:root {
  --bg-primary: #121418;
  --bg-surface: #1a1e24;
  --bg-card: #222730;
  --bg-accent: #2c3340;
  --gold-primary: #e5b342;
  --gold-light: #f7d57f;
  --gold-dark: #b3851d;
  --gold-border: rgba(229, 179, 66, 0.35);
  --text-main: #f0f3f6;
  --text-muted: #9ba7b5;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-serif: 'Cinzel', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  max-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.45;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #181d24 0%, #121418 100%);
  border-bottom: 1px solid var(--gold-border);
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
  height: 74px;
  min-height: 74px;
  max-height: 74px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.brand-crest {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #222936 0%, #11141a 100%);
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 14px rgba(229, 179, 66, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  line-height: 1.2;
}

.airport-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(229, 179, 66, 0.16);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: rgba(26, 30, 36, 0.9);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
  flex-shrink: 0;
}

.status-dot.live {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.status-dot.paused {
  background: #94a3b8;
  box-shadow: none;
}

.status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-accent);
  border-color: var(--gold-border);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.36rem 0.7rem;
  font-size: 0.76rem;
  border-radius: var(--radius-sm);
}

.btn-sm.active {
  border-color: var(--gold-primary);
  background: rgba(229, 179, 66, 0.2);
  color: var(--gold-light);
}

.btn-tower-audio {
  font-weight: 700;
}

.btn-tower-audio.is-off {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
}

.btn-tower-audio.is-off:hover {
  color: #fca5a5;
  border-color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

.btn-tower-audio.is-on {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.25);
}

.btn-tower-audio.is-on:hover {
  color: #86efac;
  border-color: #4ade80;
  background: rgba(16, 185, 129, 0.22);
}

.gold-text {
  color: var(--gold-primary);
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
}

/* Main Layout */
.app-container {
  position: fixed;
  top: 74px;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  grid-template-rows: minmax(0, 1fr);
  height: calc(100% - 74px);
  min-height: 0;
  overflow: hidden;
}

.app-container.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.app-container.sidebar-collapsed .controls-sidebar {
  display: none;
}

/* Viewport Area */
.viewport-area {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #0b0e13;
  overflow: hidden;
}

.radar-map {
  width: 100%;
  height: 100%;
  background: #0b0e13;
  z-index: 1;
}

/* Dark Tactical Filter for OpenStreetMap Tiles */
.radar-map.map-mode-dark .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(185deg) brightness(88%) contrast(92%) saturate(75%);
}

/* Selected Aircraft Detail Card (Top-Right) */
.aircraft-detail-card {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: min(350px, calc(100% - 2rem));
  background: rgba(18, 22, 28, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.75);
  z-index: 500;
}

.detail-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(229, 179, 66, 0.25);
}

.detail-callsign-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-callsign {
  font-family: var(--font-mono);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--gold-light);
}

.detail-category-badge {
  font-size: 0.68rem;
  padding: 0.12rem 0.48rem;
  border-radius: 4px;
  background: rgba(229, 179, 66, 0.16);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
}

.detail-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.detail-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.detail-close-btn:hover {
  color: var(--gold-light);
}

.detail-route-banner {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 500;
  margin-bottom: 0.65rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.8rem;
}

.detail-cell {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.38rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-val {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.1rem;
}

.detail-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* Bottom Stage Controls */
.stage-controls {
  position: absolute;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(18, 22, 28, 0.9);
  backdrop-filter: blur(12px);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-width: calc(100% - 2rem);
}

.range-quick-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stage-group-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.stage-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stage-pill:hover,
.stage-pill.active {
  background: rgba(229, 179, 66, 0.22);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.altitude-legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.6rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Aircraft Marker & On-Map Callout Tag */
.aircraft-marker-wrapper {
  background: transparent;
  border: none;
}

.aircraft-icon-container {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.aircraft-svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  transition: transform 0.25s linear;
}

.aircraft-marker-selected .aircraft-svg {
  width: 29px;
  height: 29px;
  filter: drop-shadow(0 0 8px rgba(247, 213, 127, 0.95));
}

.aircraft-label-tag {
  position: absolute;
  left: 26px;
  top: -4px;
  background: rgba(14, 18, 24, 0.86);
  border: 1px solid rgba(229, 179, 66, 0.35);
  border-radius: 4px;
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.25;
  color: #f8fafc;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.aircraft-marker-selected .aircraft-label-tag {
  border-color: var(--gold-light);
  background: rgba(28, 34, 44, 0.95);
  z-index: 1000;
}

.aircraft-label-tag .tag-callsign {
  font-weight: 700;
  color: var(--gold-light);
}

.aircraft-label-tag .tag-metrics {
  color: #cbd5e1;
  display: block;
  font-size: 9.5px;
}

.tag-bil-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.tag-bil-badge.is-arr {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid #34d399;
  color: #6ee7b7;
}

.tag-bil-badge.is-dep {
  background: rgba(56, 189, 248, 0.25);
  border: 1px solid #38bdf8;
  color: #7dd3fc;
}

.tag-bil-badge.is-gnd {
  background: rgba(229, 179, 66, 0.25);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
}

@keyframes bilPulseHalo {
  0% { transform: scale(0.85); opacity: 0.9; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

.aircraft-bil-halo {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  pointer-events: none;
  animation: bilPulseHalo 2s infinite ease-out;
}

.aircraft-bil-halo.is-arr {
  border: 2px solid #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

.aircraft-bil-halo.is-dep {
  border: 2px solid #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

.aircraft-bil-halo.is-gnd {
  border: 2px solid var(--gold-primary);
}

.aircraft-marker-bil .aircraft-label-tag {
  border-color: #34d399;
  background: rgba(12, 24, 24, 0.94);
  z-index: 600;
}

.aircraft-marker-bil-dep .aircraft-label-tag {
  border-color: #38bdf8;
  background: rgba(12, 20, 32, 0.94);
  z-index: 600;
}

.hide-plane-labels .aircraft-label-tag {
  display: none;
}

.hide-plane-labels .aircraft-marker-selected .aircraft-label-tag,
.hide-plane-labels .aircraft-icon-container:hover .aircraft-label-tag {
  display: block;
}

/* Range Ring Distance Pill on Map */
.ring-distance-label {
  background: rgba(16, 20, 26, 0.85);
  border: 1px solid rgba(229, 179, 66, 0.55);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.kbil-center-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(229, 179, 66, 0.22);
  border: 2px solid var(--gold-light);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 10px;
  box-shadow: 0 0 14px rgba(229, 179, 66, 0.7);
}

/* Right Controls Sidebar */
.controls-sidebar {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  padding: 1rem;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.55rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s ease;
}

.tab-btn.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold-primary);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.tab-content.active {
  display: flex;
}

.panel-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  border: 1px solid var(--border-subtle);
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Flights Search & Table */
.flights-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.bil-filter-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

.bil-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.25rem;
  font-size: 0.69rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.bil-pill:hover {
  border-color: var(--gold-border);
  color: var(--text-main);
}

.bil-pill.active {
  background: rgba(229, 179, 66, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.flight-row.is-bil-arr {
  border-left: 3px solid #34d399;
  background: rgba(16, 185, 129, 0.07);
}

.flight-row.is-bil-dep {
  border-left: 3px solid #38bdf8;
  background: rgba(56, 189, 248, 0.07);
}

.flight-row.is-bil-gnd {
  border-left: 3px solid var(--gold-primary);
}

.sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sort-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.sort-select {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: inherit;
}

.flights-table-header {
  display: grid;
  grid-template-columns: 1.25fr 0.7fr 0.85fr 0.8fr 0.8fr;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.flights-list-container {
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  margin-top: 0.4rem;
}

.flight-row {
  display: grid;
  grid-template-columns: 1.25fr 0.7fr 0.85fr 0.8fr 0.8fr;
  gap: 0.35rem;
  align-items: center;
  padding: 0.48rem 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flight-row:hover {
  background: var(--bg-accent);
  border-color: var(--gold-border);
}

.flight-row.active {
  background: rgba(229, 179, 66, 0.16);
  border-color: var(--gold-primary);
}

.flight-cell-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.flight-callsign {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flight-reg {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.flight-type-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-light);
}

.flight-metric {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #e2e8f0;
}

.empty-state {
  padding: 1.5rem 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* Radio & Toggle Controls */
.radio-card-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.radio-card:hover {
  border-color: var(--gold-border);
}

.radio-card input {
  margin-top: 0.2rem;
  accent-color: var(--gold-primary);
}

.radio-card strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-main);
}

.radio-card small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.48rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #353d49;
  transition: 0.25s;
  border-radius: 22px;
}

.slider-round::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider-round {
  background-color: var(--gold-primary);
}

.toggle-switch input:checked + .slider-round::before {
  transform: translateX(18px);
}

.control-slider {
  width: 100%;
  accent-color: var(--gold-primary);
  height: 6px;
  background: #343c4a;
  border-radius: 3px;
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.about-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.about-list {
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.about-list a {
  color: var(--gold-light);
}

.code-box {
  background: #0d1015;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #cbd5e1;
  overflow-x: auto;
}

/* KBIL Tower Radio Live Audio Comms Banner */
.tower-radio-hud {
  position: absolute;
  top: 1rem;
  left: 3.4rem;
  width: 356px;
  max-width: calc(100% - 4.4rem);
  background: rgba(14, 19, 25, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(74, 222, 128, 0.5);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.68), 0 0 14px rgba(16, 185, 129, 0.16);
  z-index: 500;
  pointer-events: auto;
}

.tower-radio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.tower-freq-group {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.tower-tx-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.85);
}

.tower-tx-dot.is-transmitting {
  background: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.95);
  animation: txBlink 0.55s ease-in-out infinite alternate;
}

@keyframes txBlink {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1; }
}

.tower-freq-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 0.03em;
}

.tower-speaker-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.08rem 0.36rem;
  border-radius: 4px;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #86efac;
}

.tower-speaker-tag.is-tx {
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(250, 204, 21, 0.55);
  color: #fde047;
}

.tower-radio-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tower-mini-btn {
  background: rgba(30, 38, 49, 0.9);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.16rem 0.42rem;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.tower-mini-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.tower-radio-transcript {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.38;
  color: #e2e8f0;
  background: rgba(8, 11, 15, 0.75);
  border-left: 2px solid #4ade80;
  padding: 0.38rem 0.55rem;
  border-radius: 0 4px 4px 0;
}

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

  .app-container {
    grid-template-columns: 1fr;
    height: auto;
  }

  .viewport-area {
    height: 640px;
  }

  .altitude-legend {
    display: none;
  }
}

