/* ============================================================
   Live features: experience panels, layers, inspector cards,
   dock and popovers. Builds on the tokens in styles.css.
   ============================================================ */

/* ---------- Experience blocks in the panel ---------- */
.xp { display: none; }
.xp.is-active { display: block; }
.panel-note { margin: 12px 2px 2px; font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.panel-note strong { color: var(--text-2); font-weight: 600; }
.body-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.body-note:empty { display: none; }
.sublabel { font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); margin: 12px 0 6px; }
.sublabel:first-child { margin-top: 2px; }

.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.searchrow { display: flex; gap: 6px; margin-bottom: 8px; }
.searchrow .input { flex: 1; min-width: 0; }
.searchrow .btn { flex-shrink: 0; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 2px 0 6px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.field label span { color: var(--text-2); font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; }

/* Range input */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 0 0 3px var(--accent-soft);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }

/* ---------- Small building blocks ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-2);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); white-space: nowrap;
}
.tag--good { color: var(--good); background: rgba(62, 207, 142, 0.12); border-color: rgba(62, 207, 142, 0.3); }

.livepill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: var(--text-2); background: rgba(255, 255, 255, 0.06); white-space: nowrap;
}
.livepill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.livepill.is-live { color: var(--good); background: rgba(62, 207, 142, 0.12); }
.livepill.is-live::before { background: var(--good); box-shadow: 0 0 8px var(--good); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 9px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.chip.is-on { color: var(--text); background: var(--accent-soft); border-color: var(--accent-line); }
.chip--static { cursor: default; height: 26px; font-weight: 500; }
.chip--static b { color: var(--text); font-weight: 650; }
.chip__sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stat-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 10px 11px; border-radius: 11px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); min-width: 0; }
.stat__v { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat__k { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-top: 3px; }

.callout {
  padding: 11px 12px; border-radius: 12px; font-size: 12px; line-height: 1.5;
  background: rgba(108, 173, 223, 0.08); border: 1px solid rgba(108, 173, 223, 0.22); color: var(--text-2);
}
.callout strong { color: var(--text); font-weight: 600; }
.callout--cta { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.callout--cta .btn { align-self: flex-start; }

.legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; font-size: 11px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend--dots { margin: 0 0 8px; }
.legend--dots i { border-radius: 50%; width: 8px; height: 8px; }

/* Switch */
.switch {
  position: relative; flex-shrink: 0; width: 32px; height: 19px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.is-on > .switch { background: var(--c, var(--accent)); }
.is-on > .switch::after { transform: translateX(13px); }

/* Toggle row: a label and a switch */
.toggles { display: flex; flex-direction: column; margin-top: 6px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 9px 2px; cursor: pointer; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent;
  color: var(--text); font-size: 12.5px;
}
.toggle:last-child { border-bottom: 0; }
.toggle:hover > span:first-child { color: #fff; }

/* Segmented control */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); }
.seg > button {
  flex: 1; min-width: 0; height: 30px; padding: 0 6px; cursor: pointer; white-space: nowrap;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.seg > button:hover { color: var(--text); }
.seg > button.is-on { background: rgba(255, 255, 255, 0.13); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.seg > button.seg__accent { color: var(--accent); }
.seg > button.seg__accent.is-on { background: var(--accent-soft); color: #fff; }
.seg--sm > button { height: 28px; font-size: 11.5px; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.list--tall { max-height: 340px; }
.list--flights { max-height: none; }
.list::-webkit-scrollbar { width: 5px; }
.list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 5px; }
.item {
  cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 9px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text);
  transition: background 0.12s, border-color 0.12s;
}
.item:hover { background: var(--hover); }
.item.is-selected { background: var(--accent-soft); border-color: var(--accent-line); }
.item.is-alert { border-color: rgba(255, 93, 108, 0.6); background: rgba(255, 93, 108, 0.12); }
.item__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04); }
.item__icon { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, 0.05); color: var(--text-2); }
.item__icon svg { width: 16px; height: 16px; }
.item__mag {
  flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 26px; border-radius: 8px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--c); background: rgba(255, 255, 255, 0.07); background: color-mix(in srgb, var(--c) 16%, transparent);
}
.item__main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.item__title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 1.35; }
.item__go { color: var(--accent); font-weight: 600; }
.empty { font-size: 12px; color: var(--text-3); text-align: center; padding: 14px 0; }

/* Mini bar chart */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12px; }
.bar__label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__value { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.bar__track { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 5px; background: var(--c, var(--accent)); box-shadow: 0 0 10px color-mix(in srgb, var(--c, var(--accent)) 50%, transparent); }

/* ---------- Layers ---------- */
.layers { display: flex; flex-direction: column; gap: 4px; }
.layer {
  border-radius: 13px; border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.layer.is-on { background: rgba(255, 255, 255, 0.035); border-color: var(--line); }
.layer__row {
  display: flex; align-items: center; gap: 11px; width: 100%; cursor: pointer; text-align: left;
  padding: 8px 10px 8px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--text);
  transition: background 0.15s;
}
.layer__row:hover { background: var(--hover); }
.layer__row--static { cursor: default; }
.layer__row--static:hover { background: transparent; }
.layer__icon {
  flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: var(--c); background: rgba(255, 255, 255, 0.06); background: color-mix(in srgb, var(--c) 13%, transparent);
  transition: background 0.2s, box-shadow 0.2s;
}
.layer__icon svg { width: 18px; height: 18px; }
.layer.is-on .layer__icon { background: color-mix(in srgb, var(--c) 24%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 30%, transparent); }
.layer__text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.layer__name { font-size: 13px; font-weight: 600; }
.layer__meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer.is-on .layer__meta { color: var(--text-2); }
.layer__body { padding: 4px 12px 12px 12px; animation: fadeIn 0.25s ease; }
.layer__body .list { max-height: 210px; }
.layer__body .callout { margin-top: 4px; }

/* City header row */
.cityhead { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.cityhead__count { font-size: 12px; color: var(--text-3); }
.cityhead .linkbtn { margin-left: auto; padding: 4px 8px; }
.cityhead .linkbtn[hidden] { display: none; }

/* Subway line bullets */
.bullet {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  font: 700 11px/1 Helvetica, Arial, sans-serif; vertical-align: middle;
}
.bullet--lg { width: 38px; height: 38px; font-size: 18px; }
.bullets { display: flex; flex-wrap: wrap; gap: 6px 9px; margin-bottom: 4px; }
.bullets__item { display: inline-flex; align-items: center; gap: 3px; }
.bullets__item small { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.kv__k .bullet { width: 18px; height: 18px; font-size: 10px; margin-right: 5px; }

/* Space station card (flights) */
.isscard {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 11px; margin-top: 14px; padding: 11px 11px 11px 10px;
  border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(77, 216, 255, 0.09), rgba(255, 255, 255, 0.02));
}
.isscard[hidden] { display: none; }
.toggles + .isscard { margin-top: 10px; }
.isscard__icon { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #4dd8ff; background: rgba(77, 216, 255, 0.14); }
.isscard__icon svg { width: 19px; height: 19px; }
.isscard__text { min-width: 0; display: contents; }
.isscard__title { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; min-width: 0; }
.isscard__stats { grid-column: 1 / -1; grid-row: 2; font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isscard .btn { grid-column: 3; grid-row: 1; }
.isscard__icon { grid-column: 1; grid-row: 1; }

/* Tour */
.tourhero { margin-top: 14px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.tourhero__row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tourhero__count { margin-left: auto; font-size: 12px; color: var(--text-3); }
.timeline { display: flex; flex-direction: column; }
.tstop {
  position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; cursor: pointer; text-align: left;
  padding: 8px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--text);
  transition: background 0.12s;
}
.tstop:hover { background: var(--hover); }
.tstop:not(:last-child)::before {
  content: ""; position: absolute; left: 18px; top: 34px; bottom: -6px; width: 1px; background: var(--line-2);
}
.tstop__num {
  position: relative; flex-shrink: 0; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: var(--text-2); background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent);
}
.tstop.is-selected .tstop__num { color: #0b0f17; background: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.tstop__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; padding-top: 2px; }
.tstop__title { font-size: 13px; font-weight: 600; }
.tstop__sub { font-size: 11.5px; color: var(--text-3); }
.tstop.is-selected .tstop__title { color: #fff; }

.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; align-items: center; font-size: 12px; }
.kbd-list kbd { justify-self: start; height: 20px; padding: 0 7px; font-size: 10.5px; color: var(--text); white-space: nowrap; }
.kbd-list span { color: var(--text-2); }

/* ---------- Inspector cards (right) ---------- */
.livestack {
  position: absolute; top: var(--panel-top); right: var(--gap); z-index: 24;
  width: 344px; max-height: calc(100% - var(--panel-top) - 104px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.livestack > * { pointer-events: auto; }
.livestack::-webkit-scrollbar { width: 0; }
.lcard { display: none; padding: 14px; border-radius: var(--r-xl); animation: cardIn 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
.lcard.show { display: block; }
@keyframes cardIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.lcard__media { position: relative; margin: -4px -4px 12px; }
.lcard__media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.lcard__credit { position: absolute; right: 8px; bottom: 7px; font-size: 10px; color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.lcard__head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; }
.lcard__icon {
  flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  color: var(--c); background: rgba(255, 255, 255, 0.06); background: color-mix(in srgb, var(--c) 18%, transparent);
}
.lcard__icon svg { width: 19px; height: 19px; }
.lcard__titles { flex: 1; min-width: 0; padding-top: 1px; }
.lcard__title { font-size: 16px; font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; word-break: break-word; }
.lcard__sub { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }
.lcard__close { margin: -4px -6px 0 0; width: 30px; height: 30px; }
.lcard__close svg { width: 15px; height: 15px; }
.lcard__label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); margin: 14px 0 7px; }
.lcard__text { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--text); }
.lcard__note { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--text-3); }
.lcard__note a, .kv__v a { color: var(--accent); text-decoration: none; }
.lcard__note a:hover, .kv__v a:hover { text-decoration: underline; }
.lcard__alert {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 11px; border-radius: 11px;
  background: rgba(255, 93, 108, 0.16); border: 1px solid rgba(255, 93, 108, 0.5); font-size: 12px; font-weight: 600;
}
.lcard__alert svg { width: 16px; height: 16px; flex-shrink: 0; color: #ff8f99; }
.lcard__actions { display: flex; gap: 7px; margin-top: 12px; }
.lcard__actions .btn { flex: 1; }
.lcard__more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.lcard__more summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; color: var(--text-2); }
.lcard__more summary::-webkit-details-marker { display: none; }
.lcard__more summary::after { content: "›"; display: inline-block; margin-left: 6px; transition: transform 0.2s; }
.lcard__more[open] summary::after { transform: rotate(90deg); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.metrics--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics--1 { grid-template-columns: 1fr; }
.metric { padding: 9px 10px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); min-width: 0; }
.metric__v { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric__k { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.route { margin: 14px 0 2px; }
.route__ends { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.route__names { display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.route__names span { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route__bar { position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); margin: 9px 0 7px; }
.route__fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #f5b041); }
.route__plane { position: absolute; top: 50%; width: 16px; height: 16px; transform: translate(-50%, -50%) rotate(90deg); color: #f5b041; }
.route__plane svg { width: 16px; height: 16px; fill: currentColor; }
.route__note { font-size: 10.5px; color: var(--text-3); }

.camfeed { position: relative; }
.camfeed img, .camfeed video { width: 100%; border-radius: 12px; display: block; background: #000; min-height: 120px; aspect-ratio: 16 / 9; object-fit: cover; }
.camfeed__live { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 3px 7px; border-radius: 6px; background: rgba(255, 40, 60, 0.9); color: #fff; }
.camfeed__err { font-size: 12px; color: var(--text-2); padding: 30px 10px; text-align: center; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }

.kvlist { margin-top: 8px; max-height: 260px; overflow-y: auto; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv__k { color: var(--text-3); flex: 0 0 auto; display: inline-flex; align-items: center; }
.kv__v { text-align: right; word-break: break-word; font-variant-numeric: tabular-nums; }

.facts { margin-top: 2px; }
.facts__score { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 12px; color: var(--text-2); }
.facts__score span { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 7px; color: #fff; font-weight: 700; }
.skeleton { height: 46px; border-radius: 11px; margin-bottom: 6px; background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton--short { height: 14px; width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Telemetry (bottom right, above the credit) ---------- */
.telemetry {
  position: absolute; right: var(--gap); bottom: calc(var(--gap) + 42px); z-index: 23;
  display: inline-flex; align-items: center; gap: 12px; height: 32px; padding: 0 13px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; color: var(--text); white-space: nowrap;
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.telemetry.show { opacity: 1; }
.telemetry__mode { font-family: var(--font); font-weight: 600; color: var(--accent); }
.telemetry__item { display: inline-flex; gap: 5px; font-variant-numeric: tabular-nums; }
.telemetry__item span { color: var(--text-3); }

/* ---------- Emergency banners (top centre) ---------- */
.alerts {
  position: absolute; top: calc(var(--gap) + var(--bar-h) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.alert {
  cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 13px;
  background: rgba(150, 10, 20, 0.88); border: 1px solid rgba(255, 120, 130, 0.8); color: #fff;
  font-size: 13px; box-shadow: 0 10px 34px rgba(150, 10, 20, 0.5); animation: alertPulse 1.4s ease-in-out infinite;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; }
.alert strong { letter-spacing: 1px; }
@keyframes alertPulse { 0%, 100% { box-shadow: 0 10px 34px rgba(150, 10, 20, 0.5); } 50% { box-shadow: 0 10px 44px rgba(255, 40, 60, 0.8); } }

/* ---------- Tour lower third ---------- */
.caption {
  position: absolute; bottom: calc(var(--gap) + 70px); left: 50%; z-index: 23;
  transform: translateX(-50%) translateY(14px);
  width: min(520px, calc(100vw - 2 * var(--gap))); padding: 14px 16px 0 18px; border-radius: var(--r-xl); overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.caption.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.caption__row { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; }
.caption__text { flex: 1; min-width: 0; }
.caption__kicker { font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--xp, #ff7a90); }
.caption__title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.caption__sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.caption__stop { flex-shrink: 0; }
.caption__bar { height: 3px; margin: 0 -16px 0 -18px; background: rgba(255, 255, 255, 0.08); }
.caption__fill { height: 100%; width: 0; background: linear-gradient(90deg, #ff7a90, #f5b041); transition: width 0.6s ease; }

/* ---------- Dock (bottom centre) ---------- */
.dock {
  position: absolute; bottom: var(--gap); left: 50%; z-index: 26;
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 16px;
  transform: translateX(-50%) translateY(10px); opacity: 0; pointer-events: none;
  transition: opacity 0.35s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.dock.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.dock__sep { width: 1px; height: 22px; margin: 0 4px; background: var(--line-2); }
.dock__btn {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  border: 0; border-radius: 11px; background: transparent; color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.dock__btn svg { width: 19px; height: 19px; }
.dock__btn:hover { background: var(--hover); color: var(--text); }
.dock__btn.is-open { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.dock__btn.is-on { background: var(--accent-soft); color: var(--accent); }
/* Tooltips */
.dock__btn[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(4px);
  padding: 5px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  font-size: 11.5px; font-weight: 500; color: var(--text); background: rgba(10, 14, 22, 0.95); border: 1px solid var(--line-2);
  opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.dock__btn[data-tip]:hover::after { opacity: 1; transform: translateX(-50%); transition-delay: 0.35s; }
.dock__btn.is-open::after { display: none; }

/* Popovers */
.pop {
  position: absolute; bottom: calc(100% + 12px); left: 50%; width: 344px; max-height: min(66vh, 600px); overflow-y: auto;
  padding: 14px; border-radius: var(--r-xl); background: var(--glass-strong);
  transform: translateX(-50%) translateY(8px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.pop.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.pop--wide { width: 392px; }
.pop::-webkit-scrollbar { width: 5px; }
.pop::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 5px; }
.pop__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pop__title { font-size: 14px; font-weight: 650; }
.pop__head .tag { margin-left: auto; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.pop__label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); margin: 14px 0 7px; }
.pop__note { margin: 8px 0 10px; font-size: 11.5px; line-height: 1.5; color: var(--text-2); }

.tabs { display: flex; gap: 2px; padding: 3px; margin-bottom: 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); }
.tab {
  flex: 1; height: 30px; cursor: pointer; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-2); font-size: 12.5px; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.is-on { background: rgba(255, 255, 255, 0.13); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.tabpane { display: none; }
.tabpane.is-on { display: block; animation: fadeIn 0.2s ease; }

/* Sky time */
.skytime { padding: 12px 14px; margin-bottom: 10px; border-radius: 13px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(255, 207, 90, 0.08), rgba(108, 173, 223, 0.06)); }
.skytime__clock { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.skytime__meta { font-size: 11.5px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.skytime__meta strong { color: var(--text); font-weight: 600; }

/* Weather presets */
.wxgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wxtile {
  display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer;
  padding: 10px 4px 8px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03); color: var(--text-2); font-size: 11px; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.wxtile svg { width: 26px; height: 26px; }
.wxtile:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.wxtile:active { transform: scale(0.97); }
.wxtile.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }

/* Map style tiles */
.styletiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.styletile {
  display: flex; flex-direction: column; gap: 2px; cursor: pointer; text-align: left;
  padding: 5px 5px 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.styletile:hover { background: rgba(255, 255, 255, 0.06); }
.styletile:active { transform: scale(0.98); }
.styletile.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.styletile__img { display: block; height: 54px; border-radius: 8px; margin-bottom: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.styletile__name { font-size: 11.5px; font-weight: 600; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.styletile__sub { font-size: 10px; color: var(--text-3); padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Little painted previews of each style */
.st-photoreal { background:
  linear-gradient(#5d6470, #5d6470) 10% 100% / 13% 52% no-repeat,
  linear-gradient(#7d7a70, #7d7a70) 28% 100% / 10% 80% no-repeat,
  linear-gradient(#4f5b66, #4f5b66) 45% 100% / 14% 40% no-repeat,
  linear-gradient(#8a8475, #8a8475) 64% 100% / 11% 92% no-repeat,
  linear-gradient(#5a6672, #5a6672) 84% 100% / 14% 58% no-repeat,
  linear-gradient(180deg, #8fb7dc 0%, #c9dcec 60%, #55684f 61%, #3f4f3d 100%); }
.st-photoreal-osm { background:
  linear-gradient(#eef2f7, #eef2f7) 10% 100% / 13% 52% no-repeat,
  linear-gradient(#cfd8e3, #cfd8e3) 28% 100% / 10% 80% no-repeat,
  linear-gradient(#eef2f7, #eef2f7) 45% 100% / 14% 40% no-repeat,
  linear-gradient(#cfd8e3, #cfd8e3) 64% 100% / 11% 92% no-repeat,
  linear-gradient(#eef2f7, #eef2f7) 84% 100% / 14% 58% no-repeat,
  linear-gradient(180deg, #8fb7dc 0%, #c9dcec 60%, #55684f 61%, #3f4f3d 100%); }
.st-classic { background:
  radial-gradient(ellipse at 30% 70%, #6b8f4e 0 30%, transparent 31%),
  radial-gradient(ellipse at 75% 40%, #8a7d5a 0 25%, transparent 26%),
  linear-gradient(160deg, #2c5d8a, #4f7f4a 60%, #8c7b56); }
.st-nyc { background:
  linear-gradient(#3b82f6, #3b82f6) 8% 100% / 11% 34% no-repeat,
  linear-gradient(#f59e0b, #f59e0b) 24% 100% / 10% 60% no-repeat,
  linear-gradient(#ef4444, #ef4444) 40% 100% / 12% 92% no-repeat,
  linear-gradient(#3b82f6, #3b82f6) 57% 100% / 10% 42% no-repeat,
  linear-gradient(#f59e0b, #f59e0b) 74% 100% / 11% 68% no-repeat,
  linear-gradient(#3b82f6, #3b82f6) 92% 100% / 10% 30% no-repeat,
  linear-gradient(180deg, #121826, #232c40); }
.st-roadmap { background:
  linear-gradient(35deg, transparent 46%, #f6c66b 46% 54%, transparent 54%),
  linear-gradient(-20deg, transparent 47%, #ffffff 47% 53%, transparent 53%),
  linear-gradient(90deg, transparent 60%, #ffffff 60% 64%, transparent 64%),
  linear-gradient(160deg, #e9e5dc, #d6e7d2 60%, #aad3df); }
.st-night { background:
  radial-gradient(1.5px 1.5px at 20% 40%, #ffd27a 50%, transparent 51%),
  radial-gradient(2px 2px at 45% 55%, #ffd27a 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 60% 35%, #ffe2a3 50%, transparent 51%),
  radial-gradient(2.5px 2.5px at 72% 62%, #ffc65a 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 85% 45%, #ffd27a 50%, transparent 51%),
  radial-gradient(1px 1px at 33% 70%, #ffe2a3 50%, transparent 51%),
  radial-gradient(ellipse at 50% 60%, rgba(255, 190, 90, 0.18), transparent 60%),
  linear-gradient(180deg, #050a1a, #0b1430); }

/* Quality list */
.qlist { display: flex; flex-direction: column; gap: 4px; }
.qrow {
  display: flex; align-items: center; gap: 11px; width: 100%; cursor: pointer; text-align: left;
  padding: 10px 11px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.qrow:hover { background: rgba(255, 255, 255, 0.06); }
.qrow.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.qrow__radio { flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-3); transition: border 0.15s; }
.qrow.is-on .qrow__radio { border: 5px solid var(--accent); }
.qrow__text { display: flex; flex-direction: column; line-height: 1.3; }
.qrow__name { font-size: 13px; font-weight: 600; }
.qrow__sub { font-size: 11px; color: var(--text-3); }

/* ---------- Medium screens ---------- */
@media (max-width: 1200px) {
  .telemetry { display: none; }
}
@media (max-width: 1080px) {
  .livestack { width: 320px; }
}

/* ---------- Phones ---------- */
@media (max-width: 768px) {
  /* Tools become a column on the right edge. */
  .dock { left: auto; right: var(--gap); bottom: auto; top: var(--panel-top); flex-direction: column; transform: translateX(10px); }
  .dock.show { transform: none; }
  .dock__sep { width: 22px; height: 1px; margin: 4px 0; }
  .dock__btn { width: 38px; height: 38px; }
  .dock__btn[data-tip]::after { display: none; }
  /* A backdrop filter would trap the fixed-position sheets below inside the dock. */
  .dock.glass { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(12, 16, 24, 0.9); }
  /* The tool column steps aside while the panel sheet is open. */
  .panel:not(.is-hidden) ~ .dock { opacity: 0; pointer-events: none; }
  /* Popovers become bottom sheets. */
  .pop, .pop--wide {
    position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-height: 72vh;
    transform: translateY(16px);
  }
  .pop.show { transform: none; }
  .livestack { position: fixed; top: auto; left: 8px; right: 8px; bottom: 84px; width: auto; max-height: 48vh; }
  .caption { bottom: auto; top: var(--panel-top); width: calc(100vw - 2 * var(--gap) - 52px); left: var(--gap); transform: translateY(-8px); }
  .caption.show { transform: none; }
  .caption__title { font-size: 17px; }
  .alerts { top: var(--panel-top); }
  .styletiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Airports (Live flights) ---------- */
.apcode {
  flex-shrink: 0; display: grid; place-items: center; min-width: 44px; height: 28px; padding: 0 6px; border-radius: 8px;
  font: 700 12px/1 var(--mono); letter-spacing: 0.05em; color: #ffd27a;
  background: rgba(255, 196, 77, 0.1); border: 1px solid rgba(255, 196, 77, 0.26);
}
.apcode--lg { min-width: 58px; height: 40px; font-size: 16px; border-radius: 11px; }
.aprow { display: flex; align-items: center; gap: 9px; padding: 6px 6px 6px 7px; border-radius: 10px; }
.aprow:hover { background: var(--hover); }
.aprow .iconbtn, .aprow .btn { flex-shrink: 0; }
.chips--codes { margin-top: 10px; }
.chips--codes .chip { height: 28px; padding: 0 9px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; }
.apboard {
  margin: 0 0 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 196, 77, 0.075), rgba(255, 255, 255, 0.02));
  animation: fadeIn 0.25s ease;
}
.apboard[hidden] { display: none; }
.apboard__head { display: flex; align-items: center; gap: 11px; }
.apboard__titles { flex: 1; min-width: 0; line-height: 1.3; }
.apboard__name { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apboard__sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apboard__status { display: flex; align-items: center; gap: 8px; margin: 11px 0 10px; min-width: 0; }
.apboard__text { min-width: 0; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apboard__actions { margin-top: 10px; }
.apnow { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(108, 173, 223, 0.08); border: 1px solid rgba(108, 173, 223, 0.22); }
.apnow__k { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.apnow__v { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.aplist { max-height: 196px; }
.apground { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }
.apground svg { flex-shrink: 0; width: 14px; height: 14px; }
.apground .linkbtn { margin-left: auto; padding: 3px 8px; }

/* Flight card: no published route */
.route--unknown { display: flex; flex-direction: column; gap: 6px; }
.route__likely { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.route__likely svg { flex-shrink: 0; width: 16px; height: 16px; color: #ffd27a; }
.route__likely strong { font-family: var(--mono); color: #ffd27a; }
