:root {
  --bg: #edf3f6; --panel: #ffffff; --panel-2: #f5f9fb; --line: #d7e4eb;
  --line2: #e9eff3; --line-strong: #bdced9; --text: #182f41; --text2: #345269;
  --sub: #526b7d; --muted: #596f80; --brand: #126685; --brand-d: #143e56;
  --brand-2: #187da0; --brand-soft: #dfedf3; --brand-tint: #eff7fa;
  --grad-brand: #155671; --grad-brand-h: #124862; --sidebar: #153447; --sidebar-2: #1b3b4e;
  --sidebar-3: #254c5e; --radius: 10px; --sidebar-width: 218px;
  --shadow: 0 1px 2px #102e4210; --shadow-md: 0 2px 5px #102e4217; --shadow-lg: 0 14px 52px #102e422e;
  --desk-font: "Aptos", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", system-ui, sans-serif;
}

body, button, input, textarea, select { font-family: var(--desk-font); }
body { -webkit-font-smoothing: antialiased; color: var(--text); }
button, a { touch-action: manipulation; }
:where(a, button, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid #0086a6; outline-offset: 3px; }
.app { height: 100vh; height: 100dvh; }
.app .sidebar { width: var(--sidebar-width); background: var(--sidebar); color: #d5e6ee; box-shadow: none; border-right: 1px solid #294d62; }
.app .sidebar::before { content: none; }
.app .logo { min-height: 62px; padding: 12px 15px; gap: 9px; font-size: 17px; }
.app .logo .logout { margin-left: auto; min-width: 32px; min-height: 32px; color: #e6f5f9; }
.app .workspace-label { display: block; padding: 0 16px 10px; color: #9bc6d5; font-size: 12px; }
.app .nav { padding: 1px 8px; }
.app .nav .grp { color: #9cb8c8; font-size: 11px; padding: 14px 10px 5px; letter-spacing: 0; }
.app .nav a { color: #d1e3ec; min-height: 37px; margin: 1px 0; padding: 7px 10px; gap: 9px; border-radius: 6px; font-size: 13px; transition: background-color .12s, color .12s; transform: none; }
.app .nav a:hover { background: #244b61; color: #fff; transform: none; }
.app .nav a.active { background: #29546b; color: #f5fcff; box-shadow: none; }
.app .nav a.active::before { background: #85d8ec; box-shadow: none; height: 51%; top: 24.5%; }
.app .nav a.active .ico { color: #a3e5f4; }
.app .nav a .badge { box-shadow: none; }
.app .sidebar .foot { color: #b9d4e0; padding: 10px 16px; }
.app .sidebar .foot a { color: inherit; text-underline-offset: 3px; }
.app .topbar { min-height: 62px; height: auto; padding: 8px 21px; background: white; gap: 10px; backdrop-filter: none; }
.app .topbar h1 { font-size: 20px; line-height: 1.17; font-weight: 790; }
.app .topbar .crumb { display: block; padding: 0; border: 0; font-size: 11px; margin-top: 4px; }
.app .top-clock { font-size: 11px; padding: 2px 3px; }
.app .topbar .pill { padding: 5px 9px; font-size: 11px; background: #edf6f7; border-radius: 18px; }
.app .topbar .pill .dot { margin-right: 0; box-shadow: none; }
.app .top-user { gap: 7px; }
.app .top-user .uav { box-shadow: none; border-radius: 8px; background: #dceef3; color: #154860; }
.app .top-user .un { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 148px; }
.app .top-sep { display: none; }
.app .content { padding: 22px 24px; scroll-behavior: auto; min-height: 0; }
.app .page { animation: none; }
.app .sec-title { font-size: 24px; line-height: 1.18; font-weight: 780; }
.app .sec-desc { font-size: 13px; margin-bottom: 17px; }
.app .toolbar { gap: 8px; }
.app .grid { gap: 14px; }
.app .card, .app .stat { background: var(--panel); box-shadow: none; border-color: var(--line); }
.app .card { padding: 16px 18px; min-width: 0; }
.app .card:hover, .app .stat:hover { box-shadow: none; transform: none; border-color: var(--line); }
.app .card:has(> .tbl), .app .table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.app .stat .num { color: var(--text); font-size: 30px; }
.app .stat.c2 .num { color: #a1303b; }
.app .stat::before, .app .stat::after { content: none; }
.app .stat .ic { border-radius: 8px; opacity: .92; }
.app .tbl th { padding: 9px 10px; background: #edf5f8; color: #405d70; letter-spacing: 0; }
.app .tbl td { padding: 10px; }
.app .tbl tbody tr:hover { background: #eff7fa; }
.app .btn, .modal .btn, .login-card .btn { box-shadow: none; border-radius: 7px; transition: color .12s, background-color .12s, border-color .12s; }
.app .btn:hover, .modal .btn:hover, .login-card .btn:hover { transform: none; box-shadow: none; }
.app .btn.ghost, .modal .btn.ghost { border-color: #bcd3df; }
.app input.inp, .app select.inp, .app textarea.inp { max-width: 100%; background: #f8fbfc; border-color: #bcd1dd; border-radius: 7px; }
.app .seg, .app .seg button { border-radius: 7px; }
.app #nav [hidden], .app [hidden] { display: none !important; }
.app .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.overview-lead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 18px 20px; border: 1px solid #c8dfe8; border-radius: 10px; background: #e3f2f6; }
.overview-lead .sec-title { margin: 0; }
.overview-lead .sec-desc { margin: 6px 0 0; }
.overview-lead .btn { flex-shrink: 0; white-space: nowrap; }
.channel-meter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.channel-meter-list li {
  display: grid; grid-template-columns: minmax(90px,.7fr) minmax(0,1.8fr) 3ch;
  align-items: center; gap: 8px; font-size: 12px; color: var(--text2);
}
.channel-meter-list strong { overflow-wrap: anywhere; }
.channel-meter-list span { text-align: right; font-variant-numeric: tabular-nums; }
.channel-meter-list meter { width: 100%; height: 12px; accent-color: var(--brand); }

.app #page-inbox.active { display: flex; height: 100%; min-height: 450px; }
.app .inbox { width: 100%; height: 100%; grid-template-columns: minmax(240px, 25%) minmax(0,1fr) minmax(218px, 23%); grid-template-rows: minmax(0,1fr); box-shadow: none; border-color: var(--line); }
.app .inbox.hide-cust { grid-template-columns: minmax(240px,26%) minmax(0,1fr); }
.app .inbox.hide-cust .customer-shell { display: none; }
.app .conv-list { background: #f1f7fa; }
.app .conv-list .head { padding: 13px 13px 11px; background: #f9fcfd; }
.queue-heading { margin-bottom: 10px; font-size: 15px; line-height: 1.25; font-weight: 780; }
.app .conv-list .head input { width: 100%; }
.queue-quick { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin: 0 0 11px; }
.queue-quick button { min-width: 0; display: flex; justify-content: space-between; gap: 3px; align-items: center; padding: 6px; min-height: 37px; border: 1px solid #cedfe8; border-radius: 6px; background: #edf5f8; font-size: 11px; color: #36586b; white-space: nowrap; }
.queue-quick button:hover { background: #dfedf3; }
.queue-quick button[aria-pressed="true"] { color: #123f56; border-color: #619bb1; background: #d9edf3; }
.queue-quick button strong { font-variant-numeric: tabular-nums; }
.queue-quick button.has-overdue strong { color: #9a2634; }
.app .conv-list .filters button { border-radius: 6px; padding-block: 6px; }
.app .conv-list .filters button.active { color: var(--brand-d); background: #dfedf3; box-shadow: inset 0 -2px #207590; }
.app .inbox-queue-tools { margin-top: 7px; }
.app .inbox-queue-tools select { max-width: 100%; background: #f8fbfc; border-radius: 6px; padding: 6px 7px; }
.app .conv-item { padding: 10px 11px; border-left: 3px solid transparent; border-bottom-color: #e3edf1; }
.app .conv-item:hover { background: #eaf4f8; }
.app .conv-item.active { padding-left: 11px; border-left-color: #14799a; background: #e0f0f6; }
.app .conv-item:focus-visible { outline-offset: -3px; }
.app .conv-item .ub { box-shadow: none; bottom: 10px; right: 10px; }
.app .conv-item .r2 { margin-right: 14px; }
.app .chat-head { padding: 11px 12px; gap: 7px; flex-wrap: wrap; }
.app .chat-head .nm { font-size: 15px; }
.app .chat-head .meta { max-width: 45ch; overflow-wrap: anywhere; }
.app .chat-head .btn { min-height: 32px; }
.app .chat-head #assignSelect { min-height: 31px; }
.app .msgs { background: #f4f9fb; padding: 17px clamp(13px,2vw,26px); gap: 13px; overscroll-behavior: contain; }
.app .msg { max-width: 83%; animation: none; }
.app .msg .bub { border-color: #d4e3ea; box-shadow: none; border-radius: 9px; padding: 9px 11px; white-space: pre-wrap; }
.app .msg.right .bub { border-color: #1b5873; background: #1b5873; color: white; }
.app .msg.ai .bub { background: #e8f3f7; border-color: #c9e0eb; }
.app .msg.ai .who { color: #346782; }
.app .msg.right button, .app .msg.right .inbox-translate-message { color: #e5f8ff; }
.app .composer { padding: 11px 12px; }
.app .composer textarea { height: 70px; background: #f9fcfd; border-radius: 8px; }
.app .composer .sendrow { justify-content: flex-start; gap: 7px; flex-wrap: wrap; }
#workbenchSend { margin-left: auto; min-width: 62px; }
.app .inbox-translation { padding: 6px 7px; margin-bottom: 7px; gap: 5px 9px; background: #edf6fa; }
.app .inbox-translation select { color: var(--text); }
.customer-shell { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #f0f6f9; }
.customer-shell .customer-title { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--line); min-height: 45px; }
.customer-shell .customer-title h2 { font-size: 14px; }
.customer-shell .cust { display: block; flex: 1; min-height: 0; padding: 12px; border: 0; background: transparent; }
.customer-shell .cust h4 { font-size: 12px; letter-spacing: 0; margin: 15px 0 5px; }
.customer-shell .cust .kv { padding: 6px 0; }
.customer-shell .cust .hint { overflow-wrap: anywhere; }
#workbenchCustomerClose, #workbenchMenu, #workbenchNavCover, #workbenchCustomerCover { display: none; }

.mask, .modal, .drawer { overscroll-behavior: contain; }
.modal { border-radius: 13px; }
.modal .mb { overflow: auto; }
.drawer { max-width: 100vw; }
.login-mask { background: #e2eff4; overflow-y: auto; padding: 18px; }
.login-mask::before, .login-mask::after { content: none; }
.login-mask.show { display: flex; align-items: center; justify-content: center; }
.login-frame { width: min(820px, 100%); display: grid; grid-template-columns: minmax(0,1fr) minmax(290px,.82fr); overflow: hidden; background: #fbfdfe; border: 1px solid #b5cfdc; border-radius: 15px; box-shadow: 0 20px 54px #183b5330; }
.login-context { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding: clamp(24px,5vw,54px); background: #153d56; color: #ebf7fd; }
.login-context a { color: #c1effc; font-size: 13px; text-underline-offset: 4px; }
.login-context strong { color: white; font-size: clamp(25px,4vw,39px); line-height: 1.14; font-weight: 790; letter-spacing: -.04em; }
.login-context p { max-width: 16rem; color: #cee3eb; font-size: 14px; }
.login-card { width: 100%; max-width: none; background: #fbfdfe; border: 0; border-radius: 0; padding: 25px clamp(18px,3.4vw,34px); box-shadow: none; backdrop-filter: none; text-align: left; animation: none; }
.login-card .service24-login-mark { display: none; }
.login-card h2 { font-size: 24px; }
.login-card .workspace-login-label { color: #1d607e; margin: 0 0 4px; font-size: 12px; }
.login-card p.hint { margin-bottom: 16px; }
.login-card label { display: block; font-size: 13px; font-weight: 690; color: var(--text2); margin-bottom: 4px; }
.login-card .inp { width: 100%; margin-bottom: 10px; border-radius: 7px; }
.login-card .btn { min-height: 42px; }

@media (max-width: 1300px) {
  :root { --sidebar-width: 190px; }
  .app .top-clock { display: none; }
  .app .inbox { grid-template-columns: 220px minmax(0,1fr) 205px; }
  .app .inbox.hide-cust { grid-template-columns: 220px minmax(0,1fr); }
}
@media (max-width: 1080px) {
  .app .topbar { padding-inline: 12px; }
  .app .topbar #workbenchVisitorLink { display: none; }
  .app .inbox { grid-template-columns: 220px minmax(0,1fr); }
  .app .inbox:not(.show-customer-sheet) .customer-shell { display: none; }
  .app .inbox.show-customer-sheet .customer-shell { display: flex; position: fixed; z-index: 24; inset: 0 0 0 auto; width: min(340px,100vw - 20px); box-shadow: var(--shadow-lg); }
  .app .inbox.show-customer-sheet #workbenchCustomerCover { display: block; }
  #workbenchCustomerClose { display: inline-flex; }
}
@media (max-width: 900px) {
  .app .sidebar { position: fixed; z-index: 22; width: 226px; inset: 0 auto 0 0; visibility: hidden; }
  .app.menu-open .sidebar { visibility: visible; }
  .app.menu-open #workbenchNavCover { display: block; }
  #workbenchNavCover, #workbenchCustomerCover { position: fixed; inset: 0; background: #0c2b3d70; border: 0; }
  #workbenchNavCover { z-index: 21; }
  #workbenchCustomerCover { z-index: 23; }
  #workbenchMenu { display: inline-flex; }
  .app .sidebar .foot { font-size: 11px; justify-content: flex-start; }
  .app .sidebar .logo .logout { display: inline-flex; align-items: center; justify-content: center; }
  .app .nav a { justify-content: flex-start; }
  .app .nav a .badge { display: initial; }
  .app .topbar { gap: 6px; min-height: 57px; }
  .app .topbar h1 { font-size: 16px; }
  .app .topbar .crumb, .app .top-user > div:nth-child(2) { display: none; }
  .app .top-user { padding: 0; }
  .app .topbar .pill { font-size: 10px; padding: 4px 6px; white-space: nowrap; }
  .app .topbar .btn { min-height: 37px; padding: 5px 8px; font-size: 12px; white-space: nowrap; }
  .app .content { padding: 12px; }
  .app #page-inbox.active { min-height: 390px; }
  .app .inbox, .app .inbox.hide-cust { grid-template-columns: minmax(0,1fr); }
  .app .inbox .chat-head #custToggle { display: inline-flex; }
}
@media (max-width: 520px) {
  .app .topbar { flex-wrap: wrap; justify-content: flex-start; }
  .app .topbar .pill { padding-inline: 3px; }
  .app .topbar #service24Duty, .app .topbar #inboxNotifications { font-size: 11px; min-height: 32px; padding-inline: 6px; }
  .app .top-user { display: none; }
  .app .overview-lead { padding: 12px; gap: 6px; }
  .app .sec-title { font-size: 20px; }
  .app .grid.g4 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .app .stat { padding: 9px; }
  .app .stat .ic { display: none; }
  .app .chat-head { gap: 5px; padding: 6px; }
  .app .composer { padding: 7px; }
  .app .composer textarea { height: 57px; }
  .app .chat-head .btn, .app .composer .btn { min-height: 36px; }
  .login-frame { grid-template-columns: minmax(0,1fr); max-width: 420px; }
  .login-context { display: none; }
  .login-card .service24-login-mark { margin: 0 0 10px; display: block; width: 43px; height: 43px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
