
:root {
  color-scheme: light dark;
  --page: #f4f4f1; --surface: #fcfcfb; --sunken: #f0efec; --line: #e2e1dc; --line-strong: #cfcec8;
  --text: #0b0b0b; --text-2: #52514e; --text-3: #6b6a65;
  --accent: #1c5cab; --accent-soft: #e6effb; --on-accent: #fff;
  --series-ok: #2a78d6; --series-warn: #fab219; --series-crit: #d03b3b;
  --warn-soft: #fdf3dc; --warn-ink: #6e4a00; --crit-soft: #fbe9e9; --crit-ink: #9c2424; --ok-soft: #e4f3e4; --ok-ink: #0a6b0a;
  --grid: #e9e8e3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #111110; --surface: #1a1a19; --sunken: #232321; --line: #2e2e2b; --line-strong: #41413d;
    --text: #f0efec; --text-2: #c3c2b7; --text-3: #a3a297;
    --accent: #86b6ef; --accent-soft: #1b2c44; --on-accent: #0b0b0b;
    --series-ok: #3987e5; --series-warn: #fab219; --series-crit: #e66767;
    --warn-soft: #3a2d0c; --warn-ink: #fbd474; --crit-soft: #3f1c1c; --crit-ink: #f4a9a9; --ok-soft: #163316; --ok-ink: #9be09b;
    --grid: #2a2a27;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 14px; line-height: 1.3; margin: 0; font-weight: 620; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px; font-weight: 650; }
.brand small { display: block; font-weight: 450; color: var(--text-3); font-size: 12px; line-height: 1.2; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 7px 10px; border-radius: 7px; color: var(--text-2); }
.nav a:hover { background: var(--sunken); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.who { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.main { padding: 26px 30px 44px; max-width: 1240px; width: 100%; min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.head p { color: var(--text-2); margin-top: 3px; }
.stack { display: grid; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px; min-width: 0; }
.card > header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.card > header span { color: var(--text-3); font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; min-width: 0; }
.tile b { display: block; font-size: 24px; line-height: 1.2; font-weight: 640; letter-spacing: -0.015em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--text-2); font-size: 12.5px; }
.tile em { display: block; color: var(--text-3); font-style: normal; font-size: 12px; }

.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--sunken); padding: 3px; border-radius: 9px; }
.tabs a { padding: 4px 11px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a[aria-current="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.alert { border-radius: 9px; padding: 10px 13px; border: 1px solid transparent; }
.alert b { display: block; }
.alert.info { background: var(--accent-soft); border-color: var(--line); }
.alert.warn { background: var(--warn-soft); color: var(--warn-ink); }
.alert.crit { background: var(--crit-soft); color: var(--crit-ink); }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 550; font-size: 12px; color: var(--text-3); padding: 7px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--sunken); }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.route { display: flex; gap: 6px; align-items: baseline; min-width: 190px; overflow-wrap: anywhere; }
.route code { min-width: 0; }
.empty { color: var(--text-2); padding: 22px 6px; text-align: center; }

.method { flex: none; min-width: 40px; font-size: 11px; font-weight: 650; letter-spacing: 0.02em; color: var(--text-2); }
.pill { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 19px; background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.crit { background: var(--crit-soft); color: var(--crit-ink); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { display: block; width: 100%; height: auto; }
.chart text { fill: var(--text-3); font-size: 12px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--sunken); }
.chart .bar { pointer-events: none; }
.fill-ok, .legend .fill-ok { fill: var(--series-ok); background: var(--series-ok); }
.fill-warn, .legend .fill-warn { fill: var(--series-warn); background: var(--series-warn); }
.fill-crit, .legend .fill-crit { fill: var(--series-crit); background: var(--series-crit); }
.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 9px; border-radius: 7px; font-size: 12.5px; line-height: 1.35; max-width: 280px; }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px 12px; align-items: end; margin-bottom: 14px; }
.filters .wide { grid-column: span 2; }
.filters .actions { display: flex; gap: 8px; align-items: center; }
label { display: grid; gap: 3px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
label.check { display: flex; gap: 7px; align-items: center; padding-bottom: 7px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; padding: 6px 9px; width: 100%; min-width: 0; }
input[type="checkbox"] { width: auto; }
button, .button { font: inherit; font-weight: 600; font-size: 13px; color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent); border-radius: 7px; padding: 6px 13px; cursor: pointer; display: inline-block; white-space: nowrap; }
.button:hover { text-decoration: none; }
button.quiet, .button.quiet { background: transparent; color: var(--text-2); border-color: var(--line-strong); }
button.danger { background: var(--series-crit); border-color: var(--series-crit); color: #fff; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }

dl.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 5px 14px; margin: 0; }
dl.facts dt { color: var(--text-3); font-size: 13px; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.frames { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
details.revoke summary { cursor: pointer; color: var(--crit-ink); font-size: 13px; }
details.revoke form { display: grid; gap: 7px; margin-top: 7px; min-width: 220px; }
.inline-form { display: inline; margin: 0; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.gate-card { width: 100%; max-width: 372px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 26px; display: grid; gap: 15px; }
.gate-card .brand { padding: 0; }
.gate-card p { color: var(--text-2); }
.gate-card button { padding: 8px 13px; }
.gate-card form { display: grid; gap: 12px; }

@media (max-width: 1080px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .shell { display: block; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .who { margin-top: 0; padding: 8px 0 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
  .main { padding: 18px 16px 34px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 1px 0; }
  dl.facts dd { margin-bottom: 7px; }
  .filters .wide { grid-column: auto; }
}
