/* Subtle, readable state badges in both themes. */
html:root body .record-status[class*="lead-state-"] {display:inline-flex;align-items:center;gap:7px;border:1px solid var(--state-border);background:var(--state-bg);color:var(--state-text);border-radius:20px;padding:5px 10px;font-size:12px;font-weight:650;white-space:nowrap}
.record-status[class*="lead-state-"]::before {content:'';width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.lead-state-new {--state-bg:#eaf2fc;--state-text:#245785;--state-border:#b3cee9}
.lead-state-contacted {--state-bg:#fff2db;--state-text:#81520f;--state-border:#ddbf87}
.lead-state-qualified {--state-bg:#f0eafa;--state-text:#60418a;--state-border:#c3addd}
.lead-state-unqualified {--state-bg:#edf0f4;--state-text:#526174;--state-border:#c2ccd6}
.lead-state-converted {--state-bg:#e4f3ec;--state-text:#1c644e;--state-border:#9ccdb9}
html[data-theme="dark"] .lead-state-new {--state-bg:#213b53;--state-text:#bbdefc;--state-border:#517b9e}
html[data-theme="dark"] .lead-state-contacted {--state-bg:#403322;--state-text:#f4d294;--state-border:#a18550}
html[data-theme="dark"] .lead-state-qualified {--state-bg:#382e4b;--state-text:#e3d2fa;--state-border:#89719f}
html[data-theme="dark"] .lead-state-unqualified {--state-bg:#2c3642;--state-text:#d0dbe6;--state-border:#607184}
html[data-theme="dark"] .lead-state-converted {--state-bg:#203e35;--state-text:#b4ead5;--state-border:#508c75}
.followup-history {margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
.followup-history summary {cursor:pointer;font-weight:650;padding:8px 0}
.followup-history ol {list-style:none;padding:0 0 0 16px;border-left:2px solid #9bb4ca}
.followup-history li {padding:12px 0;border-bottom:1px solid var(--line)}
.followup-history small {display:block;margin:6px 0;line-height:1.6}
.followup-history p {white-space:pre-wrap;overflow-wrap:anywhere}
/* Commercial agenda: self-contained colors preserve contrast across themes. */
.lead-agenda-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.lead-agenda-card{display:flex;flex-direction:column;gap:10px;padding:22px;border:1px solid var(--agenda-line);border-top:3px solid var(--agenda-accent);border-radius:12px;background:var(--agenda-bg);color:var(--agenda-text);transition:box-shadow .16s,border-color .16s}
.lead-agenda-card>span:first-child{font-weight:650}.lead-agenda-card>strong{font-size:30px;line-height:1.2;overflow-wrap:anywhere}.lead-agenda-card small{line-height:1.6}.lead-agenda-card .agenda-open{margin-top:auto;padding-top:8px;font-size:12px;font-weight:650}
.lead-agenda-card:hover{box-shadow:0 4px 14px #10243a18;border-color:var(--agenda-accent)}
.agenda-today{--agenda-bg:#edf4fc;--agenda-text:#245785;--agenda-line:#bdd3e8;--agenda-accent:#447dab}
.agenda-overdue{--agenda-bg:#fff3e0;--agenda-text:#805117;--agenda-line:#e5c991;--agenda-accent:#b58231}
.agenda-unscheduled{--agenda-bg:#f2eef8;--agenda-text:#60418a;--agenda-line:#d0bedf;--agenda-accent:#9377ad}
html[data-theme="dark"] .agenda-today{--agenda-bg:#20374d;--agenda-text:#c7e3fc;--agenda-line:#4c6c89;--agenda-accent:#79aacf}
html[data-theme="dark"] .agenda-overdue{--agenda-bg:#3a3124;--agenda-text:#f3d6a3;--agenda-line:#877148;--agenda-accent:#c8a368}
html[data-theme="dark"] .agenda-unscheduled{--agenda-bg:#332d43;--agenda-text:#e2d5f4;--agenda-line:#7f6d96;--agenda-accent:#ad96c6}
@media(max-width:760px){.lead-agenda-grid{grid-template-columns:1fr}.lead-agenda-card{padding:18px}}
@media(prefers-reduced-motion:reduce){.lead-agenda-card{transition:none}}

.next-contact-cell{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:155px}.next-contact-cell time{font-size:12px;line-height:1.5;color:#33465b}.next-contact-cell small{font-size:11px;color:#526174}html[data-theme="dark"] .next-contact-cell time{color:#e0eaf4}html[data-theme="dark"] .next-contact-cell small{color:#bacbdd}

[data-followup-section]{scroll-margin-top:20px;border-radius:8px}[data-followup-section]:focus{outline:2px solid #648eaf;outline-offset:6px}button[data-followup-target]{display:block;margin-top:8px;white-space:normal;min-width:150px}

.lead-responsible-name{margin-top:7px;min-width:130px;max-width:220px;white-space:normal;overflow-wrap:anywhere;color:#33465b;font-weight:600}html[data-theme="dark"] .lead-responsible-name{color:#e0eaf4}

button[data-assign-lead]{display:block;margin-top:8px;white-space:normal;min-width:150px}

.active-customer-filters{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px 18px;margin:0 0 18px;border:1px solid #c4d4e4;border-radius:12px;background:#f3f7fb;color:#29455e}.active-customer-filters>strong{font-size:12px}.customer-filter-chips{display:flex;flex-wrap:wrap;gap:8px;flex:1}.customer-filter-chip{display:inline-flex;align-items:center;gap:12px;max-width:100%;padding:8px 12px;border:1px solid #adc5dd;border-radius:20px;background:#e6eff8;color:#204f79;font:inherit;font-size:12px;cursor:pointer;min-height:36px}.customer-filter-chip>span:first-child{overflow-wrap:anywhere;text-align:left}.customer-filter-chip>span:last-child{font-size:18px;line-height:1}.customer-filter-chip:hover{background:#d6e6f5}.customer-filter-chip:focus-visible{outline:2px solid #276caa;outline-offset:3px}html[data-theme="dark"] .active-customer-filters{background:#1b2e40;border-color:#425e78;color:#d9e7f5}html[data-theme="dark"] .customer-filter-chip{background:#243e55;border-color:#6386a4;color:#d2e8fc}html[data-theme="dark"] .customer-filter-chip:hover{background:#304e68}html[data-theme="dark"] .customer-filter-chip:focus-visible{outline-color:#a4d3ff}

/* Inbox filters and conversation identity */
#inbox-root [data-commercial-filter="all"]{--chip-bg:#edf1f5;--chip-text:#35485d;--chip-border:#b5c3d1}
html[data-theme="dark"] #inbox-root [data-commercial-filter="all"]{--chip-bg:#293949;--chip-text:#e2eaf4;--chip-border:#75899e}
#inbox-root [data-commercial-filter="interested"]{--chip-bg:#e4f4ec;--chip-text:#185c43;--chip-border:#9bbfaa}
html[data-theme="dark"] #inbox-root [data-commercial-filter="interested"]{--chip-bg:#203f35;--chip-text:#bdf0d8;--chip-border:#5e9e83}
#inbox-root [data-commercial-filter="pending"]{--chip-bg:#fff1da;--chip-text:#795017;--chip-border:#d6b77f}
html[data-theme="dark"] #inbox-root [data-commercial-filter="pending"]{--chip-bg:#423521;--chip-text:#ffe0a5;--chip-border:#ba9658}
#inbox-root [data-commercial-filter="requested"]{--chip-bg:#f0e9fa;--chip-text:#63408a;--chip-border:#bea9d6}
html[data-theme="dark"] #inbox-root [data-commercial-filter="requested"]{--chip-bg:#382c49;--chip-text:#ead5ff;--chip-border:#a087ba}
#inbox-root [data-commercial-filter="human"]{--chip-bg:#e7f1fc;--chip-text:#245d8d;--chip-border:#9fbfdb}
html[data-theme="dark"] #inbox-root [data-commercial-filter="human"]{--chip-bg:#243c55;--chip-text:#c9e6ff;--chip-border:#719bbd}
#inbox-root [data-commercial-filter]{background:var(--chip-bg);color:var(--chip-text);border:1px solid var(--chip-border);font-size:12px;font-weight:600;min-height:36px;padding:7px 11px}#inbox-root [data-commercial-filter][aria-pressed="true"]{outline:2px solid var(--chip-border);outline-offset:2px;font-weight:750;box-shadow:inset 0 -3px var(--chip-border)}#inbox-root [data-commercial-filter]:focus-visible,#inbox-root .inbox-item:focus-visible{outline:2px solid #70b9f5;outline-offset:2px}
#inbox-root .inbox-item{background:#f6f8fb;border:1px solid #d5dfe8!important;margin:6px 0;padding:12px 10px!important;gap:10px}#inbox-root .inbox-item:hover{background:#eaf0f7}#inbox-root .inbox-item.selected{background:#e4eef9;border-color:#749fc5!important;box-shadow:inset 3px 0 #367cac}
#inbox-root .chat-list-text strong{color:#24364b;font-size:14px;font-weight:700}#inbox-root .chat-list-text small{color:#4c6076;font-size:12px;line-height:1.5}#inbox-root .chat-list-meta{max-width:85px;flex-shrink:0;gap:7px}#inbox-root .chat-list-meta>small{font-size:10px;line-height:1.4;color:#53677d}
#inbox-root .chat-list-text .chat-list-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px;white-space:normal;max-width:none}#inbox-root .chat-list-text .chat-list-tag{display:inline-block;max-width:100%;padding:2px 6px;border-radius:6px;background:#eee7f6;color:#624184;border:1px solid #c5b2da;font-size:10px}
#inbox-root .inbox-state{display:inline-block;font-size:11px;font-weight:650;padding:3px 7px;border-radius:6px;line-height:1.35;border:1px solid}.state-bot{background:#e4f4ec;color:#185c43;border-color:#9bbfaa!important}.state-paused{background:#fff1da;color:#795017;border-color:#d6b77f!important}.state-stopped{background:#fbe8eb;color:#8b3048;border-color:#d8a0ad!important}.state-pinned{background:#e7f1fc;color:#245d8d;border-color:#9fbfdb!important}
html[data-theme="dark"] #inbox-root .inbox-item{background:#1c3042;border-color:#3c5368!important}html[data-theme="dark"] #inbox-root .inbox-item:hover{background:#283f55}html[data-theme="dark"] #inbox-root .inbox-item.selected{background:#2b4762;border-color:#7da7ce!important;box-shadow:inset 3px 0 #9bccf5}html[data-theme="dark"] #inbox-root .chat-list-text strong{color:#f1f6ff}html[data-theme="dark"] #inbox-root .chat-list-text small{color:#cedbea}html[data-theme="dark"] #inbox-root .chat-list-meta>small{color:#becfe0}html[data-theme="dark"] #inbox-root .chat-list-text .chat-list-tag{background:#3b304c;color:#ead6ff;border-color:#957daf}
html[data-theme="dark"] #inbox-root .state-bot{background:#203f35;color:#bdf0d8}html[data-theme="dark"] #inbox-root .state-paused{background:#423521;color:#ffe0a5}html[data-theme="dark"] #inbox-root .state-stopped{background:#482c37;color:#ffcbd7}html[data-theme="dark"] #inbox-root .state-pinned{background:#243c55;color:#c9e6ff}
#inbox-root .avatar-tone-0{background:#edf1f5;color:#35485d;border:1px solid #b5c3d1}html[data-theme="dark"] #inbox-root .avatar-tone-0{background:#293949;color:#e2eaf4;border-color:#75899e}
#inbox-root .avatar-tone-1{background:#e4f4ec;color:#185c43;border:1px solid #9bbfaa}html[data-theme="dark"] #inbox-root .avatar-tone-1{background:#203f35;color:#bdf0d8;border-color:#5e9e83}
#inbox-root .avatar-tone-2{background:#fff1da;color:#795017;border:1px solid #d6b77f}html[data-theme="dark"] #inbox-root .avatar-tone-2{background:#423521;color:#ffe0a5;border-color:#ba9658}
#inbox-root .avatar-tone-3{background:#f0e9fa;color:#63408a;border:1px solid #bea9d6}html[data-theme="dark"] #inbox-root .avatar-tone-3{background:#382c49;color:#ead5ff;border-color:#a087ba}
#inbox-root .avatar-tone-4{background:#e7f1fc;color:#245d8d;border:1px solid #9fbfdb}html[data-theme="dark"] #inbox-root .avatar-tone-4{background:#243c55;color:#c9e6ff;border-color:#719bbd}

/* Counts inherit each commercial filter palette in both themes. */
#inbox-root .commercial-filters [data-commercial-filter]{display:inline-flex;align-items:center;gap:6px}
#inbox-root .commercial-filters .commercial-count{display:inline-flex;align-items:center;justify-content:center;min-width:21px;min-height:21px;padding:0 4px;border:1px solid var(--chip-border);border-radius:7px;background:var(--chip-bg);color:var(--chip-text);font-size:11px;font-weight:750;font-variant-numeric:tabular-nums;line-height:1.2}

/* Conversation attention details */
#inbox-root .chat-list-text .chat-attention-list{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;white-space:normal;overflow:visible}
#inbox-root .chat-list-text .chat-attention{display:inline-block;max-width:100%;padding:3px 6px;border:1px solid;border-radius:6px;font-size:11px;font-weight:600;line-height:1.4;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
#inbox-root .attention-owner,#inbox-root .attention-scheduled{background:#e7f1fc;color:#245d8d;border-color:#9fbfdb}
#inbox-root .attention-unassigned{background:#fff1da;color:#795017;border-color:#d6b77f}
#inbox-root .attention-overdue{background:#fce8e8;color:#922f37;border-color:#dca1a6}
html[data-theme="dark"] #inbox-root .attention-owner,html[data-theme="dark"] #inbox-root .attention-scheduled{background:#243c55;color:#c9e6ff;border-color:#719bbd}
html[data-theme="dark"] #inbox-root .attention-unassigned{background:#423521;color:#ffe0a5;border-color:#ba9658}
html[data-theme="dark"] #inbox-root .attention-overdue{background:#492c35;color:#ffd0d5;border-color:#b87987}
#inbox-root .chat-list-meta .chat-unread{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding:2px 6px;border-radius:12px;background:#126947;color:#fff;font-size:12px;font-weight:750;font-variant-numeric:tabular-nums}
html[data-theme="dark"] #inbox-root .chat-list-meta .chat-unread{background:#84e2b8;color:#10352a}

#inbox-root .inbox-sort-label{display:block;font-size:12px;font-weight:600;margin:8px 0 5px;color:#35485d}
html[data-theme="dark"] #inbox-root .inbox-sort-label{color:#d2e3f3}
#inbox-root #inbox-sort{width:100%;max-width:100%;margin-bottom:10px}

#inbox-root .history-search{display:flex;align-items:center;flex-wrap:wrap;gap:6px;flex-basis:100%;min-width:0}#inbox-root .history-search input{flex:1;min-width:120px;width:auto}#inbox-root .history-search small{flex-basis:100%;color:#35485d}html[data-theme="dark"] #inbox-root .history-search small{color:#d2e3f3}#inbox-root mark.history-match{background:#ffe39a;color:#392700;border-radius:3px}#inbox-root mark.current-match{background:#ffd15c;color:#291c00;outline:2px solid #956600;outline-offset:1px}

#inbox-root .chat-list-text .inbox-draft{display:inline-block;width:fit-content;padding:2px 6px;margin:4px 0;border:1px solid #c6a0cf;border-radius:6px;background:#f3e8f6;color:#713d7d;font-size:11px;font-weight:700}html[data-theme="dark"] #inbox-root .chat-list-text .inbox-draft{background:#402d48;color:#f1d0fb;border-color:#a981b5}

.quick-replies{width:min(620px,90vw);max-height:85vh;overflow:auto;padding:24px;border:1px solid #aac0d3;border-radius:16px;background:#f7f9fc;color:#20364c}.quick-replies::backdrop{background:#071523aa}.quick-replies label{display:block;margin:12px 0}.quick-replies input:not([type="hidden"]),.quick-replies textarea{display:block;box-sizing:border-box;width:100%;padding:10px;border:1px solid #91a9be;border-radius:8px;background:#fff;color:#20364c}.quick-replies article{padding:12px 0;border-bottom:1px solid #91a9be}.quick-replies article p{white-space:pre-wrap;overflow-wrap:anywhere}.quick-replies button{margin:4px;padding:8px 12px;border:1px solid #7497b5;border-radius:8px;background:#e3eef8;color:#204f79;cursor:pointer}.quick-replies button:disabled{opacity:.6;cursor:wait}html[data-theme="dark"] .quick-replies{background:#1c3042;color:#e8f2ff}html[data-theme="dark"] .quick-replies input,html[data-theme="dark"] .quick-replies textarea{background:#102132;color:#edf5ff}html[data-theme="dark"] .quick-replies button{background:#29465f;color:#d8ecff}

#inbox-root .inbox-row{position:relative}#inbox-root .inbox-row>.inbox-item{width:100%;padding-right:34px}#inbox-root .inbox-row-actions{position:absolute;right:4px;top:6px;z-index:2}#inbox-root .inbox-row-actions[open]{z-index:5}#inbox-root .inbox-row-actions summary{cursor:pointer;list-style:none;font-size:22px;padding:0 6px;color:#245d8d;border-radius:6px}#inbox-root .inbox-row-actions>div{position:absolute;right:0;min-width:210px;padding:6px;background:#f7f9fc;border:1px solid #92abc0;border-radius:10px;box-shadow:0 6px 16px #0003}#inbox-root .inbox-row-actions button{display:block;width:100%;padding:9px;text-align:left;background:#e7f1fc;color:#245d8d;border:1px solid #9fbfdb;border-radius:6px;margin:3px 0}html[data-theme="dark"] #inbox-root .inbox-row-actions summary{color:#c9e6ff}html[data-theme="dark"] #inbox-root .inbox-row-actions>div{background:#1c3042}html[data-theme="dark"] #inbox-root .inbox-row-actions button{background:#243c55;color:#c9e6ff;border-color:#719bbd}

#inbox-root .schedule-shortcuts{position:relative}#inbox-root .schedule-shortcuts summary{padding:10px;border:1px solid #9fbfdb;border-radius:10px;background:#e7f1fc;color:#245d8d;cursor:pointer}#inbox-root .schedule-shortcuts>div{display:flex;flex-wrap:wrap;gap:6px;padding:10px}#inbox-root .schedule-shortcuts small{width:100%;color:#35485d}html[data-theme="dark"] #inbox-root .schedule-shortcuts summary{background:#243c55;color:#c9e6ff;border-color:#719bbd}html[data-theme="dark"] #inbox-root .schedule-shortcuts small{color:#d2e3f3}

#inbox-root .inbox-extra-filters{display:grid;gap:5px;margin:8px 0 12px}#inbox-root .inbox-extra-filters label{font-size:12px;font-weight:600;color:#35485d}#inbox-root .inbox-extra-filters select{width:100%;max-width:100%}#inbox-root .inbox-extra-filters small{color:#35485d;font-size:11px}#inbox-root .inbox-active-filters:empty{display:none}#inbox-root .inbox-active-filters{padding:10px;margin-bottom:10px;border:1px solid #9fbfdb;border-radius:10px;background:#e7f1fc;color:#245d8d;font-size:12px;overflow-wrap:anywhere}#inbox-root .inbox-active-filters button{margin-top:6px;padding:6px 9px;border:1px solid #7497b5;border-radius:8px;background:#fff;color:#245d8d}html[data-theme="dark"] #inbox-root .inbox-extra-filters label,html[data-theme="dark"] #inbox-root .inbox-extra-filters small{color:#d2e3f3}html[data-theme="dark"] #inbox-root .inbox-active-filters,html[data-theme="dark"] #inbox-root .inbox-active-filters button{background:#243c55;color:#c9e6ff;border-color:#719bbd}

.internal-notes .internal-only{padding:10px;border:1px solid #c5a05b;border-radius:8px;background:#fff1da;color:#795017}.internal-notes article{border-left:3px solid #b79558;padding-left:12px}.internal-notes details p{white-space:pre-wrap;overflow-wrap:anywhere}html[data-theme="dark"] .internal-notes .internal-only{background:#423521;color:#ffe0a5;border-color:#ba9658}
/* Compact inbox: the conversation list owns the vertical space. */
#inbox-root .inbox-sidebar{position:relative;overflow:visible}
#inbox-root .inbox-search-tools{display:flex;align-items:center;gap:8px;margin:0 0 10px;position:relative}
#inbox-root .inbox-search-tools #inbox-search{min-width:0;flex:1;width:0;margin:0;height:42px}
#inbox-root .inbox-filter-menu{position:static;margin:0;border:0;padding:0;flex:none}
#inbox-root .inbox-filter-menu>summary{list-style:none;display:flex;align-items:center;justify-content:center;gap:3px;width:42px;height:42px;padding:0;border:1px solid #b8c8d6;border-radius:10px;background:#eef4f9;color:#294f6e;cursor:pointer;font-size:24px}
#inbox-root .inbox-filter-menu>summary::-webkit-details-marker{display:none}
#inbox-root .inbox-filter-menu[open]>summary{background:#dcecf9;border-color:#5689b1}
#inbox-root #inbox-filter-count:not(:empty){font-size:10px;background:#245d8d;color:white;border-radius:12px;min-width:16px;line-height:16px;text-align:center}
#inbox-root .inbox-filter-panel{position:absolute;z-index:30;top:calc(100% + 6px);left:0;right:0;max-height: min(520px,65vh);overflow-y:auto;padding:16px;border:1px solid #a9bed0;border-radius:14px;background:#fff;color:#263e53;box-shadow:0 16px 36px #071b3033}
#inbox-root .inbox-filter-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
#inbox-root .inbox-filter-heading button{width:30px;height:30px;padding:0;background:transparent;color:inherit;font-size:24px;border:0;cursor:pointer}
#inbox-root .inbox-filter-panel label{display:block;font-size:12px;margin:8px 0 5px}
#inbox-root .inbox-filter-panel select{width:100%;max-width:100%;margin:0;min-height:38px}
#inbox-root .inbox-filter-panel .inbox-workload{font-size:11px;line-height:1.5;margin:10px 0 0;color:inherit}
#inbox-root .commercial-filters{flex-wrap:nowrap;overflow-x:auto;gap:6px;margin:0 0 10px;padding:2px 2px 7px;scrollbar-width:thin}
#inbox-root .commercial-filters [data-commercial-filter]{flex:0 0 auto;white-space:nowrap;font-size:11px;padding:6px 9px;min-height:34px}
#inbox-root .commercial-filters .commercial-count{min-width:17px;min-height:17px;font-size:10px}
#inbox-root .inbox-list-head{margin:0;padding-top:12px;padding-bottom:12px}
#inbox-root .inbox-list-head h2{font-size:22px;margin:0}
#inbox-root .inbox-filter-menu summary:focus-visible,#inbox-root .inbox-filter-heading button:focus-visible{outline:2px solid #458dbd;outline-offset:3px}
html[data-theme="dark"] #inbox-root .inbox-filter-menu>summary{background:#243c50;border-color:#658298;color:#e5f2ff}
html[data-theme="dark"] #inbox-root .inbox-filter-menu[open]>summary{background:#305973;border-color:#8cb9d7}
html[data-theme="dark"] #inbox-root .inbox-filter-panel{background:#172c3c;border-color:#658298;color:#e5f2ff;box-shadow:0 16px 36px #0006}
/* The chat header stays subordinate to the conversation workspace. */
.layout.chat-workspace .topbar{height:52px;min-height:52px}
.layout.chat-workspace .content{padding-top:8px}
.layout.chat-workspace .page-heading{min-height:36px;padding:0;margin:0 0 8px;border:0;gap:12px;align-items:center}
.layout.chat-workspace .page-heading>div{min-width:0;padding:0;border:0}
.layout.chat-workspace .page-heading>div::before,.layout.chat-workspace .page-heading::before{display:none}
.layout.chat-workspace .page-heading .eyebrow,.layout.chat-workspace .page-heading h1,.layout.chat-workspace .page-heading>div>p{display:none}
.layout.chat-workspace .page-heading .workspace-user{display:block;background:none;border:0;border-radius:0;padding:0;margin:0;font-size:12px;line-height:1.4}
.layout.chat-workspace .page-heading>.btn{min-height:30px;padding:5px 10px;font-size:11px;flex-shrink:0}
.layout.chat-workspace #inbox-root .inbox-status{padding:8px 12px;gap:10px;font-size:11px;min-height:0}
.layout.chat-workspace #inbox-root .inbox-status strong{font-size:12px}
.layout.chat-workspace #bot-notice:empty{display:none}
/* Viewport-sized chat with independent scroll regions. */
.layout.chat-workspace{height:100dvh;min-height:0;overflow:hidden}
.layout.chat-workspace .main-wrap{height:100%;min-height:0;display:flex;flex-direction:column;min-width:0}
.layout.chat-workspace .topbar{flex:0 0 52px}
.layout.chat-workspace .content{flex:1;min-height:0;width:100%;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;padding-bottom:10px}
.layout.chat-workspace .page-heading{flex:none}
.layout.chat-workspace .page-footer{display:none}
.layout.chat-workspace #live-content{flex:1;min-height:0;display:flex;flex-direction:column}
.layout.chat-workspace #inbox-root{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.layout.chat-workspace .inbox-status{flex:none}
.layout.chat-workspace #bot-notice:not(:empty){flex:none;max-height:48px;overflow:auto;margin:0;padding:6px 12px;font-size:11px}
.layout.chat-workspace .inbox-grid{position:relative;display:grid;grid-template-columns:300px minmax(0,1fr);flex:1;min-height:0;overflow:hidden;align-items:stretch}
.layout.chat-workspace #inbox-root .inbox-sidebar{display:flex;flex-direction:column;min-height:0;padding-bottom:0}
.layout.chat-workspace .inbox-sidebar>*{flex-shrink:0}
.layout.chat-workspace #inbox-list{flex:1;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.layout.chat-workspace #inbox-chat{height:auto;min-height:0;overflow:hidden}
.layout.chat-workspace #inbox-chat .inbox-empty{min-height:0}
.layout.chat-workspace #inbox-chat .chat-messages{height:auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 5%}
.layout.chat-workspace .chat-heading{min-height:54px;padding:8px 14px}
.layout.chat-workspace .chat-toolbar{padding:6px 10px;max-height:120px;overflow:auto}
.layout.chat-workspace .chat-compose{padding:8px 12px;max-height:40%;overflow-y:auto}
.layout.chat-workspace #inbox-send textarea{resize:none;min-height:40px;max-height:100px}
.layout.chat-workspace #inbox-details{position:absolute;inset:0 0 0 auto;z-index:25;width:min(360px,100%);box-sizing:border-box;grid-column:auto;max-height:none;overflow-y:auto;border-top:0;border-left:1px solid #7890a4;box-shadow:-12px 0 28px #0003;padding:16px}
.layout.chat-workspace #inbox-details[hidden]{display:none!important}
.client-panel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:10px}
.client-panel-heading button{background:transparent;color:inherit;border:1px solid #7890a4;border-radius:8px;font-size:22px;width:32px;height:32px;cursor:pointer}
.layout.chat-workspace .chat-back{display:none}
.layout.chat-workspace #inbox-create:not([hidden]){max-height:45%;overflow:auto}
@media(max-width:900px){.layout.chat-workspace .inbox-grid{grid-template-columns:240px minmax(0,1fr)}}
@media(max-width:650px){
.layout.chat-workspace .inbox-grid{grid-template-columns:minmax(0,1fr)}
.layout.chat-workspace #inbox-chat{display:none}
.layout.chat-workspace .has-active-chat #inbox-chat{display:flex}
.layout.chat-workspace .has-active-chat .inbox-sidebar{display:none!important}
.layout.chat-workspace .chat-back{display:inline-block;background:transparent;color:inherit;border:1px solid #7890a4;border-radius:8px;padding:5px 9px;font-size:18px}
.layout.chat-workspace .inbox-status>span{display:none}
.layout.chat-workspace .chat-toolbar{max-height:85px}
}
/* Follow-up choices use the browser top layer, outside toolbar clipping. */
#inbox-root .schedule-shortcuts{display:inline-flex;flex:none}
#inbox-root #schedule-options{display:none;position:fixed;inset:0;margin:auto;width:min(320px,calc(100vw - 32px));max-height:calc(100dvh - 48px);box-sizing:border-box;overflow:auto;padding:16px;border:1px solid #8baac3;border-radius:14px;background:#fff;color:#23445e;box-shadow:0 18px 50px #0004}
#inbox-root #schedule-options:popover-open{display:flex;flex-direction:column;gap:8px}
#inbox-root #schedule-options strong{font-size:14px;margin-bottom:6px}
#inbox-root #schedule-options button{width:100%;min-height:40px;border:1px solid #a9bfd0;border-radius:8px;text-align:left;background:#eff5fa;color:#23445e;padding:9px 12px;font-size:12px}
#inbox-root #schedule-options small{font-size:11px;line-height:1.5;margin-top:4px}
#inbox-root #schedule-options::backdrop{background:#07152233}
html[data-theme="dark"] #inbox-root #schedule-options{background:#172c3c;color:#e5f2ff;border-color:#7296b1}
html[data-theme="dark"] #inbox-root #schedule-options button{background:#243c55;color:#e5f2ff;border-color:#719bbd}
#inbox-root #chat-more-options{display:none;position:fixed;inset:0;margin:auto;width:min(300px,calc(100vw - 32px));max-height:calc(100dvh - 48px);overflow:auto;box-sizing:border-box;padding:16px;border:1px solid #8baac3;border-radius:14px;background:#fff;color:#23445e;box-shadow:0 18px 50px #0004}
#inbox-root #chat-more-options:popover-open{display:flex;flex-direction:column;gap:8px}
#inbox-root #chat-more-options>strong{font-size:14px;margin-bottom:6px}
#inbox-root #chat-more-options>button,#inbox-root #chat-more-options>.schedule-shortcuts>button{width:100%;min-height:40px;text-align:left;padding:9px 12px;border:1px solid #a9bfd0;border-radius:8px;background:#eff5fa;color:#23445e;font-size:12px}
#inbox-root #chat-more-options>.schedule-shortcuts{display:block}
#inbox-root #chat-more-options::backdrop{background:#07152233}
html[data-theme="dark"] #inbox-root #chat-more-options{background:#172c3c;color:#e5f2ff;border-color:#7296b1}
html[data-theme="dark"] #inbox-root #chat-more-options>button,html[data-theme="dark"] #inbox-root #chat-more-options>.schedule-shortcuts>button{background:#243c55;color:#e5f2ff;border-color:#719bbd}
/* Small composer controls, growing text field, fixed send column. */
.layout.chat-workspace .chat-compose{max-height:none;overflow:visible;padding:6px 12px 10px}
.layout.chat-workspace #inbox-send{grid-template-columns:minmax(0,1fr) 42px;gap:6px 10px;align-items:end}
.layout.chat-workspace .compose-tools{grid-column:1/-1;display:flex;align-items:center;gap:6px;min-width:0}
.layout.chat-workspace .compose-tools>label{display:flex;align-items:center;gap:6px;min-width:0;flex:1;margin:0;font-size:10px}
.layout.chat-workspace #inbox-send .compose-tools select{min-width:0;max-width:100%;flex:1;padding:4px 6px;min-height:28px;font-size:11px}
.layout.chat-workspace .compose-shortcut{display:grid;place-items:center;width:30px;height:30px;flex:none;padding:0;border:1px solid #9eb6c8;border-radius:8px;background:#edf4f9;color:#254f70;font-size:17px;cursor:pointer}
.layout.chat-workspace #inbox-send textarea{box-sizing:border-box;height:42px;min-height:42px;max-height:120px;resize:none;overflow-y:hidden;line-height:20px;padding:10px 12px}
.layout.chat-workspace #inbox-send>.chat-send-button{width:42px;height:42px;min-height:42px}
#inbox-root #compose-help{position:fixed;inset:0;margin:auto;width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 48px);box-sizing:border-box;overflow:auto;padding:18px;border:1px solid #8baac3;border-radius:14px;background:#fff;color:#23445e;box-shadow:0 18px 50px #0004;font-size:12px;line-height:1.6}
#inbox-root #compose-help::backdrop{background:#07152233}
html[data-theme="dark"] .layout.chat-workspace .compose-shortcut{background:#243c55;color:#e5f2ff;border-color:#719bbd}
html[data-theme="dark"] #inbox-root #compose-help{background:#172c3c;color:#e5f2ff;border-color:#7296b1}
@media(max-height:600px){.layout.chat-workspace #inbox-send textarea{max-height:70px!important}}
.layout.chat-workspace .chat-history-viewport{position:relative;display:flex;flex:1 1 0;min-height:0;overflow:hidden}
.layout.chat-workspace #inbox-chat .chat-history-viewport .chat-messages{width:100%;box-sizing:border-box;overflow-anchor:none}
#inbox-root .chat-jump-latest{position:absolute;right:18px;bottom:14px;z-index:3;width:38px;height:38px;display:grid;place-items:center;padding:0;border:1px solid #a0b7c8;border-radius:50%;background:#fff;color:#254f70;box-shadow:0 3px 12px #0003;font-size:23px;cursor:pointer}
#inbox-root .chat-jump-latest[hidden]{display:none}
#inbox-root .chat-jump-latest span:not(:empty){position:absolute;top:-9px;right:-4px;min-width:19px;padding:2px 4px;border-radius:12px;background:#087e67;color:#fff;font-size:10px;line-height:16px;font-weight:700}
#inbox-root .chat-jump-latest:focus-visible{outline:2px solid #44b4bc;outline-offset:3px}
html[data-theme="dark"] #inbox-root .chat-jump-latest{background:#294557;color:#e5f2ff;border-color:#789fb7}
#inbox-root .history-search[hidden]{display:none!important}
.layout.chat-workspace #chat-search-panel{flex:0 0 auto;padding:7px 12px;border-bottom:1px solid #a0b7c8;box-sizing:border-box;background:#f0f5f9}
#inbox-root .chat-search-toggle{flex:none;display:grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid #9eb6c8;border-radius:8px;background:#edf4f9;color:#254f70;cursor:pointer}
#inbox-root #chat-search-panel input{min-width:80px;margin:0;padding:7px 10px;min-height:32px;font-size:12px}
#inbox-root #chat-search-panel button{width:30px;height:30px;padding:0;border:1px solid #9eb6c8;border-radius:7px;background:#edf4f9;color:#254f70;font-size:17px;cursor:pointer}
#inbox-root #chat-search-panel button:disabled{opacity:.4;cursor:default}
#inbox-root #chat-search-panel small{font-size:10px;line-height:1.3}
html[data-theme="dark"] .layout.chat-workspace #chat-search-panel{background:#172c3c;border-color:#56798f}
html[data-theme="dark"] #inbox-root .chat-search-toggle,html[data-theme="dark"] #inbox-root #chat-search-panel button{background:#243c55;color:#e5f2ff;border-color:#719bbd}
/* Date separators stay inside the scrolling history, without sticky bars. */
#inbox-root .chat-date-divider{display:flex;justify-content:center;clear:both;margin:16px 0 12px;pointer-events:none}
#inbox-root .chat-date-divider:first-child{margin-top:0}
#inbox-root .chat-date-divider span{padding:4px 11px;border:1px solid #c3d1d6;border-radius:9px;background:#f4f7f8;color:#48606d;font-size:11px;line-height:1.4;box-shadow:0 1px 2px #0000000a}
.layout.chat-workspace #inbox-root .chat-bubble{margin-bottom:5px;padding:8px 12px 6px}
.layout.chat-workspace #inbox-root .chat-bubble:not(.message-continuation){margin-top:12px}
.layout.chat-workspace #inbox-root .chat-bubble.message-continuation{margin-top:0;border-radius:9px}
#inbox-root .message-sender-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.layout.chat-workspace #inbox-root .chat-bubble p{margin:3px 0 4px}
.layout.chat-workspace #inbox-root .chat-bubble time{font-size:10px;color:inherit}
html[data-theme="dark"] #inbox-root .chat-date-divider span{background:#223d4d;color:#d8e8f2;border-color:#507184}
#inbox-root .message-reply-action{position:absolute;top:3px;right:4px;width:26px;height:24px;padding:0;border:0;border-radius:6px;background:#e7eff1;color:#315c68;cursor:pointer;opacity:0}
#inbox-root .chat-bubble:hover .message-reply-action,#inbox-root .chat-bubble:focus-within .message-reply-action{opacity:1}
#inbox-root .chat-bubble>strong{padding-right:24px}
#inbox-root .message-quote{display:block;width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere;border:0;border-left:3px solid #108674;border-radius:5px;background:#d6e9e5;color:#25483e;padding:7px 10px;margin:6px 0;font-size:11px;line-height:1.4;cursor:pointer}
#inbox-root #reply-preview{grid-column:1/-1;display:flex;gap:8px;align-items:center;border-left:3px solid #108674;padding:6px 10px;border-radius:6px;background:#e2efe9;color:#25483e}
#inbox-root #reply-preview[hidden]{display:none}
#inbox-root #reply-preview>span{min-width:0;flex:1}
#inbox-root #reply-preview strong,#inbox-root #reply-preview small{display:block;font-size:11px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#inbox-root #reply-preview button{background:transparent;border:0;color:inherit;font-size:22px;cursor:pointer}
#inbox-root .quoted-origin{outline:2px solid #31a4ad;outline-offset:2px}
html[data-theme="dark"] #inbox-root .message-quote,html[data-theme="dark"] #inbox-root #reply-preview{background:#244a48;color:#e2f4ed;border-color:#68c9b4}
html[data-theme="dark"] #inbox-root .message-reply-action{background:#2d515e;color:#e2f4ed}
@media(hover:none){#inbox-root .message-reply-action{opacity:1}}
