:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #172033;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #dce4f2, #f6f7f9 52%); }

main { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }

header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem max(1rem, calc((100vw - 1180px) / 2)); background: linear-gradient(135deg, #001a44, #002868); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.brand-lockup { display: flex; align-items: center; gap: 1rem; }
.brand-logo { width: clamp(7rem, 13vw, 10rem); height: auto; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .86)) drop-shadow(0 0 9px rgba(255, 255, 255, .42)); }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.8rem); line-height: .95; }
h2 { margin-bottom: .35rem; }

.eyebrow { margin-bottom: .45rem; color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
#data-status { margin: 0; max-width: 28rem; color: rgba(255, 255, 255, .82); text-align: right; }

main { display: grid; gap: 1rem; padding-block: 1rem 3rem; }
.route-panel, .map-card, .safety-note { border: 1px solid #ccd3df; border-radius: 1rem; background: #fff; box-shadow: 0 1.2rem 3rem rgba(0, 40, 104, .12); }
.route-panel { grid-column: 1 / -1; padding: 1.25rem; }
.route-panel summary, .legend-panel summary { cursor: pointer; color: #002868; font-weight: 800; }
#route-summary { margin-left: .5rem; color: #5a6270; font-size: .85rem; font-weight: 500; }
.route-editor { display: grid; grid-template-columns: 1fr minmax(20rem, 1.2fr); gap: 1rem 2rem; align-items: end; margin-top: 1rem; }
.route-panel p, .map-heading p, .safety-note p { margin-bottom: 0; color: #5a6270; }

label { display: block; margin-bottom: .4rem; font-size: .82rem; font-weight: 750; color: #002868; }
.route-entry { display: flex; gap: .6rem; }
input, button { border-radius: .6rem; font: inherit; }
input { min-width: 0; flex: 1; border: 1px solid #8b97aa; padding: .75rem .85rem; background: #fff; color: #172033; text-transform: uppercase; }
button { border: 0; padding: .75rem 1rem; background: #bf0a30; color: #fff; font-weight: 800; cursor: pointer; }
button:hover { background: #950824; }
.threshold-setting { display: flex; align-items: center; gap: .5rem; margin: 0 0 0 auto; }
.threshold-setting span { display: flex; align-items: center; gap: .2rem; }
.threshold-setting input { flex: none; width: 6rem; padding: .4rem .5rem; text-transform: none; }
.symbol-size-setting { position: absolute; z-index: 5; bottom: .75rem; left: .75rem; display: flex; align-items: center; gap: .5rem; width: min(20rem, calc(100% - 1.5rem)); border-radius: .6rem; padding: .45rem .65rem; background: rgba(255, 255, 255, .92); color: #172033; font-size: .8rem; font-weight: 700; box-shadow: 0 .2rem .8rem rgba(0, 0, 0, .3); }
.symbol-size-setting input { flex: 1; padding: 0; accent-color: #002868; }
.symbol-size-setting output { min-width: 3.2rem; color: #5a6270; font-variant-numeric: tabular-nums; }
#route-message { grid-column: 1 / -1; min-height: 1.2rem; margin: 0; color: #bf0a30; }

.map-card { position: relative; overflow: hidden; }
.map-stage { position: relative; }
.map-heading { padding: .65rem 1.25rem; }
.map-heading h2 { margin: 0; font-size: 1rem; }
.legend-panel { border-top: 1px solid #ccd3df; padding: .85rem 1.25rem; }
.legend-panel .legend { margin-top: .75rem; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; color: #5a6270; font-size: .8rem; }
.legend .map-help { flex-basis: 100%; margin: 0; }
.legend i { display: inline-block; width: .7rem; height: .7rem; margin-right: .3rem; border-radius: 50%; }
.green-dot { background: #22c55e; }
.yellow-dot { background: #ffd500; }
.gray-dot { background: #808080; }
.red-dot { background: #e31b23; }
.part-time-dot { height: .35rem !important; border-radius: .7rem .7rem 0 0 !important; background: #ffd500; }
.route-dot { background: #f0f; }

#map { display: block; width: 100%; min-height: 28rem; background: #001a44; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
.map-grid { stroke: #29497b; stroke-width: 1; }
.fuel-marker { pointer-events: none; }
.marker-hit { fill: transparent; cursor: pointer; }
.route-line { fill: none; stroke: #f0f; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; vector-effect: non-scaling-stroke; }
.route-marker { fill: #f0f; cursor: pointer; }
.route-marker.unavailable { fill: #ed6a5a; }
.airport-label { display: none; fill: #fff; font-weight: 700; paint-order: stroke; pointer-events: none; stroke: #001a44; stroke-width: 3px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.airport-label.visible, .route-label { display: block; }
.route-label { fill: #fff; }

#airport-tooltip { position: absolute; z-index: 10; width: min(23rem, calc(100% - 1rem)); max-height: min(25rem, calc(100% - 1rem)); overflow: auto; border: 2px solid #002868; border-radius: .75rem; padding: .9rem; background: #fff; color: #172033; box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .35); }
#airport-tooltip[hidden] { display: none; }
#airport-tooltip h2 { margin: 0 2rem .2rem 0; font-size: 1.15rem; }
#airport-tooltip p { margin-bottom: .65rem; color: #5a6270; }
#airport-tooltip .warning { color: #bf0a30; font-weight: 800; }
.tooltip-close { position: absolute; top: .35rem; right: .35rem; padding: .2rem .5rem; background: transparent; color: #002868; font-size: 1.2rem; }
.price-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.price-list li { border-top: 1px solid #d7dce5; padding-top: .55rem; }
.price-list strong, .price-list span { display: block; }
.price-list span { margin-top: .15rem; color: #414b5e; font-size: .88rem; }
.safety-note { grid-column: 1 / -1; padding: 1.1rem 1.25rem; border-color: #bf0a30; }

@media (max-width: 760px) {
  header { display: block; }
  #data-status { margin-top: 1rem; text-align: left; }
  .route-editor { display: block; }
  .route-editor form { margin-top: 1rem; }
  .threshold-setting { justify-content: flex-start; margin-left: 0; }
  .route-entry, .map-heading { flex-direction: column; }
  .safety-note { grid-column: 1; }
  #map { min-height: 22rem; }
}
