/* Grapevine UI. Chart colours are the dataviz reference palette; status colours are reserved for state.
   Brand: navy #1a213d and blue #5590ca, measured from the logo. The logo blue is 3.4:1 on white, too
   light for text, so --accent is a darker shade of it (5.6:1) and primary actions are navy. */
:root {
  color-scheme: light;
  --brand-navy: #1a213d; --brand-blue: #5590ca;
  --page: #f4f6f9; --surface: #ffffff; --surface-2: #f6f8fb; --ink: #121830; --ink-2: #4b536b; --muted: #6b7389;
  --grid: #e3e7ee; --axis: #c3cad6; --border: rgba(26, 33, 61, .12); --hover: rgba(26, 33, 61, .05);
  --accent: #2f6aa6; --accent-ink: #ffffff; --accent-wash: rgba(85, 144, 202, .14);
  --primary: #1a213d; --primary-ink: #ffffff;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --positive: #2a78d6; --negative: #e34948; --neutral: #d9d8d2;
  --good: #0ca30c; --good-text: #006300; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --radius: 10px; --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .04);
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0b0f1a; --surface: #131a2b; --surface-2: #1a2236; --ink: #f2f4f8; --ink-2: #c3c9d6; --muted: #8b93a7;
    --grid: #242d44; --axis: #33405c; --border: rgba(255, 255, 255, .10); --hover: rgba(255, 255, 255, .05);
    --accent: #7fb0e3; --accent-ink: #0b1020; --accent-wash: rgba(85, 144, 202, .20);
    --primary: #5590ca; --primary-ink: #0b1020;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --positive: #3987e5; --negative: #e66767; --neutral: #4a4a46;
    --good-text: #0ca30c; --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 14px/1.5 var(--sans); }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.secondary { color: var(--ink-2); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; padding: 6px 8px 18px; }
.brand:hover { text-decoration: none; }
.logo { display: block; }
.logo img { display: block; height: 28px; width: auto; }
.topbar .logo img { height: 22px; }
.nav-group { margin: 12px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); }
.nav-link:hover { background: var(--hover); text-decoration: none; }
.nav-link.active { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1240px; margin: 0 auto; padding: 24px 28px 64px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-header .subtitle { color: var(--ink-2); margin-top: 4px; max-width: 72ch; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.nav-open .sidebar { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .content { padding: 16px 16px 48px; }
}

/* ------------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 14px var(--sans); padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.busy { cursor: progress; }
.icon-btn { border: 0; background: transparent; color: var(--ink-2); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--hover); }

input, select, textarea { font: 14px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 80px; width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
input[type=range] { accent-color: var(--accent); padding: 0; border: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
/* The rule above would otherwise stretch a checkbox or radio across its row, leaving a gap before its label. */
.field input[type=checkbox], .field input[type=radio] { width: 16px; flex: none; }
.form { display: grid; gap: 14px; }
.form-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.choice-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choice-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.choice-card .desc { font-size: 12px; color: var(--ink-2); }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 16px; }
.filters .field { min-width: 140px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; padding: 6px 12px; font: 500 13px var(--sans); color: var(--ink-2); cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.on { background: var(--accent-wash); color: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; text-decoration: none; }

/* ------------------------------------------------------------------ surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 0; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 14px 16px 16px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); }
.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.notice.warn { border-left: 3px solid var(--warning); }
.notice.error { border-left: 3px solid var(--critical); }
.notice.info { border-left: 3px solid var(--accent); }
.notice.good { border-left: 3px solid var(--good); }
.empty { text-align: center; padding: 32px 16px; color: var(--ink-2); }
.empty h3 { margin-bottom: 6px; color: var(--ink); }
.empty .btn { margin-top: 12px; }
.loading { opacity: .55; transition: opacity .15s; pointer-events: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--grid); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* KPI tiles */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi .label { font-size: 12px; color: var(--ink-2); }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 2px; }
.kpi .value.insufficient { font-size: 15px; font-weight: 500; color: var(--muted); padding: 5px 0; }
.kpi .value.small { font-size: 15px; font-weight: 500; padding: 5px 0; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero { font-size: 48px; font-weight: 650; line-height: 1.05; }
.delta-up { color: var(--good-text); }
.delta-down { color: var(--critical); }
.meter { height: 8px; border-radius: 99px; background: var(--accent-wash); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.warn > span { background: var(--warning); }
.meter.bad > span { background: var(--critical); }

/* badges and chips: the dot carries colour, the text stays ink */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.pos { background: var(--positive); } .dot.neg { background: var(--negative); } .dot.neu { background: var(--neutral); }
.dot.good { background: var(--good); } .dot.warning { background: var(--warning); } .dot.serious { background: var(--serious); } .dot.critical { background: var(--critical); }
.dot.s1 { background: var(--series-1); } .dot.s2 { background: var(--series-2); } .dot.s3 { background: var(--series-3); }
.status-icon { font-weight: 700; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover, table.data tbody tr.selected { background: var(--hover); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; font-size: 13px; color: var(--ink-2); }

/* comments */
.comment { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.comment:last-child { border-bottom: 0; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-context { font-size: 12px; color: var(--ink-2); }
.labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.relevance { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.relevance .bar { width: 48px; height: 4px; border-radius: 99px; background: var(--grid); overflow: hidden; }
.relevance .bar > span { display: block; height: 100%; background: var(--accent); }

/* dialogs and toasts */
dialog.modal { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog.modal.wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; }
.modal-body { padding: 14px 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.toasts { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); }
.toast.error { border-left-color: var(--critical); }
.toast.good { border-left-color: var(--good); }
.secret { font: 600 18px var(--mono); padding: 10px 12px; background: var(--surface-2); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }

/* ------------------------------------------------------------------ sign-in
   A navy brand panel beside the form. Everything that moves animates transform, opacity or a
   stroke offset, and nothing moves at all for a reader who has asked for reduced motion. */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--page); }

/* the brand panel: navy in both themes */
.auth-brand { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 32px; padding: 40px clamp(32px, 4vw, 64px); color: #f2f4f8; background: linear-gradient(155deg, #243064 0%, var(--brand-navy) 48%, #10152b 100%); }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.auth-brand::before { width: 640px; height: 640px; left: -230px; top: -250px; background: radial-gradient(circle, rgba(85, 144, 202, .45), transparent 62%); animation: auth-drift-a 20s ease-in-out infinite alternate; }
.auth-brand::after { width: 540px; height: 540px; right: -210px; bottom: -230px; background: radial-gradient(circle, rgba(127, 176, 227, .28), transparent 62%); animation: auth-drift-b 24s ease-in-out infinite alternate; }
.auth-dots { position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1.2px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 78%); mask-image: linear-gradient(180deg, #000, transparent 78%); }
.auth-brand-logo { align-self: flex-start; animation: auth-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.auth-brand-logo:hover { text-decoration: none; }
.auth-brand-logo .logo img { height: 34px; width: auto; }
.auth-brand-copy { max-width: 30rem; animation: auth-rise .6s cubic-bezier(.2, .8, .2, 1) .08s both; }
.auth-brand-copy h2 { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.12; letter-spacing: -.025em; font-weight: 750; text-wrap: balance; }
.auth-brand-copy p { margin-top: 14px; font-size: 16px; line-height: 1.6; color: rgba(242, 244, 248, .72); }
.auth-brand-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(242, 244, 248, .62); animation: auth-rise .6s cubic-bezier(.2, .8, .2, 1) .3s both; }

/* the illustration: a chart that draws itself, and comments that arrive and are labelled */
.auth-visual { position: relative; width: min(500px, 100%); }
.auth-glass { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 24px 60px rgba(4, 8, 24, .35); }
.auth-chart-card { position: relative; padding: 14px 16px 14px; animation: auth-pop .7s cubic-bezier(.2, .8, .2, 1) .15s both; }
.auth-glass-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(242, 244, 248, .78); margin-bottom: 8px; }
.auth-illustrative { margin-left: auto; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(242, 244, 248, .5); border: 1px solid rgba(255, 255, 255, .16); border-radius: 99px; padding: 1px 8px; }
.auth-live { width: 8px; height: 8px; border-radius: 50%; background: #7fb0e3; animation: auth-pulse 2.4s ease-out infinite; }
.auth-chart { display: block; width: 100%; height: auto; }
.auth-chart-grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.auth-chart-gap { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .16); stroke-dasharray: 3 4; }
.auth-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: auth-draw 1.6s cubic-bezier(.4, 0, .2, 1) .5s forwards; }
.auth-chart-line.a { stroke: #7fb0e3; }
.auth-chart-line.b { stroke: #f08a5d; animation-delay: .8s; }
.auth-chart-line.b.late { animation-duration: .8s; animation-delay: 2.1s; }
.auth-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 11.5px; color: rgba(242, 244, 248, .66); }
.auth-legend span::before { content: ""; display: inline-block; width: 12px; height: 2px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.auth-legend .a::before { background: #7fb0e3; }
.auth-legend .b::before { background: #f08a5d; }
.auth-bubble { position: absolute; display: flex; gap: 10px; width: 282px; padding: 11px 13px; border-radius: 14px; background: rgba(20, 27, 54, .78); border: 1px solid rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px rgba(4, 8, 24, .35); }
/* the comments sit in their own row, tucked only into the card's bottom padding so its legend stays readable */
.auth-bubbles { position: relative; height: 132px; margin-top: -10px; }
.auth-bubble.b1 { left: -18px; top: 0; animation: auth-pop .6s cubic-bezier(.2, .8, .2, 1) 1.2s both, auth-float 6s ease-in-out 1.8s infinite alternate; }
.auth-bubble.b2 { right: -14px; top: 58px; animation: auth-pop .6s cubic-bezier(.2, .8, .2, 1) 1.6s both, auth-float 7s ease-in-out 2.2s infinite alternate-reverse; }
.auth-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--mono); color: #9cc3ea; background: rgba(127, 176, 227, .16); border: 1px solid rgba(127, 176, 227, .3); }
.auth-avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.auth-bubble-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.auth-skel { display: block; height: 6px; width: 92%; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .24), rgba(255, 255, 255, .12)); background-size: 200px 100%; animation: auth-shimmer 2.4s linear infinite; }
.auth-skel.short { width: 64%; }
.auth-tags { display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 3px; }
.auth-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; animation: auth-rise .4s ease-out both; }
.auth-bubble.b1 .auth-tag { animation-delay: 1.7s; } .auth-bubble.b1 .auth-tag + .auth-tag { animation-delay: 1.9s; }
.auth-bubble.b2 .auth-tag { animation-delay: 2.1s; } .auth-bubble.b2 .auth-tag + .auth-tag { animation-delay: 2.3s; }
.auth-tag.pos { color: #d3e6f8; background: rgba(85, 144, 202, .32); }
.auth-tag.neg { color: #ffd9c9; background: rgba(240, 138, 93, .26); }
.auth-tag.rel { color: #c9f2e1; background: rgba(27, 175, 122, .26); }
.auth-tag.none { color: rgba(242, 244, 248, .74); border: 1px dashed rgba(255, 255, 255, .3); }

/* the form panel */
.auth-panel { display: flex; flex-direction: column; min-height: 100vh; padding: 24px clamp(20px, 4vw, 48px); }
.auth-panel-top { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.auth-mobile-logo { display: none; }
.auth-mobile-logo:hover { text-decoration: none; }
.auth-mobile-logo .logo img { height: 28px; width: auto; }
.auth-home { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); padding: 6px 10px; border-radius: 8px; transition: background-color .15s, color .15s; }
.auth-home:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.auth-home .auth-icon { width: 16px; height: 16px; transition: transform .2s; }
.auth-home:hover .auth-icon { transform: translateX(-3px); }
.auth-host { flex: 1; display: grid; place-items: center; padding: 32px 0; }
.auth-legal { text-align: center; font-size: 12.5px; color: var(--muted); }

.auth-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-step { width: min(392px, 100%); }
.auth-step > *, .auth-form > * { animation: auth-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.auth-step > :nth-child(2) { animation-delay: .05s; }
.auth-step > :nth-child(3) { animation-delay: .1s; }
.auth-step > :nth-child(4) { animation-delay: .15s; }
.auth-form > :nth-child(1) { animation-delay: .16s; }
.auth-form > :nth-child(2) { animation-delay: .21s; }
.auth-form > :nth-child(3) { animation-delay: .26s; }
.auth-form > :nth-child(4) { animation-delay: .31s; }
.auth-form > :nth-child(n+5) { animation-delay: .36s; }
.auth-step.shake { animation: auth-shake .42s cubic-bezier(.36, .07, .19, .97); }
.auth-step-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 20px; color: var(--accent); background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.auth-step-icon .auth-icon { width: 24px; height: 24px; }
.auth-title { font-size: 30px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; }
.auth-subtitle { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.auth-form { display: grid; gap: 18px; margin-top: 28px; }

.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.auth-label-row label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.auth-label-row .link-btn { font-size: 13px; font-weight: 500; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input input { width: 100%; height: 48px; padding: 0 14px; font-size: 15px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); transition: border-color .15s, box-shadow .2s, background-color .15s; }
.auth-input.has-icon input { padding-left: 44px; }
.auth-input.has-trailing input { padding-right: 50px; }
.auth-input input::placeholder { color: var(--muted); opacity: .75; }
.auth-input input:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.auth-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.auth-input .lead { position: absolute; left: 15px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color .15s; }
.auth-input:focus-within .lead { color: var(--accent); }
.auth-input input.auth-code { font: 600 22px var(--mono); letter-spacing: .32em; text-align: center; padding-right: 44px; }
.auth-reveal { position: absolute; right: 6px; width: 38px; height: 38px; border: 0; border-radius: 9px; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.auth-reveal:hover { background: var(--hover); color: var(--ink); }
.auth-reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-reveal .auth-icon { width: 18px; height: 18px; }
.auth-caps { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; color: var(--ink-2); animation: auth-rise .25s ease-out both; }
.auth-caps::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.auth-hint { margin-top: 7px; font-size: 12.5px; color: var(--muted); }

.auth-submit { width: 100%; height: 48px; border-radius: 12px; font-size: 15px; font-weight: 600; margin-top: 4px; box-shadow: 0 8px 20px rgba(26, 33, 61, .18); transition: transform .15s, box-shadow .2s, filter .15s; }
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(26, 33, 61, .24); text-decoration: none; }
.auth-submit:active:not(:disabled) { transform: translateY(0); box-shadow: 0 4px 12px rgba(26, 33, 61, .2); }
.auth-submit.is-busy, .auth-submit.is-busy:disabled { opacity: .9; cursor: progress; }
.auth-submit.is-busy::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@media (prefers-color-scheme: dark) {
  .auth-submit, .auth-submit:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(85, 144, 202, .18); }
}
.btn.auth-secondary { width: 100%; height: 46px; border-radius: 12px; }
.auth-error:empty { display: none; }
.auth-error .notice { animation: auth-rise .3s ease-out both; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.auth-server { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.auth-server summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; border-radius: 6px; }
.auth-server summary::-webkit-details-marker { display: none; }
.auth-server summary:hover, .auth-server[open] summary { color: var(--ink-2); }
.auth-server summary .auth-icon { width: 16px; height: 16px; }
.auth-server[open] summary { margin-bottom: 14px; }
.auth-server[open] .auth-field { animation: auth-rise .3s ease-out both; }

.auth-done { text-align: center; display: grid; justify-items: center; gap: 10px; }
.auth-done h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.auth-done .auth-subtitle { margin-top: 0; }
.auth-done .btn { margin-top: 14px; }
.auth-check { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); animation: auth-pop .5s cubic-bezier(.2, .8, .2, 1) both; }
.auth-check .auth-icon { width: 34px; height: 34px; stroke-width: 2.5; }
.auth-check-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: auth-draw .5s ease-out .3s forwards; }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: flex; }
}
@media (max-height: 820px) and (min-width: 961px) {
  .auth-brand { gap: 22px; padding-block: 28px; }
  .auth-brand-copy h2 { font-size: 30px; }
  .auth-brand-copy p { font-size: 15px; margin-top: 10px; }
}
@media (max-height: 660px) and (min-width: 961px) { .auth-visual { display: none; } }
@media (max-width: 480px) {
  .auth-title { font-size: 26px; }
  .auth-host { place-items: start center; padding-top: 28px; }
}

@keyframes auth-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes auth-pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes auth-float { from { transform: translateY(0); } to { transform: translateY(-9px); } }
@keyframes auth-draw { to { stroke-dashoffset: 0; } }
@keyframes auth-drift-a { to { transform: translate(130px, 90px) scale(1.15); } }
@keyframes auth-drift-b { to { transform: translate(-110px, -70px) scale(1.1); } }
@keyframes auth-pulse { 0% { box-shadow: 0 0 0 0 rgba(127, 176, 227, .65); } 100% { box-shadow: 0 0 0 10px rgba(127, 176, 227, 0); } }
@keyframes auth-shimmer { from { background-position: -200px 0; } to { background-position: 200px 0; } }
@keyframes auth-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) {
  .auth-shell *, .auth-shell *::before, .auth-shell *::after { animation: none !important; transition: none !important; }
  .auth-chart-line, .auth-check-path { stroke-dashoffset: 0; }
}

/* checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.checklist li:last-child { border-bottom: 0; }
.step { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--axis); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.step.done { border-color: var(--good); background: var(--good); color: #fff; }

/* ------------------------------------------------------------------ charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--ink-2); font-size: 12px; }
.chart .suppressed-band { fill: var(--surface-2); }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .s1 { stroke: var(--series-1); } .chart .s2 { stroke: var(--series-2); } .chart .s3 { stroke: var(--series-3); }
.chart .f1 { fill: var(--series-1); } .chart .f2 { fill: var(--series-2); } .chart .f3 { fill: var(--series-3); }
.chart .f1-wash { fill: var(--series-1); opacity: .28; }
.chart .marker { stroke: var(--surface); stroke-width: 2; }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .bar-hit:hover + .bar, .chart .bar.hover { filter: brightness(1.12); }
.chart .zero { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend .key { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend .key.rect { height: 10px; width: 10px; border-radius: 2px; }
.legend .k1 { background: var(--series-1); } .legend .k2 { background: var(--series-2); } .legend .k3 { background: var(--series-3); }
.legend .k1-wash { background: var(--series-1); opacity: .28; }
.legend .kpos { background: var(--positive); } .legend .kneg { background: var(--negative); } .legend .kneu { background: var(--neutral); }
.legend .kband { background: var(--surface-2); border: 1px solid var(--border); }
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; min-width: 140px; }
.tooltip .t-title { color: var(--muted); margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; }
.tooltip .t-row strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.tooltip .t-key { width: 12px; height: 2px; border-radius: 2px; }
.split { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.split > span { display: block; height: 100%; min-width: 0; }
.split .pos { background: var(--positive); } .split .neg { background: var(--negative); } .split .neu { background: var(--neutral); }
.chart-toggle { font-size: 12px; }
.card-flush { padding: 0; }
.legend-key-k1 { background: var(--series-1); } .legend-key-k2 { background: var(--series-2); } .legend-key-k3 { background: var(--series-3); }
.legend-key-k1-wash { background: var(--series-1); opacity: .28; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.codes code { padding: 8px 10px; background: var(--surface-2); border-radius: 6px; text-align: center; font-size: 14px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
/* A status word inside a tile (System, stream Status) sits on one line beside its dot, smaller than a figure. */
.kpi .value > .row { flex-wrap: nowrap; font-size: 18px; line-height: 1.5; }
