:root {
  --bg: #0a0a0c; --panel: #121215; --panel-hi: #19191d; --line: #26262b; --text: #f2f2f4; --body: #a8a8b3; --muted: #8c8c96;
  --lime: #d4ff00; --ok: #3ddc84; --warn: #f5b53d; --down: #ff4d2d;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: var(--lime); color: var(--bg); }
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: #55555e; }
a:hover { text-decoration-color: var(--lime); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 18px; margin-bottom: 12px; }
h3 { font-size: 15px; margin-bottom: 8px; color: var(--body); font-weight: 600; }
p { margin: 0; text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--lime); color: var(--bg); padding: 8px 12px; z-index: 10; }
.muted { color: var(--muted); } .num { text-align: right; white-space: nowrap; }

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; padding: 0 8px; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; background: var(--lime); color: var(--bg); font-size: 12px; font-weight: 800; }
.nav-link { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; color: var(--body); text-decoration: none; min-height: 40px; }
.nav-link:hover { background: var(--panel); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--panel-hi); color: var(--lime); }
.nav-link.sub { min-height: 34px; padding: 6px 10px 6px 14px; font-size: 14px; }
.count { background: var(--lime); color: var(--bg); font-size: 12px; font-weight: 700; min-width: 20px; text-align: center; padding: 0 6px; }
.nav-group { margin-top: 10px; } .nav-group-name { font-size: 12px; color: var(--muted); padding: 0 10px 4px; }
.sites-nav { border-top: 1px solid var(--line); padding-top: 12px; }
.logout { margin-top: auto; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; padding: 8px 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

.main { padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: 1200px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.lede { color: var(--body); margin-top: 8px; max-width: 70ch; }
.crumb { font-size: 13px; margin-bottom: 6px; } .crumb a { color: var(--muted); }
.ext { color: var(--text); }
section { margin-bottom: 36px; }
.calm { color: var(--body); margin: -8px 0 32px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.range { display: flex; border: 1px solid var(--line); }
.range a { padding: 8px 14px; text-decoration: none; color: var(--body); font-size: 14px; min-height: 40px; display: flex; align-items: center; }
.range a + a { border-left: 1px solid var(--line); }
.range a[aria-current="true"] { background: var(--lime); color: var(--bg); font-weight: 600; }

.attention { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.attention li { border-bottom: 1px solid var(--line); }
.attention a { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; text-decoration: none; }
.attention a::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); transform: translateY(1px); }
.attention .down a::before { background: var(--down); } .attention .warn a::before { background: var(--warn); } .attention .info a::before { background: var(--lime); }
.attention a:hover { color: var(--lime); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
.data th, .data td { padding: 12px 12px 12px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; font-weight: 400; }
.data thead th { color: var(--muted); font-size: 13px; font-weight: 500; padding-top: 0; }
.data tbody th[scope="row"] { font-weight: 600; }
.data td.num, .data th.num { text-align: right; padding-right: 0; padding-left: 16px; }
.data tr.group th { padding: 22px 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); }
.data tbody tr:hover td, .data tbody tr:hover th[scope="row"] { background: rgba(255,255,255,0.02); }
.data.compact th, .data.compact td { padding: 8px 12px 8px 0; font-size: 14px; }
.cell-label { position: relative; width: 100%; }
.cell-label .fill { position: absolute; left: 0; top: 4px; bottom: 4px; background: rgba(212,255,0,0.1); }
.cell-label .fill { width: 0; }
.cell-label .fill.w0 { width: 0%; }
.cell-label .fill.w5 { width: 5%; }
.cell-label .fill.w10 { width: 10%; }
.cell-label .fill.w15 { width: 15%; }
.cell-label .fill.w20 { width: 20%; }
.cell-label .fill.w25 { width: 25%; }
.cell-label .fill.w30 { width: 30%; }
.cell-label .fill.w35 { width: 35%; }
.cell-label .fill.w40 { width: 40%; }
.cell-label .fill.w45 { width: 45%; }
.cell-label .fill.w50 { width: 50%; }
.cell-label .fill.w55 { width: 55%; }
.cell-label .fill.w60 { width: 60%; }
.cell-label .fill.w65 { width: 65%; }
.cell-label .fill.w70 { width: 70%; }
.cell-label .fill.w75 { width: 75%; }
.cell-label .fill.w80 { width: 80%; }
.cell-label .fill.w85 { width: 85%; }
.cell-label .fill.w90 { width: 90%; }
.cell-label .fill.w95 { width: 95%; }
.cell-label .fill.w100 { width: 100%; }
.cell-label .label { position: relative; padding: 0 8px; overflow-wrap: anywhere; }
.brief { color: var(--body); max-width: 46ch; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: baseline; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.down { background: var(--down); }
.spark { width: 110px; height: 26px; display: block; } .spark rect { fill: #4a4a54; }
tr:hover .spark rect { fill: var(--lime); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 0 0 36px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts > div { padding: 16px 16px 16px 0; } .facts > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 13px; } .facts dd { margin: 4px 0 0; font-size: 28px; font-weight: 600; line-height: 1.1; }
.facts .muted { font-size: 13px; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 40px; margin-bottom: 36px; }
.grid2 section { margin-bottom: 20px; }

.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .bar-pv { fill: #3a3a42; } .chart .bar-v { fill: var(--lime); }
.legend { color: var(--body); font-size: 13px; margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.legend .key { display: inline-block; width: 12px; height: 12px; margin-left: 12px; } .legend .key:first-child { margin-left: 0; }
.key.pv { background: #3a3a42; } .key.v { background: var(--lime); }
.empty { color: var(--muted); padding: 8px 0; }
.notice { padding: 12px 14px; margin-bottom: 24px; border: 1px solid var(--line); }
.notice.down { border-color: var(--down); } .notice.warn { border-color: var(--warn); }
.plain { margin: 0; padding: 0; list-style: none; } .plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }

.pill { display: inline-block; padding: 2px 10px; font-size: 13px; border: 1px solid var(--line); color: var(--body); }
.pill.new { background: var(--lime); border-color: var(--lime); color: var(--bg); font-weight: 600; }
.pill.won { border-color: var(--ok); color: var(--ok); } .pill.lost, .pill.spam { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 40px; }
.prose { white-space: pre-wrap; line-height: 1.65; max-width: 70ch; margin-bottom: 24px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
select, input { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; min-height: 44px; border-radius: 0; }
select:focus, input:focus { border-color: var(--lime); }
.btn { font: inherit; font-weight: 600; background: var(--lime); color: var(--bg); border: 0; padding: 10px 18px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; border-radius: 0; }
.btn:hover { filter: brightness(0.92); } .btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: min(380px, 100%); }
.login h1 { margin: 28px 0 20px; } .login form { display: grid; gap: 8px; } .login label { color: var(--body); font-size: 14px; margin-top: 8px; }
.login .btn { margin-top: 16px; justify-content: center; } .brand.big { padding: 0; font-size: 17px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; }
  .side nav[aria-label="Main"] { display: flex; overflow-x: auto; order: 3; width: 100%; }
  .sites-nav { display: none; } .logout { margin: 0 0 0 auto; }
  .nav-link { white-space: nowrap; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .data .brief { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.data .trend { padding-left: 28px; }

.data td.status { white-space: nowrap; }

.stack { display: grid; gap: 8px; max-width: 380px; } .stack label { color: var(--body); font-size: 14px; margin-top: 8px; } .stack .btn { margin-top: 16px; justify-self: start; }
