/* Golos Text for reading, Unbounded for the big words and numbers. Both OFL, see vendor/fonts. */
@font-face {
  font-family: 'Golos Text';
  font-weight: 400 800;
  font-display: swap;
  src: url('vendor/fonts/golos-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-weight: 400 800;
  font-display: swap;
  src: url('vendor/fonts/golos-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-weight: 500 700;
  font-display: swap;
  src: url('vendor/fonts/unbounded-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-weight: 500 700;
  font-display: swap;
  src: url('vendor/fonts/unbounded-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --page: #f2efe7;
  --surface: #fffdf8;
  --surface-2: #f7f4ec;
  --ink: #15171b;
  --ink-2: #4b4d52;
  --muted: #84837c;
  --grid: #e7e3d9;
  --axis: #ccc7b9;
  --ring: rgba(21, 23, 27, 0.09);
  --shadow: 0 1px 0 rgba(21, 23, 27, 0.04), 0 6px 18px -12px rgba(21, 23, 27, 0.18);
  --accent: #1d6b57;
  --accent-ink: #ffffff;
  --accent-wash: #e2efe9;
  --good: #2c9a52;
  --good-ink: #1f7a3f;
  --good-wash: #e5f3e8;
  --warning: #e3a008;
  --warning-ink: #8a5d00;
  --warning-wash: #fcf1d6;
  --critical: #d33a2c;
  --critical-ink: #b42b1f;
  --critical-wash: #fbe7e3;
  --panel: #15181d;
  --panel-2: #23272e;
  --panel-ink: #ece9e1;
  --panel-muted: #8f9197;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #6250d6;
  --s8: #e34948;
  --other: #898781;
}
/* Dark: by the system unless the viewer chose light, or by the viewer's choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --page: #0e1012;
    --surface: #171a1d;
    --surface-2: #1c1f23;
    --ink: #edebe5;
    --ink-2: #bbbab3;
    --muted: #85847e;
    --grid: #282b30;
    --axis: #3a3e44;
    --ring: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 22px -14px rgba(0, 0, 0, 0.8);
    --accent: #4db592;
    --accent-ink: #0b1612;
    --accent-wash: #15302a;
    --good: #36ad62;
    --good-ink: #5cc983;
    --good-wash: #15291b;
    --warning: #e8a917;
    --warning-ink: #f0c25a;
    --warning-wash: #2e2610;
    --critical: #e5493a;
    --critical-ink: #ff8073;
    --critical-wash: #321815;
    --panel: #08090b;
    --panel-2: #1b1e23;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s8: #e66767;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #0e1012;
  --surface: #171a1d;
  --surface-2: #1c1f23;
  --ink: #edebe5;
  --ink-2: #bbbab3;
  --muted: #85847e;
  --grid: #282b30;
  --axis: #3a3e44;
  --ring: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 22px -14px rgba(0, 0, 0, 0.8);
  --accent: #4db592;
  --accent-ink: #0b1612;
  --accent-wash: #15302a;
  --good: #36ad62;
  --good-ink: #5cc983;
  --good-wash: #15291b;
  --warning: #e8a917;
  --warning-ink: #f0c25a;
  --warning-wash: #2e2610;
  --critical: #e5493a;
  --critical-ink: #ff8073;
  --critical-wash: #321815;
  --panel: #08090b;
  --panel-2: #1b1e23;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #008300;
  --s7: #9085e9;
  --s8: #e66767;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
h1 { font: 600 24px/1.2 var(--display); letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13px; }

/* ── Header: the control strip ─────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px 22px;
  padding: 0 24px;
  min-height: 56px;
  background: var(--panel);
  color: var(--panel-ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; white-space: nowrap; }
.brand .word { font: 600 15px var(--display); letter-spacing: 0.02em; }
.brand .role { color: var(--panel-muted); font-size: 13px; }
.mark { width: 28px; height: 28px; flex: none; }
.mark .plate { fill: var(--panel-2); }
.mark .arm { fill: var(--panel-ink); }
.mark .lamp { fill: var(--good); }
.mark.warning .lamp { fill: var(--warning); }
.mark.critical .lamp { fill: var(--critical); }
.nav { display: flex; align-self: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--panel-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
}
.nav a:hover { color: var(--panel-ink); }
.nav a[aria-current='page'] { color: var(--panel-ink); border-bottom-color: var(--accent); font-weight: 600; }
.count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  background: var(--warning);
  color: #2a1d00;
}
.count.critical { background: var(--critical); color: #fff; }
.who { display: flex; gap: 14px; align-items: center; color: var(--panel-muted); font-size: 13px; white-space: nowrap; }
.who a { color: var(--panel-ink); text-decoration: none; }
.who a:hover { text-decoration: underline; }
.who form { margin: 0; }
.who .linklike { color: var(--panel-muted); }
.who .linklike:hover { color: var(--panel-ink); }
.clock { font-variant-numeric: tabular-nums; color: var(--panel-ink); }
.clock small { margin-left: 4px; color: var(--panel-muted); font-size: 11px; letter-spacing: 0.04em; }
.envs { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--panel-2); }
.envs a, .envs b { padding: 2px 10px; border-radius: 6px; font-weight: 500; }
.envs b { background: var(--panel-ink); color: var(--panel); }
.theme { display: inline-flex; margin: 0; padding: 2px; border-radius: 8px; background: var(--panel-2); }
.theme button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--panel-muted);
}
.theme button:hover { color: var(--panel-ink); }
.theme button[aria-pressed='true'] { background: var(--panel-ink); color: var(--panel); }
.theme svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.theme svg .solid { fill: currentColor; stroke: none; }
.theme button[value='dark'] svg path { fill: currentColor; stroke: none; }
.theme button[value='light'] svg circle { fill: currentColor; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }

/* ── Page ──────────────────────────────────────────────────────────────── */
main { max-width: 1240px; margin: 0 auto; padding: 26px 24px 56px; display: grid; gap: 22px; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; }
.head h1 .env, .env {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--page);
  font: 600 12px/1.4 var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 5px;
}
.sub { color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.grid { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); }

/* Lamps: the colour always comes with words. */
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--muted); }
.dot.good { background: var(--good); }
.dot.warning { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-wash); }
.dot.critical { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-wash); animation: beacon 2s ease-in-out infinite; }
.dot.unknown { background: transparent; border: 2px solid var(--muted); }
@keyframes beacon {
  50% { box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.critical { animation: none; }
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--warning);
  color: #2a1d00;
}
.badge.critical { background: var(--critical); color: #fff; }

/* ── «Сейчас»: the board ───────────────────────────────────────────────── */
.verdict {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 26px 28px 20px;
  border-radius: 20px;
  background: var(--good-wash);
  border: 1px solid var(--ring);
  overflow: hidden;
}
.verdict.warning { background: var(--warning-wash); }
.verdict.critical {
  background:
    repeating-linear-gradient(-45deg, transparent 0 22px, rgba(211, 58, 44, 0.05) 22px 44px),
    var(--critical-wash);
}
.verdict-line { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.verdict .dot { width: 22px; height: 22px; }
.verdict .dot.critical { box-shadow: 0 0 0 6px rgba(211, 58, 44, 0.18); }
.verdict .dot.warning { box-shadow: 0 0 0 6px rgba(227, 160, 8, 0.2); }
.verdict .dot.good { box-shadow: 0 0 0 6px rgba(44, 154, 82, 0.16); }
.verdict-title { font: 600 clamp(24px, 4vw, 36px)/1.1 var(--display); letter-spacing: -0.015em; }
.verdict-sub { color: var(--ink-2); flex: 1 1 260px; }
.verdict-env { margin-left: auto; text-align: right; color: var(--ink-2); font-size: 13px; }
.verdict-env b { display: block; color: var(--ink); font: 600 15px var(--display); }

/* The day strip: what fired when, by screen. */
.day { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; align-items: center; }
.day .lane-title { font-size: 12px; color: var(--ink-2); text-decoration: none; }
.day a.lane-title:hover { color: var(--ink); text-decoration: underline; }
.day svg { display: block; width: 100%; overflow: visible; }
.day .lane { height: 12px; }
.day .track { fill: var(--ink); opacity: 0.07; }
.day .seg { fill: var(--warning); }
.day .seg.critical { fill: var(--critical); }
.day .seg:hover { opacity: 0.75; }
.day .axis { height: 16px; }
.day .axis text { font-size: 11px; fill: var(--muted); }
.day .axis line { stroke: var(--ink); opacity: 0.18; }
.day .axis .now { fill: var(--ink-2); font-weight: 600; }

.problem {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  border-left: 6px solid var(--warning);
}
.problem.critical { border-left-color: var(--critical); }
.problem.related { border-left-color: var(--axis); opacity: 0.8; }
.problem .when {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 20px 16px 20px 18px;
  background: var(--surface-2);
  border-right: 1px solid var(--ring);
}
.problem .when b { font: 700 24px/1.15 var(--font); letter-spacing: -0.02em; color: var(--warning-ink); white-space: nowrap; }
.problem.critical .when b { color: var(--critical-ink); }
.problem.related .when b { color: var(--ink-2); }
.problem .when span { font-size: 13px; color: var(--ink-2); }
.problem .what { display: grid; gap: 10px; padding: 18px 22px 20px; min-width: 0; }
.problem h2 { font-size: 20px; line-height: 1.3; font-weight: 700; }
.problem h2 a { color: inherit; }
.problem .effect { font-size: 16px; }
.problem .who-is { color: var(--ink-2); }
.problem ul { margin: 0; padding: 0; list-style: none; display: grid; border-top: 1px solid var(--grid); }
.problem li { display: flex; gap: 12px; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.problem li span:last-child { color: var(--muted); white-space: nowrap; font-size: 13px; }
.problem .action {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--axis);
}
.problem .action b { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); line-height: 22px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); font-size: 14px; }

.card.pending { border-style: dashed; box-shadow: none; background: transparent; }
.gauges { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.gauge {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--ring);
}
.gauge .dot { margin-top: 6px; }
.gauge b { font-weight: 600; }
.gauge span:last-child { grid-column: 2; font-size: 13px; color: var(--ink-2); }
.gauge.warning { background: var(--warning-wash); }
.gauge.critical { background: var(--critical-wash); }

/* ── Lists and stats ───────────────────────────────────────────────────── */
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; align-content: start; }
.list li { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.list li .dot { position: relative; top: 1px; }
.list .grow { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.list .val { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.stat {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--ring);
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.stat-label a { color: inherit; font-weight: 600; }
.stat-value { font: 700 30px/1.15 var(--font); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.stat.warning .stat-value { color: var(--warning-ink); }
.stat.critical .stat-value { color: var(--critical-ink); }
.stat-sub { font-size: 13px; color: var(--ink-2); }
.stat.critical { border-top: 3px solid var(--critical); }
.stat.warning { border-top: 3px solid var(--warning); }

.meter { display: grid; gap: 5px; }
.meter .line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.meter .line span:last-child { color: var(--ink-2); white-space: nowrap; font-size: 14px; }
.bar { display: block; width: 100%; height: 8px; }
.bar .track { fill: var(--ink); opacity: 0.08; }
.bar .fill { fill: var(--good); }
.bar .fill.warning { fill: var(--warning); }
.bar .fill.critical { fill: var(--critical); }
.bar .fill.unknown { fill: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--ring);
  font-size: 14px;
}
.chips li small { color: var(--muted); font-size: 12px; }
.chips li.warning { background: var(--warning-wash); }
.chips li.critical { background: var(--critical-wash); }

.notice { padding: 12px 16px; border-radius: 12px; background: var(--warning-wash); border: 1px solid var(--ring); }
.notice.bad { background: var(--critical-wash); }
.notice.good { background: var(--good-wash); }

/* ── Villages ──────────────────────────────────────────────────────────── */
.orgs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.org { gap: 14px; }
.org.warning { border-top: 4px solid var(--warning); }
.org.critical { border-top: 4px solid var(--critical); }
.org-head { display: flex; align-items: center; gap: 10px; }
.org-head h2 { font-size: 18px; flex: 1 1 auto; min-width: 0; }
.org-head h2 a { color: inherit; text-decoration: none; }
.org-head h2 a:hover { text-decoration: underline; }
.org-head .small { white-space: nowrap; }
.org-part { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--grid); }
.org-part h3 { font-size: 11px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

/* ── Controls ──────────────────────────────────────────────────────────── */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--ring); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 5px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
select, input, button {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--axis);
  border-radius: 9px;
  padding: 7px 11px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button { cursor: pointer; }
button:hover { border-color: var(--ink-2); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--axis); }
td { padding: 10px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
tbody tr:hover td { background: var(--surface-2); }
td .list { gap: 2px; }

/* ── Charts ────────────────────────────────────────────────────────────── */
.charts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); min-width: 0; }
.chart { display: grid; gap: 8px; position: relative; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.chart h3 { min-width: 0; }
.chart h3 .hint {
  display: none;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--ring);
  color: var(--ink-2);
  font-size: 11px;
  vertical-align: 1px;
  cursor: help;
}
/* The plot takes the height it is given; the chart inside follows it. */
.chart .plot { height: 220px; position: relative; }
.chart .plot > .uplot { position: absolute; inset: 0; }
.chart .note { color: var(--ink-2); font-size: 13px; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 14px; }
.chart details.table { flex: none; }
.chart details.table summary { white-space: nowrap; }
.chart details.table[open] .table-box {
  position: absolute;
  z-index: 3;
  inset: 46px 12px 12px;
  overflow: auto;
  background: var(--surface);
  border-top: 1px solid var(--grid);
}
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); margin: 0; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 14px; height: 3px; border-radius: 2px; display: inline-block; background: currentColor; }
.tip {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  background: var(--panel);
  color: var(--panel-ink);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  font-size: 13px;
  display: none;
  min-width: 150px;
  max-width: 290px;
}
.tip .t { color: var(--panel-muted); margin-bottom: 3px; }
.tip .r { display: flex; gap: 8px; align-items: center; }
.tip .r b { font-variant-numeric: tabular-nums; }
.tip .r span:last-child { color: var(--panel-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.table summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
details.table summary:hover { color: var(--ink); }
details.table td, details.table th { font-variant-numeric: tabular-nums; }
.uplot, .uplot * { font-family: inherit; }
.u-legend { display: none; }

/* ── Sign-in ───────────────────────────────────────────────────────────── */
body.bare main { max-width: none; min-height: 100vh; padding: 0; place-items: center; }
.gate {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  width: min(920px, 100% - 32px);
  margin: 32px 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--ring);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
}
.gate-side {
  display: grid;
  align-content: space-between;
  gap: 40px;
  padding: 36px;
  background:
    radial-gradient(circle at 18% 22%, rgba(44, 154, 82, 0.28), transparent 42%),
    var(--panel);
  color: var(--panel-ink);
}
.gate-side .mark { width: 56px; height: 56px; }
.gate-side .brand .word { font-size: 20px; }
.gate-side h1 { font-size: 28px; line-height: 1.2; }
.gate-side p { color: var(--panel-muted); margin-top: 12px; }
.gate-form { display: grid; align-content: center; gap: 14px; padding: 40px 36px; }
.gate-form h2 { font: 600 22px var(--display); }
.gate-form form { display: grid; gap: 14px; }
.gate-form label { display: grid; gap: 5px; font-size: 14px; color: var(--ink-2); }
.gate-form button.primary { padding: 10px; }
.error { color: var(--critical-ink); }
form.stack { display: grid; gap: 12px; max-width: 420px; }
form.stack label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
form.stack label.check { display: flex; gap: 8px; align-items: center; }

/* ── Errors ────────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  line-height: 18px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--ring);
  color: var(--ink-2);
  white-space: nowrap;
  vertical-align: 1px;
}
.tag.new { background: var(--warning-wash); color: var(--warning-ink); box-shadow: inset 0 0 0 1px rgba(227, 160, 8, 0.4); }
.tag.bad { background: var(--critical-wash); color: var(--critical-ink); box-shadow: inset 0 0 0 1px rgba(211, 58, 44, 0.3); }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.issues .num { text-align: right; }
td.num.hot { font-weight: 700; color: var(--ink); }
table.issues td:first-child { overflow-wrap: anywhere; }
table.issues td:first-child > a { color: var(--ink); font-weight: 600; text-decoration: none; }
table.issues td:first-child > a:hover { color: var(--accent); text-decoration: underline; }
table.issues .culprit { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.pager { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.crumbs { color: var(--ink-2); font-size: 14px; }
.issue-head { display: grid; gap: 6px; }
.issue-title { font: 650 22px/1.3 var(--font); overflow-wrap: anywhere; }
.issue-head .culprit { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.days { margin: 4px 0 0; }
.days svg { width: 100%; max-width: 448px; height: 56px; display: block; }
.days rect { fill: var(--accent); }
.days rect.zero { fill: var(--axis); }
.days figcaption { display: flex; justify-content: space-between; max-width: 448px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.code, .json, .dsn { font-family: var(--mono); font-size: 13px; }
.dsn { overflow-wrap: anywhere; }
.exception { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--grid); }
.exception h3 { overflow-wrap: anywhere; font-size: 16px; }
.exception .value { font-weight: 400; }
.frames { display: grid; gap: 6px; }
.frame { padding: 4px 0; }
.frame .where { overflow-wrap: anywhere; font-size: 14px; }
.frame .where .muted { font-family: var(--mono); font-size: 12px; }
.frame.own .where b { color: var(--ink); }
.frame:not(.own) .where { color: var(--ink-2); }
.libs > summary, details > summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.libs { padding-left: 12px; border-left: 2px solid var(--grid); }
.code, .json {
  margin: 4px 0 0;
  padding: 8px 0;
  background: var(--surface-2);
  border: 1px solid var(--grid);
  border-radius: 10px;
  overflow-x: auto;
}
.json { padding: 10px 12px; max-height: 360px; }
.code .line { display: block; padding-right: 12px; white-space: pre; }
.code .ln { display: inline-block; width: 4.5em; padding-right: 1em; text-align: right; color: var(--muted); user-select: none; }
.code .cur { background: var(--critical-wash); box-shadow: inset 3px 0 0 var(--critical); }
table.crumbs td:first-child { white-space: nowrap; }
tr.bad td { background: var(--critical-wash); }
h4 { font-size: 14px; margin: 8px 0 2px; }
.card > *, .exception, .frames, .frame { min-width: 0; }
.filters select, .filters input { max-width: 100%; min-width: 0; }
.head > * { min-width: 0; max-width: 100%; }

/* ── Boards: the parts of a screen ──────────────────────────────────── */
.spacer { flex: 1 1 auto; }
.board { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pile { display: grid; gap: 14px; align-content: start; }
.side, .problems { display: grid; gap: 16px; align-content: start; min-width: 0; }
.side .gauges { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.side .gauge { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; padding: 7px 12px; }
.side .gauge .dot { margin-top: 0; position: relative; top: 1px; }
.side .gauge b { flex: 1 1 auto; }
.side .gauge span:last-child { font-size: 12px; }
.side .list li { flex-wrap: wrap; column-gap: 10px; row-gap: 0; }
.side .list .val { flex-basis: 100%; padding-left: 20px; white-space: normal; font-size: 13px; }
.panel-head .filters { flex: 1 1 auto; justify-content: flex-end; }
.panel-head .filters select { flex: 0 1 auto; max-width: 220px; }
.panel-head .filters input[type='search'] { flex: 1 1 160px; min-width: 120px; }
.calm {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 24px;
  border: 1px dashed var(--axis);
  border-radius: 14px;
  color: var(--ink-2);
  text-align: center;
}
.panel-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.dsn-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--grid); display: grid; gap: 10px; }
.org.picked { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.org-head h2 a[title] { cursor: pointer; }

/*
 * On a computer screen a board fills the window: the header on top, the parts
 * below sized to fit, long lists and charts scrolling or shrinking inside their
 * own panels. Smaller screens keep the ordinary page that scrolls.
 */
@media (min-width: 1100px) and (min-height: 640px) {
  body.fit { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  body.fit .top { position: static; min-height: 52px; }
  body.fit main { max-width: none; width: 100%; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 20px 16px; }
  body.fit main > * { flex: none; }
  body.fit main > .board { flex: 1 1 0; min-height: 0; gap: 14px; }
  body.fit h1 { font-size: 21px; }
  body.fit .head { align-items: center; }
  body.fit .card { padding: 14px 16px; }
  body.fit .problem { padding: 0; }
  body.fit .panel, body.fit .side, body.fit .problems, body.fit .charts { min-height: 0; }
  body.fit .fill { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-width: thin; }
  /* Cards keep their height and the list scrolls; a card clipping its own corners would otherwise shrink. */
  body.fit .problems, body.fit .pile, body.fit .orgs { grid-auto-rows: max-content; }
  body.fit .problems { overflow: auto; scrollbar-width: thin; gap: 12px; }
  body.fit .side { display: flex; flex-direction: column; gap: 12px; overflow: auto; scrollbar-width: thin; }
  body.fit .side > * { flex: none; }
  body.fit .side > .panel { flex: 1 1 0; min-height: 130px; }
  body.fit .stat { padding: 12px 16px; }
  body.fit .stat-value { font-size: 26px; }

  .board.now { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: 'verdict side' 'problems side'; }
  .now > .verdict { grid-area: verdict; padding: 18px 22px 14px; gap: 14px; }
  .now > .problems { grid-area: problems; }
  .now > .side { grid-area: side; }
  .now .verdict-title { font-size: 30px; }

  .board.villages { grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: 'stats stats' 'orgs charts'; }
  .villages > .stats { grid-area: stats; }
  .villages > .orgs-panel { grid-area: orgs; min-height: 0; }
  .villages > .charts { grid-area: charts; }
  .orgs { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; padding-right: 2px; }
  .org { gap: 10px; }
  .org-part { padding-top: 8px; gap: 4px; }

  .board.server { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: 'kpis kpis' 'state charts'; }
  .server > .stats { grid-area: kpis; }
  .server > .state { grid-area: state; min-height: 0; }
  .server > .charts { grid-area: charts; }
  .state .pile { gap: 12px; padding-right: 2px; }

  .board.errors { grid-template-columns: minmax(0, 1fr) minmax(360px, 34%); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: 'stats charts' 'issues charts'; }
  .errors > .stats { grid-area: stats; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .errors > .stats .stat { overflow: hidden; }
  .errors .stat-label a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.issues { font-size: 13px; }
  table.issues td:first-child { min-width: 240px; overflow-wrap: break-word; }
  .errors > .issues-panel { grid-area: issues; min-height: 0; }
  .errors > .charts { grid-area: charts; }
  .issues-panel thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }

  .board.issue { grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .board.issue > .panel { min-height: 0; }
  .board.issue .pile { padding-right: 2px; }

  /* Charts share the panel evenly; how to read one is in its hint. */
  body.fit .charts { gap: 12px; grid-template-columns: minmax(0, 1fr); }
  body.fit .charts.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.fit .charts.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Below a readable height the charts stop shrinking and their panel scrolls instead. */
  body.fit .charts { overflow-y: auto; scrollbar-width: thin; }
  body.fit .charts.r1 { grid-template-rows: minmax(150px, 1fr); }
  body.fit .charts.r2 { grid-template-rows: repeat(2, minmax(150px, 1fr)); }
  body.fit .charts.r3 { grid-template-rows: repeat(3, minmax(150px, 1fr)); }
  body.fit .charts.r4 { grid-template-rows: repeat(4, minmax(150px, 1fr)); }
  body.fit .chart { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 8px; min-height: 0; }
  body.fit .chart h3 { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  body.fit .chart h3 .hint { display: inline-grid; }
  body.fit .chart .note { display: none; }
  body.fit .chart .plot { flex: 1 1 0; height: auto; min-height: 50px; }
  body.fit .legend { flex: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; font-size: 12px; }
  body.fit .legend li { white-space: nowrap; }
  body.fit .chart details.table[open] .table-box { inset: 38px 12px 10px; }
}
@media (min-width: 1100px) and (max-width: 1400px) and (min-height: 640px) {
  body.fit .brand .role, body.fit .head > .sub { display: none; }
  body.fit .top { gap: 8px 14px; }
  body.fit .nav a { padding: 0 9px; }
}

@media (max-width: 860px) {
  .top { flex-wrap: wrap; padding: 8px 16px 0; gap: 6px 14px; }
  .who { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 6px; }
  .nav a { padding: 10px 10px 9px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 20px; }
  .brand .role { display: none; }
  .who .user { display: none; }
  .list li { flex-wrap: wrap; column-gap: 10px; row-gap: 0; }
  .list .val { flex-basis: 100%; padding-left: 20px; white-space: normal; }
  main { padding: 18px 16px 36px; gap: 18px; }
  .verdict { padding: 20px 18px 16px; border-radius: 16px; }
  .verdict-env { margin-left: 0; text-align: left; }
  .day .axis .minor { display: none; }
  .problem { grid-template-columns: minmax(0, 1fr); }
  .problem .when { grid-template-columns: max-content 1fr; align-items: baseline; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--ring); }
  .problem .what { padding: 14px 16px 16px; }
  .problem h2 { font-size: 18px; }
  .problem li { flex-wrap: wrap; gap: 0 12px; }
  .problem .action { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 24px; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--axis); }
  table.stack td { border: 0; padding: 4px 0; text-align: left; }
  table.stack td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; }
  tbody tr:hover td { background: none; }
  .head > .filters { width: 100%; }
  .filters select, .filters input { flex: 1 1 100%; }
  table.issues td.num { display: inline-block; width: auto; margin-right: 18px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dd { margin-bottom: 4px; }
  .gate { grid-template-columns: minmax(0, 1fr); margin: 16px 0; }
  .gate-side { padding: 24px; gap: 20px; }
  .gate-side h1 { font-size: 22px; }
  .gate-form { padding: 24px; }
}

.stat-value small { font: 500 13px var(--font); color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.stat.picked { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.figures { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ink-2); font-size: 14px; }
.figures b { display: block; font: 700 26px/1.2 var(--font); letter-spacing: -0.02em; color: var(--ink); }
