:root {
  --bg: #f4f5f3; --panel: #ffffff; --ink: #1b2420; --muted: #5f6b65; --line: #dfe3df;
  --accent: #0f5c4c; --accent-ink: #ffffff; --ok: #1f7a4d; --warn: #9a6200; --bad: #b3261e;
  --ok-bg: #e3f2e9; --warn-bg: #fbf0d9; --bad-bg: #fbe4e2;
  --s0: #0f5c4c; --s1: #c2571a; --s2: #3b5ba9; --s3: #7a4b94; --grid: #e6e9e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615; --panel: #1a201e; --ink: #e6ebe8; --muted: #9aa7a1; --line: #2b3431;
    --accent: #4fb89f; --accent-ink: #08211b; --ok: #6fcf97; --warn: #e5b454; --bad: #f08a82;
    --ok-bg: #173326; --warn-bg: #3a2e12; --bad-bg: #3d1d1a;
    --s0: #4fb89f; --s1: #f0935a; --s2: #8aa5e8; --s3: #c39ad8; --grid: #27302d;
  }
}
* { box-sizing: border-box; }
html { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 0 0 .75rem; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.25rem 0 .5rem; }
h1 small, h2 small { font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: .35rem; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand span, .signin h1 span { color: var(--accent); }
.top nav { display: flex; gap: .15rem; flex: 1; flex-wrap: wrap; }
.top nav a { padding: .35rem .65rem; border-radius: 6px; text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); background: var(--bg); }
.top nav a[aria-current] { color: var(--accent); background: var(--bg); font-weight: 600; }
.who { display: flex; align-items: center; gap: .75rem; font-size: .85rem; color: var(--muted); margin: 0; }
.who em { font-style: normal; border: 1px solid var(--line); border-radius: 99px; padding: 0 .5rem; margin-left: .25rem; }

.stale { background: var(--warn-bg); color: var(--warn); padding: .5rem 1.25rem; font-size: .9rem; border-bottom: 1px solid var(--line); }
.stale a { color: inherit; margin-left: .5rem; }

main { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.note { color: var(--muted); max-width: 70rem; margin: 0 0 1rem; }
.fine { color: var(--muted); font-size: .82rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.grid2 > .card { margin: 0 0 1rem; min-width: 0; }
.grid-side { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items: start; }
.grid-side > * { min-width: 0; }
@media (max-width: 860px) { .grid-side { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.tile span { color: var(--muted); font-size: .82rem; }
.tile b { font-size: 1.55rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile b i { font-size: .8rem; font-weight: 400; font-style: normal; color: var(--muted); }
.tile small { color: var(--muted); font-size: .8rem; }

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.scroll { overflow-x: auto; }
tr.sel td { background: var(--bg); }
tr.off td { color: var(--muted); }
.detail span { display: inline-block; margin-right: .75rem; font-size: .82rem; }
.detail i { color: var(--muted); font-style: normal; }
.empty { color: var(--muted); margin: .5rem 0; }

.tag { display: inline-block; padding: 0 .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.warnbox, .okbox { border-radius: 8px; padding: .6rem .9rem; margin: 0 0 1rem; }
.warnbox { background: var(--warn-bg); color: var(--warn); }
.okbox { background: var(--ok-bg); color: var(--ok); }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: .45rem 0 .45rem 1.4rem; position: relative; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks li::before { content: ""; position: absolute; left: .2rem; top: .95rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); }
.checks li.ok::before { background: var(--ok); }
.checks li.warn::before { background: var(--warn); }
.checks li.bad::before { background: var(--bad); }

.kv { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin: 0 0 1rem; }
label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: var(--muted); }
input, select, button, .button { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .6rem; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .button { cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: underline; }
form.stack { display: flex; flex-direction: column; gap: .7rem; }
form.inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
form.inline.card { align-items: center; }
form.inline.tight { gap: .35rem; flex-wrap: nowrap; }
td form { margin: 0; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.signin { max-width: 26rem; text-align: center; padding: 2rem; }
.signin h1 { font-size: 1.6rem; margin-bottom: .5rem; }
.signin .button { margin: 1rem 0 .5rem; padding: .6rem 1.2rem; }
.dev { border-top: 1px dashed var(--line); padding-top: .75rem; }

.chart { margin: 0; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .refline { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .s0 { stroke: var(--s0); } .chart .s1 { stroke: var(--s1); } .chart .s2 { stroke: var(--s2); } .chart .s3 { stroke: var(--s3); }
.chart .dot.s0, .chart .bar.s0, .legend .k0 { fill: var(--s0); background: var(--s0); }
.chart .dot.s1, .legend .k1 { fill: var(--s1); background: var(--s1); }
.chart .dot.s2, .legend .k2 { fill: var(--s2); background: var(--s2); }
.chart .dot.s3, .legend .k3 { fill: var(--s3); background: var(--s3); }
.chart .bar { stroke: none; }
.chart .hover { stroke: var(--muted); stroke-width: 1; visibility: hidden; }
.chart .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: .7rem; height: .7rem; border-radius: 2px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--panel); font-size: .78rem; padding: .35rem .5rem; border-radius: 6px; white-space: nowrap; visibility: hidden; transform: translate(-50%, -110%); z-index: 2; }
.tip b { display: block; }
