  /* Layout: turbopuffer's system. Hero = verdict on the left, a double-line "latest run" box on the right with a dithered shadow. Below, single-line boxes with their label on the border: system status (history, aligned run columns, ASCII tree), faults, response times (their perf-chart form). */
  :root {
    --paper: #f9fafc; --panel: #ffffff; --band: #f1f5f9; --ink: #0f172a; --ink-2: #475569; --ink-3: #94a3b8; --soft: #cbd5e1; --dither: #94a3b8;
    --ok: #059669; --bad: #dc2626; --empty: #e2e8f0; --thin: #64748b;
    --peach: #fdba74; --peach-ink: #431407;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #0f172a; --panel: #0f172a; --band: #1e293b; --ink: #f8fafc; --ink-2: #cbd5e1; --ink-3: #64748b; --soft: #334155; --dither: #475569;
      --ok: #34d399; --bad: #f87171; --empty: #1e293b; --thin: #94a3b8;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --paper: #0f172a; --panel: #0f172a; --band: #1e293b; --ink: #f8fafc; --ink-2: #cbd5e1; --ink-3: #64748b; --soft: #334155; --dither: #475569;
    --ok: #34d399; --bad: #f87171; --empty: #1e293b; --thin: #94a3b8;
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  html, body { background: var(--paper); }
  body { margin: 0; color: var(--ink); font-family: var(--mono); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
  .page { max-width: 900px; margin: 0 auto; padding-block: 24px 96px; padding-inline: 20px; }
  button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
  a { color: inherit; }

  /* nav */
  .nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--soft); }
  .logo { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
  .logo span { font-weight: 400; color: var(--ink-3); }
  .nav .r { display: flex; gap: 20px; color: var(--ink-2); font-size: 13px; }

  /* hero */
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: center; padding-block: 40px 36px; }
  .chip { display: inline-block; background: var(--peach); color: var(--peach-ink); border: 1px solid var(--peach-ink); border-radius: 3px; padding: 2px 10px; font-size: 13px; font-weight: 600;
          box-shadow: inset 1px 1px 0 rgba(255,255,255,.4), inset -1px -1px 0 rgba(0,0,0,.3), 2px 2px 0 rgba(0,0,0,.2); }
  .chip.ok { background: var(--ok); color: #fff; border-color: #064e3b; }
  h1 { font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -.03em; margin: 18px 0 12px; text-wrap: balance; }
  .hero p { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 44ch; }
  .hero .when { margin-top: 16px; font-size: 12.5px; color: var(--ink-3); }
  @media (max-width: 760px) { .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 28px; } }

  /* boxes: dithered shadow behind, label on the border */
  .win { position: relative; }
  .win::before { content: ""; position: absolute; left: 7px; top: 7px; right: -7px; bottom: -7px; background: repeating-conic-gradient(var(--dither) 0 25%, transparent 0 50%) 0 0 / 2px 2px; }
  .box { position: relative; background: var(--panel); border: 2px solid var(--ink); padding: 24px 20px 18px; }
  .box.double { border: 6px double var(--ink); padding: 22px 18px 16px; }
  .legend { position: absolute; top: -.8em; left: 14px; background: var(--panel); padding: 0 8px; font-weight: 600; font-size: 14px; line-height: 1.5; }
  .legend-r { position: absolute; top: -.75em; right: 14px; background: var(--panel); padding: 0 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
  .double .legend, .double .legend-r { top: -1.05em; }
  .section { margin-top: 44px; }

  /* latest-run map */
  .mrow { display: grid; grid-template-columns: 13ch minmax(0, 1fr); gap: 12px; align-items: center; padding: 4px 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
  .mcells { display: flex; gap: 3px; }
  .mcells .c { width: 15px; height: 15px; flex: none; display: block; background: var(--ok); }
  .mcells .c.bad { background: var(--bad); }
  .mcells .c:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
  .mkey { display: flex; gap: 16px; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
  .mkey i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: 0; }

  /* the centred rule under the hero */
  .rule { display: flex; align-items: center; gap: 16px; color: var(--ink-2); font-size: 13px; }
  .rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--soft); }

  /* system status */
  .grid-row { display: grid; grid-template-columns: 250px minmax(0, 1fr) 84px; gap: 16px; align-items: center; }
  .grp { width: 100%; padding: 9px 0; border-top: 1px dashed var(--soft); }
  .grp:first-child { border-top: 0; padding-top: 2px; }
  .grp .n { font-weight: 600; display: flex; gap: 10px; align-items: baseline; min-width: 0; }
  .grp .n .t { color: var(--ink-3); font-weight: 400; }
  .st { text-align: right; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
  .st.bad { color: var(--bad); font-weight: 600; }
  .kids { display: none; padding-bottom: 8px; }
  .open + .kids { display: block; }
  .kid { padding: 3px 0; font-size: 13px; }
  .kid .n { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kid .n b { font-weight: 400; color: var(--ink-3); margin-right: 8px; }
  .kid.bad .n { color: var(--ink); }
  .strip { display: flex; gap: 2px; }
  .strip i { flex: 1 1 0; height: 18px; background: var(--ok); }
  .strip i.bad { background: var(--bad); }
  .strip i.skip, .mcells .c.skip { background: var(--thin); }
  .strip i.none { background: repeating-conic-gradient(var(--empty) 0 25%, transparent 0 50%) 0 0 / 4px 4px; }
  .kid .strip i { height: 12px; }
  .axis { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
  .axis .s { display: flex; justify-content: space-between; }
  @media (max-width: 680px) {
    .grid-row { grid-template-columns: minmax(0, 1fr) auto; }
    .grid-row .strip { grid-column: 1 / -1; grid-row: 2; }
    .axis { display: none; }
  }

  /* faults */
  .fault { padding: 14px 0; border-top: 1px dashed var(--soft); display: grid; grid-template-columns: 3ch minmax(0, 1fr); gap: 2px 14px; scroll-margin-top: 24px; }
  .fault:first-child { border-top: 0; padding-top: 2px; }
  .fault .no { color: var(--bad); font-weight: 800; }
  .fault .h { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-weight: 600; }
  .fault .h span { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
  .fault dl { grid-column: 2; margin: 6px 0 0; display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: 3px 12px; font-size: 13px; }
  .fault dt { color: var(--ink-3); }
  .fault dd { margin: 0; color: var(--ink-2); }
  .fault a { text-decoration: underline dotted; text-underline-offset: 3px; color: var(--ink); }
  @media (max-width: 560px) { .fault dl { grid-template-columns: 1fr; gap: 0; } .fault dt { margin-top: 6px; } }

  /* response times: turbopuffer's perf-chart form */
  .perf-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--soft); font-size: 13px; }
  .perf-head b { font-weight: 600; }
  .perf-head span { color: var(--ink-2); }
  .prow { display: grid; grid-template-columns: 27ch minmax(0, 1fr) 7ch; gap: 14px; align-items: center; padding: 12px 0 0; }
  .prow .l { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
  .prow .l b { display: block; color: var(--ink); font-weight: 600; }
  .bars { display: grid; gap: 4px; }
  .bars .thin { height: 4px; background: var(--thin); }
  .bars .thick { height: 14px; background: var(--ink); }
  .vals { text-align: right; font-size: 12.5px; line-height: 1.4; }
  .vals .a { color: var(--ink-3); }
  .vals .b { font-weight: 600; }
  .perf-key { display: flex; justify-content: flex-end; gap: 22px; margin-top: 16px; font-size: 12.5px; color: var(--ink-2); }
  .perf-key i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; vertical-align: 0; }
  .perf-key span { text-decoration: underline dotted; text-underline-offset: 4px; text-decoration-color: var(--ink-3); }
  .perf-foot { margin: 18px -20px -18px; padding: 12px 20px; background: var(--band); font-size: 12.5px; color: var(--ink-2); }
  @media (max-width: 560px) { .prow { grid-template-columns: minmax(0, 1fr) 7ch; } .prow .bars { grid-column: 1 / -1; grid-row: 2; } }

  .foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--soft); color: var(--ink-3); font-size: 12px; display: grid; gap: 4px; }

  /* buttons (turbopuffer's: square corners, ink border, bevel) */
  .btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); border-radius: 3px; padding: 4px 12px; font-size: 13px; font-weight: 600; background: var(--band); color: var(--ink);
         box-shadow: inset 1px 1px 0 rgba(255,255,255,.4), inset -1px -1px 0 rgba(0,0,0,.25), 2px 2px 0 rgba(0,0,0,.18); cursor: pointer; }
  .btn.primary { background: var(--peach); color: var(--peach-ink); border-color: var(--peach-ink); }
  .btn:disabled { opacity: .6; cursor: default; }
  .btn:focus-visible, input:focus-visible, .link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .link { font-size: 13px; color: var(--ink-2); text-decoration: underline dotted; text-underline-offset: 4px; cursor: pointer; }
  .nav .r { align-items: center; }
  .chip.down { background: var(--bad); color: #fff; border-color: #450a0a; }
  .chip.idle { background: var(--band); color: var(--ink-2); border-color: var(--soft); box-shadow: none; }
  .running { font-size: 12.5px; color: var(--ink-2); }
  .logo, .nav .r > *, .btn { white-space: nowrap; }
  @media (max-width: 520px) { .nav .r { gap: 14px; } .nav .running { display: none; } }

  /* sign-in pages */
  .auth { max-width: 440px; margin: 72px auto 0; }
  .auth h1 { font-size: 24px; margin: 0 0 6px; }
  .auth p { color: var(--ink-2); margin: 0 0 20px; font-size: 13.5px; }
  .field { display: grid; gap: 6px; margin-bottom: 16px; }
  .field label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
  .field input { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--ink); border-radius: 3px; padding: 9px 10px; width: 100%; }
  .field .hint { font-size: 12px; color: var(--ink-3); }
  .check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }
  .msg { font-size: 13px; padding: 10px 12px; border: 1px solid var(--soft); background: var(--band); margin-bottom: 16px; }
  .msg.err { border-color: var(--bad); color: var(--bad); background: transparent; }
  .row-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
