/* 语桥工作区：共享外观与响应式布局，业务页面沿用同一组组件。 */
:root {
    --c-text: #203451;
    --c-text-2: #40536a;
    --c-muted: #596b80;
    --c-muted-2: #596b80;
    --c-primary: #087786;
    --c-primary-soft: #e8f4f5;
    --c-border: #dfe6ee;
    --c-surface: #edf2f7;
    --c-surface-2: #f7f9fc;
    --canvas: #f5f7fa;
    --nav-bg: #203451;
    --nav-text: #c1cfdf;
    --ug-accent: #936320;
    --radius: 8px;
    --fs-display: 36px;
    --fs-hero: 30px;
    --fs-kpi: 34px;
    --sidebar-width: 224px;
    --shadow-card: 0 1px 3px rgb(32 52 81 / 3%);
}
body { background: var(--canvas); color: var(--c-text); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
button { border-radius: var(--radius); font-weight: 500; min-height: 40px; line-height: 1.4; transition: background .16s, box-shadow .16s; }
button:hover { background: #065e6a; }
button.secondary { background: #fff; border: 1px solid #d5dee8; color: var(--c-text-2); }
button.secondary:hover { background: var(--c-surface); border-color: #a9bbce; }
button.small { min-height: 32px; padding: 6px 12px; font-size: var(--fs-small); }
button.danger:hover { background: #a72d2d; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
    outline: 3px solid #41a7b3; outline-offset: 3px;
}
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    background: #fff; border: 1px solid #cbd7e3; border-radius: var(--radius);
    color: var(--c-text); min-height: 42px; padding: 10px 12px; font-size: var(--fs-body); width: 100%; transition: box-shadow .16s, border-color .16s;
}
input::placeholder, textarea::placeholder { color: #62748a; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgb(8 119 134 / 12%);
}
label { color: var(--c-text-2); font-weight: 600; }
.main-content a, .modal a, .drawer-body a { text-decoration: underline; text-underline-offset: 3px; }
svg.ui-icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; padding: 8px; }
.skip-link { position: fixed; top: -80px; left: 20px; background: #fff; padding: 10px 16px; z-index: 2000; border-radius: var(--radius); }
.skip-link:focus { top: 12px; }

/* 导航、页头和工作区 */
.admin-layout { display: block; }
.sidebar {
    width: var(--sidebar-width); background: var(--nav-bg); z-index: 100;
    padding: 0; height: 100dvh; transition: width .2s, transform .2s;
}
.sidebar .logo { height: 84px; padding: 20px; border-bottom: 1px solid rgb(255 255 255 / 10%); display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; color: #fff; background: #087786; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; flex-shrink: 0; }
.brand-mark svg { width: 27px; height: 27px; }
.brand-name { font-size: var(--fs-page); letter-spacing: 2px; font-weight: 650; line-height: 1.3; }
.brand-caption { display: block; color: #b0c3d8; font-size: var(--fs-caption); letter-spacing: 1px; font-weight: 400; margin-top: 4px; }
.sidebar .menu { padding: 12px; scrollbar-width: thin; scrollbar-color: #526781 transparent; }
.sidebar .menu-item {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    min-height: 42px; margin: 3px 0; color: var(--nav-text); border-radius: 7px;
    background: transparent; border: 0; text-align: left; font-weight: 400;
    font-size: var(--fs-body); white-space: nowrap;
}
.sidebar .menu-item:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.sidebar .menu-item.active { color: #fff; background: #314b68; box-shadow: inset 3px 0 0 #76d1d4; font-weight: 600; }
.sidebar .menu-item .ui-icon { opacity: .85; width: 19px; height: 19px; }
.sidebar .menu-item.active .ui-icon { color: #9ae0e2; opacity: 1; }
.sidebar .menu-group {
    padding: 14px 14px 6px; margin: 0; display: flex; align-items: center; gap: 7px;
    color: #afc0d3; font-size: var(--fs-caption); font-weight: 500; line-height: 1.8;
}
.sidebar .menu-group .chevron { margin-left: auto; order: 1; font-size: var(--fs-small); opacity: .7; }
.sidebar .menu-group-items { padding: 0; }
.sidebar .user-info { background: var(--nav-bg); padding: 18px; display: flex; align-items: center; gap: 11px; border-top: 1px solid rgb(255 255 255 / 8%); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #3d5877; color: #d4e7f4; font-weight: 600; flex-shrink: 0; }
.user-copy { flex: 1; min-width: 0; }
.sidebar .user-info .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-small); color: #e2ebf5; }
.sidebar .user-info .role { color: #afc0d3; margin-top: 0; }
.sidebar .logout-button { background: transparent; color: #afc0d3; min-height: 36px; width: 32px; padding: 4px; }
.sidebar .logout-button:hover { color: #fff; background: rgb(255 255 255 / 6%); }
.workspace { margin-left: var(--sidebar-width); min-width: 0; }
.workspace-header {
    height: 64px; background: #fff; border-bottom: 1px solid var(--c-border);
    padding: 0 28px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 70;
}
.workspace-header .icon-button { background: transparent; color: var(--c-muted); border: 0; }
.workspace-header .icon-button:hover { background: var(--c-surface); color: var(--c-primary); }
.breadcrumb { display: flex; align-items: center; gap: 12px; font-size: var(--fs-small); color: var(--c-muted); white-space: nowrap; }
.breadcrumb .current { color: var(--c-text); font-weight: 600; }
.header-spacer { flex: 1; }
.nav-search-trigger { display: inline-flex; align-items: center; gap: 10px; background: var(--c-surface-2); border: 1px solid var(--c-border); color: var(--c-muted); padding: 8px 12px; min-width: 200px; }
.nav-search-trigger:hover { background: var(--c-surface); }
 kbd { font: inherit; font-size: var(--fs-caption); border: 1px solid var(--c-border); border-radius: 5px; padding: 1px 6px; color: var(--c-muted); background: #fff; }
.nav-search-trigger kbd { margin-left: auto; }
.workspace-date { font-size: var(--fs-caption); color: var(--c-muted); white-space: nowrap; }
.header-avatar { background: #e8f0f6; color: #3d5877; }
.main-content { margin-left: 0; padding: 26px 28px 40px; width: 100%; max-width: 1800px; margin-right: auto; }
.main-content:focus { outline: none; }
.page-header { margin-bottom: 22px; gap: 16px; align-items: flex-start; }
.page-header h2 { font-size: var(--fs-page); color: var(--c-text); font-weight: 650; letter-spacing: -.5px; }
.page-description { color: var(--c-muted); font-size: var(--fs-small); margin-top: 5px; font-weight: 400; letter-spacing: 0; }
.page-header > span { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav-backdrop { display: none; }
.sidebar .mobile-nav-close { display: none; background: transparent; color: #c7d8cf; margin-left: auto; font-size: var(--fs-page); padding: 6px; }
.nav-collapsed { --sidebar-width: 80px; }
.nav-collapsed .sidebar .logo { padding: 24px 21px; }
.nav-collapsed .brand-copy, .nav-collapsed .menu-label, .nav-collapsed .menu-group, .nav-collapsed .user-copy { display: none; }
.nav-collapsed .sidebar .menu { padding: 16px 12px; }
.nav-collapsed .sidebar .menu-item { justify-content: center; padding: 10px; }
.nav-collapsed .sidebar .menu-group-items { display: block; }
.nav-collapsed .sidebar .user-info { padding: 14px 8px; flex-direction: column; gap: 5px; }

/* 所有管理页共享的组件 */
.card, .stat-card { border: 1px solid var(--c-border); border-radius: 10px; box-shadow: var(--shadow-card); }
.card { padding: 22px; margin-bottom: 20px; min-width: 0; }
.card h3 { font-weight: 600; color: var(--c-text); font-size: var(--fs-lead); }
.stats-grid { gap: 16px; margin-bottom: 22px; }
.stat-card { padding: 18px 22px; position: relative; overflow: hidden; }
.stat-card .label { font-size: var(--fs-small); color: var(--c-muted); font-weight: 500; }
.stat-card .value { color: var(--c-text); font-size: var(--fs-kpi); font-weight: 650; line-height: 1.3; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin: 10px 0 7px; }
.stat-card .sub { color: var(--c-muted); font-size: var(--fs-caption); }
.stat-card[onclick] { transition: border-color .2s, box-shadow .2s; }
.stat-card[onclick]:hover { border-color: #95bec9; box-shadow: 0 4px 16px rgb(8 119 134 / 7%); }
table { line-height: 1.65; }
th { background: var(--c-surface-2); color: var(--c-muted); font-size: var(--fs-small); font-weight: 500; white-space: nowrap; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--c-border); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f5f9fc; }
td { overflow-wrap: anywhere; }
td:last-child { white-space: nowrap; }
td button + button { margin-left: 5px; }
.table-scroll { width: 100%; overflow-x: auto; scrollbar-width: thin; border: 1px solid var(--c-border); border-radius: 10px; }
.table-scroll table { margin: 0; }
.table-scroll:focus-visible { outline-offset: 2px; }
.badge { border-radius: 6px; padding: 3px 9px; line-height: 1.6; font-weight: 500; }
.badge-zh { background: var(--c-primary-soft); color: #076a77; }
.badge-ug { background: #faf0df; color: var(--ug-accent); }
.badge-active { background: #edf6ec; color: #36734b; }
.badge-pending { color: #956418; }
.text-success { color: #36734b; }
.tabs { gap: 24px; border-bottom: 1px solid var(--c-border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 5px 0 15px; font-size: var(--fs-body); color: var(--c-muted); white-space: nowrap; }
.tab.active { color: var(--c-primary); border-bottom: 2px solid var(--c-primary); font-weight: 600; }
.more-menu > summary { background: var(--c-surface); border-radius: 8px; min-height: 32px; padding: 6px 12px; }
.more-menu-list { background: #fff; padding: 6px; border-radius: 10px; box-shadow: 0 8px 28px rgb(20 40 30 / 12%); }
.more-menu-list button { border-radius: 6px; }
.modal-overlay, .drawer-mask { background: rgb(23 42 67 / 40%); backdrop-filter: blur(3px); }
.modal { padding: 28px; border-radius: 14px; max-height: 88dvh; box-shadow: 0 24px 90px rgb(23 42 67 / 20%); }
.modal h3 { font-size: var(--fs-title); margin-bottom: 22px; }
.modal-actions { position: sticky; bottom: -28px; z-index: 2; margin: 24px -28px -28px; padding: 16px 28px; background: #fff; border-top: 1px solid var(--c-border); justify-content: flex-end; }
.modal-actions button { min-width: 80px; }
.modal-actions .secondary { order: -1; }
.form-intro { font-size: var(--fs-small); color: var(--c-muted); margin: -12px 0 22px; max-width: 65ch; }
.form-section { margin: 0 0 24px; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--c-border); min-width: 0; }
.form-section legend { font-size: var(--fs-lead); font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.form-section p, .field-help { color: var(--c-muted); font-size: var(--fs-caption); margin: 4px 0 12px; max-width: 75ch; }
.form-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-section label:not(.knowledge-choice):not(.policy-choice) { display: block; margin: 14px 0 7px; font-size: var(--fs-small); }
.form-section textarea { margin-top: 0; resize: vertical; }
.policy-choice, .knowledge-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--c-border); border-radius: 8px; margin: 10px 0; font-weight: 400; cursor: pointer; }
.policy-choice input[type=checkbox], .knowledge-choice input[type=checkbox] { width: 16px; height: 16px; margin: 5px 0 0; flex-shrink: 0; accent-color: var(--c-primary); }
.policy-choice strong, .knowledge-choice strong { display: block; font-size: var(--fs-small); font-weight: 600; }
.policy-choice small, .knowledge-choice small { display: block; color: var(--c-muted); font-size: var(--fs-caption); line-height: 1.65; margin-top: 3px; }
.knowledge-choice:has(input:checked) { background: var(--c-primary-soft); border-color: #a7cfd5; }
.knowledge-options { max-height: 230px; overflow-y: auto; padding: 0 3px; }
.knowledge-warning { background: #fcf6eb; border: 1px solid #ecdfbb; padding: 12px; border-radius: 8px; color: var(--ug-accent); }
.form-error { color: var(--c-danger); background: var(--c-danger-bg); border: 1px solid var(--c-danger-border); padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.bot-test-section { background: var(--c-surface-2); padding: 16px; border: 1px solid var(--c-border); border-radius: 8px; margin: 16px 0; }
.bot-test-section p { color: var(--c-muted); font-size: var(--fs-caption); margin: 6px 0 12px; }
.bot-list-name { display: block; font-weight: 600; }
.bot-list-detail { display: block; color: var(--c-muted); font-size: var(--fs-caption); margin-top: 3px; }
.drawer-head { padding: 22px 26px; background: var(--c-surface-2); }
.drawer-body { padding: 26px; }
.drawer-close { color: var(--c-muted); min-height: 36px; min-width: 36px; }
.drawer-close:hover { background: var(--c-surface); }
.ctx-label { color: var(--c-muted); font-size: var(--fs-small); font-weight: 600; }
.ctx-section { padding: 16px 0; border-color: var(--c-border); }
.kb-suggest { border: 1px solid var(--c-border); background: var(--c-surface-2); border-radius: 10px; padding: 14px; margin-top: 10px; }
.kb-suggest:hover { background: var(--c-primary-soft); border-color: #aacabd; }
.message { border-radius: 12px; border: 1px solid var(--c-border); padding: 14px; }
.loading-state { padding: 80px 24px; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--c-muted); }
.loading-spinner { width: 20px; height: 20px; border: 2px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { min-height: 260px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 32px; gap: 12px; color: var(--c-muted); }
.empty-state > .ui-icon { color: #6ca08a; width: 44px; height: 44px; padding: 8px; border-radius: 12px; background: var(--c-primary-soft); }
.empty-state strong { color: var(--c-text-2); font-weight: 500; }
.page-error { text-align: center; padding: 50px 24px; }
.page-error p { margin-bottom: 18px; overflow-wrap: anywhere; }

/* 仪表盘：先看整体，再看需要行动的事项 */
.dashboard-welcome { padding: 18px 22px; background: #e8f0f6; border: 1px solid #d8e4ee; border-radius: 10px; margin-bottom: 22px; display: flex; align-items: center; gap: 24px; position: relative; overflow: hidden; }
.welcome-copy { flex: 1; z-index: 1; }
.dashboard-welcome h3 { font-size: var(--fs-title); font-weight: 600; letter-spacing: -.3px; margin: 0 0 4px; color: var(--c-text); }
.dashboard-welcome p { color: var(--c-muted); font-size: var(--fs-small); }
.welcome-action { display: flex; align-items: center; gap: 10px; z-index: 1; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,1fr); gap: 22px; align-items: start; }
.dashboard-grid .card { margin-bottom: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h3 { margin: 0; }
.section-meta { color: var(--c-muted); font-size: var(--fs-caption); font-weight: 400; }
.pending-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 16px 0; border-top: 1px solid var(--c-border); }
.pending-item:first-child { border-top: 0; padding-top: 0; }
.pending-title { display: flex; align-items: baseline; gap: 12px; font-weight: 500; }
.pending-count { font-size: var(--fs-page); color: var(--c-text); font-variant-numeric: tabular-nums; font-weight: 600; }
.pending-item p { font-size: var(--fs-caption); color: var(--c-muted); margin-top: 4px; }
.stat-decoration { width: 32px; height: 32px; border-radius: 8px; display: flex; justify-content: center; align-items: center; position: absolute; right: 22px; top: 18px; background: #e8f0f6; color: #526f8a; }
.stat-card:nth-child(2) .stat-decoration { background: #e8f3f2; color: #428a80; }
.stat-card:nth-child(3) .stat-decoration { background: #fcf1df; color: #ae8a45; }
#dashStats { grid-template-columns: repeat(3,minmax(0,1fr)); }
#dashMessageJobs .card { position: relative; background: #fff; }
#dashMessageJobs h3 { margin-bottom: 12px; }
#dashMessageJobs p { margin-bottom: 8px; }
#dashMessageJobs button { margin-top: 8px; }
#dashTrend > .ctx-label { font-size: var(--fs-caption); font-weight: 500; }
#dashTrend svg { max-height: 160px; }
#dashTrend svg text { font-size: var(--fs-caption); }
.dashboard-footer { display: flex; align-items: center; gap: 8px; color: var(--c-muted); font-size: var(--fs-caption); margin-top: 8px; }
.workspace-notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; margin-bottom: 20px; background: #fcf7e9; border: 1px solid #ecdfbb; border-radius: 12px; color: #8c672b; font-size: var(--fs-small); }
.workspace-notice strong { font-weight: 500; }
.workspace-notice p { font-size: var(--fs-caption); margin-top: 4px; color: #826f4d; }
.workspace-notice button { flex-shrink: 0; }

/* 坐席：队列、当前会话、客户上下文 */
.agent-desk-grid { display: grid; grid-template-columns: 300px minmax(360px,1fr) 250px; gap: 14px; align-items: start; }
.agent-desk-grid .card { padding: 16px; }
.agent-queues .card { margin: 0 0 14px; }
.agent-chat-card { margin-bottom: 0; min-height: 600px; }
.agent-chat-card > h3 { display: flex; justify-content: space-between; align-items: center; }
.agent-conversation-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.agent-conversation-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-queue-item { border: 1px solid var(--c-border); border-radius: 8px; padding: 12px !important; margin-bottom: 10px; background: #fff; }
.agent-queue-item:hover { background: var(--c-surface-2); }
.agent-queue-item.selected { background: var(--c-primary-soft); border-color: #93c4ce; box-shadow: inset 3px 0 0 var(--c-primary); }
.agent-queue-item > div:first-child { font-weight: 500; margin-bottom: 8px; }
.agent-queue-item button { margin-top: 10px; padding: 5px 8px; font-size: var(--fs-caption); }
.agent-queue-item button + button { margin-left: 3px; }
#agentChat .flex-between { flex-wrap: wrap; gap: 8px; }
#agentMsgs { margin-top: 16px; border: 1px solid var(--c-border) !important; background: #f7f9fc; padding: 18px !important; min-height: 350px; max-height: min(48dvh,540px) !important; border-radius: 8px !important; }
#agentMsgs > div { margin-bottom: 16px !important; }
#agentReplyBox { align-items: flex-start; padding-top: 8px; }
.agent-reply-field { flex: 1; min-width: 0; }
#agentReplyInput { display: block; min-width: 0; min-height: 78px; max-height: 180px; margin-top: 0; }
.agent-reply-hint { color: var(--c-muted); font-size: var(--fs-caption); margin-top: 7px; }
#agentSendBtn { min-width: 76px; min-height: 46px; }
#agentQuickReplies { display: flex; flex-wrap: wrap; gap: 6px; }
#agentContext .card { padding: 16px; }
#agentContext .ctx-section:first-child { padding-top: 0; }
#agentContext .ctx-section:last-child { border-bottom: 0; }

/* 功能搜索：原生 dialog 支持键盘焦点与 Escape */
.navigation-dialog { border: 1px solid var(--c-border); border-radius: 16px; padding: 0; width: min(580px,calc(100vw - 32px)); max-height: 80dvh; margin: 14dvh auto auto; color: var(--c-text); box-shadow: 0 24px 70px rgb(15 34 28 / 20%); }
.navigation-dialog::backdrop { background: rgb(15 34 28 / 30%); backdrop-filter: blur(3px); }
.navigation-search-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-border); }
.navigation-search-head input { border: 0 !important; box-shadow: none !important; background: transparent; margin: 0; padding: 4px 0; }
.navigation-search-head .ui-icon { color: var(--c-muted); }
.navigation-results { padding: 8px; overflow-y: auto; max-height: 48dvh; }
.navigation-result { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; text-align: left; background: transparent; color: var(--c-text); font-weight: 400; border-radius: 9px; }
.navigation-result:hover, .navigation-result.selected { background: var(--c-primary-soft); color: var(--c-primary); }
.navigation-result small { display: block; font-size: var(--fs-caption); color: var(--c-muted); margin-top: 2px; }
.navigation-search-footer { border-top: 1px solid var(--c-border); padding: 12px 20px; display: flex; gap: 14px; color: var(--c-muted); font-size: var(--fs-caption); }
.search-empty { padding: 28px; text-align: center; color: var(--c-muted); }

/* 登录 */
.login-wrapper { min-height: 100dvh; padding: 24px; background: #eef2f7; display: grid; place-items: center; justify-content: stretch; }
.login-shell { width: min(1080px,100%); display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; border: 1px solid #dce4ee; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 80px rgb(32 52 81 / 8%); }
.login-story { background: var(--nav-bg); padding: 44px; color: #f1f6fc; position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 600px; overflow: hidden; }
.login-brand { display: flex; gap: 12px; align-items: center; }
.login-story .brand-mark { background: #087786; }
.login-story h2 { font-size: var(--fs-display); line-height: 1.45; font-weight: 500; letter-spacing: 1px; margin: 44px 0 18px; position: relative; z-index: 1; }
.login-story p { color: #bed0e2; max-width: 330px; font-size: var(--fs-body); }
.login-language { display: flex; align-items: center; gap: 12px; margin-top: 30px; font-size: var(--fs-caption); }
.login-language span { padding: 6px 12px; border: 1px solid #647c97; border-radius: 6px; color: #e4edf6; }
.login-language span[lang=ug] { border-color: #b89565; color: #f5dbb0; }
.login-story-art { color: #81b6c7; position: absolute; width: 330px; height: 180px; right: -50px; bottom: 45px; opacity: .18; }
.login-story-footer { font-size: var(--fs-caption); color: #bed0e2; z-index: 1; margin-top: 100px; display: flex; align-items: center; gap: 8px; }
.login-box { width: 100%; padding: 64px 54px; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; justify-content: center; }
.login-box .login-eyebrow { font-size: var(--fs-caption); color: var(--c-muted); letter-spacing: 2px; margin-bottom: 12px; }
.login-box h1 { text-align: left; font-size: var(--fs-hero); font-weight: 600; margin-bottom: 8px; }
.login-box .subtitle { text-align: left; font-size: var(--fs-small); color: var(--c-muted); margin-bottom: 28px; }
.login-box label { font-size: var(--fs-small); margin-top: 18px; margin-bottom: 8px; }
.login-box input { margin: 0; padding: 12px 14px; min-height: 48px; }
.login-box .login-submit { margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; }
.login-box .login-submit .ui-icon { width: 18px; }
.login-error { border: 1px solid var(--c-danger-border); border-radius: 9px; background: var(--c-danger-bg); padding: 10px 12px; text-align: left; }
.login-footer { text-align: left; margin-top: 24px; line-height: 1.8; }

@media (max-width: 1279px) {
    .agent-desk-grid { grid-template-columns: 280px minmax(0,1fr); }
    #agentContext { grid-column: 1 / -1; }
    #agentContext > .card { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
    #agentContext .ctx-section { border-bottom: 0; padding: 0; }
    #agentContext .ctx-section:only-child { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
    .workspace-header { padding: 0 24px; }
    .main-content { padding: 26px 24px; }
    .workspace-date { display: none; }
    .dashboard-grid { grid-template-columns: minmax(0,1fr); }
    .dashboard-welcome h3 { font-size: var(--fs-page); }
    .dashboard-welcome { padding: 22px; }
    .nav-search-trigger { min-width: 160px; }
}
@media (max-width: 900px) {
    .admin-layout, .admin-layout.nav-collapsed { --sidebar-width: 0px; }
    .sidebar { width: 260px; height: 100dvh; position: fixed; top: 0; bottom: 0; transform: translateX(-100%); }
    .nav-open .sidebar { transform: translateX(0); }
    .sidebar .mobile-nav-close { display: inline-flex; }
    .nav-backdrop { position: fixed; inset: 0; border: 0; border-radius: 0; width: 100%; height: 100dvh; background: rgb(15 34 28 / 35%); z-index: 90; }
    .nav-open .nav-backdrop { display: block; }
    .nav-collapsed .brand-copy, .nav-collapsed .menu-label, .nav-collapsed .menu-group, .nav-collapsed .user-copy { display: initial; }
    .nav-collapsed .sidebar .menu-group { display: flex; }
    .nav-collapsed .sidebar .menu-group-items { display: none; }
    .nav-collapsed .sidebar .menu-group-items.open { display: block; }
    .nav-collapsed .sidebar .menu-item { justify-content: flex-start; padding: 10px 14px; }
    .nav-collapsed .sidebar .user-info { flex-direction: row; padding: 18px; gap: 11px; }
    .agent-desk-grid { grid-template-columns: 220px minmax(0,1fr); }
    .login-story { padding: 32px; }
    .login-box { padding: 40px 32px; }
}
@media (max-width: 640px) {
    .sidebar { width: 260px; position: fixed; height: 100dvh; padding: 0; display: flex; overflow: hidden; }
    .sidebar .logo { display: flex; }
    .sidebar .menu { display: block; overflow-y: auto; overflow-x: hidden; padding: 20px 14px; flex: 1; }
    .sidebar .menu-group { display: flex; }
    .sidebar .menu-group-items { display: none; }
    .sidebar .menu-group-items.open { display: block; }
    .sidebar .user-info { display: flex; }
    .workspace-header { height: 64px; padding: 0 14px; gap: 9px; }
    .breadcrumb { gap: 6px; font-size: var(--fs-small); }
    .breadcrumb > .breadcrumb-root, .breadcrumb > .breadcrumb-divider { display: none; }
    .header-avatar { display: none; }
    .nav-search-trigger { min-width: 40px; width: 40px; height: 40px; padding: 10px; }
    .nav-search-trigger .search-label, .nav-search-trigger kbd { display: none; }
    .main-content { margin-left: 0; padding: 22px 16px 32px; }
    .page-header { flex-direction: column; gap: 14px; }
    .page-header > span, .page-actions { justify-content: flex-start; }
    .page-header h2 { font-size: var(--fs-page); }
    .page-description { font-size: var(--fs-small); line-height: 1.7; }
    .card { padding: 18px; border-radius: 12px; overflow-x: visible; }
    .table-scroll { overflow-x: auto; }
    .table-scroll table { min-width: 560px; }
    th, td { padding: 12px; }
    .flex-between { flex-wrap: wrap; gap: 10px; }
    .stats-grid, .stats-grid[style*="grid-template-columns"] { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 12px; }
    #dashStats { grid-template-columns: 1fr !important; gap: 12px; }
    #dashStats .stat-card { min-height: 112px; padding: 18px 20px; }
    #dashStats .value { font-size: var(--fs-hero); margin: 6px 0; }
    #dashStats .sub { position: absolute; right: 20px; bottom: 22px; }
    .dashboard-welcome { padding: 22px; flex-direction: column; align-items: flex-start; gap: 18px; }
    .workspace-notice { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
    .dashboard-welcome h3 { font-size: var(--fs-page); }
    .dashboard-grid { grid-template-columns: 1fr; gap: 0; }
    .section-heading { flex-wrap: wrap; }
    .agent-desk-grid { grid-template-columns: minmax(0,1fr); }
    .agent-chat-card { order: -1; min-height: 0; }
    #agentContext { grid-column: auto; }
    #agentContext > .card { display: block; }
    #agentContext .ctx-section { padding: 16px 0; border-bottom: 1px solid var(--c-border); }
    #agentMsgs { min-height: 260px; max-height: 45dvh !important; }
    #agentReplyBox { position: sticky; bottom: 0; background: #fff; padding: 12px 0 max(4px,env(safe-area-inset-bottom)); }
    .agent-queues { display: grid; grid-template-columns: minmax(0,1fr); }
    .agent-chat-card .empty-state { min-height: 200px; }
    .modal { width: calc(100% - 24px); padding: 22px; max-height: 90dvh; border-radius: 12px; }
    .modal-actions { bottom: -22px; margin: 24px -22px -22px; padding: 14px 22px; }
    .form-columns { grid-template-columns: minmax(0,1fr); gap: 0; }
    .drawer { max-width: 100vw; width: 100%; }
    .drawer-head, .drawer-body { padding: 20px; }
    .login-wrapper { padding: 16px; }
    .login-shell { grid-template-columns: 1fr; border-radius: 20px; }
    .login-story { min-height: 0; padding: 24px; }
    .login-story h2 { font-size: var(--fs-page); margin: 26px 0 10px; }
    .login-story p { font-size: var(--fs-small); }
    .login-language { margin-top: 18px; }
    .login-story-footer, .login-story-art { display: none; }
    .login-box { padding: 30px 24px; }
    .login-box h1 { font-size: var(--fs-page); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}
/* Login verification and account security. */
.workspace-tenant { display: flex; align-items: center; gap: 7px; max-width: 210px; min-height: 34px; padding: 6px 10px; background: white; color: var(--c-text); border: 1px solid var(--c-border); font-size: var(--fs-small); flex: 0 1 auto; }
.workspace-tenant span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-tenant .ui-icon { flex-shrink: 0; }
.workspace-tenant:disabled { opacity: 1; cursor: default; }
.workspace-tenant.delegated { background: var(--c-primary-soft); border-color: #8fbec4; color: #096575; }
.tenant-switcher #tenantOptions { max-height: 45vh; overflow: auto; margin-top: 14px; }
.tenant-option { display: flex; width: 100%; align-items: center; justify-content: space-between; text-align: left; gap: 12px; margin: 6px 0; padding: 12px; }
.tenant-option span:first-child { min-width: 0; overflow-wrap: anywhere; }
.tenant-option small { display: block; margin-top: 4px; color: var(--c-muted); font-weight: 400; }
.tenant-option span:last-child { flex-shrink: 0; font-size: var(--fs-caption); }
.onboarding-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 4px 0 24px; }
.onboarding-intro h3 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -.025em; }
.onboarding-intro p { margin: 0; color: var(--c-text-2); line-height: 1.7; max-width: 42em; }
.onboarding-progress { font-size: 28px; font-weight: 600; white-space: nowrap; }
.onboarding-progress small { font-size: var(--fs-small); color: var(--c-muted); font-weight: 400; }
.onboarding-channel-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; }
.onboarding-channel-choice label { font-size: var(--fs-small); font-weight: 600; }
.onboarding-channel-choice select { width: auto; max-width: 100%; min-width: 0; }
.onboarding-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; border: 1px solid var(--c-border); border-radius: 8px; background: white; overflow: hidden; }
.onboarding-step { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 15px; align-items: center; padding: 24px; border-bottom: 1px solid var(--c-border); }
.onboarding-step:last-child { border-bottom: 0; }
.step-marker { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--c-border); border-radius: 50%; color: var(--c-muted); font-size: var(--fs-small); }
.onboarding-step.done .step-marker { background: var(--c-primary-soft); border-color: #8fbec4; color: #096575; }
.onboarding-step.next { background: #f2f9fa; box-shadow: inset 3px 0 var(--c-primary); }
.onboarding-step.next .step-marker { background: var(--c-primary); color: white; border-color: var(--c-primary); }
.onboarding-step h3 { font-size: var(--fs-body); margin: 0 0 8px; font-weight: 600; }
.onboarding-step p { margin: 0; line-height: 1.7; color: var(--c-text-2); overflow-wrap: anywhere; font-size: var(--fs-small); max-width: 44em; }
.onboarding-context { padding: 24px; border-left: 1px solid var(--c-border); background: var(--c-surface-2); min-height: 100%; }
.onboarding-context h3 { margin: 0 0 8px; font-size: var(--fs-body); }
.service-chain { padding: 18px 0; border-bottom: 1px solid var(--c-border); }
.service-chain strong { font-weight: 600; display: block; line-height: 1.7; overflow-wrap: anywhere; }
.service-chain > span { display: block; font-size: var(--fs-caption); color: var(--c-muted); margin-top: 2px; }
.service-chain dl { margin: 12px 0 0; display: grid; grid-template-columns: 65px minmax(0,1fr); gap: 8px; font-size: var(--fs-small); }
.service-chain dt { color: var(--c-muted); }
.service-chain dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.onboarding-members, .onboarding-evidence { margin-top: 24px; font-size: var(--fs-small); }
.onboarding-context h4 { font-size: var(--fs-small); font-weight: 600; margin: 0 0 10px; }
.onboarding-evidence small { color: var(--c-muted); line-height: 1.8; }
.context-empty { color: var(--c-muted); font-size: var(--fs-small); line-height: 1.8; }
.acceptance-history { margin: 14px 0; padding: 14px; border-left: 3px solid var(--c-border); background: var(--c-surface-2); font-size: var(--fs-small); }
.acceptance-notice { color: var(--c-text-2); background: var(--c-primary-soft); padding: 12px; }
.import-fields { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.import-fields legend { font-size: var(--fs-small); font-weight: 600; margin-bottom: 8px; }
.import-row-report > div { max-height: 240px; overflow: auto; font-size: var(--fs-small); }
@media (max-width: 1100px) {
    .workspace-date { display: none; }
    .workspace-tenant { max-width: 170px; }
    .onboarding-layout { grid-template-columns: minmax(0,1fr) 250px; }
    .onboarding-step { padding: 20px; gap: 10px; }
    .onboarding-context { padding: 20px; }
}
@media (max-width: 760px) {
    .onboarding-layout { grid-template-columns: 1fr; }
    .onboarding-context { border-left: 0; border-top: 1px solid var(--c-border); }
}
@media (max-width: 640px) {
    .workspace-header { flex-wrap: wrap; height: auto; min-height: 100px; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
    .workspace-tenant { order: 5; max-width: none; width: 100%; flex-basis: 100%; justify-content: flex-start; }
    .workspace-tenant span { max-width: calc(100vw - 92px); }
    .onboarding-intro { align-items: flex-start; gap: 12px; }
    .onboarding-intro h3 { font-size: 21px; }
    .onboarding-progress { font-size: 22px; }
    .onboarding-progress small { display: block; font-size: var(--fs-caption); }
    .onboarding-step { grid-template-columns: 28px minmax(0,1fr); padding: 20px 16px; }
    .onboarding-step button { grid-column: 2; justify-self: start; }
    .onboarding-step.done { grid-template-columns: 28px minmax(0,1fr) auto; padding: 14px 16px; }
    .onboarding-step.done h3 { margin-bottom: 0; }
    .onboarding-step.done p { display: none; }
    .onboarding-step.done button { grid-column: 3; grid-row: 1; }
}
.header-avatar { border: 0; padding: 0; min-height: 36px; cursor: pointer; }
.launch-stage { margin: 0; padding: 14px 24px; background: #f5f7fa; border-bottom: 1px solid var(--c-border); font-size: 15px; color: var(--c-text); }
.launch-stage:first-child { margin-top: 0; }
.launch-section-title { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:20px; }
.launch-section-title h3 { margin:0 0 8px; }
.launch-section-title p { margin:0; color:var(--c-muted); }
.launch-section-title > button { flex-shrink:0; }
.launch-voice-panel { scroll-margin-top:120px; margin-top:24px; }
.launch-instructions { padding-left:22px; max-width:75ch; line-height:1.85; }
.voice-review-grid { display:grid; grid-template-columns:1fr 1fr; gap:28px; margin:24px 0; }
.voice-review-grid h4 { margin:0 0 12px; }
.voice-review-row { display:flex; justify-content:space-between; gap:12px; align-items:center; border-top:1px solid var(--c-border); padding:14px 0; }
.voice-review-row strong { font-size:14px; font-weight:500; }
.voice-review-row small,.media-usage-table small,.media-rate-list small { display:block; margin-top:5px; color:var(--c-muted); font-size:12px; overflow-wrap:anywhere; }
.launch-review-modal { max-height:calc(100dvh - 40px); overflow:auto; width:640px; }
.launch-review-modal label:not(.security-check) { display:block; margin:16px 0 8px; }
.voice-review-checks { display:grid; grid-template-columns:1fr 1fr; gap:0 20px; }
.media-month-control { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.media-month-control input { width:160px; }
.media-usage-panel { margin-top:24px; scroll-margin-top:120px; }
.media-usage-table { overflow-x:auto; }
.media-usage-table table { min-width:730px; }
.media-usage-empty { padding:24px 0; border-block:1px solid var(--c-border); }
.media-usage-empty p { color:var(--c-muted); margin-bottom:0; }
.media-cost-summary { display:grid; grid-template-columns:repeat(3,1fr); padding:24px 0; margin:20px 0; border-block:1px solid var(--c-border); gap:24px; }
.media-cost-summary span,.media-cost-summary small { display:block; color:var(--c-muted); line-height:1.65; }
.media-cost-summary strong { display:block; margin:10px 0; font-size:24px; color:var(--c-text); font-variant-numeric:tabular-nums; }
.media-rate-list > div { display:grid; grid-template-columns:minmax(0,1fr) 150px; gap:16px; align-items:center; padding:10px 0; border-top:1px solid var(--c-border); }
.media-rate-list label { margin:0!important; }
@media(max-width:760px) {
  .launch-section-title { flex-direction:column; gap:16px; }
  .voice-review-grid,.voice-review-checks,.media-cost-summary { grid-template-columns:1fr; }
  .media-cost-summary { gap:18px; }
  .media-cost-summary > div+div { border-top:1px solid var(--c-border); padding-top:18px; }
  .media-rate-list > div { grid-template-columns:minmax(0,1fr) 120px; }
}
.login-captcha { border: 0; margin: 4px 0 16px; padding: 0; min-width: 0; }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.login-box .captcha-row input { margin: 0; width: 0; flex: 1; min-width: 85px; }
.login-box .captcha-refresh { width: 155px; padding: 4px 8px; display: grid; gap: 2px; justify-items: center; font-size: var(--fs-caption); }
.captcha-refresh img { width: 138px; height: 46px; object-fit: contain; }
.login-captcha p { font-size: var(--fs-caption); margin-top: 8px; line-height: 1.5; }
.security-check { display: flex; gap: 8px; align-items: center; cursor: pointer; margin: 12px 0; }
.security-check input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.account-security p { line-height: 1.75; }
.account-password { max-width: 520px; }
.account-password label, .security-dialog label:not(.security-check) { display: block; margin: 16px 0 6px; font-weight: 600; }
.account-password button { margin-top: 20px; }
.security-dialog { width: 560px; max-width: calc(100vw - 28px); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid var(--c-border); border-radius: 18px; padding: 24px; color: var(--c-text); box-shadow: 0 24px 70px #132e2b33; }
.security-dialog::backdrop { background: #122a2766; backdrop-filter: blur(3px); }
.security-dialog h3 { margin: 0; }
.security-dialog p { line-height: 1.75; }
.security-dialog form > button { margin-top: 12px; }
.security-dialog .mfa-setup { display: flex; gap: 20px; align-items: center; margin: 18px 0; }
.mfa-qr { width: 180px; height: 180px; flex: 0 0 auto; border: 1px solid #e2e8e5; border-radius: 8px; background: white; }
.mfa-manual-secret { display: block; word-break: break-all; user-select: all; margin-top: 8px; }
.recovery-code-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 20px 0; }
.recovery-code-grid code { padding: 10px 6px; text-align: center; border: 1px solid var(--c-border); border-radius: 7px; font-size: 13px; background: var(--canvas); }
@media (max-width: 640px) {
  .account-grid { grid-template-columns: 1fr; gap: 0; }
  .security-dialog { padding: 18px; }
  .security-dialog .mfa-setup { flex-direction: column; gap: 8px; }
  .recovery-code-grid { grid-template-columns: 1fr; }
}

/* Merchant daily operations: same navy/teal identity, fewer decisions per view. */
.merchant-task-links{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 24px}
.merchant-task-links button{min-height:44px}
.member-language-options{display:flex;gap:24px;flex-wrap:wrap}
.member-language-options label{display:flex;align-items:center;gap:8px}
.member-language-options input{width:auto;margin:0}
.step-owner{color:var(--c-muted);display:block;margin:4px 0}
.catalog-chinese-fields{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:20px 0}
.catalog-chinese-fields .field-help{min-height:3em;margin:4px 0 8px}
.catalog-ug-section,.bot-advanced{border:1px solid var(--c-border);border-radius:8px;padding:14px;margin:12px 0}
.catalog-ug-section summary,.bot-advanced summary{cursor:pointer;font-weight:600;min-height:32px}
.catalog-ug-section[open] summary{margin-bottom:12px}
@media(max-width:600px){.catalog-chinese-fields{grid-template-columns:1fr;gap:12px}.merchant-task-links{display:grid;grid-template-columns:1fr 1fr}.merchant-task-links button{text-align:left;padding:10px}.catalog-chinese-fields .field-help{min-height:0}}

/* Platform and enterprise scope: visible through navigation and every delegated page. */
.workspace-delegation {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 28px;background:#fff5df;color:#674600;border-bottom:1px solid #e8d4a8;font-size:14px;}
.workspace-delegation[hidden] {display:none;}
.workspace-delegation span {overflow-wrap:anywhere;}
.workspace-delegation button {flex-shrink:0;}
.platform-intro {display:flex;align-items:center;justify-content:space-between;gap:24px;padding:12px 0 28px;}
.platform-intro h3 {margin:0 0 8px;}
.platform-intro p {max-width:64ch;margin:0;color:var(--c-text-2);}
.platform-intro button {flex-shrink:0;}
.access-summary th {font-weight:500;}
.access-summary td {font-variant-numeric:tabular-nums;}
.permission-explanation {line-height:1.7;max-width:75ch;color:var(--c-text-2);margin-bottom:20px;}
@media(max-width:640px) {.workspace-delegation,.platform-intro {align-items:flex-start;flex-direction:column;gap:12px;}.workspace-delegation {padding:12px 16px;}.platform-intro {padding-bottom:20px;}}

.main-content .table-scroll .access-summary {min-width:0;width:100%;table-layout:fixed;}
.access-summary th,.access-summary td:last-child {white-space:normal;overflow-wrap:anywhere;}
.access-summary th:first-child {width:68%;}
.platform-summary th:first-child {width:30%;}
.platform-summary th:nth-child(2) {width:20%;}

/* Enterprise application and subscription operations inherit the workspace system. */
.commerce-login-link { color:var(--c-primary); background:none; border:0; padding:8px 0; font:inherit; text-decoration:underline; text-underline-offset:3px; width:auto; }
.commerce-public { padding:36px; }
.commerce-public h2 { font-size:var(--fs-title); margin:14px 0; }
.commerce-public select,.commerce-public textarea { width:100%; }
.commerce-public .login-submit { width:100%; }
.commerce-public-order { margin:20px 0; padding:18px 0; border-block:1px solid var(--c-border); }
.commerce-public-order p { margin:10px 0; }
.commerce-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 18px; }
.commerce-checks { border:0; padding:0; margin:20px 0; }
.commerce-checks legend { font-size:var(--fs-small); margin-bottom:4px; }
.commerce-checks label,.commerce-check { display:flex!important; align-items:flex-start; gap:9px; font-size:var(--fs-small); line-height:1.65; }
.commerce-checks input,.commerce-check input { width:18px!important; height:18px; min-height:18px!important; margin:4px 0 0!important; padding:0!important; flex-shrink:0; }
.commerce-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:22px 0 16px; }
.commerce-tabs button[aria-current], .commerce-tabs button[aria-current]:hover { background:var(--c-primary); color:#fff; border-color:var(--c-primary); }
.commerce-panel h3 { margin-bottom:14px; }
.commerce-row { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:22px 0; border-bottom:1px solid var(--c-border); }
.commerce-row>div:first-child { min-width:0; flex:1; }
.commerce-row h4 { font-size:var(--fs-body); margin:0 0 9px; line-height:1.8; }
.commerce-row p { line-height:1.7; margin:6px 0; overflow-wrap:anywhere; }
.commerce-row .commerce-actions { max-width:235px; margin:0; flex-shrink:0; }
.commerce-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:20px 0 0; }
.commerce-actions button { width:auto; }
.commerce-note { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
.commerce-price { font-size:var(--fs-title); font-variant-numeric:tabular-nums; }
.commerce-price small { font-size:var(--fs-small); font-weight:400; color:var(--c-muted); }
.commerce-empty { padding:32px 0; color:var(--c-muted); line-height:1.8; }
.commerce-error { margin:12px 0; overflow-wrap:anywhere; }
.commerce-table { overflow-x:auto; }
.commerce-table td { overflow-wrap:anywhere; min-width:110px; }
.commerce-dialog { border:1px solid var(--c-border); border-radius:14px; padding:28px; width:min(620px,calc(100% - 32px)); max-height:calc(100dvh - 40px); overflow:auto; margin:auto; color:var(--c-text); }
.commerce-dialog::backdrop { background:rgb(23 42 67 / 40%); }
.commerce-dialog h2 { font-size:var(--fs-title); margin-bottom:18px; }
.commerce-dialog label:not(.commerce-check) { display:block; margin:18px 0 8px; font-size:var(--fs-small); }
.commerce-dialog input:not([type=checkbox]),.commerce-dialog select,.commerce-dialog textarea { width:100%; }
.commerce-dialog p { line-height:1.75; margin:10px 0; }
.commerce-dialog .commerce-actions { justify-content:flex-end; }
@media(max-width:700px) {
 .commerce-row { display:block; }
 .commerce-row .commerce-actions { margin-top:14px; max-width:none; }
 .commerce-fields { grid-template-columns:1fr; }
 .commerce-public { padding:28px 24px; }
 .commerce-dialog { padding:22px; }
 .commerce-tabs { gap:6px; }
 .commerce-tabs button { flex:1 1 42%; }
}

/* Enterprise operations: a compact work list, with deliberate mobile scrolling. */
.operations-filters { display:flex; align-items:end; flex-wrap:wrap; gap:12px; }
.operations-filters > div:first-child { flex:1 1 250px; }
.operations-filters > div:nth-child(2) { flex:0 1 210px; }
.operations-filters label { display:block; margin-bottom:6px; }
.operations-filters input,.operations-filters select { width:100%; margin:0; }
.operations-count { margin-top:20px; }
.operations-table { overflow-x:auto; margin:12px 0; }
.operations-table table { min-width:850px; }
.operations-table td { vertical-align:top; }
.operations-table small { display:block; color:var(--c-muted); margin-top:5px; }
.operations-table td:first-child { min-width:180px; max-width:260px; overflow-wrap:anywhere; }
.operations-actions,.operations-pagination { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.operations-pagination { justify-content:flex-end; margin-top:18px; }
.operations-flags { display:flex; gap:5px; flex-wrap:wrap; max-width:270px; margin-bottom:10px; }
.operations-flags span { font-size:12px; color:var(--c-text-2); background:var(--c-surface); border-radius:4px; padding:3px 6px; }
.operations-todos { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:0; border-block:1px solid var(--c-border); margin-block:16px; }
.operations-todos button.secondary { display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; border:0; border-radius:0; padding:16px 12px; background:transparent; color:var(--c-text); }
.operations-todos button.secondary:hover { background:var(--c-primary-soft); }
.operations-todos strong { font-size:22px; font-variant-numeric:tabular-nums; }
.operations-receipts { padding-top:4px; }
.operations-receipts strong { font-size:24px; }
.operations-receipt-detail { display:grid; grid-template-columns:110px minmax(0,1fr); gap:12px; }
.operations-receipt-detail dt { color:var(--c-muted); }
.operations-receipt-detail dd { margin:0; overflow-wrap:anywhere; white-space:pre-wrap; }
@media(max-width:600px) {
 .operations-filters > div,.operations-filters > div:nth-child(2) { flex:1 1 100%; }
 .operations-todos { grid-template-columns:1fr; }
 .operations-receipt-detail { grid-template-columns:1fr; gap:6px; }
 .operations-receipt-detail dd { margin-bottom:8px; }
}

.commerce-service-state { margin-top:12px; color:var(--c-text); }
.commerce-service-state span { display:block; color:var(--c-muted); font-size:13px; margin-top:4px; }
.commerce-delivery-note { border-left:3px solid var(--c-primary); padding-left:12px; margin-top:12px; }
.commerce-delivery-note p { margin:4px 0; max-width:65ch; }

/* Merchant setup: a sequential workbench with a stable, compact task rail. */
.setup-track{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-bottom:1px solid var(--c-border,#dfe6ee);margin:20px 0 16px;gap:4px}
.setup-track-item{display:flex;align-items:center;gap:10px;text-align:left;background:transparent;color:#52637a;border-radius:4px 4px 0 0;border:0;border-bottom:3px solid transparent;padding:14px 12px;font-weight:500;min-height:56px}
.setup-track-item:hover{background:#edf4f5;color:#203451}.setup-track-item.current{color:#086672;border-bottom-color:#087786;background:#eaf5f5;font-weight:600}
.setup-track-item span{display:grid;place-items:center;flex:0 0 26px;height:26px;border:1px solid currentColor;border-radius:50%;font-size:13px}.setup-track-item.current span{background:#087786;color:#fff;border-color:#087786}
.setup-notice{max-width:80ch;padding:12px 16px;background:#edf4f8;border-left:3px solid #8298ad;font-size:13px;line-height:1.7;color:#3b5067;margin:16px 0}
.setup-workbench{background:#fff;border:1px solid #dfe6ee;border-radius:10px;padding:28px;margin-top:20px}.setup-workbench h3{margin:0 0 12px}.setup-workbench h4{margin:0 0 8px}.setup-workbench p{max-width:78ch;line-height:1.7}.setup-workbench label{display:block;margin:18px 0 8px;font-weight:500}.setup-workbench input,.setup-workbench textarea,.setup-workbench select{max-width:680px}
.setup-workbench fieldset{border:0;padding:0;margin:0;min-width:0}.setup-fields{display:grid;grid-template-columns:1fr 1fr;gap:24px;max-width:900px}.setup-consent{display:flex!important;align-items:flex-start;gap:8px}.setup-consent input{width:18px;height:18px;flex-shrink:0;margin:2px 0}.setup-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.setup-task{display:flex;justify-content:space-between;align-items:center;gap:24px;border-bottom:1px solid #dfe6ee;padding:24px 0}.setup-task button{flex-shrink:0}.setup-error{border:1px solid #dcacac;border-radius:6px;padding:14px;color:#9d2828;background:#fff5f5}.setup-workbench [hidden],.setup-error[hidden]{display:none!important}
.setup-track-item:focus-visible,.setup-workbench button:focus-visible{outline:3px solid #087786;outline-offset:3px}
#setupEvidence>.onboarding-intro{margin-top:24px}
@media(max-width:700px){.setup-track{grid-template-columns:1fr 1fr}.setup-track-item{font-size:13px;padding:12px 8px;gap:8px}.setup-workbench{padding:18px 14px}.setup-fields{grid-template-columns:1fr;gap:0}.setup-task{display:block}.setup-task button{margin-top:10px}.setup-actions>button{min-height:44px;flex-grow:1}}

.setup-header-actions{display:flex;flex-wrap:wrap;gap:10px}

.channel-config-form fieldset{border:0;padding:0;margin:0;min-width:0}.channel-config-form .field-help{line-height:1.7;margin:8px 0 14px}.channel-config-form .flex{flex-wrap:wrap;gap:10px}.channel-config-form input[type=password]{font-family:inherit}.channel-config-form [hidden]{display:none!important}
/* Reception controls stay above the conversation grid; the message draft is untouched. */
.reception-status{border:1px solid var(--c-border);background:#fff;border-radius:12px;padding:20px 24px;margin-bottom:24px;color:#203451}
.reception-main{display:flex;justify-content:space-between;align-items:center;gap:20px}
.reception-main strong{font-size:var(--fs-subtitle,18px)}
.reception-actions{display:flex;gap:8px;flex-wrap:wrap}
.reception-status p{margin:8px 0;max-width:80ch}
.reception-team{margin-top:16px;border-top:1px solid var(--c-border);padding-top:14px}
.reception-team summary{cursor:pointer;font-weight:600;padding:4px 0}
.reception-team summary:focus-visible{outline:2px solid #087786;outline-offset:4px}
.reception-attention{background:#fff7e8;color:#79520c;padding:12px;border-radius:8px}
.reception-table-wrap{overflow-x:auto}
.reception-table-wrap table{min-width:520px}
.reception-table-wrap small{display:block;color:var(--c-muted);margin-top:4px}
@media(max-width:640px){.reception-status{padding:16px}.reception-main{align-items:flex-start;flex-direction:column;gap:8px}.reception-actions{width:100%}.reception-actions button{flex:1;min-width:88px}}

/* Waiting and handover: a compact list with priority visible through text and color. */
.handoff-filters {display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px;}
.handoff-filters label {flex:1;min-width:115px;font-size:13px;color:#4b5e72;}
.handoff-filters select {width:100%;margin-top:5px;}
.handoff-wait {margin:8px 0 4px;font-size:13px;font-weight:600;color:#4b5e72;}
.handoff-wait.needs-attention {color:#8a4b00;background:#fff4dd;padding:6px 8px;border-left:3px solid #b36b00;}
.handoff-context {margin:5px 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:13px;}
.handoff-pages {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;font-size:12px;color:#4b5e72;}
.handoff-pages>div,.handoff-dialog-actions {display:flex;gap:8px;flex-wrap:wrap;}
.handoff-detail {margin:8px 0;padding:10px 12px;background:#f0f6f8;border-left:3px solid #087786;}
.handoff-detail p {margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;}
#handoffRequeueDialog .modal {max-width:540px;width:calc(100% - 32px);}
#handoffRequeueDialog textarea {width:100%;margin-top:6px;}
.handoff-dialog-actions {justify-content:flex-end;margin-top:16px;}

#agentQueue {max-height:600px;overflow-y:auto;scrollbar-gutter:stable;}
