#map-panel { max-width: 1180px; }
.map-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.map-heading h1 { margin: 5px 0 8px; font-size: clamp(25px, 3.2vw, 42px); }
.map-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.map-heading > strong { color: var(--primary); font: 600 22px/1.2 var(--font-display); }
.map-trade-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font: 12px/1.2 var(--font-mono); cursor: pointer; }
.map-trade-toggle input { width: 17px; height: 17px; accent-color: var(--highlight); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(290px, .8fr); gap: 14px; align-items: stretch; }
.map-frame { min-height: 510px; border: 1px solid rgba(129, 210, 138, .35); background: radial-gradient(circle at center, rgba(129, 210, 138, .065), transparent 58%), rgba(12, 16, 13, .78); overflow: hidden; }
.star-map { display: block; width: 100%; height: 100%; min-height: 510px; }
.map-grid path { fill: none; stroke: rgba(129, 210, 138, .07); stroke-width: 1; }
.map-route { stroke: rgba(129, 210, 138, .14); stroke-width: 1.4; stroke-dasharray: 4 8; }
.map-route.is-unreachable { stroke: var(--danger); opacity: .42; }
.map-route.is-active { stroke: var(--highlight); stroke-width: 2.4; stroke-dasharray: 9 6; animation: route-flow 1.5s linear infinite; }
.map-trade-routes { pointer-events: none; }
.map-trade-route path { fill: none; stroke: var(--highlight); stroke-width: 2.1; stroke-dasharray: 8 5; opacity: .78; animation: route-flow 2.2s linear infinite; }
.map-trade-route text { fill: var(--highlight); paint-order: stroke; stroke: #101411; stroke-width: 5px; font: 11px var(--font-mono); }
#trade-arrow path { fill: var(--highlight); stroke: none; }
.map-flight-marker { pointer-events: none; color: var(--highlight); filter: drop-shadow(0 0 6px rgba(244, 197, 95, .9)); }
.map-flight-marker-core { fill: currentColor; stroke: #212121; stroke-width: 1.5; }
.map-flight-marker-pulse { fill: none; stroke: currentColor; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: flight-marker-pulse 1.35s ease-out infinite; }
.map-planet { color: var(--primary); cursor: pointer; outline: none; }
.map-planet circle { fill: #121713; stroke: currentColor; stroke-width: 3; transition: .18s ease; }
.map-planet .map-planet-ring { fill: none; stroke-width: 1; opacity: .24; }
.map-planet text { fill: #e8f5ea; font: 600 18px var(--font-display); pointer-events: none; }
.map-planet .map-coordinates { fill: var(--muted); font: 12px var(--font-mono); }
.map-planet:hover circle, .map-planet:focus circle { fill: rgba(129, 210, 138, .25); filter: drop-shadow(0 0 10px rgba(129, 210, 138, .65)); }
.map-planet.is-current { color: var(--secondary); cursor: default; }
.map-planet.is-current circle { fill: rgba(92, 194, 207, .28); }
.map-planet.is-selected { color: var(--highlight); }
.map-planet.is-unreachable:not(.is-selected) { color: var(--danger); opacity: .68; }
.map-planet.is-unreachable:not(.is-selected) text { fill: var(--danger); }
.map-planet.is-selected .map-planet-ring { opacity: .85; animation: map-pulse 1.6s ease-out infinite; }
.route-card { min-height: 510px; border-top: 1px solid var(--line); padding: 24px; background: rgba(39, 42, 40, .74); }
.route-card.is-empty-route { display: flex; flex-direction: column; }
.planet-shortcut { align-self: flex-end; min-width: 0; margin-top: auto; padding: 9px 18px; font-size: 12px; }
.route-card h2 { margin: 8px 0 14px; color: #eff8f0; font: 600 29px/1.2 var(--font-display); }
.route-card > p:not(.eyebrow):not(.route-unavailable):not(.flight-lock) { color: var(--muted); font-size: 15px; line-height: 1.6; }
.route-card dl { display: grid; gap: 0; margin: 23px 0; }
.route-card dl div { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.route-card dt { color: var(--muted); font-size: 13px; }
.route-card dd { margin: 0; color: var(--primary); font: 14px var(--font-mono); text-align: right; }
.route-start { width: 100%; margin-top: 16px; }
.route-start span, .route-start em { display: block; }
.route-start em { margin-top: 5px; color: var(--highlight); font: normal 11px/1 var(--font-mono); text-transform: none; }
.route-warning { border-left: 2px solid var(--highlight); padding: 12px 14px; background: rgba(244, 197, 95, .08); }
.route-warning strong, .route-warning span { display: block; }
.route-warning strong { color: var(--highlight); font: 13px var(--font-mono); text-transform: uppercase; }
.route-warning span { margin: 7px 0 12px; color: var(--text); font-size: 14px; line-height: 1.45; }
.route-warning label { color: var(--muted); font: 12px var(--font-mono); cursor: pointer; }
.route-warning input { accent-color: var(--highlight); }
.route-unavailable { color: var(--danger); font: 13px/1.5 var(--font-mono); }
.flight-countdown { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 14px; }
.flight-countdown strong { color: var(--highlight); font: 600 48px/1 var(--font-display); }
.flight-countdown span { color: var(--muted); font: 12px var(--font-mono); text-transform: uppercase; }
.flight-card progress { width: 100%; height: 8px; border: 0; background: rgba(129, 210, 138, .1); accent-color: var(--highlight); }
.flight-card progress::-webkit-progress-bar { background: rgba(129, 210, 138, .1); }
.flight-card progress::-webkit-progress-value { background: var(--highlight); box-shadow: 0 0 10px rgba(244, 197, 95, .4); }
.flight-lock { border-left: 2px solid var(--danger); padding-left: 13px; color: var(--muted); font: 12px/1.55 var(--font-mono); }
.map-status { min-height: 18px; margin: 14px 0; color: var(--primary); font: 13px/1.4 var(--font-mono); }
.map-status.is-error { color: var(--danger); }
.incident-log { margin-top: 16px; border-top: 1px solid var(--line); padding: 24px; background: rgba(24, 28, 25, .82); }
.incident-log-heading { margin-bottom: 18px; }
.incident-log-heading h2 { margin: 5px 0 0; color: #eff8f0; font: 600 27px/1.2 var(--font-display); }
.incident-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; border-left: 2px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 18px; }
.incident-entry.is-pending { border-left-color: var(--highlight); background: rgba(244, 197, 95, .055); }
.incident-entry.rescue-summary { border-left-color: var(--danger); background: rgba(210, 129, 129, .06); }
.incident-entry h3 { margin: 4px 0 7px; color: #eff8f0; font: 600 19px/1.25 var(--font-display); }
.incident-entry p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.incident-action { min-width: 150px; }
.incident-action em { display: block; margin-top: 5px; color: var(--highlight); font: normal 11px/1.2 var(--font-mono); text-transform: none; }
.incident-resolved { color: var(--primary); font: 12px var(--font-mono); text-transform: uppercase; }
.incident-empty { color: var(--muted); }

@keyframes route-flow { to { stroke-dashoffset: -30; } }
@keyframes map-pulse { from { r: 17; opacity: .9; } to { r: 29; opacity: 0; } }
@keyframes flight-marker-pulse { from { opacity: .95; transform: scale(.65); } to { opacity: 0; transform: scale(2.25); } }

@media (max-width: 950px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-frame, .star-map { min-height: 430px; }
  .route-card { min-height: 0; }
}

@media (max-width: 650px) {
  .map-heading { flex-direction: column; }
  .map-frame, .star-map { min-height: 350px; }
  .map-planet text { font-size: 19px; }
  .map-planet .map-coordinates { display: none; }
  .incident-entry { grid-template-columns: 1fr; }
  .incident-action { width: 100%; }
}
