/* Live flight map (/local/ttn/). Large type and 44px+ tap targets, like the trail map. */
body { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 18px; line-height: 1.55; color: #1a1a1a; }
.tr-logo { height: 48px; width: auto; display: block; }
.ttn { max-width: 64rem; margin: 0 auto; }
.intro { margin: 0 0 1rem; max-width: 44rem; }
a { color: #203864; }
a:focus-visible, summary:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }

/* The map fills the screen; a strip below it stays free so phones can scroll past. */
.stage { position: relative; height: calc(100vh - 3rem); height: calc(100dvh - 3rem); min-height: 320px; }
.map { position: absolute; inset: 0; background: #e8e8e8; }
.more { display: flex; align-items: center; justify-content: center; min-height: 3rem; padding: .25rem 1rem; text-align: center; line-height: 1.3; background: #fff; border-bottom: 1px solid rgba(0,0,0,.1); font-weight: 600; text-decoration: none; gap: .4rem; }
.panel { position: absolute; z-index: 1000; top: .75rem; left: .75rem; width: 21rem; max-width: calc(100% - 4.5rem); max-height: calc(100% - 3rem); overflow-y: auto;
    background: rgba(255,255,255,.95); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: .6rem .8rem; }
.panel-head { display: flex; align-items: center; gap: .6rem; }
.panel .tr-logo { height: 36px; }
.panel h1 { font-size: 1.05rem; line-height: 1.25; font-weight: 600; margin: 0; }
.status { margin: .4rem 0 0; font-weight: 600; font-size: .9rem; line-height: 1.4; }
.status.delayed { color: #b42318; }
.color-by { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .25rem; border: 0; margin: .3rem 0 0; padding: 0; font-size: .9rem; }
.color-by legend { float: left; font-weight: 600; padding: 0; margin-right: .5rem; }
.color-by label { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: 0 .5rem 0 0; cursor: pointer; }
.color-by input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: #203864; }
.color-by input:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
.key { margin-top: 0; font-size: .9rem; }
/* The key toggles look like buttons, so it's clear on phones how to open them (owner 2026-11-18). */
.key-button { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; margin: .3rem 0; padding: 0 .8rem; list-style: none; cursor: pointer;
    font-weight: 600; color: #203864; background: #fff; border: 1.5px solid #203864; border-radius: 6px; }
.key-button::-webkit-details-marker { display: none; }
.key-button::after { content: ''; width: .45em; height: .45em; border-right: 2px solid; border-bottom: 2px solid; transform: translateY(-.15em) rotate(45deg); }
details[open] > .key-button::after { transform: translateY(.1em) rotate(-135deg); }
details[open] > .key-button .when-closed, details:not([open]) > .key-button .when-open { display: none; }
.key-button:hover { background: #eef1f7; }
.key-button:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
@media (max-width: 30em) {
    .panel { top: .5rem; left: .5rem; padding: .4rem .6rem; }
    .panel .tr-logo { height: 28px; }
    .panel h1 { font-size: .95rem; }
    .status { font-size: .85rem; }
    .color-by { font-size: .85rem; }
    .color-by legend { margin-right: .3rem; }
    .color-by label { padding-right: .2rem; gap: .25rem; }
}
.map-error { color: #b42318; font-weight: 600; }
.leaflet-container { font: inherit; }
.leaflet-tile-pane { filter: grayscale(1) contrast(.8) brightness(1.08); }
.leaflet-container a { color: #203864; }
.leaflet-control-attribution { font-size: .75rem; line-height: 1.4; }
@media (max-width: 30em) { .leaflet-control-attribution { font-size: .65rem; } }
.ttn-label { font-size: .85rem; font-weight: 600; }

/* Aircraft are colored by altitude (the bands and colors are in ttn.js). */
.plane { background: none; border: 0; }
.plane svg { display: block; stroke: #fff; stroke-width: 1.4; filter: drop-shadow(0 0 1px rgba(0,0,0,.9)) drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.plane .rotor { transform-box: view-box; transform-origin: 16px 13px; animation: rotor .6s linear infinite; }
.plane.parked .rotor { animation: none; }
@keyframes rotor { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .plane .rotor { animation: none; } }
.plane-tip { font-size: .95rem; line-height: 1.4; }
.plane.outside svg { opacity: .7; }
.list-icon { flex: none; vertical-align: middle; margin-right: .5rem; }
.field { background: none; border: 0; }
.field svg { display: block; }
.mini { stroke: #fff; stroke-width: 1.4; filter: drop-shadow(0 0 1px rgba(0,0,0,.9)); }
.mini.outside { opacity: .7; }
.field-tip { font-size: .9rem; }

.legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .75rem; }
.legend li { display: flex; align-items: center; gap: .4rem; line-height: 1.3; }
.legend .wide { grid-column: 1 / -1; }
.legend svg { flex: none; }
.legend-head { grid-column: 1 / -1; font-weight: 600; margin-top: .3rem; }

.fields-sub { font-size: 1.05rem; font-weight: 600; margin: 1rem 0 .4rem; }
.fields { list-style: none; padding: 0; margin: 0; }
.fields li { padding: .25rem 0; border-bottom: 1px solid rgba(0,0,0,.08); overflow-wrap: anywhere; }
@media (min-width: 40em) { .fields { columns: 2; column-gap: 2rem; } .fields li { break-inside: avoid; } }

.card { border: 1px solid rgba(0,0,0,.15); border-radius: 8px; background: #fff; margin: 1.5rem 0 1rem; padding: 1.25rem; }
.card h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 .5rem; }
.planes { list-style: none; padding: 0; margin: 0; }
.planes li { padding: .35rem 0; border-bottom: 1px solid rgba(0,0,0,.08); overflow-wrap: anywhere; }
.planes li:last-child { border-bottom: 0; }
.type { color: #444; }
.notes ul { margin: 0; padding-left: 1.25rem; }
.notes li { margin-bottom: .5rem; }

.pop { font-size: 1rem; line-height: 1.45; }
/* Popups get a 44px close button (owner 2026-11-18: the x was hard to tap). Aircraft popups
   let touches through to the map, so a phone can still pan with one open; only the x catches them. */
.leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 28px; line-height: 44px; color: #444; }
.leaflet-popup-content { margin-right: 40px; }
.plane-pop { pointer-events: none; }
.plane-pop .leaflet-popup-content-wrapper, .plane-pop .leaflet-popup-tip-container { pointer-events: none; }
.plane-pop .leaflet-popup-close-button { pointer-events: auto; }
.pop p { margin: 0 0 .4rem; }
.pop-name { font-weight: 700; font-size: 1.1rem; }

/* Sky view (static/ttn-sky.mjs): an overlay on the map, the sky drawn full size behind a small panel. */
.hint { margin: .2rem 0 0; font-size: .85rem; line-height: 1.35; color: #444; }
.sky-open { font: inherit; font-weight: 600; min-height: 44px; padding: .4rem 1rem; border: 0; border-radius: 6px; background: #203864; color: #fff; cursor: pointer; }
.sky-open:focus-visible, .sky-close:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
.sky { position: absolute; inset: 0; z-index: 1100; background: #f2f4f6; overflow: hidden; }
.sky[hidden] { display: none; }
.sky-view { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.sky-view:active { cursor: grabbing; }
.sky-view:focus-visible { outline: 3px solid #f2a900; outline-offset: -3px; }
.sky-view canvas { display: block; }
.sky-bar { position: absolute; top: .75rem; left: .75rem; width: 21rem; max-width: calc(100% - 1.5rem); max-height: calc(100% - 5rem); overflow-y: auto;
    background: rgba(255,255,255,.95); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: .6rem .8rem; font-size: .9rem; line-height: 1.4; }
.sky-title { font-size: 1.05rem; font-weight: 600; line-height: 1.25; margin: 0; }
.sky-where, .sky-count, .sky-status, .sky-help { margin: .3rem 0 0; }
.sky-where { color: #444; }
.sky-status:empty { display: none; }
.sky-status { color: #b42318; font-weight: 600; }
.sky-help { color: #444; }
.sky-legend { margin-top: .2rem; }
/* Follow the phone (TASK-31.9): a toggle; pressed, it fills in and gets a check mark. */
.sky-follow { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin: .3rem .5rem 0 0; padding: 0 .8rem; font: inherit; font-weight: 600;
    color: #203864; background: #fff; border: 1.5px solid #203864; border-radius: 6px; cursor: pointer; }
.sky-follow[hidden] { display: none; }
.sky-follow[aria-pressed="true"] { color: #fff; background: #203864; }
.sky-follow[aria-pressed="true"]::before { content: ''; width: .35em; height: .7em; border-right: 2px solid; border-bottom: 2px solid; transform: translateY(-.1em) rotate(45deg); }
.sky-follow:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
/* Following the phone, the sky fills the top of the screen, so the panel sits at the bottom, over the ground, above the close button. */
.sky.following .sky-bar { top: auto; bottom: calc(.75rem + 44px + .5rem); }
details[open] > .key-button .key-strip { display: none; }
.key-strip { display: inline-flex; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.key-strip span { width: 1.1rem; height: .6rem; }
.sky-color-by { margin: 0; }
.sky-close { position: absolute; right: .75rem; bottom: .75rem; font: inherit; font-weight: 600; min-height: 44px; padding: .4rem 1rem; border: 0; border-radius: 6px;
    background: #203864; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer; }
.sky-tip { position: absolute; left: 0; top: 0; max-width: min(18rem, calc(100% - 8px)); pointer-events: none; background: #fff; border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,.35); padding: .35rem .6rem; font-size: .9rem; line-height: 1.4; }
.sky-tip[hidden] { display: none; }
@media (max-width: 30em), (max-height: 40em) {
    .sky-bar { top: .5rem; left: .5rem; padding: .4rem .6rem; font-size: .8rem; max-height: 60%; }
    .sky-title { font-size: .95rem; }
    .sky-help { display: none; }
    .sky-close { right: .5rem; bottom: .5rem; }
    .sky.following .sky-bar { bottom: calc(.5rem + 44px + .5rem); }
}
