/* SuppChat visual skin v3 (SCV3) — 2026-10-07.
   Loaded after app.css and the page stylesheets: it only re-tokens and re-shapes,
   no markup or JS depends on it. Light by default, Inter, indigo accent, soft
   cards, plain-text status, quiet tags, one gentle shadow ladder. Dark theme stays and gets the
   same shapes on a deep blue-slate instead of near-black. */

@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root,
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f5fa; --panel: #ffffff; --panel-2: #f1f2f9; --active: #eceefe; --hover: #f7f8fd;
    --inset: #f4f5fa; --field: #ffffff;
    --border: #e7e9f2; --border-strong: #d6d9e6; --border-hover: #b9bdd2; --border-float: #e2e5f0;
    --text: #151a2d; --muted: #5a6280; --faint: #8e95b0;
    --accent: #4f46e5;
    --accent-2: #4f46e5;
    --accent-2-hover: #4338ca;
    --accent-ink: #4338ca;
    --accent-tint: #eceefe;
    --accent-weak: #eceefe;
    --accent-fg: #ffffff;
    --bubble-in: #ffffff; --bubble-out: #4f46e5; --bubble-out-fg: #ffffff;
    --success: #0f8a5f; --success-bg: #e2f6ec; --success-dot: #12b27a;
    --warn: #a35a00;    --warn-bg: #fff1d6;    --warn-dot: #f59e0b;
    --danger: #c2271f;  --danger-bg: #fde8e6;  --danger-dot: #ef4444; --danger-strong: #dc2626;
    --info: var(--muted); --info-bg: var(--panel-2);
    --note: #8a5a00;    --note-bg: #fff8e1;    --note-border: #f4dd9b;
    --elev: 0 12px 32px -8px rgba(21, 26, 45, .18), 0 2px 8px -2px rgba(21, 26, 45, .08);
    --sh-1: 0 1px 2px rgba(21, 26, 45, .06), 0 1px 3px rgba(21, 26, 45, .04);
    --sh-2: 0 4px 14px -4px rgba(21, 26, 45, .12), 0 1px 3px rgba(21, 26, 45, .06);
    --backdrop: rgba(21, 26, 45, .36);
    --shadow: var(--elev); --shadow-2: var(--elev); --shadow-3: var(--elev);
    --radius: 12px; --r-xs: 6px; --r-s: 8px; --r-m: 12px; --r-l: 16px;
    --ctl-h: 36px; --ctl-h-sm: 30px; --ctl-h-lg: 44px;
    --focus: #6366f1;
    --hero: #4f46e5;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c1124; --panel: #131a33; --panel-2: #1b2342; --active: #222b52; --hover: #171f3b;
    --inset: #0c1124; --field: #0f1630;
    --border: #232c4f; --border-strong: #323d68; --border-hover: #4a5788; --border-float: #2c3660;
    --text: #eef0fb; --muted: #aab1d1; --faint: #7983a8;
    --accent: #7c83ff;
    --accent-2: #6366f1;
    --accent-2-hover: #7578f5;
    --accent-ink: #a5abff;
    --accent-tint: #232a5c;
    --accent-weak: #232a5c;
    --accent-fg: #ffffff;
    --bubble-in: #1b2342; --bubble-out: #5458e8; --bubble-out-fg: #ffffff;
    --success: #4ade9f; --success-bg: #11332a; --success-dot: #2fcf8f;
    --warn: #fbbf24;    --warn-bg: #3a2c0c;    --warn-dot: #f59e0b;
    --danger: #ff8f8a;  --danger-bg: #3d1820;  --danger-dot: #f26161; --danger-strong: #dc2626;
    --note: #fbd36b;    --note-bg: #2b2410;    --note-border: #5b4a17;
    --elev: 0 14px 36px -8px rgba(0, 0, 0, .6), 0 2px 8px -2px rgba(0, 0, 0, .4);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .3);
    --sh-2: 0 6px 18px -6px rgba(0, 0, 0, .5);
    --backdrop: rgba(4, 7, 20, .6);
    --shadow: var(--elev); --shadow-2: var(--elev); --shadow-3: var(--elev);
    --radius: 12px; --r-xs: 6px; --r-s: 8px; --r-m: 12px; --r-l: 16px;
    --ctl-h: 36px; --ctl-h-sm: 30px; --ctl-h-lg: 44px;
    --focus: #8b90ff;
    --hero: #4f46e5;
}

/* ---------- base ---------- */
body {
    font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "cv11", "ss03";
    font-size: 14px;
    line-height: 21px;
    letter-spacing: -0.005em;
}
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.015em; }
a { color: var(--accent-ink); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-2); }
.ic { stroke-width: 1.9; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 0;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent);
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- fields ---------- */
.search input, .login-field input, .thread-controls select, .bulk-select,
.composer textarea, .msg-edit-area, .mfa-field input {
    background: var(--field);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-s);
    box-shadow: var(--sh-1);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.search input:hover, .login-field input:hover, .composer textarea:hover { border-color: var(--border-hover); }
.topbar .search input { background: var(--bg); border-color: transparent; box-shadow: none; border-radius: var(--r-s); padding-left: 16px; }
.topbar .search input:hover { background: var(--panel-2); }
.topbar .search input:focus { background: var(--panel); }

/* ---------- buttons ---------- */
.btn {
    border-radius: var(--r-s);
    border: 1px solid var(--border-strong);
    background: var(--panel);
    box-shadow: var(--sh-1);
    font-weight: 550;
    letter-spacing: -0.005em;
}
.btn:hover { background: var(--panel-2); border-color: var(--border-hover); }
.btn-primary {
    background: var(--accent-2);
    border: 1px solid color-mix(in srgb, var(--accent-2) 80%, #000);
    box-shadow: none;
    color: #fff;
}
.btn-primary:hover { background: var(--accent-2-hover); background-image: none; border-color: color-mix(in srgb, var(--accent-2-hover) 80%, #000); }
.btn-primary:disabled, .btn-primary:disabled:hover { background: var(--panel-2); background-image: none; color: var(--faint); border-color: var(--border); box-shadow: none; }
.btn-ghost { box-shadow: none; border-color: transparent; background: transparent; font-weight: 500; }
.btn-ghost:hover { background: var(--panel-2); border-color: transparent; }
.btn-danger:hover { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger-dot) 40%, transparent); color: var(--danger); }
.btn-sm { border-radius: var(--r-xs); }

.badge-open, .badge-closed { color: var(--muted); }
.badge-answered, .badge-sla-met, .badge[class*="resolved"] { color: var(--success); }
.badge-draft, .badge-sla-soon, .badge[class*="pending"], .badge[class*="waiting"] { color: var(--warn); }
.badge-send-failed, .badge-sla-breached { color: var(--danger); }
.badge-ai { color: var(--accent-ink); }

/* ---------- demo strip ---------- */
.demo-strip {
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border: 0;
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 16px;
}
.demo-strip::before { background: #fff; box-shadow: none; }
.demo-strip a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .55); }

/* ---------- top bar ---------- */
.topbar {
    height: 56px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    gap: 6px;
}
.brand { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; margin-right: 18px; gap: 10px; }
.brand-mark {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}
.brand-mark svg { width: 17px; height: 17px; }
.topbar .btn, .topbar a.btn, .topnav > a, .topnav > button { font-size: 13.5px; }
.op-name { font-weight: 500; color: var(--text); }
.topnav a:not(.btn), .topnav .btn-ghost { border-radius: var(--r-s); }
.topnav a:not(.btn) { color: var(--muted); font-weight: 500; padding: 6px 10px; }
.topnav a:not(.btn):hover { background: var(--panel-2); color: var(--text); text-decoration: none; }

/* ---------- queue: dense rows, hairline dividers, no cards (SCV4) ---------- */
.queue { background: var(--panel); border-right: 1px solid var(--border); width: 392px; }
.queue-filters { padding: 8px 14px 0; gap: 2px 14px; border-bottom: 1px solid var(--border); }
.chip {
    height: 34px; padding: 0 2px; margin: 0;
    border-radius: 0; background: transparent; border: 0;
    border-bottom: 2px solid transparent; box-shadow: none;
    color: var(--muted); font-size: 13px; font-weight: 500;
}
.chip:hover { color: var(--text); background: transparent; }
.chip.active { background: transparent; color: var(--text); font-weight: 600; border-bottom-color: var(--accent); box-shadow: none; }
.queue-list { padding: 0; display: block; background: var(--panel); }
.qitem {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 16px 10px 30px;
    border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
    background: transparent; box-shadow: none;
}
.qitem:hover { background: color-mix(in srgb, var(--text) 4%, transparent); border-color: var(--border); box-shadow: none; }
.qitem.selected { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.qitem.active { background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: var(--border); box-shadow: none; }
.qitem.active::before, .qitem.prio-urgent::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0;
    background: var(--accent);
}
.qitem.prio-urgent::before { background: var(--danger-dot); }
.qitem.active.prio-urgent::before { background: var(--danger-dot); }
.qitem:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.qitem-top { gap: 8px; }
.qitem-top .dot { display: none; }
.qitem-check { position: absolute; left: 9px; top: 11px; width: 16px; height: 16px; }
.qitem.unread::after {
    content: ""; position: absolute; left: 13px; top: 15px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--accent);
}
.qitem:hover::after, .qitem:focus-within::after, .queue-list:has(.qitem.selected) .qitem::after { opacity: 0; }
.qitem-name { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--text); }
.qitem.unread .qitem-name { font-weight: 600; }
.qitem.unread .qitem-top::after { display: none; }
.qitem-time { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 400; }
.qitem-subj { font-size: 13px; line-height: 18px; color: var(--muted); font-weight: 400; }
.qitem.unread .qitem-subj { color: var(--text); font-weight: 500; }
.qitem-company { font-size: 12px; color: var(--muted); }
.qitem-meta { gap: 2px 10px; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted); align-items: center; }
.qitem-ref { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; color: var(--faint); }
.qitem-prio { font-weight: 600; color: var(--warn); }
.qitem.prio-urgent .qitem-prio { color: var(--danger); }
.qitem-tags { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: 1px; }
.qitem-more { font-size: 12px; color: var(--faint); }
.qitem-tags .tag-chip {
    height: 16px; padding: 0; background: none; border: 0; border-radius: 0;
    font-size: 12px; font-weight: 400; color: var(--muted); gap: 5px;
}
.qitem-tags .tag-chip::before { width: 6px; height: 6px; }

/* status = 6px dot + word, plain text, no fill (colour never alone) */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0; border: 0; border-radius: 0; background: none;
    color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 400;
}
.badge::before { width: 6px; height: 6px; }
.badge-sla-soon, .badge-sla-breached { font-weight: 600; }

/* ---------- thread ---------- */
.thread { background: var(--bg); }
.thread-head {
    background: var(--panel);
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--sh-1);
    position: relative;
    z-index: 1;
}
.thread-title { font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; }
.thread-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.thread-controls { gap: 8px; margin-top: 12px; }
.thread-controls select { height: 32px; border-radius: var(--r-s); font-weight: 550; }
.thread-controls .btn, .thread-controls button { font-size: 13px; }
.company-chip, .tag-add, .company-add { border-radius: var(--r-xs); }
.tag-chip {
    height: 22px; padding: 0 7px;
    border-radius: var(--r-xs);
    font-size: 12px; font-weight: 500;
    background: var(--panel-2);
    color: var(--muted);
}
.tag-chip::before { width: 7px; height: 7px; }
.link-chip { border-radius: var(--r-xs); }

.messages { padding: 28px 32px; gap: 18px; background: var(--bg); }
.msg { max-width: min(680px, 82%); }
.bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 22px;
}
.msg-in .bubble {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top-left-radius: 5px;
    box-shadow: var(--sh-1);
}
.msg-out .bubble {
    background: var(--accent-2);
    color: #fff;
    border: 0;
    border-top-right-radius: 5px;
    box-shadow: none;
}
.msg-out .bubble a { color: #fff; text-decoration: underline; }
.msg-note .bubble {
    background: var(--note-bg);
    border: 1px dashed var(--note-border);
    border-radius: 14px;
    box-shadow: none;
    color: var(--text);
}
.msg-draft .bubble {
    background: color-mix(in srgb, var(--accent-2) 6%, var(--panel));
    border: 1px dashed color-mix(in srgb, var(--accent-2) 50%, var(--border));
    border-radius: 16px;
    box-shadow: none;
}
.msg-draft-label { color: var(--accent-ink); font-weight: 650; }
.msg-meta { font-size: 12px; color: var(--faint); font-weight: 500; }
.msg-avatar { box-shadow: 0 0 0 2px var(--bg); }
.day-sep-label { font-weight: 600; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }

/* composer */
.composer {
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 14px 24px 16px;
    box-shadow: 0 -8px 24px -16px rgba(21, 26, 45, .18);
}
.composer-tab { border-radius: var(--r-xs); font-weight: 500; }
.composer-tab.active { background: var(--accent-tint); color: var(--accent-ink); }
.composer textarea { border-radius: var(--r-m); }

/* context panel (right) */
.thread-context, .ctx, .context, [class*="ctx-"] { background: var(--panel); }

/* ---------- login ---------- */
.login-wrap {
    background: var(--bg);
}
.login-card {
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 36px 28px;
    box-shadow: var(--elev);
}
.login-brand { font-size: 24px; font-weight: 750; letter-spacing: -0.025em; }
.login-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.login-brand .brand-mark svg { width: 21px; height: 21px; }
.login-field label { font-weight: 550; margin-bottom: 6px; }
.login-card .btn-primary { height: 46px; font-size: 15px; border-radius: 10px; }
.login-card .btn-demo { height: 46px; border-radius: 10px; font-size: 15px; }
.login-demo { border-top: 1px dashed var(--border-strong); }
.login-forgot { margin-top: 20px; }

/* ---------- toasts, menus, dialogs ---------- */
.toast { border-radius: 12px; box-shadow: var(--elev); }
.tag-menu, .mfa-dialog, .modal-card { border-radius: 14px; box-shadow: var(--elev); }

/* ---------- reports ---------- */
.analytics { background: var(--bg); padding: 36px 40px 72px; }
.an-kpis { gap: 16px; max-width: 1120px; }
.an-kpi {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-l);
    padding: 18px 20px 16px;
    box-shadow: var(--sh-1);
}
.an-kpi-label { font-weight: 550; font-size: 13px; }
.an-kpi-val { font-size: 30px; line-height: 38px; font-weight: 750; letter-spacing: -0.03em; margin-top: 4px; }
.an-kpi-sub { font-weight: 550; }
.an-grid { max-width: 1120px; gap: 16px; }
.an-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-radius: var(--r-l);
    padding: 20px 22px 22px;
    box-shadow: var(--sh-1);
}
.an-card h3 { font-size: 15px; font-weight: 650; margin-bottom: 18px; }
.analytics { --an-created: #c7cbf4; --an-resolved: var(--accent-2); --an-bar: var(--accent-2); }
:root[data-theme="dark"] .analytics { --an-created: #3a4585; }
.an-bar-track { border-radius: 999px; height: 8px; }
.an-bar-fill { border-radius: 999px; }
.an-vbar-seg:first-child { border-radius: 4px 4px 0 0; }

/* ---------- knowledge base, help, admin, ops, portal ---------- */
.kb-editor, .outbox-inner { }
.help-result, .ptix { border-radius: var(--r-m); }
.ptix { background: var(--panel); border: 1px solid var(--border); margin-bottom: 8px; box-shadow: var(--sh-1); padding: 14px 16px; }
.ptix:hover { border-color: var(--border-hover); box-shadow: var(--sh-2); }
.portal-top { background: var(--panel); }
.portal { background: var(--bg); }
.pmsg-in .bubble, .pmsg-in > div { border-radius: 16px; }

/* ---------- scrollbars ---------- */
html { scrollbar-color: var(--border-strong) transparent; }

/* ---------- v3 refinements after first look ---------- */
.thread-head { padding: 18px 28px 14px; }
.thread-controls { margin-top: 10px; gap: 6px 8px; }
.thread-controls .btn-ghost, .thread-more-menu .btn-ghost {
    height: 32px; padding: 0 12px;
    border: 1px solid var(--border-strong);
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--sh-1);
    font-weight: 550; font-size: 13px;
    border-radius: var(--r-s);
}
.thread-controls .btn-ghost:hover, .thread-more-menu .btn-ghost:hover { background: var(--panel-2); border-color: var(--border-hover); }
.thread-controls select { padding-right: 28px; }
.queue-filters { gap: 4px; }
.chip { padding: 0 11px; font-size: 12.5px; }
.tag-add, .company-add { font-weight: 550; color: var(--muted); }
.outbox-item, .outbox-item:last-child { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-l); padding: 18px 22px; margin-bottom: 12px; box-shadow: var(--sh-1); }
.outbox-kind { font-weight: 650; }
.help-result { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-m); padding: 14px 18px; margin-bottom: 10px; box-shadow: var(--sh-1); }
.outbox-title, .portal h1 { font-weight: 750; letter-spacing: -0.025em; }

/* ---------- admin / ops (v3) ---------- */
.switch { width: 38px; height: 22px; }
.switch .slider { background: var(--border-strong); border-radius: 999px; }
.switch .slider::before { width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; box-shadow: 0 1px 3px rgba(21, 26, 45, .35); }
.switch input:checked + .slider { background: var(--accent-2); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* =====================================================================
   SCV4 (2026-10-10): flat helpdesk look. Values from
   Documents\DHIT\SUPPCHAT_UI_RESEARCH_2026-10-10 (queue + thread/theme specs).
   Tokens first, then shapes. No gradients, no pills, no glow.
   ===================================================================== */
:root, :root[data-theme="light"] {
    --bg: #f6f7f9; --panel: #ffffff; --panel-2: #eef0f3; --inset: #f6f7f9; --field: #ffffff;
    --active: #e8eefc; --hover: #f1f3f6;
    --border: #e3e6ea; --border-strong: #7b828c; --border-hover: #5b626b; --border-float: #d5d9df;
    --text: #1a1d21; --muted: #5b626b; --faint: #5b626b;
    --accent: #1d4fd0; --accent-2: #1d4fd0; --accent-2-hover: #1741b0; --accent-ink: #1d4fd0;
    --accent-tint: #e8eefc; --accent-weak: #e8eefc; --accent-fg: #ffffff; --focus: #1d4fd0; --hero: #1d4fd0;
    --success: #1b7f4b; --success-bg: #e3f4ea; --success-dot: #1b9a5c;
    --warn: #8a5a00; --warn-bg: #fff3d6; --warn-dot: #d99a1a;
    --danger: #b3261e; --danger-bg: #fdebe9; --danger-dot: #d9382e;
    --note: #5c4700; --note-bg: #fff6d6; --note-border: #d9b64a;
    --bubble-in: #ffffff; --bubble-out: #ffffff; --bubble-out-fg: #1a1d21;
    --r-xs: 3px; --r-s: 6px; --r-m: 6px; --r-l: 8px; --radius: 6px;
    --ctl-h: 32px; --ctl-h-sm: 28px;
    --sh-1: none; --sh-2: 0 4px 12px rgba(26, 29, 33, .14);
    --elev: 0 4px 12px rgba(26, 29, 33, .16);
}
:root[data-theme="dark"] {
    --bg: #14161a; --panel: #1c1f24; --panel-2: #262a31; --inset: #14161a; --field: #14161a;
    --active: #232a38; --hover: #22262c;
    --border: #2e333b; --border-strong: #6a717b; --border-hover: #8b929c; --border-float: #3a404a;
    --text: #e6e8eb; --muted: #a3a9b2; --faint: #8b929c;
    --accent: #7aa7f0; --accent-2: #7aa7f0; --accent-2-hover: #94b8f4; --accent-ink: #7aa7f0;
    --accent-tint: #232a38; --accent-weak: #232a38; --accent-fg: #0d1117; --focus: #7aa7f0; --hero: #7aa7f0;
    --success: #7dd3a0; --success-bg: #17302a; --success-dot: #4cb87c;
    --warn: #e0a93b; --warn-bg: #33290f; --warn-dot: #d29922;
    --danger: #f08a80; --danger-bg: #3b1d1d; --danger-dot: #f26b60;
    --note: #ebd9a0; --note-bg: #2e2a1c; --note-border: #f2c14e;
    --bubble-in: #1c1f24; --bubble-out: #1c1f24; --bubble-out-fg: #e6e8eb;
    --r-xs: 3px; --r-s: 6px; --r-m: 6px; --r-l: 8px; --radius: 6px;
    --ctl-h: 32px; --ctl-h-sm: 28px;
    --sh-1: none; --sh-2: 0 4px 12px rgba(0, 0, 0, .45);
    --elev: 0 4px 12px rgba(0, 0, 0, .5);
}
body { letter-spacing: 0; font-feature-settings: normal; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none; outline: 2px solid var(--focus); outline-offset: 0; }
input, select, textarea { border-color: var(--border-strong); background: var(--field); border-radius: var(--r-s); }

/* chrome */
.demo-strip { background: var(--panel-2); color: var(--text); border-bottom: 1px solid var(--border); font-weight: 400; }
.demo-strip a { color: var(--accent-ink); text-decoration-color: currentColor; }
.demo-strip::before { background: var(--warn-dot); box-shadow: none; }
.brand-mark { border-radius: 4px; background: var(--accent); color: var(--accent-fg); }
.topbar { height: 48px; }
.topbar .search input { border-radius: var(--r-s); border: 1px solid var(--border); background: var(--bg); }
.btn { border-radius: var(--r-s); box-shadow: none; }
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-fg); box-shadow: none; }
.btn-primary:hover { background: var(--accent-2-hover); border-color: var(--accent-2-hover); }
.btn-danger:hover { background: var(--danger-bg); }

/* thread header: one tight block */
.thread { background: var(--bg); }
.thread-head { padding: 12px 20px 10px; box-shadow: none; border-bottom: 1px solid var(--border); background: var(--panel); }
.thread-title { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: 0; }
.thread-sub { font-size: 12px; line-height: 16px; margin-top: 0; color: var(--muted); }
.thread-controls { margin-top: 8px; gap: 4px 6px; }
.thread-controls select { height: 28px; font-size: 13px; font-weight: 400; border-radius: var(--r-s); }
.thread-controls .btn-ghost, .thread-more-menu .btn-ghost {
    height: 28px; padding: 0 8px; border: 0; background: transparent; box-shadow: none;
    color: var(--muted); font-size: 13px; font-weight: 400; border-radius: var(--r-s);
}
.thread-controls .btn-ghost:hover, .thread-more-menu .btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.thread-tags, .thread-links { margin-top: 6px; }

/* tags: plain token, 1px outline only where editable, colour dot */
.tag-chip, .qitem-tags .tag-chip {
    height: 22px; padding: 0 6px; border-radius: var(--r-xs);
    background: transparent; border: 1px solid var(--border);
    color: var(--text); font-size: 12px; font-weight: 400;
}
.qitem-tags .tag-chip { height: 16px; padding: 0; border: 0; color: var(--muted); }
.tag-add, .company-add, .company-chip, .link-chip { border-radius: var(--r-xs); font-weight: 400; color: var(--muted); }

/* messages: flat cards, not bubbles */
.messages { padding: 16px 20px 24px; gap: 8px; background: var(--bg); }
.msg { max-width: 760px; align-self: stretch; width: 100%; padding-left: 0; padding-right: 0; }
.msg-in, .msg-out { padding-left: 0; padding-right: 0; align-self: stretch; align-items: stretch; }
.msg-avatar { display: none; }
.bubble {
    border-radius: var(--r-m); padding: 10px 14px;
    font-size: 14px; line-height: 21px; max-width: 72ch; box-shadow: none;
}
.msg-in .bubble { background: var(--panel); border: 1px solid var(--border); border-left: 2px solid var(--border-strong); }
.msg-out .bubble { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-left: 2px solid var(--accent); }
.msg-out .bubble a { color: var(--accent-ink); }
.msg-meta { order: -1; font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 500; gap: 4px 10px; margin-bottom: 2px; }
.msg-grouped { margin-top: 0; }
.msg-note { align-self: stretch; max-width: 760px; }
.msg-note .msg-meta { justify-content: flex-start; }
.msg-note .bubble {
    background: var(--note-bg); color: var(--text);
    border: 1px solid var(--border); border-left: 2px dashed var(--note-border);
    font-size: 14px; line-height: 21px; border-radius: var(--r-m);
}
.msg-note-label { font-size: 12px; font-weight: 600; color: var(--note); }
.msg-draft .bubble { background: var(--panel); border: 1px dashed var(--border-strong); border-radius: var(--r-m); }
.msg-draft-label { color: var(--muted); font-weight: 500; font-size: 12px; }
.day-sep-label { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }

/* composer */
.composer { padding: 10px 20px 12px; box-shadow: none; border-top: 1px solid var(--border); background: var(--panel); }
.composer-tab { border-radius: var(--r-s); font-size: 13px; font-weight: 500; color: var(--muted); }
.composer-tab.active { background: var(--panel-2); color: var(--text); }
.composer textarea { border-radius: var(--r-s); font-size: 14px; line-height: 21px; }

/* surfaces that were rounded cards */
.login-card { border-radius: 8px; box-shadow: var(--elev); }
.login-card .btn-primary, .login-card .btn-demo { border-radius: var(--r-s); height: 40px; font-size: 14px; }
.login-brand .brand-mark { border-radius: 6px; }
.toast, .tag-menu, .mfa-dialog, .modal-card { border-radius: 8px; box-shadow: var(--elev); }
.an-kpi, .an-card, .outbox-item, .help-result, .ptix { border-radius: var(--r-l); box-shadow: none; }
.an-bar-track, .an-bar-fill { border-radius: 2px; }
.pmsg-in .bubble, .pmsg-in > div { border-radius: var(--r-m); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* SCV4 b: rare ticket actions behind one menu on every width */
.thread-controls { position: relative; }
.thread-more { display: block; margin-left: auto; position: static; }
.thread-more-toggle { display: inline-flex; }
.thread-more-menu {
    display: none; position: absolute; top: 100%; right: 0; z-index: 40; flex-direction: column;
    min-width: 240px; margin-top: 4px; padding: 4px;
    background: var(--panel); border: 1px solid var(--border-float); border-radius: var(--r-s); box-shadow: var(--elev);
}
.thread-more.open .thread-more-menu { display: flex; }
.thread-more-menu .btn { justify-content: flex-start; width: 100%; color: var(--text); }

/* composer: reply vs internal note must not look alike */
.composer-hint { font-size: 12px; color: var(--muted); }
.composer.note-mode { background: var(--note-bg); border-top: 2px dashed var(--note-border); }
.composer.note-mode textarea { background: var(--panel); border-color: var(--note-border); }
.composer.note-mode .composer-hint { color: var(--note); font-weight: 600; }
.composer.note-mode .composer-tab.active { background: var(--panel); color: var(--note); }
.composer-actions { flex-wrap: wrap; row-gap: 6px; }

/* SCV4 c: no boxed tags anywhere. Tag = colour dot + plain text; add/link actions = plain text links. */
.tag-chip, .thread-tags .tag-chip, .ctx-section .tag-chip, .qitem-tags .tag-chip,
.company-chip, .link-chip, .participant-chip, .lt-chip {
    border: 0; background: none; padding: 0; height: auto; min-height: 20px; border-radius: 0;
    color: var(--text); font-size: 13px; font-weight: 400; gap: 6px;
}
.thread-tags, .thread-links, .thread-company { gap: 2px 14px; align-items: center; }
.tag-chip .tag-x, .tag-chip .tg-x, .participant-chip .pt-x, .lt-chip .lt-x { opacity: 0; transition: opacity .1s; }
.tag-chip:hover .tag-x, .tag-chip:focus-within .tag-x, .tag-chip:hover .tg-x, .participant-chip:hover .pt-x, .lt-chip:hover .lt-x { opacity: 1; }
.tag-add, .company-add, .tag-add:hover, .company-add:hover {
    border: 0; background: none; height: auto; min-height: 20px; padding: 0; margin: 0;
    color: var(--muted); font-size: 13px; font-weight: 400; box-shadow: none; border-radius: 0;
}
.tag-add:hover, .company-add:hover { color: var(--accent-ink); text-decoration: underline; }
.thread-company .company-add { margin-left: 0; }

/* SCV5 tags (research 03_tags_teardown): quiet tinted chip, 4px radius, hue tint + same-hue dark text (Front, Missive, HubSpot, GitHub recipe).
   Text is the tag hue mixed toward --text so contrast holds for any user colour; no dot, no saturated fill, x only on hover/focus. */
.tag-chip, .thread-tags .tag-chip, .ctx-section .tag-chip, .qitem-tags .tag-chip {
    --tg: var(--muted);
    display: inline-flex; align-items: center; gap: 4px;
    height: 20px; min-height: 0; padding: 0 7px; border-radius: 4px;
    background: color-mix(in srgb, var(--tg) 13%, var(--panel));
    border: 1px solid color-mix(in srgb, var(--tg) 32%, var(--panel));
    color: color-mix(in srgb, var(--tg) 55%, var(--text));
    font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap; max-width: 180px;
}
.tag-chip::before, .qitem-tags .tag-chip::before { display: none; }
.qitem-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.qitem-tags .tag-chip { height: 18px; line-height: 16px; padding: 0 6px; font-size: 11.5px; }
.qitem-more { align-self: center; font-size: 11.5px; color: var(--muted); }
.thread-tags, .ctx-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-chip .tag-x { padding: 0 0 0 2px; margin-right: -3px; border: 0; background: none; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.tag-add { border: 1px dashed var(--border-strong); border-radius: 4px; height: 20px; padding: 0 7px; font-size: 12px; color: var(--muted); }
.tag-add:hover { text-decoration: none; color: var(--text); border-style: solid; }

/* SCV5 structure (research 04): view counts, account menu, panel toggle, split send, empty states */
:root, :root[data-theme="light"] { --muted: #4f565f; --faint: #6b727c; }
:root[data-theme="dark"] { --faint: #8b929c; }
.chip-n { margin-left: 5px; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 400; }
.chip.active .chip-n { color: var(--accent-ink); }

.user-toggle { display: none; }
.user-menu { display: contents; }
@media (min-width: 761px) {
    .user-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong);
        background: var(--panel); color: var(--text); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 0;
    }
    .user-toggle:hover { background: var(--hover); }
    .topnav { position: relative; }
    .user-menu {
        display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px;
        flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
        background: var(--panel); border: 1px solid var(--border-float); border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    }
    .user-menu.open { display: flex; }
    .user-menu .op-name { display: block; padding: 4px 8px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text); }
    .user-menu .btn { justify-content: flex-start; width: 100%; height: 32px; gap: 8px; }
    .user-menu #theme-toggle::after { content: "Přepnout téma"; }
    .user-menu #mfa-btn::after { content: "Dvoufázové ověření"; }
    .user-menu #push-toggle::after { content: "Notifikace"; }
    .user-menu #logout-btn { color: var(--danger); margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; }
}
.topbar { position: relative; }

.panel-toggle[aria-pressed="true"] { color: var(--accent-ink); }
@media (max-width: 760px) { .panel-toggle { display: none; } }
@media (min-width: 761px) {
    .workspace.has-thread.ctx-on .context { display: block; }
    .workspace.ctx-off .context { display: none !important; }
}
@media (min-width: 761px) and (max-width: 1199px) {
    .workspace.has-thread.ctx-on .context {
        position: fixed; right: 0; top: 48px; bottom: 0; z-index: 20; width: 300px;
        box-shadow: -8px 0 24px rgba(0, 0, 0, .18); background: var(--panel);
    }
}
.ctx-h { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; justify-content: space-between; }
.ctx-h::after { content: "\2212"; color: var(--faint); font-weight: 400; }
.ctx-section.collapsed > :not(.ctx-h) { display: none; }
.ctx-section.collapsed .ctx-h::after { content: "+"; }

.send-split { position: relative; display: inline-flex; margin-left: auto; }
.send-split .btn-primary:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.send-split .send-more { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255, 255, 255, .35); padding: 0 8px; min-width: 0; }
.send-menu { display: none; position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 25; min-width: 180px; padding: 4px; background: var(--panel); border: 1px solid var(--border-float); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.send-menu.open { display: block; }
.send-menu .btn { width: 100%; justify-content: flex-start; }
.composer.note-mode .send-split .btn-primary { background: var(--text); color: var(--panel); border-color: var(--text); }

.thread-head-top > .badge { display: none; }
.thread-empty-t { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.thread-empty .keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 13px; color: var(--muted); }
.thread-empty kbd { display: inline-block; min-width: 20px; padding: 1px 5px; text-align: center; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; font: 11px ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--text); background: var(--panel); }
.queue-empty-t { margin: 0 0 4px; font-size: 14px; color: var(--text); }
.queue-empty-s { margin: 0; font-size: 13px; color: var(--muted); }
.thread-empty::before { display: none; }

/* =====================================================================
   SCV6 (2026-10-10 night): full redesign layer. Research basis:
   SUPPCHAT_UI_RESEARCH_2026-10-10/01-04. Rules: no dots anywhere, no
   colour-only signals (every signal is a word), neutral greys instead of
   navy, one accent, flat rows, email-style thread with initials, labelled
   properties in the header, label-above-value side panel.
   ===================================================================== */
:root, :root[data-theme="light"] {
    --bg: #f4f4f5; --panel: #ffffff; --panel-2: #f4f4f5; --inset: #fafafa; --field: #ffffff;
    --hover: #f4f4f5; --active: #ececef;
    --border: #e4e4e7; --border-strong: #a1a1aa; --border-hover: #71717a; --border-float: #d4d4d8;
    --text: #18181b; --muted: #52525b; --faint: #71717a;
    --accent: #2f5bd3; --accent-2: #2f5bd3; --accent-2-hover: #244ab3; --accent-ink: #2449b0;
    --accent-tint: #eef2fc; --accent-weak: #eef2fc; --accent-fg: #ffffff; --focus: #2f5bd3;
    --danger: #b42318; --warn: #8a4b00; --success: #18794e;
    --out-bg: #f6f8fd; --note-bg: #fdf8e7; --note-border: #ecd9a0; --note-ink: #6b4e00;
    --row-sel: #ececef;
}
:root[data-theme="dark"] {
    --bg: #111113; --panel: #18181b; --panel-2: #1f1f23; --inset: #141416; --field: #141416;
    --hover: #1f1f23; --active: #27272a;
    --border: #27272a; --border-strong: #52525b; --border-hover: #71717a; --border-float: #3f3f46;
    --text: #ececef; --muted: #a1a1aa; --faint: #8b8b94;
    --accent: #7c9cff; --accent-2: #4a6fe0; --accent-2-hover: #5a7deb; --accent-ink: #9db4ff;
    --accent-tint: #1d2333; --accent-weak: #1d2333; --accent-fg: #ffffff; --focus: #7c9cff;
    --danger: #ff8a80; --warn: #f0b45a; --success: #6fcf97;
    --out-bg: #1b1e27; --note-bg: #262214; --note-border: #4d4220; --note-ink: #ecd58c;
    --row-sel: #26262b;
}
body { background: var(--bg); }

/* ---- no dots, anywhere in the console ---- */
.badge::before, .badge::after, .dot, .qitem::before, .qitem::after, .qitem.unread::after,
.qitem.active::before, .qitem.prio-urgent::before, .qitem.prio-high::before,
.tag-chip::before, .demo-strip::before, .ctx-rel-top .dot { display: none !important; content: none !important; }
.badge { padding: 0; background: none !important; border: 0 !important; gap: 0; }

/* ---- demo strip: one quiet line ---- */
.demo-strip { background: var(--panel); color: var(--muted); border-bottom: 1px solid var(--border); font-size: 12px; }

/* ---- topbar ---- */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); box-shadow: none; }
.topbar .search input { background: var(--bg); border: 1px solid var(--border); height: 32px; border-radius: 6px; }
.topbar .search input:focus { border-color: var(--accent); background: var(--panel); }

/* ---- queue ---- */
.queue { width: 380px; background: var(--panel); border-right: 1px solid var(--border); }
.queue-filters { padding: 8px 12px 0; gap: 0 2px; border-bottom: 1px solid var(--border); }
.queue-filters .chip { height: 34px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.queue-filters .chip:hover { color: var(--text); background: none; }
.queue-filters .chip.active { color: var(--text); border-bottom-color: var(--text); background: none; }
.queue-filters .chip-n { color: var(--faint); margin-left: 6px; }
.queue-filters .chip.active .chip-n { color: var(--text); }

.queue .qitem {
    position: relative; display: block; padding: 12px 16px 12px 16px; margin: 0;
    border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--panel);
    box-shadow: none; cursor: pointer;
}
.queue .qitem:hover { background: var(--hover); }
.queue .qitem.active { background: var(--row-sel); box-shadow: inset 2px 0 0 var(--accent); }
.queue .qitem.selected { background: var(--accent-tint); }
.queue .qitem-check { position: absolute; left: -9999px; }
.queue .qitem:hover .qitem-check, .queue .qitem.selected .qitem-check, .queue .qitem-check:focus-visible { position: absolute; left: auto; right: 16px; top: 38px; }
.qrow { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.qrow-1 { line-height: 20px; }
.qitem-name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.qitem-company { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.qitem-time { margin-left: auto; flex: none; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.qrow-2 { margin-top: 2px; align-items: center; }
.qitem-subj { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 18px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.queue .qitem.unread .qitem-name { font-weight: 700; }
.queue .qitem.unread .qitem-subj { color: var(--text); font-weight: 500; }
.queue .qitem.unread .qitem-time { color: var(--text); font-weight: 600; }
.qrow-2 .qitem-tags { display: inline-flex; flex: none; gap: 4px; margin: 0; align-items: center; }
.qrow-3 { margin-top: 4px; flex-wrap: wrap; gap: 0; font-size: 12px; line-height: 16px; color: var(--faint); }
.qrow-3 > * + *::before { content: "\00B7"; margin: 0 6px; color: var(--faint); font-weight: 400; }
.qitem-ref { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; color: var(--faint); }
.qm { color: var(--faint); }
.qm-danger { color: var(--danger); font-weight: 600; }
.qm-warn { color: var(--warn); font-weight: 600; }
.qm-who { color: var(--muted); }
.queue-empty { padding: 40px 24px; text-align: left; }

/* ---- thread header: title + one meta line + labelled properties ---- */
.thread { background: var(--bg); }
.thread-head { background: var(--panel); border-bottom: 1px solid var(--border); padding: 14px 24px 10px; box-shadow: none; }
.thread-head-top { display: flex; align-items: flex-start; gap: 12px; }
.thread-head-top > div:first-child { flex: 1; min-width: 0; }
.thread-title { font-size: 18px; line-height: 26px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.thread-sub { font-size: 13px; line-height: 18px; color: var(--muted); margin-top: 2px; }
.thread-resolve { flex: none; height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text); border-radius: 6px; font-weight: 500; }
.thread-resolve:hover { background: var(--hover); border-color: var(--border-hover); }
.thread-company { margin-top: 2px; font-size: 13px; }
.thread-tags, .thread-links { margin-top: 8px; }
.thread-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.prop { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.prop-k { font-size: 12px; color: var(--faint); }
.thread-controls select {
    height: 28px; padding: 0 22px 0 6px; border: 1px solid transparent; background-color: transparent; border-radius: 6px;
    font-size: 13px; font-weight: 500; color: var(--text); width: auto; min-width: 0;
}
.thread-controls select:hover, .thread-controls select:focus { border-color: var(--border-strong); background-color: var(--panel); }
.thread-controls .panel-toggle, .thread-controls .thread-more { margin-left: 0; }
.thread-controls .panel-toggle { margin-left: auto; }
.thread-controls .btn-ghost { color: var(--muted); }

/* ---- messages: email thread, initials, full width, no bubbles ---- */
.messages { background: var(--bg); padding: 16px 24px 24px; gap: 12px; }
.msg, .msg-in, .msg-out, .msg-note, .msg-draft {
    display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-items: start;
    max-width: 820px; width: 100%; margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--panel); box-shadow: none;
}
.msg-out { background: var(--out-bg); }
.msg-avatar {
    display: flex !important; grid-column: 1; grid-row: 1 / span 3; width: 32px; height: 32px; border-radius: 50%;
    align-items: center; justify-content: center; font-size: 12px; font-weight: 600; letter-spacing: .02em;
    background: var(--active); color: var(--muted); box-shadow: none;
}
.msg-out .msg-avatar { background: var(--accent-tint); color: var(--accent-ink); }
.msg > .msg-meta { grid-column: 2; grid-row: 1; order: 0; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; margin: 0 0 6px; font-size: 12px; color: var(--faint); font-weight: 400; }
.msg > .bubble, .msg-in .bubble, .msg-out .bubble, .msg-note .bubble, .msg-draft .bubble {
    grid-column: 2; grid-row: 2; margin: 0; padding: 0; border: 0 !important; border-radius: 0; background: none !important; box-shadow: none;
    font-size: 14px; line-height: 22px; color: var(--text); max-width: 72ch; white-space: pre-wrap;
}
.msg > .msg-tools, .msg > .draft-actions { grid-column: 2; grid-row: 3; margin-top: 8px; }
.msg-grouped { padding-top: 10px; }
.msg-note { grid-template-columns: minmax(0, 1fr); background: var(--note-bg); border-color: var(--note-border); }
.msg-note > .msg-meta, .msg-note > .bubble, .msg-note > .msg-tools { grid-column: 1; }
.msg-note-label { color: var(--note-ink); font-weight: 600; }
.msg-draft { border-style: dashed; }
.msg-draft-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.badge-ai, .badge-draft, .badge-send-failed { font-size: 12px; font-weight: 600; color: var(--muted); }
.badge-send-failed { color: var(--danger); }
.day-sep-label { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; color: var(--faint); }

/* ---- composer: one bordered box ---- */
.composer { background: var(--panel); border-top: 1px solid var(--border); padding: 12px 24px 14px; }
.composer textarea { border: 1px solid var(--border-strong); border-radius: 8px; background: var(--field); font-size: 14px; line-height: 22px; padding: 10px 12px; }
.composer textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 0; }
.composer-tab { font-size: 13px; font-weight: 500; }
.composer.note-mode { background: var(--note-bg); border-top: 1px solid var(--note-border); }
.composer.note-mode textarea { border-color: var(--note-border); }

/* ---- side panel: label above value, no uppercase ---- */
.context { background: var(--panel); border-left: 1px solid var(--border); }
.context-inner { gap: 0; padding: 0; }
.ctx-section { padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 6px; }
.ctx-h { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ctx-row { display: grid; grid-template-columns: 1fr; gap: 1px; margin-bottom: 8px; }
.ctx-row-k { font-size: 12px; color: var(--faint); }
.ctx-row-v { text-align: left; font-size: 13px; color: var(--text); }
.ctx-contact-name { font-size: 15px; font-weight: 600; }

/* ---- buttons ---- */
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; box-shadow: none; background-image: none; }
.btn-primary:hover { background: var(--accent-2-hover); border-color: var(--accent-2-hover); }
.thread-head-top > div:first-child { display: block !important; flex: 1 1 auto; min-width: 0; }
.thread-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .msg-avatar { position: static !important; margin: 0 !important; inset: auto !important; transform: none !important; align-self: start; }
.msg-out, .msg-in { margin-left: 0 !important; margin-right: 0 !important; justify-self: start; flex-direction: initial; }

/* =====================================================================
   SCV7 (2026-10-10): "quiet precision + floating glass"
   Spec: SUPPCHAT_UI_RESEARCH_2026-10-10/05_future_look.md section 2.
   Opaque flat reading surfaces; translucency + blur only on things that
   float (topbar, command palette, menus, toasts). One accent. Status as
   words. Tabular numerals. Contrast measured (Node, WCAG): every text
   token >= 4.73:1, accent 7.33 dark / 5.90 light, signal 6.53 / 5.66.
   ===================================================================== */
:root, :root[data-theme="light"] {
    --bg: #f6f6f4; --panel: #ffffff; --panel-2: #fbfbf9; --raised: #fbfbf9; --inset: #f6f6f4; --field: #ffffff;
    --hover: #efefec; --active: #e6e6e2; --row-sel: #e6e6e2;
    --border: #e4e4df; --border-strong: #cbcbc5; --border-hover: #a9a9a2; --border-float: rgba(17, 17, 18, .09);
    --text: #111112; --muted: #55554f; --faint: #6e6e68;
    --accent: #2f5bd3; --accent-2: #2f5bd3; --accent-2-hover: #274db4; --accent-ink: #2f5bd3; --accent-fg: #ffffff;
    --accent-tint: #e8eefc; --accent-weak: #e8eefc; --focus: #2f5bd3;
    --danger: #c42b1f; --warn: #9a5b00; --success: #1b7a4b;
    --out-bg: #ffffff; --note-bg: #e8eefc; --note-border: #c9d6f6; --note-ink: #1d3f9e;
    --glass: rgba(255, 255, 255, .72); --glass-line: rgba(17, 17, 18, .09); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .9);
    --blur: none; --shadow-float: 0 10px 30px rgba(17, 17, 18, .14);
    --ring: 0 0 0 2px #f6f6f4, 0 0 0 4px #2f5bd3;
    --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] {
    --bg: #0e0e0f; --panel: #151516; --panel-2: #1c1c1e; --raised: #1c1c1e; --inset: #121213; --field: #121213;
    --hover: #1c1c1e; --active: #2a2a2d; --row-sel: #212123;
    --border: #262628; --border-strong: #38383b; --border-hover: #4a4a4e; --border-float: rgba(255, 255, 255, .09);
    --text: #ececea; --muted: #a6a6a3; --faint: #82827f;
    --accent: #7aa2ff; --accent-2: #7aa2ff; --accent-2-hover: #93b4ff; --accent-ink: #7aa2ff; --accent-fg: #0e0e0f;
    --accent-tint: #1b2540; --accent-weak: #1b2540; --focus: #7aa2ff;
    --danger: #ff6b5e; --warn: #e8a13a; --success: #6fcf97;
    --out-bg: #151516; --note-bg: #1b2540; --note-border: #2b3a63; --note-ink: #b9ccff;
    --glass: rgba(24, 24, 26, .66); --glass-line: rgba(255, 255, 255, .09); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .07);
    --blur: none; --shadow-float: 0 10px 30px rgba(0, 0, 0, .45);
    --ring: 0 0 0 2px #0e0e0f, 0 0 0 4px #7aa2ff;
}
html, body { background: var(--bg); color: var(--text); }
body, button, input, select, textarea { font-family: "Inter", "Inter Variable", system-ui, "Segoe UI", sans-serif; font-feature-settings: "cv11", "ss01"; }
.qitem-time, .qitem-ref, .chip-n, .ctx-row-v, .msg-meta, .cmdk-sub, kbd { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.btn, .chip, .qitem, select, input, textarea, .cmdk-item { transition: background-color 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0ms !important; animation: none !important; } }

/* ---------- floating layers: solid background (1.28.0, no frosted glass) ---------- */
.topbar, .cmdk, .user-menu, .send-menu, .thread-more-menu, .toast, .tag-picker, .picker, .popover {
    background: var(--raised) !important;
}
.topbar { background: var(--bg) !important; }
.cmdk, .user-menu, .send-menu, .thread-more-menu, .toast {
    border: 1px solid var(--glass-line) !important; border-radius: 10px !important; box-shadow: var(--glass-hi), var(--shadow-float) !important;
}

/* ---------- topbar 44px, translucent, palette trigger in the middle ---------- */
.topbar { height: 44px; min-height: 44px; padding: 0 12px; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--glass-line) !important; box-shadow: none !important; }
.brand { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; }
.topbar .search { display: flex; align-items: center; gap: 8px; flex: 0 1 460px; margin-left: 16px; }
.topbar .search input { height: 30px; border-radius: 6px; background: var(--inset); border: 1px solid var(--border); font-size: 13px; }
.cmdk-trigger {
    flex: none; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--inset); color: var(--muted); font-size: 13px; cursor: pointer;
}
.cmdk-trigger:hover { color: var(--text); border-color: var(--border-strong); }
kbd, .cmdk-trigger kbd, .cmdk-kbd {
    display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border-strong);
    background: var(--panel); color: var(--muted); font: 500 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.topnav-link { color: var(--muted) !important; font-size: 13px; }
.topnav-link:hover { color: var(--text) !important; background: var(--hover) !important; }
.user-toggle { width: 26px !important; height: 26px !important; border: 0 !important; background: var(--active) !important; font-size: 11px !important; }

/* ---------- command palette ---------- */
.cmdk-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(0, 0, 0, .28); }
.cmdk-overlay.open { display: flex; animation: cmdk-in 180ms var(--ease); }
@keyframes cmdk-in { from { opacity: 0; } to { opacity: 1; } }
.cmdk { width: min(640px, calc(100vw - 32px)); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; animation: cmdk-up 200ms var(--ease); }
@keyframes cmdk-up { from { transform: translateY(6px) scale(.99); } to { transform: none; } }
.cmdk-input { height: 52px; padding: 0 18px; border: 0 !important; border-bottom: 1px solid var(--glass-line) !important; border-radius: 0 !important; background: transparent !important; font-size: 16px; color: var(--text); box-shadow: none !important; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--faint); }
.cmdk-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.cmdk-item.on { background: var(--active); }
.cmdk-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-sub { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--faint); }
.cmdk-kbd { margin-left: auto; }
.cmdk-empty { padding: 20px 12px; font-size: 13px; color: var(--muted); }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--glass-line); font-size: 12px; color: var(--faint); }
.cmdk-foot kbd { margin-right: 3px; }

/* ---------- queue ---------- */
.queue { width: 360px; background: var(--panel); border-right: 1px solid var(--border); }
.queue-filters { padding: 6px 10px 0; background: var(--panel); }
.queue-filters .chip { height: 32px; font-size: 13px; padding: 0 8px; }
.queue-filters .chip.active { border-bottom-color: var(--text); }
.queue .qitem { padding: 10px 14px 10px 16px; border-bottom: 1px solid var(--border); }
.queue .qitem:hover { background: var(--hover); }
.queue .qitem.active { background: var(--row-sel); box-shadow: inset 2px 0 0 var(--accent); }
.qitem-name { font-size: 13.5px; font-weight: 500; }
.qitem-subj { font-size: 13px; color: var(--muted); }
.queue .qitem.unread .qitem-name { font-weight: 650; }
.queue .qitem.unread .qitem-subj { color: var(--text); font-weight: 500; }
.queue .qitem.unread .qitem-time { color: var(--accent-ink); font-weight: 600; }
.qrow-3 { margin-top: 3px; }
.qitem-ref { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11px; letter-spacing: 0; }
.qskel-wrap { padding: 0; }
.qskel { height: 74px; padding: 12px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 7px; align-content: start; }
.qskel i { display: block; height: 10px; border-radius: 3px; background: var(--hover); }
.qskel i:nth-child(1) { width: 45%; } .qskel i:nth-child(2) { width: 80%; } .qskel i:nth-child(3) { width: 35%; height: 8px; }

/* ---------- tags: quiet tint chips (03_tags_teardown) ---------- */
.tag-chip, .qitem-tags .tag-chip, .thread-tags .tag-chip, .ctx-section .tag-chip { border-radius: 4px; }

/* ---------- thread header: title, meta line, property row ---------- */
.thread-head { display: block !important; padding: 14px 24px 0 !important; background: var(--panel) !important; border-bottom: 1px solid var(--border); }
.thread-head-top { display: flex !important; align-items: center; gap: 12px; }
.thread-title { font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.thread-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.thread-company { display: flex; gap: 10px; margin-top: 4px; font-size: 12.5px; }
.thread-tags, .thread-links { display: flex !important; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; width: 100%; }
.thread-viewers { width: 100%; }
.thread-resolve { height: 28px; border-radius: 6px; font-size: 13px; }
.thread-controls { display: flex !important; flex-wrap: nowrap; width: 100%; gap: 2px 14px; margin-top: 10px; padding: 6px 0; border-top: 1px solid var(--border); overflow: visible; }
.thread-controls .prop-k { font-size: 12px; color: var(--faint); }
.thread-controls select { height: 28px; font-size: 13px; }
.thread-controls .panel-toggle { margin-left: auto !important; }
.thread-more { margin-left: 0 !important; }
.thread-more-menu { padding: 4px; min-width: 220px; }
.thread-more-menu .btn { width: 100%; justify-content: flex-start; height: 32px; }
.thread-more-menu [data-bind="ban"] { color: var(--danger); border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; margin-top: 4px; }

/* ---------- messages: flat blocks on the reading surface, no cards ---------- */
.messages { background: var(--bg); padding: 8px 32px 24px; gap: 0; }
.msg, .msg-in, .msg-out, .msg-draft {
    max-width: 760px; padding: 16px 0 16px 0; border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important;
}
.msg-out > .bubble { border-left: 2px solid var(--border-strong) !important; padding-left: 12px !important; }
.msg > .msg-meta { font-size: 12px; color: var(--faint); }
.msg > .msg-meta span:last-child { color: var(--faint); }
.msg > .bubble { font-size: 14px; line-height: 1.55; }
.msg-avatar { width: 28px !important; height: 28px !important; font-size: 11px !important; background: var(--active) !important; color: var(--muted) !important; }
.msg-out .msg-avatar { background: var(--accent-tint) !important; color: var(--accent-ink) !important; }
.msg-note {
    max-width: 760px; margin: 12px 0 !important; padding: 12px 14px !important; border: 1px solid var(--note-border) !important; border-radius: 8px !important;
    background: var(--note-bg) !important; box-shadow: none !important;
}
.msg-note-label { color: var(--note-ink) !important; }
.msg-draft { border: 1px dashed var(--border-strong) !important; border-radius: 8px !important; padding: 14px !important; margin: 12px 0; }
.day-sep { margin: 16px 0 4px; }

/* ---------- composer: one rounded field with a focus ring ---------- */
.composer { background: var(--bg) !important; border-top: 0 !important; padding: 8px 32px 16px !important; }
.composer-tabs { margin-bottom: 6px; }
.composer textarea {
    border: 1px solid var(--border-strong) !important; border-radius: 10px !important; background: var(--panel) !important;
    padding: 12px 14px !important; font-size: 14px; line-height: 1.55; min-height: 84px;
}
.composer textarea:focus { border-color: var(--accent) !important; outline: none !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent) !important; }
.composer.note-mode { background: var(--bg) !important; }
.composer.note-mode textarea { background: var(--note-bg) !important; border-color: var(--note-border) !important; }
.composer-actions { margin-top: 8px; }
.composer-hint { font-size: 12px; color: var(--faint); }
.btn-primary { background: var(--accent-2) !important; border-color: var(--accent-2) !important; color: var(--accent-fg) !important; }
.btn-primary:hover { background: var(--accent-2-hover) !important; border-color: var(--accent-2-hover) !important; }
.send-split .send-more { border-left: 1px solid color-mix(in srgb, var(--accent-fg) 30%, transparent) !important; }
.composer.note-mode .send-split .btn-primary { background: var(--text) !important; border-color: var(--text) !important; color: var(--panel) !important; }

/* ---------- right panel: key/value rows, hairlines ---------- */
.context { width: 320px; background: var(--panel); }
.ctx-section { padding: 14px 18px; }
.ctx-h { font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--faint); }
.ctx-row { display: flex !important; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ctx-row:last-child { border-bottom: 0; }
.ctx-row-k { font-size: 12px; color: var(--faint); }
.ctx-row-v { font-size: 13px; text-align: right; }
.ctx-contact-name { font-size: 14px; font-weight: 600; }
.ctx-contact-email a { color: var(--muted); }

/* ---------- toast ---------- */
.toast { color: var(--text) !important; font-size: 13px; padding: 10px 14px !important; }
.toast.err { color: var(--danger) !important; }
.thread-tags, .thread-links { display: inline-flex !important; width: auto !important; vertical-align: middle; margin: 8px 12px 0 0 !important; }
.thread-links:empty { display: none !important; }
.thread-company { display: inline-flex !important; margin: 0 0 0 8px; vertical-align: baseline; }
.thread-sub { display: inline; }
.cmdk-input:focus, .cmdk-input:focus-visible { box-shadow: none !important; outline: none !important; }

/* =====================================================================
   SCV7 + queue work (2026-10-10, 08_SEZNAM_ZLEPSENI A-G): queue tools,
   paging footer, undo toast, key help. Same language: hairlines, one
   accent, words not dots.
   ===================================================================== */
.queue-tools { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.qtool { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.qtool select { height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); font-size: 12.5px; max-width: 170px; }
.qtool select:hover { border-color: var(--border-hover); }
.queue-more { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 14px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.queue-more .btn { height: 28px; font-size: 12.5px; }
.queue-empty { padding: 28px 16px; text-align: center; font-size: 13px; color: var(--muted); }
.toast.toast-has-undo { pointer-events: auto; gap: 14px; }
.toast-undo { border: 0; background: none; padding: 2px 4px; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; border-radius: 4px; }
.toast-undo:hover { text-decoration: underline; }
.toast-undo:disabled { color: var(--faint); cursor: default; text-decoration: none; }
.key-help-dialog { width: min(420px, calc(100vw - 32px)); padding: 18px 20px; background: var(--panel); color: var(--text); border: 1px solid var(--border-float); }
.key-help-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.key-help-dialog .keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.key-help-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
/* C: sort + "Fronta po řadě" */
.qtool-dir, .qtool-inorder { height: 28px; font-size: 12.5px; color: var(--muted); }
.qtool-dir[aria-pressed="true"], .qtool-inorder[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-tint); }
.send-menu .btn + .btn { margin-top: 2px; }
.send-menu { min-width: 200px; }
/* B: one row above the queue (view, order, search, filters) + view menu */
.queue-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.view-switch { position: relative; min-width: 0; flex: 0 1 auto; }
.view-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 190px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.view-btn:hover { border-color: var(--border-hover); }
.view-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-n, .view-item-n { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.view-menu { display: none; position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 280px; max-height: 70vh; overflow: auto; padding: 6px; background: var(--panel); border: 1px solid var(--border-float); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.view-menu.open { display: block; }
.view-group { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.view-row { display: flex; align-items: center; gap: 2px; }
.view-item { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border: 0; border-radius: 5px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.view-item:hover { background: var(--hover, rgba(127,127,127,.08)); }
.view-item.active { color: var(--accent-ink); background: var(--accent-tint); }
.view-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-item-key { font-size: 11px; color: var(--faint); }
.view-del { border: 0; background: none; padding: 4px 6px; font: inherit; font-size: 11.5px; color: var(--faint); cursor: pointer; border-radius: 4px; }
.view-del:hover { color: var(--text); text-decoration: underline; }
.view-save { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent-ink); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
.qh-sort { height: 30px; max-width: 150px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); font-size: 12.5px; }
.qh-search { flex: 1 1 80px; min-width: 60px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); font-size: 13px; }
.qh-filters { height: 30px; font-size: 12.5px; white-space: nowrap; }
.qh-filters.has-filters, .qh-filters[aria-expanded="true"] { color: var(--accent-ink); }
.qh-filters-n { font-variant-numeric: tabular-nums; font-weight: 600; }
.qtool-row { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.view-save-name { width: 100%; height: 34px; margin: 4px 0 10px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); font-size: 14px; }
.view-save-what { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.view-save-scope, .view-save-display { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; color: var(--muted); }
.view-switch { flex: 0 1 auto; min-width: 104px; }
.view-btn { width: 100%; justify-content: space-between; }
.qh-sort { flex: 0 1 112px; min-width: 84px; }
.qh-search { flex: 1 1 60px; min-width: 48px; }
.qh-search:focus { min-width: 120px; }
/* F: settings dialog; what the operator may not do is not shown */
body.no-bulk .qitem-check, body.no-bulk #bulk-bar { display: none !important; }
.settings-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; background: var(--panel); color: var(--text); border: 1px solid var(--border-float); }
.settings-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.set-head .key-help-title { margin: 0; }
.set-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 7px; }
.set-tab { border: 0; background: none; padding: 4px 12px; border-radius: 5px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.set-tab[aria-selected="true"] { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.set-body { overflow: auto; padding: 8px 20px 4px; }
.set-sec { border: 0; border-top: 1px solid var(--border); margin: 10px 0 0; padding: 10px 0 4px; }
.set-legend { padding: 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.set-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; align-items: center; gap: 4px 12px; padding: 5px 0; font-size: 13px; }
.set-k { color: var(--muted); }
.set-row select, .set-row input[type="time"], .set-key { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); font-size: 13px; justify-self: start; }
.set-row input[type="checkbox"] { justify-self: start; }
.set-key { width: 44px; text-align: center; text-transform: uppercase; }
.set-hint { grid-column: 2; font-size: 12px; color: var(--faint); margin: 2px 0 0; }
.set-sec > .set-hint { grid-column: auto; }
.set-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.set-check { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.set-inline { display: inline-flex; align-items: center; gap: 6px; }
.set-sig { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; font-size: 13px; resize: vertical; }
.set-ro { margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; color: var(--muted); }
.set-view { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; }
.set-view-name { flex: 1; }
.set-link { font-size: 13px; color: var(--accent-ink); }
.settings-dialog .key-help-foot { padding: 12px 20px 16px; margin: 0; border-top: 1px solid var(--border); gap: 8px; }
.key-help-foot { gap: 8px; }
@media (max-width: 560px) { .set-row { grid-template-columns: 1fr; } .set-hint { grid-column: 1; } }
/* D: layouts. Three columns stay the default. */
.qtool-display { align-items: center; gap: 6px 12px; padding-top: 2px; }
.qtool-fields { flex-wrap: wrap; gap: 4px 10px; }
.qtool-fields .set-check { font-size: 12.5px; }
.qgroup { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 16px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.qgroup-n { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 500; text-transform: none; letter-spacing: 0; }
.qrow-preview { font-size: 12.5px; line-height: 17px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* density */
body.density-compact .queue .qitem { padding-top: 6px; padding-bottom: 6px; gap: 0; }
body.density-compact .queue .qitem .qrow-3 { display: none; }
body.density-compact .queue .qitem.active .qrow-3, body.density-compact .queue .qitem:hover .qrow-3 { display: flex; }
body.density-comfy .queue .qitem { padding-top: 14px; padding-bottom: 14px; gap: 4px; }
body.density-compact .qtable td { padding-top: 4px; padding-bottom: 4px; }
body.density-comfy .qtable td { padding-top: 12px; padding-bottom: 12px; }
/* table and board: the queue takes the width, the ticket opens in a side panel */
body.layout-table .queue, body.layout-board .queue { flex: 1; width: auto; max-width: none; border-right: 0; }
body.layout-table .thread, body.layout-board .thread { display: none; }
body.layout-table .workspace.has-thread .thread, body.layout-board .workspace.has-thread .thread {
    display: flex; position: fixed; right: 0; top: 44px; bottom: 0; z-index: 30; width: min(760px, 64vw);
    border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(0,0,0,.16);
}
body.layout-table .context, body.layout-board .context { display: none !important; }
body.layout-table .thread-back, body.layout-board .thread-back { display: inline-flex !important; }
body.layout-focus .queue { display: none; }
.focus-exit { position: fixed; left: 16px; bottom: 16px; z-index: 35; box-shadow: 0 4px 16px rgba(0,0,0,.14); }
.qtable-wrap { overflow-x: auto; }
.qtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.qtable th { position: sticky; top: 0; z-index: 3; background: var(--panel); text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.qt-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.qt-sort:hover { color: var(--text); text-decoration: underline; }
.qtable th[aria-sort] .qt-sort { color: var(--accent-ink); }
.qt-dir { font-weight: 500; }
.queue .qtable tr.qitem { display: table-row; padding: 0; position: static; cursor: pointer; }
.qtable td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text); }
.qtable tr.qitem:hover td { background: var(--hover); }
.qtable tr.qitem.active td { background: var(--row-sel); }
.qtable tr.qitem.active td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.qtable tr.qitem.unread .qt-subject, .qtable tr.qitem.unread .qt-contact { font-weight: 600; }
.qtable tr.qitem::before, .qtable tr.qitem::after { display: none; }
.qt-subject { min-width: 220px; }
.qt-status, .qt-priority, .qt-sla, .qt-arrival, .qt-activity { white-space: nowrap; color: var(--muted); }
.qtable .qt-attn { color: var(--text); font-weight: 600; }
.qgroup-row td { padding: 0; border: 0; }
.qgroup-row .qgroup { position: static; }
.qboard { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 10px; padding: 10px; min-height: 100%; overflow-x: auto; align-items: start; }
.bcol { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; min-height: 200px; display: flex; flex-direction: column; }
.bcol .qgroup { position: static; border-radius: 8px 8px 0 0; background: transparent; }
.bcol.drop { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bcol-body { display: grid; gap: 6px; padding: 8px; }
.bcol-empty { margin: 8px 4px; font-size: 12.5px; color: var(--faint); }
.queue .qitem.bcard { position: relative; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); cursor: grab; }
.queue .qitem.bcard::before, .queue .qitem.bcard::after { display: none; }
.queue .qitem.bcard.dragging { opacity: .5; }
.bcard-subj { font-size: 13px; line-height: 18px; color: var(--text); }
@media (max-width: 760px) { .qboard { grid-template-columns: repeat(5, 240px); } body.layout-table .workspace.has-thread .thread, body.layout-board .workspace.has-thread .thread { width: 100vw; } }
/* G39/G40: ticket header in two lines, actions in one place */
.thread-head-top > div:first-child { display: flex !important; flex-wrap: nowrap; align-items: baseline; gap: 2px 10px; }
.thread-head-top .thread-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.thread-head-top .thread-company { margin: 0 !important; }
.thread-head-top .thread-sub { color: var(--faint); }
.thread-controls { display: flex; flex-wrap: wrap; align-items: center; }
.thread-controls .thread-tags { margin: 0; display: inline-flex; flex-wrap: wrap; gap: 4px; }
.thread-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.thread-actions .thread-resolve { order: -1; }
.thread-links:not([hidden]) { margin-top: 6px; }
.queue-empty-t { margin: 0; }
.thread-controls .thread-tags { order: 0; }
.thread-actions { order: 1; }
.thread-head-top .thread-title { flex: 0 1 auto; max-width: 70%; }
.thread-head-top .thread-company { flex: none; }
.thread-head-top .thread-sub { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the property words say what they are; the label stays for screen readers */
.thread-controls .prop-k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thread-head-top .thread-company { order: 1; } .thread-head-top .thread-sub { order: 2; flex-shrink: 100; }

/* ===== E26/E33: customer panel with the company ===== */
.ctx-company-note { margin: 6px 0 8px; font-size: 13px; line-height: 1.45; color: var(--text); white-space: pre-line; }
.ctx-sub-h { margin: 12px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ctx-people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.ctx-people a { color: var(--accent-ink); text-decoration: none; }
.ctx-people a:hover { text-decoration: underline; }
.ctx-rel-top .ctx-rel-status { margin-left: auto; font-size: 12px; color: var(--muted); }
.ctx-company-queue { margin-top: 10px; }

/* QA 2026-10-13: phone width. The 44px topbar above shows the palette trigger at every width, which
   undid app.css hiding it under 760px: it wrapped under the brand and sat over the ticket header. */
@media (max-width: 760px) {
    .topbar .search { display: none; }
    /* the subject, company and contact line shared one unwrapped row and the contact line got 0 px */
    .thread-head-top > div:first-child { flex-wrap: wrap !important; }
    .thread-head-top .thread-title { max-width: 100%; flex-basis: 100%; }
}
.thread-crm:not([hidden]) { margin-top: 6px; }
