:root {
  color-scheme: dark;
  --bg: oklch(.36 .085 153);
  --map-bg: oklch(.31 .08 154);
  --panel: oklch(.36 .085 153 / .96);
  --panel-solid: oklch(.36 .085 153);
  --text: oklch(.96 .025 96);
  --muted: oklch(.74 .05 120);
  --faint: oklch(.5 .07 150);
  --amber: oklch(.84 .15 87);
  --amber-soft: oklch(.84 .15 87 / .1);
  --tomato: oklch(.68 .17 38);
  --blue: oklch(.74 .05 120);
  --header-h: 64px;
  --timeline-h: 142px;
}

* { box-sizing: border-box; }
html, body { height: 100%; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Newsreader", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { width: 100%; height: 100%; height: 100dvh; min-height: 620px; overflow: hidden; }
.topbar {
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 2px solid var(--faint);
  background: var(--bg);
  position: relative;
  z-index: 30;
}
.toolbar { justify-self: end; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--amber);
  text-decoration: none;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tomato);
  box-shadow: 0 0 14px oklch(.68 .17 38 / .5);
  animation: pulse 2.6s ease-in-out infinite;
}
.place {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  min-height: 38px;
  padding: 5px 6px 5px 11px;
  border: 2px solid var(--faint);
  border-radius: 10px;
  background: oklch(.5 .07 150 / .08);
  color: var(--muted);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.place:hover { color: var(--text); border-color: var(--amber); background: var(--amber-soft); }
.place-separator { width: 1px; height: 16px; background: var(--faint); }
.place-action {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: stretch;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--amber);
  color: var(--bg);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.place-action svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.toolbar { display: flex; align-items: center; gap: 9px; }
.pill-button, .width-control {
  height: 34px;
  border: 2px solid var(--faint);
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  color: oklch(.86 .04 110);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.pill-button { cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.pill-button:hover { color: var(--text); border-color: var(--amber); }
.pill-button[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.pill-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.width-control { font-family: "Instrument Sans", system-ui, sans-serif; }
.width-control > span { color: var(--muted); text-transform: uppercase; font-size: 9px; letter-spacing: .1em; }
.width-control output { width: 42px; color: var(--amber); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 82px; height: 3px; accent-color: var(--amber); cursor: pointer; }

.workspace { height: calc(100% - var(--header-h)); display: flex; flex-direction: column; }
.map { flex: 1; min-height: 0; position: relative; overflow: hidden; isolation: isolate; cursor: grab; touch-action: none; }
.map-rotate { position: absolute; inset: 0; z-index: 0; transform-origin: center; pointer-events: none; transition: transform .22s cubic-bezier(.22, .75, .25, 1); will-change: transform; }
.map-rotate > * { pointer-events: auto; }
.map.rotating .map-rotate, .map.rotating .corridor-label, .map.rotating .home-marker small, .map.rotating .plane svg, .map.rotating .plane span { transition: none; }
.map.panning { cursor: grabbing; }
.map.panning .map-rotate { transition: none; }
.tile-layer { position: absolute; left: 50%; top: 50%; overflow: hidden; background: var(--map-bg); transform: translate(-50%, -50%); }
.tile-layer::after { content: ""; position: absolute; inset: 0; background: oklch(.31 .08 154 / .46); pointer-events: none; }
.tile-layer img { position: absolute; width: 256px; height: 256px; filter: grayscale(1) sepia(.7) hue-rotate(80deg) saturate(1.3) brightness(.46) contrast(1.14); user-select: none; }
.basemap { display: none; }
.water { fill: url(#water); opacity: .86; }
.shore { fill: none; stroke: rgba(135, 170, 186, .16); stroke-width: 1; }
.roads { fill: none; stroke: rgba(238, 234, 227, .075); stroke-width: 1; }
.roads path:nth-child(2), .roads path:nth-child(3) { stroke-width: 1.5; }
.districts { fill: none; stroke: rgba(238, 234, 227, .07); stroke-width: 1; }
.labels { fill: rgba(238, 234, 227, .18); font: 500 9px "DM Sans", system-ui, sans-serif; letter-spacing: .14em; }
.map-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; box-shadow: inset 0 0 140px oklch(.2 .04 154 / .26); }
.flight-path-layer { position: absolute; inset: 0; z-index: 9; width: 100%; height: 100%; overflow: hidden; pointer-events: none !important; }
.flight-path-layer path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.flight-path-layer .observed-route { stroke: var(--amber); stroke-width: 2.5; opacity: .9; }
.flight-path-layer .projected-route { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 7 7; opacity: .7; }
.flight-path-layer .filed-route { stroke: oklch(.72 .1 225); stroke-width: 1.5; stroke-dasharray: 2 6; opacity: .65; }
.flight-path-legend { position: absolute; z-index: 20; left: 24px; top: 108px; display: flex; gap: 12px; padding: 7px 10px; border: 1px solid var(--faint); border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.flight-path-legend[hidden] { display: none; }
.flight-path-legend span::before { display: inline-block; width: 17px; margin-right: 5px; border-top: 2px solid var(--amber); content: ""; vertical-align: middle; }
.flight-path-legend .projected-key::before { border-top-style: dashed; }
.flight-path-legend .filed-key::before { border-color: oklch(.72 .1 225); border-top-style: dotted; }
.zoom-controls {
  position: absolute;
  z-index: 20;
  left: 24px;
  top: 22px;
  display: grid;
  grid-template-columns: 32px auto 32px 32px;
  align-items: center;
  overflow: hidden;
  border: 2px solid var(--faint);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}
.zoom-controls button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 17px; cursor: pointer; }
.zoom-controls button:hover:not(:disabled) { color: var(--amber); background: var(--faint); }
.zoom-controls button:disabled { opacity: .25; cursor: not-allowed; }
.zoom-controls button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.zoom-controls span { min-width: 48px; color: var(--muted); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 8px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: center; text-transform: uppercase; }
.rotate-controls {
  position: absolute;
  z-index: 20;
  left: 24px;
  top: 64px;
  display: grid;
  grid-template-columns: 32px auto 32px 32px;
  align-items: center;
  overflow: hidden;
  border: 2px solid var(--faint);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}
.rotate-controls button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; font-family: "Instrument Sans", system-ui, sans-serif; display: flex; align-items: center; justify-content: center; }
.rotate-controls button:hover:not(:disabled) { color: var(--amber); background: var(--faint); }
.rotate-controls span { min-width: 36px; color: var(--muted); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 8px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: center; text-transform: uppercase; }
.rotate-reset { font-weight: 700; font-size: 12px !important; }

.corridor {
  --corridor-w: 96px;
  position: absolute;
  z-index: 7;
  left: 48%;
  top: 47%;
  width: 43%;
  height: var(--corridor-w);
  transform: translate(-50%, -50%) rotate(67deg);
  transform-origin: center;
  border: 2px dashed var(--amber);
  border-radius: 4px;
  background: oklch(.84 .15 87 / .1);
  box-shadow: none;
  pointer-events: none;
}
.corridor-label {
  position: absolute;
  left: 0;
  top: -23px;
  color: var(--amber);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(calc(var(--map-counter-rotation, 0deg) - var(--corridor-angle, 0deg))) scale(var(--map-counter-scale, 1));
  transform-origin: left center;
  transition: transform .22s cubic-bezier(.22, .75, .25, 1);
}
.handle {
  display: none;
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 2px solid var(--map-bg);
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 0 18px oklch(.84 .15 87 / .35);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.handle:active { cursor: grabbing; }
.handle-start { left: 0; }
.handle-end { left: 100%; }
.map.editing { cursor: crosshair; touch-action: none; }
.map.editing .handle { display: block; }
.map.editing .corridor { z-index: 14; pointer-events: none; }
.map.editing .handle { pointer-events: auto; }
.map.editing .plane { pointer-events: none; }
.scan-line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 180, 93, .45), transparent); opacity: .6; }

.home-marker { position: absolute; z-index: 8; left: 50%; top: 50%; display: flex; align-items: center; gap: 9px; transform: translate(-4px, -4px); }
.home-marker span { width: 8px; height: 8px; border-radius: 50%; background: var(--tomato); box-shadow: 0 0 0 5px oklch(.68 .17 38 / .18); }
.home-marker small { color: var(--muted); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 9px; text-transform: uppercase; display: inline-block; transform: rotate(var(--map-counter-rotation, 0deg)) scale(var(--map-counter-scale, 1)); transition: transform .22s cubic-bezier(.22, .75, .25, 1); }
.plane-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.plane {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 7px;
  background: transparent;
  color: rgba(238, 234, 227, .52);
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: color .2s, opacity .2s;
  will-change: transform;
}
.plane:hover, .plane.selected { color: var(--text); }
.plane.in-strip { color: var(--amber); }
.plane.other { color: rgba(135, 170, 186, .32); }
.plane svg { width: 18px; height: 18px; fill: currentColor; transform: rotate(var(--angle)) scale(var(--map-counter-scale, 1)); filter: drop-shadow(0 0 6px currentColor); transition: transform .22s cubic-bezier(.22, .75, .25, 1); }
.plane.helicopter svg { width: 25px; height: 19px; transform: rotate(calc(var(--angle) - 90deg)) scale(var(--map-counter-scale, 1)); }
.plane span { font-family: "Instrument Sans", system-ui, sans-serif; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .04em; text-shadow: 0 2px 4px var(--bg); display: inline-block; transform: rotate(var(--map-counter-rotation, 0deg)) scale(var(--map-counter-scale, 1)); transition: transform .22s cubic-bezier(.22, .75, .25, 1); }

.flight-card, .today-card {
  position: absolute;
  z-index: 20;
  right: 24px;
  width: 318px;
  border: 2px solid var(--faint);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}
.flight-card { top: 22px; overflow: hidden; }
.flight-card > .eyebrow-row, .flight-card > h1, .flight-card > p { margin-left: 18px; margin-right: 18px; }
.eyebrow-row { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.card-actions { display: flex; align-items: center; gap: 2px; }
.card-toggle { display: none; }
.card-toggle svg { transition: transform .2s; }
.card-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.eyebrow { color: var(--muted); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.active { color: var(--amber); }
.icon-button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--faint); }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.flight-card h1 { margin-top: 6px; margin-bottom: 2px; font-family: "Instrument Sans", system-ui, sans-serif; font-size: 33px; line-height: 1.05; letter-spacing: -.035em; }
.flight-card > p { margin-top: 0; margin-bottom: 16px; color: oklch(.86 .04 110); font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 15px; font-weight: 600; }
.flight-details { border-top: 1px solid var(--faint); }
.flight-details dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--faint); }
.flight-details dl div { background: var(--panel-solid); padding: 11px 18px; }
.flight-details dt { color: var(--muted); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 8px; letter-spacing: .11em; text-transform: uppercase; }
.flight-details dd { margin: 4px 0 0; font-family: "Instrument Sans", system-ui, sans-serif; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.flight-details dd .alert { color: var(--tomato); }
.flight-details .status-detail small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 400; line-height: 1.25; }
.today-card { top: 177px; padding: 14px 18px 12px; transition: top .2s; }
.flight-card.has-detail + .today-card { top: 407px; }
.stat-heading { display: flex; justify-content: space-between; align-items: baseline; }
.stat-heading span { color: rgba(238, 234, 227, .38); font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.stat-heading strong { color: rgba(238, 234, 227, .6); font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chart { display: flex; align-items: end; gap: 3px; height: 39px; margin-top: 10px; }
.chart i { flex: 1; min-height: 5px; border-radius: 2px 2px 0 0; background: rgba(238, 234, 227, .18); }
.chart i.active { background: var(--amber); box-shadow: 0 0 12px oklch(.84 .15 87 / .18); }
.chart i.current { outline: 1px solid rgba(238, 234, 227, .45); outline-offset: 1px; }
.chart i.future { opacity: .3; }
.chart-labels { display: flex; justify-content: space-between; margin-top: 6px; color: rgba(238, 234, 227, .27); font-size: 8px; text-transform: uppercase; }

.edit-tip {
  position: absolute;
  z-index: 22;
  left: 50%;
  bottom: 20px;
  padding: 8px 15px;
  border: 2px solid var(--amber);
  border-radius: 10px;
  background: var(--map-bg);
  color: var(--amber);
  font-size: 10px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.map.editing .edit-tip { opacity: 1; transform: translate(-50%, 0); }
.map-scale { position: absolute; z-index: 5; left: 24px; bottom: 37px; display: flex; align-items: center; gap: 8px; color: rgba(238, 234, 227, .28); font-size: 8px; text-transform: uppercase; }
.map-scale span { width: 42px; height: 5px; border: solid rgba(238, 234, 227, .25); border-width: 0 1px 1px; }
.map-credit { position: absolute; z-index: 5; left: 24px; bottom: 18px; color: rgba(238, 234, 227, .3); font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }
.map-credit a { color: inherit; }
.map-credit a:hover { color: var(--text); }

.timeline { height: var(--timeline-h); flex: none; position: relative; z-index: 25; padding: 13px 24px 0; border-top: 2px solid var(--faint); background: var(--bg); }
.timeline-heading { display: flex; justify-content: space-between; color: var(--muted); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 8px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.timeline-heading span:nth-child(2) { color: rgba(238, 234, 227, .46); }
.timeline-track { --timeline-item-w: 100px; position: relative; height: 94px; margin-top: 8px; }
.track-line { position: absolute; left: 0; right: 0; top: 43px; height: 1px; background: var(--faint); }
.now-line { position: absolute; z-index: 3; left: 38%; top: 0; bottom: 4px; width: 2px; background: var(--tomato); }
.now-line span { position: absolute; top: 0; left: 0; transform: translate(-50%, -30%); padding: 0 5px; background: var(--bg); color: var(--tomato); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 8px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.timeline-item { position: absolute; top: 5px; width: var(--timeline-item-w); transform: translateX(-50%); border: 0; background: transparent; color: rgba(238, 234, 227, .85); text-align: center; cursor: pointer; opacity: .92; }
.timeline-item:hover, .timeline-item.selected { color: var(--amber); }
.timeline-item.past { opacity: .38; }
.timeline-item strong { display: block; font-family: "Instrument Sans", system-ui, sans-serif; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.timeline-item i { display: block; width: 1px; height: 12px; margin: 5px auto 0; background: currentColor; opacity: .32; }
.timeline-item b { display: block; width: 6px; height: 6px; margin: 0 auto; border-radius: 50%; background: currentColor; }
.timeline-item em { display: block; margin-top: 5px; color: currentColor; font-size: 9px; font-style: normal; font-weight: 500; font-variant-numeric: tabular-nums; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.location-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  border: 2px solid var(--faint);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .6);
}
.location-dialog::backdrop { background: oklch(.2 .04 154 / .72); backdrop-filter: blur(5px); }
.location-dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 25px; letter-spacing: -.03em; }
.location-dialog label { display: block; margin-bottom: 7px; color: rgba(238, 234, 227, .55); font-size: 11px; }
.location-search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.location-search-row input {
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(238, 234, 227, .16);
  border-radius: 9px;
  background: var(--map-bg);
  color: var(--text);
  font-size: 14px;
}
.search-button, .locate-button, .location-result {
  border: 1px solid rgba(238, 234, 227, .15);
  border-radius: 9px;
  background: transparent;
  color: rgba(238, 234, 227, .72);
  cursor: pointer;
}
.search-button { padding: 0 16px; background: var(--amber); border-color: var(--amber); color: var(--bg); font-weight: 600; }
.locate-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 40px; margin-top: 10px; font-size: 12px; }
.locate-button:hover, .location-result:hover { border-color: rgba(232, 180, 93, .45); color: var(--amber); }
.location-crosshair { width: 11px; height: 11px; border: 1px solid currentColor; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--bg); background: currentColor; }
.privacy-controls { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--faint); }
.location-dialog .remember-option { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--text); cursor: pointer; }
.remember-option input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--amber); }
.remember-option span { display: grid; gap: 2px; }
.remember-option strong { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 13px; }
.remember-option small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.forget-button { justify-self: start; padding: 3px 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.forget-button:hover:not(:disabled) { color: var(--amber); }
.forget-button:disabled { opacity: .35; cursor: default; }
.local-cache-note { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.location-status { min-height: 17px; margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.location-results { display: grid; gap: 7px; margin-top: 4px; }
.location-result { padding: 10px 12px; text-align: left; font-size: 12px; line-height: 1.35; }
.location-attribution { margin: 17px 0 0; color: rgba(238, 234, 227, .25); font-size: 8px; text-align: center; text-transform: uppercase; }

@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

@media (max-width: 1100px) {
  .place-clock, .place-separator, #location-label { display: none; }
}

@media (max-width: 900px) {
  :root { --header-h: 58px; --timeline-h: 150px; }
  .topbar { padding: 0 16px; grid-template-columns: auto 1fr auto; gap: 10px; }
  .place { min-height: 34px; padding: 3px; justify-self: end; }
  .place-action { min-height: 26px; padding: 0 7px; }
  .toolbar { justify-self: end; }
  .width-control { display: none; }
  .pill-button { width: 34px; padding: 0; justify-content: center; }
  .pill-button span { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }
  .flight-card, .today-card { right: 16px; width: 288px; }
  .zoom-controls { left: 16px; top: 16px; }
  .rotate-controls { left: 16px; top: 58px; }
  .today-card { display: none; }
  .home-marker { left: 50%; }
  .corridor { width: 55%; }
}

@media (max-width: 600px) {
  :root { --timeline-h: 132px; }
  .app-shell { min-height: 0; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand { font-size: 15px; }
  .place-action { width: 30px; padding: 0; justify-content: center; }
  .place-action > span { display: none; }
  .location-search-row input { font-size: 16px; }
  .map { overflow: hidden; }
  .flight-card {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-height: min(58vh, 340px);
    border-radius: 14px;
    box-shadow: 0 16px 40px oklch(.18 .04 154 / .34);
    transition: max-height .25s ease, opacity .2s, transform .2s;
  }
  .flight-card::before { content: ""; position: absolute; top: 6px; left: 50%; width: 32px; height: 3px; border-radius: 2px; background: rgba(238, 234, 227, .22); transform: translateX(-50%); }
  .flight-card:not(.expanded) { max-height: 96px; }
  .flight-card:not(.expanded) .flight-details { display: none; }
  .flight-card:not(.expanded) > p { overflow: hidden; margin-bottom: 10px; font-size: 12px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .flight-card h1 { margin-top: 2px; font-size: 24px; }
  .flight-card > .eyebrow-row { margin-top: 12px; }
  .flight-card.expanded { overflow-y: auto; overscroll-behavior: contain; }
  .card-toggle { display: flex; }
  .card-actions .icon-button { width: 32px; height: 32px; }
  .map.editing .flight-card { opacity: 0; transform: translateY(12px); pointer-events: none; }
  .flight-details dl { grid-template-columns: repeat(3, 1fr); }
  .flight-details dl div { padding: 9px 10px; }
  .flight-details dd { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .corridor { left: 42%; top: 42%; width: 70%; transform: translate(-50%, -50%) rotate(67deg); }
  .corridor-label { font-size: 7px; }
  .home-marker { top: 50%; }
  .map-scale, .map-credit { display: none; }
  .flight-path-legend { left: 12px; top: 100px; gap: 7px; padding: 6px 8px; font-size: 7px; }
  .flight-path-legend span::before { width: 12px; margin-right: 3px; }
  .edit-tip { bottom: 16px; width: calc(100% - 28px); font-size: 8px; text-align: center; }
  .timeline { padding-left: 14px; padding-right: 14px; overflow: hidden; }
  .timeline-track { --timeline-item-w: 74px; min-width: 680px; transform: translateX(-205px); }
  .timeline-heading { position: relative; z-index: 2; }
}

@media (max-height: 700px) {
  .app-shell { min-height: 0; }
}

@media (max-height: 700px) and (min-width: 601px) {
  :root { --timeline-h: 122px; }
  .timeline-track { height: 72px; }
  .flight-card { transform: scale(.9); transform-origin: top right; }
  .today-card { display: none; }
}

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
