@font-face {
  font-family: "Orbitron";
  src: url("../fonts/orbitron.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Share Tech Mono";
  src: url("../fonts/sharetechmono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #02070c;
  --bg-2: #041018;
  --panel: rgba(3, 14, 21, 0.86);
  --panel-solid: #040f17;
  --line: rgba(43, 235, 255, 0.16);
  --line-mid: rgba(43, 235, 255, 0.3);
  --line-bright: rgba(43, 235, 255, 0.6);
  --cyan: #2debff;
  --cyan-soft: #9cf8ff;
  --green: #45ffad;
  --violet: #8d7bff;
  --amber: #ffc857;
  --red: #ff3068;
  --text: #c6f5fd;
  --bright: #ecfeff;
  --muted: #5f8792;
  --muted-2: #3c5c66;
  --font-display: "Orbitron", "Arial Narrow", sans-serif;
  --font-mono: "Share Tech Mono", "SFMono-Regular", Consolas, monospace;
  --hud-gap: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(14, 70, 82, 0.22), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(20, 40, 80, 0.16), transparent 60%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(45, 235, 255, 0.25);
  color: var(--bright);
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------------ */
/* top bar                                                             */
/* ------------------------------------------------------------------ */
.topbar {
  position: relative;
  z-index: 12;
  flex: 0 0 66px;
  height: 66px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(4, 18, 26, 0.98), rgba(2, 9, 14, 0.84)),
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(45, 235, 255, 0.025) 119px 120px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-bright) 18%, transparent 45%, transparent 55%, var(--line-bright) 82%, transparent);
  opacity: 0.55;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(45, 235, 255, 0.45));
  animation: mark-breathe 6s ease-in-out infinite;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.28em;
  color: var(--bright);
  text-shadow: 0 0 16px rgba(45, 235, 255, 0.28);
  white-space: nowrap;
}

.brand-text h1 span {
  color: var(--cyan);
  margin: 0 2px;
  opacity: 0.8;
}

.brand-text p {
  margin: 3px 0 0;
  font-size: 8px;
  letter-spacing: 0.34em;
  color: var(--muted);
  white-space: nowrap;
}

.statusline {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-size: 9.5px;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.status-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-mid);
  background: rgba(45, 235, 255, 0.04);
  color: var(--cyan);
  letter-spacing: 0.16em;
  font-size: 9px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.badge i {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  animation: blink 1.6s steps(1) infinite;
}

.badge b {
  font-weight: 400;
}

.badge-live {
  color: var(--green);
  border-color: rgba(69, 255, 173, 0.4);
  background: rgba(69, 255, 173, 0.06);
}

.badge-demo {
  color: var(--amber);
  border-color: rgba(255, 200, 87, 0.45);
  background: rgba(255, 200, 87, 0.06);
}

.badge-offline {
  color: var(--red);
  border-color: rgba(255, 48, 104, 0.45);
  background: rgba(255, 48, 104, 0.07);
}

.badge-connecting {
  color: var(--amber);
}

.kv {
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.16em;
}

.kv b {
  color: var(--text);
  font-weight: 400;
  margin-left: 5px;
  letter-spacing: 0.08em;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.clock {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-right: 6px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.clock b {
  color: var(--cyan-soft);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.16em;
}

.clock em {
  font-style: normal;
  color: var(--muted-2);
  font-size: 7px;
}

.btn {
  position: relative;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(45, 235, 255, 0.03);
  color: var(--text);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn span {
  margin-left: 5px;
  color: var(--muted);
}

.btn:hover,
.btn:focus-visible {
  background: rgba(45, 235, 255, 0.09);
  border-color: var(--line-bright);
  color: var(--bright);
  box-shadow: 0 0 18px rgba(45, 235, 255, 0.12), inset 0 0 12px rgba(45, 235, 255, 0.06);
  outline: none;
}

.btn-accent {
  border-color: rgba(45, 235, 255, 0.55);
  color: var(--cyan);
  background: rgba(45, 235, 255, 0.08);
}

.btn-accent:hover {
  color: #00151b;
  background: var(--cyan);
  box-shadow: 0 0 24px rgba(45, 235, 255, 0.45);
}

.btn-small {
  height: 25px;
  padding: 0 9px;
  font-size: 8px;
}

.btn.is-on {
  color: var(--amber);
  border-color: rgba(255, 200, 87, 0.55);
  background: rgba(255, 200, 87, 0.08);
}

.btn.is-on span {
  color: var(--amber);
}

.icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  transition: 0.18s ease;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  color: var(--cyan);
  border-color: var(--line-bright);
  outline: none;
}

/* ------------------------------------------------------------------ */
/* stage / map                                                         */
/* ------------------------------------------------------------------ */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(8, 38, 49, 0.4), transparent 62%),
    #01050a;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.map-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.32) 0,
    rgba(0, 0, 0, 0.32) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(0, 3, 6, 0.5) 100%),
    linear-gradient(180deg, rgba(1, 5, 9, 0.35), transparent 15%, transparent 78%, rgba(1, 5, 9, 0.55));
}

.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0 solid rgba(45, 235, 255, 0.32);
}

.corner.tl {
  top: 10px;
  left: 10px;
  border-top-width: 1px;
  border-left-width: 1px;
}

.corner.tr {
  top: 10px;
  right: 10px;
  border-top-width: 1px;
  border-right-width: 1px;
}

.corner.bl {
  bottom: 10px;
  left: 10px;
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.corner.br {
  bottom: 10px;
  right: 10px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

/* ------------------------------------------------------------------ */
/* HUD panels                                                          */
/* ------------------------------------------------------------------ */
.hud {
  position: absolute;
  top: 16px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: var(--hud-gap);
  pointer-events: none;
  max-height: calc(100% - 92px);
}

.hud-left {
  left: 16px;
  width: 306px;
}

.hud-right {
  right: 16px;
  width: 324px;
}

.hud > * {
  pointer-events: auto;
}

.panel {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(5, 21, 30, 0.94), rgba(2, 9, 14, 0.87)),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(45, 235, 255, 0.018) 24px 25px);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.32),
    inset 0 0 36px rgba(45, 235, 255, 0.025);
  backdrop-filter: blur(9px);
  animation: panel-in 0.55s ease both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  background:
    linear-gradient(var(--line-mid), var(--line-mid)) left top / 10px 1px no-repeat,
    linear-gradient(var(--line-mid), var(--line-mid)) left top / 1px 10px no-repeat,
    linear-gradient(var(--line-mid), var(--line-mid)) right bottom / 10px 1px no-repeat,
    linear-gradient(var(--line-mid), var(--line-mid)) right bottom / 1px 10px no-repeat;
  opacity: 0.55;
}

.hud-right .panel:nth-child(2),
.hud-left .panel:nth-child(2) {
  animation-delay: 0.08s;
}

.hud-right .panel:nth-child(3) {
  animation-delay: 0.16s;
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.19em;
  color: var(--cyan);
  white-space: nowrap;
}

.panel h2 > span {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.panel h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.panel h2 em {
  margin-left: auto;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-throughput {
  padding-bottom: 10px;
}

.rates {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rate-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.arrow {
  font-size: 11px;
  line-height: 1;
}

.arrow.down {
  color: var(--cyan);
}

.arrow.up {
  color: var(--green);
}

.rate-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 1px;
  line-height: 1;
}

.rate-value b {
  font-family: var(--font-display);
  font-size: clamp(27px, 2.25vw, 34px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(45, 235, 255, 0.33);
  font-variant-numeric: tabular-nums;
}

.rate:nth-child(2) .rate-value b {
  color: var(--green);
  text-shadow: 0 0 22px rgba(69, 255, 173, 0.25);
}

.rate-value span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.meter {
  position: relative;
  height: 3px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 12px, rgba(0, 0, 0, 0.5) 12px 13px);
  opacity: 0.5;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(45, 235, 255, 0.4), var(--cyan));
  box-shadow: 0 0 10px rgba(45, 235, 255, 0.65);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.meter.tx i {
  background: linear-gradient(90deg, rgba(69, 255, 173, 0.35), var(--green));
  box-shadow: 0 0 10px rgba(69, 255, 173, 0.55);
}

.chart-wrap {
  position: relative;
  height: 92px;
  margin: 12px -4px 0;
}

#spark {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
  pointer-events: none;
}

.chart-empty[hidden] {
  display: none;
}

.chart-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.chart-meta .cyan {
  color: var(--cyan);
}

.chart-meta .violet {
  color: var(--violet);
}

.chart-meta em {
  margin-left: auto;
  font-style: normal;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(45, 235, 255, 0.09);
}

.stat-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-grid span {
  font-size: 7px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}

.stat-grid b {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.panel-talkers {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100px;
  overflow: hidden;
}

.talker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.talker {
  position: relative;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(45, 235, 255, 0.075);
  isolation: isolate;
}

.talker:last-child {
  border-bottom: 0;
}

.talker::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 1px;
  width: var(--w, 0%);
  background: linear-gradient(90deg, rgba(45, 235, 255, 0.55), transparent);
  z-index: -1;
}

.talker .rank {
  font-size: 8px;
  color: var(--muted-2);
}

.talker-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.talker-main b {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talker-main span {
  font-size: 7.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talker .rate {
  font-size: 9px;
  color: var(--cyan-soft);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.talker .rate small {
  display: block;
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.panel-uplink .uplink-head {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(45, 235, 255, 0.085);
}

.uplink-glyph {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}

.uplink-glyph span {
  width: 3px;
  background: var(--cyan);
  opacity: 0.75;
  box-shadow: 0 0 5px rgba(45, 235, 255, 0.5);
  animation: bars 2.2s ease-in-out infinite;
}

.uplink-glyph span:nth-child(1) { height: 7px; animation-delay: 0s; }
.uplink-glyph span:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.uplink-glyph span:nth-child(3) { height: 18px; animation-delay: 0.3s; }
.uplink-glyph span:nth-child(4) { height: 11px; animation-delay: 0.45s; }
.uplink-glyph span:nth-child(5) { height: 5px; animation-delay: 0.6s; }

.uplink-head b {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--bright);
  letter-spacing: 0.08em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uplink-head p {
  margin: 2px 0 0;
  font-size: 7.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-status {
  font-size: 7.5px;
  letter-spacing: 0.12em;
  color: var(--green);
  border: 1px solid rgba(69, 255, 173, 0.3);
  padding: 3px 5px;
  white-space: nowrap;
}

.data-list {
  margin: 7px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
}

.data-list div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.data-list dt {
  font-size: 7px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}

.data-list dd {
  margin: 0;
  font-size: 9.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.region-list,
.threat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.panel-regions {
  flex: 0 0 auto;
}

.region {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.region .code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  border: 1px solid rgba(45, 235, 255, 0.18);
  background: rgba(45, 235, 255, 0.035);
  color: var(--cyan-soft);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.region-main {
  min-width: 0;
}

.region-main b {
  display: block;
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.09em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-bar {
  position: relative;
  height: 2px;
  margin-top: 3px;
  background: rgba(255, 255, 255, 0.055);
}

.region-bar i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: linear-gradient(90deg, rgba(45, 235, 255, 0.6), var(--cyan));
  box-shadow: 0 0 6px rgba(45, 235, 255, 0.4);
}

.region .bytes {
  font-size: 8px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.panel-sigint {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 118px;
  overflow: hidden;
  padding-bottom: 8px;
}

.threat-list {
  overflow: hidden;
}

.threat {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(45, 235, 255, 0.07);
  animation: row-in 0.4s ease both;
}

.threat:last-child {
  border-bottom: 0;
}

.threat .pip {
  width: 4px;
  height: 4px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 7px currentColor;
  color: var(--amber);
}

.threat.high .pip {
  background: var(--red);
  color: var(--red);
  animation: blink 1s steps(1) infinite;
}

.threat.medium .pip {
  background: var(--amber);
  color: var(--amber);
}

.threat.low .pip {
  background: var(--muted);
  color: var(--muted);
}

.threat-main {
  min-width: 0;
}

.threat-main b {
  display: block;
  font-size: 8px;
  letter-spacing: 0.09em;
  color: var(--cyan-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.threat.high .threat-main b {
  color: #ff8ba9;
}

.threat-main p {
  margin: 1px 0 0;
  font-size: 8.5px;
  line-height: 1.25;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.threat time {
  font-size: 7.5px;
  color: var(--muted-2);
  white-space: nowrap;
}

.empty-row {
  padding: 10px 0;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* map furniture                                                       */
/* ------------------------------------------------------------------ */
.map-mode {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 200, 87, 0.35);
  background: rgba(8, 12, 14, 0.78);
  color: var(--amber);
  font-size: 8px;
  letter-spacing: 0.2em;
  backdrop-filter: blur(5px);
  pointer-events: none;
  white-space: nowrap;
}

.map-mode i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
  animation: blink 1.8s steps(1) infinite;
}

.map-mode.live {
  color: var(--green);
  border-color: rgba(69, 255, 173, 0.35);
}

.map-mode.offline {
  color: var(--red);
  border-color: rgba(255, 48, 104, 0.4);
}

.map-note {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 7.5px;
  letter-spacing: 0.24em;
  color: rgba(95, 135, 146, 0.65);
  pointer-events: none;
  white-space: nowrap;
}

.coords {
  position: absolute;
  right: 18px;
  bottom: 17px;
  z-index: 5;
  font-size: 8px;
  letter-spacing: 0.13em;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}

.legend {
  position: absolute;
  left: 18px;
  bottom: 17px;
  z-index: 5;
  display: flex;
  gap: 13px;
  font-size: 7px;
  letter-spacing: 0.13em;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
}

.legend .dot.in {
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
}

.legend .dot.bad {
  background: var(--red);
  box-shadow: 0 0 7px var(--red);
}

.legend .dot.region {
  background: var(--violet);
  box-shadow: 0 0 7px var(--violet);
}

.ticker {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 5;
  width: min(560px, calc(100% - 720px));
  height: 34px;
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  background: rgba(2, 10, 15, 0.82);
  backdrop-filter: blur(6px);
  font-size: 8px;
  letter-spacing: 0.08em;
  overflow: hidden;
}

.ticker-label {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: rgba(45, 235, 255, 0.08);
  border-right: 1px solid var(--line);
  color: var(--cyan);
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.ticker-track {
  flex: 1;
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-item {
  display: inline-block;
  color: var(--text);
  animation: ticker-in 0.45s ease both;
}

.ticker-item b {
  color: var(--cyan);
  font-weight: 400;
}

.ticker-count {
  padding: 0 9px;
  color: var(--muted);
  border-left: 1px solid rgba(45, 235, 255, 0.1);
  white-space: nowrap;
}

/* Read-only public view: no settings entry points, no redacted placeholders. */
body.public-view #connect-btn,
body.public-view #feed-btn,
body.public-view #sim-connect,
body.public-view #retry-btn,
body.public-view .statusline .kv:has(#top-gw),
body.public-view .data-list > div:has(#wan-ip),
body.public-view .data-list > div:has(#gateway-name),
body.public-view .data-list > div:has(#asn),
body.public-view .data-list > div:has(#wan-iface) {
  display: none;
}

/* ------------------------------------------------------------------ */
/* history replay                                                      */
/* ------------------------------------------------------------------ */
.replay-tag[hidden],
.replay-bar[hidden] {
  display: none;
}

.map-mode.replay-tag {
  color: var(--violet);
  border-color: rgba(141, 123, 255, 0.45);
}

.replay-tag b {
  font-weight: 400;
  color: var(--bright);
  letter-spacing: 0.12em;
}

body.mode-replay #map-mode,
body.mode-replay .ticker,
body.mode-replay .legend,
body.mode-replay .coords,
body.mode-replay .map-note {
  display: none;
}

body.mode-replay .hud {
  max-height: calc(100% - 104px);
}

.replay-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 10px 8px;
  border: 1px solid rgba(141, 123, 255, 0.4);
  background: rgba(3, 10, 16, 0.9);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(141, 123, 255, 0.05);
  backdrop-filter: blur(8px);
  font-size: 8px;
  letter-spacing: 0.12em;
  animation: panel-in 0.35s ease both;
}

.replay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.replay-play {
  min-width: 58px;
}

.replay-field {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.replay-field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color-scheme: dark;
  height: 23px;
  padding: 0 20px 0 7px;
  border: 1px solid var(--line-mid);
  border-radius: 0;
  background-color: #04131b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%232debff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  color: var(--bright);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 21px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.replay-field select:hover,
.replay-field select:focus-visible {
  outline: none;
  border-color: var(--line-bright);
  box-shadow: 0 0 12px rgba(45, 235, 255, 0.12);
}

.replay-field option {
  background: #04131b;
  color: var(--text);
}

.legend .legend-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  margin: -2px -4px;
  border: 1px solid transparent;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  pointer-events: auto;
  cursor: pointer;
}

.legend .legend-toggle:hover,
.legend .legend-toggle:focus-visible {
  outline: none;
  color: var(--text);
  border-color: var(--line);
}

.legend .legend-toggle[aria-pressed="false"] {
  opacity: 0.38;
  text-decoration: line-through;
}

.legend .legend-volume {
  display: none;
  align-items: center;
  gap: 5px;
}

body.volume-on .legend .legend-volume {
  display: flex;
}

.legend .vol-col {
  width: 5px;
  height: 11px;
  border-radius: 2.5px / 1.5px;
  background: linear-gradient(to top, var(--green) 0 55%, var(--cyan) 55% 100%);
  box-shadow: 0 0 6px rgba(45, 235, 255, 0.5);
}

.replay-event {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.replay-event.hostile {
  color: var(--red);
}

.replay-stats,
.replay-edge {
  color: var(--muted);
  white-space: nowrap;
}

.replay-edge {
  font-size: 7px;
}

.replay-timeline {
  position: relative;
  flex: 1;
  height: 20px;
  border: 1px solid var(--line);
  background: rgba(45, 235, 255, 0.025);
  cursor: pointer;
  touch-action: none;
}

.replay-timeline:focus-visible {
  outline: none;
  border-color: var(--line-bright);
}

.replay-timeline canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.replay-head {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--violet);
  box-shadow: 0 0 9px var(--violet);
  pointer-events: none;
}

.banner {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 6px;
  border: 1px solid rgba(255, 200, 87, 0.32);
  background: rgba(10, 12, 13, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  max-width: min(560px, calc(100% - 40px));
  backdrop-filter: blur(7px);
}

.banner[hidden],
.banner.hidden {
  display: none;
}

.banner p {
  margin: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-tag {
  padding: 3px 5px;
  background: var(--amber);
  color: #1a1203;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.banner-error {
  border-color: rgba(255, 48, 104, 0.45);
}

.banner-error .banner-tag {
  background: var(--red);
  color: #fff;
}

.banner-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 3px;
}

.banner-x:hover {
  color: var(--bright);
}

.map-tip {
  position: absolute;
  z-index: 20;
  min-width: 190px;
  max-width: 270px;
  padding: 8px 10px;
  border: 1px solid var(--line-bright);
  background: rgba(2, 12, 18, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(45, 235, 255, 0.08);
  font-size: 8.5px;
  line-height: 1.5;
  pointer-events: none;
  color: var(--text);
  backdrop-filter: blur(8px);
}

.map-tip h3 {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--cyan);
  font-weight: 600;
}

.map-tip dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 8px;
}

.map-tip dt {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.09em;
}

.map-tip dd {
  margin: 0;
  text-align: right;
  color: var(--bright);
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-tip .tip-bad {
  color: var(--red);
}

.map-tip.pinned {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 28px rgba(45, 235, 255, 0.22);
}

.map-tip .tip-pin {
  margin: 6px 0 0;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 6.5px;
  letter-spacing: 0.12em;
}

.hud-toggle {
  display: none;
}

/* ------------------------------------------------------------------ */
/* dialogs                                                             */
/* ------------------------------------------------------------------ */
dialog {
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 4, 8, 0.82);
  backdrop-filter: blur(7px);
}

.terminal-dialog {
  width: min(720px, 94vw);
  max-height: 90vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-mid);
  background:
    linear-gradient(165deg, rgba(6, 22, 31, 0.98), rgba(2, 9, 14, 0.99)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(45, 235, 255, 0.02) 31px 32px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 70px rgba(45, 235, 255, 0.06);
  overflow: auto;
}

.terminal-dialog[open] {
  animation: dialog-in 0.28s ease both;
}

#settings-form {
  padding: 22px 24px 18px;
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.24em;
}

.dialog-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.17em;
  color: var(--bright);
  text-shadow: 0 0 24px rgba(45, 235, 255, 0.2);
}

.close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.close-btn:hover {
  color: var(--cyan);
  border-color: var(--line-bright);
}

.dialog-copy {
  margin: 0 0 18px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

.dialog-copy b {
  color: var(--text);
  font-weight: 400;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 14px;
}

.form-grid.compact {
  margin-top: 10px;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.span-2 {
  grid-column: span 2;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--muted);
  min-width: 0;
}

label small {
  font-size: 7.5px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--muted-2);
  text-transform: none;
}

.optional {
  color: var(--muted-2);
  font-size: 7px;
}

input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(45, 235, 255, 0.16);
  background: rgba(0, 5, 9, 0.6);
  color: var(--bright);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder {
  color: var(--muted-2);
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(45, 235, 255, 0.2), 0 0 18px rgba(45, 235, 255, 0.08);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0 4px;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--text);
  cursor: pointer;
}

.check input {
  appearance: none;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid var(--line-mid);
  background: rgba(45, 235, 255, 0.03);
  flex: 0 0 auto;
  position: relative;
}

.check input:checked {
  background: var(--cyan);
  border-color: var(--cyan);
}

.check input:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid #001318;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.advanced {
  margin-top: 13px;
  border-top: 1px solid rgba(45, 235, 255, 0.08);
  padding-top: 8px;
}

.advanced summary {
  cursor: pointer;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--muted);
  padding: 5px 0;
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary::before {
  content: "+ ";
  color: var(--cyan);
}

.advanced[open] summary::before {
  content: "− ";
}

.advanced summary span {
  color: var(--muted-2);
  font-size: 7px;
}

.advanced > small {
  display: block;
  margin-top: 4px;
  font-size: 7.5px;
  color: var(--muted-2);
  line-height: 1.5;
}

.form-status {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: pre-wrap;
}

.form-status.ok {
  color: var(--green);
}

.form-status.err {
  color: var(--red);
}

.form-status.busy {
  color: var(--amber);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(45, 235, 255, 0.1);
}

.dialog-actions #save-btn {
  margin-left: auto;
}

.dialog-fineprint {
  margin: 12px 0 0;
  font-size: 7.5px;
  line-height: 1.6;
  color: var(--muted-2);
}

.dialog-fineprint code {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 3px;
}

.help-dialog {
  width: min(760px, 94vw);
  padding: 22px 24px 16px;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin: 6px 0 20px;
}

.help-grid h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--cyan);
}

.help-grid p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.65;
  color: var(--muted);
}

.help-grid code {
  color: var(--text);
  background: rgba(45, 235, 255, 0.07);
  padding: 1px 3px;
}

.help-grid b {
  color: var(--text);
  font-weight: 400;
}

.help-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(45, 235, 255, 0.1);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  color: var(--muted-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 200;
  padding: 9px 14px;
  border: 1px solid var(--line-bright);
  background: rgba(2, 13, 19, 0.96);
  color: var(--cyan-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(45, 235, 255, 0.08);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.err {
  border-color: rgba(255, 48, 104, 0.6);
  color: #ff9eb6;
}

/* ------------------------------------------------------------------ */
/* boot                                                                */
/* ------------------------------------------------------------------ */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(11, 62, 74, 0.35), transparent 45%),
    #010509;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#boot.done {
  opacity: 0;
  visibility: hidden;
}

.boot-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgba(45, 235, 255, 0.055) 49.9% 50.1%, transparent 50.1%),
    linear-gradient(0deg, transparent 0 49.9%, rgba(45, 235, 255, 0.055) 49.9% 50.1%, transparent 50.1%);
  background-size: 100% 100%, 100% 100%;
  mask-image: radial-gradient(circle at center, black, transparent 70%);
}

.boot-inner {
  position: relative;
  text-align: center;
  width: min(440px, 84vw);
}

.boot-mark {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  border: 1px solid rgba(45, 235, 255, 0.35);
  border-radius: 50%;
  animation: spin 9s linear infinite;
}

.boot-mark::before,
.boot-mark::after {
  content: "";
  position: absolute;
  background: rgba(45, 235, 255, 0.3);
}

.boot-mark::before {
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
}

.boot-mark::after {
  top: 50%;
  left: -6px;
  right: -6px;
  height: 1px;
}

.boot-mark span {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(45, 235, 255, 0.16);
  border-radius: 50%;
}

.boot-mark span:nth-child(2) { inset: 24px; }
.boot-mark span:nth-child(3) { inset: 34px; background: rgba(45, 235, 255, 0.08); }
.boot-mark span:nth-child(4) {
  inset: auto;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2px;
  background: var(--cyan);
  border: 0;
  box-shadow: 0 0 12px var(--cyan);
}

.boot-kicker {
  margin: 0 0 10px;
  font-size: 7.5px;
  letter-spacing: 0.35em;
  color: var(--muted);
}

#boot h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--bright);
  text-shadow: 0 0 36px rgba(45, 235, 255, 0.35);
}

.boot-sub {
  margin: 8px 0 28px;
  font-size: 8px;
  letter-spacing: 0.55em;
  color: var(--cyan);
  opacity: 0.75;
}

.boot-bar {
  height: 2px;
  background: rgba(45, 235, 255, 0.1);
  overflow: hidden;
}

.boot-bar i {
  display: block;
  height: 100%;
  width: 7%;
  background: linear-gradient(90deg, transparent, var(--cyan));
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.5s ease;
}

.boot-msg {
  margin: 12px 0 0;
  font-size: 7.5px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
}

/* ------------------------------------------------------------------ */
/* animations                                                          */
/* ------------------------------------------------------------------ */
@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.25; }
}

@keyframes mark-breathe {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(45, 235, 255, 0.35)); }
  50% { filter: drop-shadow(0 0 13px rgba(45, 235, 255, 0.7)); }
}

@keyframes bars {
  0%, 100% { transform: scaleY(0.65); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 0.95; }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(5px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes ticker-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------ */
/* responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1360px) {
  .topbar {
    grid-template-columns: minmax(210px, 1fr) auto minmax(270px, 1fr);
    gap: 10px;
    padding: 0 12px;
  }

  .brand-text h1 {
    font-size: 14px;
  }

  .clock span,
  .clock em {
    display: none;
  }

  .hud-left { width: 282px; }
  .hud-right { width: 300px; }
  .rate-value b { font-size: 28px; }
  .ticker { width: min(460px, calc(100% - 640px)); }
  .statusline { gap: 10px; }
  .kv { font-size: 8px; }
}

@media (max-width: 1120px) {
  .statusline .kv:nth-of-type(2),
  .statusline .kv:nth-of-type(3) {
    display: none;
  }

  .hud-left { width: 262px; }
  .hud-right { width: 282px; }
  .panel { padding: 10px 12px; }
  .panel-talkers { display: none; }
  .panel-sigint { min-height: 130px; }
  .ticker { display: none; }
  .map-note { display: none; }
  .legend { gap: 9px; font-size: 6.5px; }
  .rate-value b { font-size: 25px; }
  .chart-wrap { height: 78px; }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: hidden;
  }

  .topbar {
    flex: 0 0 56px;
    height: 56px;
    grid-template-columns: 1fr auto;
    padding: 0 10px;
  }

  .statusline {
    display: none;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-text h1 {
    font-size: 12px;
    letter-spacing: 0.22em;
  }

  .brand-text p {
    font-size: 6.5px;
    letter-spacing: 0.22em;
  }

  .clock,
  #feed-btn,
  #sound-btn span,
  #volume-btn span {
    display: none;
  }

  .top-actions {
    gap: 5px;
  }

  .top-actions .btn {
    height: 27px;
    padding: 0 8px;
    font-size: 7.5px;
  }

  .icon-btn {
    width: 27px;
    height: 27px;
  }

  .stage {
    height: calc(100svh - 56px);
    min-height: 420px;
  }

  .hud-right {
    display: none;
  }

  .hud-left {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: none;
  }

  .panel-throughput {
    padding: 9px 11px 8px;
    background: linear-gradient(155deg, rgba(5, 21, 30, 0.94), rgba(2, 9, 14, 0.9));
  }

  .rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .rate-value b {
    font-size: 26px;
  }

  .chart-wrap {
    height: 62px;
    margin-top: 8px;
  }

  .chart-meta,
  .stat-grid {
    display: none;
  }

  .panel-throughput h2 {
    margin-bottom: 7px;
  }

  .legend,
  .coords,
  .ticker,
  .map-note {
    display: none;
  }

  .map-mode {
    top: 10px;
    left: 10px;
    transform: none;
    height: 21px;
    font-size: 7px;
  }

  .banner {
    top: 40px;
    left: 8px;
    right: 8px;
    transform: none;
    max-width: none;
  }

  .banner p {
    white-space: normal;
    font-size: 8px;
    line-height: 1.35;
  }

  .banner-x {
    display: none;
  }

  .hud-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9;
    display: block;
    height: 22px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: rgba(2, 10, 15, 0.8);
    color: var(--muted);
    font-size: 7px;
    letter-spacing: 0.14em;
  }

  .stage.hud-collapsed .hud-left,
  body.mode-replay .hud-left {
    display: none;
  }

  .replay-bar {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .replay-row:first-child {
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .replay-event {
    order: 10;
    flex-basis: 100%;
  }

  .stage.hud-collapsed .hud-toggle {
    color: var(--cyan);
    border-color: var(--line-mid);
  }

  .terminal-dialog {
    width: 96vw;
    max-height: 92vh;
  }

  #settings-form,
  .help-dialog {
    padding: 16px 14px 13px;
  }

  .form-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .form-grid.compact {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid.compact .btn {
    grid-column: span 2;
  }

  .dialog-head h2 {
    font-size: 16px;
  }

  .dialog-actions #save-btn {
    margin-left: 0;
  }

  .dialog-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .brand-text p {
    display: none;
  }

  .brand-text h1 {
    font-size: 11px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .top-actions .btn {
    font-size: 7px;
    padding: 0 6px;
  }

  #help-btn {
    display: none;
  }

  .rate-value b {
    font-size: 23px;
  }

  .chart-wrap {
    height: 52px;
  }

  .banner p {
    font-size: 7.5px;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .hud {
    top: 10px;
    gap: 8px;
  }

  .panel {
    padding: 9px 11px;
  }

  .panel h2 {
    margin-bottom: 7px;
  }

  .chart-wrap {
    height: 64px;
    margin-top: 8px;
  }

  .stat-grid {
    display: none;
  }

  .panel-sigint {
    min-height: 90px;
  }

  .hud-left {
    width: 282px;
  }

  .hud-right {
    width: 300px;
  }
}

@media (max-height: 720px) {
  .terminal-dialog {
    max-height: 96vh;
  }

  #settings-form,
  .help-dialog {
    padding: 14px 16px 12px;
  }

  .dialog-copy {
    margin-bottom: 10px;
    font-size: 9px;
  }

  .form-grid {
    gap: 8px 10px;
  }

  input {
    height: 30px;
  }

  .toggle-row {
    margin: 10px 0 2px;
  }

  .advanced {
    margin-top: 8px;
  }

  .form-status {
    min-height: 16px;
    margin-top: 8px;
  }

  .dialog-fineprint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
