@import url('font/noto-sans/font.css');
@import url('font/kyooshi-gothic/font.css');
@import url('font/anisa-sans/font.css');
@import url('font/motoya/font.css');
@import url('font/meiryo/font.css');

html,
body {
    height: 100%;
    max-height: 100%;
    /* min-height: 100%; */
    overflow: hidden;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    touch-action: manipulation;
}

body {
    /* line-height: 30px; */
    background-color: #F4F5F6;
    background-color: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#lhc_livechat {
    height: 100%;
    overflow: hidden;
    /* height: 100%; */
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    width: 100%;
    flex-grow: 1;
    overflow: hidden;
    display: -ms-flexbox;
    display: flex;
    /* height: calc(100% - 40px); */
}

.chat-wrapper {
    flex-grow: 1;
    overflow: hidden;
    border-right: 1px solid #D9D9D9;
    position: relative;
    background-color: white;
    display: flex;
    flex-direction: column;
}

.chat-message-container {
    flex-grow: 1;
    width: 100%;
    padding: 0 20px;
    overflow-y: auto;
    overflow-y: overlay;
    -ms-overflow-y: scroll;
}

.chat-message-container::-webkit-scrollbar {
    width: 5px;
}

.chat-message-container::-webkit-scrollbar-thumb {
    background: #7FAED9;
    border-radius: 4px;
}

.chat-messages {
    margin-top: 40px;
}

.chat-input-container {
    background: #FFFFFF;
    width: 100%;
    padding: 14px 16px;
    border-top: 1px solid #D8DEE9;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
}

.chat-input-buttons {
    display: inline-block;
    /* display: none; */
    flex-shrink: 0;
    margin-right: 8px;
}

.chat-input-buttons button {
    border: 1px solid #BFBFBF;
    background-color: transparent;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    outline: none;
}

.ChatMessageFeedback {
	float: left;
	margin-top: 12px;
	margin-left: 106px;
	clear: both;
	font-size: 0.8em;
}

.mobile-menu-btn {
    background: url('../img/mobile-menu.svg') 50% 50% no-repeat;
    display: none;
}

.mobile-menu-opened .mobile-menu-btn {
    background: url('../img/mobile-menu-active.svg') 50% 50% no-repeat;
}

body:not(.mobile) .voice-input-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 360px;
    height: 360px;
    background-color: white;
    z-index: 100;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

body:not(.mobile).voice-input-opened .voice-input-panel {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s;
    padding-top: 60px;
}

.voice-input-close-btn {
    background: url('../img/close-circle.svg') no-repeat;
    width: 25px;
    height: 25px;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
}

.voice-input-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.voice-input-txt {
    position: absolute;
    text-align: center;
    top: 54px;
    left: 0;
    color: #BFBFBF;
    font-size: 18px;
    width: 100%;
    padding: 0 20px;
}

.voice-input-error {
    color: #F57F17;
}

.voice-input-panel-btn {
    background: url('../img/voice-input.svg') 50% 50% no-repeat;
}

.voice-input-opened .voice-input-panel-btn {
    background: url('../img/voice-input-active.svg') 50% 50% no-repeat;
}

.waveform-base {
    border: 0;
    background-color: rgba(34, 150, 243, 0.30);
    height: 1px;
    width: 100%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    left: 0;
}

#waveform-container {
    width: 100%;
    position: absolute;
    margin-top: 2px;
    opacity: 0.4;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.chat-input-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input-form>input {
    vertical-align: middle;
}

.chat-input-form .txt_input {
    resize: none;
    height: 42px;
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.4;
    color: #333A4D;
    border: 1.5px solid #D8DEE9;
    border-radius: 8px;
    background: #FAFBFD;
    outline: none;
    box-shadow: none;
    overflow-y: hidden;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
}

.chat-input-form .txt_input::placeholder {
    color: #8B93A7;
}

.chat-input-form .txt_input:focus {
    border-color: #4DA896;
    box-shadow: 0 0 0 3px rgba(77, 168, 150, 0.12);
    background: #fff;
}

.chat-input-form .btn_send {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B4590, #4A7EC7) !important;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(43, 69, 144, 0.28);
    transition: opacity 0.2s, box-shadow 0.2s, transform 0.15s;
    outline: none;
    -webkit-appearance: none;
}

.chat-input-form .btn_send svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    transform: translateX(1px);
}

.chat-input-form .btn_send:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(43, 69, 144, 0.38);
    transform: scale(1.07);
}

.top {
    position: relative;
    height: 60px;
    min-height: 60px;
    line-height: 60px;
    padding-right: 20px;
    padding-left: 40px;
    /* 背景色由 #2296F3 調整為 #2b4590（2026-06-01） */
    /* background: #2296F3; */
    background: #2b4590;
}

/* webchat-interface.jsp 執行期會 append <style>.top { background: #XXXXXX !important }</style>（租戶後台主題色），
   注入時機在 custom.css 之後又帶 !important，會蓋過上方 .top 的 background。
   用更高 specificity (#lhc_livechat .top) + !important 強制覆蓋為品牌 navy（2026-06-01）。 */
#lhc_livechat .top {
    background: #2b4590 !important;
}

.top-avatar {
	max-width: 30px;
    max-height: 30px;
}

@media screen and (min-width:800px){
    .top-avatar {
		max-width: 50px;
	    max-height: 50px;
	}
}

/* 舊樣式：公司名稱緊鄰 logo（已用下方新排版取代，暫時保留以利回溯）
.top-logo span {
    margin-left: 12px;
    font-size: 20px;
    color: white;
    vertical-align: middle;
}
*/

/* 新排版：參考 前台頁面.html navbar-brand 樣式，logo 白底容器 + 分隔線 + 副標題 */
.top-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    vertical-align: middle;
    line-height: normal;
}

.top-logo .logo-box {
    background: #fff;
    border-radius: 7px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
}

/* 在 .logo-box 內，固定圖片高度以呼應參考排版（覆蓋 .top-avatar 既有的 max-width/max-height） */
.top-logo .logo-box .top-avatar {
    max-width: none;
    max-height: none;
    height: 32px;
    width: auto;
    display: block;
}

.top-logo .navbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.3);
}

.top-logo .navbar-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75) !important;
    letter-spacing: 0.5px;
}

.top-banner {
    background: linear-gradient(90deg, #eef2fb, #E0F4F1) !important;
    font-size: 16px;
    color: #7F7F7F;
    height: 0;
    border-bottom: 1px solid #D8DEE9;
    padding: 0 16px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: min-height 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
    /* 子元素不換行；浮在 .overlay (z-index:99) 之上，確保關閉按鈕可點 */
    flex-wrap: nowrap;
    position: relative;
    z-index: 100;
}

.top-banner.show {
    height: auto;
    padding: 8px 16px;
    /* webchat-interface.jsp 會動態注入 .top-banner { display: block !important }，
       需用更高特異性 (.top-banner.show) + !important 才能蓋過，確保 flex 排版生效 */
    display: flex !important;
}

.top-banner-text {
    flex: 1;
    font-size: 12.5px;
    color: #2B4590;
    line-height: 1.6;
    /* flex item 預設 min-width: auto 會被內容撐爆，造成兄弟元素換行；設 0 才能真正收縮 */
    min-width: 0;
}

.top-banner a {
    font-size: inherit;
    color: #2B4590;
    font-weight: 700;
    text-decoration: underline;
}

.top-banner img {
    margin-right: 10px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
}

.top-banner-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-left: 10px;
    padding: 0;
    background: rgba(43, 69, 144, 0.1);
    border: none;
    border-radius: 50%;
    color: #2B4590;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    transition: background 0.18s, color 0.18s;
}

.top-banner-close:hover {
    background: #2B4590;
    color: #fff;
}


/*==============================================
    MENU STYLES    
    =============================================*/

.sidebar-wrapper {
    width: 400px;
    background: #F4F6FA;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    /* 收合動畫：只用 transform 向右滑出 + width 同步收 0 讓聊天區擴展，無 fade */
    transform: translateX(0);
    transition: transform 0.3s ease, width 0.3s ease;
}

/**
 * 側邊選單收合狀態：向右滑出 + 寬度收 0
 * 由 .btn_open / .btn_close 按鈕的 click handler 透過 addClass/removeClass 控制
 */
.sidebar-wrapper.collapsed {
    transform: translateX(100%);
    width: 0;
}

.sidebar {
    flex: 1;
    width: auto;
    margin: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    box-sizing: border-box;
    overflow-y: auto;
}

.sidebar .tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    background: #fff;
    border-bottom: 2px solid #D8DEE9;
}

.sidebar .tab {
    font-size: 14px;
    color: #8B93A7;
    padding: 15px 22px;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.sidebar .tab:hover {
    color: #2B4590;
}

.sidebar .tab.active {
    color: #2B4590;
    font-weight: 700;
}

.sidebar .tab.active:after {
    content: '';
    display: block;
    height: 2.5px;
    position: absolute;
    bottom: -2px;
    right: 0;
    left: 0;
    background: linear-gradient(90deg, #4DA896, #4A7EC7);
    border-radius: 2px 2px 0 0;
}

.sidebar .tab-content-container {
    overflow: hidden;
}

.tab-content {
    display: none;
    margin-bottom: 40px;
}

.tab-content.active {
    display: block;
}

.tab-content section {
    margin-bottom: -18px;
    padding: 0 20px;
    position: relative;
}

.tab-content section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #2B4590;
    margin: 20px 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-content section h4::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #4DA896, #4A7EC7);
    border-radius: 2px;
    flex-shrink: 0;
}

.icon-block-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.icon-block-container a {
    outline: none;
}

.icon-block-container a:hover,
.icon-block-container a:focus {
    text-decoration: none;
}

.icon-block {
    background: #fff;
    border: 1.5px solid #D8DEE9;
    border-radius: 10px;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
    overflow: hidden;
}

.icon-block:hover {
    box-shadow: 0 4px 14px rgba(43, 69, 144, 0.14);
    border-color: #4DA896;
    transform: translateY(-2px);
}

.icon-block > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 8px 14px;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.icon-block img {
    width: 50px;
    height: 50px;
    display: block;
}

.icon-block span {
    font-size: 12.5px;
    color: #2B4590;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #D8DEE9;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.hot-item:hover {
    box-shadow: 0 4px 14px rgba(43, 69, 144, 0.14);
    border-color: #4DA896;
    transform: translateY(-1px);
    text-decoration: none;
}

.hot-item-num {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B4590, #4A7EC7);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hot-item-text {
    font-size: 13px;
    color: #2B4590;
    font-weight: 500;
    line-height: 1.45;
}

.text-link-container {
    padding-left: 26px;
}

.question-clickable {
    color: #2296F3;
    font-size: 16px;
    cursor: pointer;
}

/* 圖卡預設選項按鈕 hover 樣式（2026-06-01）
   button 的基本樣式以 inline style 設定，inline 優先級高於外部 CSS，
   故 hover 需加 !important 才能覆蓋 inline 的 background/color。
   限定 button.question-clickable，避免影響舊的 <li class="question-clickable"> 選項。 */
button.question-clickable:hover {
    background: #2B4590 !important;
    color: #fff !important;
}

.hover-content {
    display: none;
    opacity: 0;
    z-index: 1;
    width: 0;
    transition: opacity 1s, width 1s;
    border-bottom: 1px dashed #999;
    margin-left: 3px;
    margin-right: 15px;
}

.hover-container:hover .hover-content {
    display: inline-block;
    opacity: 1;
    width: auto;
}

.badge.question-clickable {
    color: black;
    font-size: 16px;
    cursor: pointer;
}

.slide-indicator-container {
    position: absolute;
    display: none;
    height: 20px;
    width: 100%;
    text-align: center;
    /* background-color: red; */
    margin-top: -10px;
}

.slide-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 1px;
    background-color: #c0c0c0;
}

.slide-indicator.active {
    background-color: darkslategray;
}

.voice-input-btn {
    height: 100px;
    width: 100px;
    border-radius: 50%;
    text-align: center;
    line-height: 100px;
    z-index: 99;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

.voice-input-btn.active {
    background-color: rgba(34, 150, 243, 0.05);
}

.voice-input-btn img {
    /* height: 50px; */
    /* width: 50px; */
    pointer-events: none;
    height: 60%;
}

.tabs {
	display: flex;
	border-bottom: 2px solid var(--border);
	background: #fff;
}

/*==============================================
    DASHBOARD STYLES    
    =============================================*/

.div-square {
    padding: 5px;
    border: 3px double #e1e1e1;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    margin: 5px;
}

.div-square>a,
.div-square>a:hover {
    color: #808080;
    text-decoration: none;
}

.icon-wrap {
      width: 50px; height: 50px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
      background: linear-gradient(135deg, #EEF2FB, #E0F4F1);
 }

/* 鎖死 SVG 圖示為 32x32（對齊 前台頁面.html .menu-item .icon-wrap svg 設定）
   未設 width/height 時 SVG 會 intrinsic-size 填到父容器 50x50，導致看起來比較大 */
.icon-block .icon-wrap svg {
    width: 32px;
    height: 32px;
    display: block;
    flex-shrink: 0;
}


/*==============================================
    FOOTER STYLES     
    =============================================*/

.footer {
    background-color: #3891F9;
    width: 100%;
    color: #fff;
    padding: 20px 50px 20px 50px;
    padding-left: 20px;
}

.footer>a,
.footer>a:hover {
    color: #fff;
}

.avatar-wrapper {
    position: absolute;
}

.robot-avatar {
    width: 72px;
    height: 72px;
}

.message-datetime {
    margin-left: 106px;
    float: left;
    color: #BFBFBF;
    font-size: 14px;
    margin-top: 8px;
    line-height: 14px;
    clear: both;
}

.by-user .message-datetime {
    margin-right: 20px;
    float: right;
}

.message-row .msg {
    border-radius: 12px;
    background-color: #F0F0F0;
    color: #4C4C4C;
    font-size: 16px;
    padding: 10px 20px;
    line-height: 1.5em;
    word-break: break-word;
    word-wrap: break-word;
    margin-left: 86px;
    float: left;
}

.message-row .msg img {
    display: block;
    max-width: 100%;
}

.message-row.by-user {
    float: right;
}

.message-row.by-user .msg {
    background-color: #CAE6FC;
    float: right;
    white-space: pre-wrap;
}

.col-lg-12 {
    padding-left: 0px;
    padding-right: 0px;
}

button.btn_open,
button.btn_close {
    position: absolute;
    top: 50%;
    /* 右間距由 80px 調整為 40px（減半） */
    right: 20px;
    transform: translateY(-50%);
    padding: 7px 9px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    box-shadow: none;
    transition: background 0.2s, border-color 0.2s;
}

button.btn_open:hover,
button.btn_close:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.5);
}

button.btn_open svg,
button.btn_close svg {
    width: 20px;
    height: 20px;
}

button.btn_help {
    width: 36px;
    height: 36px;
    position: absolute;
    top: 50%;
    right: 40px;
    margin-top: -18px;
    border: 0;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    /* float: right; */
    background: url(../img/help.svg) 0 0 no-repeat;
    background-position: 50% 50%;
    background-size: 24px 24px;
}

.tooltip-inner {
    padding: 10px;
    width: 260px;
    max-width: 350px;
    text-align: left;
    background: rgba(64, 64, 64, 0.85);
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.20);
    border-radius: 6px;
    font-size: 14px;
    color: #FFFFFF;
}

.tooltip.bottom .tooltip-arrow {
    border-bottom-color: rgba(64, 64, 64, 0.85);
}

@keyframes inputbox-anim {
    0% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(-8px);
    }
}

@keyframes inputbox-float-anim {
    100% {
        transform: translateY(-8px);
    }
}

@keyframes grid-icon-anim {
    0% {
        transform: translateX(-8px);
    }
    50% {
        transform: translateX(-4px);
    }
    100% {
        transform: translateX(-8px);
    }
}

@keyframes grid-icon-float-anim {
    100% {
        transform: translateX(-8px);
    }
}

.tip {
    position: absolute;
    display: inline-block;
    z-index: 100;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0);
    transform: translateZ(0);
}

.tip.animated {
    animation-duration: .3s, 1.5s;
    animation-timing-function: ease-out, ease-in-out;
    animation-delay: .3s, .3s;
    animation-iteration-count: 1, infinite;
    animation-direction: normal, alternate;
    animation-fill-mode: forwards;
}

.grid-icon-tip {
    position: fixed;
    right: 420px;
}

.grid-icon-tip:after {
    bottom: calc(50% - 6px);
    right: -12px;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
    border-left-color: #4C4C4C;
    /* border-left-color: red; */
    border-width: 6px;
}

.inputbox-tip {
    top: -65px;
    left: calc(50% - 190px);
}

.inputbox-tip:after {
    bottom: -12px;
    left: calc(50% - 6px);
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
    border-top-color: #4C4C4C;
    border-width: 6px;
}

.overlay {
    position: absolute;
    width: 100vw;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.overlay.active {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s;
}

.tip-highlight {
    background: rgba(34, 150, 243, 0.20);
    border: 2px solid #FFF;
    position: absolute;
    z-index: 100;
}

.grid-icon-tip-highlight {
    width: 108px;
    height: 108px;
    border-radius: 4px;
}

.inputbox-tip-highlight {
    border-radius: 4px;
    width: calc(100% - 80px);
    height: 50px;
    left: 40px;
}

.tip-content {
    background-color: #4C4C4C;
    border-radius: 4px;
    color: white;
    font-size: 16px;
    padding: 10px 20px;
    font-weight: 300;
    line-height: 1.6em;
}

.grid-icon-tip-content {
    width: 270px;
}

.inputbox-tip-content {
    width: 420px;
}

.skip-tips-btn {
    background: transparent;
    padding: 1px 20px;
    border: 2px solid #FFFFFF;
    border-radius: 8px;
    font-size: 20px;
    line-height: 36px;
    color: #FFFFFF;
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    cursor: pointer;
    pointer-events: auto;
}

.tutorial-1 {
    display: none;
    opacity: 0;
}

.tutorial-2 {
    display: none;
    opacity: 0;
}

.tutorial-1.active {
    display: inline-block;
    opacity: 1;
    transition: opacity 1s linear;
}

.tutorial-2.active {
    display: inline-block;
    opacity: 1;
    transition: opacity 1s linear;
}

.itri-tooltip {
    position: absolute;
    display: none;
    width: 114px;
    height: auto;
    background: #4C4C4C;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.20);
    border-radius: 4px;
    font-size: 14px;
    line-height: 20px;
    color: #FFFFFF;
    top: 50%;
    margin-top: 24px;
    right: 30px;
    padding: 10px 15px;
    z-index: 1;
}

button.btn_help:hover+.itri-tooltip {
    display: inline-block;
}

button.btn_open:hover+.itri-tooltip-open, button.btn_close:hover+.itri-tooltip-close {
    display: inline-block;
    /* 按鈕右間距改為 40px 後，tooltip 對應從 70px 調整為 30px 避免錯位 */
    right: 30px;
}

.itri-tooltip-open, .itri-tooltip-close {
    position: absolute;
    display: none;
    width: 114px;
    height: auto;
    background: #4C4C4C;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.20);
    border-radius: 4px;
    font-size: 14px;
    line-height: 20px;
    color: #FFFFFF;
    top: 50%;
    margin-top: 24px;
    right: 30px;
    padding: 10px 15px;
    z-index: 1;
}

.itri-tooltip:after, .itri-tooltip-open:after, .itri-tooltip-close:after {
    bottom: 100%;
    right: 22px;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
    border-color: rgba(136, 183, 213, 0);
    border-bottom-color: #4C4C4C;
    border-width: 6px;
}

.message-row {
    position: relative;
    margin-bottom: 40px;
    overflow: hidden;
    clear: both;
}

.message-row a {
    color: #2296F3;
    font-size: inherit;
    cursor: pointer;
}

.message-row a:hover {
    color: #71B1F7;
    text-decoration: none;
}

.message-row.by-robot {
    min-height: 50px;
}

.message-row.by-robot .msg {
    margin-right: 80px;
}

.message-row.by-robot.swiper {
    margin-right: -20px;
}

.swiper .buttons-message-container {
    /* 輪播兩端去除空白（2026-06-01）
       原 padding-right: 316px 會讓捲到最右時留下大片空白；
       基底 .buttons-message-container 的 margin-left: 86px 則在最左留白。
       改為左右皆 0，讓第一／最後一張卡片貼齊泡泡內緣（仿 前台頁面.html 兩端不留白）。
       捲到底時瀏覽器會在 scrollWidth - clientWidth 自動夾住，最後一張卡片右緣即停。 */
    /* padding-right: 84px; */
    /* padding-right: 316px; */
    margin-left: 0;
    padding-right: 0;
}

.buttons-message-container {
    /*margin-left: 86px;*/
    float: left;
    display: -ms-flexbox;
    display: flex;
    overflow: visible;
}

.chat-messages .message-row.by-robot:not(.swiper) .bubble:has(.buttons-message-container) {
    padding: 0;
}

.quickreplies-container {
    margin-left: 46px;
    float: left;
    display: -ms-flexbox;
    display: flex;
    overflow: visible;
}

.buttons-message-block {
    /* 圖卡寬度由 282px 調整為 186px（2026-06-01） */
    /* width: 282px; */
    /* min-width: 282px; */
    width: 186px !important;
    min-width: 186px !important;
    padding: 10px 20px;
    border-radius: 12px;
    background-color: #F0F0F0;
    color: #4C4C4C;
    font-size: 16px;
    display: inline-block;
    /*margin-right: 14px;*/
}

.buttons-message-block:last-of-type {
    margin-right: 0;
}

/* Imagemap 卡片滿版 + 響應式寬度（2026-07-23，最大寬度由 500px 改為 360px：2026-07-27）：
   1. 移除 padding 讓圖片貼齊卡片邊緣，避免卡片扣掉左右 20px padding 造成圖片四周露出白邊
   2. 寬度改用「最多 360px，但不超過容器可用寬度」，手機等小螢幕會跟著容器縮小，避免固定寬度造成圖片被裁切/遮擋
   3. .imagemap 的 height: auto 搭配未在 <img> 標籤上寫死 width/height 屬性（見 webRM.js），
      瀏覽器會依圖片原始比例（intrinsic aspect ratio）依目前寬度自動算出高度，故寬度改變後高度會自動跟著等比例縮放
   .chat-messages .message-row .buttons-message-block（給 carousel 圖卡用，見下方 2681 行）
   width/min-width 皆為 186px !important 且選擇器有 3 層，比原本 .buttons-message-block.imagemap-block（2 層）特異度更高，
   原本靠 inline style 的 !important 蓋過去，拿掉 inline style 後這裡必須補齊同樣層級的前綴才蓋得過 */
.buttons-message-container.imagemap-container {
    width: 100%;
    max-width: 360px;
}

.chat-messages .message-row .buttons-message-block.imagemap-block {
    width: 100% !important;
    max-width: 360px !important;
    min-width: 0 !important;
    padding: 0;
    overflow: hidden;
}

.buttons-message-block.imagemap-block .imagemap {
    display: block;
    width: 100%;
    height: auto;
}

.buttons-message-block .img-wrapper {
    margin: -10px -20px;
    margin-bottom: 0;
    height: 155px;
    overflow: hidden;
    border: 1px solid #CCCCCC;
    border-radius: 12px 12px 0 0;
}

.buttons-message-block .img-wrapper img {
    width: 100%;
}

.buttons-message-block .description {
    background-color: #F0F0F0;
    color: #7F7F7F;
    margin: -10px -20px 0 -20px;
    padding: 6px 12px;
    border: 1px solid #F0F0F0;
    border-radius: 12px 12px 0 0;
    border-bottom: transparent;
    word-wrap: break-word;
}

.buttons-message-block .description:last-child {
    background-color: #F0F0F0;
    color: #7F7F7F;
    margin: -10px -20px 0 -20px;
    padding: 6px 12px;
    border: 1px solid #F0F0F0;
    border-radius: 12px 12px 12px 12px;
    word-wrap: break-word;
}

.buttons-message-block .img-wrapper + .description {
    background-color: white;
    color: #7F7F7F;
    margin: 0 -20px;
    padding: 6px 12px;
    border: 1px solid #CCCCCC;
    border-radius: 0 0 0 0;
    border-bottom: transparent;
    white-space: normal;
}

.buttons-message-block .description h4 {
    color: #4C4C4C;
    font-size: 16px;
    line-height: 22px;
    margin: 0;
}

.buttons-message-block.message-box {
	width: auto;
}

.buttons-message-block .message-box {
    background-color: #F0F0F0;
    color: #4C4C4C;
    margin: -5px -20px -5px -20px;
    padding: 6px 12px;
    border: 1px solid #F0F0F0;
    border-radius: 12px 12px 0 0;
    border-bottom: transparent;
    word-wrap: break-word;
    font-size: 16px;
}

.buttons-message-block ul {
    list-style: none;
    padding: 0;
    background-color: white;
    margin: 0 -20px -10px -20px;
    border: 1px solid #CCCCCC;
    border-top: transparent;
    border-radius: 0 0 12px 12px;
}

.buttons-message-block ul li {
    border-top: 1px solid #CCCCCC;    
    text-align: center;    
    padding: 10px 5px 10px 5px;
    width: 100%;
    white-space: normal;
}

.buttons-message-block ul li span {
    text-align: left;
    display: inline-block;
}

.form-control-round {
	margin-left: 5px;
	border: 1px solid #2d9ee0;
	border-radius: 15px !important;
	color: #2d9ee0;
	display: inline-block;
    width: auto;
}
.btns-area {
	width: 100%;
	margin: 3px;
	padding: 5px;
	border-radius: 5px;
	border: 2px solid #FFFFFF;
	background-color: #FFFFFF;
	font-size: 12pt;
	line-height: 1.5em;
	word-break: break-word;
	word-wrap: break-word;
	display: inline-block;
}
.more-area {
	width: 10%;
}
.btns-area-btn {
	border-style: solid;
	background-color: #FFFFFF;
	border: 1px solid #99FFFF;
	border-radius: 5px;
	text-align: center;
	color: #2d9ee0; 
}
.slideshow-container {
	position: relative;
	margin: auto;
}
.next {
	right: 0;
	border-radius: 1px 0 0 1px;
}
.prev:hover, .next:hover {
	color:white;
	background-color: #009d95;
}
.link-btn-img{
	width:100%;
	border-radius: 10px;
}
.link-btn-txt{
	padding:0.5em;
	color:#fff;
	text-align:left;
	white-space: pre-line;
}
.link-btn-img img {
	width:100%;
	height:100%;
}
.link-btn-block::-webkit-scrollbar { width: 0 !important; height: 0 !important } 
.link-btn-block { -ms-overflow-style: none; } 
.link-btn-block { overflow: -moz-scrollbars-none; }
	
.link-btn-block{ background:none; width:auto; height:auto; white-space:nowrap; position:relative; overflow-y:hidden; overflow-x:auto; display:-webkit-box;}
.link-btn{ width:290px; margin:3px; padding:5px; border-radius: 5px; border:2px solid #9BD2B7; background-color: #FFFFFF; font-size: 12pt; line-height: 1.5em; word-break: break-word; word-wrap: break-word;}
.prev, .next { display:block; cursor: pointer; position: absolute; top: 50%; width: auto; font-weight: bold; font-size: 18px; transition: 0.6s ease; border-radius: 0 1px 1px 0;}

/* === 舊輪播箭頭樣式（藍色實心圓 #2296F3 + background-image 箭頭）保留註解（2026-06-01）===
.swiper-control-button {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background-color: #2296F3;
    position: absolute;
    top: calc(50% - 18px);
    cursor: pointer;
    z-index: 10;
}

.swiper-control-button.prev {
    left: 34px;
    background-image: url('../img/arrow.svg');
    background-repeat: no-repeat;
    background-position: 44% 50%;
    background-size: 10px 16px;
}

.swiper-control-button.next {
    right: 40px;
    background-image: url('../img/arrow.svg');
    background-repeat: no-repeat;
    background-position: 44% 50%;
    background-size: 10px 16px;
    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    filter: FlipH;
    -ms-filter: "FlipH";
}
=== 舊樣式結束 === */

/* 新輪播箭頭樣式（2026-06-01）：對齊 前台頁面.html 的 .carousel-arrow
   白底圓鈕 + navy 邊框 + 陰影；hover 反白（navy 底 + 白箭頭）。
   箭頭圖示改用 mask（而非 background-image），讓圖示顏色由 background-color 控制，
   才能在 hover 時從 navy 變白（背景圖無法用 CSS 重新上色）。
   位置沿用舊的 left:34 / right:40（.message-row 有 overflow:hidden，無法像參考頁用 left:-16 放到外側）。 */
.swiper-control-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #D8DEE9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

/* 箭頭圖示：mask 只取 arrow.svg 形狀，顏色 = background-color（navy），故可隨 hover 變色 */
.swiper-control-button::before {
    content: "";
    width: 10px;
    height: 8px;
    background-color: #2B4590;
    -webkit-mask: url('../img/arrow.svg') no-repeat center / 10px 8px;
            mask: url('../img/arrow.svg') no-repeat center / 10px 8px;
}

.swiper-control-button:hover {
    background: #2B4590;
    border-color: #2B4590;
}

.swiper-control-button:hover::before {
    background-color: #fff;
}

.swiper-control-button.prev {
    left: 40px;
    font-size: 10px;
}

.swiper-control-button.next {
    right: 10px;
    font-size: 10px;
}

/* next 箭頭水平翻轉指向右（翻轉移到 ::before，避免與按鈕本身的 translateY 置中衝突） */
.swiper-control-button.next::before {
    -webkit-transform: scaleX(-1);
            transform: scaleX(-1);
}

.swiper-scroll-container {
    overflow-x: hidden;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-scroll-snap-type: mandatory;
    -ms-overflow-style: none;
    -ms-scroll-snap-type: mandatory;
    scroll-snap-type: mandatory;
    /* 輪播最左去除空白（2026-06-01）：原 86px 會讓 scroll-snap 後左側留 86px 空白，改 0 貼齊 */
    /* scroll-padding-left: 86px; */
    scroll-padding-left: 0;
    position: relative;
}

.swiper-scroll-container::-webkit-scrollbar {
    display: none;
}

@-moz-document url-prefix() {
    .swiper-scroll-container {
        scroll-snap-points-x: repeat(246px);
    }
}

.swiper .buttons-message-block {
    scroll-snap-align: start;
    background-color: transparent;
}

.survey-wrapper {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.survey {
    width: 517px;
    min-height: 300px;
    flex: 0 0 auto;
    margin: auto;
    border-radius: 4px;
    background-color: white;
    padding: 30px 24px;
    box-shadow: 0 2px 8px 0 rgb(153, 153, 153);
}

.survey-header {
    font-size: 14px;
    color: #7F7F7F;
    border-bottom: 1px solid #CCC;
    position: relative;
}

.survey-header h4 {
    font-size: 18px;
    font-weight: 500;
    color: #2B93FC;
    margin: 0;
}

.survey-header .close-btn {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: url('../img/close-circle.svg') 0 0 no-repeat;
    background-size: 18px 18px;
    background-position: 50% 50%;
    position: absolute;
    top: 0;
    right: 0;
    cursor: pointer;
}

.survey-header img {
    width: 75px;
    height: 75px;
    margin: 0 auto;
    display: block;
}

.survey-header p {
    margin-bottom: 30px;
}

.scale-label-container {
    color: #7F7F7F;
    font-size: 12px;
    position: relative;
    height: 14px;
    margin-top: 14px;
}

.scale-label-container span {
    position: absolute;
    right: 0;
}

.scale-label-container span:first-child {
    right: 210px;
}

.survey-question-container {
    display: flex;
    flex-wrap: wrap;
}

.survey-question {
    width: 45%;
    color: #4C4C4C;
    font-size: 14px;
    line-height: 1.6em;
    margin-top: 20px;
}

.survey-scale {
    display: flex;
    width: 55%;
    margin-top: 20px;
    align-items: center;
}

.survey-scale .scale-label {
    font-size: 12px;
    color: #7F7F7F;
    display: none;
}

.survey-scale .radio-button-wrapper {
    position: relative;
    padding: 1px;
    display: block;
    width: 16px;
    height: 16px;
    flex-grow: 1;
    text-align: center;
}

.survey-scale input[type="radio"] {
    position: absolute;
    left: calc(50% - 8px);
    width: 16px;
    height: 16px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.survey-scale .radio-button {
    position: absolute;
    left: calc(50% - 8px);
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 2px #D9D9D9;
    border: 3px solid white;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
}

.survey-scale input[type="radio"]:checked+.radio-button {
    box-shadow: 0 0 0 2px #1890FF;
    border: 3px solid white;
    background-color: #1890FF;
}

.survey .submit-button-wrapper {
    width: 100%;
    text-align: center;
}

.survey input[type="submit"] {
    border: none;
    border-radius: 4px;
    background-color: #1890FF;
    color: white;
    width: 194px;
    height: 32px;
    display: block;
    margin: 50px auto 20px auto;
    font-weight: normal;
    letter-spacing: 3px;
}

._bubble_loading__dot {
  position: relative;
  width: 8px;
  height: 8px;
  margin-right: 2px;
  display: inline-block;
  background-color: #6E6E6E;
  border-radius: 50%;
  -webkit-animation-name: lodingAni;
  animation-name: lodingAni;
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-timing-function: ease-in-out;
  animation-timing-function: ease-in-out;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite; 
}
._bubble_loading__dot--1 {
	-webkit-animation-delay: 0;
	animation-delay: 0; 
}
._bubble_loading__dot--2 {
    -webkit-animation-delay: .3s;
    animation-delay: .3s;
}
._bubble_loading__dot--3 {
    -webkit-animation-delay: .6s;
    animation-delay: .6s; 
}
@-webkit-keyframes lodingAni {
  0% {
    opacity: .2;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  50% {
    opacity: .4;
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
  }
  100% {
    opacity: .2;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
@keyframes lodingAni {
  0% {
    opacity: .2;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  50% {
    opacity: .4;
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
  }
  100% {
    opacity: .2;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

.helpful_font {
    display: inline-block;
    margin-right: 5px;
    cursor: pointer;
}

.helpful_font span {
	padding-left: 30px;
	color: #2296F3;
}

.icon-feedback {
	width: 20px;
	height: 20px;
	position: absolute;
}
/*
.icon-feedback path {
	fill: red;
}
*/

img.FormalAnswerSticker {
    max-width: 100%;
    height: auto;
}

/*==============================================
    MEDIA QUERIES     
    =============================================*/

/* 新增平板尺寸區間（801px-1023px）：
   原本 .btn_open/.btn_close right: 40px 在桌機畫面正常，但平板螢幕較窄時按鈕容易擠到 logo
   或在某些字體渲染下視覺超出。改為 right: 16px + 縮小 padding，讓按鈕更貼邊但仍可點 */
@media (max-width: 1023px) and (min-width: 801px) {
    button.btn_open,
    button.btn_close {
        right: 16px;
        padding: 5px 7px;
    }
    button.btn_open svg,
    button.btn_close svg {
        width: 18px;
        height: 18px;
    }
    button.btn_open:hover+.itri-tooltip-open,
    button.btn_close:hover+.itri-tooltip-close {
        right: 10px;
    }
}

@media (max-width: 800px) {
    .top {
        height: 40px;
        min-height: 40px;
        line-height: 40px;
        padding: 0;
    }
    .top .btn_help {
        display: none;
    }
    /* 手機保留按鈕（讓使用者仍能切換 sidebar），縮小尺寸並貼右邊避免超出螢幕 */
    .top .btn_open,
    .top .btn_close {
        right: 8px;
        padding: 4px 5px;
        border-radius: 5px;
    }
    .top .btn_open svg,
    .top .btn_close svg {
        width: 16px;
        height: 16px;
    }
    .top .btn_open:hover+.itri-tooltip-open,
    .top .btn_close:hover+.itri-tooltip-close {
        right: 2px;
    }
    .top .top-logo {
        text-align: center;
        /* 新排版為 inline-flex，小螢幕改用 justify-content 置中 */
        justify-content: center;
        gap: 10px;
    }
    /* 小螢幕縮小 logo 高度與副標題字級，避免擠到輸入區 */
    .top .top-logo .logo-box {
        padding: 3px 8px;
    }
    .top .top-logo .logo-box .top-avatar {
        height: 26px;
    }
    .top .top-logo .navbar-divider {
        height: 22px;
    }
    .top .top-logo .navbar-subtitle {
        font-size: 13px;
    }

    /* 手機保留 banner 可見，縮小內距與字級避免擠到聊天區 */
    .top-banner.show {
        padding: 6px 12px;
    }
    .top-banner-text {
        font-size: 11.5px;
        line-height: 1.5;
    }
    .top-banner-close {
        width: 20px;
        height: 20px;
        margin-left: 8px;
        font-size: 12px;
    }
    .nav-top, .nav-second {
        width: 100vw !important;
    }
    .footer {
        width: 100vw !important;
        padding: 5px 5px !important;
    }
    .main-wrapper {
        flex-direction: column;
    }
    .chat-message-container {
        padding: 0 16px;
        width: 100vw !important;
        -webkit-overflow-scrolling: touch;
    }
    .chat-messages {
        margin-top: 26px;
    }
    .robot-avatar {
        width: 48px;
        height: 48px;
    }
    .message-row.by-robot {
        /* margin-right: 62px; */
    }
    .message-row .msg {
        margin-left: 62px !important;
        padding: 5px 10px !important;
    }
    .message-row.by-robot .msg {
        margin-right: 32px !important;
    }
    /* 新架構：.bubble 在 .message-content 容器內，
       由容器本身負責與 avatar 的間距，bubble 自身 margin 歸零 */
    .chat-messages .message-row .message-content .msg {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .message-datetime {
        margin-left: 72px !important;
    }
    /*
    .buttons-message-container {
        margin-left: 62px !important;
    }
    */
    .quickreplies-container {
        margin-left: 62px !important;
    }
    .chat-input-container {
        padding: 14px 16px !important;
    }
    .mobile-menu-btn {
        display: inline-block;
    }
    .mobile-menu-opened .chat-input-container,
    .voice-input-opened .chat-input-container {
        z-index: 99;
    }
    .chat-input-buttons {
        display: inline-block;
    }
    .sidebar-wrapper {
        width: 100vw !important;
        height: 0;
        flex-shrink: 0;
        transition: height 0.3s;
        position: relative;
    }
    .mobile-menu-opened .sidebar-wrapper {
        height: 100vh;
        transition: height 0.3s;
        background-color: white;
    }
    .sidebar {
        margin: 0;
        width: 100vw !important;
        padding: 0;
    }
    .sidebar .tabs {
        padding: 0 20px;
        display: block;
        margin: 0;
    }
    .sidebar .tab {
        height: 40px;
        line-height: 40px;
        display: inline-block;
        margin-right: 10px;
    }
    .tab-content {
        margin-bottom: 0;
    }
    .slide-container {
        overflow-x: scroll;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        -webkit-scroll-snap-type: mandatory;
        -ms-scroll-snap-type: mandatory;
        scroll-snap-type: mandatory;
        /* older spec implementation */
        -webkit-scroll-snap-destination: 0% 100%;
        -ms-scroll-snap-destination: 0% 100%;
        scroll-snap-destination: 0% 100%;
        -webkit-scroll-snap-points-x: repeat(100%);
        -ms-scroll-snap-points-x: repeat(100%);
        scroll-snap-points-x: repeat(100%);
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 0;
    }
    .sidebar section {
        display: inline-block;
        width: 100%;
        vertical-align: top;
        scroll-snap-align: start;
        padding: 0 20px;
        margin-bottom: 20px;
    }
    .icon-block-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-flow: row;
        grid-gap: 14px;
    }
    .icon-block {
        margin: 0;
        width: auto;
        /* 改用 min-height：文字換行時容器可隨內容增高，避免固定 height 搭配上層 overflow:hidden 把換行後的文字遮住 */
        min-height: 90px;
        padding: 4px;
    }
    .icon-block img {
        width: 50px;
        height: 50px;
        display: block;
        margin: 0 auto;
    }
    .slide-indicator-container {
        display: block;
    }
    .voice-input-panel {
        width: 100vw;
        height: 0;
        flex-shrink: 0;
        transition: height 0.3s;
    }
    .voice-input-opened .voice-input-panel {
        height: 160px;
        transition: height 0.3s;
        background-color: white;
    }
    .voice-input-close-btn {
        display: none;
    }
    .survey {
        width: calc(100vw - 64px);
        padding: 20px 16px;
    }
    .survey-header p {
        margin-bottom: 12px;
        line-height: 1.6em;
    }
    .survey .scale-label-container {
        display: none;
    }
    .survey-question {
        width: 100%;
    }
    .survey-scale {
        width: 100%;
        margin-top: 12px;
    }
    .survey-scale .scale-label {
        display: block;
    }
    .survey input[type="submit"] {
        height: 42px;
        margin: 30px auto 0 auto;
        letter-spacing: 3px;
    }
    .message-row.by-robot.swiper {
        margin-right: -16px;
    }
    .swiper .buttons-message-container {
        /*padding-right: 16px;*/
    }
    .ChatMessageFeedback {
		margin-left: 72px;
	}
}

/*==============================================
    新對話框樣式（參考 前台頁面.html）
    使用更高 specificity 覆蓋舊樣式，舊規則保留以利回溯
    =============================================*/

/* 訊息列：機器人靠左、使用者靠右；用 flex 取代舊 float 排版 */
.chat-messages .message-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    /*底部空間經實測比直接拿掉margin-bottom還要少*/
    margin-bottom: 0px;
    margin-top: 10px;
    float: none;
    clear: both;
}

.chat-messages .message-row.by-user {
    justify-content: flex-end;
}

/* 機器人頭像：圓形邊框白底 */
.chat-messages .message-row.by-robot .avatar-wrapper {
    /* 覆蓋舊 .avatar-wrapper { position: absolute }，否則頭像會脫離 flex 流並覆蓋對話框 */
    position: static;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: none;
    border: 2px solid #7FAED9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(74, 126, 199, 0.2);
    overflow: hidden;
    padding: 0;
    margin: 0;
    float: none;
}

.chat-messages .message-row.by-robot .avatar-wrapper .robot-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: none;
    max-height: none;
    margin: 0;
}

/* 訊息內容容器：泡泡 + 時間/回饋 垂直堆疊 */
.chat-messages .message-row .message-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: calc(100% - 80px);
    min-width: 0;
}

.chat-messages .message-row.by-user .message-content {
    align-items: flex-end;
}

/* 機器人泡泡：淺灰底、深色文字 */
.chat-messages .message-row.by-robot .bubble {
    background: #F4F6FA;
    border: 1px solid #D8DEE9;
    border-radius: 4px 14px 14px 14px;
    font-size: 14.5px;
    color: #333A4D;
    max-width: 360px;
    line-height: 1.65;
    display: inline-block;
    margin: 0;
    float: none;
    text-align: left;
    word-wrap: break-word;
}

/* 純文字訊息才加 padding
   .message-row 非 .swiper（即純文字訊息，不含任何圖卡）才命中此規則 */
.chat-messages .message-row.by-robot:not(.swiper) .bubble {
    padding: 11px 16px;
}

/* 單卡（非輪播、非 imagemap）圖文卡片（如 buttons 模板推薦問題清單）：比照下方 .swiper／imagemap 的響應式作法（2026-07-27）：
   1. .message-content 改為 flex-grow 撐滿可用寬度，讓它有「真正的」定值寬度（依聊天面板實際寬度而非文字內容決定），
      底下 .bubble / .buttons-message-container / .buttons-message-block 的 width:100% 才能正確依這個定值往下解析，
      否則 width:100% 在一整條都只有 max-width（沒有任何一層是 flex-grow/定值寬）的鏈路下，會退化成「依內容縮放」（shrink-to-fit），
      螢幕夠寬時也不會長到 360px，這也是為什麼前一版「文字短的卡片比較窄」的原因。
   2. 泡泡 padding 歸零、width:100%、max-width:360px：讓白卡貼齊泡泡邊緣，寬螢幕預設長到 360px、窄螢幕（手機）跟著面板縮小。
   用 :has(> .buttons-message-container:not(.imagemap-container)) 精準鎖定「直接子層是圖文卡容器、且不是 imagemap」的泡泡，
   不影響純文字泡泡（上面的 padding: 11px 16px 規則）與 imagemap 泡泡（已有自己專屬的 :has(.imagemap-container) 規則）。 */
.chat-messages .message-row.by-robot:not(.swiper):has(> .message-content > .bubble > .buttons-message-container:not(.imagemap-container)) .message-content {
    flex: 1 1 auto;
    width: 100%;
}

.chat-messages .message-row.by-robot:not(.swiper) .bubble:has(> .buttons-message-container:not(.imagemap-container)) {
    padding: 0;
    width: 100%;
    max-width: 360px;
}

/* 含圖卡（含輪播、單張卡）時放寬機器人泡泡寬度（2026-06-01，2026-07-22 擴及單張卡）
   判定依據：只要訊息含圖卡（LINE/Messenger/Google/Teams 各式 template 或 hero card），
   不論卡片數量，webRM.js 都會在 .message-row 加上 .swiper class；
   左右切換按鈕與輪播指示點才是依卡片數 > 1 才建立，用來控制「是否可滑動」，與泡泡外觀無關。
   作法：讓 .message-content 撐滿可用空間、泡泡解除 360px 上限，最終由 .message-content 的
        max-width: calc(100% - 60px) 自動收斂（寬螢幕露多張、窄螢幕自動縮）。
   純文字訊息不受影響，仍維持上方 .by-robot .bubble 的 360px。
   specificity（5 個 class）高於 .by-robot .bubble（4 個 class），故能覆蓋。 */
.chat-messages .message-row.by-robot.swiper .message-content {
    flex: 1 1 auto;
    width: 100%;
}

.chat-messages .message-row.by-robot.swiper .bubble {
    max-width: none;
    width: 100%;
    /* 含圖卡時，bubble 改為透明容器：背景同聊天底色、去除邊框與內距 */
    background: transparent;
    border: none;
    padding: 0;
}

/* imagemap 訊息不是多卡片輪播，webRM.js 不會幫它加上 .swiper class，
   因此套用不到上面 .swiper 版本解除 360px 上限的規則，改用 :has() 精準鎖定「含 imagemap 卡片」的泡泡，
   只影響 imagemap，不影響其他訊息類型（2026-07-23）：
   1. 解除 360px 上限，寬度撐滿讓 imagemap-container 決定實際寬度
   2. 泡泡背景/邊框比照 .swiper 版本改透明，避免 imagemap-block 自己的白底/邊框/陰影外面
      又包一層灰底/邊框，造成雙層框視覺 */
.chat-messages .message-row.by-robot:has(.imagemap-container) .message-content {
    flex: 1 1 auto;
    width: 100%;
}

.chat-messages .message-row.by-robot:has(.imagemap-container) .bubble {
    max-width: none;
    width: 100%;
    background: transparent;
    border: none;
}

/* 輪播指示點（對齊 前台頁面.html .carousel-dots / .dot 樣式） */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.carousel-dots .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #D8DEE9;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.carousel-dots .dot.active {
    background: #2B4590;
    transform: scale(1.25);
}

/* 使用者泡泡：藍色漸層、白字
   加 !important 防 webchat-interface.jsp 動態注入的 background !important 覆蓋
   （tenant 後台若設定 .by-user .msg 之類的 background，會被 jQuery 動態 append <style> 帶 !important） */
.chat-messages .message-row.by-user .bubble.user-bubble {
    background: linear-gradient(135deg, #2B4590, #4A7EC7) !important;
    background-color: transparent !important;
    color: #fff;
    border: none;
    border-radius: 14px 4px 14px 14px;
    padding: 11px 16px;
    font-size: 14.5px;
    max-width: 340px;
    line-height: 1.65;
    box-shadow: 0 2px 8px rgba(43, 69, 144, 0.25);
    display: inline-block;
    margin: 0;
    float: none;
    text-align: left;
    word-wrap: break-word;
}

/* msg-footer：時間戳 + 回饋按鈕，flex 排成一列 */
.chat-messages .message-row .msg-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-left: 2px;
    margin: 0;
}

.chat-messages .message-row.by-user .msg-footer {
    justify-content: flex-end;
}

/* 時間戳：覆蓋舊 .message-datetime float 與 margin */
.chat-messages .message-row .msg-footer .timestamp,
.chat-messages .message-row .msg-footer .message-datetime {
    font-size: 11px;
    color: #8B93A7;
    margin: 0;
    line-height: 1;
    float: none;
    display: inline-block;
}

/* 回饋按鈕：純 SVG button，hover 變藍底 */
.chat-messages .message-row .feedback-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    color: #8B93A7;
    /* 用 inline-flex 而非 flex；display: flex 會讓 button 變 block-level，導致兩按鈕垂直堆疊 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s, background 0.18s;
    line-height: 1;
    vertical-align: middle;
}

.chat-messages .message-row .feedback-btn:hover {
    color: #2B4590;
    background: #EEF2FB;
}

.chat-messages .message-row .feedback-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

/* 已選滿意：綠底白字 */
.chat-messages .message-row .feedback-btn.active-up {
    color: #fff;
    background: #4DA896;
    border-radius: 4px;
}

/* 已選不滿意：紅底白字 */
.chat-messages .message-row .feedback-btn.active-down {
    color: #fff;
    background: #D64545;
    border-radius: 4px;
}

.chat-messages .message-row .feedback-btn svg {
    width: 13px;
    height: 13px;
}

/* feedback-template 在 msg-footer 內並排（覆蓋舊 .ChatMessageFeedback float 與 margin）
   clone 後 .feedback-template class 被 removeClass 移除，但 .ChatMessageFeedback 仍保留 */
.chat-messages .message-row .feedback-template,
.chat-messages .message-row .feedback-actions,
.chat-messages .message-row .ChatMessageFeedback,
.chat-messages .message-row .msg-footer .ChatMessageFeedback {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    float: none;
    font-size: inherit;
    clear: none;
    /* 強制不換行：兩個 button 必須並排 */
    flex-wrap: nowrap;
    flex-direction: row;
}

/* 確保 msg-footer 內所有 flex item 不換行 */
.chat-messages .message-row .msg-footer {
    flex-wrap: nowrap;
}

.chat-messages .message-row .feedback-thank-text {
    font-size: 11px;
    color: #4DA896;
    margin-left: 4px;
}

/*==============================================
    不滿意意見 Popup 樣式（參考 前台頁面.html）
    =============================================*/
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.popup-overlay.open {
    display: flex;
}

.popup-box {
    background: #fff;
    border-radius: 14px;
    width: 92%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(43, 69, 144, 0.22);
    overflow: hidden;
    animation: popInFeedback 0.22s ease;
}

@keyframes popInFeedback {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.popup-header {
    background: linear-gradient(135deg, #2B4590, #4A7EC7);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.popup-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.popup-body {
    padding: 20px;
}

.popup-step-prompt {
    font-size: 13px;
    color: #8B93A7;
    margin-bottom: 14px;
}

.popup-step {
    display: none;
}

.popup-step.active {
    display: block;
}

.reason-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #D8DEE9;
    border-radius: 9px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    user-select: none;
}

.reason-option:hover {
    border-color: #4A7EC7;
    background: #F4F6FA;
}

.reason-option.selected {
    border-color: #2B4590;
    background: #EEF2FB;
}

.reason-option input[type="radio"] {
    display: none;
}

.reason-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #D8DEE9;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s;
}

.reason-option.selected .reason-radio {
    border-color: #2B4590;
}

.reason-option.selected .reason-radio::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2B4590;
}

.reason-label {
    font-size: 14px;
    color: #333A4D;
}

.popup-textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 14px;
    border: 1.5px solid #D8DEE9;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    color: #333A4D;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 14px;
    background: #fff;
}

.popup-textarea:focus {
    border-color: #4DA896;
    box-shadow: 0 0 0 3px rgba(77, 168, 150, 0.12);
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.popup-btn {
    padding: 9px 22px;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.popup-btn.secondary {
    background: #fff;
    border: 1.5px solid #D8DEE9;
    color: #8B93A7;
}

.popup-btn.secondary:hover {
    border-color: #2B4590;
    color: #2B4590;
}

.popup-btn.primary {
    background: linear-gradient(135deg, #2B4590, #4A7EC7);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(43, 69, 144, 0.25);
}

.popup-btn.primary:hover {
    opacity: 0.88;
}

.popup-btn.primary:disabled {
    opacity: 0.45;
    cursor: default;
}

.popup-success {
    text-align: center;
    padding: 10px 0 6px;
}

.popup-success .check-icon {
    width: 52px;
    height: 52px;
    background: #E6F7F3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.popup-success .check-icon svg {
    width: 28px;
    height: 28px;
    color: #4DA896;
}

.popup-success p {
    font-size: 15px;
    color: #333A4D;
    font-weight: 600;
    margin-bottom: 6px;
}

.popup-success small {
    font-size: 13px;
    color: #8B93A7;
}

/*==============================================
    側邊選單 RWD 修正（參考 前台頁面.html overlay 模式）
    桌機（≥ 1024px）維持 flex item 佔流模式；
    平板與手機（≤ 1023px）改為 position: fixed 浮動 overlay，疊在主內容上方，
    避免 sidebar 被 flex 排版擠出螢幕導致展開時看不見。
    本區段刻意放在檔案末端，靠 source order 蓋過既有 max-width: 800px 內的舊 sidebar 規則。
    =============================================*/

/* 平板 + 手機（≤ 1023px）：sidebar 改為 fixed overlay 模式 */
@media (max-width: 1023px) {
    .sidebar-wrapper {
        position: fixed !important;
        /* 對應桌機尺寸 .top 高度 60px，下方手機尺寸再蓋成 40px */
        top: 60px;
        right: 0;
        bottom: 0;
        width: 320px !important;
        /* 取消舊 RWD 的 height: 0；改用 auto 讓 fixed 撐到 bottom: 0 */
        height: auto !important;
        z-index: 200;
        box-shadow: -4px 0 24px rgba(43, 69, 144, 0.18);
        transform: translateX(0);
        transition: transform 0.3s ease;
        overflow: hidden;
        background: #F4F6FA;
        opacity: 1;
    }

    /* 收合狀態：向右滑出 110% 確保完全離開視窗（多 10% 避免子像素縫隙） */
    .sidebar-wrapper.collapsed {
        transform: translateX(110%) !important;
        width: 320px !important;
        height: auto !important;
    }

    /* 既有 sidebar 內部 .sidebar / .tabs / section 在小螢幕有特殊樣式，
       overlay 模式下要讓 sidebar 滿父層高度且可滾動 */
    .sidebar-wrapper .sidebar {
        width: 100% !important;
        height: 100%;
        overflow-y: auto;
    }
}

/* 手機（≤ 800px）：對應 .top 縮為 40px，sidebar top 也要調整 */
@media (max-width: 800px) {
    .sidebar-wrapper {
        top: 40px !important;
    }
}

/* 小型手機（≤ 639px）：sidebar 改全寬，符合 前台頁面.html 手機行為 */
@media (max-width: 639px) {
    .sidebar-wrapper {
        width: 100% !important;
    }
    .sidebar-wrapper.collapsed {
        width: 100% !important;
    }
}

/*==============================================
    小螢幕 sidebar tabs 文字置中修正
    既有 max-width: 800px RWD 用 .sidebar .tab { display: inline-block; line-height: 40px }，
    inline-block 的 baseline gap 與 white-space 縫隙會讓 tab 文字下移、甚至被外層遮住。
    改用 flex 雙層置中（容器 flex + 每個 tab flex），文字穩定垂直水平居中。
    =============================================*/
@media (max-width: 1023px) {
    .sidebar-wrapper .sidebar .tabs {
        display: flex !important;
        justify-content: center;
        align-items: stretch;
        padding: 0 !important;
        margin: 0 !important;
    }

    .sidebar-wrapper .sidebar .tab {
        flex: 1;
        display: flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
        /* 取消既有 height: 40px / line-height: 40px / inline-block 排版 */
        height: auto !important;
        line-height: 1.5 !important;
        padding: 14px 12px !important;
        margin: 0 !important;
    }
}

/*==============================================
    輪播圖卡視覺重塑（參考 前台頁面.html .carousel-card 樣式）
    DOM 結構（webRM.js 產出）對應到 前台頁面.html：
      .buttons-message-block   ↔  .carousel-card
      .img-wrapper             ↔  .card-img
      .description             ↔  .card-body
      .description h4          ↔  .card-title
      .description（h4 後文字） ↔  .card-desc
      .options (ul)            ↔  .card-actions
      .options li a            ↔  .card-btn
    高 specificity (.chat-messages .message-row ...) 蓋過 line 1206+ 的舊灰底卡片樣式
    =============================================*/

/* 卡片容器：白底 + 圓角 + 邊框 + 陰影 + flex column；hover 上浮加陰影
   background 與 background-color 都加 !important，對抗 webchat-interface.jsp 可能動態注入的背景色 */
.chat-messages .message-row .buttons-message-block {
    background: #fff !important;
    background-color: #fff !important;
    border: 1.5px solid #D8DEE9;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(43, 69, 144, 0.09);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #333A4D;
    transition: box-shadow 0.2s, transform 0.2s;
    /* 圖卡寬度由 282px 調整為 186px（2026-06-01）；對應 custom.js 輪播捲動距離 294→200 */
    /* width: 282px; */
    /* min-width: 282px; */
    width: 186px !important;
    min-width: 186px !important;
    margin-right: 10px;
}

.chat-messages .message-row .buttons-message-block:hover {
    box-shadow: 0 6px 20px rgba(43, 69, 144, 0.16);
    transform: translateY(-2px);
}

.chat-messages .message-row .buttons-message-block:last-of-type {
    margin-right: 0;
}

/* 單卡（非輪播）情境寬度區隔（2026-07-27，改為響應式「預設/最大皆 360px」：2026-07-27）：
   輪播卡片（.swiper-container 內，多張卡橫向捲動）維持上方 186px 固定小卡寬度不變；
   但「單一圖文卡」（buttons/image/audio/video/messagebox 等模板）是直接掛在
   .bubble.msg-content.msg-text 底下（無 .swiper-container 包一層），並不是用來橫向捲動的，
   固定 186px 會顯得過窄。採用 width:100% + max-width:360px：
   因為上方已讓 .message-content 與 .bubble 改為 flex-grow / width:100%（見 :has() 規則），
   這條鏈路從 .message-content 開始就有「依聊天面板實際寬度決定」的定值寬度，
   width:100% 才會正確依這個定值往下解析成「寬螢幕長到 360px 上限、窄螢幕（手機）跟著面板等比縮小」，
   而不是退化成依文字內容多寡決定寬度（shrink-to-fit）。
   用 > 子選擇器精準鎖定「未被 .swiper-container 包住」的情境，selector 天然就把輪播卡排除在外，
   不需要額外寫 :not(.swiper)；imagemap 有自己專屬的響應式 max-width 規則，故此處用 :not(.imagemap-block) 排除避免互相打架 */
.chat-messages .message-row .bubble.msg-content.msg-text > .buttons-message-container:not(.imagemap-container) {
    width: 100%;
    max-width: 360px;
}

.chat-messages .message-row .bubble.msg-content.msg-text > .buttons-message-container .buttons-message-block:not(.imagemap-block) {
    width: 100% !important;
    max-width: 360px !important;
    min-width: 0 !important;
}

/* 圖片區：固定高度 130px、漸層底色（無圖時當 placeholder）、有圖時 cover 顯示 */
.chat-messages .message-row .buttons-message-block .img-wrapper {
    margin: 0;
    width: 100%;
    height: 110px;
    overflow: hidden;
    border: none;
    border-radius: 0;
    background: linear-gradient(135deg, #2B4590, #4A7EC7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-messages .message-row .buttons-message-block .img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 無圖 placeholder：webRM.js 在 thumbnailImageUrl 為空時加 .no-img class，提供預設漸層 */
.chat-messages .message-row .buttons-message-block .img-wrapper.no-img {
    background: linear-gradient(135deg, #2B4590, #4A7EC7);
}

/* 輪播卡片（.swiper-container 內）沒有設定圖片時，直接隱藏整個 img-wrapper，不顯示漸層佔位色塊 */
.chat-messages .message-row .swiper-container .buttons-message-block .img-wrapper.no-img {
    display: none;
}

/* 輪播多卡片時讓每張卡片用不同漸層 rotation，避免一片同色（參考 前台頁面.html .img-survey/.img-web/.img-contact/.img-faq） */
.chat-messages .message-row .buttons-message-container .buttons-message-block:nth-child(4n+1) .img-wrapper {
    background: linear-gradient(135deg, #2B4590, #4A7EC7);
}
.chat-messages .message-row .buttons-message-container .buttons-message-block:nth-child(4n+2) .img-wrapper {
    background: linear-gradient(135deg, #4A7EC7, #7FAED9);
}
.chat-messages .message-row .buttons-message-container .buttons-message-block:nth-child(4n+3) .img-wrapper {
    background: linear-gradient(135deg, #4DA896, #2B4590);
}
.chat-messages .message-row .buttons-message-container .buttons-message-block:nth-child(4n+4) .img-wrapper {
    background: linear-gradient(135deg, #1E3373, #4DA896);
}
/* 有圖 (.img-wrapper 不含 .no-img) 時讓圖片蓋過漸層；漸層只在 .no-img 或 img 載入前顯示 */

/* 文字區：白底（覆蓋舊 .description 灰底）+ padding + flex column + gap
   background 加 !important 對抗動態 CSS 注入，確保卡片內所有文字區皆為白底 */
.chat-messages .message-row .buttons-message-block .description {
    background: #fff !important;
    background-color: #fff !important;
    color: #333A4D;
    margin: 0;
    padding: 12px 14px 8px;
    border: none;
    border-radius: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    word-wrap: break-word;
    white-space: normal;
}

/* 若卡片無圖（理論上不會發生因為已加 .no-img fallback），description 仍維持白底 */
.chat-messages .message-row .buttons-message-block .description:last-child {
    background: #fff !important;
    background-color: #fff !important;
    color: #333A4D;
    margin: 0;
    padding: 12px 14px 8px;
    border: none;
    border-radius: 0;
}

.chat-messages .message-row .buttons-message-block .img-wrapper + .description {
    background: #fff !important;
    background-color: #fff !important;
    color: #333A4D;
    margin: 0;
    padding: 12px 14px 8px;
    border: none;
    border-radius: 0;
}

/* 標題：navy 色粗體 */
.chat-messages .message-row .buttons-message-block .description h4 {
    color: #2B4590;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

/* 副標題（h4 之後的純文字）：muted 灰色小字 */
.chat-messages .message-row .buttons-message-block .description {
    font-size: 12px;
    color: #8B93A7;
    line-height: 1.6;
}
/* 但 h4 本身要保留前面定義的 navy + 14px（重新確認 specificity） */
.chat-messages .message-row .buttons-message-block .description h4 {
    color: #2B4590;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

/* 按鈕區（ul）：白底 + flex column + gap + padding；保留 padding 即使無按鈕（使用者選 B）
   background 加 !important 對抗動態 CSS 注入 */
.chat-messages .message-row .buttons-message-block ul.options,
.chat-messages .message-row .buttons-message-block > ul {
    list-style: none;
    background: #fff !important;
    background-color: #fff !important;
    margin: 0;
    border: none;
    border-top: none;
    border-radius: 0;
    padding: 6px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 按鈕本身（li）：清掉舊 border-top 與 padding，由 li > a 自己負責樣式 */
.chat-messages .message-row .buttons-message-block ul.options li,
.chat-messages .message-row .buttons-message-block > ul li {
    border-top: none;
    padding: 0;
    margin: 0;
    text-align: center;
    width: 100%;
    white-space: normal;
}

/* 按鈕 a：對齊使用者指定規格（前台頁面.html .card-btn 樣式）
   白底 navy 邊框 navy 字 + 圓角；hover 變 navy 底白字
   加 !important 對抗 webchat-interface.jsp 動態注入的按鈕色彩設定
   保留 display:block / line-height / text-decoration / box-sizing 是 <a> 標籤需要的補強（webRM.js 產出 a，非 button） */
.chat-messages .message-row .buttons-message-block ul.options li a,
.chat-messages .message-row .buttons-message-block > ul li a {
    width: 100%;
    padding: 3px 5px;
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    border: 1.5px solid #2B4590 !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #2B4590 !important;
    letter-spacing: 0.3px;
    text-align: center;
    font-weight: 500;
    transition: background 0.18s, color 0.18s;
    /* <a> 補強屬性 */
    display: block;
    text-decoration: none;
    /*line-height: 1.4;*/
    box-sizing: border-box;
}

.chat-messages .message-row .buttons-message-block ul.options li a:hover,
.chat-messages .message-row .buttons-message-block > ul li a:hover {
    background: #2B4590 !important;
    background-color: #2B4590 !important;
    color: #fff !important;
    text-decoration: none;
}

/* 多訊息群組：連續的機器人訊息中，第二則起隱藏頭像，保留佔位空間維持 bubble 對齊。
   使用相鄰兄弟選擇器：只要前一個也是 .by-robot 才命中，使用者訊息出現後自動重置。 */
.chat-messages .message-row.by-robot + .message-row.by-robot .avatar-wrapper {
    visibility: hidden;
}

/* 多訊息群組：被後續非推薦訊息取代 last_msg 的訊息隱藏 msg-footer（含時間戳）。
   display:none 完全移除排版空間，避免訊息間產生多餘間隔。
   由 JS 在確認「不是最後一則主訊息」時加上 robot-group-nonfinal class，
   避免誤將推薦按鈕（也是 .by-robot）視為「後繼者」而隱藏主答案的 footer。 */
.chat-messages .message-row.by-robot.robot-group-nonfinal .msg-footer {
    display: none;
}
