/* Call Recruiter admin — light and dark themes share one set of role tokens. */
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceff3;
  --border: #e2e6eb;
  --border-strong: #cdd3db;
  --text: #0f172a;
  --text-2: #475467;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --accent-text: #1c5cab;
  --on-accent: #ffffff;
  --good: #0ca30c;
  --good-text: #0a6b0a;
  --good-soft: rgba(12, 163, 12, 0.11);
  --warn: #fab219;
  --warn-text: #8a5a00;
  --warn-soft: rgba(250, 178, 25, 0.18);
  --bad: #d03b3b;
  --bad-text: #b42323;
  --bad-soft: rgba(208, 59, 59, 0.10);
  --violet-text: #4a3aa7;
  --violet-soft: rgba(74, 58, 167, 0.10);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: #e8ebef;
  --axis: #c3c8d0;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #7c8aa0;
  --sidebar-active: rgba(255, 255, 255, 0.08);
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
  --radius: 10px;
  --radius-sm: 7px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d11; --surface: #15181e; --surface-2: #1a1e25; --surface-3: #222731; --border: #262b34; --border-strong: #363c47;
    --text: #f1f3f6; --text-2: #c3c8d0; --muted: #959ba7; --faint: #6b7280;
    --accent: #3987e5; --accent-hover: #5598e7; --accent-soft: rgba(57, 135, 229, 0.16); --accent-text: #86b6ef; --on-accent: #ffffff;
    --good-text: #4ad64a; --good-soft: rgba(12, 163, 12, 0.18); --warn-text: #fab219; --warn-soft: rgba(250, 178, 25, 0.14);
    --bad-text: #ff8080; --bad-soft: rgba(208, 59, 59, 0.2); --violet-text: #a79ef0; --violet-soft: rgba(144, 133, 233, 0.16);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #242931; --axis: #3a404a;
    --sidebar-bg: #0f1216; --sidebar-text: #c9d1dc; --sidebar-muted: #7d8795; --sidebar-active: rgba(255, 255, 255, 0.07); --sidebar-border: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d11; --surface: #15181e; --surface-2: #1a1e25; --surface-3: #222731; --border: #262b34; --border-strong: #363c47;
  --text: #f1f3f6; --text-2: #c3c8d0; --muted: #959ba7; --faint: #6b7280;
  --accent: #3987e5; --accent-hover: #5598e7; --accent-soft: rgba(57, 135, 229, 0.16); --accent-text: #86b6ef; --on-accent: #ffffff;
  --good-text: #4ad64a; --good-soft: rgba(12, 163, 12, 0.18); --warn-text: #fab219; --warn-soft: rgba(250, 178, 25, 0.14);
  --bad-text: #ff8080; --bad-soft: rgba(208, 59, 59, 0.2); --violet-text: #a79ef0; --violet-soft: rgba(144, 133, 233, 0.16);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #242931; --axis: #3a404a;
  --sidebar-bg: #0f1216; --sidebar-text: #c9d1dc; --sidebar-muted: #7d8795; --sidebar-active: rgba(255, 255, 255, 0.07); --sidebar-border: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; border-right: 1px solid var(--sidebar-border); z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand strong { display: block; color: #fff; font-size: 14px; letter-spacing: -0.01em; }
.brand span { display: block; color: var(--sidebar-muted); font-size: 12px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-group { margin-top: 14px; }
.nav-group-label { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-weight: 500; }
.nav-link:hover { background: var(--sidebar-active); text-decoration: none; color: #fff; }
.nav-link.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-link .nav-count { margin-left: auto; font-size: 11px; font-weight: 600; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #fff; text-align: center; }
.sidebar-foot { border-top: 1px solid var(--sidebar-border); padding: 12px; display: grid; gap: 10px; }
.queue-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--sidebar-active); color: var(--sidebar-text); font-size: 12px; }
.queue-chip:hover { text-decoration: none; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.live { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.45); } 70% { box-shadow: 0 0 0 6px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.sidebar .avatar { background: rgba(255, 255, 255, 0.1); color: #fff; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong { display: block; color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { display: block; color: var(--sidebar-muted); font-size: 12px; text-transform: capitalize; }
.sidebar .btn-ghost { color: var(--sidebar-muted); }
.sidebar .btn-ghost:hover { color: #fff; background: var(--sidebar-active); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .brand-title { font-weight: 600; flex: 1; }
.main { padding: 24px 28px 48px; width: 100%; max-width: 1440px; margin: 0 auto; outline: none; }
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform 0.2s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 35; }
  .topbar { display: flex; }
  .main { padding: 16px 16px 40px; }
}

/* ---------- page structure ---------- */
.page { display: grid; gap: 20px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.015em; }
.page-head .subtitle { color: var(--muted); margin-top: 4px; max-width: 72ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 20px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .grid-main-side { grid-template-columns: minmax(0, 1fr); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .card-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.stat-foot { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; }
.delta.up-good, .delta.down-good { color: var(--good-text); }
.delta.up-bad, .delta.down-bad { color: var(--bad-text); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.banner .icon { margin-top: 1px; }
.banner.warn { background: var(--warn-soft); border-color: transparent; color: var(--text); }
.banner.warn .icon { color: var(--warn-text); }
.banner.bad { background: var(--bad-soft); border-color: transparent; }
.banner.bad .icon { color: var(--bad-text); }
.banner.info { background: var(--accent-soft); border-color: transparent; }
.banner.info .icon { color: var(--accent-text); }
.banner strong { display: block; }

/* ---------- buttons & controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger-ghost { background: transparent; color: var(--bad-text); border-color: var(--border-strong); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--bad-soft); }
.btn-good { background: var(--good); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn[data-busy] { cursor: progress; }
.input, .textarea, select.input { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 14px var(--font); }
.textarea { height: auto; padding: 9px 10px; line-height: 1.5; resize: vertical; }
.textarea.code { font: 12.5px/1.6 var(--mono); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); }
select.input { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.search { position: relative; min-width: 0; }
.search .icon { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 34px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 550; color: var(--text); }
.field .req { color: var(--bad-text); }
.hint { font-size: 12.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 220px; max-width: 360px; }
.toolbar select.input { width: auto; min-width: 140px; max-width: 220px; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; color: var(--text-2); padding: 0 12px; height: 30px; font: 500 12.5px var(--font); cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge.blue { background: var(--accent-soft); color: var(--accent-text); }
.badge.green { background: var(--good-soft); color: var(--good-text); }
.badge.amber { background: var(--warn-soft); color: var(--warn-text); }
.badge.red { background: var(--bad-soft); color: var(--bad-text); }
.badge.violet { background: var(--violet-soft); color: var(--violet-text); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }
.badge .dot { width: 6px; height: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; background: var(--surface-3); color: var(--text-2); }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; display: grid; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 500 12.5px var(--font); cursor: pointer; }
.chip .count { color: var(--muted); font-weight: 600; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .align-right { text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-check { width: 40px; padding-right: 0; }
.table .primary { font-weight: 550; color: var(--text); }
.table .sub { display: block; font-size: 12px; color: var(--muted); }
.table tr.selected td { background: var(--accent-soft); }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.pager-buttons { display: flex; align-items: center; gap: 8px; }
.selection-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.selection-bar strong { margin-right: 6px; }

/* ---------- key-value, empty, loading ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .icon { color: var(--faint); }
.empty strong { color: var(--text); font-size: 15px; }
.empty p { max-width: 46ch; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 48px; }
.refreshing { opacity: 0.6; transition: opacity 0.15s; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 500 13.5px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- modal & toast ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: grid; place-items: center; padding: 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); color: var(--text); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1000px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 13.5px; }
.toast .icon { margin-top: 1px; }
.toast span { flex: 1; overflow-wrap: anywhere; }
.toast-success .icon:first-child { color: var(--good-text); }
.toast-error { border-color: var(--bad); }
.toast-error .icon:first-child { color: var(--bad-text); }
.toast-info .icon:first-child { color: var(--accent-text); }
.toast-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 28px; display: grid; gap: 18px; }
.auth-card h1 { font-size: 20px; font-weight: 650; }
.auth-card .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.auth-card form { display: grid; gap: 14px; }
.auth-error { color: var(--bad-text); background: var(--bad-soft); padding: 9px 11px; border-radius: 8px; font-size: 13px; }
.auth-foot { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }

/* ---------- charts ---------- */
.chart { display: grid; gap: 10px; }
.chart-plot { position: relative; width: 100%; min-height: 60px; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-svg .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .hit { fill: transparent; cursor: default; }
.chart-svg .hit:focus { outline: none; }
.chart-svg .col.dim { opacity: 0.45; }
.chart-svg .hover-band { fill: var(--surface-3); opacity: 0.7; }
.s1 { fill: var(--series-1); } .s2 { fill: var(--series-2); } .s3 { fill: var(--series-3); }
.s1-bg { background: var(--series-1); } .s2-bg { background: var(--series-2); } .s3-bg { background: var(--series-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-tooltip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; }
.tt-title { color: var(--muted); margin-bottom: 4px; }
.tt-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tt-row strong { font-variant-numeric: tabular-nums; }
.tt-row span { color: var(--text-2); }
.tt-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tt-total { border-top: 1px solid var(--border); margin-top: 5px; padding-top: 5px; }
.hbars { display: grid; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar-track { height: 14px; position: relative; }
.hbar-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-value { font-variant-numeric: tabular-nums; font-weight: 550; min-width: 3ch; text-align: right; }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; display: flex; gap: 2px; }
.progress > span { display: block; height: 100%; }

/* ---------- conversation & transcript ---------- */
.transcript { display: grid; gap: 12px; }
.msg { display: grid; gap: 3px; max-width: 78%; }
.msg.assistant { justify-self: start; }
.msg.user { justify-self: end; text-align: right; }
.msg .who { font-size: 11.5px; color: var(--muted); }
.msg .bubble { padding: 9px 12px; border-radius: 12px; background: var(--surface-3); color: var(--text); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant .bubble { border-bottom-left-radius: 4px; }
.msg.user .bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.msg.filler .bubble { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); font-style: italic; }
.msg.interrupted .bubble { opacity: 0.75; }
.msg-flag { font-size: 11px; color: var(--warn-text); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { margin-top: 6px; width: 9px; height: 9px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); background: var(--surface-3); }
.timeline .when { font-size: 12px; color: var(--muted); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.note-cell { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); min-width: 0; }
.note-cell .k { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.note-cell .v { overflow-wrap: anywhere; }
.note-cell.blank .v { color: var(--faint); font-style: italic; }
.note-cell.wide { grid-column: 1 / -1; }
.player { width: 100%; }
.prompt-view { white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; margin: 0; }
.feed { display: grid; gap: 12px; }
.feed-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.feed-item .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.feed-item .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); min-width: 0; color: var(--text); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- editors ---------- */
.kv-editor { display: grid; gap: 6px; }
.kv-row { display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.4fr) auto; gap: 6px; }
.kv-row .input:first-child { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.tag-input input { border: 0; outline: none; background: transparent; color: var(--text); font: 14px var(--font); flex: 1; min-width: 100px; height: 26px; }
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drop { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
details.disclosure > summary { cursor: pointer; font-weight: 550; list-style: none; display: flex; align-items: center; gap: 6px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { transition: transform 0.15s; }
details.disclosure[open] > summary .icon { transform: rotate(90deg); }
.diff { font: 12px/1.55 var(--mono); max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.diff div { padding: 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .add { background: var(--good-soft); }
.diff .del { background: var(--bad-soft); text-decoration: line-through; text-decoration-color: var(--faint); }

/* ---------- simulator ---------- */
.sim { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 520px; }
.sim-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sim-body { padding: 16px; overflow-y: auto; max-height: 60vh; }
.sim-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; background: var(--good); transition: width 0.08s linear; }
.phase { font-weight: 600; }
.phase[data-phase="listening"] { color: var(--good-text); }
.phase[data-phase="speaking"] { color: var(--accent-text); }
.phase[data-phase="thinking"] { color: var(--warn-text); }
.phase[data-phase="error"] { color: var(--bad-text); }
.timer { font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--muted); }

/* Keyboard access and compact screens. */
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 210; padding: 10px 16px; background: var(--surface); border: 2px solid var(--accent); border-radius: 7px; }
.skip-link:focus { top: 12px; }
.boot, .shell, .auth { min-height: 100dvh; }
.sidebar { height: 100dvh; }
.stat-value { font-variant-numeric: tabular-nums; }
.card-body, .page, .toolbar, .row, .stack, .stack-lg, .field { min-width: 0; }
input[type=file] { max-width: 100%; }
.btn, .nav-link { transition: background-color 160ms ease, color 160ms ease; }
.btn:active:not(:disabled) { transform: translateY(1px); }
@media (max-width: 480px) {
  .toolbar > .row { max-width: 100%; }
  .toolbar input[type=date] { min-width: 0; width: 130px; }
  .kv { grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1.2fr); }
  .page-head h1 { overflow-wrap: anywhere; }
  .kv-row { grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
