/* ============================================================
   River Murray Sky Watch — deep space theme
   ============================================================ */

:root {
  --bg: #05060e;
  --bg-2: #0a0d1f;
  --bg-3: #10142b;
  --panel: rgba(20, 25, 52, 0.55);
  --panel-border: rgba(120, 140, 255, 0.14);
  --text: #e8ecff;
  --text-dim: #9aa3c7;
  --text-faint: #6b7396;
  --accent: #7ee7ff;
  --accent-2: #b18cff;
  --accent-3: #ffd9a0;
  --good: #7dffc7;
  --radius: 18px;
  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 85% -5%, rgba(95, 60, 180, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(30, 90, 160, 0.14), transparent 60%);
  background-attachment: fixed;
}

::selection { background: rgba(126, 231, 255, 0.3); }

.container { width: min(1160px, 92vw); margin: 0 auto; }
.container-narrow { width: min(760px, 92vw); }

/* ---------- preview banner ---------- */
.preview-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 4px 12px;
  background: linear-gradient(90deg, rgba(122, 82, 20, 0.92), rgba(94, 60, 16, 0.92));
  border-bottom: 1px solid rgba(255, 217, 160, 0.35);
  color: #ffe3b3; font-size: 0.72rem; letter-spacing: 0.05em;
  text-align: center;
}
.preview-banner strong { color: #ffd9a0; text-transform: uppercase; letter-spacing: 0.14em; margin-right: 0.4em; }
.banner-short { display: none; }
@media (max-width: 640px) {
  .banner-full { display: none; }
  .banner-short { display: inline; }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 32px 0 auto 0; z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(5, 6, 14, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--panel-border); background: rgba(5, 6, 14, 0.8); }
.nav-inner {
  width: min(1160px, 92vw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 0;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--text); text-decoration: none; font-size: 1.05rem; letter-spacing: 0.02em;
}
.brand strong { color: var(--accent); font-weight: 600; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.nav-links { display: flex; gap: 1.6rem; align-items: center; }
.nav-links a, .nav-drop-btn {
  color: var(--text-dim); text-decoration: none; font-size: 0.92rem;
  letter-spacing: 0.04em; transition: color .2s;
}
.nav-links a:hover, .nav-drop-btn:hover, .nav-drop-btn[aria-expanded="true"] { color: var(--accent); }

/* ---------- sites dropdown ---------- */
.nav-dropdown { position: relative; }
/* invisible bridge so the pointer never leaves the hover zone
   while travelling from the button down to the menu */
.nav-dropdown::after {
  content: ""; position: absolute; top: 100%; left: -12px; right: -12px;
  height: 18px;
}
.nav-drop-btn {
  background: none; border: 0; cursor: pointer; font-family: var(--font);
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 8px 0; /* generous hit area */
}
.nav-drop-btn .chev {
  width: 7px; height: 7px; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px);
  transition: transform .2s;
}
.nav-drop-btn[aria-expanded="true"] .chev { transform: rotate(225deg) translateY(-1px); }
.nav-menu {
  display: none; position: absolute; top: calc(100% + 14px); right: 0; z-index: 60;
  min-width: 360px; padding: 0.7rem;
  background: rgba(10, 13, 31, 0.97);
  border: 1px solid var(--panel-border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-menu.open { display: block; }
.nav-menu-item {
  display: block; padding: 0.45rem 0.8rem; border-radius: 8px;
  color: var(--text-dim); font-size: 0.88rem;
}
.nav-menu-item:hover { background: rgba(126,231,255,0.08); color: var(--accent); }
.nav-menu-overview { font-weight: 600; color: var(--text); }
.nav-menu-sep { height: 1px; background: var(--panel-border); margin: 0.45rem 0.3rem; }
.nav-menu-sites { display: grid; grid-template-columns: 1fr 1fr; }
.nav-menu-sites .nav-menu-item { font-size: 0.84rem; }
.nav-menu-loading { display: block; padding: 0.45rem 0.8rem; color: var(--text-faint); font-size: 0.82rem; }
.ref-star { color: var(--accent-3); font-size: 0.75rem; }
/* hover to open on devices with a real pointer */
@media (hover: hover) and (min-width: 861px) {
  .nav-dropdown:hover .nav-menu { display: block; }
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: .25s; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto 1fr; justify-items: center;
  text-align: center; overflow: hidden;
}
#starfield { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-nebula {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 380px at 72% 22%, rgba(140, 90, 255, 0.16), transparent 65%),
    radial-gradient(600px 340px at 24% 68%, rgba(60, 160, 255, 0.12), transparent 65%),
    linear-gradient(to bottom, transparent 55%, var(--bg) 96%);
}
.hero-content { position: relative; z-index: 2; grid-row: 2; padding: 7rem 1.5rem 6rem; max-width: 900px; }
.hero-eyebrow {
  color: var(--accent); letter-spacing: 0.28em; text-transform: uppercase;
  font-size: 0.72rem; margin-bottom: 1.4rem; font-weight: 500;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.05;
  font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.3rem;
  text-shadow: 0 0 60px rgba(126, 231, 255, 0.25);
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--text-dim); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 620px; margin: 0 auto 2rem; }

.hero-readings {
  display: flex; align-items: stretch; justify-content: center; gap: 0.75rem;
  flex-wrap: wrap; margin-bottom: 2.2rem;
}
.hero-readings[hidden] { display: none; }
.hero-live {
  display: inline-flex; align-items: center; gap: 1.1rem;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 999px; padding: 0.7rem 1.5rem 0.7rem 1rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  margin-bottom: 0;
  box-shadow: 0 0 40px rgba(126, 231, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.06);
}
.hero-live-num { font-family: var(--mono); font-size: 1.7rem; font-weight: 500; color: var(--accent); display: flex; align-items: baseline; gap: 0.5rem; }
.hero-live-num small { font-size: 0.68rem; color: var(--text-faint); letter-spacing: 0.06em; }
.hero-live-meta { display: flex; align-items: center; gap: 0.55rem; color: var(--text-dim); font-size: 0.85rem; text-align: left; max-width: 260px; }
.hero-live-secondary { background: rgba(11, 12, 28, 0.68); border-color: rgba(177, 140, 255, 0.28); }
.hero-live-secondary .hero-live-num { color: var(--accent-2); }
.median-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); flex: none; box-shadow: 0 0 12px rgba(177, 140, 255, 0.55); }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 0 rgba(125, 255, 199, 0.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(125,255,199,0); } 100% { box-shadow: 0 0 0 0 rgba(125,255,199,0); } }

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; text-decoration: none; font-family: var(--font);
  border-radius: 999px; padding: 0.85rem 1.9rem; font-size: 0.95rem;
  letter-spacing: 0.03em; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.btn-primary {
  background: linear-gradient(to right, var(--accent) 0%, var(--accent-2) 100%) padding-box;
  background-origin: padding-box; background-clip: padding-box;
  color: #071018; font-weight: 600;
  box-shadow: 0 8px 30px rgba(17, 20, 48, 0.42);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(17, 20, 48, 0.58); }
.btn-ghost { color: var(--text); border-color: var(--panel-border); background: rgba(255,255,255,0.03); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small {
  padding: 0.45rem 1.1rem; font-size: 0.82rem; background: rgba(255,255,255,0.04);
  color: var(--text-dim); border-color: var(--panel-border);
}
.btn-small:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.btn-small:disabled { opacity: 0.35; cursor: default; }

.scroll-cue {
  position: relative; grid-row: 3; align-self: center;
  width: 26px; height: 44px; border: 1.5px solid var(--text-faint); border-radius: 14px;
  z-index: 2;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--accent); animation: cue 1.8s infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- sections ---------- */
.section { padding: 6.5rem 0; position: relative; }
.section-alt { background: linear-gradient(to bottom, transparent, rgba(16, 20, 43, 0.5) 18%, rgba(16, 20, 43, 0.5) 82%, transparent); }
.section-head { margin-bottom: 3rem; max-width: 720px; }
.kicker {
  color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.26em;
  font-size: 0.7rem; font-weight: 600; margin-bottom: 0.7rem;
}
.section h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.section-sub { color: var(--text-dim); margin-top: 0.9rem; }
.accent { color: var(--accent); }
.h-inline { font-size: 1.25rem; margin-bottom: 0.9rem; color: var(--accent); }

/* ---------- stat cards ---------- */
.stat-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat-card {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 1.4rem 1.4rem 1.2rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .25s, border-color .25s;
}
.stat-card:hover { transform: translateY(-4px); border-color: rgba(126, 231, 255, 0.35); }
.stat-hero { grid-row: span 1; }
.stat-label {
  color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.66rem; font-weight: 600; margin-bottom: 0.7rem;
}
.stat-value { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.stat-value span { font-family: var(--mono); font-size: 2.3rem; font-weight: 500; color: var(--text); line-height: 1; }
.stat-hero .stat-value span { font-size: 3rem; color: var(--accent); text-shadow: 0 0 30px rgba(126, 231, 255, 0.45); }
.stat-value small { color: var(--text-faint); font-size: 0.72rem; }
.stat-note { color: var(--text-faint); font-size: 0.76rem; margin-top: 0.7rem; line-height: 1.45; }
.stat-glow {
  position: absolute; inset: auto -30% -60% -30%; height: 120%;
  background: radial-gradient(closest-side, rgba(126, 231, 255, 0.14), transparent);
  pointer-events: none;
}
.stat-value canvas { width: 46px; height: 46px; }

.bortle-meter { display: flex; gap: 4px; margin-top: 0.9rem; }
.bortle-meter i {
  height: 5px; flex: 1; border-radius: 3px; background: rgba(255,255,255,0.08);
}
.bortle-meter i.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 8px rgba(126,231,255,0.5); }

.compare-strip {
  margin-top: 2.2rem; text-align: center; color: var(--text-dim);
  font-size: 1.02rem;
}
.compare-strip strong { color: var(--accent-3); font-family: var(--mono); font-weight: 500; }

/* ---------- chart panels ---------- */
.chart-panel {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 1.4rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chart-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.chart-title { text-align: center; }
.chart-title strong { display: block; font-size: 1.05rem; }
.chart-title span { color: var(--text-faint); font-size: 0.78rem; }
.chart-range {
  display: inline-flex; gap: 0.2rem; padding: 0.22rem; border-radius: 999px;
  border: 1px solid var(--panel-border); background: rgba(5, 6, 14, 0.42);
}
.range-btn {
  appearance: none; border: 0; border-radius: 999px; padding: 0.42rem 0.75rem;
  background: transparent; color: var(--text-faint); font: 500 0.76rem var(--font);
  cursor: pointer; transition: color .2s, background .2s, box-shadow .2s;
}
.range-btn:hover { color: var(--text); }
.range-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.range-btn:disabled { opacity: 0.38; cursor: default; }
.range-btn.active {
  color: #071018; background: linear-gradient(to right, var(--accent) 0%, #9adfff 100%);
  box-shadow: 0 0 15px rgba(126, 231, 255, 0.18);
}
.night-nav { display: flex; gap: 0.45rem; }
.night-nav[hidden] { display: none; }
.chart-wrap { position: relative; height: 380px; }
.chart-wrap-short { height: 300px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(8, 10, 24, 0.92); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 0.55rem 0.8rem; font-size: 0.78rem;
  color: var(--text); white-space: nowrap; transform: translate(-50%, -110%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.chart-tooltip .tt-title { color: var(--text-faint); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; }
.chart-tooltip .tt-value { font-family: var(--mono); color: var(--accent); }
.chart-legend { display: flex; gap: 1.6rem; margin-top: 0.9rem; flex-wrap: wrap; color: var(--text-faint); font-size: 0.76rem; }
.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw-sqm { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.sw-moon { background: #ffd36e; box-shadow: 0 0 6px rgba(255,211,110,0.65); }
.sw-daylight { background: rgba(255,190,120,0.65); box-shadow: 0 0 6px rgba(255,190,120,0.35); }
.sw-band { background: rgba(255,255,255,0.25); }
.metric-range { margin-left: auto; }
.measurement-guide {
  display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 2fr); gap: 1.2rem;
  margin-top: 1.25rem; padding: 1rem 1.1rem; border: 1px solid var(--panel-border);
  border-radius: 10px; background: rgba(126, 231, 255, .035);
}
.measurement-guide-intro strong { color: var(--text); font-size: .88rem; }
.measurement-guide p, .measurement-guide dd {
  color: var(--text-faint); font-size: .74rem; line-height: 1.55;
}
.measurement-guide-intro p { margin-top: .35rem; }
.measurement-guide dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.measurement-guide dl > div { padding-left: .85rem; border-left: 2px solid rgba(126, 231, 255, .22); }
.measurement-guide dt {
  margin-bottom: .25rem; color: var(--accent); font-family: var(--mono);
  font-size: .74rem; font-weight: 500; letter-spacing: .08em;
}
.measurement-guide dd strong { color: var(--text-dim); font-weight: 500; }
.night-distributions {
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--panel-border);
}
.night-distributions[hidden] { display: none; }
.night-distributions-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem;
  margin-bottom: 1rem;
}
.night-distributions-head h3 { color: var(--text); font-size: 1rem; }
.night-distributions-head p {
  max-width: 480px; color: var(--text-faint); font-size: .72rem; line-height: 1.5;
}
#nightCorrectionNote { margin-top: .25rem; color: var(--accent-3); }
.night-distribution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.night-distribution-card {
  min-width: 0; overflow: hidden; border: 1px solid var(--panel-border);
  border-radius: 10px; background: rgba(5, 6, 14, .28);
}
.night-distribution-card h4 {
  display: flex; justify-content: space-between; padding: .75rem .85rem;
  color: var(--text); font-size: .78rem; border-bottom: 1px solid var(--panel-border);
}
.night-distribution-card h4 span { color: var(--accent); font-family: var(--mono); }
.distribution-table { width: 100%; border-collapse: collapse; font-size: .7rem; }
.distribution-table th, .distribution-table td {
  padding: .58rem .65rem; text-align: right; white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.045);
}
.distribution-table th:first-child, .distribution-table td:first-child { text-align: left; }
.distribution-table th {
  color: var(--text-faint); font-size: .58rem; text-transform: uppercase; letter-spacing: .06em;
}
.distribution-table td { color: var(--text-dim); font-family: var(--mono); }
.distribution-table td:first-child { color: var(--text); font-family: var(--font); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 1.4rem; align-items: stretch; }
.two-col-wide { gap: 4rem; margin-top: 0; align-items: start; }

/* ---------- insights ---------- */
.insight-panel {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 1.6rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.insight-panel h3 { font-size: 1.05rem; margin-bottom: 1rem; color: var(--accent); }
.insight-list { list-style: none; display: grid; gap: 0.9rem; }
.insight-list li {
  padding-left: 1.2rem; position: relative; color: var(--text-dim);
  font-size: 0.9rem; line-height: 1.5;
}
.insight-list li::before {
  content: "✦"; position: absolute; left: 0; top: 0; color: var(--accent-2); font-size: 0.8rem;
}
.insight-list strong { color: var(--text); font-family: var(--mono); font-weight: 500; }

/* ---------- understand ---------- */
.scale-bar { margin: 2.4rem 0 0; padding-bottom: 3.4rem; position: relative; }
.scale-bar-track {
  height: 12px; border-radius: 8px;
  background: linear-gradient(90deg, #4a3b16 0%, #31406b 35%, #16204a 65%, #02030a 100%);
  border: 1px solid var(--panel-border);
}
.scale-bar-marker {
  position: absolute; top: -10px; width: 3px; height: 32px;
  background: var(--accent); box-shadow: 0 0 12px var(--accent); border-radius: 2px;
  transition: left 1s ease;
}
.scale-bar-marker span {
  position: absolute; top: -1.5rem; left: 50%; transform: translateX(-50%);
  font-size: 0.72rem; color: var(--accent); white-space: nowrap; letter-spacing: 0.08em;
}
.scale-bar-marker.near-start span { left: 0; transform: none; }
.scale-bar-marker.near-end span { left: auto; right: 0; transform: none; }
.scale-bar-labels { display: flex; justify-content: space-between; margin-top: 0.7rem; color: var(--text-faint); font-size: 0.8rem; font-family: var(--mono); }
.scale-bar-labels small { color: var(--text-faint); font-family: var(--font); font-size: 0.66rem; }
.scale-bar-labels span { text-align: center; }

.bortle-list { list-style: none; display: grid; gap: 0.45rem; margin-top: 0.4rem; }
.bortle-list li {
  display: flex; align-items: center;
  padding: 0.5rem 0.8rem; border-radius: 10px; font-size: 0.86rem; color: var(--text-dim);
  border: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.bortle-list li:hover { border-color: rgba(126, 231, 255, 0.45); background: rgba(126, 231, 255, 0.06); }
.bortle-list li.active {
  background: rgba(126, 231, 255, 0.07); border-color: rgba(126, 231, 255, 0.3);
  color: var(--text);
}
.bortle-list li.active:hover { border-color: rgba(126, 231, 255, 0.55); }
.bortle-link {
  display: flex; align-items: center; gap: 0.9rem; flex: 1;
  color: inherit; text-decoration: none;
}
.bortle-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.b-arrow { margin-left: auto; flex: none; color: var(--text-faint); transition: transform .2s, color .2s; }
.bortle-list li:hover .b-arrow { color: var(--accent); transform: translateX(3px); }
.bortle-more { margin-top: 1rem; font-size: 0.86rem; }
.bortle-more a { color: var(--accent); text-decoration: none; }
.bortle-more a:hover { text-decoration: underline; }
.b-num {
  font-family: var(--mono); width: 2rem; height: 2rem; flex: none;
  display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--panel-border); color: var(--accent); font-size: 0.85rem;
}
.bortle-list li.active .b-num { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #071018; font-weight: 600; }

/* ---------- bortle scale page ---------- */
.accent-em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.prose p { color: var(--text-dim); margin-bottom: 1.1rem; }
.prose p strong { color: var(--text); }
.section-sub a, .prose a { color: var(--accent); text-decoration: none; }
.section-sub a:hover, .prose a:hover { text-decoration: underline; }

.bortle-cards { display: grid; gap: 1.4rem; }
.bortle-card {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 1.6rem 1.8rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  scroll-margin-top: 115px;
  transition: border-color .35s, box-shadow .35s;
}
.bortle-card:target { border-color: rgba(126, 231, 255, 0.5); }
.bortle-card.flash { border-color: var(--accent); box-shadow: 0 0 44px rgba(126, 231, 255, 0.22); }
.bortle-card-head { display: flex; align-items: center; gap: 1.1rem; }
.b-num-lg {
  width: 2.7rem; height: 2.7rem; font-size: 1.15rem;
  background: rgba(126, 231, 255, 0.05);
}
.bortle-card-title h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
.bortle-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.45rem; }
.b-chip {
  font-family: var(--mono); font-size: 0.68rem; color: var(--text-dim);
  border: 1px solid var(--panel-border); border-radius: 999px; padding: 0.15rem 0.65rem;
}
.bortle-card .bortle-meter { margin: 1.1rem 0; }
.bortle-card p { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 0.8rem; }
.bortle-card p:last-child { margin-bottom: 0; }
.b-label { color: var(--accent); font-weight: 600; }
.b-compare { border-left: 2px solid var(--accent-2); padding-left: 0.9rem; }
.cell-mono { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }

/* ---------- network ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.site-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 1.3rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
a.site-card.live:hover { transform: translateY(-4px); border-color: rgba(126, 231, 255, 0.4); box-shadow: 0 10px 34px rgba(126,231,255,0.10); }
.site-card.live { border-color: rgba(125, 255, 199, 0.35); box-shadow: 0 0 30px rgba(125, 255, 199, 0.06); }
.site-card { transition: transform .25s, border-color .25s, box-shadow .25s; }
.site-card.soon { opacity: 0.45; border-style: dashed; }
.site-status { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.7rem; }
.site-card.live .site-status { color: var(--good); }
.site-card.soon .site-status { color: var(--text-faint); }
.site-card h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.site-card p { color: var(--text-dim); font-size: 0.8rem; }
.site-coords { font-family: var(--mono); font-size: 0.7rem; color: var(--text-faint); margin-top: 0.4rem; margin-bottom: 0.4rem; }
.site-stat { display: flex; justify-content: space-between; margin-top: 0.55rem; padding-top: 0.5rem; border-top: 1px solid var(--panel-border); font-size: 0.78rem; color: var(--text-faint); }
.site-stat > span small, .site-card-meta > span > small { display: block; margin-top: 0.08rem; color: var(--text-faint); font-size: 0.55rem; }
.site-stat strong { font-family: var(--mono); color: var(--accent); font-weight: 500; }
.site-stat-live strong { color: var(--good); font-size: 0.94rem; }
.site-window-group {
  margin-top: 0.75rem; padding: 0.75rem; border: 1px solid rgba(126, 231, 255, 0.12);
  border-radius: 12px; background: rgba(5, 6, 14, 0.34);
}
.site-window-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.55rem; color: var(--text-dim); font-size: 0.72rem; font-weight: 600; }
.site-window-heading small { color: var(--text-faint); font-size: 0.58rem; letter-spacing: 0.04em; }
.site-window-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 0.8rem; }
.site-window-grid div { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; }
.site-window-grid span { color: var(--text-faint); font-size: 0.65rem; }
.site-window-grid strong { color: var(--accent); font: 500 0.78rem var(--mono); }
.site-stat strong, .site-window-grid strong, .site-card-meta strong { min-width: 0; }
.site-card-meta { display: flex; justify-content: space-between; gap: 0.55rem; margin-top: 0.7rem; color: var(--text-faint); font-size: 0.65rem; }
.site-card-meta strong { display: block; margin-top: 0.1rem; color: var(--text-dim); font: 500 0.72rem var(--mono); }
.ref-chip, .sim-chip {
  font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--panel-border); border-radius: 999px; padding: 0.1rem 0.5rem;
  color: var(--accent-3); margin-left: 0.35rem;
}
.sim-chip { color: var(--text-faint); }

/* ---------- map ---------- */
.chart-wrap-map { height: 480px; }
.chart-wrap-map canvas { cursor: default; }
.map-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 0.9rem; flex-wrap: wrap;
}
.map-mode {
  display: inline-flex; padding: 3px; border: 1px solid var(--panel-border);
  border-radius: 999px; background: rgba(5, 6, 14, 0.55);
}
.map-mode-btn {
  border: 0; border-radius: 999px; padding: 0.42rem 0.85rem;
  background: transparent; color: var(--text-faint); cursor: pointer;
  font: 500 0.72rem var(--font); letter-spacing: 0.02em;
  transition: color .2s, background .2s, box-shadow .2s;
}
.map-mode-btn:hover { color: var(--text); }
.map-mode-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-mode-btn:disabled { cursor: not-allowed; opacity: 0.45; }
.map-mode-btn-live::before {
  content: ""; display: inline-block; width: 0.4rem; height: 0.4rem; margin-right: 0.35rem;
  border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor;
}
.map-mode-btn.active {
  color: #071018; background: linear-gradient(to right, var(--accent) 0%, #9adfff 100%);
  box-shadow: 0 0 18px rgba(126, 231, 255, 0.18);
}
.map-mode-btn-live.active {
  background: linear-gradient(to right, #7dffc7 0%, #b5ffe0 100%);
  box-shadow: 0 0 18px rgba(125, 255, 199, 0.22);
}
.map-reading-meta { color: var(--text-faint); font-size: 0.76rem; }
.map-scale { display: inline-flex; align-items: center; gap: 0.55rem; }
.map-scale i {
  display: inline-block; width: clamp(90px, 16vw, 160px); height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8a65 0%, #ffbe78 24%, #b18cff 62%, #7ee7ff 100%);
  box-shadow: 0 0 10px rgba(177, 140, 255, 0.28);
}
.sw-station {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 7px var(--accent); margin-right: 7px;
}
.sw-city {
  width: 8px; height: 8px; transform: rotate(45deg); background: #ff8a65;
  border: 1px solid rgba(255,255,255,0.85); box-shadow: 0 0 7px rgba(255,138,101,0.85);
  margin-right: 7px;
}
.legend-note { margin-left: auto; font-style: italic; }

/* Leaflet + OpenStreetMap (CARTO dark basemap) */
.leaflet-map {
  height: 480px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--panel-border);
  background: var(--bg-2);
}
.map-heat-layer {
  pointer-events: none; image-rendering: auto;
  filter: saturate(0.95) contrast(1.03);
}
.map-dot-wrap { background: none; border: none; }
.map-dot {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--dot, #7ee7ff);
  box-shadow: 0 0 10px var(--dot, #7ee7ff), 0 0 3px #fff inset;
  border: 1.5px solid rgba(255,255,255,0.85);
}
.map-dot-ref { outline: 2px solid rgba(255,255,255,0.75); outline-offset: 3px; }
.map-dot-muted { background: rgba(154,163,199,0.65); box-shadow: none; }
.map-city-dot {
  display: block; width: 13px; height: 13px; transform: rotate(45deg);
  background: #ff8a65; border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 12px rgba(255,138,101,0.9), 0 0 3px #fff inset;
}
.map-label {
  background: rgba(8, 10, 24, 0.72); border: none; box-shadow: none;
  color: var(--text); font-family: var(--font); font-size: 10.5px; font-weight: 500;
  padding: 1px 6px; border-radius: 6px; letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.map-label::before { display: none; }
.labels-hidden .map-label { display: none; }
.map-label-city { color: #ffd0c2; font-weight: 600; }
.labels-hidden .map-label-city { display: block; }
.leaflet-popup-content-wrapper {
  background: rgba(12, 15, 32, 0.96); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.6);
}
.leaflet-popup-tip { background: rgba(12, 15, 32, 0.96); border: 1px solid var(--panel-border); }
.leaflet-popup-content { font-family: var(--font); font-size: 0.85rem; margin: 12px 16px; }
.map-popup strong { font-size: 1rem; }
.map-popup-stats { display: grid; gap: 2px; margin: 0.5rem 0; color: var(--text-dim); font-size: 0.78rem; }
.map-popup-stats b { color: var(--accent); font-family: var(--mono); font-weight: 500; }
.map-popup-city .map-popup-stats b { color: #ffab91; }
.map-popup-city p { max-width: 245px; margin: 0; color: var(--text-dim); font-size: 0.76rem; line-height: 1.45; }
.city-chip {
  display: inline-block; margin-left: 0.3rem; padding: 0.1rem 0.45rem;
  border: 1px solid rgba(255,138,101,0.45); border-radius: 999px;
  color: #ffab91; font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; vertical-align: 2px;
}
.map-popup a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.82rem; }
.map-popup a:hover { text-decoration: underline; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-dim); }
.leaflet-bar a { background: rgba(12,15,32,0.9); color: var(--text); border-color: var(--panel-border); }
.leaflet-bar a:hover { background: rgba(30,36,66,0.95); }
.leaflet-control-attribution {
  background: rgba(8,10,24,0.7) !important; color: var(--text-faint) !important;
  font-size: 9.5px !important;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }

/* ---------- site page hero ---------- */
.site-hero {
  position: relative; padding: 8.5rem 0 3.5rem; overflow: hidden;
  background:
    radial-gradient(700px 300px at 80% 0%, rgba(140, 90, 255, 0.14), transparent 65%),
    radial-gradient(500px 260px at 10% 40%, rgba(60, 160, 255, 0.10), transparent 65%);
}
.site-hero-inner { position: relative; z-index: 2; }
.site-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.02em; margin: 0.6rem 0 0.4rem; }
.site-hero-coords { font-family: var(--mono); color: var(--text-faint); font-size: 0.82rem; margin-bottom: 1.4rem; }
.back-link { color: var(--text-dim); text-decoration: none; font-size: 0.85rem; letter-spacing: 0.04em; }
.back-link:hover { color: var(--accent); }
.sim-badge {
  display: inline-block; font-size: 0.72rem; color: var(--accent-3);
  border: 1px dashed rgba(255, 217, 160, 0.4); border-radius: 999px;
  padding: 0.3rem 0.9rem; margin-bottom: 1.4rem;
}
.stat-value-text span { font-size: 1.5rem; font-family: var(--font); font-weight: 600; color: var(--accent); }

/* ---------- independent Swan Reach Observatory record ---------- */
.sro-section {
  border-top: 1px solid rgba(255, 208, 138, 0.14);
  background:
    radial-gradient(650px 300px at 85% 15%, rgba(255, 190, 105, 0.07), transparent 70%),
    rgba(8, 8, 17, 0.42);
}
.sro-kicker { color: #ffd08a; }
.sro-provenance {
  margin-bottom: 1.3rem; padding: 1.35rem 1.5rem;
  background: rgba(64, 42, 17, 0.2); border: 1px solid rgba(255, 208, 138, 0.28);
  border-left: 4px solid #ffd08a; border-radius: var(--radius);
}
.sro-source-chip {
  display: inline-block; margin-bottom: 0.65rem; padding: 0.16rem 0.65rem;
  border: 1px solid rgba(255, 208, 138, 0.38); border-radius: 999px;
  color: #ffd08a; font: 500 0.64rem var(--mono); text-transform: uppercase; letter-spacing: 0.09em;
}
.sro-provenance p { color: var(--text-dim); font-size: 0.9rem; }
.sro-provenance strong { color: var(--text); }
.sro-provenance .sro-provenance-note { margin-top: 0.55rem; color: var(--text-faint); font-size: 0.8rem; }
.sro-links { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; margin-top: 0.75rem; }
.sro-links a { color: #ffd08a; text-underline-offset: 3px; }
.sro-status {
  min-height: 1.5rem; margin-bottom: 1rem; color: var(--text-dim);
  font: 0.76rem var(--mono);
}
.sro-stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.sro-stat-card {
  min-width: 0; padding: 1rem 1.1rem; border-radius: 14px;
  background: rgba(20, 19, 35, 0.68); border: 1px solid rgba(255, 208, 138, 0.16);
}
.sro-stat-card > span {
  display: block; color: var(--text-faint); font-size: 0.64rem;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.sro-stat-card strong {
  display: inline-block; margin: 0.35rem 0.3rem 0 0; color: #ffd08a;
  font: 500 1.55rem var(--mono);
}
.sro-stat-card small { color: var(--text-faint); font-size: 0.68rem; }
.sro-stat-card .sro-stat-time { color: var(--text); font: 500 1rem var(--font); }
.sro-stat-primary { box-shadow: inset 0 0 30px rgba(255, 208, 138, 0.035); }
.sro-chart-panel { border-color: rgba(255, 208, 138, 0.2); }
.sro-toolbar { align-items: center; padding-bottom: 1rem; border-bottom: 1px solid rgba(255, 208, 138, 0.12); }
.sro-compare-control {
  display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text-dim);
  font-size: 0.8rem; cursor: pointer;
}
.sro-compare-control input { width: 1rem; height: 1rem; accent-color: #ffd08a; }
.sro-compare-control:has(input:disabled) { opacity: 0.5; cursor: default; }
.sro-compare-control input:focus-visible { outline: 2px solid #ffd08a; outline-offset: 3px; }
.sro-chart-block + .sro-chart-block {
  margin-top: 1.5rem; padding-top: 1.4rem; border-top: 1px solid rgba(255, 208, 138, 0.12);
}
.sro-chart-block > .chart-title { margin-bottom: 0.65rem; }
.sw-sro { background: #ffd08a; box-shadow: 0 0 6px rgba(255, 208, 138, 0.5); }
.sw-sro-ambient { background: #ffcf86; }
.sw-sro-sky { background: #cf9fff; }
.sw-dashed {
  height: 0; background: none; border-top: 3px dashed currentColor; border-radius: 0;
}
.sro-chart-summary { margin-top: 1.2rem; color: var(--text-faint); font-size: 0.78rem; }
.sro-data-details {
  margin-top: 1rem; border-top: 1px solid rgba(255, 208, 138, 0.12); padding-top: 0.9rem;
}
.sro-data-details summary { color: #ffd08a; cursor: pointer; font-size: 0.84rem; }
.sro-data-details summary:focus-visible { outline: 2px solid #ffd08a; outline-offset: 3px; }
.sro-data-details[open] summary { margin-bottom: 0.8rem; }
.sro-table caption { padding: 0.5rem 0.8rem; color: var(--text-faint); text-align: left; font-size: 0.74rem; }

/* ---------- about / footer ---------- */
#about p { color: var(--text-dim); margin-bottom: 1.2rem; }
#about p strong, #understand p strong { color: var(--text); }
#understand p { color: var(--text-dim); margin-bottom: 1rem; }
.fine-print { font-size: 0.78rem; color: var(--text-faint) !important; border-top: 1px solid var(--panel-border); padding-top: 1.2rem; margin-top: 2rem; }

.footer { border-top: 1px solid var(--panel-border); padding: 2.6rem 0; background: rgba(5,6,14,0.6); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer p { color: var(--text-faint); font-size: 0.82rem; }
.footer-meta { font-family: var(--mono); font-size: 0.72rem; text-align: right; }

/* ---------- reveal animation ---------- */
.section .container > *, .stat-card, .chart-panel, .site-card { will-change: transform, opacity; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .two-col, .two-col-wide { grid-template-columns: 1fr; gap: 1.4rem; }
  .chart-wrap { height: 300px; }
  .chart-range { order: 1; width: 100%; justify-content: center; }
  .metric-range { order: 2; width: auto; margin-left: 0; }
  .chart-range + .chart-title { order: 2; text-align: left; }
  .night-nav { order: 3; }
  .measurement-guide { grid-template-columns: 1fr; gap: .85rem; }
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 90px; right: 0; left: 0;
    flex-direction: column; gap: 0; padding: 0.5rem 4vw 1.2rem;
    align-items: stretch;
    background: rgba(5, 6, 14, 0.96); border-bottom: 1px solid var(--panel-border);
    transform: translateY(-130%); transition: transform .3s ease;
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 0.8rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
  /* dropdown goes inline in the mobile menu */
  .nav-dropdown { border-bottom: 1px solid rgba(255,255,255,0.05); }
  .nav-dropdown::after { display: none; } /* bridge not needed (and would block taps) */
  .nav-drop-btn { padding: 0.8rem 0; width: 100%; justify-content: space-between; }
  .nav-menu {
    position: static; min-width: 0; margin-bottom: 0.6rem;
    background: rgba(255,255,255,0.03); box-shadow: none;
  }
  .nav-menu-sites { grid-template-columns: 1fr 1fr; }
  .nav-menu-item { font-size: 0.85rem; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero-readings { flex-direction: column; align-items: center; }
  .hero-live { flex-direction: column; gap: 0.4rem; width: min(100%, 360px); border-radius: 22px; padding: 1rem 1.4rem; }
  .map-toolbar { align-items: flex-start; }
  .map-reading-meta { flex-basis: 100%; }
  .legend-note { flex-basis: 100%; margin-left: 0; }
  .hero-live-meta { max-width: none; text-align: center; }
  .section { padding: 4.5rem 0; }
  .sro-stat-grid { grid-template-columns: 1fr 1fr; }
  .sro-toolbar { align-items: flex-start; }
  .night-distributions-head { display: block; }
  .night-distributions-head > p { margin-top: .5rem; }
  .night-distribution-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .measurement-guide dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse-dot, .scroll-cue span { animation: none; }
}

/* screenshot/test mode (?snap) */
.snap .hero { min-height: 720px; }
.snap .scroll-cue { display: none; }

/* ---------- settings page: sensor health ---------- */
.settings-page .settings-view { display: none; }
.settings-page .settings-view.settings-view-active { display: block; }
.settings-page .settings-view.settings-unavailable { display: none; }
.settings-page:not([data-settings-current="health"]) #teleSourceBadge { display: none; }
.settings-menu-button {
  display: inline-flex; align-items: center; gap: 0.45rem; flex: none;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  background: rgba(126, 231, 255, 0.08); border: 1px solid var(--panel-border);
  color: var(--text); font: 500 0.82rem var(--font); cursor: pointer;
}
.settings-menu-button:hover { color: var(--accent); border-color: var(--accent); }
.settings-menu-button span { color: var(--accent); font-size: 1rem; }
.settings-menu-scrim {
  position: fixed; inset: 0; z-index: 120; background: rgba(2, 3, 10, 0.72);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.settings-menu {
  position: fixed; z-index: 130; top: 0; right: 0; bottom: 0;
  width: min(370px, 92vw); padding: 1rem;
  display: flex; flex-direction: column;
  background: #0b0d1a; border-left: 1px solid var(--panel-border);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.45);
  transform: translateX(102%); transition: transform .22s ease;
}
.settings-menu-open { overflow: hidden; }
.settings-menu-open .settings-menu { transform: translateX(0); }
.settings-menu-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0.45rem 1rem; color: var(--text); font-size: 1.1rem; font-weight: 600;
}
.settings-menu-head button {
  width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.06); color: var(--text-dim); font-size: 1.5rem; cursor: pointer;
}
.settings-menu nav {
  display: grid; flex: 1; min-height: 0; gap: 0.35rem;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 0.2rem 0.5rem;
}
.settings-menu nav a {
  display: grid; grid-template-columns: 1.9rem 1fr; align-items: center; gap: 0.75rem;
  padding: 0.9rem; border-radius: 12px; border: 1px solid transparent;
  color: var(--text-dim); text-decoration: none;
}
.settings-menu nav a:hover { background: rgba(255,255,255,.035); color: var(--text); }
.settings-menu nav a.active {
  background: rgba(126, 231, 255, 0.08); border-color: rgba(126, 231, 255, 0.22); color: var(--accent);
}
.settings-menu nav a > span:first-child { text-align: center; color: var(--accent); font-family: var(--mono); }
.settings-menu nav strong { display: block; color: inherit; font-size: 0.9rem; }
.settings-menu nav small { display: block; margin-top: 0.1rem; color: var(--text-faint); font-size: 0.73rem; }

.tele-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tele-card { text-decoration: none; }
.tele-card h3 { margin-bottom: 0.15rem; }
.tele-card .site-status { color: var(--text-dim); }
.dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: var(--text-faint);
}
.dot-ok { background: var(--good); box-shadow: 0 0 8px rgba(125, 255, 199, 0.6); }
.dot-stale { background: var(--accent-3); box-shadow: 0 0 8px rgba(255, 217, 160, 0.6); }
.dot-down { background: #ff8d8d; box-shadow: 0 0 8px rgba(255, 125, 125, 0.6); }
.dot-waiting { background: var(--accent); box-shadow: 0 0 8px rgba(126, 231, 255, 0.45); }
.dot-disabled { background: var(--text-faint); box-shadow: none; }
.tele-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 0.9rem;
  margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid var(--panel-border);
}
.metric { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.metric-label {
  color: var(--text-faint); font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.12em;
}
.metric-value { font-family: var(--mono); font-size: 0.82rem; color: var(--text); }
.tele-power {
  margin-top: 0.8rem; padding-top: 0.6rem; border-top: 1px dashed var(--panel-border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.9rem;
}
.power-empty { color: var(--text-faint); font-size: 0.76rem; font-style: italic; grid-column: 1 / -1; }

.pipeline-map {
  position: relative; margin-top: 2rem; padding: 1.4rem;
  overflow: hidden; border: 1px solid var(--panel-border); border-radius: 24px;
  background:
    radial-gradient(560px 210px at 42% 25%, rgba(126, 231, 255, 0.065), transparent 72%),
    radial-gradient(440px 180px at 68% 92%, rgba(177, 140, 255, 0.07), transparent 74%),
    rgba(8, 10, 24, 0.64);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.pipeline-map::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .16;
  background-image: radial-gradient(circle, rgba(126,231,255,.45) 0 1px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
.pipeline-stage-labels {
  position: relative; z-index: 1; display: grid;
  grid-template-columns: 230px minmax(160px,1fr) minmax(160px,1fr) 270px;
  gap: 70px; margin: 0 0 .75rem;
  color: var(--text-faint); font: 500 .58rem var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
}
.pipeline-stage-labels span:nth-child(2),
.pipeline-stage-labels span:nth-child(3) { text-align: center; }
.pipeline-stage-labels span:last-child { text-align: right; }
.pipeline-primary {
  position: relative; z-index: 1; display: grid; align-items: center;
  grid-template-columns: 160px 70px minmax(150px,1fr) 52px minmax(150px,1fr) 70px 200px;
  min-height: 216px;
}
.pipeline-source-stack, .pipeline-output-stack { display: grid; gap: 12px; }
.pipeline-node {
  position: relative; min-width: 0; border: 1px solid rgba(126,231,255,.16);
  background: rgba(16,20,43,.88); border-radius: 13px; color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 10px 30px rgba(0,0,0,.14);
}
.pipeline-source, .pipeline-output {
  display: flex; align-items: center; gap: .68rem; min-height: 64px; padding: .72rem .8rem;
}
.pipeline-node strong { display: block; font-size: .82rem; line-height: 1.25; font-weight: 600; }
.pipeline-node small {
  display: block; margin-top: .2rem; color: var(--text-faint);
  font-size: .64rem; line-height: 1.45;
}
.pipeline-node code { color: var(--accent-3); font: 500 .68rem var(--mono); }
.pipeline-node-dot {
  position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 11px rgba(125,255,199,.7);
}
.pipeline-node-dot::after {
  content: ""; position: absolute; inset: -5px; border: 1px solid rgba(125,255,199,.35);
  border-radius: 50%; animation: pipeline-source-ping 2.7s ease-out infinite;
}
.pipeline-source:nth-child(2) .pipeline-node-dot::after { animation-delay: -.8s; }
.pipeline-source:nth-child(3) .pipeline-node-dot::after { animation-delay: -1.6s; }
.pipeline-source-more .pipeline-node-dot { background: var(--accent); box-shadow: 0 0 11px rgba(126,231,255,.7); }
.pipeline-hub {
  min-height: 142px; padding: 1rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-color: rgba(126,231,255,.28);
  background: linear-gradient(145deg, rgba(19,31,58,.96), rgba(14,17,38,.93));
}
.pipeline-hub::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid transparent; animation: pipeline-hub-glow 3.6s ease-in-out infinite;
}
.pipeline-store { border-color: rgba(177,140,255,.28); }
.pipeline-store::after { animation-delay: -1.8s; }
.pipeline-node-kicker {
  color: var(--accent); font: 500 .55rem var(--mono); letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: .2rem;
}
.pipeline-store .pipeline-node-kicker { color: var(--accent-2); }
.pipeline-hub strong { font-size: .9rem; }
.pipeline-hub small { font-size: .66rem; }
.pipeline-node-icon {
  width: 28px; height: 28px; margin-bottom: .55rem; border: 1px solid currentColor;
  border-radius: 8px; color: var(--accent); opacity: .9;
}
.pipeline-node-icon-collector {
  background:
    linear-gradient(currentColor,currentColor) 7px 7px / 12px 1px no-repeat,
    linear-gradient(currentColor,currentColor) 7px 13px / 12px 1px no-repeat,
    linear-gradient(currentColor,currentColor) 7px 19px / 7px 1px no-repeat;
}
.pipeline-node-icon-store { color: var(--accent-2); border-radius: 50%; position: relative; }
.pipeline-node-icon-store::before, .pipeline-node-icon-store::after {
  content: ""; position: absolute; left: 4px; right: 4px; height: 5px;
  border: 1px solid currentColor; border-radius: 50%;
}
.pipeline-node-icon-store::before { top: 5px; }
.pipeline-node-icon-store::after { bottom: 5px; }
.pipeline-output { border-color: rgba(177,140,255,.18); }
.pipeline-file-mark {
  flex: none; display: grid; place-items: center; width: 28px; height: 34px;
  border: 1px solid rgba(177,140,255,.45); border-radius: 5px;
  color: var(--accent-2); font: 500 .54rem var(--mono);
  background: rgba(177,140,255,.06);
}
.pipeline-branch { position: relative; align-self: stretch; min-height: 216px; }
.pipeline-branch svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pipeline-wire { fill: none; stroke: rgba(126,231,255,.22); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.pipeline-signal {
  fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 1 13; vector-effect: non-scaling-stroke;
  animation: pipeline-flow 2.2s linear infinite;
  filter: drop-shadow(0 0 4px rgba(126,231,255,.75));
}
.pipeline-signal-delay-1 { animation-delay: -.72s; }
.pipeline-signal-delay-2 { animation-delay: -1.44s; }
.pipeline-branch-mobile { display: none !important; }
.pipeline-branch-note {
  position: absolute; left: 50%; top: 50%; padding: .2rem .35rem;
  transform: translate(-50%, 18px); background: rgba(8,10,24,.9);
  color: var(--text-faint); font: 500 .51rem/1.35 var(--mono); text-align: center;
  white-space: nowrap;
}
.pipeline-link { position: relative; height: 1px; background: rgba(126,231,255,.22); }
.pipeline-packet {
  position: absolute; top: 50%; left: 0; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  transform: translate(-50%,-50%); animation: pipeline-packet-x 1.8s linear infinite;
}
.pipeline-connectivity {
  position: relative; z-index: 1; margin-top: 1.35rem; padding: 1rem 1.1rem;
  border: 1px solid rgba(126,231,255,.18); border-radius: 15px;
  background: rgba(12,16,35,.82); box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.pipeline-connectivity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem; }
.pipeline-connectivity-head h3 { margin: .08rem 0 .2rem; font-size: 1rem; }
.pipeline-connectivity-head p:not(.pipeline-node-kicker) { max-width: 660px; color: var(--text-dim); font-size: .74rem; line-height: 1.5; }
.pipeline-connectivity-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .65rem; }
.pipeline-connectivity-state {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 28px; padding: .2rem .58rem;
  border: 1px solid var(--panel-border); border-radius: 999px;
  color: var(--text-dim); font: 500 .65rem var(--mono); white-space: nowrap;
}
.pipeline-connectivity-state .dot { flex: none; }
.pipeline-connectivity-ok { color: var(--good); border-color: rgba(125,255,199,.25); }
.pipeline-connectivity-warn { color: #ffd36e; border-color: rgba(255,211,110,.25); }
.pipeline-connectivity-down { color: #ff9d9d; border-color: rgba(255,125,125,.3); }
.pipeline-connectivity-summary {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px;
  margin-top: .9rem; overflow: hidden; border: 1px solid var(--panel-border);
  border-radius: 11px; background: var(--panel-border);
}
.pipeline-connectivity-summary > div { padding: .7rem .8rem; background: rgba(15,19,41,.96); }
.pipeline-connectivity-summary span, .pipeline-connectivity-summary small {
  display: block; color: var(--text-faint); font-size: .59rem;
  letter-spacing: .08em; text-transform: uppercase;
}
.pipeline-connectivity-summary strong { display: block; margin: .15rem 0 .12rem; color: var(--text); font: 500 1rem var(--mono); }
.pipeline-connectivity-summary small { font-size: .53rem; letter-spacing: .04em; text-transform: none; }
.pipeline-core-path { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .65rem; }
.pipeline-core-result {
  display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem;
  border: 1px solid var(--panel-border); border-radius: 8px;
  color: var(--text-dim); font-size: .68rem;
}
.pipeline-core-result code { color: var(--accent-3); font: 500 .65rem var(--mono); }
.pipeline-core-result small { color: var(--text-faint); font: .6rem var(--mono); }
.pipeline-address-details { margin-top: .7rem; border-top: 1px dashed var(--panel-border); }
.pipeline-address-details summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: .8rem;
  padding: .7rem .1rem .15rem; color: var(--accent); font-size: .72rem; cursor: pointer;
}
.pipeline-address-details summary small { color: var(--text-faint); font-size: .6rem; }
.pipeline-address-table-wrap { margin-top: .55rem; overflow-x: auto; }
.pipeline-address-table { width: 100%; border-collapse: collapse; font-size: .66rem; }
.pipeline-address-table th, .pipeline-address-table td {
  padding: .45rem .55rem; border-top: 1px solid rgba(126,231,255,.09); text-align: left;
}
.pipeline-address-table thead th {
  color: var(--text-faint); font: 500 .54rem var(--mono);
  letter-spacing: .08em; text-transform: uppercase;
}
.pipeline-address-table tbody th { color: var(--text); font-weight: 500; white-space: nowrap; }
.pipeline-address-table tbody th span {
  display: inline-block; width: 2rem; color: var(--text-faint); font: .59rem var(--mono);
}
.pipeline-address-result > span, .pipeline-address-result code { display: block; white-space: nowrap; }
.pipeline-address-result > span { color: var(--text-dim); font-size: .61rem; }
.pipeline-address-result code { margin-top: .08rem; color: var(--text-faint); font: .58rem var(--mono); }
.pipeline-address-ok > span { color: var(--good); }
.pipeline-address-down > span { color: #ff9d9d; }
.pipeline-address-disabled > span,
.pipeline-address-unconfigured > span { color: var(--text-faint); }
.pipeline-connectivity-meta { margin-top: .65rem; color: var(--text-faint); font-size: .62rem; line-height: 1.45; }
.pipeline-independent-head {
  position: relative; z-index: 1; display: flex; align-items: baseline; gap: .8rem;
  margin: 1.35rem 0 .8rem; padding-top: 1.15rem; border-top: 1px dashed rgba(177,140,255,.22);
}
.pipeline-independent-head span {
  color: var(--accent-2); font: 500 .6rem var(--mono);
  letter-spacing: .13em; text-transform: uppercase;
}
.pipeline-independent-head small { color: var(--text-faint); font-size: .67rem; }
.pipeline-independent {
  position: relative; z-index: 1; display: grid; align-items: center;
  grid-template-columns: 1fr 46px 1fr 46px 1fr 46px 1.35fr;
}
.pipeline-independent-node {
  min-height: 66px; padding: .72rem .8rem; display: flex; flex-direction: column;
  justify-content: center; border-color: rgba(177,140,255,.2);
  background: rgba(22,18,48,.7);
}
.pipeline-independent-node strong { color: #d6c5ff; }
.pipeline-link-independent { background: rgba(177,140,255,.24); }
.pipeline-link-independent .pipeline-packet {
  background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); animation-duration: 2.35s;
}

@keyframes pipeline-flow { to { stroke-dashoffset: -28; } }
@keyframes pipeline-packet-x {
  from { left: 0; opacity: 0; }
  12%, 88% { opacity: 1; }
  to { left: 100%; opacity: 0; }
}
@keyframes pipeline-source-ping {
  0% { opacity: 0; transform: scale(.55); }
  28% { opacity: .8; }
  75%, 100% { opacity: 0; transform: scale(1.55); }
}
@keyframes pipeline-hub-glow {
  0%, 100% { border-color: transparent; box-shadow: none; }
  45% { border-color: rgba(126,231,255,.32); box-shadow: 0 0 22px rgba(126,231,255,.07); }
}

@media (max-width: 980px) {
  .pipeline-stage-labels { display: none; }
  .pipeline-primary { grid-template-columns: 1fr; }
  .pipeline-source-stack, .pipeline-output-stack { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .pipeline-source, .pipeline-output { min-height: 74px; padding: .65rem; }
  .pipeline-branch { width: 100%; min-height: 58px; height: 58px; }
  .pipeline-branch-desktop { display: none !important; }
  .pipeline-branch-mobile { display: block !important; }
  .pipeline-branch-note { top: 50%; transform: translate(20px,-50%); }
  .pipeline-hub { width: min(260px, 78vw); min-height: 126px; margin: 0 auto; }
  .pipeline-link { width: 1px; height: 48px; margin: 0 auto; }
  .pipeline-packet { top: 0; left: 50%; animation-name: pipeline-packet-y; }
  .pipeline-independent { grid-template-columns: 1fr 38px 1fr 38px 1fr 38px 1.35fr; }
  .pipeline-independent .pipeline-link { width: auto; height: 1px; margin: 0; }
  .pipeline-independent .pipeline-packet { top: 50%; left: 0; animation-name: pipeline-packet-x; }
}
@media (max-width: 640px) {
  .pipeline-map { width: 100vw; margin-left: calc(50% - 50vw); padding: 1.1rem 4vw; border-left: 0; border-right: 0; border-radius: 0; }
  .pipeline-source-stack, .pipeline-output-stack { gap: 6px; }
  .pipeline-source, .pipeline-output { align-items: flex-start; gap: .42rem; min-height: 84px; padding: .58rem .5rem; }
  .pipeline-node strong { font-size: .72rem; }
  .pipeline-node small { font-size: .57rem; }
  .pipeline-node-dot { width: 7px; height: 7px; margin-top: .25rem; }
  .pipeline-output { display: block; }
  .pipeline-file-mark { width: 22px; height: 26px; margin-bottom: .38rem; }
  .pipeline-independent-head { display: block; }
  .pipeline-independent-head small { display: block; margin-top: .3rem; }
  .pipeline-independent { grid-template-columns: 1fr; padding: 0 9vw; }
  .pipeline-independent-node { min-height: 62px; text-align: center; }
  .pipeline-independent .pipeline-link { width: 1px; height: 32px; margin: 0 auto; }
  .pipeline-independent .pipeline-packet { top: 0; left: 50%; animation-name: pipeline-packet-y; }
  .pipeline-connectivity { padding: .85rem; }
  .pipeline-connectivity-head { display: block; }
  .pipeline-connectivity-actions { justify-content: flex-start; margin-top: .7rem; }
  .pipeline-connectivity-summary { grid-template-columns: 1fr 1fr; }
  .pipeline-core-result { width: 100%; }
  .pipeline-core-result small { margin-left: auto; }
  .pipeline-address-details summary { display: block; }
  .pipeline-address-details summary small { display: block; margin-top: .15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pipeline-signal, .pipeline-packet, .pipeline-node-dot::after, .pipeline-hub::after { animation: none; }
  .pipeline-signal { stroke-dasharray: 2 12; }
}
@keyframes pipeline-packet-y {
  from { top: 0; opacity: 0; }
  12%, 88% { opacity: 1; }
  to { top: 100%; opacity: 0; }
}

/* ---------- settings page: recording sources ---------- */
.source-global-card { margin-bottom: 1.2rem; }
.field-help { display: block; margin-top: .3rem; color: var(--text-faint); font-size: .7rem; }
.source-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.1rem; }
.source-card { min-width: 0; }
.source-card-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.source-card-head h3 { margin: 0.2rem 0 0.1rem; }
.source-card-head p { color: var(--text-faint); font: 0.72rem var(--mono); }
.source-state {
  display: inline-block; border-radius: 999px; padding: 0.12rem 0.5rem;
  border: 1px solid var(--panel-border); color: var(--text-faint);
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em;
}
.source-state-connected { color: var(--good); border-color: rgba(125, 255, 199, 0.35); }
.source-state-error { color: #ff9d9d; border-color: rgba(255, 125, 125, 0.4); }
.source-state-disabled { opacity: 0.6; }
.source-enabled { display: flex; gap: 0.45rem; align-items: center; color: var(--text-dim); font-size: 0.78rem; }
.source-enabled input { accent-color: var(--accent); }
.source-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, .7fr); gap: 0 .8rem; }
.source-fields .field:last-child { grid-column: 1 / -1; }
.source-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.source-last { flex: 1 1 100%; color: var(--text-faint); font-size: 0.72rem; }
.source-error { min-height: 1em; margin-top: .55rem; color: #ff9d9d; font: .72rem var(--mono); overflow-wrap: anywhere; }
.source-calibration { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--panel-border); }
.source-calibration-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.source-calibration-head h4 { margin: 0 0 .22rem; font-size: .92rem; }
.source-calibration-head p { color: var(--text-dim); font-size: .75rem; }
.source-calibration .panel-note { margin: .65rem 0 .8rem; }
.calibration-fields { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(120px, .65fr); gap: 0 .8rem; }
.calibration-note { grid-column: 1 / -1; }
.calibration-preview { margin: .15rem 0 .35rem; color: var(--accent); font: .73rem var(--mono); }
.calibration-warning { margin-bottom: .75rem; color: #ffd36e; font-size: .72rem; line-height: 1.45; }
.calibration-history { margin-top: .9rem; display: grid; gap: .55rem; }
.calibration-history-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem; padding: .7rem; border: 1px solid var(--panel-border); border-radius: 9px; background: rgba(255,255,255,.018); }
.calibration-history-row strong, .calibration-history-row span, .calibration-history-row small { display: block; }
.calibration-history-row strong { color: var(--text); font: .75rem var(--mono); }
.calibration-history-row span, .calibration-history-row small { margin-top: .2rem; color: var(--text-faint); font-size: .67rem; }
.calibration-history-row p { margin-top: .35rem; color: var(--text-dim); font-size: .72rem; }
.btn-small { padding: .35rem .58rem; font-size: .67rem; }
.loading-panel { padding: 2rem; color: var(--text-dim); background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); }

/* ---------- settings page: network diagnostics ---------- */
.network-stat-heading {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
}
.network-stat-heading > div:first-child { max-width: 760px; }
.network-stat-actions { display: flex; gap: .55rem; flex: none; padding-bottom: .25rem; }
.network-stat-controls { margin: 1.4rem 0 1rem; }
.network-range-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.network-range-buttons button {
  padding: .42rem .72rem; border: 1px solid var(--panel-border); border-radius: 999px;
  background: rgba(255,255,255,.025); color: var(--text-dim); font: 500 .75rem var(--font);
  cursor: pointer;
}
.network-range-buttons button:hover { color: var(--text); border-color: rgba(126,231,255,.45); }
.network-range-buttons button.active { color: #071018; background: var(--accent); border-color: var(--accent); }
.network-filter-grid {
  display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: .8rem;
}
.network-filter-grid .field, .network-custom-range .field { margin: 0; }
.network-custom-range {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end; gap: .8rem; margin-top: .85rem; padding-top: .85rem;
  border-top: 1px solid var(--panel-border);
}
.network-custom-range[hidden] { display: none; }
.network-series-toggles {
  display: flex; flex-wrap: wrap; gap: .65rem 1.1rem; align-items: center;
  margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--panel-border);
  color: var(--text-dim); font-size: .76rem;
}
.network-series-toggles > span { color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; font-size: .63rem; }
.network-series-toggles label { display: flex; gap: .38rem; align-items: center; cursor: pointer; }
.network-series-toggles input { accent-color: var(--accent); }
.network-stat-meta { min-height: 1.2rem; margin: .8rem 0 1rem; color: var(--text-faint); font-size: .75rem; }
.network-stat-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 1.2rem; }
.network-stat-grid .stat-value span { font-size: 1.65rem; }
.network-stat-grid .stat-hero .stat-value span { font-size: 2rem; }
.network-chart-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.network-chart-card { min-width: 0; padding: 1.25rem; }
.network-chart-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  margin-bottom: .65rem;
}
.network-chart-head h3 { margin-top: .18rem; color: var(--text); }
.network-chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .8rem; color: var(--text-faint); font-size: .7rem; }
.network-chart-legend span::before {
  content: ""; display: inline-block; width: 12px; height: 3px; margin-right: 5px;
  border-radius: 2px; vertical-align: middle; background: currentColor;
}
.legend-rx { color: #7ee7ff; }
.legend-tx { color: #b99cff; }
.legend-ping { color: #7dffc7; }
.legend-poll { color: #ffd36e; }
.legend-success { color: #ff9dad; }
.network-chart-wrap { position: relative; height: 320px; }
.network-chart-wrap canvas { display: block; width: 100%; height: 100%; }
.network-chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem;
  color: var(--text-faint); font-size: .82rem; text-align: center; pointer-events: none;
}
.network-chart-empty[hidden] { display: none; }
.network-detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 1.1rem; margin-top: 1.1rem; }
.network-detail-grid > * { min-width: 0; }
.network-detail-grid .table-wrap { max-height: 390px; }
.network-quality-card dl { display: grid; gap: 0; margin-top: .8rem; }
.network-quality-card dl div {
  display: flex; justify-content: space-between; gap: 1rem; padding: .67rem 0;
  border-bottom: 1px solid var(--panel-border);
}
.network-quality-card dt { color: var(--text-dim); font-size: .78rem; }
.network-quality-card dd { color: var(--text); font: .78rem var(--mono); text-align: right; }
.network-method-note {
  margin-top: 1.2rem; padding: 1rem 1.2rem; border: 1px dashed var(--panel-border);
  border-radius: 10px; color: var(--text-faint); font-size: .76rem; line-height: 1.6;
}
.network-method-note strong { color: var(--text-dim); }

.diagnostics-probe-card { margin-bottom: 1.2rem; }
.diagnostics-probe-form {
  display: grid; grid-template-columns: minmax(160px, .7fr) minmax(240px, 1.6fr) minmax(110px, .45fr) auto;
  gap: .9rem; align-items: end;
}
.diagnostics-probe-form .field { margin-bottom: 0; }
.diagnostics-target-field { grid-column: auto; }
.diagnostics-result { margin-bottom: 3rem; border-color: rgba(126, 231, 255, .28); }
.diagnostics-result-head, .diagnostics-snapshot-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem;
}
.diagnostics-result-head h3 { margin: .2rem 0 0; color: var(--text); overflow-wrap: anywhere; }
.diagnostics-result-meta { margin: .55rem 0 .8rem; color: var(--text-faint); font-size: .76rem; }
.diagnostics-result pre {
  max-height: 360px; overflow: auto; margin: 0; padding: 1rem;
  border: 1px solid var(--panel-border); border-radius: 10px;
  background: rgba(3, 5, 12, .75); color: #cdd5f8;
  font: .78rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.diagnostics-snapshot-head { align-items: flex-end; margin: 2.6rem 0 1.1rem; }
.diagnostics-snapshot-head .section-sub { margin-top: .45rem; }
.diagnostics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.diagnostics-table-card { min-width: 0; }
.diagnostics-table-card .table-wrap { max-height: 370px; }
.diagnostics-neighbour-card { grid-column: 1 / -1; }
.diagnostics-addresses { max-width: 360px; overflow-wrap: anywhere; }

/* ---------- settings page: live raw feed ---------- */
.live-feed-controls-card { margin-bottom: 1.2rem; }
.live-feed-controls {
  display: flex; flex-wrap: wrap; gap: .9rem; align-items: end;
}
.live-feed-controls .field {
  margin-bottom: 0; min-width: 220px; max-width: 360px;
  flex: 1 1 220px;
}
.live-feed-stat-grid { margin-bottom: 1.2rem; }
.live-feed-log {
  max-height: 420px; overflow: auto; margin: 0 0 .9rem; padding: 1rem;
  border: 1px solid var(--panel-border); border-radius: 10px;
  background: rgba(3, 5, 12, .75); color: #cdd5f8;
  font: .78rem/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
  tab-size: 2;
}
.live-feed-log:empty::before {
  content: "No lines yet — waiting for the next recording.";
  color: var(--text-faint);
}

/* ---------- settings page: SQM data archive ---------- */
.archive-heading {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
  margin-bottom: 1.4rem;
}
.archive-heading .section-head { margin-bottom: 0; }
.archive-primary-actions, .archive-card-actions, .archive-dialog-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
}
.archive-primary-actions { justify-content: flex-end; padding-bottom: .25rem; }
.archive-export-working::before {
  content: ""; width: .75rem; height: .75rem; display: inline-block; margin-right: .45rem;
  vertical-align: -.1rem; border: 2px solid rgba(126, 231, 255, .22);
  border-top-color: var(--accent); border-radius: 50%; animation: archive-spin .85s linear infinite;
}
.archive-stat-grid { margin-bottom: 3rem; }
.archive-section-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem;
  margin: 2.8rem 0 1rem; padding-bottom: .8rem;
  border-bottom: 1px solid var(--panel-border);
}
.archive-section-head .kicker { margin-bottom: .2rem; }
.archive-section-head h3 { color: var(--text); font-size: 1.25rem; }
.archive-section-head > p {
  max-width: 500px; color: var(--text-faint); font-size: .78rem; text-align: right;
}
.archive-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem;
}
.archive-card { min-width: 0; }
.archive-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding-bottom: .9rem; border-bottom: 1px solid var(--panel-border);
}
.archive-card-head h3 { margin: .45rem 0 .15rem; color: var(--text); font-size: 1.05rem; }
.archive-card-head p { color: var(--text-faint); font-size: .76rem; }
.archive-next {
  max-width: 145px; color: var(--text-dim); font: .72rem var(--mono); text-align: right;
}
.archive-next small { display: block; margin-bottom: .25rem; color: var(--text-faint); font: .62rem var(--font); text-transform: uppercase; letter-spacing: .1em; }
.archive-provider-mark {
  width: 2.2rem; height: 2.2rem; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: var(--accent); font: 600 .9rem var(--mono);
  background: rgba(126, 231, 255, .08); border: 1px solid rgba(126, 231, 255, .22);
}
.archive-meta { display: grid; gap: .7rem; margin: 1rem 0; }
.archive-meta div { display: grid; grid-template-columns: 6rem 1fr; gap: .7rem; }
.archive-meta dt {
  color: var(--text-faint); font-size: .62rem; text-transform: uppercase;
  letter-spacing: .1em;
}
.archive-meta dd {
  min-width: 0; color: var(--text-dim); font-size: .78rem; overflow-wrap: anywhere;
}
.archive-card-actions { margin-top: .8rem; }
.archive-empty {
  grid-column: 1 / -1; padding: 2rem; text-align: center;
  background: rgba(126, 231, 255, .025); border: 1px dashed var(--panel-border);
  border-radius: var(--radius); color: var(--text-dim);
}
.archive-empty strong { display: block; color: var(--text); margin-bottom: .35rem; }
.archive-empty p { font-size: .82rem; }
.archive-calendar-card { margin-top: 1rem; }
.archive-calendar-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  margin-bottom: 1rem;
}
.archive-calendar-head .kicker { margin-bottom: .2rem; }
.archive-calendar-head h3 { margin-bottom: .2rem; color: var(--text); font-size: 1.05rem; }
.archive-calendar-summary { color: var(--text-faint); font-size: .76rem; }
.archive-calendar-controls { display: flex; align-items: center; gap: .35rem; }
.archive-calendar-controls .btn { min-width: 2.1rem; }
.archive-calendar-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, 155px);
  gap: 1.25rem; align-items: end;
}
.archive-calendar-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem;
}
.archive-calendar-weekday {
  padding: 0 .2rem .25rem; color: var(--text-faint); font-size: .62rem;
  text-align: center; text-transform: uppercase; letter-spacing: .08em;
}
.archive-calendar-day {
  min-width: 0; min-height: 2.65rem; padding: .38rem .42rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: .2rem;
  border: 1px solid rgba(120, 140, 255, .12); border-radius: 8px;
  color: var(--text-dim); background: rgba(255,255,255,.018);
  width: 100%; cursor: pointer; appearance: none;
  font: .7rem var(--mono); text-align: left;
}
.archive-calendar-day:not(.archive-calendar-day--outside):hover { border-color: rgba(126,231,255,.55); background: rgba(126,231,255,.08); }
.archive-calendar-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.archive-calendar-day--one {
  color: var(--good); border-color: rgba(125,255,199,.34); background: rgba(125,255,199,.08);
}
.archive-calendar-day--some {
  color: var(--good); border-color: rgba(125,255,199,.5); background: rgba(125,255,199,.15);
}
.archive-calendar-day--many {
  color: #d4faff; border-color: rgba(126,231,255,.68); background: rgba(126,231,255,.2);
  box-shadow: inset 0 0 14px rgba(126,231,255,.06);
}
.archive-calendar-day--today { box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(126,231,255,.15); }
.archive-calendar-day--outside { opacity: .22; background: transparent; cursor: default; }
.archive-calendar-number { line-height: 1.1; }
.archive-calendar-count {
  min-width: 1.05rem; padding: .08rem .2rem; border-radius: 999px;
  color: inherit; background: rgba(5,6,14,.3); font-size: .6rem; line-height: 1.1;
  text-align: center;
}
.archive-calendar-key {
  display: grid; align-content: center; gap: .45rem; color: var(--text-faint); font-size: .67rem;
}
.archive-calendar-key > span:not(.archive-calendar-key-label) { display: flex; align-items: center; gap: .4rem; }
.archive-calendar-key-label {
  margin-bottom: .05rem; color: var(--text-dim); font-size: .61rem;
  text-transform: uppercase; letter-spacing: .1em;
}
.archive-calendar-swatch { width: .72rem; height: .72rem; flex: none; border: 1px solid transparent; border-radius: 3px; }
.archive-calendar-swatch-none { border-color: rgba(120,140,255,.16); background: rgba(255,255,255,.018); }
.archive-calendar-swatch-one { border-color: rgba(125,255,199,.34); background: rgba(125,255,199,.08); }
.archive-calendar-swatch-some { border-color: rgba(125,255,199,.5); background: rgba(125,255,199,.15); }
.archive-calendar-swatch-many { border-color: rgba(126,231,255,.68); background: rgba(126,231,255,.2); }
.archive-calendar-note { margin-top: .9rem; color: var(--text-faint); font-size: .68rem; }
.archive-calendar-dialog { width: min(680px, calc(100vw - 2rem)); }
.archive-calendar-dialog .archive-dialog-shell { max-height: calc(100vh - 2rem); }
.archive-calendar-run-list { display: grid; gap: .65rem; }
.archive-calendar-run {
  padding: .85rem; border: 1px solid var(--panel-border); border-radius: 10px;
  background: rgba(255,255,255,.025);
}
.archive-calendar-run-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem;
  padding-bottom: .65rem; border-bottom: 1px solid var(--panel-border);
}
.archive-calendar-run-head strong { color: var(--text); font-size: .86rem; text-transform: capitalize; }
.archive-calendar-run-head small { display: block; margin-top: .18rem; color: var(--text-faint); font: .68rem var(--mono); }
.archive-calendar-run-meta { display: grid; gap: .45rem; margin-top: .7rem; }
.archive-calendar-run-meta div { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: .7rem; }
.archive-calendar-run-meta dt {
  color: var(--text-faint); font-size: .61rem; text-transform: uppercase; letter-spacing: .08em;
}
.archive-calendar-run-meta dd { min-width: 0; color: var(--text-dim); font-size: .74rem; overflow-wrap: anywhere; }
.archive-history-wrap { border: 1px solid var(--panel-border); border-radius: var(--radius); }
.archive-history-table td { min-width: 90px; }
.archive-history-table td:nth-child(5) { min-width: 190px; }
.archive-trigger, .archive-run-error {
  display: block; margin-top: .25rem; color: var(--text-faint); font-size: .68rem;
}
.archive-run-error { max-width: 220px; color: #ff9d9d; }
.btn-danger {
  color: #ffd1d1; border-color: rgba(255, 125, 125, .46);
  background: rgba(130, 34, 45, .28);
}
.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px); color: #fff; border-color: rgba(255, 125, 125, .8);
  background: rgba(150, 38, 50, .48);
}
.recovery-heading { margin-bottom: 1rem; }
.recovery-warning { line-height: 1.55; }
.recovery-current-card {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  margin-bottom: 1rem; padding: 1.25rem 1.4rem;
  border-color: rgba(255, 125, 125, .22);
}
.recovery-current-card h3, .recovery-card h3 { margin: 0 0 .35rem; color: var(--text); font-size: 1.12rem; }
.recovery-current-card .kicker, .recovery-card .kicker { margin-bottom: .38rem; }
.recovery-current-card .panel-note { margin: .2rem 0 0; }
.recovery-current-action { display: grid; justify-items: end; gap: .4rem; text-align: right; }
.recovery-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.recovery-card { min-width: 0; padding: 1.2rem 1.3rem; }
.recovery-card .panel-note { margin: .45rem 0 .9rem; line-height: 1.5; }
.recovery-card .field { margin: .9rem 0 .4rem; }
.recovery-card input[type="file"] { color: var(--text-dim); font-size: .78rem; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .8rem; }
.recovery-template-row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: .9rem 0 .25rem; }
.recovery-template-row .panel-note { margin: 0; }
.recovery-preview {
  margin-top: .7rem; padding: .75rem .85rem; border: 1px solid rgba(72, 146, 224, .23);
  border-radius: 9px; color: var(--text-dim); background: rgba(4, 16, 35, .42);
  font-size: .76rem; line-height: 1.5;
}
.recovery-preview[hidden] { display: none; }
.recovery-preview strong { color: var(--text); font-weight: 600; }
.recovery-preview ul { margin: .5rem 0 0; padding-left: 1.3rem; }
.recovery-preview li + li { margin-top: .2rem; }
.recovery-preview--invalid { border-color: rgba(255, 125, 125, .35); }
.recovery-preview--valid { border-color: rgba(125, 255, 199, .28); }
.recovery-history-heading { margin: 1.7rem 0 .7rem; }
.recovery-history-table td:nth-child(3) { min-width: 180px; }
.recovery-confirm-dialog { width: min(560px, calc(100vw - 2rem)); }
.recovery-confirm-dialog .archive-dialog-shell { padding: 1.35rem; }
.recovery-confirm-dialog .archive-dialog-head { margin-bottom: .8rem; }
.recovery-confirm-dialog .archive-dialog-head h2 { color: #ffd1d1; }
.recovery-confirm-dialog .panel-note { margin-top: .4rem; }
.recovery-confirm-dialog .field { margin-bottom: .75rem; }
.recovery-confirm-dialog .archive-dialog-actions { justify-content: flex-end; }
.recovery-confirm-dialog .form-msg { min-height: 1.1rem; }
.archive-deliveries { display: grid; gap: .35rem; }
.archive-deliveries > span {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  color: var(--text-dim); font-size: .74rem;
}
.archive-dialog {
  width: min(780px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  padding: 0; color: var(--text); background: #0b0d1a;
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0,0,0,.7);
}
.archive-dialog::backdrop {
  background: rgba(2, 3, 10, .78); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.archive-dialog-shell { padding: 1.5rem; overflow-y: auto; }
.archive-dialog-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--panel-border);
}
.archive-dialog-head h2 { font-size: 1.4rem; }
.archive-dialog-close {
  width: 2.2rem; height: 2.2rem; border: 1px solid var(--panel-border);
  border-radius: 50%; color: var(--text-dim); background: rgba(255,255,255,.04);
  font: 1rem var(--font); cursor: pointer;
}
.archive-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem;
}
.archive-form-grid .archive-span { grid-column: 1 / -1; }
.field textarea {
  width: 100%; resize: vertical; padding: .65rem .9rem;
  background: rgba(5, 6, 14, .55); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 10px;
  font-family: var(--mono); font-size: .82rem;
}
.field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(126, 231, 255, .12);
}
.archive-picker-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: .6rem 0 1rem;
}
.archive-picker-grid fieldset {
  min-width: 0; padding: .9rem; border: 1px solid var(--panel-border); border-radius: 10px;
}
.archive-picker-grid legend {
  padding: 0 .35rem; color: var(--accent); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em;
}
.archive-check-list { max-height: 230px; overflow-y: auto; display: grid; gap: .25rem; }
.archive-check {
  display: flex; align-items: center; gap: .5rem; padding: .35rem;
  color: var(--text-dim); font-size: .8rem;
}
.archive-check input { accent-color: var(--accent); }
.archive-check small { color: var(--text-faint); }
.archive-download-fieldset {
  min-width: 0; margin-top: .6rem; padding: .9rem;
  border: 1px solid var(--panel-border); border-radius: 10px;
}
.archive-download-fieldset legend {
  padding: 0 .35rem; color: var(--accent); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .1em;
}
.archive-progress-dialog { width: min(720px, calc(100vw - 2rem)); }
.archive-progress-spinner {
  width: 2.5rem; height: 2.5rem; flex: none; border-radius: 50%;
  border: 3px solid rgba(126, 231, 255, .15); border-top-color: var(--accent);
  box-shadow: 0 0 20px rgba(126, 231, 255, .12);
  animation: archive-spin .85s linear infinite;
}
.archive-progress-spinner.done {
  border-color: rgba(91, 225, 160, .75); animation: none;
  box-shadow: 0 0 20px rgba(91, 225, 160, .16);
}
.archive-progress-spinner.failed {
  border-color: rgba(255, 112, 112, .75); animation: none;
  box-shadow: 0 0 20px rgba(255, 112, 112, .14);
}
@keyframes archive-spin { to { transform: rotate(360deg); } }
.archive-progress-current {
  margin-top: 1rem; padding: 1rem; border: 1px solid rgba(126, 231, 255, .18);
  border-radius: 10px; background: rgba(126, 231, 255, .04);
}
.archive-progress-current > div {
  display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .65rem;
}
.archive-progress-current span {
  color: var(--accent); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
}
.archive-progress-current strong { color: var(--text); font: .78rem var(--mono); }
.archive-progress-current progress {
  display: block; width: 100%; height: .7rem; overflow: hidden;
  border: 0; border-radius: 99px; background: rgba(255,255,255,.08);
  accent-color: var(--accent);
}
.archive-progress-current progress::-webkit-progress-bar {
  background: rgba(255,255,255,.08); border-radius: 99px;
}
.archive-progress-current progress::-webkit-progress-value {
  border-radius: 99px; background: linear-gradient(90deg, #2d8fac, var(--accent));
  transition: width .3s ease;
}
.archive-progress-current progress::-moz-progress-bar {
  border-radius: 99px; background: linear-gradient(90deg, #2d8fac, var(--accent));
}
.archive-progress-current p { margin-top: .7rem; color: var(--text-dim); font-size: .82rem; }
.archive-progress-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0;
}
.archive-progress-metrics div {
  padding: .75rem; border: 1px solid var(--panel-border); border-radius: 9px;
  background: rgba(255,255,255,.025);
}
.archive-progress-metrics span {
  display: block; color: var(--text-faint); font-size: .58rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.archive-progress-metrics strong {
  display: block; margin-top: .3rem; color: var(--text); font: .82rem var(--mono);
}
.archive-progress-log-wrap {
  border: 1px solid var(--panel-border); border-radius: 10px; overflow: hidden;
}
.archive-progress-log-wrap > div {
  display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .8rem;
  color: var(--text-dim); font-size: .7rem; border-bottom: 1px solid var(--panel-border);
  background: rgba(255,255,255,.025);
}
.archive-progress-log-wrap small { color: var(--text-faint); }
.archive-progress-log {
  max-height: 180px; margin: 0; padding: .55rem .8rem; overflow-y: auto;
  list-style: none; font: .68rem/1.5 var(--mono); color: var(--text-dim);
}
.archive-progress-log li { display: grid; grid-template-columns: 4.5rem 1fr; gap: .65rem; padding: .28rem 0; }
.archive-progress-log time { color: var(--text-faint); }
@media (prefers-reduced-motion: reduce) {
  .archive-progress-spinner { animation: none; }
}
.archive-dialog-actions {
  justify-content: flex-end; margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--panel-border);
}
.archive-dialog-actions .form-msg { flex: 1 1 230px; margin: 0; }
.archive-cloud-ready, .archive-cloud-setup {
  margin: .45rem 0 1rem; padding: .85rem 1rem; border-radius: 10px;
  color: var(--text-dim); font-size: .8rem; line-height: 1.55;
}
.archive-cloud-ready {
  background: rgba(91, 225, 160, .06); border: 1px solid rgba(91, 225, 160, .2);
}
.archive-cloud-setup {
  background: rgba(126, 231, 255, .05); border: 1px solid rgba(126, 231, 255, .17);
}
.archive-cloud-ready strong, .archive-cloud-setup strong { display: block; color: var(--text); }
.archive-cloud-setup ol { margin: .55rem 0 .6rem 1.2rem; }
.archive-cloud-setup li { margin: .35rem 0; }
.archive-cloud-setup code, .archive-token-import code {
  overflow-wrap: anywhere; color: var(--accent); font-family: var(--mono); font-size: .76rem;
}
.archive-cloud-setup li > code { display: block; margin-top: .25rem; }
.archive-token-import {
  margin: .45rem 0 1rem; padding: .75rem 1rem; border: 1px solid var(--panel-border);
  border-radius: 10px; color: var(--text-dim); font-size: .8rem;
}
.archive-token-import summary { color: var(--text); cursor: pointer; font-weight: 600; }
.archive-token-import p { margin: .7rem 0; line-height: 1.55; }
.archive-token-import a { color: var(--accent); }
.archive-estimate {
  padding: .75rem 1rem; border-radius: 10px; color: var(--text-dim);
  background: rgba(126, 231, 255, .05); border: 1px solid rgba(126, 231, 255, .15);
  font-size: .82rem;
}
.archive-estimate code { color: var(--accent); font: .76rem var(--mono); }

/* ---------- auth: login page ---------- */
.auth-main {
  min-height: 100vh; display: grid; place-items: center;
  padding: 8rem 4vw 4rem;
}
.auth-card {
  width: min(430px, 100%);
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 2.2rem 2.2rem 1.8rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.auth-card h1 { font-size: 1.7rem; letter-spacing: -0.01em; margin-bottom: 0.3rem; }
.auth-sub { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 1.4rem; }
.auth-step-note { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 1.1rem; }
.auth-step-note strong { color: var(--text); }
.auth-divider {
  display: flex; align-items: center; gap: 0.9rem;
  color: var(--text-faint); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.14em; margin: 1.2rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; border-top: 1px solid var(--panel-border);
}
.auth-hint { color: var(--text-faint); font-size: 0.78rem; margin-top: 0.9rem; }
.auth-foot {
  color: var(--text-faint); font-size: 0.72rem; margin-top: 1.6rem;
  padding-top: 1rem; border-top: 1px solid var(--panel-border);
}
.btn-block { display: block; width: 100%; margin-top: 0.6rem; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none !important; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 0.95rem; }
.field-label {
  display: block; color: var(--text-faint); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.35rem;
}
.field input, .field select {
  width: 100%; padding: 0.65rem 0.9rem;
  background: rgba(5, 6, 14, 0.55); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 10px;
  font-family: var(--font); font-size: 0.92rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 231, 255, 0.12);
}
.form-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; }
.form-row .field { flex: 1 1 160px; margin-bottom: 0; }
.form-row .btn { flex: none; }
.settings-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem 1.1rem; margin-bottom: 0.5rem;
}
.settings-form-grid .field { margin-bottom: 0; }
.field-checkbox {
  display: flex; align-items: center; gap: 0.55rem;
  min-height: 2.7rem; color: var(--text);
}
.field-checkbox input { width: auto; accent-color: var(--accent); }
.form-msg { font-size: 0.82rem; margin-top: 0.7rem; min-height: 1.2em; }
.form-msg.ok { color: var(--good); }
.form-msg.err { color: #ff9d9d; }

.notice {
  border-radius: 10px; padding: 0.7rem 1rem; font-size: 0.85rem; margin-bottom: 1.1rem;
}
.notice-error { background: rgba(255, 125, 125, 0.1); border: 1px solid rgba(255, 125, 125, 0.35); color: #ffc4c4; }
.notice-ok { background: rgba(125, 255, 199, 0.08); border: 1px solid rgba(125, 255, 199, 0.3); color: var(--good); }

/* ---------- settings page: account & users ---------- */
.auth-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}
.panel-card {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 1.4rem 1.5rem;
}
.panel-card h3 { color: var(--accent); font-size: 1rem; margin-bottom: 0.5rem; }
.panel-note { color: var(--text-dim); font-size: 0.84rem; margin-bottom: 0.9rem; }
.panel-wide { margin-top: 1.4rem; }
.secret-box {
  background: rgba(5, 6, 14, 0.6); border: 1px dashed var(--panel-border);
  border-radius: 10px; padding: 0.7rem 1rem; margin-bottom: 1rem;
  word-break: break-all;
}
.secret-box code { font-family: var(--mono); color: var(--accent-3); font-size: 0.95rem; letter-spacing: 0.08em; }

.passkey-list { list-style: none; margin-bottom: 1rem; }
.passkey-list li {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.5rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}
.passkey-list li span:first-child { flex: 1; }
.passkey-meta { color: var(--text-faint); font-size: 0.74rem; }
.passkey-empty { color: var(--text-faint); font-style: italic; }

.role-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  border-radius: 999px; padding: 0.15rem 0.65rem; vertical-align: middle;
}
.role-admin { background: rgba(177, 140, 255, 0.15); color: var(--accent-2); border: 1px solid rgba(177, 140, 255, 0.4); }
.role-operator { background: rgba(126, 231, 255, 0.1); color: var(--accent); border: 1px solid rgba(126, 231, 255, 0.35); }
.role-viewer { background: rgba(154, 163, 199, 0.12); color: var(--text-dim); border: 1px solid rgba(154, 163, 199, 0.3); }

.chip {
  display: inline-block; font-size: 0.7rem; border-radius: 999px;
  padding: 0.15rem 0.6rem; background: rgba(126, 231, 255, 0.08);
  border: 1px solid var(--panel-border); color: var(--text-dim);
}
.chip-ok { color: var(--good); border-color: rgba(125, 255, 199, 0.35); }
.chip-warn { color: var(--accent-3); border-color: rgba(255, 217, 160, 0.4); }
.chip-dim { opacity: 0.6; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th {
  text-align: left; color: var(--text-faint); font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 500;
  padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--panel-border);
}
.table td { padding: 0.7rem 0.8rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.table select {
  background: rgba(5, 6, 14, 0.55); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 8px;
  padding: 0.3rem 0.5rem; font-family: var(--font); font-size: 0.82rem;
}
.cell-dim { color: var(--text-faint); font-size: 0.78rem; }
.row-disabled td { opacity: 0.55; }
.row-actions { white-space: nowrap; }
.row-actions .btn-small { margin: 0.1rem 0.15rem; }
.row-note { color: var(--text-faint); font-size: 0.78rem; font-style: italic; }
.btn-danger:hover:not(:disabled) { color: #ff9d9d; border-color: rgba(255, 125, 125, 0.5); }

.nav-user { color: var(--text-dim); font-size: 0.85rem; }
.nav-logout {
  background: none; border: 1px solid var(--panel-border); border-radius: 999px;
  color: var(--text-dim); font-family: var(--font); font-size: 0.82rem;
  padding: 0.35rem 1rem; cursor: pointer; transition: color .2s, border-color .2s;
}
.nav-logout:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 860px) {
  .auth-main { padding-top: 7rem; }
  .auth-card { padding: 1.6rem 1.3rem; }
  .row-actions { white-space: normal; }
  .settings-page .nav-links { display: none; }
  .source-list { grid-template-columns: 1fr; }
  .diagnostics-probe-form { grid-template-columns: 1fr 1fr; }
  .diagnostics-target-field { grid-column: 1 / -1; grid-row: 1; }
  .diagnostics-grid { grid-template-columns: 1fr; }
  .diagnostics-neighbour-card { grid-column: auto; }
  .network-stat-heading { align-items: flex-start; flex-direction: column; }
  .network-filter-grid, .network-stat-grid { grid-template-columns: 1fr 1fr; }
  .network-detail-grid { grid-template-columns: 1fr; }
  .network-detail-grid .table-wrap { overflow-x: auto; }
  .archive-heading, .archive-section-head { align-items: flex-start; flex-direction: column; }
  .archive-primary-actions { justify-content: flex-start; }
  .archive-section-head > p { text-align: left; }
  .archive-card-grid { grid-template-columns: 1fr; }
  .archive-calendar-layout { grid-template-columns: 1fr; }
  .archive-calendar-key { grid-template-columns: repeat(4, max-content); gap: .45rem 1rem; }
  .archive-calendar-key-label { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .settings-menu-button { padding: 0.4rem 0.65rem; }
  .source-fields { grid-template-columns: 1fr; }
  .calibration-fields { grid-template-columns: 1fr; }
  .diagnostics-probe-form { grid-template-columns: 1fr; }
  .diagnostics-target-field { grid-column: auto; grid-row: auto; }
  .diagnostics-snapshot-head { align-items: flex-start; flex-direction: column; }
  .network-filter-grid, .network-custom-range, .network-stat-grid { grid-template-columns: 1fr; }
  .network-stat-actions { width: 100%; }
  .network-stat-actions .btn { flex: 1; }
  .network-chart-wrap { height: 270px; }
  .source-fields .field:last-child { grid-column: auto; }
  .calibration-note { grid-column: auto; }
  .archive-calendar-head { flex-direction: column; }
  .recovery-current-card { align-items: flex-start; flex-direction: column; }
  .recovery-current-action { justify-items: start; text-align: left; }
  .recovery-card-grid { grid-template-columns: 1fr; }
  .archive-calendar-controls { width: 100%; justify-content: space-between; }
  .archive-calendar-controls .btn:nth-child(2) { flex: 1; }
  .archive-calendar-grid { gap: .2rem; }
  .archive-calendar-day { min-height: 2.3rem; padding: .3rem .25rem; }
  .archive-calendar-number { font-size: .66rem; }
  .archive-calendar-count { min-width: .9rem; padding: .06rem .14rem; font-size: .56rem; }
  .archive-calendar-key { grid-template-columns: repeat(2, max-content); }
  .archive-form-grid, .archive-picker-grid { grid-template-columns: 1fr; }
  .archive-progress-metrics { grid-template-columns: repeat(2, 1fr); }
  .archive-progress-log-wrap > div { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .archive-dialog-shell { padding: 1.1rem; }
  .archive-dialog-actions .form-msg { flex-basis: 100%; }
  .sro-stat-grid { grid-template-columns: 1fr; }
  .sro-provenance { padding: 1.1rem; }
}

/* ---------- settings dashboard shell ---------- */
.settings-page {
  --settings-sidebar-width: 236px;
  background-color: #071326;
  background-image:
    radial-gradient(900px 520px at 82% -12%, rgba(60, 91, 180, .18), transparent 68%),
    radial-gradient(760px 460px at -10% 78%, rgba(21, 107, 166, .12), transparent 68%);
}
.settings-page .nav {
  left: var(--settings-sidebar-width);
}
.settings-page .nav-inner {
  width: auto;
  margin: 0;
  padding: .72rem 2.6rem;
  justify-content: flex-end;
}
.settings-page .nav .brand,
.settings-page .nav-links a,
.settings-page .settings-menu-button { display: none; }
.settings-page .nav-links { display: flex; gap: 1rem; }
.settings-page .settings-menu {
  top: 32px;
  right: auto;
  left: 0;
  bottom: 0;
  width: var(--settings-sidebar-width);
  padding: 1.4rem .8rem 1rem;
  transform: none;
  background: linear-gradient(180deg, #071326 0%, #061124 72%, #08182d 100%);
  border: 0;
  border-right: 1px solid rgba(101, 174, 255, .13);
  box-shadow: 20px 0 50px rgba(0, 0, 0, .12);
}
.settings-sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .1rem .5rem 1.7rem;
  color: #dbe8ff;
  text-decoration: none;
}
.settings-sidebar-mark { width: 48px; height: 48px; flex: none; color: #59c7ff; }
.settings-sidebar-brand strong {
  display: block;
  color: #dbe8ff;
  font-size: 1rem;
  line-height: 1.08;
  letter-spacing: .01em;
}
.settings-sidebar-brand small {
  display: block;
  margin-top: .42rem;
  color: #5ea3dc;
  font: 500 .42rem/1.35 var(--mono);
  letter-spacing: .13em;
}
.settings-page .settings-menu-head {
  display: none;
}
.settings-page .settings-menu nav {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  padding: 0;
  overflow-y: auto;
}
.settings-page .settings-menu nav a {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  gap: .62rem;
  align-items: center;
  min-height: 42px;
  padding: .56rem .62rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #8eadd6;
}
.settings-page .settings-menu nav a:hover { color: #e4efff; background: rgba(57, 151, 227, .09); }
.settings-page .settings-menu nav a.active {
  color: #75d8ff;
  background: linear-gradient(90deg, rgba(0, 174, 255, .24), rgba(26, 89, 171, .25));
  border-color: rgba(68, 182, 255, .24);
  box-shadow: inset 3px 0 #13b8f6;
}
.settings-page .settings-menu nav a > span:first-child { color: #8acaff; font: 500 1.05rem/1 var(--font); }
.settings-page .settings-menu nav strong { color: inherit; font-size: .82rem; font-weight: 500; }
.settings-page .settings-menu nav small { display: none; }
.settings-nav-label {
  display: block;
  margin: 1.05rem .62rem .28rem;
  color: #7092bc;
  font: 500 .7rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.settings-page .settings-menu nav .settings-nav-label:first-child { margin-top: .1rem; }
.settings-page .site-hero,
.settings-page main,
.settings-page .footer { margin-left: var(--settings-sidebar-width); }
.settings-page .site-hero .container,
.settings-page main .container,
.settings-page .footer .container { width: min(1220px, calc(100% - 64px)); }
.settings-page .settings-hero {
  min-height: 0;
  padding: 5.4rem 0 2.1rem;
  background:
    radial-gradient(700px 260px at 84% 0%, rgba(50, 117, 223, .17), transparent 70%),
    linear-gradient(180deg, rgba(5, 19, 41, .9), rgba(7, 19, 38, .38));
  border-bottom: 1px solid rgba(101, 174, 255, .12);
}
.settings-page .settings-hero .hero-nebula { opacity: .35; }
.settings-hero-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.settings-hero-title { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.settings-page .settings-hero h1 {
  margin: 0;
  color: #e8f0ff;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  letter-spacing: -.025em;
}
.settings-preview-pill {
  display: inline-flex;
  align-items: center;
  height: 1.65rem;
  padding: 0 .75rem;
  border: 1px solid rgba(130, 89, 255, .55);
  border-radius: 999px;
  color: #b7a2ff;
  background: rgba(90, 62, 196, .22);
  font-size: .66rem;
  letter-spacing: .02em;
}
.settings-page .settings-hero .site-hero-coords { margin: .35rem 0 0; color: #91abd3; font: 400 .86rem var(--font); }
.settings-updated { margin-top: .32rem; color: #91abd3; font: 400 .67rem var(--mono); white-space: nowrap; }
.settings-page main .section { padding: 1.2rem 0 1.9rem; }
.settings-page main .section-alt { background: rgba(6, 19, 40, .25); }
.dashboard-container { max-width: 1220px; }
.dashboard-source-note {
  margin: .05rem 0 .72rem;
  color: #849fc9;
  font-size: .75rem;
}
.dashboard-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.dashboard-stat {
  position: relative;
  min-width: 0;
  min-height: 114px;
  overflow: hidden;
  padding: .86rem 1rem .8rem 3.35rem;
  border: 1px solid rgba(72, 146, 224, .24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(11, 34, 67, .9), rgba(10, 25, 52, .82));
  box-shadow: inset 0 1px 0 rgba(201, 232, 255, .035);
}
.dashboard-stat::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: rgba(61, 171, 255, .18); }
.dashboard-stat-icon { position: absolute; left: 1rem; top: 1.15rem; color: #45c6ff; font-size: 1.7rem; line-height: 1; }
.dashboard-stat .stat-label { margin: 0 0 .3rem; color: #8eadcf; font-size: .7rem; letter-spacing: .02em; text-transform: none; }
.dashboard-stat .stat-value { gap: .4rem; }
.dashboard-stat .stat-value span { color: #e6f1ff; font-size: 1.85rem; font-weight: 600; }
.dashboard-stat .stat-value small { color: #a1b7dc; font-size: .72rem; }
.dashboard-stat .stat-note { margin-top: .28rem; color: #8ba5cc; font-size: .7rem; line-height: 1.3; }
.dashboard-stat-attention { border-color: rgba(245, 170, 54, .38); background: linear-gradient(135deg, rgba(56, 39, 27, .83), rgba(27, 28, 48, .82)); }
.dashboard-stat-attention .dashboard-stat-icon, .dashboard-stat-attention .stat-value span { color: #ffbd58; }
.dashboard-stat-disabled { border-color: rgba(111, 116, 201, .3); background: linear-gradient(135deg, rgba(28, 32, 70, .88), rgba(17, 27, 57, .82)); }
.dashboard-stat-disabled .dashboard-stat-icon, .dashboard-stat-disabled .stat-value span { color: #aba4ff; }
.dashboard-stat-archive { border-color: rgba(43, 185, 165, .35); background: linear-gradient(135deg, rgba(9, 55, 64, .8), rgba(11, 31, 54, .83)); }
.dashboard-stat-archive .dashboard-stat-icon, .dashboard-stat-archive .stat-value span { color: #66e5c7; }
.dashboard-panel {
  min-width: 0;
  margin-top: .72rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(72, 146, 224, .25);
  border-radius: 8px;
  background: rgba(8, 25, 51, .79);
  box-shadow: inset 0 1px 0 rgba(201, 232, 255, .025);
}
.dashboard-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dashboard-panel-head h2 { display: flex; align-items: center; gap: .48rem; color: #dceaff; font-size: 1rem; letter-spacing: 0; }
.dashboard-panel-head p { margin-top: .12rem; color: #8aa7ce; font-size: .75rem; }
.dashboard-panel-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.dashboard-panel-actions .btn { padding: .45rem .72rem; font-size: .67rem; }
.dashboard-panel-actions .btn-primary { color: #03162a; background: #28c9f3; box-shadow: none; }
.dashboard-alert-mark { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; color: #ffbd58; background: rgba(255, 181, 67, .16); font: 700 .85rem var(--mono); }
.dashboard-alert-panel { margin-top: .72rem; }
.dashboard-alert-list { margin-top: .62rem; border-top: 1px solid rgba(72, 146, 224, .19); }
.dashboard-alert-row { display: grid; grid-template-columns: .7rem minmax(150px, 1fr) minmax(0, 2.6fr) max-content; align-items: center; gap: .65rem; min-height: 31px; border-bottom: 1px solid rgba(72, 146, 224, .15); color: #dbe8ff; font-size: .79rem; }
.dashboard-alert-row:last-child { border-bottom: 0; }
.dashboard-alert-row .dot { width: .65rem; height: .65rem; }
.dashboard-alert-reason { color: #9eb4d7; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-alert-reason b { color: #ffbd58; font-weight: 500; }
.dashboard-alert-age { color: #91a8cc; font: .68rem var(--mono); white-space: nowrap; }
.dashboard-lower-grid { display: grid; grid-template-columns: 1.18fr 1fr 1fr; gap: .72rem; align-items: stretch; }
.dashboard-lower-grid .dashboard-panel { display: flex; flex-direction: column; }
.dashboard-lower-grid .dashboard-panel-head { min-height: 2.5rem; }
.dashboard-panel-icon { color: #58ceff; font-size: 1.45rem; }
.dashboard-text-link { padding: .05rem 0; border: 0; background: transparent; color: #49d6ff; font: 500 .66rem var(--font); cursor: pointer; }
.dashboard-text-link:disabled { color: #6682aa; cursor: default; opacity: .65; }
.dashboard-text-link:hover { color: #b9eeff; }
.dashboard-pipeline-steps { display: flex; align-items: flex-start; gap: .32rem; margin-top: .8rem; }
.dashboard-pipeline-step { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: .42rem; flex: 1; min-width: 0; }
.dashboard-pipeline-step > span { grid-row: span 3; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border: 2px solid #55d2ff; border-radius: 50%; color: #58d8ff; font: 700 .84rem var(--mono); }
.dashboard-pipeline-step-warn > span { border-color: #ffbd58; color: #ffbd58; }
.dashboard-pipeline-step-muted > span { border-color: #8d9fe2; color: #a7baff; }
.dashboard-pipeline-step strong { color: #d4e8ff; font-size: .76rem; font-weight: 500; }
.dashboard-pipeline-step small, .dashboard-pipeline-step em { display: block; color: #8ba9d3; font: .72rem var(--mono); font-style: normal; }
.dashboard-pipeline-step em { margin-top: .1rem; color: #6586b3; font-family: var(--font); font-size: .72rem; }
.dashboard-pipeline-step-muted > span { border-color: #8d9fe2; color: #a7baff; }
.dashboard-pipeline-connector { padding-top: .33rem; color: #77a9d6; font-size: 1rem; }
.dashboard-connectivity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; margin-top: .72rem; }
.dashboard-connectivity-grid > div { display: grid; grid-template-columns: .7rem 1fr; column-gap: .42rem; padding: .45rem .5rem; border: 1px solid rgba(72, 146, 224, .2); border-radius: 6px; background: rgba(4, 17, 37, .38); }
.dashboard-connectivity-grid .dot { grid-row: span 2; align-self: center; width: .62rem; height: .62rem; }
.dashboard-connectivity-grid strong { color: #dbeaff; font: 600 .95rem var(--mono); }
.dashboard-connectivity-grid small { color: #86a5cf; font-size: .68rem; }
.dashboard-panel-foot { margin-top: auto; padding-top: .65rem; color: #6e8eb9; font-size: .68rem; line-height: 1.35; }
.dashboard-archive-list { margin-top: .65rem; border-top: 1px solid rgba(72, 146, 224, .16); }
.dashboard-archive-row { display: grid; grid-template-columns: 1.2fr .8fr max-content; align-items: center; gap: .4rem; min-height: 31px; border-bottom: 1px solid rgba(72, 146, 224, .14); color: #b8cee9; font-size: .7rem; }
.dashboard-archive-row strong { text-align: right; font-size: .68rem; font-weight: 500; text-transform: capitalize; }
.dashboard-run-ok { color: #61e0bd; }
.dashboard-run-other { color: #ffbd58; }
.dashboard-empty { padding: .75rem 0; color: #7896be; font-size: .76rem; }
.dashboard-station-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.dashboard-station-head .kicker { margin-bottom: .35rem; }
.dashboard-station-head h2 { color: #dceaff; font-size: 1.35rem; }
.dashboard-station-controls { display: flex; gap: .5rem; align-items: center; }
.dashboard-search { display: flex; align-items: center; gap: .35rem; min-width: 220px; padding: .42rem .65rem; border: 1px solid rgba(72, 146, 224, .4); border-radius: 7px; background: rgba(3, 15, 34, .48); color: #7ea6d1; }
.dashboard-search:focus-within { border-color: #53cfff; box-shadow: 0 0 0 2px rgba(83, 207, 255, .2); }
.dashboard-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #dceaff; font: .7rem var(--font); }
.dashboard-search input::placeholder { color: #7191ba; }
.dashboard-station-controls select { min-width: 112px; padding: .46rem .55rem; border: 1px solid rgba(72, 146, 224, .4); border-radius: 7px; background: rgba(3, 15, 34, .48); color: #c4daf2; font: .68rem var(--font); }
.dashboard-station-note { max-width: 680px; margin: .35rem 0 .78rem; font-size: .76rem; }
.dashboard-table-wrap { overflow-x: auto; border: 1px solid rgba(72, 146, 224, .2); border-radius: 7px; background: rgba(3, 14, 31, .34); }
.dashboard-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: .79rem; }
.dashboard-table th, .dashboard-table td { padding: .52rem .68rem; border-bottom: 1px solid rgba(72, 146, 224, .15); text-align: left; white-space: nowrap; }
.dashboard-table thead th { color: #91add1; font-size: .68rem; font-weight: 500; letter-spacing: .03em; }
.dashboard-table tbody tr:last-child th, .dashboard-table tbody tr:last-child td { border-bottom: 0; }
.dashboard-table tbody th { color: #dbeaff; font-weight: 500; }
.dashboard-station-name { display: block; }
.dashboard-table tbody th small { display: block; margin-top: .1rem; color: #6687b2; font: .62rem var(--mono); }
.dashboard-mono { color: #aec5e4; font: .7rem var(--mono); }
.dashboard-source-cell { max-width: 210px; overflow: hidden; color: #89a7cd; text-overflow: ellipsis; }
.dashboard-status { display: inline-flex; align-items: center; gap: .35rem; color: #64e2bf; }
.dashboard-status-stale, .dashboard-status-waiting { color: #ffbd58; }
.dashboard-status-down { color: #ff8f96; }
.dashboard-status-disabled { color: #ada5ff; }
.dashboard-status .dot { width: .5rem; height: .5rem; }
.dashboard-row-action { color: #80a3cf; text-align: right !important; font-size: 1.05rem; }
.dashboard-table-empty { padding: 1rem; text-align: center; }
.settings-page .dashboard-table-empty[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) and (min-width: 861px) {
  .settings-page { --settings-sidebar-width: 210px; }
  .settings-page .site-hero .container, .settings-page main .container, .settings-page .footer .container { width: min(100% - 42px, 1220px); }
  .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-lower-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-archives-panel { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .settings-page { --settings-sidebar-width: 0px; }
  .settings-page .nav { left: 0; }
  .settings-page .nav-inner { width: min(1160px, 92vw); padding: .9rem 0; }
  .settings-page .nav .brand { display: flex; }
  .settings-page .nav-links a { display: block; }
  .settings-page .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: .45rem;
    padding: 0;
    background: transparent;
    border: 0;
    transform: none;
  }
  .settings-page .nav-links a { display: none; }
  .settings-page .nav-user, .settings-page .nav-logout { display: inline-flex; }
  .settings-page .settings-menu-button { display: inline-flex; }
  .settings-page .settings-menu {
    top: 0; right: 0; left: auto; width: min(370px, 92vw); padding: 1rem; transform: translateX(102%);
    background: #0b0d1a; border-left: 1px solid var(--panel-border); border-right: 0; box-shadow: -24px 0 70px rgba(0,0,0,.45);
  }
  .settings-page.settings-menu-open .settings-menu { transform: translateX(0); }
  .settings-sidebar-brand { display: none; }
  .settings-page .settings-menu-head { display: flex; }
  .settings-page .settings-menu nav { display: grid; gap: .35rem; padding: 0 .2rem .5rem; }
  .settings-page .settings-menu nav a { grid-template-columns: 1.9rem 1fr; min-height: 0; padding: .9rem; }
  .settings-page .settings-menu nav small { display: block; }
  .settings-nav-label { margin: .65rem .9rem .1rem; }
  .settings-page .site-hero, .settings-page main, .settings-page .footer { margin-left: 0; }
  .settings-page .site-hero .container, .settings-page main .container, .settings-page .footer .container { width: min(92vw, 1160px); }
  .settings-page .settings-hero { padding-top: 7.3rem; }
  .settings-hero-line { display: block; }
  .settings-updated { margin-top: .7rem; }
  .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-lower-grid { grid-template-columns: 1fr; }
  .dashboard-station-head { align-items: flex-start; flex-direction: column; }
  .dashboard-station-controls { width: 100%; }
  .dashboard-search { flex: 1; }
  .dashboard-alert-row { grid-template-columns: .7rem minmax(130px, 1fr) max-content; }
  .dashboard-alert-reason { grid-column: 2 / -1; grid-row: 2; padding-bottom: .4rem; }
  .dashboard-alert-age { grid-column: 3; grid-row: 1; }
}
@media (max-width: 520px) {
  .settings-page .nav .brand span,
  .settings-page .nav-user { display: none !important; }
  .settings-page .nav .brand { gap: 0; }
  .settings-page .settings-hero { padding-bottom: 1.4rem; }
  .settings-page main .section { padding-top: .9rem; }
  .dashboard-stat-grid { grid-template-columns: 1fr; }
  .dashboard-panel-actions { width: 100%; justify-content: flex-start; margin-top: .65rem; }
  .dashboard-alert-panel .dashboard-panel-head { display: block; }
  .dashboard-station-controls { align-items: stretch; flex-direction: column; }
  .dashboard-station-controls select { width: 100%; }
  .dashboard-pipeline-steps { flex-wrap: wrap; }
  .dashboard-pipeline-step { min-width: 42%; }
  .dashboard-pipeline-connector { display: none; }
}
