:root { --bg: #f4f6fa; --panel: #fff; --ink: #0b1220; --ink-2: #44506a; --ink-3: #5f6b82; --line: #d9dfea; --brand: #0b1220;
  --cta: #1172D9; --cta-h: #0e62bb; --gold: #c9a227; --ok: #137a3f; --warn: #8a5a00; --bad: #b42318; --focus: #1172D9; --r: 10px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--cta-h); }   /* #0e62bb: 5.4:1 on the page background; the lighter brand blue is for buttons */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-3); } .pad { padding: 24px; } .small { font-size: 13px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 20px; background: var(--brand); color: #fff; }
.brand { font-weight: 700; letter-spacing: .02em; } .brand b { color: var(--gold); font-weight: 700; }
nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
nav a { color: #dbe3f0; text-decoration: none; padding: 8px 10px; border-radius: 8px; min-height: 40px; display: inline-flex; align-items: center; }
nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }
nav a:hover { color: #fff; }
.who { color: #dbe3f0; font-size: 13px; }
.mode { background: #fff4d6; color: #5c3d00; padding: 8px 20px; font-size: 14px; border-bottom: 1px solid #f0d78c; }
.mode.live { background: #fde7e7; color: #7a1010; border-color: #f3b5b5; }
main { max-width: 1240px; margin: 0 auto; padding: 20px; outline: none; }
h1 { font-size: 24px; margin: 4px 0 16px; } h2 { font-size: 18px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 16px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.tile .n { font-size: 28px; font-weight: 700; line-height: 1.1; } .tile .l { color: var(--ink-2); font-size: 13px; }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; } @media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 0;
  background: var(--cta); color: #fff; font: 600 15px system-ui, sans-serif; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--cta-h); } .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; } .bar .btn.ghost { color: #fff; }
.btn.danger { background: var(--bad); } .btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.link { background: none; color: var(--cta-h); padding: 0; min-height: 0; text-decoration: underline; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
input, select, textarea { font: 15px system-ui, sans-serif; min-height: 40px; padding: 6px 10px; border: 1px solid #b9c2d3; border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%; }
textarea { min-height: 160px; width: 100%; } input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 6px 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 220px; }
th { background: #eef2f8; font-weight: 600; } th button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
tbody tr:hover { background: #f7f9fc; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e8edf5; color: #2c3a55; }
.pill.ok { background: #e3f4ea; color: var(--ok); } .pill.warn { background: #fff1d6; color: var(--warn); } .pill.bad { background: #fde7e7; color: var(--bad); }
.err { color: var(--bad); font-weight: 600; } .ok { color: var(--ok); font-weight: 600; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
dl.kv { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 14px; margin: 0; } dl.kv dt { color: var(--ink-2); } dl.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 560px) { dl.kv { grid-template-columns: 1fr; } dl.kv dd { margin-bottom: 6px; } main { padding: 12px; } }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 8px; border-bottom: 1px solid #b9c2d3; }
.chart .b { flex: 1; background: var(--cta); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.chart .b:hover, .chart .b:focus { background: var(--cta-h); }
.chart .b:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.chart .b:hover::after, .chart .b:focus::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px);
  background: var(--ink); color: #fff; font-size: 12px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.axis { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
.hbar .t { height: 14px; background: #e8edf5; border-radius: 4px; overflow: hidden; } .hbar .v { height: 100%; background: var(--cta); border-radius: 0 4px 4px 0; }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; }
.login { max-width: 400px; margin: 8vh auto; } .login .btn { width: 100%; margin-top: 12px; } .login input { width: 100%; }
.callout { background: #eef5ff; border: 1px solid #c3dafe; border-radius: var(--r); padding: 12px 14px; margin: 12px 0; }
.callout.warn { background: #fff7e6; border-color: #f3d38c; }
code.link { display: block; word-break: break-all; background: #f1f3f7; padding: 8px; border-radius: 6px; font-size: 13px; }
.counts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
