/* Camel Rush Konsole. Night-blue desert sky, fairground gold as the only brand accent, status colours only for
   traffic lights. Data colours: validated categorical palette (blue, orange, aqua) for light and dark. */
@font-face { font-family: "Lilita One"; src: url("fonts/LilitaOne-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  color-scheme: light;
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #f5f7fb; --hover: #eaeef5; --line: #dde2ea; --line-strong: #c3cbd8;
  --ink: #0f1724; --ink-2: #485267; --muted: #6f798c;
  --gold: #a86a12; --gold-fill: #f2b544; --gold-ink: #241500; --brand: #c8312a;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s1-wash: rgba(42,120,214,.10);
  --good: #0ca30c; --good-ink: #006300; --warn: #fab219; --warn-ink: #8a5a00; --serious: #ec835a; --crit: #d03b3b; --crit-ink: #b42323;
  --seq-0: #f3f7fd; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95;
  --shadow: 0 10px 30px rgba(15,23,36,.16);
  --r-lg: 16px; --r-md: 10px; --r-sm: 7px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: "Lilita One", var(--font);
  --nav-w: 248px; --tab-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0d1320; --surface: #141c2b; --surface-2: #1a2436; --hover: #1f2a3e; --line: #243049; --line-strong: #34435f;
    --ink: #edf1f7; --ink-2: #b1bbcc; --muted: #8995aa;
    --gold: #f2b544; --gold-fill: #f2b544; --gold-ink: #241500; --brand: #e5483f;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s1-wash: rgba(57,135,229,.14);
    --good-ink: #3ccf3c; --warn-ink: #fab219; --crit-ink: #ff7a7a;
    --seq-0: #172235; --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #256abf; --seq-4: #3987e5; --seq-5: #6da7ec; --seq-6: #9ec5f4;
    --shadow: 0 14px 40px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1320; --surface: #141c2b; --surface-2: #1a2436; --hover: #1f2a3e; --line: #243049; --line-strong: #34435f;
  --ink: #edf1f7; --ink-2: #b1bbcc; --muted: #8995aa;
  --gold: #f2b544; --gold-fill: #f2b544; --gold-ink: #241500; --brand: #e5483f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s1-wash: rgba(57,135,229,.14);
  --good-ink: #3ccf3c; --warn-ink: #fab219; --crit-ink: #ff7a7a;
  --seq-0: #172235; --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #256abf; --seq-4: #3987e5; --seq-5: #6da7ec; --seq-6: #9ec5f4;
  --shadow: 0 14px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.num, table td.n, .tab-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- shell */
.shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); box-shadow: 0 1px 0 var(--line);
  border-bottom: 1px solid var(--line); padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; display: flex; align-items: center; gap: 10px; }
.topbar .title { font: 24px/1.1 var(--display); letter-spacing: .2px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.testband { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 12.5px; font-weight: 600; color: var(--gold-ink);
  background: repeating-linear-gradient(135deg, var(--gold-fill) 0 14px, color-mix(in srgb, var(--gold-fill) 82%, #fff) 14px 28px); }
.testband svg { flex: none; }
.content { padding: 16px; max-width: 1320px; margin: 0 auto; display: grid; gap: 16px; }

.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface);
  border-top: 1px solid var(--line); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; text-decoration: none;
  color: var(--muted); background: none; border: 0; padding: 6px 0 4px; position: relative; }
.tabbar [aria-current="page"] { color: var(--ink); }
.tabbar [aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.tabbar .dot { position: absolute; top: 7px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--surface); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--nav-w) 1fr; }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; min-width: 0; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 18px 12px; gap: 4px; }
  .topbar { padding: 14px 28px; }
  .topbar .title { font-size: 28px; }
  .content { padding: 22px 28px; gap: 20px; }
  .testband { padding: 6px 28px; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand b { font: 21px/1 var(--display); display: block; }
.brand span { font-size: 12px; color: var(--muted); }
.navgroup { font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 12px 4px; }
.navlink { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-weight: 550; position: relative; }
.navlink:hover { background: var(--hover); color: var(--ink); }
.navlink[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.navlink[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.navlink .badge { margin-left: auto; }
.sidebar .foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13px; }

/* ---------------------------------------------------------------- building blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; min-width: 0; }
.panel > header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.panel > header h2 { font-size: 16px; font-weight: 700; }
.panel > header p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.panel > header .grow { flex: 1; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > header { padding: 16px 16px 0; }
.section-title { font: 20px/1.15 var(--display); margin: 6px 2px -4px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .g2, .g-21, .g-12 { align-items: start; } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g-21 { grid-template-columns: 2fr 1fr; } .g-12 { grid-template-columns: 1fr 2fr; } }
@media (min-width: 1100px) { .g4 { grid-template-columns: repeat(4, 1fr); } }

/* KPI strip: one surface, hairline dividers (not a row of identical cards) */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kpis > * { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.kpis > *:nth-child(2n) { border-right: 0; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis > *:nth-child(2n) { border-right: 1px solid var(--line); } .kpis > *:nth-child(4n) { border-right: 0; } }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis.k3 > * { border-right: 1px solid var(--line); } .kpis.k3 > *:nth-child(3n) { border-right: 0; }
@media (max-width: 759px) { .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis.k3 > *:nth-child(3n) { border-right: 1px solid var(--line); } .kpis.k3 > *:nth-child(2n) { border-right: 0; } }
.tile { display: flex; flex-direction: column; gap: 2px; text-decoration: none; position: relative; }
a.tile:hover { background: var(--hover); }
.tile .label { font-size: 13px; color: var(--ink-2); font-weight: 550; display: flex; gap: 6px; align-items: center; }
.tile .value { font-size: 25px; font-weight: 700; letter-spacing: -.3px; line-height: 1.15; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
.tile .spark { margin-top: 6px; height: 28px; }
.delta { font-size: 12.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.delta.good { color: var(--good-ink); } .delta.bad { color: var(--crit-ink); } .delta.flat { color: var(--muted); }

/* Hero: the state of the game in one sentence */
.hero { display: grid; gap: 12px; padding: 18px 18px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background:
  radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--gold-fill) 16%, transparent), transparent 55%), var(--surface); }
.hero .when { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero h2 { font: 24px/1.2 var(--display); letter-spacing: .1px; display: flex; gap: 10px; align-items: flex-start; }
.hero h2 svg { flex: none; margin-top: 2px; }
@media (min-width: 960px) { .hero h2 { font-size: 30px; } .hero { padding: 22px 24px; } }

.lights { display: grid; }
.light { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 12px; align-items: start; padding: 12px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.light:first-child { border-top: 0; }
a.light:hover { background: var(--hover); border-radius: 10px; }
.light .t { font-weight: 650; }
.light .v { font-weight: 700; text-align: right; white-space: nowrap; }
.light .d { grid-column: 2 / 4; font-size: 13px; color: var(--ink-2); }
.light .th { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 650; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.chip.good { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.chip.warn { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.chip.crit { color: var(--crit-ink); border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); background: color-mix(in srgb, var(--crit) 10%, var(--surface)); }
.chip.gold { color: var(--gold-ink); background: var(--gold-fill); border-color: transparent; }
.chip.blue { color: var(--s1); border-color: color-mix(in srgb, var(--s1) 40%, var(--line)); background: var(--s1-wash); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: var(--crit); color: #fff; }

/* period switch */
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; gap: 2px; flex: none; }
.seg button { white-space: nowrap; border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.gold { background: var(--gold-fill); color: var(--gold-ink); border-color: transparent; }
.btn.danger { color: var(--crit-ink); border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; }
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--gold) 70%, transparent); outline-offset: 0; border-color: var(--gold); }
.form { display: grid; gap: 14px; }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 550; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.error { color: var(--crit-ink); font-size: 13.5px; font-weight: 600; }
.note { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.note.gold { border-color: color-mix(in srgb, var(--gold-fill) 55%, var(--line)); background: color-mix(in srgb, var(--gold-fill) 12%, var(--surface)); }

/* tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--hover); }
table.sticky th:first-child, table.sticky td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
td .bar { height: 6px; border-radius: 3px; background: var(--s1); min-width: 2px; }

/* heat table (cohorts) */
table.heat td.cell { text-align: center; font-weight: 650; border: 2px solid var(--surface); border-radius: 6px; min-width: 52px; }
table.heat td.cell.dark { color: #fff; } table.heat td.cell.empty { color: var(--muted); font-weight: 400; }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .base { stroke: var(--line-strong); }
.chart .target line { stroke: var(--ink-2); stroke-dasharray: 0; stroke-width: 1; opacity: .55; }
.chart .target text { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; opacity: 0; }
.chart:hover .cross { opacity: .6; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; vertical-align: 3px; }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; font-size: 12.5px;
  box-shadow: var(--shadow); min-width: 140px; opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.tip .h { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tip .r { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tip .r b { font-variant-numeric: tabular-nums; }
.tip .r i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(96px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .lab { color: var(--ink-2); line-height: 1.25; overflow-wrap: anywhere; }
.hbar .track { height: 12px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--s1); }
.hbar .val { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
.funnel .hbar { grid-template-columns: minmax(118px, 34%) 1fr auto; }
.funnel .step { font-size: 12px; color: var(--muted); grid-column: 2 / 4; margin-top: -6px; }
.div-bars { display: grid; gap: 7px; }
.div-row { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.div-row .l, .div-row .r { height: 12px; position: relative; }
.div-row .l span { position: absolute; right: 0; top: 0; bottom: 0; background: var(--s2); border-radius: 4px 0 0 4px; }
.div-row .r span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); border-radius: 0 4px 4px 0; }
.div-row .m { text-align: center; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 8px; border-radius: 4px; background: var(--seq-1); overflow: hidden; } .meter span { display: block; height: 100%; background: var(--s1); border-radius: 4px; }

/* lists */
.list { display: grid; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); text-decoration: none; min-width: 0; }
.item:first-child { border-top: 0; }
a.item:hover { background: var(--hover); }
.item .main-t { flex: 1; min-width: 0; }
.item .main-t b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .main-t span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-state { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }

/* experiments */
.exp { display: grid; gap: 12px; }
.exp + .exp { border-top: 1px solid var(--line); padding-top: 16px; }
.variant-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.variant-row .vid { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); }
.ci { position: relative; height: 18px; }
.ci .zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.ci .range { position: absolute; top: 6px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--s1) 45%, transparent); }
.ci .point { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--s1); border: 2px solid var(--surface); }

/* dialogs: bottom sheet on phones, centred on desktop */
dialog { border: 0; padding: 0; background: var(--surface); color: var(--ink); border-radius: 18px 18px 0 0; width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5,9,16,.55); backdrop-filter: blur(2px); }
dialog .dlg { display: grid; gap: 14px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
dialog .dlg h3 { font: 22px/1.15 var(--display); }
dialog .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: -6px auto 0; }
@media (min-width: 700px) { dialog { margin: auto; border-radius: 18px; max-width: 560px; } dialog .grip { display: none; } }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
@media (min-width: 960px) { .toast { bottom: 24px; } }

/* sign-in */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--gold-fill) 22%, transparent), transparent 60%), radial-gradient(60% 50% at 50% 110%, color-mix(in srgb, var(--brand) 18%, transparent), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.auth-card .mark { display: grid; justify-items: center; gap: 10px; text-align: center; }
.auth-card .mark img { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); }
.auth-card .mark h1 { font: 34px/1 var(--display); }
.auth-card .mark p { color: var(--ink-2); font-size: 14px; }
.auth-card .panel { padding: 20px; display: grid; gap: 14px; }
.otp { letter-spacing: 8px; font-size: 26px !important; text-align: center; font-variant-numeric: tabular-nums; height: 54px !important; }
.qr { width: 196px; height: 196px; border-radius: 12px; background: #fff; padding: 8px; justify-self: center; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; } .or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* players */
.pcard { display: grid; gap: 10px; }
.pcard .who { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.timeline { display: grid; }
.ev { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ev:first-child { border-top: 0; }
.ev time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.dayhead { font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 12px 0 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }

/* push preview */
.phone-note { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.phone-note img { width: 34px; height: 34px; border-radius: 8px; }
.phone-note b { font-size: 14px; } .phone-note p { font-size: 13.5px; color: var(--ink-2); }

.skeleton { opacity: .55; transition: opacity .2s; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px 0; }

/* page: today */
.today-top { display: grid; gap: 16px; grid-template-areas: "kpis" "lights";   /* Handy: Leitzahlen zuerst */ }
@media (min-width: 1100px) { .today-top { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-areas: "lights kpis"; align-items: start; } }
table.heat td.cell[data-s="0"], table.heat td.cell[data-s="1"], table.heat td.cell[data-s="2"], table.heat td.cell[data-s="3"] { color: var(--ink); }
table.heat td.cell[data-s="4"], table.heat td.cell[data-s="5"], table.heat td.cell[data-s="6"] { color: #fff; }
:root[data-theme="dark"] table.heat td.cell[data-s="5"], :root[data-theme="dark"] table.heat td.cell[data-s="6"] { color: #0d1320; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) table.heat td.cell[data-s="5"], :root:where(:not([data-theme="light"])) table.heat td.cell[data-s="6"] { color: #0d1320; } }
table.heat td:first-child, table.heat th:first-child { white-space: nowrap; }
.item.stack { flex-wrap: wrap; row-gap: 8px; }
.item.stack .main-t b, .item.stack .main-t span { white-space: normal; overflow: visible; }
.item .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }
@media (max-width: 640px) { .item.stack .main-t { flex: 1 1 calc(100% - 44px); } .item.stack .acts { width: 100%; padding-left: 32px; } }
.knob { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 2px 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.knob:first-child { border-top: 0; }
.knob .k { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.knob .v { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.knob .d { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }

/* definitions, filters, scroll hints, csv */
.info { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--muted); font: 700 11px/1 var(--font); cursor: pointer; flex: none; padding: 0; }
.info[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tile .def { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 6px; line-height: 1.4; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filter { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.filter select { height: 36px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 30px 0 10px; font-size: 14px; color: var(--ink); }
.scrollbox { position: relative; }
.scrollbox.more::after { content: ""; position: absolute; top: 0; right: -16px; bottom: 0; width: 36px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--surface)); }
.scrollhint { position: absolute; right: -4px; bottom: 4px; z-index: 2; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; pointer-events: none; }
.csv { margin-top: 6px; }
@media (max-width: 640px) { .hide-sm { display: none; } }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 650; padding: 10px 0; }
details.fold > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
.ci { overflow: hidden; }
.ev span, .item.audit .main-t span { white-space: normal; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; }
.codes span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; text-align: center; }

/* phones: tables become cards (label left, value right); decisions stay visible without sideways scrolling */
@media (max-width: 640px) {
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
  table.cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 4px 0; text-align: right; position: static !important; }
  table.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; flex: none; max-width: 45%; }
  table.cards td:first-child { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  table.cards td:first-child::before, table.cards td[data-label=""]::before { content: none; }
  table.cards td[data-label=""] { justify-content: flex-end; }
  table.cards tr.link { cursor: pointer; }
  .tablewrap:has(table.cards) { overflow: visible; margin: 0; padding: 0; }
  .hero h2 { font-size: 20px; }
  .hero { padding: 14px 14px 12px; gap: 8px; }
  .btn.small.ghost { min-width: 40px; min-height: 40px; }
  .light .d, .light .th { grid-column: 1 / 4; }
}
.light.na { opacity: .85; }

/* round 4: roles, notes, jump links, warnings */
html[data-role="viewer"] .w { display: none !important; }
.note.warn { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: var(--ink); }
.note > svg:first-child { vertical-align: -3px; }
.pcard .pseudo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pcard .pseudo b { font-size: 15px; }
.jumps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px -2px 0; padding: 2px; }
.jumps::-webkit-scrollbar { display: none; }
.jumps button { flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 600 13px/1 var(--sans, inherit); cursor: pointer; }
.jumps button:hover { color: var(--ink); border-color: var(--ink-3, var(--line)); }
.hero .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hero .chips a { text-decoration: none; }
.queue .item { align-items: flex-start; }
@media (max-width: 600px) {
  .panel > header { flex-wrap: wrap; }
  .panel > header > .grow { flex-basis: 100%; }
}
.panel { scroll-margin-top: 72px; }
.lights.compact .light .th { display: none; }
@media (max-width: 600px) { .lights.compact .light.ok .d, .lights.compact .light.na .d { display: none; } }
button.more { margin-top: 8px; }
table.cards tr[hidden] { display: none !important; }
.diff-v { white-space: normal !important; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  details.filterfold > summary { padding: 4px 0 8px; }
}
/* Lange Wörter (Spaltenlisten, Dateinamen, Links) brechen um statt die Seite am Handy seitlich zu verbreitern. */
.content { overflow-wrap: break-word; }
.content p, .content .small, .content .note { overflow-wrap: break-word; }
.content > * { min-width: 0; }
/* Zahlenzellen bleiben einzeilig, ihre Detailzeilen (Originalwährungen, Bänder) dürfen umbrechen. */
td.n .small { white-space: normal; }
/* «Heute»: weitere Kennzahlen aufklappbar unter den vier Leitzahlen. */
details.more-kpis { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg, 16px); padding: 12px 16px; }
details.more-kpis > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
details.green-lights > summary { cursor: pointer; padding: 10px 4px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
