:root {
  color-scheme: light;
  font-family: "Segoe UI", "Aptos", Arial, sans-serif;
  --navy: #061621;
  --navy-soft: #0c2533;
  --navy-panel: rgba(6, 18, 28, 0.94);
  --cyan: #2ee6ee;
  --cyan-soft: #8df6fb;
  --gold: #e6b86a;
  --amber: #ffcc78;
  --paper: #f2fbfc;
  --muted: #a8c2c8;
  --red: #ff8f73;
  --green: #7bf2a2;
  --panel-line: rgba(46, 230, 238, 0.25);
  --panel-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(rgba(46, 230, 238, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 230, 238, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #06131d 0%, #092131 48%, #071923 100%);
  background-size: 46px 46px, 46px 46px, auto;
}

button[hidden] {
  display: none;
}

.opening-overlay {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 38% 42%, rgba(46, 230, 238, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(3, 11, 17, 0.92), rgba(3, 11, 17, 0.76));
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease, visibility 700ms ease;
  visibility: hidden;
}

.is-opening .opening-overlay {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.opening-overlay.complete {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.opening-card {
  width: min(420px, calc(100% - 40px));
  padding: 24px;
  border: 1px solid rgba(46, 230, 238, 0.52);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(8, 31, 45, 0.96), rgba(5, 17, 26, 0.92)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46), 0 0 40px rgba(46, 230, 238, 0.14);
  transform: translateY(10px);
  animation: opening-card-in 900ms ease forwards;
}

.opening-card h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.opening-card p:not(.eyebrow) {
  margin: 10px 0 18px;
  color: #d9f6f8;
  line-height: 1.5;
}

.opening-card button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(230, 184, 106, 0.62);
  border-radius: 5px;
  color: #fff5dc;
  background: rgba(230, 184, 106, 0.1);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes opening-card-in {
  to {
    transform: translateY(0);
  }
}

.command-bar {
  position: relative;
  z-index: 1000;
  min-height: 92px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid rgba(230, 184, 106, 0.58);
  background:
    linear-gradient(90deg, rgba(6, 18, 28, 0.98), rgba(9, 33, 49, 0.96)),
    repeating-linear-gradient(90deg, rgba(46, 230, 238, 0.08) 0 1px, transparent 1px 22px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: #ffffff;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  font-weight: 750;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(46, 230, 238, 0.28);
}

.deck-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.deck-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(46, 230, 238, 0.35);
  border-radius: 4px;
  color: #dffbfc;
  background: rgba(46, 230, 238, 0.08);
  box-shadow: inset 0 0 18px rgba(46, 230, 238, 0.04);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-shell {
  position: relative;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 540px;
  background: #b8d7df;
  outline: 1px solid rgba(230, 184, 106, 0.18);
}

.status-panel {
  position: absolute;
  z-index: 800;
  top: 20px;
  right: 20px;
  width: min(392px, calc(100% - 40px));
  max-height: calc(100% - 40px);
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(46, 230, 238, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 31, 45, 0.96), var(--navy-panel)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(8px);
  transition: opacity 650ms ease 450ms, transform 650ms ease 450ms;
}

.is-opening .status-panel {
  opacity: 0;
  transform: translateX(16px);
}

.status-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(37, 217, 232, 0.25);
}

.status-heading h2 {
  color: #ffffff;
  font-size: 1.45rem;
}

.motion-status {
  padding: 6px 9px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(232, 185, 93, 0.1);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.motion-status.underway {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(37, 217, 232, 0.1);
}

.motion-status.arrived {
  border-color: var(--green);
  color: var(--green);
  background: rgba(123, 242, 162, 0.1);
}

.motion-status.blocked {
  border-color: var(--red);
  color: #ffb29f;
  background: rgba(255, 143, 115, 0.12);
}

.navigation-warning {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(232, 185, 93, 0.42);
  border-radius: 5px;
  color: #ffe2a4;
  background: rgba(230, 184, 106, 0.09);
  font-size: 0.76rem;
  line-height: 1.4;
}

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

.telemetry-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(168, 194, 200, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
}

.telemetry-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.telemetry-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
}


.state-inspector {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(46, 230, 238, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

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

.state-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(168, 194, 200, 0.12);
  border-radius: 5px;
  background: rgba(2, 12, 18, 0.26);
}

.state-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.state-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  line-height: 1.35;
}

.state-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.state-controls button {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(46, 230, 238, 0.42);
  border-radius: 5px;
  color: #e8fdff;
  background: rgba(46, 230, 238, 0.09);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
}

.state-controls button:hover,
.state-controls button:focus-visible {
  border-color: var(--cyan);
  background: rgba(46, 230, 238, 0.16);
}

#clearStateButton {
  grid-column: 1 / -1;
  border-color: rgba(255, 143, 115, 0.42);
  color: #ffe0d8;
  background: rgba(255, 143, 115, 0.08);
}

.time-warp {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin: 0 0 10px;
}

.warp-button {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(168, 194, 200, 0.35);
  border-radius: 5px;
  color: #d8edef;
  background: rgba(168, 194, 200, 0.08);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.warp-button:hover,
.warp-button:focus-visible,
.warp-button.active {
  border-color: var(--cyan);
  color: #ffffff;
  background: rgba(37, 217, 232, 0.18);
}

.live-mode-note {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(46, 230, 238, 0.3);
  border-radius: 5px;
  background: rgba(46, 230, 238, 0.06);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.controls button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(46, 230, 238, 0.5);
  border-radius: 5px;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(46, 230, 238, 0.16), rgba(46, 230, 238, 0.07));
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.controls button:hover,
.controls button:focus-visible {
  border-color: var(--cyan);
  background: rgba(37, 217, 232, 0.2);
}

.controls button.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(232, 185, 93, 0.18);
}

.controls button.attention {
  animation: control-attention 700ms ease;
}

@keyframes control-attention {
  0%,
  100% {
    box-shadow: none;
  }

  45% {
    box-shadow: 0 0 0 3px rgba(230, 184, 106, 0.22), 0 0 18px rgba(230, 184, 106, 0.28);
  }
}

#escortModeButton {
  border-color: rgba(123, 242, 162, 0.45);
  color: #dcffe8;
  background: linear-gradient(180deg, rgba(123, 242, 162, 0.13), rgba(46, 230, 238, 0.07));
}

#escortModeButton:hover,
#escortModeButton:focus-visible {
  border-color: var(--green);
  background: rgba(123, 242, 162, 0.16);
}

.controls button:disabled {
  border-color: rgba(154, 181, 189, 0.28);
  color: #718b93;
  background: rgba(154, 181, 189, 0.05);
  cursor: not-allowed;
}

.controls .secondary {
  grid-column: 1 / -1;
  border-color: rgba(232, 185, 93, 0.58);
  background: rgba(232, 185, 93, 0.1);
}

.design-console {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-line);
}

.tuning-grid,
.notes-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.preset-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.preset-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.preset-row span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preset-row select {
  min-height: 38px;
  border: 1px solid rgba(46, 230, 238, 0.28);
  border-radius: 5px;
  color: #ffffff;
  background: rgba(2, 12, 18, 0.72);
  font: inherit;
  font-size: 0.76rem;
}

.preset-row button {
  align-self: end;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(46, 230, 238, 0.5);
  border-radius: 5px;
  color: #ffffff;
  background: rgba(46, 230, 238, 0.12);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.preset-row button:hover,
.preset-row button:focus-visible {
  border-color: var(--cyan);
  background: rgba(46, 230, 238, 0.2);
}

.tuning-grid label,
.notes-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(168, 194, 200, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
}

.tuning-grid span,
.notes-grid span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tuning-grid output {
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.76rem;
}

.tuning-grid input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.notes-grid input,
.notes-grid textarea,
.scenario-export {
  width: 100%;
  border: 1px solid rgba(46, 230, 238, 0.28);
  border-radius: 5px;
  color: #ffffff;
  background: rgba(2, 12, 18, 0.58);
  font: inherit;
  font-size: 0.76rem;
}

.notes-grid input,
.notes-grid textarea {
  padding: 8px;
}

.notes-grid textarea,
.scenario-export {
  resize: vertical;
}

.notes-grid input::placeholder,
.notes-grid textarea::placeholder,
.scenario-export::placeholder {
  color: rgba(216, 237, 239, 0.46);
}

.export-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.export-controls button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(230, 184, 106, 0.58);
  border-radius: 5px;
  color: #fff5dc;
  background: rgba(230, 184, 106, 0.11);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.export-controls button:hover,
.export-controls button:focus-visible {
  border-color: var(--gold);
  background: rgba(230, 184, 106, 0.18);
}

.export-controls button:disabled {
  border-color: rgba(154, 181, 189, 0.28);
  color: #718b93;
  background: rgba(154, 181, 189, 0.05);
  cursor: not-allowed;
}

.scenario-export {
  min-height: 142px;
  margin-top: 10px;
  padding: 10px;
  color: #dcfbff;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.35;
}

.ship-panel,
.captains-log {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-line);
}

.panel-title-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.panel-title-row h3 {
  margin: 0;
  color: #ffffff;
  font-size: 0.92rem;
  letter-spacing: 0;
  text-align: right;
}

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

.ship-details div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(168, 194, 200, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
}

.ship-details dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ship-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.75rem;
  line-height: 1.35;
}

.ship-details div:last-child {
  grid-column: 1 / -1;
}

.captains-log ol {
  max-height: 150px;
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.captains-log li {
  padding: 8px 0;
  border-top: 1px solid rgba(154, 181, 189, 0.14);
  color: #d9ebee;
  font-size: 0.76rem;
  line-height: 1.35;
}

.captains-log li.latest {
  animation: log-latest 950ms ease;
}

@keyframes log-latest {
  0% {
    background: rgba(230, 184, 106, 0.18);
    box-shadow: inset 3px 0 0 rgba(230, 184, 106, 0.8);
  }

  100% {
    background: transparent;
    box-shadow: inset 3px 0 0 transparent;
  }
}

.captains-log time {
  display: inline-block;
  min-width: 66px;
  color: var(--gold);
  font-family: Consolas, "Courier New", monospace;
}

.simulation-note {
  position: absolute;
  z-index: 700;
  right: 18px;
  bottom: 18px;
  padding: 7px 9px;
  margin: 0;
  border: 1px solid rgba(7, 26, 40, 0.36);
  border-radius: 4px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.leaflet-control-zoom a {
  border-color: rgba(46, 230, 238, 0.25) !important;
  color: #0b2534 !important;
}

.leaflet-control-attribution {
  border-top: 1px solid rgba(46, 230, 238, 0.18);
  background: rgba(255, 255, 255, 0.78) !important;
}

.fleet-dot {
  background: none;
  border: 0;
}

.ship-dot {
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 3px rgba(7, 26, 40, 0.42), 0 0 16px rgba(7, 26, 40, 0.45);
}

.ship-dot::before {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 2px;
  height: 10px;
  content: "";
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.72);
  transform: translateX(-50%) rotate(var(--heading, 0deg));
  transform-origin: 50% calc(100% + 7px);
}

.ship-dot::after {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--cyan);
}

.ship-dot.flagship {
  width: 32px;
  height: 32px;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(7, 26, 40, 0.5), 0 0 20px rgba(232, 185, 93, 0.62);
}

.ship-dot.flagship::after {
  width: 10px;
  height: 10px;
  background: var(--gold);
}

.ship-dot.flagship::before {
  height: 13px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(232, 185, 93, 0.78);
}

.contact-dot {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 44% 56% 50% 50%;
  background: rgba(230, 184, 106, 0.96);
  box-shadow: 0 0 0 4px rgba(7, 26, 40, 0.46), 0 0 18px rgba(230, 184, 106, 0.5);
}

.contact-dot::before {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 2px;
  height: 12px;
  content: "";
  border-radius: 999px;
  background: #ffffff;
  transform: translateX(-50%) rotate(var(--heading, 0deg));
  transform-origin: 50% calc(100% + 6px);
}

.contact-dot::after {
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--navy);
}

.contact-label {
  border: 1px solid rgba(230, 184, 106, 0.42);
  color: #fff7dc;
  background: rgba(7, 26, 40, 0.88);
  box-shadow: 0 6px 16px rgba(7, 26, 40, 0.28);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ship-dot.selected {
  transform: scale(1.16);
  box-shadow: 0 0 0 4px rgba(7, 26, 40, 0.5), 0 0 24px rgba(37, 217, 232, 0.8);
}

.contact-dot.selected {
  transform: scale(1.16);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(7, 26, 40, 0.48), 0 0 20px rgba(123, 242, 162, 0.62);
}

.waypoint-dot {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--navy);
  background: rgba(232, 185, 93, 0.92);
  box-shadow: 0 0 0 3px rgba(7, 26, 40, 0.42), 0 0 16px rgba(232, 185, 93, 0.42);
  font-size: 0.62rem;
  font-weight: 900;
}

.waypoint-dot.suggested {
  border-color: var(--cyan);
  background: rgba(37, 217, 232, 0.92);
}

.waypoint-dot.selected {
  border-color: #ffffff;
  color: #041620;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(7, 26, 40, 0.5), 0 0 22px rgba(123, 242, 162, 0.72);
}

.feedback-pulse {
  animation: feedback-pulse 900ms ease-out forwards;
  pointer-events: none;
}

.feedback-pulse.rejected {
  stroke: var(--red);
  fill: var(--red);
}

.feedback-pulse.selected {
  stroke: var(--cyan);
  fill: var(--cyan);
}

.feedback-pulse.canceled,
.feedback-pulse.reset {
  stroke: var(--gold);
  fill: var(--gold);
}

@keyframes feedback-pulse {
  0% {
    opacity: 0.95;
    stroke-width: 3;
  }

  100% {
    opacity: 0;
    stroke-width: 1;
    transform: scale(3.2);
  }
}

.threat-dot {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid #ffffff;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(7, 26, 40, 0.48), 0 0 22px rgba(255, 79, 95, 0.74);
  transform: rotate(45deg);
}

.threat-dot::after {
  display: block;
  width: 7px;
  height: 7px;
  margin: 5px;
  content: "";
  border-radius: 50%;
  background: #ffffff;
}

.leaflet-interactive.detour-preview {
  filter: drop-shadow(0 0 5px rgba(232, 185, 93, 0.5));
}

.leaflet-interactive.threat-line {
  filter: drop-shadow(0 0 5px rgba(255, 79, 95, 0.45));
}

.leaflet-interactive.fleet-trail {
  filter: drop-shadow(0 0 4px rgba(37, 217, 232, 0.45));
}

.leaflet-interactive.formation-link {
  filter: drop-shadow(0 0 5px rgba(37, 217, 232, 0.28));
  pointer-events: none;
}

.leaflet-interactive.land-zone {
  filter: drop-shadow(0 0 5px rgba(255, 143, 115, 0.35));
}

.leaflet-tooltip {
  border: 1px solid rgba(7, 26, 40, 0.3);
  color: var(--navy);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(7, 26, 40, 0.16);
  font-size: 0.72rem;
  font-weight: 700;
}

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

  .command-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .deck-meta {
    justify-content: flex-start;
  }

  .map-shell {
    display: flex;
    flex-direction: column;
  }

  #map {
    height: 56vh;
    min-height: 400px;
  }

  .status-panel {
    position: relative;
    inset: auto;
    order: 2;
    width: auto;
    max-height: none;
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
  }

  .simulation-note {
    top: 12px;
    right: 10px;
    bottom: auto;
    max-width: calc(100% - 66px);
  }
}

@media (max-width: 420px) {
  .telemetry-grid,
  .state-grid,
  .ship-details,
  .deck-meta,
  .state-controls,
  .controls {
    grid-template-columns: 1fr;
  }

  .time-warp {
    grid-template-columns: repeat(2, 1fr);
  }

  .controls .secondary {
    grid-column: auto;
  }

  .ship-details div:last-child {
    grid-column: auto;
  }
}
