/* Siwon dashboard. Colour tokens follow the validated data-viz palette (light and dark are separate selections). */
:root {
  color-scheme: light;
  --page: #f5f5f2;
  --surface: #ffffff;
  --raised: #ffffff;
  --sunken: #f9f9f7;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7d7b75;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, .09);
  --border-strong: rgba(11, 11, 11, .16);
  --wash: rgba(11, 11, 11, .045);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-wash: rgba(42, 120, 214, .10);
  --ink-btn: #0f1729;           /* primary buttons */
  --ink-btn-text: #ffffff;
  --good: #0ca30c; --good-text: #006300; --good-wash: rgba(12, 163, 12, .10);
  --warn: #fab219; --warn-text: #7a5400; --warn-wash: rgba(250, 178, 25, .16);
  --serious: #ec835a;
  --bad: #d03b3b; --bad-text: #a82a2a; --bad-wash: rgba(208, 59, 59, .10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --seq-0: #eef4fc; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #1c5cab;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 1px 1px rgba(11, 11, 11, .02);
  --shadow-pop: 0 2px 6px rgba(11, 11, 11, .06), 0 16px 40px -12px rgba(11, 11, 11, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 248px;
  --font: "Inter var", InterVariable, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --raised: #222221; --sunken: #141413; --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .16);
    --wash: rgba(255, 255, 255, .06);
    --accent: #3987e5; --accent-wash: rgba(57, 135, 229, .16); --ink-btn: #f0efec; --ink-btn-text: #0b0b0b;
    --good-text: #0ca30c; --warn-text: #fab219; --bad-text: #ec6b6b;
    --good-wash: rgba(12, 163, 12, .16); --warn-wash: rgba(250, 178, 25, .14); --bad-wash: rgba(236, 107, 107, .14);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --seq-0: #1c2430; --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #2a78d6; --seq-4: #5598e7; --seq-5: #86b6ef;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 40px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --raised: #222221; --sunken: #141413; --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8d86;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .16);
  --wash: rgba(255, 255, 255, .06);
  --accent: #3987e5; --accent-wash: rgba(57, 135, 229, .16); --ink-btn: #f0efec; --ink-btn-text: #0b0b0b;
  --good-text: #0ca30c; --warn-text: #fab219; --bad-text: #ec6b6b;
  --good-wash: rgba(12, 163, 12, .16); --warn-wash: rgba(250, 178, 25, .14); --bad-wash: rgba(236, 107, 107, .14);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --seq-0: #1c2430; --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #2a78d6; --seq-4: #5598e7; --seq-5: #86b6ef;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 40px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased;
       font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font: 12.5px var(--mono); background: var(--wash); padding: 1px 5px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 14px;
        border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 10px; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand b { display: block; font-size: 15.5px; font-weight: 680; letter-spacing: -.01em; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav h3 { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; text-decoration: none; color: var(--text-2); font-weight: 520; }
.nav a:hover { background: var(--wash); color: var(--text); }
.nav a[aria-current="page"] { background: var(--wash); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.nav a[aria-current="page"] .ico { color: var(--accent); }
.nav .sw { width: 8px; height: 8px; border-radius: 3px; flex: none; margin: 0 5px; }
.nav .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--axis); flex: none; }
.nav .dot[data-state="ok"] { background: var(--good); }
.nav .dot[data-state="stale"] { background: var(--warn); }
.nav .dot[data-state="error"] { background: var(--bad); }
.nav .dot[data-state="archive"] { display: none; }
.nav .tag { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); padding: 0 6px; border-radius: 6px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding: 10px 4px 0; border-top: 1px solid var(--border); }
.who { display: flex; align-items: center; gap: 9px; padding: 4px 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.who .avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent);
               font-weight: 700; font-size: 12px; flex: none; text-transform: uppercase; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-row { display: flex; gap: 6px; }
.foot-row form { margin: 0; flex: 1; }
.foot-row form .icon-btn { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; min-width: 34px; padding: 0 10px; border-radius: 9px;
            border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 550; text-decoration: none; }
.icon-btn:hover { background: var(--wash); color: var(--text); }
.main { min-width: 0; padding: 0 32px 56px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 18px 0 16px; background: var(--page); }
.top .title { min-width: 0; flex: 1; }
.top h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; display: flex; align-items: center; gap: 10px; }
.top h1 .sw { width: 12px; height: 12px; border-radius: 4px; }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.updated { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- range control: quick segments + the full list in a popover ---------- */
.range { position: relative; display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--wash); border: 1px solid var(--border); }
.seg button { height: 30px; padding: 0 11px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.range .more { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border);
               background: var(--surface); font-weight: 600; font-size: 13px; }
.range .more:hover { background: var(--wash); }
.range .more .lbl { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop { position: absolute; right: 0; top: 46px; z-index: 30; width: 270px; padding: 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--raised); box-shadow: var(--shadow-pop); }
.pop[hidden] { display: none; }
.pop button.opt { display: flex; align-items: center; width: 100%; height: 36px; padding: 0 10px; gap: 8px; border: 0; border-radius: 8px; background: none; text-align: left; }
.pop button.opt:hover { background: var(--wash); }
.pop button.opt .chk { margin-left: auto; width: 16px; height: 16px; opacity: 0; }
.pop button.opt[aria-checked="true"] { font-weight: 650; }
.pop button.opt[aria-checked="true"] .chk { opacity: 1; }
.pop .custom { margin-top: 6px; padding: 10px 6px 4px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.pop .custom label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.pop input[type=date] { height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px;
       border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--wash); }
.btn.primary { background: var(--ink-btn); border-color: var(--ink-btn); color: var(--ink-btn-text); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.danger { color: var(--bad-text); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

/* ---------- cards & layout ---------- */
.stack { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card > header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card > header h2 { font-size: 14.5px; font-weight: 650; letter-spacing: -.005em; }
.card > header p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card > header .tools { margin-left: auto; display: flex; gap: 6px; flex: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start;
        grid-auto-flow: row dense; }
.grid.charts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.grid > .wide { grid-column: 1 / -1; }
.cols-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.loading { opacity: .5; transition: opacity .15s; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 2px -4px; }
.section-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.section-head p { color: var(--muted); font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
        background: var(--wash); color: var(--text-2); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--axis); }
.chip[data-state="ok"] i { background: var(--good); }
.chip[data-state="stale"] i { background: var(--warn); }
.chip[data-state="error"] i { background: var(--bad); }
.chip[data-state="archive"] i { background: var(--muted); border-radius: 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--wash); color: var(--text-2); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--text-2); font-size: 13px; }
.meta .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- insights ---------- */
.insights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.insights li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; min-width: 0; }
.insights li:hover { background: var(--wash); }
.insights li > .ico { margin-top: 1px; padding: 3px; width: 24px; height: 24px; border-radius: 7px; background: var(--wash); color: var(--muted); }
.insights li[data-level="bad"] > .ico { color: var(--bad-text); background: var(--bad-wash); }
.insights li[data-level="warn"] > .ico { color: var(--warn-text); background: var(--warn-wash); }
.insights li[data-level="good"] > .ico { color: var(--good-text); background: var(--good-wash); }
.insights .txt { min-width: 0; }
.insights .tag { display: block; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.insights a { text-decoration: none; }
.insights a:hover { text-decoration: underline; }

/* ---------- hero + tiles ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
.hero-main { display: grid; gap: 6px; align-content: start; }
.hero-label { color: var(--text-2); font-weight: 560; font-size: 13.5px; }
.hero-value { font-size: clamp(38px, 5.4vw, 54px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em; }
.hero-value small { font-size: .34em; font-weight: 650; color: var(--muted); letter-spacing: 0; margin-right: 6px; vertical-align: .75em; }
.hero-deltas { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.hero-spark { margin-top: 8px; height: 70px; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-content: start; }
.tile { padding: 14px 16px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--border); min-width: 0; overflow: hidden; display: grid; gap: 2px; align-content: start; }
.tile .label { color: var(--text-2); font-size: 12.5px; font-weight: 550; }
.tile .value { font-size: clamp(19px, 5vw, 25px); font-weight: 680; letter-spacing: -.02em; line-height: 1.25; }
.tile .hint { color: var(--muted); font-size: 12px; }
.tile.wide { grid-column: 1 / -1; }
.tile .spark { height: 30px; margin-top: 6px; }
.tiles.on-card { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.delta { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 5px; font-size: 12.5px; font-weight: 650; }
.delta[data-tone="good"] { color: var(--good-text); }
.delta[data-tone="bad"] { color: var(--bad-text); }
.delta[data-tone="flat"] { color: var(--muted); }
.delta small { font-weight: 450; color: var(--muted); font-size: 12px; }
.meter { height: 8px; border-radius: 999px; background: var(--seq-1); overflow: hidden; margin: 8px 0 2px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* ---------- business cards ---------- */
.biz { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.biz .card { display: grid; gap: 6px; align-content: start; text-decoration: none; transition: border-color .12s, box-shadow .12s; position: relative; overflow: hidden; }
.biz .card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--bar, var(--axis)); }
a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-pop); }
.biz .head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.biz .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.biz .name { font-weight: 680; font-size: 15px; }
.biz .lbl { color: var(--muted); font-size: 12.5px; }
.biz .big { font-size: 27px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.biz .row { display: flex; align-items: center; gap: 4px 14px; color: var(--text-2); font-size: 12.5px; flex-wrap: wrap; }
.biz .spark { height: 40px; margin-top: 4px; }
.biz .pace { font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.biz .pace b { color: var(--text); }
.waiting { display: grid; gap: 8px; }
.waiting .w { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; font-size: 13px; color: var(--text-2); }
.waiting .w b { color: var(--text); }
.waiting .w a { margin-left: auto; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.ln { width: 14px; height: 2px; border-radius: 2px; background: var(--text-2); }
.axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.axis .grid { stroke: var(--grid); stroke-width: 1; }
.axis .base { stroke: var(--axis); stroke-width: 1; }
.cap { fill: var(--text-2); font-size: 11px; font-weight: 650; font-family: var(--font); }
.hit { fill: transparent; }
.hit:hover, .hit.on { fill: var(--wash); }
.cross { stroke: var(--axis); stroke-width: 1; pointer-events: none; }
.ring { stroke: var(--surface); stroke-width: 2; }
.f1 { fill: var(--s1); } .f2 { fill: var(--s2); } .f3 { fill: var(--s3); } .f4 { fill: var(--s4); }
.f5 { fill: var(--s5); } .f6 { fill: var(--s6); } .f7 { fill: var(--s7); } .f8 { fill: var(--s8); } .f0 { fill: var(--axis); }
.k1 { stroke: var(--s1); } .k2 { stroke: var(--s2); } .k3 { stroke: var(--s3); } .k4 { stroke: var(--s4); }
.k5 { stroke: var(--s5); } .k6 { stroke: var(--s6); } .k7 { stroke: var(--s7); } .k8 { stroke: var(--s8); } .k0 { stroke: var(--axis); }
.b1 { background: var(--s1); } .b2 { background: var(--s2); } .b3 { background: var(--s3); } .b4 { background: var(--s4); }
.b5 { background: var(--s5); } .b6 { background: var(--s6); } .b7 { background: var(--s7); } .b8 { background: var(--s8); } .b0 { background: var(--axis); }
.bline { background: var(--text-2); }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.overlay { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.overlay-dot { fill: var(--text-2); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.area { opacity: .1; }
.spark svg { height: 100%; }
.tip { position: fixed; z-index: 60; pointer-events: none; min-width: 160px; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: var(--raised);
       border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: 12.5px; }
.tip[hidden] { display: none; }
.tip .t-head { color: var(--text-2); margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.tip .t-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.tip .t-row .k { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); min-width: 0; }
.tip .t-row .k i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tip .t-row b { font-weight: 680; color: var(--text); font-variant-numeric: tabular-nums; }
.tip .t-sum { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.tip .t-note { margin-top: 6px; color: var(--muted); font-size: 11.5px; }

/* heatmap (busiest hours) */
.heat { overflow-x: auto; }
.heat .hg { display: grid; gap: 3px; min-width: max-content; }
.heat .hc { height: 26px; min-width: 22px; border-radius: 4px; background: var(--seq-0); }
.heat .hc:hover, .heat .hc:focus-visible { outline: 2px solid var(--text); outline-offset: -1px; }
.heat .q1 { background: var(--seq-1); } .heat .q2 { background: var(--seq-2); } .heat .q3 { background: var(--seq-3); }
.heat .q4 { background: var(--seq-4); } .heat .q5 { background: var(--seq-5); }
.heat .rl { font-size: 11.5px; color: var(--muted); padding-right: 8px; align-self: center; }
.heat .cl { font-size: 10.5px; color: var(--muted); text-align: center; }
.scale { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.scale i { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }

/* ranked bars, segments, tables */
.hbars { display: grid; gap: 11px; grid-template-columns: minmax(0, 1fr); }
.hbar { min-width: 0; }
.hbar .top-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 13.5px; }
.hbar .top-row a { text-decoration: none; }
.hbar .top-row a:hover { text-decoration: underline; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.hbar .val { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar .track { height: 6px; margin-top: 5px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--s1); }
.hbar .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.segbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; }
.segbar i { display: block; height: 100%; min-width: 2px; }
.segs-legend { display: grid; gap: 8px; margin-top: 14px; }
.segs-legend div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.segs-legend b { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.segs-legend small { color: var(--muted); width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.segs-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; letter-spacing: .02em; padding: 0 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
table.t td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 14px; white-space: nowrap; }
table.t a { text-decoration: none; } table.t a:hover { text-decoration: underline; }
table.t .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; }
table.t td.pos { color: var(--good-text); } table.t td.neg { color: var(--bad-text); }
.table-wrap { overflow: auto; max-height: 360px; }
.stats { display: grid; gap: 16px 18px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat .label { color: var(--text-2); font-size: 12.5px; }
.stat .value { font-size: 21px; font-weight: 680; letter-spacing: -.015em; }
.stat .hint { color: var(--muted); font-size: 11.5px; }
.note { margin-top: 12px; color: var(--muted); font-size: 12px; }
.empty { display: grid; gap: 8px; justify-items: start; padding: 8px 2px; color: var(--text-2); }
.empty h2 { color: var(--text); font-size: 16px; }

/* ---------- data sources & settings ---------- */
.src { display: grid; gap: 14px; }
.src .head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.src .head h2 { font-size: 16px; font-weight: 680; }
.src .head .acts { margin-left: auto; }
.src .facts { display: grid; gap: 6px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); font-size: 13px; color: var(--text-2); }
.src .facts b { color: var(--text); font-weight: 600; }
.src pre, .keybox { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--border); overflow-x: auto;
                    font: 12.5px/1.55 var(--mono); white-space: pre; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.steps b { color: var(--text); }
form.up { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
form.up label, form.inline label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 550; }
input[type=text].in, input[type=file].in { height: 36px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); width: 100%; }
form.inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
form.inline label { flex: 1; min-width: 200px; }
.result { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--wash); white-space: pre-wrap; }
.result[data-tone="bad"] { color: var(--bad-text); background: var(--bad-wash); }
.result[data-tone="good"] { color: var(--good-text); background: var(--good-wash); }
details.more summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 550; }
details.more[open] summary { margin-bottom: 10px; }
.enrol { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; padding: 16px; border-radius: 12px;
         border: 1px solid var(--border); background: var(--sunken); }
.enrol img { width: 220px; height: 220px; border-radius: 10px; background: #fff; padding: 6px; display: block; }
.enrol .keybox { white-space: normal; word-break: break-all; letter-spacing: .08em; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
              background: radial-gradient(1200px 500px at 50% -10%, var(--accent-wash), transparent 70%), var(--page); }
.login-wrap { width: 100%; max-width: 390px; display: grid; gap: 18px; }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.login-brand img { border-radius: 11px; }
.login-brand b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.login-brand span { display: block; color: var(--muted); font-size: 12.5px; }
.login { display: grid; gap: 16px; padding: 26px 24px; box-shadow: var(--shadow-pop); }
.login h1 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.login label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.login input { height: 46px; padding: 0 12px; font-size: 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.login input.code { font: 600 22px/1 var(--mono); letter-spacing: .3em; text-align: center; }
.login input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.login .btn { height: 46px; width: 100%; font-size: 15px; }
.err { padding: 10px 12px; border-radius: 10px; background: var(--bad-wash); color: var(--bad-text); font-size: 13px; line-height: 1.55; }
.err code { background: transparent; padding: 0; word-break: break-all; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .seg { display: none; }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(82vw, 300px); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  body.menu-open .side { transform: none; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .main { padding: 0 16px 40px; }
  .hero, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .top { gap: 10px; padding: 12px 0; }
  .top h1 { font-size: 19px; }
  .updated { display: none; }
}
@media (max-width: 560px) {
  .card { padding: 16px; }
  .tiles, .tiles.on-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .top .sub { display: none; }
  .range .more .lbl { max-width: 110px; }
  .pop { right: -2px; width: min(300px, calc(100vw - 32px)); }
  .enrol { grid-template-columns: minmax(0, 1fr); }
  .enrol img { margin: 0 auto; }
  .insights ul { grid-template-columns: minmax(0, 1fr); }
}
@media print { .side, .top .range, .menu-btn { display: none; } .shell { display: block; } .card { box-shadow: none; break-inside: avoid; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
