/* Support console. Plain CSS, no build step (research R2). Visual system: DESIGN.md. */
:root {
  --app: #F3F4F6;
  --surface: #FFFFFF;
  --sunken: #F7F8FA;
  --ink: #15171C;
  --ink-2: #474D59;
  --ink-3: #636A77;
  --line: #E5E7EB;
  --line-strong: #D2D6DC;
  --accent: #3355D6;
  --accent-ink: #2A47B8;
  --accent-soft: #EDF1FD;
  --ok: #1D7A4B;
  --ok-soft: #E6F4EC;
  --near: #9A5800;
  --near-soft: #FFF2DC;
  --near-bar: #E39A1B;
  --past: #BE2A2F;
  --past-soft: #FCEBEB;
  --note: #FFF8E1;
  --note-line: #F1DFA6;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-float: 0 12px 32px -8px rgb(21 23 28 / .28), 0 2px 6px rgb(21 23 28 / .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* AI identity (SC-22): everything the AI does or offers wears this gradient; people's work never does. */
  --ai: linear-gradient(120deg, #2446C7 0%, #5B47F0 55%, #9B44E0 100%);
  --ai-soft: linear-gradient(120deg, #EEF1FE 0%, #F1EEFE 60%, #F7EEFD 100%);
  color-scheme: light;
  font-family: var(--font);
  accent-color: var(--accent);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--app); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
code, .mono { font-family: var(--mono); font-size: .92em; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
::selection { background: #CBD6FA; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sprite { position: absolute; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-3); }
.error { color: var(--past); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Controls */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--sunken); border-color: #BCC1C9; }
.button:disabled { opacity: .55; cursor: default; }
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.button--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.button--dark:hover { background: #2B2F37; border-color: #2B2F37; }
.button--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.button--small { min-height: 28px; padding: 0 10px; font-size: 13px; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-button:hover { background: var(--sunken); color: var(--ink); }
textarea, input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 7px 10px; }
textarea:hover, input:hover, select:hover { border-color: #BCC1C9; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: #6B7280; }
select {
  appearance: none; -webkit-appearance: none;
  min-height: 34px; padding: 0 32px 0 10px; font-weight: 500; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23636A77' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 9px center / 16px;
  box-shadow: 0 1px 1px rgb(21 23 28 / .04);
}
select:hover { background-color: var(--sunken); }
select:focus { background-color: var(--surface); }
select:disabled { opacity: .55; cursor: default; }
.side__group select { width: 100%; }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: inline-flex; align-items: center; }
  select::picker-icon { display: none; } /* the chevron above stays */
  ::picker(select) { margin-top: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-float); max-height: 320px; }
  option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border-radius: 5px; font-weight: 450; color: var(--ink); }
  option::checkmark { order: 1; margin-left: auto; color: var(--accent); }
  option:hover, option:focus-visible { background: var(--sunken); outline: none; }
  option:checked { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
}

/* Shell */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; text-decoration: none; white-space: nowrap; }
.topbar__mark { width: 20px; height: 20px; border-radius: 6px; background: var(--ink); box-shadow: inset -7px -7px 0 0 var(--accent); }
.topbar__search { position: relative; flex: 1; max-width: 460px; }
.topbar__search > .icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--ink-3); }
.topbar__search input { width: 100%; height: 34px; padding-left: 32px; background: var(--sunken); border-color: transparent; }
.topbar__search input:focus { background: var(--surface); }
.live { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: #A3A9B3; }
.live[data-live="on"] .live__dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.live[data-live="on"] { color: var(--ok); }
.topbar__user { position: relative; cursor: pointer; font-weight: 500; }
.topbar__user summary { list-style: none; padding: 6px 10px; border-radius: var(--radius); }
.topbar__user summary::-webkit-details-marker { display: none; }
.topbar__user summary:hover { background: var(--sunken); }
.topbar__user form { position: absolute; right: 0; top: 38px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-float); white-space: nowrap; }
.topbar__user button { padding: 6px 10px; border: 0; border-radius: 4px; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.topbar__user button:hover { background: var(--sunken); }
.page { padding: 20px; }

/* Shared pieces */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card__heading { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.card__heading .plain { font-weight: 400; }
.swatch { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #EEF0F3; color: var(--ink-2); }
.mark { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: #EEF0F3; color: var(--ink-2); font-size: 12px; }
.mark--handoff { background: var(--near-soft); color: var(--near); }
.channel { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-right: 8px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--ink-3); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.channel--chat { border-color: #C9D3F6; color: var(--accent-ink); }
.banner { padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--past-soft); color: var(--past); font-weight: 600; }

/* Stage: a word and a shape, never colour alone */
.stage { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #EEF0F3; color: var(--ink-2); }
.stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.stage--unassigned { background: var(--accent-soft); color: var(--accent-ink); }
.stage--mine::before, .stage--assigned::before { background: currentColor; }
.stage--mine { background: #E9E6FB; color: #4C3BB0; }
.stage--waiting::before { border-style: dotted; }
.stage--closed { color: var(--ink-3); }
.stage--closed::before { background: currentColor; border-radius: 2px; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-3); flex: none; }
.stage-dot--unassigned { border-color: var(--accent); }
.stage-dot--mine { border-color: #4C3BB0; background: #4C3BB0; }
.stage-dot--open { border-color: var(--ink-2); background: var(--ink-2); }
.stage-dot--waiting { border-style: dotted; }
.stage-dot--closed { border-radius: 2px; background: var(--ink-3); }

/* Promise meter: the wait clock against the project's promise */
.meter { display: inline-grid; justify-items: end; gap: 2px; width: 100%; max-width: 190px; }
.meter__time { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.meter__state { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.meter__state .icon { width: 13px; height: 13px; stroke-width: 1.9; }
.meter__of { font-weight: 400; color: var(--ink-3); }
.meter__bar { width: 100%; height: 4px; border-radius: 2px; background: #E9EBEF; overflow: hidden; }
.meter__bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.meter--ok .meter__state { color: var(--ok); }
.meter--near .meter__time, .meter--near .meter__state { color: var(--near); }
.meter--near .meter__bar > span { background: var(--near-bar); }
.meter--past .meter__time, .meter--past .meter__state { color: var(--past); }
.meter--past .meter__bar > span { background: var(--past); }
.meter--idle .meter__time { color: var(--ink-2); font-weight: 500; font-size: 14px; }
.meter--idle .meter__state { font-weight: 400; }

/* Home */
.home, .kb { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 24px; max-width: 1440px; margin: 0 auto; }
.side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; padding-bottom: 8px; }
.side__group { display: flex; flex-direction: column; gap: 1px; }
.side__group select { margin-top: 2px; }
.side__row { display: flex; justify-content: space-between; align-items: center; }
.side__heading { margin: 0 0 6px; padding: 0 10px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.side__group > .side__heading:first-child[for] { padding: 0; }
.side__item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.side__item:hover { background: #E8EAEE; color: var(--ink); }
.side__item.is-active { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgb(21 23 28 / .08), inset 0 0 0 1px var(--line); }
.side__item.is-picked { background: var(--accent-soft); color: var(--accent-ink); }
.side__item--action { color: var(--accent-ink); }
.side__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__clear { font-size: 12px; padding-right: 10px; }
.side__note { margin: 0 10px; font-size: 13px; }
.side__hours-list { gap: 10px; }
.hours-card { padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 12px; }
.hours-card__head { display: flex; align-items: center; gap: 8px; }
.hours-card__head .dot { margin-top: 0; }
.hours-card__project { flex: 1; font-size: 13px; font-weight: 650; }
.hours-card__state { height: 20px; padding: 0 8px; border-radius: 10px; display: inline-flex; align-items: center; font-weight: 650; background: #EEF0F3; color: var(--ink-2); }
.hours-card--open .hours-card__state { background: var(--ok-soft); color: var(--ok); }
.hours-card__facts { margin: 8px 0 0; }
.hours-card__facts dt { margin-top: 6px; font-size: 11px; color: var(--ink-3); }
.hours-card__facts dd { margin: 1px 0 0; color: var(--ink-2); font-size: 13px; }
.hours-card__quote { color: var(--ink); font-weight: 500; }
.dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #A3A9B3; }
.dot--on { background: var(--ok); }
.pill { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.pill--alert { background: var(--accent); color: #fff; }
.queue { min-width: 0; }
.queue__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.queue__head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.queue__count { margin-left: 4px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: #E8EAEE; }
.segmented__item { padding: 4px 12px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500; }
.segmented__item:hover { color: var(--ink); }
.segmented__item.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(21 23 28 / .1); }
.summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0; padding: 0; list-style: none; color: var(--ink-3); font-size: 13px; }
.summary__item { display: inline-flex; align-items: center; gap: 5px; }
.summary__item strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.summary__item .icon { width: 14px; height: 14px; }
.summary__item--past.is-on { color: var(--past); font-weight: 600; }
.summary__item--past.is-on strong { color: var(--past); }
.summary__item--near.is-on { color: var(--near); font-weight: 600; }
.summary__item--near.is-on strong { color: var(--near); }
.panel { overflow: hidden; }
.calls { width: 100%; border-collapse: collapse; }
.calls th { padding: 9px 16px; text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: var(--sunken); border-bottom: 1px solid var(--line); }
.calls td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.calls tbody tr:last-child td { border-bottom: 0; }
.row { position: relative; }
.row:hover { background: #FAFBFC; }
.row--past { background: linear-gradient(90deg, var(--past-soft), transparent 40%); }
.row--past:hover { background: linear-gradient(90deg, #FAE2E2, #FAFBFC 40%); }
.row__stage { width: 1%; }
.row__customer { width: 22%; min-width: 180px; }
.row__who { display: flex; align-items: center; gap: 7px; }
.row__name { color: var(--ink); text-decoration: none; font-weight: 600; }
.row .row__name::after { content: ""; position: absolute; inset: 0; } /* the whole queue row opens the call */
.row__name:focus-visible { outline: none; }
.row:has(.row__name:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.row__sub { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.row__sub--none { color: var(--past); }
.row__project { font-weight: 500; color: var(--ink-2); }
.row__conversation { max-width: 0; width: 100%; }
.row__preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.row--new .row__preview { color: var(--ink); font-weight: 500; }
.row__marks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.row__assignee { white-space: nowrap; }
.row__assignee .button, .row__wait { position: relative; z-index: 1; }
.assignee { color: var(--ink-2); font-weight: 500; }
.row__wait { width: 190px; min-width: 190px; text-align: right; }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.empty { padding: 56px 24px; text-align: center; color: var(--ink-3); }
.empty__icon { width: 28px; height: 28px; color: var(--ok); margin-bottom: 8px; }
.empty__title { font-weight: 650; color: var(--ink); margin-bottom: 2px; font-size: 15px; }

/* Call page */
.call { max-width: 1280px; margin: 0 auto; }
.crumbs { margin-bottom: 14px; font-size: 13px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.call__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.call__title h1 { margin: 0 0 10px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.call__chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.call__chips .channel { margin: 0; height: 24px; padding: 0 8px; font-size: 12px; border-radius: 12px; }
.call__clock { flex: none; width: 200px; }
.call__clock .meter { max-width: none; }
.call__clock .meter__time { font-size: 22px; }
.call__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; margin-bottom: 18px; background: var(--sunken); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.call__actions label { font-size: 13px; color: var(--ink-3); }
.call__actions select { min-height: 34px; }
.call__actions-spacer { flex: 1; }
.call__status-actions { display: inline-flex; gap: 8px; }
.call__body { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.call__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.call__side { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.call__side .card, .thread, .reply { padding: 16px 18px; }
.thread > p { margin: 0 0 14px; }
.thread [data-messages] { display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: min(78%, 640px); align-self: flex-start; }
.msg__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.msg__body { padding: 10px 13px; border-radius: 12px 12px 12px 4px; background: #F0F1F4; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.msg__body:empty { display: none; }
.msg__body p, .msg__body ul, .msg__body ol { margin: 0 0 8px; }
.msg__body > :last-child { margin-bottom: 0; }
.msg__body ul, .msg__body ol { padding-left: 20px; }
.msg__body .md-h { font-weight: 650; }
.msg__body code { font-size: .92em; padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, .06); }
.msg--bot .msg__body { background: var(--surface); border: 1px dashed var(--line-strong); }
.msg--staff { align-self: flex-end; }
.msg--staff .msg__meta { justify-content: flex-end; }
.msg--staff .msg__body { background: var(--accent); color: #fff; border-radius: 12px 12px 4px 12px; }
.msg--staff .msg__body a { color: #fff; }
.msg--staff .msg__files { justify-content: flex-end; }
.msg--fresh .msg__body { box-shadow: 0 0 0 2px var(--accent); }
.fresh-tag { display: inline-flex; height: 18px; padding: 0 6px; align-items: center; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 650; }
.msg__files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 6px; }
.file { display: inline-flex; flex-direction: column; max-width: 260px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; overflow: hidden; }
.file:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px -2px rgb(21 23 28 / .12); }
.file__thumb { display: block; width: 260px; max-width: 100%; height: 150px; object-fit: cover; background: var(--sunken); border-bottom: 1px solid var(--line); }
.file__meta { display: flex; align-items: center; gap: 7px; padding: 7px 10px; font-size: 13px; min-width: 0; }
.file__meta .icon { color: var(--ink-3); }
.file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file__size { color: var(--ink-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.marker { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); }
.marker::before, .marker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.reply { display: flex; flex-direction: column; gap: 10px; }
.reply:focus-within { border-color: #BCC6EE; box-shadow: 0 0 0 3px var(--accent-soft); }
.reply__head, .reply__foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.reply__send { display: flex; gap: 8px; }
.reply textarea { resize: vertical; min-height: 96px; }
.files { margin: 0; padding-left: 18px; font-size: 13px; }
.customer__name { font-size: 16px; font-weight: 650; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 14px 0 0; }
.facts dt { font-size: 12px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.others { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.others__link { display: block; padding: 4px 0; font-size: 13px; }
.block { margin-top: 12px; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note { background: var(--note); border: 1px solid var(--note-line); border-radius: var(--radius); padding: 9px 11px; line-height: 1.5; }
.note-form { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.note-form label { font-size: 13px; color: var(--ink-2); }
.note-form .button { align-self: flex-end; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; }
.tag:hover { border-color: var(--past); }

/* Attachment viewer (SC-13) */
.viewer { width: min(1100px, calc(100vw - 32px)); height: min(860px, calc(100vh - 32px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-float); color: var(--ink); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgb(15 17 22 / .62); }
.viewer__bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.viewer__bar > .icon { color: var(--ink-3); }
.viewer__title { flex: 1; min-width: 0; }
.viewer__name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__meta { font-size: 12px; color: var(--ink-3); }
.viewer__stage { flex: 1; min-height: 0; display: grid; place-items: center; background: #1B1D22; }
.viewer__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer__stage object { width: 100%; height: 100%; border: 0; display: grid; place-items: center; }
.viewer__none { display: grid; justify-items: center; gap: 10px; max-width: 360px; padding: 32px; text-align: center; color: #E7E9EE; }
.viewer__none .icon { width: 40px; height: 40px; color: #9AA1AD; }
.viewer__none p { margin: 0; color: #B5BAC4; }

/* Toasts: new customer messages on other calls (SC-14) */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 20; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; padding: 10px 12px; border-radius: 8px; background: var(--ink); color: #fff; box-shadow: var(--shadow-float); text-decoration: none; }
.toast .icon { color: #9DB2FF; }
.toast__text { flex: 1; font-size: 13px; }
.toast__text strong { display: block; font-weight: 650; }
.toast:hover { background: #262A31; }

/* Login, new call, settings, reports */
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); min-height: 100vh; margin: 0; background: var(--surface); }
.login__art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px 56px; color: #fff; background: #0B1020; }
.login__art-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.login__brand, .login__pitch { position: relative; }
.login__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.login__mark { background: #fff; box-shadow: inset -7px -7px 0 0 #5A7BFF; }
.login__pitch { max-width: 30rem; }
.login__pitch h2 { margin: 0 0 16px; font-size: clamp(34px, 4.2vw, 56px); font-weight: 700; line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.login__pitch p { margin: 0; max-width: 26rem; font-size: 16px; line-height: 1.55; color: rgb(255 255 255 / .72); }
.login__side { display: grid; place-items: center; padding: 40px 24px; }
.login__card { display: grid; gap: 8px; width: min(380px, 100%); }
.login__card h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.login__card > .muted { margin: 0 0 18px; font-size: 15px; }
.login__card label { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.login__card input { height: 44px; font-size: 15px; }
.login__submit { margin-top: 16px; min-height: 46px; font-size: 15px; font-weight: 650; background: var(--ink); border-color: var(--ink); }
.login__submit:hover { background: #2A2E37; border-color: #2A2E37; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login__art { min-height: 260px; padding: 24px 20px 28px; }
  .login__pitch h2 { font-size: 30px; }
  .login__pitch p { display: none; }
}
.narrow { max-width: 720px; margin: 0 auto; }
.narrow > h1 { margin: 0 0 16px; font-size: 22px; letter-spacing: -.015em; }
.stack { display: flex; flex-direction: column; gap: 8px; padding: 18px; margin-bottom: 16px; }
.stack > label { font-size: 13px; color: var(--ink-2); font-weight: 500; margin-top: 4px; }
.stack .button--primary { align-self: flex-start; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; }
.hours { border-collapse: collapse; }
.hours th { text-align: left; padding: 6px 16px 6px 0; font-weight: 500; color: var(--ink-2); }
.hours td { padding: 4px 8px 4px 0; }
.hours tbody tr + tr th, .hours tbody tr + tr td { border-top: 1px solid var(--line); }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tag-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag-edit > input[name="name"] { width: 180px; }
.swatches { display: inline-flex; gap: 4px; margin: 0; padding: 0; border: 0; }
.swatches__item { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.swatches__item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatches__chip { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.swatches__item:hover .swatches__chip { transform: scale(1.08); }
.swatches__item:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatches__item:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.hours select { min-width: 112px; }
.msg__original { margin-top: 6px; }
.msg__original iframe { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* Knowledge base (WH-4342), on the console's tokens (DESIGN.md). */
.kb { max-width: 1440px; margin: 0 auto; }
.kb__main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.kb__main h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.kb__lede { margin: 4px 0 0; font-size: 13px; }
.kb__project { display: flex; align-items: center; gap: 8px; max-width: 100%; font-size: 13px; color: var(--ink-3); }
.kb__project select { max-width: 100%; }
.kb__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.segmented__count { margin-left: 4px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.kb-upload { padding: 16px 18px; }
.kb-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 18px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--sunken); }
.kb-drop p { margin: 0; }
.kb-drop input:focus-visible + label, #kb-replace:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.kb-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.kb-results { margin-top: 12px; }
.kb-results__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.kb-results ul { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.kb-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; }
.kb-result__name { font-weight: 600; }
.kb-result--error { border-color: #F1C4C4; background: var(--past-soft); color: var(--past); }
.kb-result--waiting { border-color: #F2D7A6; background: var(--near-soft); color: var(--near); }
.kb-result progress { flex: 1 1 120px; max-width: 200px; accent-color: var(--accent); }
.kb-banner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.kb-banner--draft { background: var(--near-soft); border-color: #F2D7A6; color: var(--near); }
.kb-banner--draft a { color: var(--near); font-weight: 600; }
.kb-banner--published { background: var(--ok-soft); border-color: #BFE3CD; color: var(--ok); }
.kb-banner--off { background: var(--surface); border-style: dashed; border-color: var(--line-strong); color: var(--ink-2); }
.kb-scroll { position: relative; overflow-x: auto; } /* keeps the sr-only header inside the scroller */
.kb-table { min-width: 720px; }
.kb-table td { vertical-align: middle; }
/* Entry status: a word and a shape, like the call stages. */
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.status-pill--draft { background: var(--near-soft); color: var(--near); }
.status-pill--published { background: var(--ok-soft); color: var(--ok); }
.status-pill--published::before { background: currentColor; }
.status-pill--off { background: #EEF0F3; color: var(--ink-3); }
.status-pill--off::before { border-style: dashed; }
.kb-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--ink-3); }
.kb-meter__bar { width: 160px; height: 4px; border-radius: 2px; background: #E9EBEF; overflow: hidden; }
.kb-meter__bar span { display: block; height: 100%; background: var(--accent); }
.kb-entry__head { border-radius: var(--radius-lg); align-items: center; flex-wrap: wrap; }
.kb-entry__head .call__actions, .kb-confirm .call__actions, .call__side .call__actions { margin: 0; padding: 0; background: none; border: 0; }
.kb-entry__title { display: flex; flex: 1 1 320px; flex-wrap: wrap; align-items: center; gap: 8px; }
.kb-entry__title input { flex: 1 1 240px; min-width: 0; font-size: 18px; font-weight: 650; }
.kb-text { max-height: 600px; overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.kb-text:focus-visible { outline: 2px solid var(--accent); }
.kb-confirm { padding: 16px 18px; background: var(--past-soft); border: 1px solid #F1C4C4; border-radius: var(--radius-lg); color: var(--ink); }
.kb-confirm p { margin: 0 0 12px; }
.button--danger { background: var(--past); border-color: var(--past); color: #fff; }
.button--danger:hover { background: #A22328; border-color: #A22328; }
.kb-history { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 18px; font-size: 13px; }

/* Project setup (New project) */
.lede { margin: -8px 0 18px; font-size: 13px; max-width: 62ch; }
.setup { display: flex; flex-direction: column; gap: 14px; }
.setup__step { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.setup__step .card__heading { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; }
.setup__n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 650; }
.setup__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setup__intro { margin: -4px 0 0; }
.setup__actions { display: flex; justify-content: flex-end; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input:not([type=color]), .field select, .field textarea { width: 100%; }
.field textarea { resize: vertical; font-family: var(--mono); font-size: 12px; }
.field__help { margin: 0; font-size: 12px; color: var(--ink-3); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--past); }
.field .error { margin: 0; font-size: 12px; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 40px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.color-field input[type=text] { width: 140px; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.handoff { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; align-items: center; }
.handoff dt { font-size: 13px; color: var(--ink-3); }
.handoff dd { margin: 0; }
.handoff code, .snippet { cursor: copy; border-radius: var(--radius); background: var(--sunken); border: 1px solid var(--line); }
.handoff code { padding: 3px 7px; }
[data-copy] { cursor: copy; }
.handoff code.is-copied, .snippet.is-copied { border-color: var(--ok); background: var(--ok-soft); }
.handoff__sub { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
.snippet { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.guide { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--sunken); }
.guide > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--accent-ink); }
.guide[open] > summary { border-bottom: 1px solid var(--line); }
.guide__steps { margin: 0; padding: 12px 16px 4px 34px; display: flex; flex-direction: column; gap: 14px; font-size: 13px; color: var(--ink-2); }
.guide__steps p { margin: 6px 0 0; }
.guide__steps .snippet { margin-top: 6px; background: var(--surface); white-space: pre; }
.guide code { font-size: 12px; }
.guide__note { margin: 0; padding: 4px 16px 12px; font-size: 12px; color: var(--ink-3); }
.next-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 640px) { .setup__grid { grid-template-columns: 1fr; } .handoff { grid-template-columns: 1fr; gap: 2px; } .handoff dd { margin-bottom: 8px; } }

/* AI assistant (SC-17): marked with the sparkle and the accent, never mistaken for a person's words. */
.assist { display: flex; flex-direction: column; gap: 8px; }
.assist__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.assist__spacer { flex: 1; }
.assist__status { font-size: 12px; color: var(--ink-3); }
.ai-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 650; }
.ai-badge .icon, .button--ai .icon, .sources-card .card__heading .icon { width: 14px; height: 14px; fill: url(#ai-grad); stroke: none; }
.button--ai { color: var(--accent-ink); border-color: #C9D3F6; background: var(--accent-soft); }
.button--ai:hover { background: #E2E8FC; border-color: #B4C2F2; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.reply:has(.ai-badge:not([hidden])) textarea { border-color: #B4C2F2; background: #FBFCFF; }
.assist__sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.source-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border: 1px solid #C9D3F6; border-radius: 12px; background: var(--surface); color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.source-chip:hover { background: var(--accent-soft); }
.assist__nosource { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--near-soft); color: var(--near); font-size: 12px; font-weight: 600; }
.sources-card .card__heading { display: flex; align-items: center; gap: 6px; color: var(--accent-ink); }
.sources-card__lede { margin: -6px 0 10px; }
.sources-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sources-list__title { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sources-list__title:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.sources-list__excerpt { margin: 6px 0 0; padding: 6px 10px; border: 1px solid var(--line); background: var(--sunken); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); }
.factcheck { border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); padding: 10px 12px; }
.factcheck__summary { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; }
.factcheck__summary--ok { color: var(--ok); }
.factcheck__summary--warn { color: var(--near); }
.factcheck__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.claim { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.claim > .icon { margin-top: 2px; }
.claim--ok > .icon { color: var(--ok); }
.claim--missing { background: var(--near-soft); border-color: #F2D7A6; }
.claim--missing > .icon { color: var(--near); }
.claim__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.claim__text { color: var(--ink); font-weight: 500; }
.claim__missing { color: var(--near); font-size: 12px; font-weight: 650; }
.claim__source { padding: 0; border: 0; background: none; text-align: left; color: var(--ink-3); font: inherit; font-size: 12px; cursor: pointer; overflow-wrap: anywhere; }
.claim__source:hover { color: var(--accent-ink); text-decoration: underline; }
.article-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(820px, calc(100vh - 32px)); padding: 0; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-float); color: var(--ink); }
.article-dialog[open] { display: flex; flex-direction: column; }
.article-dialog::backdrop { background: rgb(15 17 22 / .5); }
.article-dialog__body { overflow: auto; padding: 18px 22px 24px; white-space: pre-line; line-height: 1.6; font-size: 14px; overflow-wrap: anywhere; }
.article-dialog__body mark { background: #FFF0B8; color: var(--ink); border-radius: 3px; padding: 1px 2px; box-shadow: 0 0 0 1px #F2D7A6; }

/* Escalate to dev (SC-18) */
.ticket-dialog { width: min(860px, calc(100vw - 32px)); height: min(900px, calc(100vh - 32px)); padding: 0; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-float); color: var(--ink); }
.ticket-dialog[open] { display: flex; flex-direction: column; }
.ticket-dialog::backdrop { background: rgb(15 17 22 / .5); }
.ticket-dialog__mark { color: var(--accent-ink); fill: currentColor; stroke: none; }
.ticket-dialog__body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.ticket-dialog__loading { margin: 40px 0; text-align: center; color: var(--ink-3); }
.ticket-missing { padding: 12px 14px; border: 1px solid #F2D7A6; border-radius: var(--radius); background: var(--near-soft); color: var(--ink); font-size: 13px; }
.ticket-missing__head { display: flex; align-items: center; gap: 6px; color: var(--near); font-weight: 650; }
.ticket-missing ul { margin: 8px 0 10px; padding-left: 20px; }
.ticket-form { display: flex; flex-direction: column; gap: 6px; }
.ticket-form label { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-top: 4px; }
.ticket-form input { font-size: 15px; font-weight: 600; }
.ticket-editor { min-height: 320px; padding: 4px 16px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); line-height: 1.55; font-size: 14px; overflow-wrap: anywhere; }
.ticket-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ticket-editor h2 { margin: 16px 0 6px; font-size: 15px; font-weight: 700; }
.ticket-editor p { margin: 0 0 8px; }
.ticket-editor ul, .ticket-editor ol { margin: 0 0 8px; padding-left: 22px; }
.ticket-dialog__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--sunken); border-radius: 0 0 12px 12px; }
.ticket-dialog__foot .check { font-size: 13px; color: var(--ink-2); }
.ticket-dialog__status { font-size: 12px; color: var(--ok); font-weight: 600; }
@media (max-width: 640px) { .ticket-dialog { width: 100vw; height: 100dvh; border-radius: 0; } }

/* Universal search (SC-19) */
.omni { position: absolute; top: calc(100% + 6px); left: 0; width: min(620px, calc(100vw - 32px)); max-height: min(70vh, 620px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-float); z-index: 30; }
.omni__item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius); background: none; color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.omni__item:hover, .omni__item.is-active { background: var(--sunken); }
.omni__item.is-active { box-shadow: inset 0 0 0 1px var(--line-strong); }
.omni__ask { display: flex; align-items: center; gap: 8px; color: var(--accent-ink); }
.omni__ask strong { color: var(--ink); }
.omni__spark { width: 15px; height: 15px; fill: url(#ai-grad); stroke: none; }
.omni__hint { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.omni__section { padding: 10px 10px 4px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.omni__title { font-weight: 600; }
.omni__meta { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.omni__snippet { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.omni__snippet mark { background: #FFF0B8; color: var(--ink); border-radius: 2px; padding: 0 1px; }
.omni__all { font-size: 13px; color: var(--accent-ink); }
.omni__empty { padding: 12px 10px; font-size: 13px; color: var(--ink-3); }
.omni__ai-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 650; color: var(--accent-ink); border-bottom: 1px solid var(--line); }
.omni__ai-body { padding: 8px 4px; font-size: 13px; color: var(--ink-2); }
.omni__answer { margin: 0 6px 8px; font-size: 14px; color: var(--ink); line-height: 1.5; }
.omni__match { border: 1px solid var(--line); margin-bottom: 6px; }
.omni__why { margin: 2px 0 4px; font-size: 13px; color: var(--ink-2); }
.omni__foot { padding: 6px 6px 2px; font-size: 12px; color: var(--ink-3); }
.msg:target .msg__body { box-shadow: 0 0 0 2px #F2C94C; }
@media (max-width: 640px) { .omni { position: fixed; top: 56px; left: 8px; right: 8px; width: auto; } .omni__hint { display: none; } }

/* Narrow screens */
@media (max-width: 900px) {
  .page { padding: 14px; }
  .home, .kb { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* The queue comes first: stage tabs scroll across the top, filters follow the list. */
  .side { display: contents; }
  .side__group--views { order: -2; flex-direction: row; gap: 4px; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; }
  .side__group--views .side__heading { display: none; }
  .side__group--views .side__item { flex: none; min-height: 32px; border: 1px solid var(--line); background: var(--surface); }
  .queue { order: -1; }
  .side__hours-list { display: none; }
  .call__head { flex-direction: column; }
  .call__clock { width: 100%; max-width: 260px; }
  .call__clock .meter { justify-items: start; }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar__brand { font-size: 0; gap: 0; }
  .live__label { display: none; }
  .calls:not(.kb-table) thead { display: none; }
  .calls:not(.kb-table), .calls:not(.kb-table) tbody, .calls:not(.kb-table) tr, .calls:not(.kb-table) td { display: block; width: auto; }
  .calls:not(.kb-table) tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .calls:not(.kb-table) td { padding: 0; border: 0; }
  .row__stage { grid-column: 1; }
  .row__wait { grid-column: 2; grid-row: 1 / span 2; }
  .row__customer, .row__conversation, .row__assignee { grid-column: 1 / -1; min-width: 0; }
  .row__preview { white-space: normal; }
  .row__wait { width: auto; min-width: 0; }
  .row__conversation { max-width: none; }
  .meter { max-width: 220px; }
  .msg { max-width: 92%; }
  .viewer { width: 100vw; height: 100dvh; border-radius: 0; }
}

/* AI operator (SC-22): "Talk to AI" in the top bar opens a chat that works the console through tools. */
.ai-button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px 0 12px; border: 0; border-radius: 17px; background: var(--ai); color: #fff; font: inherit; font-weight: 650; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgb(36 70 199 / .25), inset 0 1px 0 rgb(255 255 255 / .18); transition: box-shadow .15s ease, translate .15s ease; }
.ai-button .icon { width: 15px; height: 15px; fill: #fff; stroke: none; }
.ai-button:hover { box-shadow: 0 4px 14px -2px rgb(91 71 240 / .45), inset 0 1px 0 rgb(255 255 255 / .18); translate: 0 -1px; }
.ai-button[aria-expanded="true"] { box-shadow: 0 0 0 3px rgb(91 71 240 / .22); }
.op { position: fixed; z-index: 40; top: 62px; right: 16px; display: flex; flex-direction: column; width: min(440px, calc(100vw - 32px)); height: min(680px, calc(100vh - 78px)); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-float); overflow: hidden; }
.op::before { content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; background: var(--ai); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: .55; }
.op[hidden] { display: none; }
.op__head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 16px; background: var(--ai-soft); border-bottom: 1px solid var(--line); }
.op__spark { width: 22px; height: 22px; fill: url(#ai-grad); stroke: none; }
.op__head > div { flex: 1; }
.op__title { font-weight: 700; }
.op__sub { font-size: 12px; color: var(--ink-3); }
.op__icon-button { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.op__icon-button:hover { background: rgb(255 255 255 / .7); color: var(--ink); }
.op__log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.op__empty p { margin: 0 0 12px; color: var(--ink-2); }
.op__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.op__chip { height: 30px; padding: 0 12px; border: 1px solid #D6D3FA; border-radius: 15px; background: var(--surface); color: #3B36B8; font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; }
.op__chip:hover { background: var(--ai-soft); }
.op__me { align-self: flex-end; max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--ink); color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.op__ai { max-width: 100%; color: var(--ink); line-height: 1.5; overflow-wrap: anywhere; }
.op__ai p, .op__ai ul, .op__ai ol { margin: 0 0 8px; }
.op__ai > :last-child { margin-bottom: 0; }
.op__ai ul, .op__ai ol { padding-left: 20px; }
.op__ai .md-h { font-weight: 650; }
.op__ai code { padding: 1px 4px; border-radius: 4px; background: var(--sunken); }
.op__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.op__act { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 600; }
.op__act--fail { background: var(--past-soft); color: var(--past); }
.op__act .icon { width: 13px; height: 13px; }
.op__error { padding: 8px 12px; border-radius: var(--radius); background: var(--past-soft); color: var(--past); font-size: 13px; }
.op__working { align-self: flex-start; font-weight: 600; background: var(--ai); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: op-shimmer 1.6s linear infinite; }
@keyframes op-shimmer { to { background-position: -200% 0; } }
.op__composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.op__composer textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 9px 12px; resize: none; border-radius: 12px; font: inherit; line-height: 1.4; }
.op__send { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--ai); color: #fff; cursor: pointer; }
.op__send .icon { stroke-width: 2; }
.op__send:disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) { .op__working { animation: none; } .ai-button { transition: none; } }
@media (max-width: 640px) { .ai-button { padding: 0 10px; font-size: 0; gap: 0; } .ai-button .icon { width: 17px; height: 17px; } .op { inset: 56px 8px 8px; width: auto; height: auto; } }

/* SC-24: what the customer's browser reported when they wrote. */
.context-card__lede { margin: -6px 0 10px; }
.context-card__replay { display: inline-flex; margin-bottom: 10px; }
.context-trail { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--line); }
.context-trail li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; padding-left: 10px; overflow-wrap: anywhere; }
.context-trail li:first-child { border-left: 2px solid var(--accent); margin-left: -2px; }
.context-trail__when { margin-left: auto; white-space: nowrap; }
