:root {
  --bg: #050709;
  --surface: #0b0f14;
  --surface-2: #111720;
  --surface-3: #17202c;
  --border: rgba(233, 230, 221, 0.12);
  --border-strong: rgba(233, 230, 221, 0.24);
  --ink: #e9e6dd;
  --ink-muted: #98a2b0;
  --ink-dim: #697485;

  --phosphor: #8dffb0;
  --phosphor-soft: rgba(141, 255, 176, 0.14);
  --cyan: #4cc9ff;
  --warn: #f4b942;
  --danger: #ff4b3a;
  --danger-soft: rgba(255, 75, 58, 0.15);

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 8px;
  --radius-sm: 5px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 400 13px/1.45 var(--sans);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection {
  background: rgba(141, 255, 176, 0.28);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
}

/* Custom thin scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(233, 230, 221, 0.18);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(233, 230, 221, 0.32);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.accent { color: var(--phosphor); }
.warn { color: var(--warn); }
.danger { color: var(--danger); }

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

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

.app {
  display: grid;
  grid-template-rows: 54px 1fr 54px;
  height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  background: var(--bg);
}

/* ── Top Bar ───────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  min-width: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

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

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--phosphor);
  flex: none;
  box-shadow: 0 0 0 3px rgba(141, 255, 176, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.topbar__titles h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  white-space: nowrap;
}

.topbar__sub {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__clocks {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 36px;
}

.clock-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.clock-cell__label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.clock-cell__value {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.segmented__btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented__btn.is-active {
  background: var(--surface-3);
  color: var(--ink);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.icon-btn[aria-expanded="true"] {
  border-color: rgba(141, 255, 176, 0.38);
  color: var(--phosphor);
}

/* ── Main Stage ────────────────────────────────────────────────────────── */

.stage {
  position: relative;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.panel {
  width: 304px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  z-index: 10;
  min-height: 0;
  overflow: hidden;
}

.panel--left {
  border-right: 1px solid var(--border);
}

.panel--right {
  width: 336px;
  border-left: 1px solid var(--border);
}

.panel.is-collapsed {
  display: none;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.panel__head h2 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.panel__tools {
  display: flex;
  gap: 5px;
}

.mini-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--ink-muted);
  cursor: pointer;
}

.mini-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--phosphor-soft);
  color: var(--phosphor);
  letter-spacing: 0.06em;
}

.tag.is-blocked {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ── Left Panel: Search, Country Summary, Fleets ───────────────────────── */

.search-wrap {
  position: relative;
  padding: 10px 14px 8px;
}

.search-icon {
  position: absolute;
  left: 23px;
  top: 50%;
  transform: translateY(-42%);
  color: var(--ink-dim);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px 6px 28px;
  font-size: 12px;
  color: var(--ink);
}

.search-wrap input::placeholder {
  color: var(--ink-dim);
}

.search-results {
  margin: 0 14px 8px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 6px 9px;
  text-align: left;
  cursor: pointer;
  font-size: 11.5px;
}

.search-item:last-child { border-bottom: 0; }
.search-item:hover { background: var(--surface-2); }

.search-item__sub {
  font-size: 10.5px;
  color: var(--ink-muted);
}

.catalog-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.country-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--ink-muted);
  cursor: pointer;
}

.country-pill:hover,
.country-pill.is-active {
  border-color: var(--border-strong);
  color: var(--ink);
  background: var(--surface-3);
}

.country-pill strong {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink);
}

.fleet-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}

.fleet-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}

.fleet-row:hover {
  background: var(--surface-2);
}

.fleet-row.is-muted {
  opacity: 0.42;
}

.fleet-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

.fleet-info {
  min-width: 0;
}

.fleet-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-meta {
  font-size: 10.5px;
  color: var(--ink-muted);
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.fleet-count {
  text-align: right;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
}

.fleet-lag {
  display: block;
  font-size: 9.5px;
  color: var(--ink-dim);
}

.panel__foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
}

.toggle-row input {
  accent-color: var(--phosphor);
  margin: 0;
}

.toggle-row--compact {
  margin-top: 8px;
  font-size: 11px;
}

/* ── Viewport & Canvas ─────────────────────────────────────────────────── */

.viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  background: radial-gradient(circle at 50% 48%, #0b121c 0%, #050709 72%);
  overflow: hidden;
  cursor: grab;
}

.viewport:active {
  cursor: grabbing;
}

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

.canvas-hud {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

.canvas-hud--tl {
  top: 12px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(11, 15, 20, 0.86);
  border: 1px solid var(--border-strong);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--phosphor);
}

.hud-pill.is-siloed {
  color: var(--warn);
  border-color: rgba(244, 185, 66, 0.45);
}

.hud-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.hud-hint {
  font-size: 11px;
  color: var(--ink-dim);
  background: rgba(5, 7, 9, 0.65);
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
}

.canvas-hud--bl {
  bottom: 14px;
  left: 14px;
  background: rgba(11, 15, 20, 0.94);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 11.5px;
  max-width: 290px;
}

/* ── Satellite Inspector ───────────────────────────────────────────────── */

.inspector {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 310px;
  background: rgba(11, 15, 20, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  z-index: 8;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.inspector__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.inspector__head h3 {
  margin: 0;
  font-size: 13.5px;
  font-family: var(--mono);
  font-weight: 600;
}

.inspector__sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
}

.close-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 0;
}

.close-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin: 0;
}

.kv-grid div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.kv-grid dt {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.kv-grid dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
}

.inspector__lag {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--warn);
  line-height: 1.4;
}

/* ── Loading Overlay ───────────────────────────────────────────────────── */

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 9, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--phosphor);
  animation: spin 0.8s linear infinite;
}

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

.loading-title {
  font-weight: 600;
  font-size: 14px;
}

.loading-sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* ── Right Panel: Comms Simulator ──────────────────────────────────────── */

.comms-section {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

.comms-section--grow {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-bottom: 0;
}

.field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 7px;
}

.policy-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.policy-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.policy-btn strong {
  font-size: 12px;
  font-weight: 600;
}

.policy-btn span {
  font-size: 10px;
  color: var(--ink-muted);
  line-height: 1.25;
}

.policy-btn.is-active[data-policy="open"] {
  border-color: rgba(141, 255, 176, 0.55);
  background: rgba(141, 255, 176, 0.07);
}

.policy-btn.is-active[data-policy="open"] strong {
  color: var(--phosphor);
}

.policy-btn.is-active[data-policy="siloed"] {
  border-color: rgba(244, 185, 66, 0.55);
  background: rgba(244, 185, 66, 0.08);
}

.policy-btn.is-active[data-policy="siloed"] strong {
  color: var(--warn);
}

.silo-row {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.silo-row label,
.gs-field label {
  font-size: 10.5px;
  color: var(--ink-muted);
}

.silo-row select,
.gs-field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  color: var(--ink);
}

.gs-selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 6px;
}

.gs-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.swap-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 0;
}

.swap-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metrics-row--sub {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

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

.metric__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric__val {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.metrics-row--sub .metric__val {
  font-size: 11.5px;
  font-weight: 500;
}

.compare-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
}

.compare-row.is-highlight {
  border-color: rgba(141, 255, 176, 0.4);
}

.compare-row__name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-row__lat {
  font-family: var(--mono);
  font-weight: 500;
}

.compare-row__hops {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-dim);
}

.hop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hop-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
}

.hop-item--sat {
  cursor: pointer;
}

.hop-item--sat:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.hop-idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-dim);
  text-align: center;
}

.hop-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hop-sub {
  font-size: 10px;
  color: var(--ink-muted);
}

.hop-dist {
  text-align: right;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-muted);
}

.hop-empty {
  padding: 12px 10px;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 75, 58, 0.35);
  border-radius: var(--radius-sm);
  color: #ffc5bf;
  font-size: 11.5px;
  line-height: 1.45;
}

/* ── Bottom Timeline Bar ───────────────────────────────────────────────── */

.timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.timeline__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--phosphor);
  color: #050709;
  border: 0;
  cursor: pointer;
}

.play-btn:hover {
  filter: brightness(1.08);
}

.speed-group,
.delay-presets {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.chip.is-active {
  background: var(--surface-3);
  border-color: rgba(141, 255, 176, 0.5);
  color: var(--phosphor);
}

.timeline__scrubber {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 720px;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

#delaySlider {
  flex: 1;
  accent-color: var(--phosphor);
  cursor: pointer;
}

.slider-readout {
  font-size: 11px;
  color: var(--warn);
  min-width: 132px;
  text-align: right;
}

.timeline__note {
  font-size: 10.5px;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .topbar__clocks {
    gap: 12px;
    padding: 0 10px;
  }
  .timeline__note {
    display: none;
  }
}

@media (max-width: 960px) {
  .topbar__clocks {
    display: none;
  }
  .panel {
    position: absolute;
    top: 0;
    bottom: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  }
  .panel--left { left: 0; width: min(300px, 86vw); }
  .panel--right { right: 0; width: min(330px, 88vw); }
  .delay-presets { display: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   1990 ASCII COMPUTER STYLE — INSPIRED BY ENCANDY.COM
   Pure void black (#000), P31 phosphor green (#8dffb0), lock red (#ff3d24),
   VT323 terminal face, inverse-video controls, CRT scanlines, 0px corners.
   ═══════════════════════════════════════════════════════════════════════════ */

.crt-scanline {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: #8dffb0;
  box-shadow: 0 0 16px 3px rgba(70, 255, 140, 0.75);
  opacity: 0;
  pointer-events: none;
  z-index: 12;
}

html[data-theme="ascii"] {
  --bg: #000000;
  --surface: #000000;
  --surface-2: #040c06;
  --surface-3: #091b0e;
  --border: #2c8f52;
  --border-strong: #8dffb0;
  --ink: #8dffb0;
  --ink-muted: #56b877;
  --ink-dim: #2c8f52;

  --phosphor: #8dffb0;
  --phosphor-soft: rgba(141, 255, 176, 0.14);
  --cyan: #8dffb0;
  --warn: #e9e6dd;
  --danger: #ff3d24;
  --danger-soft: rgba(255, 61, 36, 0.14);
  --glow: rgba(70, 255, 140, 0.42);

  --sans: "VT323", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --mono: "VT323", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 0px;
  --radius-sm: 0px;
}

html[data-theme="ascii"] body {
  background: #000000;
  color: #8dffb0;
  font: 400 18px/1.2 var(--mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

html[data-theme="ascii"] .app {
  grid-template-rows: 58px 1fr 56px;
}

/* Phosphor scrollbars */
html[data-theme="ascii"] ::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
html[data-theme="ascii"] ::-webkit-scrollbar-track {
  background: #000000;
  border-left: 1px solid #1d5c35;
}
html[data-theme="ascii"] ::-webkit-scrollbar-thumb {
  background: #2c8f52;
  border-radius: 0;
}
html[data-theme="ascii"] ::-webkit-scrollbar-thumb:hover {
  background: #8dffb0;
}

/* Scanline overlay over the viewport — matching Encandy .hero__machine::after */
html[data-theme="ascii"] .viewport {
  background: #000000;
}

html[data-theme="ascii"] .viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.34) 2px 3px
  );
  pointer-events: none;
  z-index: 4;
}

html[data-theme="ascii"] .crt-scanline {
  display: block;
}

html[data-theme="ascii"] .crt-scanline.is-sweeping {
  animation: crtSweep 1.35s linear 1;
}

@keyframes crtSweep {
  0%   { top: 0; opacity: 0.95; }
  85%  { top: 100%; opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}

html[data-theme="ascii"] #orbitCanvas {
  filter: drop-shadow(0 0 4px rgba(60, 255, 130, 0.28));
}

/* Topbar */
html[data-theme="ascii"] .topbar {
  border-bottom: 1px solid #2c8f52;
  padding: 0 12px;
  gap: 10px;
}

html[data-theme="ascii"] .topbar__brand {
  min-width: 0;
  flex: 0 1 280px;
}

html[data-theme="ascii"] .topbar__titles {
  min-width: 0;
}

html[data-theme="ascii"] .signal-dot {
  width: 8px;
  height: 14px;
  border-radius: 0;
  background: #8dffb0;
  box-shadow: 0 0 10px var(--glow);
  animation: terminalBlink 1s steps(1) infinite;
}

@keyframes terminalBlink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

html[data-theme="ascii"] .topbar__titles h1 {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #8dffb0;
  text-shadow: 0 0 10px var(--glow);
}

html[data-theme="ascii"] .topbar__sub {
  font-size: 13.5px;
  color: #56b877;
}

html[data-theme="ascii"] .topbar__clocks {
  gap: 12px;
  padding: 0 10px;
  border-left: 1px solid #1d5c35;
  border-right: 1px solid #1d5c35;
  height: 38px;
  flex-shrink: 1;
  min-width: 0;
}

html[data-theme="ascii"] .clock-cell__label {
  font-size: 12px;
  font-weight: 400;
  color: #2c8f52;
  letter-spacing: 0.06em;
}

html[data-theme="ascii"] .clock-cell__value {
  font-size: 16px;
  font-weight: 400;
  color: #e9e6dd;
}

html[data-theme="ascii"] .clock-cell__value.accent {
  color: #8dffb0;
  text-shadow: 0 0 8px var(--glow);
}

html[data-theme="ascii"] #simTimeVal::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.78em;
  margin-left: 4px;
  vertical-align: -1px;
  background: #8dffb0;
  animation: terminalBlink 1s steps(1) infinite;
}

html[data-theme="ascii"] .clock-cell__value.warn {
  color: #ff3d24;
  text-shadow: 0 0 8px rgba(255, 61, 36, 0.45);
}

/* Inverse-video buttons (Encandy terminal grammar) */
html[data-theme="ascii"] .topbar__actions {
  gap: 6px;
  flex: none;
}

html[data-theme="ascii"] .segmented {
  background: #000000;
  border: 1px solid #2c8f52;
  padding: 2px;
  border-radius: 0;
}

html[data-theme="ascii"] .segmented__btn {
  padding: 2px 7px;
  font-size: 15px;
  font-weight: 400;
  color: #56b877;
  border-radius: 0;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

html[data-theme="ascii"] .segmented__btn:hover {
  color: #8dffb0;
}

html[data-theme="ascii"] .segmented__btn.is-active {
  background: #8dffb0;
  color: #000000;
  box-shadow: 0 0 10px var(--glow);
}

html[data-theme="ascii"] .icon-btn {
  background: #000000;
  border: 1px solid #2c8f52;
  border-radius: 0;
  padding: 3px 8px;
  font-size: 15px;
  font-weight: 400;
  color: #8dffb0;
  white-space: nowrap;
}

html[data-theme="ascii"] .icon-btn:hover,
html[data-theme="ascii"] .icon-btn[aria-expanded="true"] {
  background: #8dffb0;
  color: #000000;
  border-color: #8dffb0;
  box-shadow: 0 0 10px var(--glow);
}

/* Panels */
html[data-theme="ascii"] .panel {
  width: 294px;
  background: #000000;
}

html[data-theme="ascii"] .panel--right {
  width: 334px;
}

html[data-theme="ascii"] .panel__head {
  padding: 9px 12px 8px;
  border-bottom: 1px solid #2c8f52;
}

html[data-theme="ascii"] .panel__head h2 {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: #8dffb0;
  text-shadow: 0 0 8px var(--glow);
}

html[data-theme="ascii"] .panel__head h2::before {
  content: "> ";
  color: #2c8f52;
}

html[data-theme="ascii"] .mini-btn {
  background: #000000;
  border: 1px solid #2c8f52;
  border-radius: 0;
  padding: 1px 7px;
  font-size: 15px;
  color: #8dffb0;
}

html[data-theme="ascii"] .mini-btn:hover {
  background: #8dffb0;
  color: #000000;
}

html[data-theme="ascii"] .tag {
  font-size: 15px;
  font-weight: 400;
  border-radius: 0;
  padding: 1px 7px;
  background: #8dffb0;
  color: #000000;
  box-shadow: 0 0 10px var(--glow);
}

html[data-theme="ascii"] .tag.is-blocked {
  background: #ff3d24;
  color: #000000;
  box-shadow: 0 0 10px rgba(255, 61, 36, 0.55);
}

/* Search & Country Pills */
html[data-theme="ascii"] .search-wrap input {
  background: #000000;
  border: 1px solid #2c8f52;
  border-radius: 0;
  font-size: 16px;
  padding: 5px 8px 5px 28px;
  color: #8dffb0;
  text-transform: uppercase;
}

html[data-theme="ascii"] .search-wrap input::placeholder {
  color: #2c8f52;
}

html[data-theme="ascii"] .search-item {
  font-size: 16px;
  border-bottom: 1px solid #1d5c35;
}

html[data-theme="ascii"] .search-item__sub {
  font-size: 14px;
}

html[data-theme="ascii"] .country-pill {
  border-radius: 0;
  background: #000000;
  border: 1px solid #1d5c35;
  padding: 1px 6px;
  font-size: 14px;
  color: #56b877;
}

html[data-theme="ascii"] .country-pill strong {
  color: #8dffb0;
}

html[data-theme="ascii"] .country-pill:hover,
html[data-theme="ascii"] .country-pill.is-active {
  background: #8dffb0;
  color: #000000;
  border-color: #8dffb0;
}

html[data-theme="ascii"] .country-pill:hover strong,
html[data-theme="ascii"] .country-pill.is-active strong {
  color: #000000;
}

/* Fleet rows */
html[data-theme="ascii"] .fleet-row {
  border-radius: 0;
  padding: 4px 6px;
  border-bottom: 1px dotted rgba(44, 143, 82, 0.35);
}

html[data-theme="ascii"] .fleet-row:hover {
  background: rgba(141, 255, 176, 0.1);
}

html[data-theme="ascii"] .fleet-swatch {
  border-radius: 0;
  width: 9px;
  height: 9px;
}

html[data-theme="ascii"] .fleet-name {
  font-size: 17px;
  font-weight: 400;
  color: #e9e6dd;
}

html[data-theme="ascii"] .fleet-meta {
  font-size: 14px;
  color: #56b877;
}

html[data-theme="ascii"] .fleet-count {
  font-size: 17px;
  color: #8dffb0;
}

html[data-theme="ascii"] .fleet-lag {
  font-size: 13px;
  color: #2c8f52;
}

html[data-theme="ascii"] .toggle-row {
  font-size: 16px;
  color: #56b877;
}

/* HUD & Inspector */
html[data-theme="ascii"] .hud-pill {
  border-radius: 0;
  background: #000000;
  border: 1px solid #8dffb0;
  padding: 3px 10px;
  font-size: 17px;
  color: #8dffb0;
  box-shadow: 0 0 12px var(--glow);
}

html[data-theme="ascii"] .hud-pill.is-siloed {
  color: #ff3d24;
  border-color: #ff3d24;
  box-shadow: 0 0 12px rgba(255, 61, 36, 0.45);
}

html[data-theme="ascii"] .hud-pill__dot {
  border-radius: 0;
  width: 7px;
  height: 7px;
}

html[data-theme="ascii"] .hud-hint {
  border-radius: 0;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #1d5c35;
  font-size: 15px;
  color: #56b877;
  padding: 2px 8px;
}

html[data-theme="ascii"] .canvas-hud--bl {
  border-radius: 0;
  background: #000000;
  border: 1px solid #8dffb0;
  font-size: 16px;
}

html[data-theme="ascii"] .inspector {
  border-radius: 0;
  background: #000000;
  border: 1px solid #8dffb0;
  box-shadow: 0 0 18px rgba(70, 255, 140, 0.22);
  width: 326px;
}

html[data-theme="ascii"] .inspector__head h3 {
  font-size: 22px;
  font-weight: 400;
  text-shadow: 0 0 8px var(--glow);
}

html[data-theme="ascii"] .inspector__sub {
  font-size: 15px;
  color: #56b877;
}

html[data-theme="ascii"] .kv-grid dt {
  font-size: 13px;
  font-weight: 400;
  color: #2c8f52;
}

html[data-theme="ascii"] .kv-grid dd {
  font-size: 17px;
  color: #e9e6dd;
}

html[data-theme="ascii"] .inspector__lag {
  border-top: 1px dashed #2c8f52;
  font-size: 15px;
  color: #ff3d24;
  line-height: 1.25;
}

html[data-theme="ascii"] .close-btn {
  border-radius: 0;
  border: 1px solid #2c8f52;
  color: #8dffb0;
}

html[data-theme="ascii"] .close-btn:hover {
  background: #8dffb0;
  color: #000000;
}

/* Right Panel: Comms Simulator */
html[data-theme="ascii"] .comms-section {
  padding: 9px 12px;
  border-bottom: 1px solid #1d5c35;
}

html[data-theme="ascii"] .field-label {
  font-size: 15px;
  font-weight: 400;
  color: #56b877;
  margin-bottom: 5px;
}

html[data-theme="ascii"] .policy-btn {
  border-radius: 0;
  background: #000000;
  border: 1px solid #2c8f52;
  padding: 6px 8px;
}

html[data-theme="ascii"] .policy-btn strong {
  font-size: 18px;
  font-weight: 400;
  color: #8dffb0;
}

html[data-theme="ascii"] .policy-btn span {
  font-size: 13.5px;
  color: #56b877;
  line-height: 1.1;
}

html[data-theme="ascii"] .policy-btn.is-active[data-policy="open"] {
  background: #8dffb0;
  border-color: #8dffb0;
  box-shadow: 0 0 12px var(--glow);
}

html[data-theme="ascii"] .policy-btn.is-active[data-policy="open"] strong,
html[data-theme="ascii"] .policy-btn.is-active[data-policy="open"] span {
  color: #000000;
}

html[data-theme="ascii"] .policy-btn.is-active[data-policy="siloed"] {
  background: #ff3d24;
  border-color: #ff3d24;
  box-shadow: 0 0 12px rgba(255, 61, 36, 0.5);
}

html[data-theme="ascii"] .policy-btn.is-active[data-policy="siloed"] strong,
html[data-theme="ascii"] .policy-btn.is-active[data-policy="siloed"] span {
  color: #000000;
}

html[data-theme="ascii"] .silo-row label,
html[data-theme="ascii"] .gs-field label {
  font-size: 14px;
  color: #56b877;
}

html[data-theme="ascii"] .silo-row select,
html[data-theme="ascii"] .gs-field select {
  background: #000000;
  border: 1px solid #2c8f52;
  border-radius: 0;
  font-size: 16px;
  padding: 4px 6px;
  color: #e9e6dd;
  text-transform: uppercase;
}

html[data-theme="ascii"] .swap-btn {
  border-radius: 0;
  background: #000000;
  border: 1px solid #2c8f52;
  color: #8dffb0;
}

html[data-theme="ascii"] .swap-btn:hover {
  background: #8dffb0;
  color: #000000;
}

html[data-theme="ascii"] .metric__label {
  font-size: 13px;
  font-weight: 400;
  color: #2c8f52;
}

html[data-theme="ascii"] .metric__val {
  font-size: 21px;
  font-weight: 400;
  line-height: 1.05;
}

html[data-theme="ascii"] .metrics-row--sub .metric__val {
  font-size: 18px;
}

html[data-theme="ascii"] .compare-row {
  border-radius: 0;
  background: #000000;
  border: 1px solid #1d5c35;
  padding: 3px 7px;
  font-size: 16px;
}

html[data-theme="ascii"] .compare-row.is-highlight {
  border-color: #8dffb0;
  background: rgba(141, 255, 176, 0.1);
}

html[data-theme="ascii"] .compare-row__hops {
  font-size: 14px;
  color: #56b877;
}

html[data-theme="ascii"] .hop-item {
  border-radius: 0;
  background: #000000;
  border: 1px solid #1d5c35;
  padding: 5px 7px;
  font-size: 16px;
}

html[data-theme="ascii"] .hop-item--sat:hover {
  border-color: #8dffb0;
  background: rgba(141, 255, 176, 0.1);
}

html[data-theme="ascii"] .hop-idx {
  font-size: 15px;
  color: #2c8f52;
}

html[data-theme="ascii"] .hop-name {
  font-size: 17px;
  font-weight: 400;
}

html[data-theme="ascii"] .hop-sub {
  font-size: 13.5px;
  color: #56b877;
}

html[data-theme="ascii"] .hop-dist {
  font-size: 15px;
  color: #e9e6dd;
}

html[data-theme="ascii"] .hop-empty {
  border-radius: 0;
  background: rgba(255, 61, 36, 0.12);
  border: 1px solid #ff3d24;
  color: #ff3d24;
  font-size: 16px;
}

/* Bottom Timeline */
html[data-theme="ascii"] .timeline {
  border-top: 1px solid #2c8f52;
  background: #000000;
}

html[data-theme="ascii"] .play-btn {
  border-radius: 0;
  background: #8dffb0;
  color: #000000;
  box-shadow: 0 0 10px var(--glow);
}

html[data-theme="ascii"] .chip {
  border-radius: 0;
  background: #000000;
  border: 1px solid #2c8f52;
  padding: 2px 8px;
  font-size: 16px;
  color: #56b877;
}

html[data-theme="ascii"] .chip:hover {
  color: #8dffb0;
  border-color: #8dffb0;
}

html[data-theme="ascii"] .chip.is-active {
  background: #8dffb0;
  color: #000000;
  border-color: #8dffb0;
  box-shadow: 0 0 10px var(--glow);
}

html[data-theme="ascii"] .slider-readout {
  font-size: 17px;
  color: #ff3d24;
  min-width: 156px;
}

html[data-theme="ascii"] .timeline__note {
  font-size: 14px;
  color: #2c8f52;
}
