/* UNILUS Library: one stylesheet, light and dark themes from the same tokens. */
:root {
  color-scheme: light;
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --ink: #12161d;
  --ink-2: #48505e;
  --muted: #7a8292;
  --line: #e2e5eb;
  --line-2: #d3d7df;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: #e8f1fc;
  --side-bg: #14284b;
  --side-bg-2: #1b3360;
  --side-ink: #dbe4f3;
  --side-muted: #93a3c0;
  --gold: #f2c14e;
  --good: #0ca30c;
  --good-ink: #0a6b14;
  --good-wash: #e5f5e6;
  --warn: #c98500;
  --warn-ink: #8a5a00;
  --warn-wash: #fdf3dc;
  --bad: #d03b3b;
  --bad-ink: #ad2a2a;
  --bad-wash: #fbe9e9;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 12px;
  /* charts (reference palette) */
  --chart-surface: #fcfcfb;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  /* SQL highlighting */
  --code-bg: #f6f8fb;
  --code-kw: #1c5cab;
  --code-fn: #8a3ab9;
  --code-str: #a3501b;
  --code-num: #0a7a5a;
  --code-com: #8a919e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1014;
    --surface: #171a20;
    --surface-2: #1c2027;
    --surface-3: #232831;
    --ink: #f1f3f6;
    --ink-2: #c4c9d3;
    --muted: #8d95a4;
    --line: #2a2f39;
    --line-2: #363c48;
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --accent-wash: #16263d;
    --side-bg: #0b1426;
    --side-bg-2: #142242;
    --good-ink: #4cc75a;
    --good-wash: #12291a;
    --warn: #e0a116;
    --warn-ink: #f0bf4f;
    --warn-wash: #2c2310;
    --bad-ink: #ef7d7d;
    --bad-wash: #2f1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --chart-surface: #1a1a19;
    --grid: #2c2c2a;
    --axis: #383835;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --code-bg: #12151b;
    --code-kw: #79aef0;
    --code-fn: #c99bf0;
    --code-str: #e7a36a;
    --code-num: #5fd1a5;
    --code-com: #737b89;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
p { margin: 0 0 .75em; }
svg { flex-shrink: 0; }
button { font: inherit; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 10px 0 5px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 16px 12px 14px;
  scrollbar-width: thin; scrollbar-color: var(--side-bg-2) transparent;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 16px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--side-bg-2); display: grid; place-items: center; }
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; }
.brand-text b { display: block; font-size: 15.5px; color: #fff; letter-spacing: .1px; }
.brand-text small { display: block; font-size: 11.5px; color: var(--side-muted); }
.duty { background: var(--side-bg-2); border-radius: 10px; padding: 9px 10px; margin: 0 2px 14px; font-size: 12px; }
.duty .duty-label { color: var(--side-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.duty select { background: transparent; border: 0; color: #fff; padding: 2px 0; font-weight: 600; font-size: 13px; box-shadow: none; cursor: pointer; }
.duty select option { color: #12161d; }
.duty .duty-hours { color: var(--side-muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: #3ccf5a; box-shadow: 0 0 0 3px rgba(60, 207, 90, .18); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--side-muted); font-weight: 700; margin: 14px 10px 6px; }
.nav a, .nav button.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: var(--side-ink); text-decoration: none; font-weight: 500; border: 0; background: none; width: 100%; text-align: left; cursor: pointer;
}
.nav a svg, .nav button.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav a:hover, .nav button.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav a.active { background: var(--side-bg-2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav .count { margin-left: auto; font-size: 11.5px; background: rgba(255, 255, 255, .1); padding: 1px 7px; border-radius: 99px; color: #fff; }
.nav .count.alert { background: #c4413d; }
.solution-btn { margin-top: 6px; border: 1px dashed rgba(242, 193, 78, .45) !important; color: #ffe3a1 !important; }
.solution-btn.open { border-style: solid !important; background: rgba(242, 193, 78, .08) !important; }
.sol-tree { margin: 4px 0 6px 6px; border-left: 1px solid rgba(255, 255, 255, .1); padding-left: 6px; }
.sol-sec > button {
  display: flex; width: 100%; align-items: center; gap: 8px; background: none; border: 0; color: #fff; font-weight: 600;
  font-size: 12.5px; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left;
}
.sol-sec > button:hover { background: rgba(255, 255, 255, .05); }
.sol-sec > button .chev { margin-left: auto; width: 14px; height: 14px; stroke: var(--side-muted); fill: none; stroke-width: 2; transition: transform .15s; }
.sol-sec.open > button .chev { transform: rotate(90deg); }
.sol-sec .sec-num { color: var(--gold); min-width: 18px; }
.sol-items { display: none; padding: 0 0 4px 0; }
.sol-sec.open .sol-items { display: block; }
.sol-items a { font-size: 12.5px; padding: 6px 8px 6px 10px; gap: 8px; align-items: flex-start; line-height: 1.35; }
.sol-items a .q-num { color: var(--side-muted); font-variant-numeric: tabular-nums; min-width: 30px; }
.sol-items a.active .q-num { color: var(--gold); }
.side-foot { margin-top: auto; padding: 14px 6px 0; display: flex; flex-direction: column; gap: 6px; }
.side-foot button { background: none; border: 1px solid rgba(255, 255, 255, .12); color: var(--side-muted); border-radius: 8px; padding: 7px 10px; font-size: 12px; cursor: pointer; text-align: left; }
.side-foot button:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }
.side-foot .foot-note { font-size: 11px; color: var(--side-muted); line-height: 1.4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.page { padding: 24px 28px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.scrim { display: none; }

/* ------------------------------------------------------------------ building blocks */
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; padding: 9px 15px;
  border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; text-decoration: none; color: var(--ink);
}
.btn:hover { text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-danger { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-danger:hover { background: var(--bad-wash); }
.btn-ghost { background: none; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-run { background: #0f8a4c; border-color: #0f8a4c; color: #fff; }
.btn-run:hover { background: #0b733f; border-color: #0b733f; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2, .card > h3 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .right { margin-left: auto; }
.kpi { padding: 15px 16px; }
.kpi .k-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.kpi .k-value { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.3px; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.alert .k-value { color: var(--bad-ink); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--good-wash); color: var(--good-ink); }
.badge.warn { background: var(--warn-wash); color: var(--warn-ink); }
.badge.bad { background: var(--bad-wash); color: var(--bad-ink); }
.badge.info { background: var(--accent-wash); color: var(--accent-ink); }
.badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.notice { border-radius: 10px; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.notice.ok { background: var(--good-wash); border-color: transparent; color: var(--good-ink); }
.notice.warn { background: var(--warn-wash); border-color: transparent; color: var(--warn-ink); }
.notice.bad { background: var(--bad-wash); border-color: transparent; color: var(--bad-ink); }
.notice ul { margin: 6px 0 0 18px; padding: 0; }
.tabs { display: inline-flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: 10px; }
.tabs button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 520px; background: var(--surface); }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
table.t td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t td.null { color: var(--muted); font-style: italic; }
table.t tr.clickable { cursor: pointer; }
.result-meta { font-size: 12px; color: var(--muted); margin: 8px 2px 0; display: flex; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ desk */
.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; }
.person { display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14.5px; flex-shrink: 0; }
.person .p-name { font-weight: 650; font-size: 15px; }
.person .p-sub { font-size: 12.5px; color: var(--muted); }
.copy-card { display: flex; gap: 12px; align-items: flex-start; }
.spine { width: 10px; align-self: stretch; border-radius: 3px; background: var(--accent); flex-shrink: 0; }
.desk-log li { font-size: 13px; }
.desk-log .when { color: var(--muted); font-size: 12px; min-width: 52px; font-variant-numeric: tabular-nums; }
.hint-list { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.hint-list li { margin: 3px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------ catalogue */
.book-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 13px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.book-row:hover { background: var(--surface-2); }
.book-row .b-title { font-weight: 600; }
.book-row .b-meta { font-size: 12.5px; color: var(--muted); }
.avail { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; }

/* ------------------------------------------------------------------ modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 20, .5); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(900px, 100%); }
.modal-close { position: absolute; top: 12px; right: 12px; }
@keyframes fade { from { opacity: 0; } }
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #172033; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: min(560px, calc(100vw - 32px)); animation: fade .2s; }
.toast.bad { background: #8f2525; }
.toast.ok { background: #145c2c; }

/* ------------------------------------------------------------------ loading */
.loading { display: grid; place-items: center; gap: 10px; padding: 120px 20px; color: var(--muted); text-align: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ solution */
.lock-card { max-width: 420px; margin: 50px auto; text-align: center; padding: 30px 28px; }
.lock-card .lock-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-wash); color: var(--accent-ink); display: grid; place-items: center; margin: 0 auto 14px; }
.lock-card .lock-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lock-card input { text-align: center; font-size: 18px; letter-spacing: 3px; margin-top: 8px; }
.q-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.q-num { font-variant-numeric: tabular-nums; }
.q-badge { background: var(--side-bg); color: var(--gold); font-weight: 700; border-radius: 10px; padding: 7px 10px; font-size: 14px; white-space: nowrap; }
.q-head h1 { font-size: 19px; margin: 2px 0 6px; }
.q-sec { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.concepts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.prose { max-width: 820px; }
.prose p, .prose li { color: var(--ink); }
.prose h2 { margin-top: 1.3em; }
.prose h3 { margin-top: 1.1em; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 .9em; }
.prose li { margin: 4px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 6px 0 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.prose .callout { border-left: 3px solid var(--accent); background: var(--accent-wash); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 10px 0 14px; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.8px; line-height: 1.6;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0;
  overflow: auto; white-space: pre; tab-size: 2; max-height: 560px;
}
.code .kw { color: var(--code-kw); font-weight: 600; }
.code .fn { color: var(--code-fn); }
.code .str { color: var(--code-str); }
.code .num { color: var(--code-num); }
.code .com { color: var(--code-com); font-style: italic; }
.code-bar { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; flex-wrap: wrap; }
.code-bar .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.code-bar .right { margin-left: auto; display: flex; gap: 6px; }
.result { margin-top: 14px; }
.result-err { background: var(--bad-wash); color: var(--bad-ink); border-radius: 10px; padding: 11px 13px; font-size: 13.5px; }
.result-ok { background: var(--good-wash); color: var(--good-ink); border-radius: 10px; padding: 11px 13px; font-size: 13.5px; }
.analysis { margin-top: 18px; }
.analysis h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.sol-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.sol-nav a { text-decoration: none; max-width: 48%; }
.sol-nav small { display: block; color: var(--muted); font-size: 11.5px; }
.sol-nav span { font-weight: 600; font-size: 13.5px; }
.sol-index .sec { margin-bottom: 18px; }
.sol-index a.item { display: flex; gap: 12px; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.sol-index a.item:hover { background: var(--surface-2); }
.sol-index a.item .q-num { color: var(--muted); min-width: 34px; font-weight: 600; }

/* ------------------------------------------------------------------ diagrams & charts */
.diagram { background: var(--chart-surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; overflow: auto; }
.diagram svg { display: block; width: 100%; height: auto; min-width: 760px; }
.diagram.zoom svg { min-width: 1400px; }
.chart-card { background: var(--chart-surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 10px; position: relative; }
.chart-title { font-weight: 650; font-size: 14.5px; margin: 0; }
.chart-sub { font-size: 12.5px; color: var(--ink-2); margin: 2px 0 8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 16px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px;
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; min-width: 120px; z-index: 3; display: none;
}
.tip b { display: block; margin-bottom: 3px; }
.tip .t-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip .t-row i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.tip .t-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 10px; }

/* ------------------------------------------------------------------ slides */
.deck { position: fixed; inset: 0; z-index: 70; background: #0c1730; display: flex; flex-direction: column; }
.deck-stage { flex: 1; display: grid; place-items: center; padding: 24px; min-height: 0; }
.slide {
  width: min(1180px, 100%); aspect-ratio: 16 / 9; max-height: 100%; background: #fff; color: #12161d; border-radius: 14px;
  padding: 44px 56px; display: flex; flex-direction: column; overflow: hidden; position: relative; color-scheme: light;
  --ink: #12161d; --ink-2: #48505e; --muted: #7a8292; --line: #e2e5eb; --surface: #fff; --surface-2: #f7f8fa; --surface-3: #eef0f4;
  --chart-surface: #fcfcfb; --grid: #e1e0d9; --axis: #c3c2b7; --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
}
.slide h2 { font-size: 30px; margin-bottom: 18px; color: #14284b; }
.slide .s-kicker { color: #2a78d6; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; margin-bottom: 6px; }
.slide ul { font-size: 20px; line-height: 1.5; padding-left: 26px; margin: 0; }
.slide li { margin: 6px 0; }
.slide .s-body { flex: 1; min-height: 0; display: flex; gap: 28px; }
.slide .s-body > * { min-width: 0; }
.slide .s-text { flex: 1; }
.slide .s-visual { flex: 1.25; display: flex; align-items: center; justify-content: center; min-height: 0; }
.slide .s-visual > * { width: 100%; max-height: 100%; }
.slide .s-visual svg { max-height: 100%; }
.slide.title-slide { background: linear-gradient(140deg, #14284b, #1f4580); color: #fff; justify-content: center; }
.slide.title-slide h2 { color: #fff; font-size: 44px; max-width: 820px; }
.slide.title-slide .s-sub { font-size: 20px; color: #c8d6ee; }
.slide.title-slide .s-names { margin-top: 30px; font-size: 15px; color: #c8d6ee; columns: 2; max-width: 760px; }
.slide .s-foot { position: absolute; bottom: 16px; left: 56px; right: 56px; display: flex; justify-content: space-between; font-size: 12px; color: #8a92a2; }
.slide.title-slide .s-foot { color: #9fb2d4; }
.slide .big-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 10px; }
.slide .big-stats div { background: #f3f6fb; border-radius: 12px; padding: 16px; }
.slide .big-stats b { display: block; font-size: 32px; color: #14284b; }
.slide .big-stats span { font-size: 14px; color: #48505e; }
.deck-bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; color: #c8d6ee; font-size: 13px; }
.deck-bar button { background: rgba(255, 255, 255, .1); border: 0; color: #fff; border-radius: 8px; padding: 7px 13px; cursor: pointer; font-weight: 600; }
.deck-bar button:hover { background: rgba(255, 255, 255, .18); }
.deck-bar .spacer { flex: 1; }

/* ------------------------------------------------------------------ report */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 48px; max-width: 900px; }
.report h1 { font-size: 24px; }
.report h2 { font-size: 19px; margin-top: 32px; padding-top: 10px; border-top: 1px solid var(--line); }
.report h3 { font-size: 15px; margin-top: 18px; }
.report .cover { text-align: center; padding: 40px 0 30px; }
.report .cover h1 { font-size: 28px; margin: 14px 0 8px; }
.report .cover .c-sub { color: var(--ink-2); font-size: 16px; }
.report .cover table { margin: 24px auto 0; border-collapse: collapse; font-size: 14px; }
.report .cover td { padding: 5px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.report .toc ol { columns: 2; font-size: 14px; }
.report .figure { margin: 12px 0 18px; }
.report .figure figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.report .code { max-height: none; white-space: pre-wrap; font-size: 11.5px; }
.report .table-wrap { max-height: none; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 290px; max-width: 86vw; transform: translateX(-102%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(8, 12, 20, .45); }
  .topbar .menu-btn { display: grid; }
  .topbar { padding: 10px 16px; }
  .page { padding: 18px 16px 50px; }
  .clock { display: none; }
  .report { padding: 22px 18px; }
  .q-head { flex-direction: column; gap: 8px; }
  .book-row { grid-template-columns: 1fr; }
  .avail { justify-content: flex-start; }
  .slide { padding: 24px 22px; }
  .slide h2 { font-size: 20px; }
  .slide ul { font-size: 14px; }
  .slide .s-body { flex-direction: column; }
}

/* ------------------------------------------------------------------ print (the project report) */
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f6f7f9; --surface-3: #eef0f4; --ink: #000; --ink-2: #333; --muted: #555; --line: #ccc; --line-2: #bbb; --chart-surface: #fff; --code-bg: #f6f8fb; }
  body { background: #fff; font-size: 11pt; }
  .side, .topbar, .no-print, #toast-root, .scrim { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; box-shadow: none; max-width: none; }
  .report h2 { break-before: page; border-top: 0; }
  .report .cover { break-after: page; padding-top: 120px; }
  .report .figure, .report table, .report .code { break-inside: avoid; }
  .diagram { border: 0; padding: 0; overflow: visible; }
  .diagram svg { min-width: 0 !important; }
  .table-wrap { overflow: visible; border: 0; max-height: none; }
  a { color: inherit; text-decoration: none; }
}
