/* ─────────────────────────────────────────────────────────────────────────────
   PHMS Central — control-room theme.
   Dark navy with a teal accent by default; a light theme for bright rooms and
   printing. Every colour is a token below, so the two themes cannot drift apart.
   ───────────────────────────────────────────────────────────────────────────── */

:root, [data-theme="dark"] {
  --bg:        #0a1120;
  --bg-2:      #0d1628;
  --panel:     #111c31;
  --panel-2:   #15223b;
  --panel-3:   #1a2a47;
  --border:    #22314f;
  --border-2:  #2c3d60;
  --text:      #dde6f5;
  --text-2:    #b3c1d9;
  --muted:     #7f90ad;
  --faint:     #56688a;
  --accent:    #17c3b2;
  --accent-2:  #0ea5e9;
  --accent-bg: rgba(23, 195, 178, .12);
  --ok:        #22c55e;
  --ok-bg:     rgba(34, 197, 94, .13);
  --warn:      #f5a524;
  --warn-bg:   rgba(245, 165, 36, .14);
  --crit:      #f04352;
  --crit-bg:   rgba(240, 67, 82, .14);
  --info:      #5aa9ff;
  --info-bg:   rgba(90, 169, 255, .13);
  --trip:      #ff6b6b;
  --close:     #34d399;
  --shadow:    0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.18);
  --grid:      rgba(127, 144, 173, .14);
  --code-bg:   #0a1426;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:        #eef2f8;
  --bg-2:      #e6ecf5;
  --panel:     #ffffff;
  --panel-2:   #f6f8fc;
  --panel-3:   #edf2f9;
  --border:    #d8e0ec;
  --border-2:  #c7d2e3;
  --text:      #142036;
  --text-2:    #33415c;
  --muted:     #5f6f8c;
  --faint:     #8795ad;
  --accent:    #0b9f91;
  --accent-2:  #0284c7;
  --accent-bg: rgba(11, 159, 145, .10);
  --ok:        #16a34a;
  --ok-bg:     rgba(22, 163, 74, .10);
  --warn:      #c47a06;
  --warn-bg:   rgba(196, 122, 6, .12);
  --crit:      #d42a3a;
  --crit-bg:   rgba(212, 42, 58, .10);
  --info:      #2563eb;
  --info-bg:   rgba(37, 99, 235, .10);
  --trip:      #d42a3a;
  --close:     #0e9f6e;
  --shadow:    0 1px 2px rgba(16,24,40,.06), 0 6px 18px rgba(16,24,40,.06);
  --grid:      rgba(95, 111, 140, .16);
  --code-bg:   #f2f5fa;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
code, kbd, .mono { font-family: "JetBrains Mono", "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace; }
code { background: var(--code-bg); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
kbd { background: var(--panel-3); border: 1px solid var(--border-2); border-bottom-width: 2px; padding: 0 5px; border-radius: 4px; font-size: 11px; color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1 1 auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.gap-s { gap: 6px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Shell ─────────────────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--bg-2) 240px, var(--bg) 240px); }

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #04121c; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.brand .name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand .sub { color: var(--muted); font-size: 11.5px; }

.nav { padding: 10px 10px; overflow-y: auto; flex: 1; }
.nav-section { color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-2); padding: 7px 10px; border-radius: 8px; font-weight: 500;
}
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-bg); color: var(--accent); }
.nav a .count { margin-left: auto; background: var(--crit); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.nav a .count.warn { background: var(--warn); color: #1b1300; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--border); color: var(--faint); font-size: 11.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.jump {
  display: flex; align-items: center; gap: 10px; min-width: 300px;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  border-radius: 9px; padding: 7px 10px; cursor: pointer; font: inherit;
}
.jump:hover { border-color: var(--border-2); color: var(--text-2); }
.jump kbd { margin-left: auto; }
.env {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-bg);
  padding: 3px 9px; border-radius: 999px;
}
.clock { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 500; }
.icon-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--text-2);
  border-radius: 8px; width: 34px; height: 32px; display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.user-menu { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--accent); border: 1px solid var(--border-2); }

.content { padding: 22px 26px 40px; max-width: 1600px; width: 100%; }

.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .titles { flex: 1 1 auto; min-width: 0; }
.crumbs { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.subtitle { color: var(--muted); margin-top: 4px; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.card > .card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.card > .card-head h2, .card > .card-head h3 { font-size: 14px; }
.card > .card-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card > .card-body { padding: 14px 16px; }
.card > .card-body.flush { padding: 0; }
.card .step { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1200px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; background: var(--bg); } .sidebar { position: static; height: auto; } .g2, .g3 { grid-template-columns: 1fr; } .jump { min-width: 0; } }

.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .foot { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.ok .value { color: var(--ok); }
.kpi.warn .value { color: var(--warn); }
.kpi.crit .value { color: var(--crit); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── Tables ────────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--panel-2); position: sticky; top: 0;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 6px 10px; }
.table tr.clickable { cursor: pointer; }
.table .sub { color: var(--muted); font-size: 12px; }
.table input, .table select { width: 100%; min-width: 60px; }

/* ── Status ────────────────────────────────────────────────────────────────── */

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot.crit { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-bg); }
.dot.info { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.dot.off { background: var(--faint); }
.dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.crit { color: var(--crit); }
.status.off { color: var(--faint); }
.status.info { color: var(--info); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--border-2); color: var(--text-2); background: var(--panel-2); white-space: nowrap;
}
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.crit { color: var(--crit); background: var(--crit-bg); border-color: transparent; }
.pill.info { color: var(--info); background: var(--info-bg); border-color: transparent; }
.pill.accent { color: var(--accent); background: var(--accent-bg); border-color: transparent; }
.pill.trip { color: var(--trip); background: var(--crit-bg); border-color: transparent; }
.pill.close { color: var(--close); background: var(--ok-bg); border-color: transparent; }

.breaker {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .06em;
  padding: 6px 14px; border-radius: 9px; font-size: 13px; border: 1px solid transparent;
}
.breaker.closed { color: var(--close); background: var(--ok-bg); border-color: color-mix(in srgb, var(--close) 35%, transparent); }
.breaker.open { color: var(--trip); background: var(--crit-bg); border-color: color-mix(in srgb, var(--trip) 35%, transparent); }
.breaker.unknown { color: var(--muted); background: var(--panel-2); border-color: var(--border); }

.chan { display: inline-flex; gap: 3px; }
.chan i { display: inline-block; min-width: 22px; text-align: center; font-style: normal; font-size: 9.5px; font-weight: 700; border-radius: 4px; padding: 1px 4px; background: var(--panel-3); color: var(--faint); white-space: nowrap; }
.chan i.fresh { background: var(--ok-bg); color: var(--ok); }
.chan i.unknown { background: var(--info-bg); color: var(--info); }
.chan i.stale { background: var(--panel-3); color: var(--faint); text-decoration: line-through; }
.chan i.missing { background: var(--crit-bg); color: var(--crit); }
.chan i.waiting { background: var(--warn-bg); color: var(--warn); }

.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; vertical-align: -2px; }
.bars i { width: 4px; background: var(--border-2); border-radius: 1px; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 7px; } .bars i:nth-child(3) { height: 10px; }
.bars i:nth-child(4) { height: 12px; } .bars i:nth-child(5) { height: 14px; }
.bars i.on { background: var(--accent); }

.zone-Normal { color: var(--text); }
.zone-Warning { color: var(--warn); }
.zone-Critical { color: var(--crit); }

/* ── Forms & buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  font: inherit; font-weight: 600; font-size: 13px;
  padding: 7px 13px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2);
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: #03201d; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: transparent; color: var(--crit); border-color: color-mix(in srgb, var(--crit) 50%, transparent); }
.btn.danger:hover { background: var(--crit-bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--border); }
.btn.small { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

label { display: block; font-weight: 600; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; min-height: 420px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); vertical-align: -3px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); }
.inline-form { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 16px; }
.validation-summary-errors ul, .field-validation-error { color: var(--crit); }
.input-validation-error { border-color: var(--crit) !important; }

.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.flash.crit { background: var(--crit-bg); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 30%, transparent); }
.flash.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.seg a, .seg button { padding: 6px 11px; color: var(--text-2); font-weight: 600; font-size: 12.5px; background: transparent; border: 0; border-right: 1px solid var(--border-2); cursor: pointer; font-family: inherit; }
.seg a:last-child, .seg button:last-child { border-right: 0; }
.seg a.active, .seg button.active { background: var(--accent-bg); color: var(--accent); }
.seg a:hover { text-decoration: none; background: var(--panel-2); }

.copy-field { display: flex; gap: 8px; align-items: stretch; }
.copy-field input, .copy-field .value { flex: 1; font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; }
.copy-field .value { background: var(--code-bg); border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.secret { border: 1px dashed var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 12px 14px; }
pre.code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; margin: 0; line-height: 1.55; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.checklist li:last-child { border-bottom: 0; }
.checklist .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; margin-top: 1px; }
.checklist .mark.ok { background: var(--ok-bg); color: var(--ok); }
.checklist .mark.no { background: var(--crit-bg); color: var(--crit); }
.checklist .mark.wait { background: var(--warn-bg); color: var(--warn); }
.checklist .mark.na { background: var(--panel-3); color: var(--faint); }
.checklist .what { font-weight: 600; }
.checklist .why { color: var(--muted); font-size: 12.5px; }

.help-list { margin: 0; padding-left: 18px; }
.help-list li { margin-bottom: 9px; }
.help-list b { color: var(--text); }

.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty .big { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }

/* ── Live values ───────────────────────────────────────────────────────────── */

.values { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.value-tile { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.value-tile .n { color: var(--muted); font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value-tile .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.value-tile .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.value-tile .r { color: var(--faint); font-size: 10.5px; }
.value-tile.Warning { border-color: color-mix(in srgb, var(--warn) 60%, transparent); background: var(--warn-bg); }
.value-tile.Critical { border-color: color-mix(in srgb, var(--crit) 60%, transparent); background: var(--crit-bg); }
.value-tile.Warning .v { color: var(--warn); }
.value-tile.Critical .v { color: var(--crit); }
.group-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 16px 0 8px; }
.group-title:first-child { margin-top: 0; }

/* ── Charts (uPlot) ────────────────────────────────────────────────────────── */

.chart { width: 100%; min-height: 260px; }
.chart-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 10px 4px; }
.chart-title { display: flex; gap: 10px; align-items: baseline; margin: 2px 4px 6px; }
.chart-title b { font-size: 13px; }
.chart-title .muted { font-size: 12px; }
.uplot, .uplot * { font-family: inherit !important; }
.uplot .u-legend { color: var(--text-2); font-size: 12px; }
.uplot .u-legend .u-marker { border-radius: 2px; }
.uplot .u-select { background: rgba(23, 195, 178, .12); }

/* ── Command palette ───────────────────────────────────────────────────────── */

.palette-backdrop { position: fixed; inset: 0; background: rgba(3, 8, 18, .55); z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette { width: min(640px, 92vw); background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.45); overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 15px 18px; font-size: 15px; background: transparent; }
.palette input:focus { box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.palette li a .k { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; width: 86px; flex: none; }
.palette li a .s { color: var(--muted); font-size: 12px; margin-left: auto; }
.palette li.sel a, .palette li a:hover { background: var(--accent-bg); text-decoration: none; }
.palette .hint { padding: 8px 14px; color: var(--faint); font-size: 11.5px; border-top: 1px solid var(--border); }

/* ── Sign-in ───────────────────────────────────────────────────────────────── */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(23,195,178,.12), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, rgba(14,165,233,.10), transparent 60%), var(--bg); }
.auth .card { width: min(420px, 100%); }
.auth .brand { border: 0; padding: 22px 22px 6px; }

/* ── Misc ──────────────────────────────────────────────────────────────────── */

.kv-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.kv-inline div span { color: var(--muted); margin-right: 6px; }
.note { color: var(--muted); font-size: 12.5px; }
.warn-text { color: var(--warn); }
.crit-text { color: var(--crit); }
.ok-text { color: var(--ok); }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--faint); border: 1px solid var(--border-2); padding: 0 5px; border-radius: 4px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 12px; }
.diff-add { color: var(--ok); }
.diff-del { color: var(--crit); }
.diff-chg { color: var(--warn); }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--border); padding: 12px 0; margin-top: 18px; display: flex; gap: 10px; align-items: center; z-index: 5; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.more[open] summary { margin-bottom: 10px; }
.spark { height: 34px; }
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
