/* ═══════════════════════════════════════════════════════════════════════════
   Kenzed — interface styles.

   Layout and typography are carried over from the console prototype, which
   the handoff names as the spec of record for UX. The palette is a single
   blue ramp (see :root) applied over that structure. Every control keeps its
   44px minimum touch target: §A6 property 7 requires the work queue to be
   usable on a 5-inch screen over 3G.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* One blue ramp, hue ~212, from paper to ink. Every surface, border and
     text colour is a step on it, so the interface reads as a single family
     rather than a set of blues that happen to co-occur. */
  --blue-25:#f7fafd;  --blue-50:#eff5fc;  --blue-100:#dfeaf7; --blue-200:#c3d9ee;
  --blue-300:#93b8dd;  --blue-400:#5b93c8; --blue-500:#2c74ac; --blue-600:#1d5fa0;
  --blue-700:#184c80;  --blue-800:#143a60; --blue-900:#0e2743; --blue-950:#08192c;

  --paper:var(--blue-50); --panel:#ffffff;
  --ink:var(--blue-950); --ink2:#24486e;
  /* Text steps are chosen for contrast on --panel, not for looks alone:
     --mut clears 5.0:1 and --faint 3.4:1, so secondary labels and timestamps
     stay readable on the 5-inch screen §A6 property 7 asks for. --blue-300
     stays available for borders and decoration, where contrast is not a
     legibility question. */
  --mut:#55708f; --faint:#6d8cae;
  --line:var(--blue-200); --line2:var(--blue-100);
  --accent:var(--blue-600); --accent-2:var(--blue-400);
  /* Inputs sit a step below their card so a field is visible as a field,
     not just as a border on the same surface. */
  --field:var(--blue-50);

  /* Chrome (the dark top bar) gets its own steps so the contrast is set
     deliberately rather than inherited from the light surfaces. */
  --bar-text:#dbe9f8; --bar-mut:#8dafd2;
  --bar-line:rgba(255,255,255,.15); --bar-field:rgba(255,255,255,.09);

  /* Severity stays semantic. A blue "3 overdue" is unreadable at a glance,
     and the whole point of §A6 is that a counsellor can see a breach without
     reading. These are retuned cooler to sit beside the blue, not replaced. */
  --sev-fatal:#c0334a; --sev-high:#cf6a2e; --sev-med:#b8892c; --sev-low:#2f7d63;

  --serif:'Newsreader',Georgia,serif;
  --sans:'IBM Plex Sans',system-ui,-apple-system,sans-serif;
  --mono:'IBM Plex Mono',ui-monospace,monospace;
  --row-h:92px;
}

html, body { margin:0; padding:0; }
body {
  /* A long, low-contrast wash so a full-height screen never looks flat. */
  background:linear-gradient(180deg, var(--blue-25) 0%, var(--blue-50) 55%, var(--blue-100) 100%);
  background-attachment:fixed;
  color:var(--ink); font-family:var(--sans); font-size:14px;
  -webkit-font-smoothing:antialiased; min-height:100vh;
}
button { font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
button:disabled { cursor:not-allowed; }
input, select, textarea { font-family:inherit; font-size:inherit; color:var(--ink); }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
::selection { background:var(--blue-200); color:var(--blue-950); }

@keyframes pulse { 0%,100%{opacity:.45} 50%{opacity:.9} }
@keyframes slideup { from{transform:translateY(8px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes spin { to { transform:rotate(360deg); } }

/* ══ sign-in ══════════════════════════════════════════════════════════════ */
.signin-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:40px 20px;
  background:linear-gradient(160deg, var(--blue-800) 0%, var(--blue-600) 45%, var(--blue-400) 100%); }
.signin { width:min(460px,100%); background:var(--panel); border:1px solid var(--line);
  border-radius:12px; padding:34px 32px 28px; box-shadow:0 40px 80px -40px rgba(8,25,44,.55); }
.signin-brand { display:flex; align-items:center; gap:9px; font-family:var(--mono); font-size:13px;
  letter-spacing:.22em; font-weight:600; color:var(--ink); margin-bottom:18px; }
.logo-dot { width:20px; height:20px; border-radius:5px; display:inline-block;
  background:linear-gradient(135deg, var(--blue-400), var(--blue-700)); }
.signin h1 { font-family:var(--serif); font-weight:500; font-size:30px; margin:0 0 6px; }
.signin-sub { font-size:13.5px; color:var(--mut); line-height:1.6; margin:0 0 22px; }
.signin label { display:block; font-family:var(--mono); font-size:10px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--mut); margin:0 0 6px; }
.signin input { width:100%; background:var(--field); border:1px solid var(--line); border-radius:7px;
  padding:11px 12px; font-size:13.5px; min-height:44px; margin-bottom:14px; }
.signin-error { background:color-mix(in oklab,var(--sev-fatal) 10%,transparent);
  border:1px solid color-mix(in oklab,var(--sev-fatal) 40%,transparent); border-radius:8px;
  padding:11px 13px; font-size:13px; color:var(--ink); margin-bottom:14px; line-height:1.5; }
.persona-list { margin-top:24px; border-top:1px solid var(--line); padding-top:18px; }
.persona-head { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--mut); margin-bottom:10px; }
.persona { display:flex; width:100%; align-items:baseline; gap:10px; text-align:left; padding:10px 12px;
  border:1px solid var(--line); border-radius:7px; background:var(--panel); margin-bottom:7px; min-height:44px; }
.persona:hover { border-color:var(--accent); background:color-mix(in oklab,var(--accent) 5%,var(--panel)); }
.persona-role { font-size:13.5px; font-weight:600; }
.persona-name { font-size:12px; color:var(--mut); }

.boot-error { max-width:620px; margin:80px auto; background:var(--panel); border:1px solid var(--sev-fatal);
  border-radius:12px; padding:28px 32px; }
.boot-error h1 { font-family:var(--serif); font-weight:500; font-size:26px; margin:0 0 10px; }
.boot-error p { color:var(--sev-fatal); font-family:var(--mono); font-size:12.5px; line-height:1.6; }
.boot-error ol { line-height:1.9; color:var(--ink2); }
.boot-error code { font-family:var(--mono); background:var(--line2); padding:2px 6px; border-radius:4px; }

/* ══ app shell ════════════════════════════════════════════════════════════ */
.app { min-height:100vh; display:flex; flex-direction:column; }

.topbar { background:linear-gradient(100deg, var(--blue-950) 0%, var(--blue-900) 40%, var(--blue-800) 100%);
  color:var(--bar-text); padding:0 18px; display:flex; align-items:center;
  gap:14px; flex-wrap:wrap; min-height:54px; position:sticky; top:0; z-index:40;
  box-shadow:0 1px 0 rgba(255,255,255,.06) inset; }
.topbar .brand { display:flex; align-items:center; gap:10px; }
.topbar .brand-name { font-family:var(--mono); font-size:13px; letter-spacing:.22em; font-weight:600; }
.topbar .tenant { font-size:12.5px; color:var(--bar-mut); white-space:nowrap; }
.topbar .spacer { flex:1; }
.topbar .group { display:flex; align-items:center; gap:8px; padding-left:14px; border-left:1px solid var(--bar-line); }
.topbar .glabel { font-family:var(--mono); font-size:10px; letter-spacing:.16em; color:var(--bar-mut); text-transform:uppercase; }
.topbar select { background:var(--bar-field); color:var(--bar-text); border:1px solid var(--bar-line); border-radius:6px;
  padding:7px 10px; font-size:13px; min-height:36px; max-width:260px; }
.topbar select option { background:var(--blue-900); color:var(--bar-text); }
.topbar .clock { font-family:var(--mono); font-size:12px; color:var(--blue-300); white-space:nowrap; }
.topbar .tbtn { font-family:var(--mono); font-size:10.5px; letter-spacing:.1em; color:var(--bar-mut);
  padding:7px 9px; border-radius:6px; border:1px solid var(--bar-line); background:transparent;
  white-space:nowrap; min-height:32px; }
.topbar .tbtn:hover { color:#fff; border-color:var(--blue-400); background:var(--bar-field); }
.topbar .tbtn.on { border-color:var(--blue-400); color:#fff;
  background:linear-gradient(135deg, var(--blue-500), var(--blue-700)); }

.nav { background:linear-gradient(180deg, var(--panel), var(--blue-50));
  border-bottom:1px solid var(--line); padding:0 18px;
  display:flex; align-items:center; gap:2px; flex-wrap:wrap; position:sticky; top:54px; z-index:35; }
.nav .scope { margin-left:auto; font-family:var(--mono); font-size:10.5px; color:var(--mut);
  letter-spacing:.08em; padding:6px 0; white-space:nowrap; }

.tab { padding:11px 15px; font-size:13.5px; font-weight:500; min-height:42px;
  border-bottom:2px solid transparent; color:var(--mut); white-space:nowrap;
  display:inline-flex; align-items:center; gap:7px; }
.tab:hover { color:var(--ink); }
.tab.active { font-weight:600; border-bottom-color:var(--accent); color:var(--ink); }
.tab .count { font-family:var(--mono); font-size:11px; padding:2px 6px; border-radius:4px;
  background:var(--line2); color:var(--mut); }
.tab.active .count { color:#fff; background:linear-gradient(135deg, var(--blue-500), var(--blue-700)); }

.permnote { background:color-mix(in oklab,var(--sev-med) 14%,var(--paper)); border-bottom:1px solid var(--line);
  padding:9px 18px; display:flex; align-items:center; gap:10px; font-size:13px; color:var(--ink2); }
.permnote .dot { width:6px; height:6px; border-radius:50%; background:var(--sev-med); flex:0 0 auto; }

.screen { flex:1; padding:18px; }

/* ══ generic pieces ═══════════════════════════════════════════════════════ */
.btn { border-radius:7px; padding:9px 13px; font-size:12.5px; font-weight:600; min-height:38px;
  white-space:nowrap; border:1px solid var(--line); color:var(--ink2); background:var(--paper);
  display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.btn:hover:not(:disabled) { border-color:var(--blue-400); color:var(--accent); }
.btn-primary { color:#fff; border-color:var(--blue-700);
  background:linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%); }
.btn-primary:hover:not(:disabled) { color:#fff; border-color:var(--blue-800);
  background:linear-gradient(135deg, var(--blue-600) 0%, var(--blue-800) 100%); }
.btn-danger { background:var(--sev-fatal); color:#fff; border-color:var(--sev-fatal); }
.btn-ghost { background:transparent; }
.btn-block { width:100%; padding:13px; font-size:14.5px; min-height:46px; }
.btn:disabled, .btn.muted { opacity:.45; }
.btn-sm { padding:7px 10px; min-height:34px; font-size:12px; }

.card { border:1px solid var(--line); border-radius:10px; background:var(--panel); overflow:hidden; }
.card-head { padding:13px 16px; border-bottom:1px solid var(--line); }
.card-eyebrow { font-family:var(--mono); font-size:10px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--accent); font-weight:600; }
.card-sub { font-size:12.5px; color:var(--mut); margin-top:4px; line-height:1.5; }

.stat-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:18px; }
.stat { flex:1; min-width:178px; border:1px solid var(--line); border-radius:9px; padding:13px 16px; background:var(--panel); }
.stat .label { font-family:var(--mono); font-size:9.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--mut); }
.stat .value { font-family:var(--mono); font-size:21px; font-weight:600; color:var(--ink); margin:6px 0 4px; }
.stat .sub { font-size:11.5px; color:var(--mut); line-height:1.45; }

.pill { display:inline-block; font-family:var(--mono); font-size:9.5px; font-weight:600; letter-spacing:.07em;
  text-transform:uppercase; padding:3px 7px; border-radius:4px; white-space:nowrap; }
.pill-ink   { background:color-mix(in oklab,var(--ink2) 15%,transparent); color:var(--ink2); }
.pill-accent{ background:color-mix(in oklab,var(--accent) 15%,transparent); color:var(--accent); }
.pill-low   { background:color-mix(in oklab,var(--sev-low) 15%,transparent); color:var(--sev-low); }
.pill-med   { background:color-mix(in oklab,var(--sev-med) 18%,transparent); color:var(--sev-high); }
.pill-high  { background:color-mix(in oklab,var(--sev-high) 15%,transparent); color:var(--sev-high); }
.pill-fatal { background:var(--sev-fatal); color:#fff; }
.pill-faint { background:color-mix(in oklab,var(--faint) 20%,transparent); color:var(--mut); }

.empty { padding:56px 24px; text-align:center; }
.empty h3 { font-family:var(--serif); font-weight:500; font-size:20px; margin:0 0 6px; }
.empty p { font-size:13.5px; color:var(--mut); margin:0 auto; line-height:1.6; max-width:48ch; }

.footnote { font-family:var(--mono); font-size:10.5px; color:var(--faint); margin:10px 2px 0; line-height:1.6; }

.field { margin-bottom:15px; }
.field label { display:block; font-family:var(--mono); font-size:10px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--mut); margin-bottom:6px; }
.field input, .field select, .field textarea { width:100%; background:var(--field); border:1px solid var(--line);
  border-radius:7px; padding:11px 12px; font-size:13.5px; min-height:44px; }
.field textarea { min-height:80px; resize:vertical; }
.field .err { font-size:12px; color:var(--sev-fatal); margin-top:5px; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color:var(--sev-fatal); }

.notice { border-radius:8px; padding:12px 14px; font-size:13px; line-height:1.55; }
.notice-med { background:color-mix(in oklab,var(--sev-med) 15%,transparent);
  border:1px solid color-mix(in oklab,var(--sev-med) 45%,transparent); color:var(--ink2); }
.notice-low { background:color-mix(in oklab,var(--sev-low) 13%,transparent); color:var(--ink2); }
.notice-eyebrow { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase;
  font-weight:600; margin-bottom:5px; color:var(--sev-high); }

/* ══ work queue ═══════════════════════════════════════════════════════════ */
.q-top { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.q-search { background:var(--field); border:1px solid var(--line); border-radius:7px; padding:9px 12px;
  font-size:13.5px; min-width:210px; min-height:38px; margin-left:auto; }
.q-alert { background:color-mix(in oklab,var(--sev-fatal) 12%,var(--panel));
  border:1px solid color-mix(in oklab,var(--sev-fatal) 40%,transparent); border-radius:9px;
  padding:12px 14px; display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.q-alert .text { font-family:var(--mono); font-size:12.5px; font-weight:600; color:var(--sev-fatal); }

.q-head { display:flex; align-items:center; gap:12px; padding:10px 14px; border-bottom:1px solid var(--line);
  background:color-mix(in oklab,var(--line2) 50%,var(--panel));
  font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--mut); font-weight:600; }
.q-scroll { height:560px; overflow-y:auto; position:relative; }
.q-row { height:var(--row-h); box-sizing:border-box; overflow:hidden; padding:13px 16px;
  border-bottom:1px solid var(--line2); }
.q-row.od { background:color-mix(in oklab,var(--sev-fatal) 5%,transparent); }
.q-row .main { display:flex; align-items:center; gap:12px; }
.q-row .dot { width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.q-row .sub { margin:8px 0 0 26px; display:flex; align-items:center; gap:9px; height:20px; overflow:hidden; }
.q-name { font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.q-phone { font-family:var(--mono); font-size:11px; color:var(--mut); margin-top:2px; }
.q-last { font-size:12.5px; color:var(--ink2); font-style:italic; white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; }
.q-lastmeta { font-family:var(--mono); font-size:10px; color:var(--faint); white-space:nowrap; }
.c-name { flex:2.4; min-width:0; }
.c-prog { flex:1.3; min-width:0; }
.c-score{ flex:1; }
.c-origin{ flex:1.4; min-width:0; }
.c-next { flex:1.2; min-width:0; }
.c-act  { width:112px; display:flex; justify-content:flex-end; }
.mono-sm { font-family:var(--mono); font-size:10.5px; color:var(--mut); margin-top:2px; }
.q-nextlabel { font-family:var(--mono); font-size:12.5px; font-weight:600; }

/* ══ drawer ═══════════════════════════════════════════════════════════════ */
.drawer-scrim { position:fixed; inset:0; background:rgba(8,25,44,.45); z-index:60;
  display:flex; justify-content:flex-end; }
.drawer { width:min(1000px,100%); height:100%; background:var(--paper); border-left:1px solid var(--line);
  display:flex; flex-direction:column; animation:slideup .18s ease-out; }
.drawer-head { padding:16px 20px; border-bottom:1px solid var(--line); display:flex; align-items:flex-start;
  gap:14px; background:var(--panel); flex-wrap:wrap; }
.drawer-head h2 { font-family:var(--serif); font-weight:500; font-size:24px; margin:0; }
.drawer-meta { font-family:var(--mono); font-size:11.5px; color:var(--mut); margin-top:6px; }
.drawer-grid { flex:1; display:grid; grid-template-columns:1.5fr 1fr; overflow:hidden; }
.conv { display:flex; flex-direction:column; border-right:1px solid var(--line); overflow:hidden; }
.session { padding:10px 20px; border-bottom:1px solid var(--line); display:flex; align-items:baseline;
  flex-wrap:wrap; gap:8px; font-size:12.5px; }
.session.open   { background:color-mix(in oklab,var(--sev-low) 13%,var(--paper)); color:var(--sev-low); }
.session.closed { background:color-mix(in oklab,var(--sev-med) 13%,var(--paper)); color:var(--sev-high); }
.session .lbl { font-family:var(--mono); font-size:10px; letter-spacing:.14em; text-transform:uppercase; font-weight:600; }
.msgs { flex:1; overflow-y:auto; padding:18px 20px; display:flex; flex-direction:column; gap:12px; }
.msg { display:flex; flex-direction:column; }
.msg.in  { align-items:flex-start; }
.msg.out { align-items:flex-end; }
.bubble { max-width:78%; padding:11px 14px; border-radius:12px; font-size:13.5px; line-height:1.5; }
.msg.in .bubble  { background:#fff; border:1px solid var(--line); color:var(--ink); border-bottom-left-radius:4px; }
.msg.out .bubble { color:#fff; border-bottom-right-radius:4px;
  background:linear-gradient(135deg, var(--blue-500), var(--blue-700)); }
.msg.queued .bubble { background:color-mix(in oklab,var(--sev-med) 22%,var(--panel));
  color:var(--ink); border:1px dashed var(--sev-med); }
.msg-meta { font-family:var(--mono); font-size:10px; color:var(--faint); margin-top:4px; }
.composer { border-top:1px solid var(--line); padding:12px 16px; background:var(--panel); }
.composer-row { display:flex; gap:8px; }
.composer input { flex:1; background:var(--field); border:1px solid var(--line); border-radius:7px;
  padding:11px 12px; font-size:13.5px; min-height:42px; }
.tpl-rail { display:flex; gap:7px; flex-wrap:wrap; margin-top:9px; }
.tpl { border:1px solid var(--line); border-radius:20px; padding:7px 12px; font-size:11.5px;
  color:var(--ink2); background:var(--paper); min-height:34px; }
.tpl.money { border-color:color-mix(in oklab,var(--accent) 50%,transparent); }
.tpl:hover { border-color:var(--accent); }
.rail { overflow-y:auto; padding:18px 20px; background:var(--panel); display:flex; flex-direction:column; gap:18px; }
.rail-box { border:1px solid var(--line); border-radius:9px; padding:11px 13px; background:var(--paper); }
.rail-eyebrow { font-family:var(--mono); font-size:9.5px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--mut); margin-bottom:5px; }
.actions { display:flex; gap:8px; flex-wrap:wrap; }
.disposition-bar { background:color-mix(in oklab,var(--sev-fatal) 13%,var(--paper));
  border-bottom:1px solid color-mix(in oklab,var(--sev-fatal) 40%,transparent);
  padding:11px 20px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.manual-open { font-family:var(--serif); font-size:16px; line-height:1.45; font-style:italic;
  border-left:2px solid var(--accent); padding-left:13px; margin-bottom:13px; }
.manual-point { display:flex; gap:9px; align-items:flex-start; font-size:13px; color:var(--ink2); line-height:1.55; }
.manual-point::before { content:''; width:4px; height:4px; border-radius:50%; background:var(--faint);
  margin-top:7px; flex:0 0 auto; }
.objection { background:var(--paper); border:1px solid var(--line); border-radius:8px; padding:11px 13px; }
.objection .q { font-size:12.5px; color:var(--mut); margin-bottom:6px; }
.objection .a { font-size:13px; color:var(--ink); line-height:1.55; }

/* ══ rows / tables ════════════════════════════════════════════════════════ */
.row { display:flex; align-items:center; gap:14px; padding:14px 16px; border-bottom:1px solid var(--line2);
  flex-wrap:wrap; }
.row:last-child { border-bottom:none; }
.row .grow { flex:2; min-width:150px; }
.row .title { font-size:14px; font-weight:600; }
.table-scroll { overflow-x:auto; }
.thead { display:flex; gap:12px; padding:10px 16px; border-bottom:1px solid var(--line);
  background:color-mix(in oklab,var(--line2) 50%,var(--panel));
  font-family:var(--mono); font-size:10px; letter-spacing:.13em; text-transform:uppercase;
  color:var(--mut); font-weight:600; }
.trow { display:flex; gap:12px; align-items:center; padding:12px 16px; border-bottom:1px solid var(--line2); }
.trow.neg { background:color-mix(in oklab,var(--sev-fatal) 5%,transparent); }
.num { font-family:var(--mono); font-size:12.5px; text-align:right; color:var(--ink2); }
.num.strong { font-size:13.5px; font-weight:600; color:var(--ink); }
.num.neg { color:var(--sev-fatal); }
.num.pos { color:var(--sev-low); }
/* Funnel and ROI bars run light-to-dark across their own length, so a longer
   bar reads as a deeper blue as well as a wider one. */
.bar { height:100%; border-radius:3px;
  background:linear-gradient(90deg, var(--blue-400), var(--blue-700)); }
.bar-track { height:16px; background:var(--line2); border-radius:3px; overflow:hidden; }
.ledger-foot { display:flex; justify-content:space-between; align-items:center; padding:13px 16px;
  border-top:1.5px solid var(--ink); background:color-mix(in oklab,var(--line2) 40%,var(--panel));
  flex-wrap:wrap; gap:10px; }
.ledger-foot .lbl { font-family:var(--mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--mut); }
.ledger-foot .val { font-family:var(--mono); font-size:17px; font-weight:600; }

.split { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line); }
.split > div { background:var(--panel); padding:16px; }
.side-win { box-shadow:inset 3px 0 0 var(--sev-low); }

/* ══ modal + toasts ═══════════════════════════════════════════════════════ */
.modal-scrim { position:fixed; inset:0; background:rgba(8,25,44,.55); z-index:80;
  display:flex; align-items:center; justify-content:center; padding:20px; }
.modal { width:min(560px,100%); max-height:88vh; overflow-y:auto; background:var(--paper);
  border:1px solid var(--line); border-radius:12px; box-shadow:0 30px 70px -30px rgba(8,25,44,.5);
  animation:slideup .16s ease-out; }
.modal-head { padding:20px 22px 0; }
.modal-head h3 { font-family:var(--serif); font-weight:500; font-size:22px; margin:0 0 5px; }
.modal-head p { font-size:13.5px; color:var(--mut); margin:0; line-height:1.6; }
.modal-body { padding:18px 22px; }
.modal-foot { padding:0 22px 20px; display:flex; gap:9px; justify-content:flex-end; flex-wrap:wrap; }
.picklist { display:flex; flex-direction:column; gap:7px; }
.picklist button { text-align:left; border:1px solid var(--line); border-radius:8px; padding:13px 15px;
  font-size:13.5px; color:var(--ink); background:var(--field); min-height:46px; }
.picklist button:hover { border-color:var(--accent); }

.toasts { position:fixed; right:18px; bottom:18px; z-index:90; display:flex; flex-direction:column;
  gap:9px; max-width:400px; }
.toast { display:flex; gap:11px; background:var(--panel); border:1px solid var(--line); border-radius:9px;
  padding:13px 15px; box-shadow:0 12px 30px -14px rgba(8,25,44,.38); cursor:pointer;
  animation:slideup .18s ease-out; }
.toast.bad { border-color:color-mix(in oklab,var(--sev-fatal) 45%,transparent); }
.toast .dot { width:7px; height:7px; border-radius:50%; margin-top:6px; flex:0 0 auto; background:var(--sev-low); }
.toast.bad .dot { background:var(--sev-fatal); }
.toast .t { font-size:13.5px; font-weight:600; line-height:1.4; }
.toast .b { font-size:12.5px; color:var(--mut); margin-top:3px; line-height:1.5; }

.doc { border:1px solid var(--line); border-radius:9px; background:var(--panel); padding:22px; }
.doc-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap;
  border-bottom:1.5px solid var(--ink); padding-bottom:14px; margin-bottom:14px; }
.doc-line { display:flex; justify-content:space-between; gap:12px; font-size:13px; color:var(--ink2); margin-bottom:4px; }
.doc-total { display:flex; justify-content:space-between; font-size:14.5px; font-weight:600;
  border-top:1px solid var(--line); padding-top:10px; margin-bottom:16px; }

.skeleton { height:12px; border-radius:4px; background:var(--line2); animation:pulse 1.4s ease-in-out infinite; }
.spinner { width:16px; height:16px; border:2px solid var(--line); border-top-color:var(--accent);
  border-radius:50%; animation:spin .7s linear infinite; display:inline-block; }

/* ══ responsive — §A6 property 7: a 5-inch screen over 3G ════════════════ */
@media (max-width:900px) {
  .drawer-grid { grid-template-columns:1fr; overflow:auto; }
  .conv { border-right:none; border-bottom:1px solid var(--line); }
  .split { grid-template-columns:1fr; }
}
@media (max-width:720px) {
  .c-prog, .c-score, .c-origin { display:none; }
  .screen { padding:12px; }
  .q-scroll { height:min(66vh,520px); }
  .topbar { padding:8px 12px; gap:8px; }
  .topbar .group { padding-left:8px; }
  .topbar select { max-width:170px; }
  .stat { min-width:140px; }
}
