/* Cortex HUD */
:root {
  --bg: #04080e;
  --bg-2: #071321;
  --panel: rgba(8, 22, 36, 0.72);
  --panel-solid: #0a1a2a;
  --line: rgba(80, 210, 255, 0.22);
  --line-strong: rgba(80, 210, 255, 0.55);
  --cyan: #43d9ff;
  --cyan-soft: #8fe9ff;
  --cyan-deep: #1384b0;
  --text: #dcf4ff;
  --muted: #a9c8d6;
  --amber: #ffb547;
  --green: #4dffa6;
  --red: #ff6b78;
  --violet: #b9a2ff;
  --glow: 0 0 18px rgba(67, 217, 255, 0.35);
  --font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 6px;
  --gap: 16px;
  --ticker-h: 34px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.4;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--cyan-soft); }
button, input { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--cyan); color: #00121c; padding: 10px 14px; border-radius: var(--radius);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }
.muted { color: var(--muted); }

/* Background: deep vignette + fine grid + scanline shimmer */
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(30, 120, 170, 0.22), transparent 70%),
    radial-gradient(ellipse at 50% 120%, rgba(19, 132, 176, 0.18), transparent 60%),
    linear-gradient(rgba(67, 217, 255, 0.045) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(67, 217, 255, 0.045) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(16px, 2.5vw, 32px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 10, 18, 0.9), rgba(4, 10, 18, 0.55));
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark { width: 44px; height: 44px; filter: drop-shadow(0 0 8px rgba(67, 217, 255, 0.6)); }
.bm-outer { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-dasharray: 10 5; opacity: 0.7; }
.bm-mid { fill: none; stroke: var(--cyan-soft); stroke-width: 2.5; }
.bm-core { fill: var(--cyan); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1; }
.brand-sub { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--cyan); margin-top: 4px; }

.sys-status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(8, 22, 36, 0.8);
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
}
.sys-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sys-status[data-state="ok"] { color: var(--green); border-color: rgba(77, 255, 166, 0.35); }
.sys-status[data-state="ok"] .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.sys-status[data-state="warn"] { color: var(--amber); border-color: rgba(255, 181, 71, 0.4); }
.sys-status[data-state="warn"] .dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.sys-status[data-state="demo"] { color: var(--violet); border-color: rgba(185, 162, 255, 0.4); }
.sys-status[data-state="demo"] .dot { background: var(--violet); box-shadow: 0 0 10px var(--violet); }

.top-actions { display: flex; gap: 10px; }
.menu-btn, .menu-status { display: none; }
[hidden] { display: none !important; }
.views ul { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(8, 22, 36, 0.8); }
.views a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px; border-radius: 999px;
  color: var(--muted); text-decoration: none;
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.views a:hover { color: var(--text); background: rgba(67, 217, 255, 0.1); }
.views a[aria-current="page"] { background: var(--cyan); color: #001520; }
.btn {
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover { background: rgba(67, 217, 255, 0.1); box-shadow: var(--glow); }
.btn-primary { background: linear-gradient(180deg, #2fc4ee, #138ab8); color: #001520; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(180deg, #5fe0ff, #1ba3d6); }
.btn[aria-pressed="true"] { background: rgba(185, 162, 255, 0.16); border-color: var(--violet); color: var(--violet); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.notice {
  margin: 12px clamp(16px, 2.5vw, 32px) 0;
  padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.08); color: #ffe2b5;
}

/* ---------- Layout ---------- */
.hud {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr) minmax(270px, 330px);
  gap: var(--gap);
  padding: var(--gap) clamp(16px, 2.5vw, 32px) 64px;
  max-width: 1720px; margin: 0 auto;
}
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

@media (max-width: 1180px) {
  .hud { grid-template-columns: 1fr 1fr; grid-template-areas: "center center" "left right"; }
  .col-center { grid-area: center; }
  .col-left { grid-area: left; }
  .col-right { grid-area: right; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hud { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .col { display: contents; }
  .date-panel { order: 1; }
  .core-wrap { order: 2; }
  /* Recent files sit right under the folder chips so filtering visibly changes the list. */
  .files-panel { order: 3; }
  .gauges-panel { order: 4; }
  .weather-panel { order: 5; }
  .schedule-panel { order: 6; }
  .launch-panel { order: 7; }
  .activity-panel { order: 8; }
  .rings-panel { order: 9; }
  .systems-panel { order: 11; }
  .brand-sub { display: none; }
  .hud { padding-bottom: var(--gap); }
}

/* ---------- Panels ---------- */
.panel {
  position: relative;
  padding: 16px 18px 18px;
  background: linear-gradient(160deg, rgba(14, 36, 56, 0.78), var(--panel) 45%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(143, 233, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.35);
}
/* Corner brackets */
.panel::before, .panel::after {
  content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none;
  border-color: var(--cyan); border-style: solid; opacity: 0.9;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }

.panel-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: 14px;
}
.panel-title .code { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }

/* ---------- Launchers ---------- */
.launchers { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.launchers a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px 6px 6px;
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: rgba(67, 217, 255, 0.04); font-weight: 600; font-size: 15px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.launchers a:hover { border-color: var(--cyan); background: rgba(67, 217, 255, 0.1); transform: translateX(2px); }
.launch-code {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: linear-gradient(160deg, var(--cyan), var(--cyan-deep));
  color: #001520; font-family: var(--font-display); font-size: 10px; font-weight: 800;
}

/* ---------- Schedule ---------- */
.schedule li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px;
  padding: 10px 0; border-top: 1px dashed var(--line);
}
.schedule li:first-child { border-top: 0; padding-top: 0; }
.sched-when { font-family: var(--font-mono); font-size: 13px; color: var(--cyan); }
.sched-what { font-weight: 600; }
.sched-who { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.sched-in { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; }
.schedule li.is-next .sched-in { color: var(--amber); }

/* ---------- Core ---------- */
.core-wrap {
  position: relative; width: min(100%, 620px); margin: 0 auto; padding: 8px 0;
  container-type: inline-size;
}
.core { position: relative; width: 100%; aspect-ratio: 1; }
.core-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.core-svg .spin-slow { transform-origin: 250px 250px; animation: spin 90s linear infinite; }
.core-svg .spin-rev { transform-origin: 250px 250px; animation: spin 60s linear infinite reverse; }
.core-svg .spin-fast { transform-origin: 250px 250px; animation: spin 24s linear infinite; }
.core-svg .pulse { animation: pulse 4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.45; } }

.core-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 44%; aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: radial-gradient(circle, rgba(10, 30, 46, 0.2), rgba(4, 10, 18, 0.1));
  border: 0; cursor: pointer; text-align: center; padding: 0 6%;
}
.core-center:hover .core-count { filter: drop-shadow(0 0 22px rgba(67, 217, 255, 0.8)); }
.core-kicker { font-family: var(--font-display); font-size: clamp(9px, 1.9cqi, 12px); letter-spacing: 0.3em; text-transform: uppercase; color: var(--cyan); }
.core-count {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 13cqi, 88px); line-height: 1;
  color: #f2fcff; filter: drop-shadow(0 0 14px rgba(67, 217, 255, 0.6)); font-variant-numeric: tabular-nums;
}
.core-label { font-family: var(--font-display); font-size: clamp(9px, 1.9cqi, 12px); letter-spacing: 0.24em; text-transform: uppercase; color: var(--text); }
.core-sub { font-family: var(--font-mono); font-size: clamp(10px, 2cqi, 13px); color: var(--muted); margin-top: 4px; }

.orbit { position: absolute; left: 0; right: 0; top: 8px; aspect-ratio: 1; pointer-events: none; }
.orbit li {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-46cqi) rotate(calc(-1 * var(--a)));
}
.orbit button {
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  min-width: 84px; min-height: 44px; padding: 6px 10px;
  background: rgba(6, 18, 30, 0.88); border: 1px solid var(--line-strong);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.orbit button .n { font-family: var(--font-mono); font-size: 15px; color: var(--cyan-soft); letter-spacing: 0; }
.orbit button:hover { background: rgba(67, 217, 255, 0.16); }
.orbit button[aria-pressed="true"] { background: var(--cyan); color: #001520; }
.orbit button[aria-pressed="true"] .n { color: #001520; }

@media (max-width: 560px) {
  .orbit { position: static; aspect-ratio: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
  .orbit li { position: static; transform: none; }
  .orbit button { min-width: 0; flex-direction: row; gap: 8px; }
}

/* ---------- Gauges ---------- */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.gauge { text-align: center; }
.gauge svg { width: 100%; max-width: 200px; height: auto; display: block; margin: 0 auto; }
.gauge .g-track { fill: none; stroke: rgba(67, 217, 255, 0.12); stroke-width: 12; }
.gauge .g-val { fill: none; stroke-width: 12; stroke-linecap: butt; transition: d 0.8s ease; }
.gauge .g-tick { stroke: rgba(143, 233, 255, 0.5); stroke-width: 1.5; }
.gauge .g-tick.major { stroke: var(--cyan-soft); stroke-width: 2.5; }
.gauge .g-num { fill: var(--muted); font-family: var(--font-mono); font-size: 9px; text-anchor: middle; }
.gauge .g-needle { transition: transform 0.9s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 100px 100px; }
.gauge .g-needle line { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.gauge .g-hub { fill: var(--panel-solid); stroke: var(--cyan); stroke-width: 2; }
.gauge-readout { margin-top: -18px; }
.gauge-value { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.gauge-label { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.gauge-note { font-size: 14px; color: var(--muted); }
.tone-ok { color: var(--green); stroke: var(--green); }
.tone-cyan { color: var(--cyan); stroke: var(--cyan); }
.tone-warn { color: var(--amber); stroke: var(--amber); }
.tone-bad { color: var(--red); stroke: var(--red); }
.tone-idle { color: var(--muted); stroke: var(--muted); }

/* ---------- Activity ---------- */
.activity svg { width: 100%; height: auto; display: block; }
.activity .bar { fill: var(--cyan); opacity: 0.85; }
.activity .bar.today { fill: var(--amber); }
.activity .base { stroke: var(--line-strong); }
.activity .lbl { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.activity-caption { font-size: 15px; color: var(--muted); margin-top: 6px; }

/* ---------- Files ---------- */
/* The title keeps the full width so its number lines up with every other panel; the filter note sits below. */
.files-head .panel-title { margin-bottom: 6px; }
.files-filter { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.files-filter:empty { display: none; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input, .weather-settings input {
  flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px;
  background: rgba(2, 8, 14, 0.7); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.search input::placeholder { color: #93b4c4; }
.files { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; scrollbar-color: var(--cyan-deep) transparent; }
.files li + li { border-top: 1px solid rgba(67, 217, 255, 0.1); }
.file-btn {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  min-height: 48px; padding: 8px 6px; background: none; border: 0; text-align: left; cursor: pointer;
  border-radius: 4px;
}
.file-btn:hover { background: rgba(67, 217, 255, 0.07); }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag {
  display: inline-block; min-width: 64px; padding: 2px 6px; border-radius: 3px; text-align: center;
  font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.tag-inbox { color: var(--amber); }
.tag-notes { color: var(--cyan); }
.tag-index { color: var(--green); }
.tag-profile { color: var(--violet); }
.tag-digest { color: #7cf0d4; }
.tag-retired { color: #c3d6df; }
.files .empty { padding: 18px 6px; color: var(--muted); }

/* ---------- Date tile + ring clock ---------- */
.date-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.date-tile { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.date-day {
  font-family: var(--font-display); font-weight: 800; font-size: 72px; line-height: 0.9; color: #fff;
  text-shadow: 0 0 18px rgba(67, 217, 255, 0.45);
}
.date-month {
  margin-top: 8px; padding: 2px 10px; background: #0b5f80; color: #fff;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
}
.date-weekday { margin-top: 4px; font-family: var(--font-display); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.clock-tz { margin-top: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.ring-clock { position: relative; width: 168px; flex: none; }
.ring-clock svg { width: 100%; height: auto; display: block; }
.ring-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
/* Same gradient display face as the old Local time panel. */
.clock-hm {
  font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1;
  letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 0%, #bdf1ff 55%, #4fb9dc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(67, 217, 255, 0.35));
}
.clock-ampm { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.2em; color: var(--cyan); }
.ring-clock .rc-track { fill: none; stroke: rgba(67, 217, 255, 0.12); stroke-width: 6; }
.ring-clock .rc-sec { fill: none; stroke: var(--cyan); stroke-width: 6; filter: drop-shadow(0 0 4px var(--cyan)); }
.ring-clock .rc-min { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 3; }
.ring-clock .rc-tick { stroke: rgba(143, 233, 255, 0.45); stroke-width: 1.5; }

/* ---------- Weather ---------- */
.wx-loc { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-soft); }
.wx-updated { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.wx-now { display: flex; align-items: center; gap: 14px; margin: 10px 0 6px; }
.wx-temp { font-family: var(--font-display); font-weight: 800; font-size: 54px; line-height: 1; color: #fff; text-shadow: 0 0 16px rgba(67, 217, 255, 0.4); }
.wx-cond { font-size: 20px; font-weight: 700; }
.wx-icon { width: 48px; height: 48px; flex: none; }
.wx-details { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 15px; margin: 10px 0 12px; }
.wx-details dt { color: var(--muted); }
.wx-details dd { margin: 0; font-family: var(--font-mono); font-size: 13px; align-self: center; }
.wx-forecast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wx-day { min-width: 0; padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(67, 217, 255, 0.04); text-align: center; }
.wx-day h3 { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.wx-day abbr { text-decoration: none; }
.wx-day .hi-lo { font-family: var(--font-mono); font-size: 15px; margin-top: 4px; white-space: nowrap; }
/* Two lines are reserved for the condition so every card lines up. */
.wx-day .c { font-size: 13px; color: var(--muted); line-height: 1.2; margin-top: 2px; min-height: 2.4em; display: flex; align-items: center; justify-content: center; }
.wx-day .rain { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.weather-settings { margin-top: 12px; font-size: 15px; }
.weather-settings summary { cursor: pointer; color: var(--cyan-soft); min-height: 32px; display: flex; align-items: center; }
.weather-settings form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.weather-settings .row { display: flex; gap: 8px; }

/* ---------- Rings ---------- */
.rings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ring { display: flex; align-items: center; gap: 10px; }
.ring svg { width: 58px; height: 58px; flex: none; transform: rotate(-90deg); }
.ring .r-track { fill: none; stroke: rgba(67, 217, 255, 0.12); stroke-width: 6; }
.ring .r-val { fill: none; stroke: var(--cyan); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.ring-text b { display: block; font-family: var(--font-display); font-size: 18px; }
.ring-text span { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* ---------- Systems ---------- */
.systems li { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 9px 0; border-top: 1px dashed var(--line); }
.systems li:first-child { border-top: 0; padding-top: 0; }
.sys-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--muted); grid-row: span 2; }
.sys-dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sys-dot.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.sys-dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }
.sys-name { font-weight: 700; }
.sys-detail { font-size: 14px; color: var(--muted); }
.sys-meter { grid-column: 2; height: 4px; margin-top: 6px; background: rgba(67, 217, 255, 0.12); border-radius: 2px; overflow: hidden; }
.sys-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan-deep), var(--cyan)); }

/* ---------- Footer ticker ---------- */
/* The ticker is fixed, so reserve its height at the bottom of every page. */
body { padding-bottom: calc(var(--ticker-h) + env(safe-area-inset-bottom)); }
.ticker {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  background: rgba(3, 8, 14, 0.92);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.06em;
}

/* ---------- Viewer ---------- */
.viewer {
  width: min(760px, calc(100vw - 32px)); max-height: min(80vh, 900px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel-solid); color: var(--text);
  box-shadow: 0 0 0 1px rgba(67, 217, 255, 0.1), 0 30px 80px rgba(0, 0, 0, 0.6), var(--glow);
}
.viewer::backdrop { background: rgba(1, 4, 8, 0.7); backdrop-filter: blur(3px); }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid); }
.viewer-kicker { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.viewer-head h2 { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.06em; word-break: break-word; }
.viewer-body { padding: 16px 18px; font-size: 17px; line-height: 1.55; }
.viewer-body h3 { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em; color: var(--cyan); margin: 18px 0 6px; }
.viewer-body h3:first-child { margin-top: 0; }
.viewer-body p { margin: 0 0 10px; }
.viewer-body ul { list-style: disc; padding-left: 22px; margin: 0 0 10px; }
.viewer-body pre { white-space: pre-wrap; font-family: var(--font-mono); font-size: 14px; }
.viewer-foot { padding: 0 18px 18px; }

/* ---------- Top bar on phones ---------- */
/* One compact row (logo, views, status light, menu). Desktop is unchanged. */
@media (max-width: 760px) {
  .topbar { flex-wrap: nowrap; gap: 10px; padding: 8px 16px; }
  .brand { gap: 8px; margin-right: auto; flex: none; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 17px; letter-spacing: 0.16em; }
  .views a { min-height: 36px; padding: 4px 12px; font-size: 11px; letter-spacing: 0.12em; }
  .sys-status { padding: 0; border: 0; background: none; width: 24px; height: 44px; justify-content: center; flex: none; }
  .sys-status .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu-btn {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px;
    border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(8, 22, 36, 0.8); cursor: pointer;
  }
  .menu-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--cyan-soft); stroke-width: 2; stroke-linecap: round; }
  .menu-btn[aria-expanded="true"] { background: rgba(67, 217, 255, 0.16); border-color: var(--cyan); }
  .top-actions {
    display: none; position: absolute; top: calc(100% + 6px); right: 16px; width: min(280px, calc(100vw - 32px));
    flex-direction: column; gap: 8px; padding: 12px;
    background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), var(--glow);
  }
  .topbar.menu-open .top-actions { display: flex; }
  .top-actions .btn { width: 100%; min-height: 44px; }
  .menu-status { display: block; font-family: var(--font-display); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
  /* Footer: one short line. */
  :root { --ticker-h: 28px; }
  .ticker { flex-wrap: nowrap; gap: 14px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); font-size: 11px; letter-spacing: 0.02em; white-space: nowrap; }
  .ticker span:nth-child(2) { display: none; }
}
@media (max-width: 400px) {
  .topbar { gap: 8px; padding: 8px 12px; }
  .brand-name { display: none; }
  .views a { padding: 4px 8px; font-size: 10px; letter-spacing: 0.04em; }
}
@media (max-width: 340px) {
  .topbar { gap: 6px; }
  .views a { padding: 4px 6px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
