/* True Odds stats. Colours as tokens (the dataviz reference palette's chart roles), light and
   dark selected separately. No external fonts or scripts (the page's CSP allows none). */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.1);
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --seq-1: #cde2fb;
  --seq-2: #86b6ef;
  --seq-3: #3987e5;
  --seq-4: #1c5cab;
  --seq-5: #0d366b;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --critical: #d03b3b;
  --accent: #0f5f3a;
  --accent-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #9a988f;
    --grid: #2c2c2a;
    --axis: #383835;
    --ring: rgba(255, 255, 255, 0.1);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --seq-1: #184f95;
    --seq-2: #1c5cab;
    --seq-3: #2a78d6;
    --seq-4: #5598e7;
    --seq-5: #9ec5f4;
    --good-ink: #0ca30c;
    --accent: #2f9e6b;
    --accent-ink: #0b0b0b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #9a988f;
  --grid: #2c2c2a;
  --axis: #383835;
  --ring: rgba(255, 255, 255, 0.1);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --seq-1: #184f95;
  --seq-2: #1c5cab;
  --seq-3: #2a78d6;
  --seq-4: #5598e7;
  --seq-5: #9ec5f4;
  --good-ink: #0ca30c;
  --accent: #2f9e6b;
  --accent-ink: #0b0b0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 18px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--ink-2); }
button {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover { background: var(--surface-2); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.primary:disabled { opacity: 0.6; cursor: progress; }
button.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--ring);
}
.brand { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--surface) 0 30%, var(--accent) 31% 100%);
  box-shadow: inset 0 0 0 3px var(--accent);
}
.env {
  font-size: 12px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--ring); border-radius: 999px; padding: 1px 8px;
}
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ranges { display: inline-flex; border: 1px solid var(--ring); border-radius: 8px; overflow: hidden; }
.ranges button { border: 0; border-radius: 0; background: var(--surface); }
.ranges button + button { border-left: 1px solid var(--ring); }
.ranges button[aria-pressed="true"] { background: var(--surface-2); font-weight: 650; }
.who { color: var(--ink-2); font-size: 13px; }

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--ring);
  scrollbar-width: thin;
}
.tabs a {
  flex: none;
  padding: 10px 12px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
.tabs .dot {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 999px; background: var(--critical); color: #fff; font-size: 11px; text-align: center;
}

.status { margin: 0; padding: 0 24px; min-height: 0; color: var(--ink-2); font-size: 13px; }
.status:not(:empty) { padding: 8px 24px; background: var(--surface-2); }

main { padding: 20px 24px 8px; max-width: 1360px; margin: 0 auto; }
.gate { max-width: 460px; margin: 12vh auto; text-align: center; }
.gate p { color: var(--ink-2); }

.section { margin: 0 0 28px; }
.section > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 10px; }
.section > header p { margin: 0; color: var(--muted); font-size: 13px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile, .card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 0;
}
.tile .label { color: var(--ink-2); font-size: 13px; }
.tile .value { font-size: 28px; font-weight: 650; line-height: 1.2; margin: 4px 0 2px; }
.tile .sub { color: var(--muted); font-size: 12px; }
.tile .delta { font-size: 12px; color: var(--ink-2); }
.tile .delta.up { color: var(--good-ink); }
.tile .delta.down { color: var(--critical); }
.tile.na .value { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 16px; margin-bottom: 24px; }
.tiles + .grid, .section > .tiles { margin-bottom: 24px; }
.section > .grid:last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 4px; }
.about { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.card .about { margin: 0 0 8px; }
.card.note { border-style: dashed; }
.card.note p { margin: 0; color: var(--ink-2); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 6px; font-size: 12px; color: var(--ink-2); }
.legend span::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: -1px; background: var(--sw);
}
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { fill: var(--muted); font-size: 11px; }
svg.chart .label { fill: var(--ink-2); font-size: 11px; }
svg.chart .grid { stroke: var(--grid); stroke-width: 1; }
svg.chart .axis { stroke: var(--axis); stroke-width: 1; }
svg.chart .hit { fill: transparent; }
svg.chart .cross { stroke: var(--axis); stroke-width: 1; }

.tip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ring); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding: 8px 10px; font-size: 12px; max-width: 280px;
}
.tip strong { display: block; margin-bottom: 2px; }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip .row i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--ink-2); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
td.heat { text-align: center; font-variant-numeric: tabular-nums; }

.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 32%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.bar-row .v { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.problems li {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--ring); border-left: 4px solid var(--critical);
  border-radius: 8px; padding: 10px 12px;
}
.problems li .icon { color: var(--critical); font-weight: 700; }
.problems li small { display: block; color: var(--muted); }
.clear {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--ring); border-left: 4px solid var(--good);
  border-radius: 8px; padding: 10px 12px;
}
.clear .icon { color: var(--good-ink); font-weight: 700; }

/* Bug reports: a report's note wraps in its cell, its log lines open under its row. */
.muted { color: var(--muted); }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.report-note { display: inline-block; white-space: normal; min-width: 240px; max-width: 520px; }
.logs-row td { white-space: normal; background: var(--surface); }
.logs-row .report-note { max-width: none; margin: 4px 0; }
pre.logs {
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; margin: 8px 0 4px;
  padding: 10px 12px; border-radius: 6px; background: var(--surface-2);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* The Health tab's rows whose runs and times came from Lambda's metrics. */
.from-metrics { color: var(--muted); font-size: 12px; margin-left: 4px; }

.foot { color: var(--muted); font-size: 12px; padding: 8px 24px 32px; max-width: 1360px; margin: 0 auto; }
.foot p { margin: 4px 0; }

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  main { padding: 16px 16px 8px; }
  .status:not(:empty) { padding: 8px 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .value { font-size: 22px; }
  .bar-row { grid-template-columns: minmax(90px, 38%) 1fr auto; }
  .foot { padding: 8px 16px 24px; }
}
