/* Мониторинг — a calm control panel. Tokens first: deep graphite-blue by default, light on request (Настройки or the switch). */
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/fonts/exo2-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/fonts/exo2-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/jbmono-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/jbmono-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jura'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/jura-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Jura'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/jura-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* «Командный центр»: a HUD over a fine grid. Cyan lines, corner brackets, mono labels. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #03060c; --surface: #07101c; --surface-2: #0a1626; --sidebar: #040a14; --text: #e6f1ff; --muted: #8197b3; --faint: #50627e;
  --line: rgba(62,230,255,.17); --line-strong: rgba(62,230,255,.34); --accent: #3ee6ff; --accent-text: #021219; --hover: rgba(62,230,255,.06); --selected: rgba(62,230,255,.11);
  --ok: #3dffa2; --warn: #ffc24d; --bad: #ff4d6d; --info: #7a8cff; --neutral: #8197b3;
  --grid: rgba(62,230,255,.035); --glow-a: rgba(62,230,255,.45);
  --radius: 2px; --shadow: none;
  --font: 'Exo 2', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: 'Jura', 'Exo 2', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  /* Timeline marks: hearings are filled diamonds, planned checks hollow ones (shape, not only color). */
  --mark-hearing: #29a3c9; --mark-check: #9a7cf0;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f8; --surface: #ffffff; --surface-2: #f5f9fc; --sidebar: #e6eef5; --text: #0b1a2b; --muted: #4f6077; --faint: #8796ab;
  --line: rgba(8,96,140,.18); --line-strong: rgba(8,96,140,.36); --accent: #087ea8; --accent-text: #ffffff; --hover: rgba(8,96,140,.05); --selected: rgba(8,126,168,.10);
  --ok: #138a52; --warn: #a35a00; --bad: #c42840; --info: #3b4fd1; --neutral: #5c6b80;
  --grid: rgba(8,96,140,.05); --glow-a: rgba(8,126,168,.25);
  --mark-hearing: #087ea8; --mark-check: #6b4fd8;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
body { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 32px 32px; background-attachment: fixed; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 650; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 650; margin: 0 0 4px; }
h3 { font-size: 15px; font-weight: 650; margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
p { margin: 6px 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 13.5px; }
.warn-text { color: var(--warn); } .bad-text { color: var(--bad); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 2px; }
.error { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); padding: 10px 12px; border-radius: 10px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* Layout: sidebar + main; on phones the sidebar becomes a bottom tab bar. */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); padding: 6px 10px 14px; }
.brand img { border-radius: 7px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.nav:hover { background: var(--hover); text-decoration: none; }
.nav.active { background: var(--selected); color: var(--accent); font-weight: 600; }
.icon { width: 20px; height: 20px; flex: none; }
.nav .lbl { flex: 1; }
.badge { background: var(--warn); color: #1a1205; font-size: 12px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; }
.nav-section { font-size: 12px; color: var(--muted); font-weight: 600; padding: 14px 10px 4px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 4px; }
.main { min-width: 0; }
.page { padding: 28px 32px 80px; max-width: 1100px; }
.page.narrow { max-width: 820px; margin: 0 auto; }

/* Cards, rows, fields */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; }
.card > p { padding: 10px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow, .grow { flex: 1; min-width: 0; }
.link-row { color: var(--text); } .link-row:hover { text-decoration: none; background: var(--hover); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chev { color: var(--faint); font-size: 18px; }
.field { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field span { color: var(--muted); } .field b { font-weight: 500; text-align: right; }
.head-card { padding: 16px; }
.head-card h2 { margin-bottom: 2px; }
.actions, .buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.buttons { margin-top: 12px; } .buttons.end { justify-content: flex-end; }
.buttons form, .actions form { margin: 0; }
.add { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--hover); font-size: 16px; color: var(--accent); }
.add:hover { text-decoration: none; background: var(--selected); }

/* Buttons and inputs */
button, .button { font: inherit; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; }
button:hover, .button:hover { background: var(--hover); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover, .button.primary:hover { filter: brightness(1.08); }
button.large { min-height: 42px; padding: 8px 20px; font-size: 15px; }
button.small, .button.small { min-height: 28px; padding: 3px 10px; font-size: 13px; }
button.link { background: none; border: 0; color: var(--accent); padding: 4px 0; min-height: 0; }
button:disabled, [aria-disabled="true"] { opacity: .45; pointer-events: none; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-height: 38px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex: none; }
input.short { width: 80px; display: inline-block; }
.form { display: grid; gap: 12px; padding: 16px; }
.form label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.form label > input, .form label > select, .form label > textarea { color: var(--text); font-size: 15px; }
label.check, label.radio { display: flex !important; align-items: center; gap: 10px; color: var(--text) !important; font-size: 15px !important; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.segmented-radio { display: flex; gap: 16px; }
.inline-form { display: grid; gap: 10px; padding: 14px 0; }
.search { margin: 0 0 10px; }
.search input { background: var(--hover); border-color: transparent; }

/* Status capsule */
.pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; font-weight: 550; padding: 3px 10px; border-radius: 999px;
  --c: var(--neutral); color: var(--text); background: color-mix(in srgb, var(--c) 14%, transparent); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pill.ok { --c: var(--ok); } .pill.warn { --c: var(--warn); } .pill.bad { --c: var(--bad); } .pill.info { --c: var(--info); }

/* Segmented control */
.segmented { display: flex; background: var(--hover); border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 12px; overflow-x: auto; }
.segmented a { flex: 1; text-align: center; padding: 6px 10px; border-radius: 7px; color: var(--text); font-size: 13.5px; white-space: nowrap; }
.segmented a:hover { text-decoration: none; background: var(--hover); }
.segmented a.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.segmented.wrap { flex-wrap: wrap; }

/* List + detail split */
.split { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; min-height: 100vh; }
.list-pane, .detail-pane { min-width: 0; }
.list-pane { border-right: 1px solid var(--line); padding: 20px 14px; background: var(--surface); }
.detail-pane { padding: 22px 28px 80px; min-width: 0; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.pane-head h1 { font-size: 22px; margin: 0; }
.count { color: var(--muted); font-weight: 500; font-size: 15px; }
.list { list-style: none; margin: 0; padding: 0; }
.list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.list a:hover { background: var(--hover); text-decoration: none; }
.list a.selected { background: var(--selected); }
.list .empty { color: var(--muted); padding: 16px 10px; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--warn); color: var(--warn); font-size: 11px; font-weight: 700; }
.placeholder { color: var(--muted); display: grid; place-items: center; min-height: 60vh; text-align: center; padding: 20px; }
.back-link { display: none; margin-bottom: 10px; }
.page > .back-link { display: inline-block; }

/* Home */
.hero { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.hero-text { flex: 1; min-width: 240px; }
.hero-mark { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 700; }
.hero-mark.ok { background: var(--ok); } .hero-mark.warn { background: var(--warn); }
section { margin-bottom: 26px; }
section h2 { font-size: 18px; margin-bottom: 10px; }
.alert .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); align-self: flex-start; margin-top: 7px; flex: none; }
.alert.important .dot { background: var(--bad); }
.alert { align-items: flex-start; }
details.recent summary { cursor: pointer; color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: 8px 0; }
ul.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* Menus, tables, stats */
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 8px; width: 290px; display: grid; gap: 4px; }
.menu-body > a { padding: 8px 10px; border-radius: 6px; color: var(--text); }
.menu-body > a:hover { background: var(--hover); text-decoration: none; }
.upload label { display: grid; gap: 6px; padding: 8px 10px; font-size: 14px; }
.upload input[type=file] { border: 0; padding: 0; min-height: 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0; }
.stat b { display: block; font-size: 26px; } .stat span { color: var(--muted); font-size: 13px; }
.stat.ok b { color: var(--ok); } .stat.info b { color: var(--info); } .stat.warn b { color: var(--warn); }
.notice { border-color: var(--accent); padding: 12px 16px; }

/* Progress and toast */
.progress-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.progress-bar progress { width: 140px; accent-color: var(--accent); }
.progress-bar .step { flex: 1; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 14px; background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: toast-in .2s ease-out; max-width: calc(100vw - 32px); }
.toast form { margin: 0; } .toast button.link { color: var(--bg); text-decoration: underline; font-weight: 600; }
.toast.hide { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Sign-in */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 380px; text-align: center; }
.login img { border-radius: 16px; }
.login h1 { font-size: 22px; margin: 14px 0 18px; }
.login .form { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Phones and narrow windows */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; padding-bottom: 64px; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; z-index: 15; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--sidebar) 92%, transparent); backdrop-filter: blur(12px); }
  .brand, .nav-section, .sidebar-foot form { display: none; }
  .sidebar-foot { margin: 0; display: contents; }
  .nav { flex: 1 1 0; flex-direction: column; gap: 2px; padding: 4px 2px; font-size: 10px; position: relative; min-width: 0; }
  .nav .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
  .nav.active { background: none; }
  .badge { position: absolute; top: 0; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .page { padding: 18px 16px 40px; }
  .split { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .split.has-detail .list-pane { display: none; }
  .split:not(.has-detail) .detail-pane { display: none; }
  .list-pane { border-right: 0; padding: 16px 12px; }
  .detail-pane { padding: 16px; }
  .back-link { display: inline-block; }
  .field { flex-direction: column; gap: 2px; } .field b { text-align: left; }
  .row { flex-wrap: wrap; }
  .hero form, .hero button { width: 100%; }
}

.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--hover); color: var(--muted); vertical-align: 1px; }
.alert .muted { white-space: pre-line; }
details.more { border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; color: var(--accent); margin-bottom: 8px; }
details.more label { margin-top: 10px; }

/* MARK: Home — a quiet control panel */
.cockpit { max-width: 1240px; margin: 0 auto; padding: 28px 32px 80px; display: grid; gap: 20px; }
.state { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.state-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.state h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 4px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; margin-top: 9px; flex: none; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.state.attention .pulse { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 18%, transparent); }
.gaps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.gaps a { color: var(--text); font-size: 14px; border-bottom: 1px dashed var(--line-strong); }
.gaps a:hover { text-decoration: none; border-bottom-color: var(--accent); color: var(--accent); }
.gaps li::before { content: '—'; color: var(--faint); margin-right: 8px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 10px; }

.figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.figure { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out); }
.figure:hover { text-decoration: none; border-color: var(--line-strong); background-color: var(--surface-2); }
.figure:active { transform: scale(0.98); }
.figure-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.figure.bad .figure-value { color: var(--bad); } .figure.warn .figure-value { color: var(--warn); }
.figure-label { color: var(--muted); font-size: 13px; }
.figure-sub { color: var(--faint); font-size: 12px; }

.cockpit-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.side { display: grid; gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 16px 18px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.panel-head .count { font-size: 12px; color: var(--faint); }
.empty-state { color: var(--muted); font-size: 14px; padding: 14px 0 6px; }

.event { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.event:first-of-type { border-top: 0; }
.event-rail { width: 3px; border-radius: 3px; background: var(--line-strong); flex: none; }
.event.important .event-rail { background: var(--bad); }
.event-body { flex: 1; min-width: 0; }
.event-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.event h3 { margin: 0; font-size: 15px; font-weight: 600; }
.event time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.event-subject { margin: 4px 0 0; font-size: 14px; color: var(--text); }
.event-detail { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); white-space: pre-line; }
.event-source { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.event-source .src, .event-source .cert { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.event-source .src { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.event-actions { display: flex; gap: 8px; margin-top: 10px; }
.event.fresh { animation: fresh 1600ms var(--ease-out) 1; }
@keyframes fresh { 0% { background: color-mix(in srgb, var(--accent) 14%, transparent); } 100% { background: transparent; } }

/* Timeline: the only chart. Filled dots — hearings, hollow rings — planned checks. */
.timeline { position: relative; padding: 4px 6px 0; }
.tl-axis { position: relative; height: 18px; font-size: 11px; color: var(--faint); }
.tl-tick { position: absolute; left: var(--x, 0); transform: translateX(-50%); white-space: nowrap; }
.tl-tick:first-child { transform: none; } .tl-tick:last-child { transform: translateX(-100%); }
.tl-track { position: relative; height: 62px; margin-top: 4px; border-top: 1px solid var(--line-strong);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / 30 * 7) 100%; }
.tl-mark { position: absolute; left: var(--x, 0); top: calc(8px + var(--y, 0px)); width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--mark-hearing); box-shadow: 0 0 0 2px var(--surface); }
.tl-mark.check { background: var(--surface); border: 2px solid var(--mark-check); }
.tl-mark:focus-visible, .tl-mark:hover { z-index: 2; }
.tl-tip { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%) scale(0.97); opacity: 0; pointer-events: none; white-space: nowrap; font-size: 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; transition: opacity 140ms ease, transform 140ms var(--ease-out); transform-origin: bottom center; }
.tl-mark:hover .tl-tip, .tl-mark:focus-visible .tl-tip { opacity: 1; transform: translateX(-50%) scale(1); }
.tl-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 8px 6px 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--mark-hearing); }
.dot.check { background: transparent; border: 2px solid var(--mark-check); width: 9px; height: 9px; }
.tl-list { list-style: none; margin: 8px 0 0; padding: 0; }
.tl-list a { display: flex; align-items: baseline; gap: 10px; padding: 8px 6px; border-radius: 8px; color: var(--text); }
.tl-list a:hover { background: var(--hover); text-decoration: none; }
.tl-date { color: var(--muted); font-size: 13px; min-width: 42px; }
.tl-label { display: block; font-size: 14px; } .tl-sub { display: block; font-size: 12px; color: var(--muted); }

.sources { list-style: none; margin: 0; padding: 0; }
.source a { display: flex; align-items: flex-start; gap: 12px; padding: 10px 6px; border-radius: 8px; color: var(--text); }
.source a:hover { background: var(--hover); text-decoration: none; }
.source + .source { border-top: 1px solid var(--line); }
.source-state { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--ok); }
.source.warn .source-state { background: var(--warn); } .source.bad .source-state { background: var(--bad); } .source.off .source-state { background: transparent; border: 1.5px solid var(--faint); }
.source-name { display: block; font-size: 14px; } .source-meta { display: block; font-size: 12px; color: var(--muted); }
.source-problem { display: block; font-size: 12px; color: var(--warn); } .source.bad .source-problem { color: var(--bad); }
.source-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.source.warn .source-label { color: var(--warn); } .source.bad .source-label { color: var(--bad); }

@media (max-width: 1100px) { .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cockpit-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .cockpit { padding: 16px 12px 96px; gap: 14px; }
  .state { flex-direction: column; padding: 16px; }
  .state form, .state .primary { width: 100%; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-top { flex-direction: column; gap: 2px; }
  .cockpit-grid, .side { gap: 14px; }
  .tl-tick:nth-child(even) { display: none; }
}

/* MARK: Motion — short, meaningful, and off when the system asks for less movement */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.list-pane { view-transition-name: list-pane; }
.detail-pane { view-transition-name: detail-pane; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; animation-timing-function: var(--ease-out); }
::view-transition-old(detail-pane) { animation: vt-out 160ms var(--ease-out) both; }
::view-transition-new(detail-pane) { animation: vt-in 240ms var(--ease-out) both; }
::view-transition-group(sidebar) { animation: none; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
button, .button { transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease; }
button:active, .button:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .event.fresh { animation: none; }
  button:active, .button:active, .figure:active { transform: none; }
  .tl-tip { transition: opacity 0s; }
}

/* MARK: HUD layer — overrides the base components above */
h1, h2, .pane-head h1 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; }
.mono, code, kbd, .count, time { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 0; box-shadow: 0 0 14px var(--glow-a); }

/* Corner brackets — painted with gradients, so no extra markup or pseudo-elements are taken. */
.card, .panel, .state, .figure, .table-wrap, .login .form, .menu-body {
  --b: var(--accent);
  border-radius: var(--radius); border-color: var(--line);
  background-color: color-mix(in srgb, var(--surface) 88%, transparent);
  background-image:
    linear-gradient(var(--b), var(--b)), linear-gradient(var(--b), var(--b)),
    linear-gradient(var(--b), var(--b)), linear-gradient(var(--b), var(--b));
  background-repeat: no-repeat;
  background-size: 14px 2px, 2px 14px, 14px 2px, 2px 14px;
  background-position: -1px -1px, -1px -1px, calc(100% + 1px) calc(100% + 1px), calc(100% + 1px) calc(100% + 1px);
}
.figure.bad { --b: var(--bad); } .figure.warn { --b: var(--warn); }

/* Sidebar and navigation */
.sidebar { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--sidebar)), var(--sidebar) 45%); border-right-color: var(--line); padding: 20px 12px; }
.brand { font-family: var(--display); font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); font-size: 14px; text-shadow: 0 0 12px var(--glow-a); padding: 4px 10px 6px; }
.brand img { filter: drop-shadow(0 0 6px var(--glow-a)); }
.brand-sub { display: block; font: 500 10px var(--mono); letter-spacing: .14em; color: var(--muted); text-shadow: none; padding: 0 10px 18px; text-transform: uppercase; }
.nav-section { font: 500 10.5px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.nav { font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-radius: 0; padding: 10px 10px; position: relative; transition: color 160ms ease, background-color 160ms ease; }
.nav .icon { width: 18px; height: 18px; opacity: .8; }
.nav:hover { color: var(--text); background: var(--hover); }
.nav.active { color: var(--accent); background:
  linear-gradient(var(--accent), var(--accent)) left top / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) left top / 1px 10px no-repeat,
  linear-gradient(var(--accent), var(--accent)) right top / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) right top / 1px 10px no-repeat,
  linear-gradient(var(--accent), var(--accent)) left bottom / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) left bottom / 1px 10px no-repeat,
  linear-gradient(var(--accent), var(--accent)) right bottom / 10px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) right bottom / 1px 10px no-repeat,
  var(--selected); text-shadow: 0 0 10px var(--glow-a); font-weight: 600; }
.nav.active .icon { opacity: 1; filter: drop-shadow(0 0 4px var(--glow-a)); }
.badge { border-radius: 0; font-family: var(--mono); color: #1a1205; background: var(--warn); box-shadow: 0 0 10px color-mix(in srgb, var(--warn) 50%, transparent); }
.sidebar-foot button.link { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 10px; }
.sidebar-foot button.link:hover { color: var(--accent); }

/* Buttons: cut corners, mono caps */
button, .button { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; border-radius: 0; min-height: 36px; padding: 6px 14px;
  background: transparent; color: var(--accent); border: 1px solid var(--line-strong);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
button:hover, .button:hover { background: var(--hover); border-color: var(--accent); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: 0 0 22px var(--glow-a); }
button.primary:hover, .button.primary:hover { filter: brightness(1.1); }
button.small, .button.small { min-height: 28px; font-size: 11px; padding: 3px 10px; }
button.link { clip-path: none; text-transform: none; letter-spacing: 0; font: inherit; }
/* Inputs */
input, select, textarea { border-radius: 0; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); border-color: var(--line); transition: border-color 160ms ease, box-shadow 160ms ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 16px -4px var(--glow-a); }
.search input { background: color-mix(in srgb, var(--bg) 50%, var(--surface)); border-color: var(--line); font-family: var(--mono); font-size: 13px; }
.form label, legend, .field span, th { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field b { font-family: var(--font); }
/* Status capsules */
.pill { border-radius: 0; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); padding: 3px 8px; }
.pill i { box-shadow: 0 0 6px var(--c); border-radius: 0; transform: rotate(45deg); width: 6px; height: 6px; }
.pill.neutral, .pill:not(.ok):not(.warn):not(.bad):not(.info) { color: var(--muted); }
/* Segmented */
.segmented { background: transparent; border: 1px solid var(--line); border-radius: 0; padding: 2px; }
.segmented a { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-radius: 0; transition: color 160ms ease, background-color 160ms ease; }
.segmented a:hover { color: var(--text); }
.segmented a.on { background: var(--selected); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-strong); text-shadow: 0 0 8px var(--glow-a); }
/* Lists and panes */
.list-pane { background: color-mix(in srgb, var(--surface) 70%, transparent); border-right-color: var(--line); }
.list a { border-radius: 0; position: relative; transition: background-color 140ms ease; }
.list a.selected { background: var(--selected); box-shadow: inset 2px 0 0 var(--accent); }
.pane-head h1 { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.count { color: var(--accent); font-size: 13px; }
h3 { font: 600 11.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 24px; }
.detail-pane h2 { font-size: 22px; }
.row, .field { border-bottom-color: var(--line); }
.toast { border-radius: 0; background: var(--surface-2); color: var(--text); border: 1px solid var(--accent); box-shadow: 0 0 24px -6px var(--glow-a); font-family: var(--mono); font-size: 13px; }
.toast button.link { color: var(--accent); }
.progress-bar { background: var(--surface-2); border-bottom-color: var(--line); font-family: var(--mono); }
.progress-bar progress { accent-color: var(--accent); }
.empty-state, .placeholder { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.login h1 { font-family: var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); text-shadow: 0 0 14px var(--glow-a); font-size: 18px; }

/* MARK: HUD home */
.ticker { overflow: hidden; border-block: 1px solid var(--line); font: 11.5px var(--mono); letter-spacing: .06em; color: var(--muted); white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: inline-flex; padding: 7px 0; animation: tick 50s linear infinite; }
.ticker-track span { padding-right: 28px; } .ticker-track b { color: var(--accent); font-weight: 500; } .ticker-track .w { color: var(--warn); } .ticker-track .x { color: var(--bad); }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.state { position: relative; overflow: hidden; }
.state::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 28%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 10%, transparent), transparent); animation: scan 7s var(--ease-out) infinite; pointer-events: none; }
@keyframes scan { 0% { transform: translateX(-110%); } 55%, 100% { transform: translateX(400%); } }
.state-label, .panel-head h2 { font: 500 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.state-label { margin-bottom: 6px; }
.state-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.state h1 { font-family: var(--display); font-size: 28px; letter-spacing: .01em; }
.state h1 .n { color: var(--warn); text-shadow: 0 0 14px color-mix(in srgb, var(--warn) 50%, transparent); font-family: var(--mono); }
.state.calm h1 .n { color: var(--ok); text-shadow: 0 0 14px color-mix(in srgb, var(--ok) 45%, transparent); }
.pulse { border-radius: 0; transform: rotate(45deg); animation: breathe 2.4s ease-in-out infinite; }
.gaps a { font-family: var(--mono); font-size: 13px; color: var(--text); border-bottom: 0; }
.gaps li::before { content: '▲'; color: var(--warn); font-size: 10px; }
.meta { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.figure-value { font: 600 32px var(--mono); letter-spacing: -.02em; }
.figure.bad .figure-value { text-shadow: 0 0 16px color-mix(in srgb, var(--bad) 45%, transparent); }
.figure.warn .figure-value { text-shadow: 0 0 16px color-mix(in srgb, var(--warn) 45%, transparent); }
.figure-label { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.figure-sub { font: 12px var(--mono); color: var(--accent); }
.figure:hover { border-color: var(--line-strong); background-color: var(--surface-2); }
.panel-head h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.panel-head { gap: 10px; }
.event { border-top: 1px dashed var(--line); }
.event-rail { width: 2px; border-radius: 0; }
.event.important .event-rail { box-shadow: 0 0 10px var(--bad); }
.event.important h3::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; vertical-align: 2px; background: var(--bad); box-shadow: 0 0 8px var(--bad); transform: rotate(45deg); animation: blink 1.4s steps(2) infinite; }
.event h3 { font: 600 15.5px var(--font); letter-spacing: 0; text-transform: none; color: var(--text); margin: 0; }
.event time { font-size: 11.5px; }
.event-source .src, .event-source .cert { border-radius: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }
.event-source .src { text-transform: uppercase; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes breathe { 50% { opacity: .45; } }
.event.fresh { animation: fresh 1600ms var(--ease-out) 1; }

/* Timeline: an axis that draws itself once, diamonds for marks */
.tl-track { border-top: 0; background-image: none; }
.tl-track::before { content: ''; position: absolute; left: 0; right: 0; top: 13px; height: 1px; background: var(--line-strong); }
.tl-track::after { content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 3px; background: linear-gradient(90deg, var(--accent), transparent 85%); transform-origin: left; animation: draw 1.2s var(--ease-out) both; box-shadow: 0 0 10px var(--glow-a); }
@keyframes draw { from { transform: scaleX(0); } }
.tl-mark { border-radius: 0; background: transparent; box-shadow: none; width: 14px; height: 14px; margin-left: -7px; top: calc(6px + var(--y, 0px)); z-index: 1; }
.tl-mark::before { content: ''; position: absolute; inset: 2px; transform: rotate(45deg); background: var(--mark-hearing); box-shadow: 0 0 10px var(--mark-hearing); animation: pop 420ms var(--ease-out) both; animation-delay: calc(300ms + var(--i, 0) * 60ms); }
.tl-mark.check { background: transparent; border: 0; }
.tl-mark.check::before { background: var(--bg); border: 1.5px solid var(--mark-check); box-shadow: none; }
.tl-tip { border-radius: 0; font-family: var(--mono); }
@keyframes pop { from { opacity: 0; transform: rotate(45deg) scale(.3); } }
.tl-axis { font-family: var(--mono); letter-spacing: .04em; }
.dot { border-radius: 0; transform: rotate(45deg); width: 8px; height: 8px; }
.dot.check { border-radius: 0; background: transparent; border: 1.5px solid var(--mark-check); width: 8px; height: 8px; }
.tl-date { font-family: var(--mono); color: var(--accent); }
.tl-list a { border-radius: 0; }
.source-state { border-radius: 50%; animation: breathe 2.6s ease-in-out infinite; box-shadow: 0 0 8px var(--ok); }
.source.warn .source-state { box-shadow: 0 0 8px var(--warn); } .source.bad .source-state { box-shadow: 0 0 8px var(--bad); animation-duration: 1s; }
.source.off .source-state { animation: none; box-shadow: none; }
.source-label { font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ok); }
.source-meta, .source-problem { font-family: var(--mono); font-size: 11.5px; }
.source a { border-radius: 0; }
.source + .source { border-top-style: dashed; }
.appear { animation: rise 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 820px) {
  .sidebar { background: color-mix(in srgb, var(--sidebar) 94%, transparent); border-top-color: var(--line); }
  .nav { font-size: 9.5px; letter-spacing: .06em; }
  .nav.active { background: none; box-shadow: inset 0 2px 0 var(--accent); }
  .brand-sub { display: none; }
  .state h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .state::after, .pulse, .source-state, .event.important h3::before { animation: none; }
  .tl-track::after, .tl-mark::before, .appear { animation: none; }
}
.form label.check, .form label.radio, label.check, label.radio { font: 400 15px var(--font) !important; letter-spacing: 0; text-transform: none; color: var(--text) !important; }
