:root {
  --bg: #0f1419; --panel: #171e26; --line: #26313d; --text: #dfe6ee; --muted: #8796a8;
  --accent: #3fa7ff; --ok: #2ecc71; --warn: #f0b429; --bad: #ff5c5c; --off: #5c6b7a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
code { background: #0b1016; padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.muted { color: var(--muted); } .small { font-size: 0.85em; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.ok-t { color: var(--ok); } .warn-t { color: var(--warn); } .bad-t { color: var(--bad); }
header.top { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: #0b1016; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
nav a.on, nav a:hover { color: var(--text); background: var(--panel); }
.logout { margin-left: auto; }
main { max-width: 1400px; margin: 0 auto; padding: 20px; }
footer { text-align: center; color: var(--muted); font-size: 0.8em; padding: 20px; }
h1 { font-size: 1.5em; margin: 0; } h2 { font-size: 1.05em; margin: 0 0 10px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cols > .panel { margin-bottom: 0; } .cols { margin-bottom: 16px; }
.btn { display: inline-block; background: #223040; color: var(--text); border: 1px solid #2f3f52; padding: 7px 14px; border-radius: 7px; cursor: pointer; font: inherit; }
.btn:hover { background: #2a3b4f; } .btn.primary { background: #1f6fd1; border-color: #2a7fe6; } .btn.primary:hover { background: #2a7fe6; }
.btn.sm { padding: 3px 9px; font-size: 0.85em; } .btn:disabled { opacity: .6; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; }
form.inline { display: inline; }
label { display: block; margin: 0 0 12px; color: var(--muted); font-size: 0.9em; }
label small { display: block; font-size: 0.85em; }
label.chk { display: flex; gap: 8px; align-items: center; color: var(--text); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; background: #0b1016; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; }
label.chk input { width: auto; margin: 0; }
input[type=range] { padding: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
details summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.bar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; }
.flash.ok { border-color: #1d6b42; background: #0f2a1d; } .flash.error { border-color: #7a2b2b; background: #2a1212; }
.flash.warn { border-color: #6b5718; background: #2a2210; }
.login { max-width: 360px; margin: 10vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.login h1 { margin-bottom: 4px; }
.summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8em; font-weight: 600; background: #24303c; color: var(--text); }
.pill.up { background: #10351f; color: #6fe3a1; } .pill.degraded { background: #3b2f0d; color: #f5cf6b; }
.pill.down { background: #3d1515; color: #ff9b9b; } .pill.off, .pill.unknown { background: #232b33; color: var(--muted); }
.ai-b { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: #13212f; border: 1px solid #23415e; }
.ai-b.warn { background: #2a2210; border-color: #6b5718; } .ai-b.bad { background: #2a1212; border-color: #7a2b2b; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } .flow { grid-template-columns: 1fr !important; } }
.card { display: block; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--off); border-radius: 10px; padding: 14px; }
.card:hover { border-color: #35506b; }
.card.st-up { border-left-color: var(--ok); } .card.st-degraded { border-left-color: var(--warn); } .card.st-down { border-left-color: var(--bad); }
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-f { margin-top: 8px; font-size: 0.8em; }
.flow { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 12px; align-items: start; }
.side .lbl { font-weight: 600; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 0.75em; padding: 1px 7px; border-radius: 999px; border: 1px solid; }
.chip.ok { color: #6fe3a1; border-color: #1d6b42; } .chip.warn { color: #f5cf6b; border-color: #6b5718; } .chip.bad { color: #ff9b9b; border-color: #7a2b2b; }
.talker { margin-top: 6px; color: #ffd27a; font-weight: 600; }
.problems { margin-top: 10px; font-size: 0.85em; color: #f5cf6b; }
.dir { margin-bottom: 10px; } .dir-l { font-size: 0.82em; display: flex; gap: 6px; align-items: center; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #2a3440; display: inline-block; }
.led.tx { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
.meter { position: relative; height: 10px; background: #0b1016; border-radius: 5px; overflow: hidden; margin: 4px 0 2px; border: 1px solid var(--line); }
.meter .bar { height: 100%; transition: width .15s linear; }
.bar.low { background: #3fa7ff; } .bar.good { background: var(--ok); } .bar.hot { background: var(--bad); }
.meter .mk { position: absolute; top: 0; bottom: 0; width: 1px; background: #4a5a6c; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .levels { grid-template-columns: 1fr; } }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 0.85em; }
tr.dim td { opacity: .55; }
.lvl { font-size: 0.75em; padding: 1px 7px; border-radius: 4px; background: #24303c; }
.lvl.ok { background: #10351f; color: #6fe3a1; } .lvl.warn { background: #3b2f0d; color: #f5cf6b; } .lvl.error { background: #3d1515; color: #ff9b9b; }
tr.lv-error td { color: #ffb3b3; } tr.lv-warn td { color: #f5d98f; }
.log { background: #0b1016; border: 1px solid var(--line); border-radius: 6px; padding: 10px; max-height: 420px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.ask { display: flex; gap: 8px; } .ask input { margin: 0; } .ask select { width: auto; margin: 0; }
.answer { white-space: pre-wrap; margin-top: 12px; }
.report { border-left: 3px solid var(--ok); padding: 4px 12px; margin-bottom: 14px; }
.report.warn { border-color: var(--warn); } .report.bad { border-color: var(--bad); }
.refl-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--off); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.refl-card.st-up { border-left-color: var(--ok); } .refl-card.st-down { border-left-color: var(--bad); }
.refl-card .talker { margin: 0; }
details.inline-edit { display: inline-block; text-align: left; }
details.inline-edit[open] { display: block; background: #121a22; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 6px; }
details summary.btn { list-style: none; display: inline-block; }
details summary.btn::-webkit-details-marker { display: none; }
tr.onair td { background: #2a2210; }
code.secret { cursor: pointer; }
.flow2 { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 12px; align-items: start; }
.flow2 .lbl { font-weight: 600; margin-bottom: 4px; }
@media (max-width: 600px) { .flow2 { grid-template-columns: 1fr; } }
.boxrow { display: flex; flex-wrap: wrap; gap: 10px; }
.boxchip { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--off); border-radius: 8px; padding: 8px 12px; }
.boxchip.up { border-left-color: var(--ok); } .boxchip.degraded { border-left-color: var(--warn); } .boxchip.down { border-left-color: var(--bad); }
.sysgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sysgrid > div > span.muted:first-child { display: block; font-size: 0.8em; }
.copyline { display: flex; gap: 8px; align-items: center; background: #0b1016; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.copyline code { background: none; flex: 1; word-break: break-all; }
.card.st-off { border-left-color: var(--off); }
.pill.off { background: #232b33; color: var(--muted); }
main.public { max-width: 1000px; }
.panel.pinned { border-color: #6b5718; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.chart svg { width: 100%; height: 70px; background: #0b1016; border: 1px solid var(--line); border-radius: 6px; margin-top: 4px; }

/* compact hubs / TG links */
.hub-h { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.hub-h a { color: inherit; text-decoration: none; } .hub-h a:hover { text-decoration: underline; }
.panel.hub { border-left: 4px solid #2c3a4d; } .panel.hub.st-up { border-left-color: #1d6b42; }
.panel.hub.st-degraded { border-left-color: #8a6d1a; } .panel.hub.st-down { border-left-color: #7a2b2b; }
.ltable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ltable th { text-align: left; font-weight: 500; color: #8a97a8; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid #243042; }
.ltable td { padding: 6px 8px; border-bottom: 1px solid #1b2433; vertical-align: middle; }
.ltable tbody tr { cursor: pointer; } .ltable tbody tr:hover { background: #141c28; }
.ltable td.tgs { font-family: ui-monospace, monospace; font-size: 13px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #555; margin: 0 4px; vertical-align: middle; }
.dot.ok { background: #2fbf71; } .dot.warn { background: #e0b23a; } .dot.bad { background: #e05555; }
.aud.on { color: #2fbf71; font-weight: 600; }
.hub-h .talker, .ltable .talker { margin: 0 0 0 4px; font-size: 13px; }
