/* ─── Reset & Variables ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Ensure [hidden] always wins, even when a class sets display explicitly */
[hidden] { display: none !important; }

:root {
  --bg:         #0f172a;
  --surface:    #1e293b;
  --surface-2:  #334155;
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --accent:     #3b82f6;

  --green-bg:   #14532d;
  --green-text: #86efac;
  --green-edge: #22c55e;

  --yellow-bg:   #713f12;
  --yellow-text: #fde68a;
  --yellow-edge: #eab308;

  --red-bg:   #7f1d1d;
  --red-text: #fca5a5;
  --red-edge: #ef4444;

  --radius: 12px;
  --gap:    1rem;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: 5.75rem;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

h1 { font-size: 1.2rem; font-weight: 700; white-space: nowrap; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.header-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
}

.last-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.time-zone-readout {
  font-size: 0.7rem;
  color: rgba(241, 245, 249, 0.72);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.btn-icon-text {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

/* ─── Main Layout ────────────────────────────────────────────────────────── */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

section h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.display-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
}

.display-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.display-bar-copy {
  min-width: 0;
}

.display-bar-summary {
  font-size: 0.88rem;
  color: var(--text);
}

.display-summary {
  font-size: 0.88rem;
  color: var(--text);
  max-width: 42rem;
  margin-bottom: 1rem;
}

  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.btn-icon:disabled,
.bottom-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-icon.is-spinning,
.bottom-action.is-spinning .bottom-action-icon {
  animation: spin 0.85s linear infinite;
}
.segmented-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.segmented-btn.is-active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text);
}

.time-mode-summary {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.view-tab {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.view-tab[aria-selected="true"] {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.7);
  color: var(--text);
}

.layer-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.layer-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.42);
}

.layer-chip input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  accent-color: var(--accent);
}

.layer-chip strong {
  display: block;
  font-size: 0.8rem;
  color: var(--text);
}

.layer-chip span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.overview-panel {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: var(--text);
}

.overview-panel.is-high { border-color: var(--red-edge); }
.overview-panel.is-moderate { border-color: var(--yellow-edge); }
.overview-panel.is-low { border-color: var(--green-edge); }

.overview-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.overview-copy {
  font-size: 0.98rem;
  line-height: 1.6;
}

.overview-meta {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ─── Card Grid ──────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--surface-2);
  border-left-width: 3px;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
}

.airport-card {
  padding-bottom: 3.6rem;
}

.card[role="button"],
.card[tabindex] {
  cursor: pointer;
}
.card[role="button"]:hover,
.card[tabindex]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.airport-code {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2em 0.55em;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-badge-icon {
  font-size: 0.6rem;
  line-height: 1;
}

.status-badge-low {
  background: rgba(34, 197, 94, 0.16);
  color: var(--green-text);
}

.status-badge-moderate {
  background: rgba(234, 179, 8, 0.16);
  color: var(--yellow-text);
}

.status-badge-high {
  background: rgba(239, 68, 68, 0.18);
  color: var(--red-text);
}

.card-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.card-impact {
  color: var(--text);
  font-size: 0.84rem;
  margin-bottom: 0.55rem;
}

.card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.fact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
}

.fact-pill-icon {
  font-size: 0.68rem;
  line-height: 1;
}

.fact-pill-good {
  color: var(--green-text);
  border-color: rgba(34, 197, 94, 0.24);
}

.fact-pill-info {
  color: rgba(147, 197, 253, 0.95);
  border-color: rgba(59, 130, 246, 0.24);
}

.fact-pill-warn {
  color: var(--yellow-text);
  border-color: rgba(234, 179, 8, 0.24);
}

.fact-pill-bad {
  color: var(--red-text);
  border-color: rgba(239, 68, 68, 0.24);
}

.fact-pill-muted {
  color: var(--text-muted);
}

.weather-peek-btn {
  position: absolute;
  right: 0.85rem;
  bottom: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  border-radius: 999px;
  padding: 0.36rem 0.58rem;
  font-size: 0.7rem;
  cursor: pointer;
}

.weather-peek-icon {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  box-shadow: 0 0 0 0.18rem rgba(148, 163, 184, 0.12);
}

.weather-peek-icon-clear { background: var(--green-edge); box-shadow: 0 0 0 0.18rem rgba(34, 197, 94, 0.14); }
.weather-peek-icon-mixed { background: var(--yellow-edge); box-shadow: 0 0 0 0.18rem rgba(234, 179, 8, 0.14); }
.weather-peek-icon-poor,
.weather-peek-icon-storm { background: var(--red-edge); box-shadow: 0 0 0 0.18rem rgba(239, 68, 68, 0.14); }
.weather-peek-icon-wind { background: var(--accent); box-shadow: 0 0 0 0.18rem rgba(59, 130, 246, 0.14); }
.weather-peek-icon-unknown { background: rgba(148, 163, 184, 0.55); }

.weather-peek-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(241, 245, 249, 0.85);
}

.weather-popover {
  position: absolute;
  right: 0.85rem;
  bottom: 3.3rem;
  width: min(15rem, calc(100% - 1.7rem));
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.35);
  padding: 0.8rem 0.85rem;
  z-index: 3;
}

.weather-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.weather-popover-head span {
  color: var(--text-muted);
}

.weather-popover p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.weather-popover-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.raw-toggle {
  margin-top: 0.65rem;
}

.raw-toggle summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.raw-toggle p {
  margin-top: 0.45rem;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.detail-summary {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 1rem;
}

.detail-summary p + p {
  margin-top: 0.5rem;
}

.evidence-panel {
  margin-top: 1rem;
}

.evidence-panel summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.evidence-list {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.evidence-list li {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.network-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.network-grid {
  display: grid;
  gap: 1rem;
}

.network-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.network-summary {
  background: linear-gradient(140deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
}

.network-summary p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.network-summary p + p {
  margin-top: 0.45rem;
}

.network-board {
  position: relative;
  min-height: 24rem;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  border: 1px solid var(--surface-2);
  background: #0b1220;
}

.network-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.18));
  pointer-events: none;
  z-index: 1;
}

.network-map-toolbar {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  right: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 4;
}

.network-map-actions {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: auto;
}

.network-map-btn {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border-radius: 999px;
  padding: 0.36rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.network-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.network-viewport {
  position: absolute;
  inset: 0;
  transform-origin: top left;
  will-change: transform;
}

.network-map {
  position: absolute;
  inset: 8% 4% 8%;
  width: 92%;
  height: 84%;
  opacity: 0.9;
}

.network-map-tiles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
  z-index: 0;
}

.network-map-tile {
  position: absolute;
  display: block;
  object-fit: cover;
}

.network-map-attribution {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.network-node {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0;
  min-width: 0;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}

.network-node.is-national {
  z-index: 1;
}

.network-node-pin {
  display: block;
  width: 1rem;
  height: 1rem;
  margin: 0 auto;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.88);
  background: var(--green-edge);
  box-shadow: 0 0 0 0.22rem rgba(15, 23, 42, 0.34);
}

.network-node.is-moderate .network-node-pin { background: var(--yellow-edge); }
.network-node.is-high .network-node-pin { background: var(--red-edge); }

.network-node.has-restriction::after {
  content: '';
  position: absolute;
  inset: -7px -7px auto;
  height: 1.4rem;
  border: 1px dashed rgba(248, 250, 252, 0.28);
  border-radius: 18px;
}

.network-cluster {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.9);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}

.network-cluster.is-low { background: rgba(34, 197, 94, 0.86); }
.network-cluster.is-moderate { background: rgba(234, 179, 8, 0.88); }
.network-cluster.is-high { background: rgba(239, 68, 68, 0.9); }

.network-cluster-count {
  font-size: 0.72rem;
  font-weight: 800;
}

.network-node-spider {
  z-index: 4;
}

.network-spoke {
  position: absolute;
  height: 1px;
  background: rgba(241, 245, 249, 0.45);
  transform-origin: left center;
  z-index: 2;
}

.network-node-code {
  display: none;
}

.network-node-meta {
  display: none;
}

.network-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.network-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.network-events-panel {
  width: 100%;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 0.95rem;
}

.network-watched-panel {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
}

.network-events-summary {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.network-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.network-event-card {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.58);
  color: var(--text);
  padding: 0.8rem 0.85rem;
  cursor: pointer;
}

.network-event-card.is-high { border-color: rgba(239, 68, 68, 0.55); }
.network-event-card.is-moderate { border-color: rgba(234, 179, 8, 0.45); }
.network-event-card.is-low { border-color: rgba(34, 197, 94, 0.4); }

.network-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.network-event-code {
  font-size: 0.9rem;
  font-weight: 700;
}

.network-event-copy,
.network-event-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.bottom-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  padding: 0.7rem 0.75rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.94);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(16px);
  z-index: 30;
}

.bottom-action {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 12px;
  padding: 0.5rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.16rem;
  font-size: 0.68rem;
  cursor: pointer;
}

.bottom-action-icon {
  font-size: 1rem;
}

.bottom-action.is-active {
  background: rgba(59, 130, 246, 0.18);
  color: var(--text);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.network-row {
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.network-row.is-watched {
  border-color: rgba(59, 130, 246, 0.28);
}

.network-row-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.network-row-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.network-row-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.network-row-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.network-empty {
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* Status color variants */
.status-green { border-left-color: var(--green-edge); }
.status-green .status-badge { background: var(--green-bg); color: var(--green-text); }

.status-yellow { border-left-color: var(--yellow-edge); }
.status-yellow .status-badge { background: var(--yellow-bg); color: var(--yellow-text); }

.status-red { border-left-color: var(--red-edge); }
.status-red .status-badge { background: var(--red-bg); color: var(--red-text); }

/* ─── Flight Cards ───────────────────────────────────────────────────────── */
#flight-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.flight-card .card-body {
  font-size: 0.88rem;
  color: var(--text);
}

.duration {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-left: 0.4rem;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.price-tag {
  font-size: 0.72rem;
  background: var(--surface-2);
  color: var(--text);
  padding: 0.2em 0.55em;
  border-radius: 6px;
}

.seats-warning { color: var(--yellow-text); }

/* ─── State: loading / empty / error ────────────────────────────────────── */
.loading, .empty, .error {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.75rem 0;
}
.error { color: var(--red-text); }

/* ─── Primary Button ─────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.3rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  background: rgba(59, 130, 246, 0.14);
  color: var(--text);
  border: 1px solid rgba(59, 130, 246, 0.38);
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.flight-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-row label,
#settings-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 110px;
}

.label-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.7;
}

input, select {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  color: var(--text);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

/* Settings form */
#settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 1rem;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 50;
  display: flex;
  align-items: flex-end;
}

.modal-inner {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem 2rem;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
}

.modal-display-inner {
  max-width: 760px;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-inner h2 { margin-bottom: 0.25rem; }

/* ─── Advisory text ──────────────────────────────────────────────────────── */
.advisory-text {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  white-space: pre-wrap;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-top: 1rem;
  line-height: 1.6;
}

/* ─── Briefing Output ────────────────────────────────────────────────────── */
#briefing-output { margin-top: 1rem; }

.briefing { line-height: 1.75; }
.briefing p { margin-bottom: 0.75rem; }

.briefing-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-2);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 760px) {
  .modal {
    align-items: center;
    padding: 1rem;
  }
  .modal-inner {
    border-radius: var(--radius);
    max-width: 580px;
    margin: 0 auto;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (min-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .network-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 0.95fr);
    align-items: start;
  }

  .bottom-toolbar {
    left: 50%;
    right: auto;
    bottom: 1rem;
    width: min(34rem, calc(100% - 2rem));
    transform: translateX(-50%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
  }
}

@media (max-width: 759px) {
  .header-inner {
    gap: 0.75rem;
  }

  .header-status {
    align-items: flex-start;
  }

  .display-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-secondary {
    width: 100%;
  }

  .layer-controls {
    grid-template-columns: 1fr;
  }

  .network-board {
    min-height: 19rem;
  }

  .network-map-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .network-node {
    min-width: 4.4rem;
    padding: 0.44rem 0.5rem;
  }

  .network-node-code {
    font-size: 0.84rem;
  }

  .network-node-meta,
  .network-marker-code {
    font-size: 0.62rem;
  }

  .weather-peek-label {
    display: none;
  }
}
