[hidden] { display: none !important; }
/* Pharmotics MedBridge design system — plain CSS, no build step.
   Type: Atkinson Hyperlegible (Braille Institute, OFL) for legibility in clinical settings.
   Colour roles: indigo = actions, caliper amber = AI / assist, coral = recording and critical. */

@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ink: #14213d;
  --ink-2: #3a4763;
  --muted: #68758c;
  --line: #e1e6ee;
  --line-2: #eef1f6;
  --bg: #f4f6f9;
  --card: #ffffff;
  --raised: #ffffff;
  --brand: #3b3fd8;
  --brand-2: #2f33b8;
  --brand-soft: #eceefe;
  --amber: #f2b233;
  --amber-ink: #8a5a00;
  --amber-soft: #fff7e3;
  --coral: #e5484d;
  --coral-soft: #fdecec;
  --ok: #12805c;
  --ok-soft: #e4f5ee;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --bad: #c9353a;
  --bad-soft: #fdecec;
  --info: #1d63a8;
  --info-soft: #e7f1fb;
  --focus: 0 0 0 3px rgba(59, 63, 216, .28);
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 8px;
  --shadow-pop: 0 12px 32px rgba(20, 33, 61, .18), 0 2px 6px rgba(20, 33, 61, .08);
  --font: "Atkinson", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #e7ecf5;
  --ink-2: #c3cbd9;
  --muted: #8d98ad;
  --line: #263147;
  --line-2: #1d2639;
  --bg: #0d1424;
  --card: #131c2e;
  --raised: #1a2439;
  --brand: #8c8ff7;
  --brand-2: #a5a8ff;
  --brand-soft: #23284f;
  --amber-ink: #f2c25c;
  --amber-soft: #2c2412;
  --coral-soft: #3a1c22;
  --ok: #46c59a;
  --ok-soft: #12302a;
  --warn: #f0b64a;
  --warn-soft: #2e2512;
  --bad: #ff7a7f;
  --bad-soft: #3a1c22;
  --info: #7bb6f0;
  --info-soft: #14283f;
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.015em; }
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -.005em; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.ic { flex: none; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 16px 10px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: var(--ink); font-weight: 700; font-size: 17px; text-decoration: none; }
.side .brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.side .brand small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.side .group { margin: 16px 10px 4px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.side a { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 7px 10px; border-radius: var(--r-sm); font-size: 14.5px; position: relative; text-decoration: none; }
.side a .ic { color: var(--muted); }
.side a:hover { background: var(--line-2); color: var(--ink); }
.side a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side a.active .ic { color: var(--brand); }
.side .brand .logo .ic { color: #fff; }
.side a.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side .count { margin-left: auto; background: var(--coral); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.side .foot { margin-top: auto; padding-top: 16px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .org { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .spacer { flex: 1; }
.search-trigger { display: flex; align-items: center; gap: 8px; min-width: 260px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.search-trigger kbd { margin-left: auto; font-family: var(--font); font-size: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--line-2); border-color: var(--line); text-decoration: none; }
.top .bell .dot { position: absolute; top: 2px; right: 0; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 5px; display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.user-chip .who { line-height: 1.15; } .user-chip .who small { display: block; font-size: 12px; }
.page { padding: 26px 28px 60px; max-width: 1360px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .lede { color: var(--muted); max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.menu-toggle { display: none; }

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 18px; }
.card.tight { padding: 12px 14px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card > h2:first-child .ic { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Stat tiles become one status strip where grouped (.strip); single .stat still works */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: block; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.stat.alert { display: block; margin: 0; padding: 14px 16px; font-size: inherit; color: inherit; border-color: color-mix(in srgb, var(--coral) 45%, var(--line)); background: var(--coral-soft); }
.stat.alert .n { color: var(--bad); }
.strip + .strip { margin-top: -6px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 18px; overflow: hidden; }
.strip > .stat { border: 0; border-radius: 0; border-left: 1px solid var(--line); }
.strip > .stat:first-child { border-left: 0; }
.strip > .stat.alert { background: var(--coral-soft); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 700; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--line-2); }
tr.pri-urgent td:first-child { box-shadow: inset 3px 0 var(--amber); }
tr.pri-critical td:first-child { box-shadow: inset 3px 0 var(--coral); }
.table-wrap { overflow-x: auto; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.field .hint, .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--line) 60%, var(--muted)); border-radius: var(--r-sm); font: inherit; font-size: 15px; background: var(--card); color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[disabled], select[disabled], textarea[disabled] { opacity: .6; }
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; font-size: 14.5px; margin-bottom: 8px; color: var(--ink); }
.check input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks .check { margin: 0; }
.inline-form { display: inline; }
.error-text { color: var(--bad); font-size: 13.5px; margin-top: 4px; }
.seg { display: inline-flex; background: var(--line-2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg label, .seg button { margin: 0; padding: 6px 12px; border-radius: 7px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; border: 0; background: none; font-family: inherit; }
.seg input { display: none; }
.seg input:checked + span, .seg .on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg label span { display: block; padding: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: var(--r-sm); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { text-decoration: none; background: var(--line-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
[data-theme="dark"] .btn.primary { color: #0d1424; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 6px 8px; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.small { padding: 5px 10px; font-size: 13.5px; }
.btn.big { padding: 12px 22px; font-size: 16px; border-radius: var(--r); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Badges, alerts, flags ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok, .badge.released, .badge.acknowledged, .badge.verified, .badge.live, .badge.captured, .badge.approved, .badge.paid, .badge.completed, .badge.online { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.checking, .badge.pending, .badge.urgent, .badge.held, .badge.untested, .badge.investigating, .badge.authorised, .badge.issued, .badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.bad, .badge.critical, .badge.failed, .badge.rejected, .badge.suspended, .badge.blocking, .badge.expired, .badge.withdrawn, .badge.returned, .badge.open { background: var(--bad-soft); color: var(--bad); }
.badge.info, .badge.published, .badge.claimed, .badge.in_review, .badge.active, .badge.applied { background: var(--info-soft); color: var(--info); }
.badge.routine { background: var(--line-2); color: var(--ink-2); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.ai { background: var(--amber-soft); color: var(--amber-ink); border: 1px dashed color-mix(in srgb, var(--amber) 70%, transparent); }
.badge.online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); margin-bottom: 14px; font-size: 14.5px; border: 1px solid transparent; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--coral) 35%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert > div { flex: 1; }
.alert b { color: inherit; }
.flag { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); margin-bottom: 8px; background: var(--line-2); border: 1px solid var(--line); }
.flag.blocking { background: var(--bad-soft); border-color: color-mix(in srgb, var(--coral) 35%, transparent); }
.flag.warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.doc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.doc-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.doc-card.urgent::before { background: var(--amber); }
.doc-card.critical::before { background: var(--coral); }
.doc-card .title { font-weight: 700; font-size: 16.5px; }
.doc-card .price { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.doc-card .meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.doc-card .q { font-size: 14px; background: var(--line-2); border-radius: var(--r-sm); padding: 9px 10px; color: var(--ink-2); }
.doc-card.new { animation: arrive .7s ease; }
@keyframes arrive { 0% { box-shadow: 0 0 0 0 rgba(59, 63, 216, .5); } 100% { box-shadow: 0 0 0 14px rgba(59, 63, 216, 0); } }
.avail { display: inline-flex; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; background: var(--card); }
.avail button { border: 0; padding: 7px 14px; font-weight: 700; font-family: inherit; font-size: 13.5px; cursor: pointer; background: transparent; color: var(--muted); }
.avail button.on { background: var(--ok); color: #fff; }
.avail button.off.on { background: var(--ink-2); color: var(--card); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { white-space: nowrap; flex: 0 0 auto; }
.tabs button, .tabs a { border: 0; background: none; padding: 9px 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font: inherit; font-size: 14.5px; margin-bottom: -1px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tabs button.on, .tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }

/* ---------- Workspace ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(460px, 1fr); gap: 16px; align-items: start; }
.workspace > .ws-viewer { position: sticky; top: 70px; }
.section-editor .field label { display: flex; align-items: center; gap: 8px; }
.ai-sugg { border: 1.5px dashed color-mix(in srgb, var(--amber) 80%, transparent); background: var(--amber-soft); border-radius: var(--r); padding: 11px 13px; margin-bottom: 10px; }
.ai-sugg .lbl { font-size: 12.5px; font-weight: 700; color: var(--amber-ink); display: inline-flex; gap: 6px; align-items: center; }
.ai-sugg.decided { opacity: .55; border-style: solid; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.saved-note { font-size: 12.5px; color: var(--muted); }
.signoff { border: 1.5px solid var(--brand); border-radius: var(--r-lg); padding: 18px; background: color-mix(in srgb, var(--brand-soft) 45%, var(--card)); }
.dock .btn { padding-left: 11px; padding-right: 11px; font-size: 14px; white-space: nowrap; }
.dock .btn.ghost { padding-left: 6px; padding-right: 6px; }
.dock > span[style*="flex:1"] { min-width: 0; }
.dock { position: sticky; bottom: 0; z-index: 5; margin: 14px -20px -20px; padding: 12px 16px; column-gap: 4px; background: var(--raised); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; overflow-x: auto; }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(13, 20, 36, .45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--card); z-index: 61; box-shadow: var(--shadow-pop); transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; padding: 22px; }
.drawer.open { transform: none; }
.drawer.open + .drawer-backdrop, .drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer .close { position: absolute; top: 14px; right: 14px; }

/* ---------- Viewer ---------- */
.viewer { background: #05070c; border-radius: var(--r-lg); overflow: hidden; display: grid; grid-template-columns: 132px 1fr; height: 74vh; min-height: 480px; color: #cbd5e1; }
.viewer .thumbs { overflow-y: auto; border-right: 1px solid #1c2433; padding: 6px; }
.viewer .thumb { border: 1px solid #243045; border-radius: 7px; padding: 7px; margin-bottom: 6px; cursor: pointer; font-size: 11.5px; color: #a9b6cc; background: #0b0f17; }
.viewer .thumb.on { border-color: var(--amber); color: #fff; }
.viewer .stage { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.viewer .toolbar { display: flex; gap: 4px; padding: 6px; background: #0b0f17; border-bottom: 1px solid #1c2433; flex-wrap: wrap; align-items: center; }
.viewer .toolbar button { background: #151c29; color: #cbd5e1; border: 1px solid #243045; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; font-family: var(--font); }
.viewer .toolbar button.on { background: #f2b233; border-color: #f2b233; color: #14213d; font-weight: 700; }
.viewer .toolbar .sep { width: 1px; height: 20px; background: #243045; margin: 0 4px; }
.viewer .canvas-wrap { position: relative; flex: 1; min-height: 0; }
.viewer canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.viewer .canvas-wrap iframe { position: absolute; inset: 0; }
.viewer .overlay { position: absolute; pointer-events: none; font-size: 12px; color: #e2e8f0; text-shadow: 0 1px 2px #000; }
.viewer .overlay.tl { top: 8px; left: 10px; }
.viewer .overlay.tr { top: 8px; right: 10px; text-align: right; }
.viewer .overlay.bl { bottom: 10px; left: 10px; }
.viewer .overlay.br { bottom: 10px; right: 10px; text-align: right; }
.viewer .msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; color: #94a3b8; }
.viewer iframe, .viewer img.doc { width: 100%; height: 100%; border: 0; background: #fff; object-fit: contain; }

/* ---------- Voice kit ---------- */
.vk-bar { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.vk-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 20px; padding: 4px 11px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.vk-btn:hover { border-color: var(--brand); color: var(--brand); }
.vk-btn.rec { background: var(--coral); border-color: var(--coral); color: #fff; }
.vk-btn.polish:hover { border-color: var(--amber); color: var(--amber-ink); }
.vk-btn[disabled] { opacity: .5; cursor: progress; }
.vk-hint { font-size: 12px; color: var(--muted); }
.vk-recording { border-color: var(--coral) !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .18) !important; }
.vk-capsule { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; background: #14213d; color: #fff; padding: 10px 12px 10px 16px; border-radius: 40px; box-shadow: 0 16px 40px rgba(20, 33, 61, .35); max-width: min(760px, calc(100vw - 24px)); }
.vk-capsule .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); animation: rec 1.2s infinite; flex: none; }
@keyframes rec { 50% { opacity: .25; } }
.vk-capsule canvas { width: 120px; height: 28px; flex: none; }
.vk-capsule .t { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; flex: none; }
.vk-capsule .live { font-size: 13.5px; color: #c8d2e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; direction: rtl; text-align: left; }
.vk-capsule button { border: 0; border-radius: 20px; padding: 7px 14px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; flex: none; }
.vk-capsule .stop { background: #fff; color: #14213d; }
.vk-capsule .cancel { background: transparent; color: #c8d2e6; }
.vk-pop { margin-top: 8px; border: 1.5px dashed color-mix(in srgb, var(--amber) 80%, transparent); background: var(--amber-soft); border-radius: var(--r); padding: 12px 14px; }
.vk-pop .lbl { font-size: 12.5px; font-weight: 700; color: var(--amber-ink); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.vk-pop .txt { white-space: pre-wrap; font-size: 14.5px; }
.vk-pop .row { margin-top: 10px; }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(13, 20, 36, .45); }
.cmdk.open { display: flex; }
.cmdk .box { width: min(620px, calc(100vw - 24px)); background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; border: 1px solid var(--line); }
.cmdk input { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; padding: 16px 18px !important; font-size: 17px !important; box-shadow: none !important; }
.cmdk ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk li a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.cmdk li a .ic { color: var(--muted); }
.cmdk li.sel a { background: var(--brand-soft); color: var(--brand); }
.cmdk .foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 0; margin-bottom: 20px; counter-reset: s; }
.stepper > a, .stepper > span { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 2px solid var(--line); color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.stepper .n { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 12.5px; }
.stepper .on { color: var(--brand); border-bottom-color: var(--brand); }
.stepper .on .n { background: var(--brand); color: #fff; }
.stepper .done { color: var(--ok); border-bottom-color: var(--ok); }
.stepper .done .n { background: var(--ok-soft); color: var(--ok); }
.speak-panel { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 18px; }
.speak-orb { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 6px var(--brand-soft); transition: background .15s, box-shadow .15s; }
.speak-orb:hover { box-shadow: 0 0 0 9px var(--brand-soft); }
.speak-orb.rec { background: var(--coral); box-shadow: 0 0 0 6px var(--coral-soft); animation: orb 1.4s infinite; }
@keyframes orb { 50% { box-shadow: 0 0 0 14px var(--coral-soft); } }

/* ---------- Misc ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: #14213d; color: #fff; padding: 12px 14px; border-radius: var(--r); box-shadow: var(--shadow-pop); font-size: 14px; cursor: pointer; border-left: 4px solid var(--brand); }
.toast.urgent { border-left-color: var(--coral); }
.toast.warning { border-left-color: var(--amber); }
.toast.success { border-left-color: #46c59a; }
.toast b { display: block; margin-bottom: 2px; }
.pill-steps { display: flex; gap: 0; flex-wrap: wrap; margin: 10px 0 4px; }
.pill-steps span { padding: 3px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid var(--line); font-weight: 700; }
.pill-steps span.done { color: var(--ok); border-bottom-color: var(--ok); }
.pill-steps span.now { color: var(--brand); border-bottom-color: var(--brand); }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.timeline li { padding: 6px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--brand); }
.dropzone { border: 2px dashed color-mix(in srgb, var(--line) 50%, var(--muted)); border-radius: var(--r-lg); padding: 30px; text-align: center; background: var(--line-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone .ic { color: var(--brand); margin-bottom: 6px; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.progress { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.temp-pass { background: #14213d; color: #fff; border-radius: var(--r-lg); padding: 16px; border: 0; }
.temp-pass code { font-size: 18px; color: #ffd27a; }
pre.report-text { white-space: pre-wrap; font-family: var(--font); font-size: 15px; line-height: 1.6; background: var(--line-2); padding: 16px; border-radius: var(--r); border: 1px solid var(--line); margin: 0; }
.pagination { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 13.5px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { color: var(--line); margin-bottom: 8px; }
.greet { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--bg); }
.auth .hero { background: #14213d; color: #e7ecf5; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth .hero h1 { font-size: 38px; line-height: 1.12; max-width: 20ch; color: #fff; margin-top: 40px; margin-bottom: 14px; letter-spacing: -.02em; }
.auth .hero p { color: #b8c3d9; max-width: 44ch; font-size: 16.5px; }
.auth .hero .scan { position: absolute; right: -60px; bottom: -60px; width: 420px; opacity: .55; }
.auth .hero .facts { display: grid; gap: 14px; max-width: 46ch; position: relative; z-index: 1; }
.auth .hero .facts div { display: flex; gap: 12px; align-items: flex-start; color: #d5ddec; font-size: 15px; }
.auth .hero .facts .ic { color: #f2b233; margin-top: 2px; }
.auth .pane { display: grid; place-items: center; padding: 32px 24px; }
.auth .box { width: 100%; max-width: 420px; }
.auth .box.wide { max-width: 760px; }
.auth .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; margin-bottom: 22px; color: inherit; }
.auth .brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.auth .hero .brand .logo { background: #f2b233; color: #14213d; }
.auth.single { grid-template-columns: 1fr; }
.auth.single .hero { display: none; }

@media (max-width: 1150px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace > .ws-viewer { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .strip { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > .stat { border-left: 0; border-top: 1px solid var(--line); }
  .search-trigger { min-width: 0; }
  .search-trigger span { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: -260px; width: 248px; z-index: 50; transition: left .2s; box-shadow: var(--shadow-pop); }
  .side.open { left: 0; }
  .menu-toggle { display: inline-grid; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .page { padding: 18px 16px 60px; }
  .kv { grid-template-columns: 1fr; }
  .viewer { grid-template-columns: 1fr; height: 62vh; }
  .viewer .thumbs { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #1c2433; }
  .viewer .thumb { min-width: 110px; }
  .auth { grid-template-columns: 1fr; }
  .auth .hero { display: none; }
  .user-chip .who { display: none; }
  .stepper .lbl { display: none; }
}
