:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  --bg: #f4f5f7; --card: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb; --grid: #eceef2;
  --accent: #16a34a; --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --run: #f97316; --ride: #2563eb; --lift: #9333ea; --other: #9ca3af; --band: rgba(22,163,74,.12);
  --nav-h: 58px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1020; --card: #141a2e; --text: #e5e7eb; --muted: #94a3b8; --line: #263049; --grid: #1e2740;
    --accent: #22c55e; --ok: #22c55e; --warn: #fbbf24; --bad: #f87171; --run: #fb923c; --ride: #60a5fa; --lift: #c084fc; --other: #64748b; --band: rgba(34,197,94,.16); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
main { padding: 0 12px calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); max-width: 860px; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; max-width: 860px; margin: 0 auto; }
.brand { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; font-weight: 600; }
h3 { font-size: 14px; margin: 12px 0 6px; }
.muted { color: var(--muted); }
.s, .small { font-size: 12px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tiles.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--bg); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 2px 0; font-variant-numeric: tabular-nums; }
.tile .v.small { font-size: 17px; }
.tile .s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--grid); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.bar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; color: #fff; background: var(--other); vertical-align: middle; }
.pill.run { background: var(--run); } .pill.ride { background: var(--ride); } .pill.lift { background: var(--lift); }
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li a { display: flex; align-items: center; gap: 10px; padding: 10px 2px; }
.list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); }
.tabs a.on { color: var(--accent); font-weight: 600; }
.tabs .ico { font-size: 18px; line-height: 1; }
button, input, select { font: inherit; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 7px 12px; font-size: 13px; }
form.inline { display: inline; }
.form label, .login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1; }
input[type=number], input[type=password], input[type=text], select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 16px; width: 100%; }
.row { display: flex; gap: 10px; margin: 8px 0; align-items: flex-end; flex-wrap: wrap; }
.flash { background: var(--band); color: var(--text); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 12px; margin: 0 12px; font-size: 13px; }
.notice { background: rgba(251,191,36,.12); border: 1px solid var(--warn); border-radius: 10px; padding: 8px 12px; margin: 8px 12px; font-size: 13px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
pre { overflow-x: auto; background: var(--bg); padding: 8px; border-radius: 8px; }
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--bg); }
td.nowrap { white-space: nowrap; }
.chips { display: flex; gap: 8px; margin: 8px 0; overflow-x: auto; }
.chips a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--card); white-space: nowrap; }
.chips a.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 6px 2px; font-size: 14px; }
.pager a { color: var(--accent); font-weight: 600; }
.setrow { display: flex; flex-wrap: wrap; gap: 6px; }
.set { background: var(--bg); border-radius: 8px; padding: 4px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.foot { text-align: center; font-size: 12px; margin: 14px 0; }
body.center { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.center-row { display: flex; justify-content: center; margin: 16px 0; }
details summary { cursor: pointer; font-size: 13px; margin: 8px 0; }
canvas { width: 100% !important; margin-top: 8px; }

.verdict-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 4px 0 6px; }
.verdict.raise .verdict-title { color: var(--ok); } .verdict.hold .verdict-title { color: var(--warn); } .verdict.noisy .verdict-title { color: var(--muted); }
tr.faded td { color: var(--muted); }

.prose { font-size: 15px; line-height: 1.55; }
.prose h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 14px 0 6px; }
.prose ul { padding-left: 18px; margin: 4px 0; } .prose li { margin: 3px 0; } .prose p { margin: 6px 0; }
.ghost-link { color: var(--accent); font-size: 13px; padding: 7px 0; }
