/* tracker.css — departures picker, flight cards, pins, AeroDataBox, logos, inbound.
   From concept/live-air-traffic.html (lines 584–773). Linked from index.html in a fixed
   order that keeps the cascade identical to the concept. */
/* Departures picker */
.dep-picker {
  position: fixed; z-index: 1050; width: 380px; display: flex; flex-direction: column;
  max-height: calc(100vh - 110px - env(safe-area-inset-top, 0px)); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.dep-picker[hidden] { display: none; }
.dep-picker-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 8px 14px; }
.dep-picker-head > div { flex: 1; min-width: 0; }
.dep-picker-head h2 { margin: 0; font-size: 15px; }
.dep-picker-head .dim { font-size: 12px; }
.icon-btn { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.dep-tools { padding: 0 14px 8px; border-bottom: 1px solid var(--edge); }
.dep-tools[hidden] { display: none; }
.dep-tools .clearable { display: block; }
.dep-tools-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; }
.dep-list { flex: 1; min-height: 80px; overflow-y: auto; overscroll-behavior: contain; }
.dep-empty { padding: 18px 14px; font-size: 13px; color: var(--muted); }
.dep-note { padding: 8px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--edge); }
.dep-note.error { color: var(--bad); }
.dep-foot { padding: 0 14px; }
.dep-foot:not(:empty) { padding: 8px 14px 12px; border-top: 1px solid var(--edge); }
.dep-foot .dep-later { margin: 0; }
@media (max-width: 760px) {
  .dep-picker { left: 8px !important; right: 8px; top: calc(8px + env(safe-area-inset-top, 0px)) !important; width: auto; max-height: calc(100vh - 90px); }
}

/* Departures list */
.dep-head { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 12.5px; }
.dep-rows { margin-top: 6px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--edge); border-radius: 10px; }
.dep-row > .chip { font-size: 10.5px; padding: 1px 6px; }
.dep-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; text-align: left;
  background: transparent; color: var(--text); font-weight: 400; border-radius: 0; border-bottom: 1px solid rgba(150, 175, 210, 0.1);
}
.dep-row:last-child { border-bottom: 0; }
.dep-row:hover { background: rgba(124, 199, 255, 0.08); }
.dep-row.sel { background: rgba(124, 199, 255, 0.16); box-shadow: inset 3px 0 0 var(--accent); }
.dep-row.gone { opacity: 0.6; }
.dep-time { flex: none; width: 66px; white-space: nowrap; display: flex; flex-direction: column; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dep-time s { color: var(--muted); font-size: 11px; }
.dep-time .late { color: var(--bad); } .dep-time .early { color: #C4A7FF; }
.dep-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dep-flight { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.dep-flight .chip { font-size: 10px; padding: 0 5px; }
.dep-dest, .dep-extra { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-dest b { color: var(--text); }
.logo-chip.tiny { width: 44px; height: 16px; padding: 1px 3px; border-radius: 4px; }
.logo-chip.tiny.badge-logo { width: 16px; padding: 0; }
.dep-later { margin-top: 8px; width: 100%; font-size: 12.5px; padding: 6px 10px; }
.dep-later small { color: var(--muted); }

/* Flight card */
.fcard { margin-top: 10px; border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; background: rgba(255, 255, 255, 0.03); }
.fhead { display: flex; gap: 10px; align-items: center; }
.flogo { flex: none; width: 30px; height: 30px; border-radius: 6px; background: #fff; object-fit: contain; padding: 2px; box-sizing: border-box; }
.fhead .who { flex: 1; min-width: 0; }
.fname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.chip[data-kind="air"]    { color: var(--good); }
.chip[data-kind="landed"] { color: var(--accent); }
.chip[data-kind="idle"]   { color: var(--muted); }
.chip[data-kind="warn"]   { color: var(--warn); }
.chip[data-kind="late"]   { color: var(--bad); }
.chip[data-kind="early"]  { color: #C4A7FF; }
.chip[data-kind="ontime"] { color: #B9E57A; }
.chip[data-kind="est"]    { color: var(--warn); }
.chip[data-kind="alert"]  { color: #1A0B0E; background: var(--bad); border-color: var(--bad); }
.chips { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 70%; }

/* Clear (×) button inside text boxes */
.clearable { position: relative; display: block; flex: 1; min-width: 0; }
.clearable .text-in { padding-right: 32px; }
.clear-x {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--muted); border: 0; font-weight: 400;
}
.clear-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.clear-x[hidden] { display: none; }
.clear-x svg { width: 14px; height: 14px; fill: currentColor; }

/* Route progress graphic */
.rg { margin: 12px 0 2px; }
.rg-codes, .rg-places, .rg-meta { display: flex; justify-content: space-between; gap: 8px; }
.rg-codes { font-size: 17px; font-weight: 700; }
.rg-places { font-size: 11.5px; color: var(--muted); }
.rg-places span:last-child, .rg-meta span:last-child { text-align: right; }
.rg-track { position: relative; height: 20px; margin: 6px 4px 4px; }
.rg-line { position: absolute; left: 0; right: 0; top: 9px; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(150, 175, 210, 0.45) 0 6px, transparent 6px 11px); }
.rg-done { position: absolute; left: 0; top: 9px; height: 2px; background: var(--good); border-radius: 2px; }
.rg-end { position: absolute; top: 6px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--edge); background: var(--night); box-sizing: border-box; }
.rg-end.start { left: -4px; border-color: var(--good); background: var(--good); }
.rg-end.stop { right: -4px; }
.rg-end.stop.reached { border-color: var(--accent); background: var(--accent); }
.rg-plane { position: absolute; top: 0; width: 20px; height: 20px; margin-left: -10px; color: var(--good); filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8)); }
.rg-plane svg { width: 20px; height: 20px; transform: rotate(90deg); fill: currentColor; }
.rg-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rg-unknown { font-size: 12.5px; color: var(--muted); margin: 10px 0 2px; }

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fgrid span { display: block; font-size: 11px; color: var(--muted); }
.fnote { margin-top: 8px; font-size: 12px; color: var(--muted); }
.factions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.factions button { font-size: 12.5px; padding: 6px 10px; }
.pin-form { display: flex; gap: 6px; margin-top: 10px; }
.pin-form .text-in { flex: 1; font-size: 13px; }

/* Pinned flights */
.pins-head { margin: 14px 0 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.pins-head > span { flex: 1; }
.pins-head[hidden] { display: none; }
.linkish { background: none; border: 0; padding: 2px 0; color: var(--accent); font-size: 12px; font-weight: 400; cursor: pointer; }
.linkish:disabled { color: var(--muted); opacity: 0.6; cursor: default; }
.pins-foot { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.pins-foot:empty { display: none; }
.pin-chev { flex: none; width: 16px; height: 16px; fill: var(--muted); transition: transform 0.2s; }
details.pin[open] .pin-chev { transform: rotate(180deg); }
details.pin { margin-top: 8px; border: 1px solid var(--edge); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
details.pin > summary { list-style: none; cursor: pointer; padding: 9px 12px; }
details.pin > summary::-webkit-details-marker { display: none; }
details.pin[open] > summary { border-bottom: 1px solid var(--edge); }
.pin-top { display: flex; align-items: center; gap: 8px; }
.pin-top .fname { flex: 1; min-width: 0; }
.pin-top { align-items: flex-start; }
.pin-top .fname { padding-top: 1px; }
.mini { position: relative; height: 4px; margin: 7px 0 5px; border-radius: 2px; background: rgba(150, 175, 210, 0.2); overflow: hidden; }
.mini i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--good); border-radius: 2px; }
.pin-line { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.pin .fcard { margin: 0; border: 0; background: none; }

/* AeroDataBox: schedule table, photo, extras, usage meter */
.sched { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--edge); }
.sched-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sched-grid b { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.sched-grid .k { color: var(--muted); }
.ac-photo { margin: 10px 0 0; }
.ac-photo img { display: block; width: 100%; max-height: 150px; object-fit: cover; border-radius: 8px; background: rgba(255, 255, 255, 0.05); }
.ac-photo figcaption { margin-top: 4px; font-size: 11px; color: var(--muted); }
.ac-photo a { color: var(--accent); }
.extra { margin-top: 10px; font-size: 12.5px; }
.extra-h { font-weight: 700; margin-bottom: 3px; }
.extra ul { margin: 0; padding-left: 16px; }
.extra li { margin: 2px 0; }
.dim { color: var(--muted); }
.adb-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.adb-actions button { font-size: 12px; padding: 5px 9px; }
.adb-actions small { color: var(--muted); font-size: 10.5px; margin-left: 3px; }
.adb-status { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.adb-status.error { color: var(--bad); }
.adb-usage { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--edge); font-size: 12px; }
.adb-usage[hidden] { display: none; }
.adb-usage-top { display: flex; justify-content: space-between; gap: 8px; }
.adb-usage-note { font-size: 11px; color: var(--muted); }
.chip[data-kind="alert"] + .chip[data-kind="ontime"] { display: none; }

/* Airline logos (wordmarks on a white chip; lettered badge as fallback) */
.logo-chip { flex: none; display: block; width: 72px; height: 26px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 5px; box-sizing: border-box; }
.logo-chip.small { width: 58px; height: 21px; padding: 2px 4px; border-radius: 5px; }
.logo-chip.badge-logo { width: 26px; padding: 0; background: none; }
.logo-chip.small.badge-logo { width: 21px; }
#airline-list .logo-chip { width: 58px; height: 21px; padding: 2px 4px; }
#airline-list .logo-chip.badge-logo { width: 21px; padding: 0; }
#airline-list li { align-items: center; }
.chosen-logo { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; }
.chosen-logo:empty { display: none; }
.combo.with-logo .text-in { padding-left: 72px; }
.combo.with-logo .chosen-logo .badge-logo { margin-left: 0; }
.pop-head .logo-chip { width: 76px; height: 28px; }
.pop-head .logo-chip.badge-logo { width: 28px; }
.leaflet-popup-content .rg { margin: 10px 0 4px; }
.pop-track { width: 100%; font-size: 12.5px; padding: 7px 10px; }
.pop-btns { display: flex; gap: 8px; margin-top: 10px; }
.pop-btns .pop-track { flex: 1; width: auto; }

/* Card header: logo + name on one line, badges on the next */
.fhead { flex-wrap: wrap; row-gap: 6px; }
.fhead .chips { order: 3; flex-basis: 100%; max-width: 100%; justify-content: flex-start; }

/* Inbound aircraft */
.inbound { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--edge); font-size: 12.5px; }
.inbound .extra-h .dim { font-weight: 400; margin-left: 4px; }
.inbound-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.inbound-text[data-kind="air"] { color: var(--good); }
.inbound-text[data-kind="landed"] { color: var(--accent); }
.inbound-text[data-kind="warn"] { color: var(--warn); }
.inbound-btn { margin-top: 8px; font-size: 12.5px; padding: 6px 10px; }

