/* Bayline: New York, interface stylesheet (owner: ui; rules in nyc/notes/ui.md).
   One material (light dark glass), one accent (amber), a 4 px grid, system type. No external assets.
   The picture is the product: the chrome is quiet, sits at the edges and fades when idle. */

#ui {
  --tint: 13 16 22;
  --glass: rgb(var(--tint) / .48);
  --glass-solid: rgb(var(--tint) / .86);
  --line: rgb(255 255 255 / .12);
  --line-2: rgb(255 255 255 / .20);
  --fill: rgb(255 255 255 / .08);
  --fill-2: rgb(255 255 255 / .14);
  --fg: #f4f6f9;
  --fg-2: rgb(244 246 249 / .80);
  --fg-3: rgb(244 246 249 / .56);
  --accent: #f6b756;
  --accent-ink: #1d1404;
  --accent-soft: rgb(246 183 86 / .18);
  --good: #6fd08c;
  --shadow: 0 1px 0 rgb(255 255 255 / .06) inset, 0 4px 14px rgb(0 0 0 / .18);
  --text-shadow: 0 1px 2px rgb(0 0 0 / .45);
  --r-panel: 16px;
  --r-ctl: 10px;
  --ctl: 36px;                     /* control height; 44 px on touch / small screens */
  --gap: 12px;
  --edge: 16px;                    /* distance from the screen edge */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 140ms;
  --t: 260ms;
  --t-slow: 520ms;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --bar-h: 64px;                   /* desktop time bar */
  --top-h: 56px;
  position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden;
  color: var(--fg);
  font: 400 14px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
#ui *, #ui *::before, #ui *::after { box-sizing: border-box; }
#ui button, #ui input { font: inherit; color: inherit; }
#ui button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
#ui h2, #ui h3, #ui h4, #ui p { margin: 0; font-weight: inherit; }
#ui .ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
#ui :focus { outline: none; }
#ui :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (pointer: coarse), (max-width: 719px) { #ui { --ctl: 44px; } }
@media (max-width: 719px) { #ui { --edge: 10px; --gap: 10px; } }

/* ---------------------------------------------------------------- material */
#ui .glass {
  pointer-events: auto;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(.82);
  backdrop-filter: blur(22px) saturate(1.4) brightness(.82);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
  text-shadow: var(--text-shadow);
}
/* without blur (reduced transparency, or a browser without backdrop-filter) the glass is solid */
@media (prefers-reduced-transparency: reduce) {
  #ui .glass, #ui .sky::before { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #ui .glass, #ui .sky::before { background: rgb(var(--tint) / .78); }
}

/* whole-interface states: title, photo mode, tours, idle */
/* (each surface fades by itself: an opacity on the common parent made it the backdrop root of
   every glass panel and cost two 100 ms frames on the first fade at dpr 2) */
#ui .chrome { position: absolute; inset: 0; }
#ui .chrome > .hud, #ui .chrome > .dock, #ui .chrome > .sky, #ui .chrome > .pad { transition: opacity var(--t-slow) var(--ease); }
#ui.intro .chrome > *, #ui.photo .chrome > *, #ui.touring .chrome > *, #ui.idle .chrome > * { opacity: 0 !important; }
/* only the surfaces themselves and the few controls that turn pointer events back on: a rule on
   every descendant restyled the whole chrome on each switch (photo mode's first open, 50-67 ms) */
#ui.intro .chrome > *, #ui.photo .chrome > *, #ui.touring .chrome > *, #ui.idle .chrome > *,
#ui.intro .chrome .glass, #ui.photo .chrome .glass, #ui.touring .chrome .glass, #ui.idle .chrome .glass,
#ui.intro .chrome .pad *, #ui.photo .chrome .pad *, #ui.touring .chrome .pad *, #ui.idle .chrome .pad * { pointer-events: none !important; }

/* ---------------------------------------------------------------- controls */
#ui .lbl { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); }
#ui .btn, #ui .chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: var(--ctl); padding: 0 14px; border-radius: 999px; background: var(--fill); color: var(--fg);
  font-weight: 500; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
#ui .btn:active, #ui .chip:active, #ui .ibtn:active { transform: scale(.96); }
#ui .chip .ic { width: 18px; height: 18px; }
#ui .chip.on { background: rgb(255 255 255 / .22); color: var(--fg); font-weight: 600; }
#ui .btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; text-shadow: none; }
#ui .btn.quiet { background: none; color: var(--fg-2); }
#ui .ibtn {
  display: inline-grid; place-items: center; width: var(--ctl); height: var(--ctl); min-width: var(--ctl);
  border-radius: 50%; color: var(--fg); background: var(--fill); transition: background var(--t-fast), transform var(--t-fast);
}
#ui .ibtn.plain { background: none; color: var(--fg-2); }
#ui .ibtn.on { background: rgb(255 255 255 / .22); }
@media (hover: hover) {
  #ui .btn:hover, #ui .chip:hover, #ui .ibtn:hover { background: var(--fill-2); }
  #ui .chip.on:hover, #ui .ibtn.on:hover { background: rgb(255 255 255 / .28); }
  #ui .btn.primary:hover { background: #ffc66b; }
}
#ui .seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: calc(var(--r-ctl) + 2px); background: var(--fill); }
#ui .seg > button {
  min-height: calc(var(--ctl) - 6px); min-width: 44px; padding: 0 12px; border-radius: var(--r-ctl); color: var(--fg-2);
  font-weight: 500; transition: background var(--t-fast), color var(--t-fast);
}
#ui .seg > button.on { background: rgb(255 255 255 / .18); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
#ui .seg.tier > button.on { background: var(--accent); color: var(--accent-ink); text-shadow: none; }
#ui .seg.fill { display: flex; }
#ui .seg.fill > button { flex: 1; }
#ui .bullet {
  display: inline-grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; color: #fff; background: #777; line-height: 1; text-shadow: none;
}
#ui .bullet.dark { color: #111; }
#ui .bullet.lg { min-width: 30px; height: 30px; border-radius: 15px; font-size: 16px; padding: 0 7px; }
#ui .bullet.wide { border-radius: 6px; font-size: 11px; font-weight: 650; padding: 0 6px; }
#ui input[type=range] {
  -webkit-appearance: none; appearance: none; height: var(--ctl); background: none; margin: 0; flex: 1; min-width: 0; cursor: pointer; touch-action: pan-y;
}
#ui input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, rgb(255 255 255 / .75) var(--v, 50%), var(--fill-2) var(--v, 50%)); }
#ui input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill-2); }
#ui input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: rgb(255 255 255 / .75); }
#ui input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .5); }
#ui input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .5); }
#ui input[type=range]:focus-visible { outline: none; }
#ui input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
/* switches: neutral when on (amber is kept for the one current choice) */
#ui .switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: 13px; background: var(--fill-2); transition: background var(--t); }
#ui .switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgb(255 255 255 / .72); box-shadow: 0 1px 3px rgb(0 0 0 / .4); transition: transform var(--t) var(--ease), background var(--t); }
#ui .on > .switch, #ui .switch.on { background: rgb(255 255 255 / .34); }
#ui .on > .switch::after, #ui .switch.on::after { transform: translateX(18px); background: #fff; }

/* ---------------------------------------------------------------- top: HUD + dock */
#ui .hud {
  position: absolute; top: calc(var(--edge) + var(--sat)); left: calc(var(--edge) + var(--sal));
  display: flex; align-items: stretch; height: var(--top-h); max-width: calc(100% - 2 * var(--edge) - var(--sal) - var(--sar)); overflow: hidden;
}
#ui .hud .cell { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0 16px; text-align: left; min-width: 0; }
#ui .hud .cell + .cell { border-left: 1px solid var(--line); }
#ui .hud button.cell { transition: background var(--t-fast); }
@media (hover: hover) { #ui .hud button.cell:hover { background: var(--fill); } }
#ui .hud .t1 { font-size: 16px; font-weight: 620; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: baseline; gap: 4px; }
#ui .hud .t1 small { font-size: 11px; font-weight: 600; color: var(--fg-2); letter-spacing: .04em; }
#ui .hud .t2 { font-size: 12px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
#ui .hud .t2 .ic { width: 15px; height: 15px; color: var(--fg); }
#ui .hud .c-time .t1 { font-size: 19px; font-weight: 640; }
#ui .hud .c-place { flex: 1 1 auto; max-width: 300px; }
#ui .hud .c-place .t1, #ui .hud .c-place .t2 { display: block; }
/* height and speed only when asked for (Settings, Flight data) */
#ui .hud .c-flight { min-width: 96px; display: none; }
#ui.flight .hud .c-flight { display: flex; }
#ui.following .hud .c-mode { display: none; }

#ui .dock {
  position: absolute; top: calc(var(--edge) + var(--sat)); right: calc(var(--edge) + var(--sar));
  display: flex; align-items: center; gap: 2px; height: var(--top-h); padding: 0 6px;
}
#ui .dock button {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; color: var(--fg-2);
  font-weight: 500; transition: background var(--t-fast), color var(--t-fast);
}
#ui .dock button .k { font-size: 11px; color: var(--fg-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; line-height: 16px; margin-left: 2px; }
#ui .dock button.on { color: var(--accent); background: var(--accent-soft); }
#ui .dock .snd { padding: 0 12px; }
#ui .dock .snd.off { color: var(--fg-3); }
@media (hover: hover) { #ui .dock button:hover { color: var(--fg); background: var(--fill); } #ui .dock button.on:hover { color: var(--accent); background: var(--accent-soft); } }

@media (min-width: 720px) and (max-width: 1139px) {
  #ui .dock button > span:not([data-id]) { display: none; }
  #ui .dock button { padding: 0 13px; }
  #ui .hud { max-width: calc(100% - 3 * var(--edge) - 270px); }
}
@media (min-width: 1140px) { #ui .hud { max-width: calc(100% - 3 * var(--edge) - 560px); } }

/* performance read-out (outside the fading chrome; click for more) */
#ui .perf {
  position: absolute; top: calc(var(--edge) + var(--sat) + var(--top-h) + var(--gap)); left: calc(var(--edge) + var(--sal));
  padding: 9px 13px; border-radius: 12px; font: 500 11.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--fg-2); max-width: min(calc(100% - 2 * var(--edge)), 620px); display: none; cursor: pointer;
}
#ui .perf b { color: var(--fg); font-weight: 600; }
#ui .perf div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .perf .wrapl { white-space: normal; overflow-wrap: anywhere; margin-top: 4px; }
#ui .perf .hintl { color: var(--fg-3); font-size: 10.5px; margin-top: 2px; }
#ui.show-perf .perf { display: block; }
#ui.idle.show-perf .perf { opacity: .75; }

/* ---------------------------------------------------------------- panels */
#ui .panel {
  position: absolute; display: flex; flex-direction: column; min-height: 0; overflow: hidden; contain: layout paint style;
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.985); transform-origin: 50% 0;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t);
}
#ui .panel.open { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s; }
#ui .panel > header { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px 18px; flex: none; }
#ui .panel > header h2 { font-size: 16px; font-weight: 640; flex: 1; letter-spacing: -.005em; }
#ui .panel .body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 4px 18px 28px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
/* scrollable bodies fade out at the bottom instead of a hard cut */
#ui .fadebottom { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
#ui .panel .sec { padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
#ui .panel .sec:first-child { padding-top: 4px; }
#ui .panel .row { display: flex; align-items: center; gap: 12px; min-height: var(--ctl); }
#ui .panel .row > .grow { flex: 1; min-width: 0; }
#ui .panel .row .sub { display: block; font-size: 12px; color: var(--fg-3); margin-top: 1px; }
#ui .panel .row .val { color: var(--fg-2); min-width: 46px; text-align: right; }
#ui .panel .row .lab { width: 108px; flex: none; }
#ui .panel .row.tog { width: 100%; text-align: left; padding: 4px 0; }
#ui .panel .wrap { display: flex; flex-wrap: wrap; gap: 8px; }
#ui .note { font-size: 12px; color: var(--fg-3); line-height: 1.45; }
#ui .adv { border-top: 1px solid var(--line); margin-top: 4px; }
#ui .adv summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: var(--ctl); cursor: pointer; color: var(--fg-2); }
#ui .adv summary::-webkit-details-marker { display: none; }
#ui .adv summary .ic { width: 16px; height: 16px; transition: transform var(--t) var(--ease); }
#ui .adv[open] summary .ic { transform: rotate(180deg); }

@media (min-width: 720px) {
  #ui .p-go, #ui .p-set, #ui .p-map { top: calc(var(--edge) + var(--sat) + var(--top-h) + var(--gap)); max-height: calc(100% - 2 * var(--edge) - var(--top-h) - var(--bar-h) - 2 * var(--gap) - var(--sat) - var(--sab)); }
  #ui .p-go { left: calc(var(--edge) + var(--sal)); width: 384px; }
  #ui.has-ctx .p-go { max-height: calc(100% - 2 * var(--edge) - var(--top-h) - var(--bar-h) - 3 * var(--gap) - var(--ctx-h, 150px)); }
  #ui .p-set { right: calc(var(--edge) + var(--sar)); width: 384px; }
  #ui .p-map { right: calc(var(--edge) + var(--sar)); width: min(620px, 48vw); height: 100%; }
}
@media (max-width: 719px) {
  #ui .panel:not(.sky) {
    left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); bottom: calc(var(--edge) + var(--sab) + 56px + 8px);
    max-height: min(64%, 560px); border-radius: 20px; transform: translateY(24px); transform-origin: 50% 100%;
  }
  #ui .panel:not(.sky).open { transform: none; }
  #ui .p-map { height: 64%; }
}

/* ---------------------------------------------------------------- go to */
#ui .field { display: flex; align-items: center; gap: 10px; height: 46px; margin: 14px 14px 6px; padding: 0 14px; border-radius: 12px; background: var(--fill); border: 1px solid transparent; transition: border-color var(--t-fast), background var(--t-fast); flex: none; }
#ui .field:focus-within { border-color: rgb(246 183 86 / .6); background: var(--fill-2); }
#ui .field .ic { color: var(--fg-3); }
#ui .field input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; font-size: 16px; user-select: text; -webkit-user-select: text; text-shadow: none; }
#ui .field input::placeholder { color: var(--fg-3); }
#ui .field input:focus-visible { outline: none; }
#ui .field input::-webkit-search-cancel-button { display: none; }
#ui .field .k { font-size: 11px; color: var(--fg-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 6px; line-height: 18px; }
#ui .list { display: flex; flex-direction: column; padding: 2px 8px 28px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; touch-action: pan-y; }
#ui .list .head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 6px; }
#ui .item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px; border-radius: 12px; text-align: left; width: 100%; transition: background var(--t-fast); flex: none; }
#ui .item .ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--fill); color: var(--fg-2); }
#ui .item .txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
#ui .item .n { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .item .s { font-size: 12px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .item .meta { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
#ui .item .meta .ic { width: 16px; height: 16px; }
#ui .item.sel { background: var(--fill-2); }
#ui .item.sel .ico { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) { #ui .item:hover { background: var(--fill); } #ui .item.sel:hover { background: var(--fill-2); } }
#ui .item .num { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--fill); color: var(--fg-2); font-weight: 600; font-size: 13px; }
#ui .item .num .ic { width: 18px; height: 18px; }
#ui .item.cur .num { background: var(--accent); color: var(--accent-ink); }
#ui .empty { padding: 28px 18px 30px; text-align: center; color: var(--fg-2); }
#ui .empty b { display: block; color: var(--fg); font-weight: 600; margin-bottom: 4px; }

/* ---------------------------------------------------------------- time and sky */
#ui .sky { position: absolute; display: flex; flex-direction: column; isolation: isolate; background: none; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* the glass is a layer of its own, so the bar can fold to a line without repainting */
#ui .sky::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(.82); backdrop-filter: blur(22px) saturate(1.4) brightness(.82); border: 1px solid var(--line); box-shadow: var(--shadow); transition: opacity var(--t) var(--ease); }
#ui .sky .sky-bar { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: var(--bar-h); flex: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
#ui .scrub { position: relative; flex: 1; min-width: 120px; height: 50px; touch-action: none; cursor: pointer; }
#ui .scrub .track { position: absolute; left: 0; right: 0; top: 17px; height: 6px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(255 255 255 / .10); }
#ui .scrub .tick { position: absolute; top: 11px; width: 2px; height: 18px; margin-left: -1px; border-radius: 1px; background: rgb(255 255 255 / .7); box-shadow: 0 0 0 1px rgb(0 0 0 / .25); }
#ui .scrub .thumb { position: absolute; top: 9px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgb(246 183 86 / 0), 0 2px 8px rgb(0 0 0 / .45); transition: box-shadow var(--t-fast), transform var(--t-fast); }
#ui .scrub.drag .thumb, #ui .scrub:focus-visible .thumb { box-shadow: 0 0 0 5px rgb(246 183 86 / .45), 0 2px 8px rgb(0 0 0 / .45); transform: scale(1.08); }
#ui .scrub:focus-visible { outline: none; }
#ui .scrub .hours { position: absolute; left: 0; right: 0; top: 35px; height: 14px; font-size: 10.5px; color: var(--fg-3); font-weight: 500; }
#ui .scrub .hours span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
#ui .scrub .hours span:first-child { transform: none; }
#ui .scrub .hours span:last-child { transform: translateX(-100%); }
#ui .scrub .bubble { position: absolute; top: -26px; transform: translateX(-50%); padding: 3px 9px; border-radius: 8px; background: var(--glass-solid); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity var(--t-fast); pointer-events: none; }
#ui .scrub.drag .bubble { opacity: 1; }
#ui .sky .sky-more { display: flex; flex-direction: column; gap: 6px; padding: 0 18px; overflow: hidden; max-height: 0; opacity: 0; visibility: hidden; transition: opacity var(--t) var(--ease), visibility 0s linear var(--t); }
#ui .sky.open .sky-more { max-height: none; opacity: 1; visibility: visible; padding: 14px 18px 6px; transition: opacity var(--t) var(--ease), visibility 0s; }
#ui .sky .srow { display: flex; align-items: center; gap: 12px; min-height: calc(var(--ctl) + 8px); }
#ui .sky .srow > .lbl { width: 64px; flex: none; }
#ui .sky .srow .wrap { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
#ui .sky .srow .side { margin-left: auto; font-size: 12px; color: var(--fg-2); white-space: nowrap; }
#ui .datebox { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl); padding: 0 14px; border-radius: 999px; background: var(--fill); font-weight: 500; white-space: nowrap; cursor: pointer; }
#ui .datebox input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
#ui .datebox input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
#ui .sky .more .ic { transition: transform var(--t) var(--ease); }
#ui .sky.open .more .ic { transform: rotate(180deg); }
#ui .sky .clock { font-size: 15px; font-weight: 620; min-width: 74px; text-align: center; white-space: nowrap; }
/* the idle time bar: a thin line with the hour on it; it opens under the pointer or the keyboard */
#ui .tline { position: absolute; left: 22px; right: 22px; bottom: 10px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / .30); box-shadow: 0 1px 3px rgb(0 0 0 / .35); opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease); }
#ui .tline i { position: absolute; top: -3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .45); }
@media (min-width: 720px) {
  #ui .sky { left: 50%; bottom: calc(var(--edge) + var(--sab)); width: min(820px, calc(100% - 2 * var(--edge))); transform: translateX(-50%); }
  #ui .sky .clock { display: none; }
}
@media (min-width: 720px) and (hover: hover) {
  #ui .sky:not(:hover):not(:focus-within):not(.open)::before { opacity: 0; }
  #ui .sky:not(:hover):not(:focus-within):not(.open) .sky-bar { opacity: 0; transform: translateY(6px); }
  #ui .sky:not(:hover):not(:focus-within):not(.open) .tline { opacity: 1; }
}
@media (min-width: 720px) and (max-width: 1023px) { #ui .sky .seg.speed > button { min-width: 36px; padding: 0 8px; } }
@media (max-width: 719px) {
  #ui .sky { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); bottom: calc(var(--edge) + var(--sab) + 56px + 8px); border-radius: 20px;
    opacity: 0; visibility: hidden; transform: translateY(24px); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t); max-height: 78%; overflow-y: auto; }
  #ui .sky.open { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s; }
  #ui .sky .sky-more, #ui .sky.open .sky-more { max-height: none; opacity: 1; visibility: visible; padding: 4px 14px 16px; order: 2; overflow: visible; flex: none; }
  #ui .sky .sky-bar { flex-wrap: wrap; height: auto; padding: 22px 14px 6px; gap: 10px; order: 1; }
  #ui .sky .scrub { flex: 1 0 100%; order: -1; }
  #ui .sky .more, #ui .sky .tline { display: none; }
  #ui .sky .clock { flex: 1; text-align: left; font-size: 17px; }
  #ui .sky .srow { flex: none; flex-wrap: wrap; gap: 8px 12px; padding-top: 14px; }
  #ui .sky .srow > .lbl { width: auto; flex: 1; order: -2; }
  #ui .sky .srow .side { margin-left: 0; order: -1; }
  #ui .sky .srow .wrap { flex: 1 0 100%; }
}

/* ---------------------------------------------------------------- transit map */
#ui .p-map .filters { display: flex; gap: 6px; padding: 2px 14px 10px; overflow-x: auto; flex: none; scrollbar-width: none; touch-action: pan-x; }
#ui .p-map .filters::-webkit-scrollbar { display: none; }
#ui .p-map .filters .chip { padding: 0 12px; gap: 6px; font-size: 13px; }
#ui .p-map .filters .chip:not(.on) { color: var(--fg-3); background: var(--fill); font-weight: 500; }
#ui .p-map .filters .chip.on { background: var(--fill-2); color: var(--fg); font-weight: 550; }
#ui .p-map .filters .chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
#ui .p-map .filters .chip.on .dot { background: var(--accent); }
#ui .live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--fg-2); white-space: nowrap; }
/* the pulse animates only transform and opacity of its own layer: a box-shadow animation here
   repainted the whole panel, map included, every frame (60 -> 17 fps on a T4) */
#ui .live i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
#ui .live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); opacity: 0; will-change: transform, opacity; animation: ui-pulse 2.4s ease-out infinite; }
#ui .live.paused i { background: var(--fg-3); }
#ui .live.paused i::after { animation: none; }
@keyframes ui-pulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(3.2); opacity: 0; } }
#ui .mapbox { position: relative; flex: 1; min-height: 180px; margin: 0 8px; border-radius: 12px; overflow: hidden; background: #080b11; touch-action: none; cursor: grab; border: 1px solid var(--line); text-shadow: none; }
#ui .mapbox.drag { cursor: grabbing; }
#ui .mapbox > svg, #ui .mapbox > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ui .mapbox > canvas, #ui .mapbox > .maplab { pointer-events: none; }
/* the network is heavy to rasterise: its own layer, moved on the compositor while panning (map.rs) */
#ui .mapbox { contain: layout paint; isolation: isolate; }
#ui .mapbox > .mapnet { transform-origin: 0 0; will-change: transform; }
#ui .mapbox > .maplab { transition: opacity 160ms ease; }
#ui .mapbox .land path { fill: #222b37; stroke: #33404f; stroke-width: 1; vector-effect: non-scaling-stroke; }
#ui .mapbox .rt { fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: opacity var(--t); }
#ui .mapbox .rt.c1 { stroke-width: 2.2; }
#ui .mapbox .rt.c4 { stroke-width: 1.6; stroke-dasharray: 5 5; }
#ui .mapbox .rt.c3 { stroke-width: 1.2; opacity: .8; }
#ui .mapbox.z0 .rt { stroke-width: 1.8; }
#ui .mapbox .dim .rt { opacity: .16; }
#ui .mapbox .dim .rt.hi { opacity: 1; stroke-width: 4; }
#ui .mapbox .st { stroke: #f4f6f9; stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#ui .mapbox .sto { stroke: #080b11; stroke-width: 8.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#ui .mapbox.z0 .st { stroke-width: 2; } #ui .mapbox.z0 .sto { stroke-width: 0; }
#ui .mapbox.z0 .st.min, #ui .mapbox.z0 .sto.min { display: none; }
#ui .mapbox.z1 .st { stroke-width: 2.6; } #ui .mapbox.z1 .sto { stroke-width: 5; }
#ui .mapbox.z1 .st.maj { stroke-width: 3.6; } #ui .mapbox.z1 .sto.maj { stroke-width: 6.5; }
#ui .mapbox .hide { display: none; }
#ui .mapbox .lab { font-size: 11px; font-weight: 550; fill: #eef1f5; paint-order: stroke; stroke: rgb(9 12 18 / .92); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
#ui .mapbox .lab.big { font-size: 12px; font-weight: 650; }
#ui .mapbox .lab.area { font-size: 11px; font-weight: 600; letter-spacing: .14em; fill: rgb(244 246 249 / .32); stroke: none; text-transform: uppercase; }
#ui .mapbtns { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
#ui .mapbtns .ibtn { background: var(--glass-solid); border: 1px solid var(--line); border-radius: 12px; }
#ui .mapfoot { flex: none; padding: 6px 16px 10px; font-size: 10.5px; color: var(--fg-3); }
#ui .board { flex: 0 1 auto; min-height: 0; max-height: 46%; overflow-y: auto; border-top: 1px solid var(--line); padding: 12px 14px 14px; display: none; scrollbar-width: thin; touch-action: pan-y; }
#ui .board.open { display: block; }
#ui .board .bh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#ui .board .bh .nm { flex: 1; min-width: 0; }
#ui .board .bh h3 { font-size: 16px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .board .bh .bl { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
#ui .dep { display: flex; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid var(--line); }
#ui .dep:first-of-type { border-top: 0; }
#ui .dep .to { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .dep .eta { font-weight: 620; white-space: nowrap; min-width: 54px; text-align: right; }
#ui .dep .eta.soon { color: var(--accent); }
#ui .dep .at { color: var(--fg-3); font-size: 12px; min-width: 62px; text-align: right; white-space: nowrap; }

/* ---------------------------------------------------------------- selection / ride card */
#ui .ctx { position: absolute; padding: 14px; display: flex; flex-direction: column; gap: 12px;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t); }
#ui .ctx.open { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s; }
#ui .ctx .hd { display: flex; align-items: center; gap: 12px; }
#ui .ctx .hd .ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--fill); color: var(--fg-2); }
#ui .ctx .hd .txt { flex: 1; min-width: 0; }
#ui .ctx .hd .n { font-size: 16px; font-weight: 640; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#ui .ctx .hd .s { font-size: 12.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
#ui .ctx .acts { display: flex; gap: 8px; }
#ui .ctx .acts .btn { flex: 1; }
#ui .ctx .ride { display: none; flex-direction: column; gap: 12px; }
#ui .ctx.riding .ride { display: flex; }
#ui .ctx.riding .acts { display: none; }
#ui .ctx.nostrip .strip { display: none; }
#ui .ctx .seg > button { min-width: 0; padding: 0 8px; }
#ui .strip { position: relative; height: 58px; margin: 0 4px; text-shadow: none; }
#ui .strip .ln { position: absolute; left: 0; right: 0; top: 9px; height: 6px; border-radius: 3px; background: var(--rc, #888); }
#ui .strip .stp { position: absolute; top: 0; width: 0; }
#ui .strip .stp i { position: absolute; left: -7px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--rc, #888); }
#ui .strip .stp.past i { background: var(--rc, #888); border-color: var(--rc, #888); opacity: .55; left: -5px; top: 7px; width: 10px; height: 10px; }
#ui .strip .stp.next i { box-shadow: 0 0 0 4px rgb(255 255 255 / .22); }
#ui .strip .stp span { position: absolute; top: 26px; left: -4px; width: 80px; font-size: 11px; line-height: 1.25; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#ui .strip .stp.next span { color: var(--fg); font-weight: 620; }
#ui .strip .stp.past span { color: var(--fg-3); }
/* between the next stop and the terminal: the line breaks (stops left out) */
#ui .strip .gap { position: absolute; top: 9px; width: 44px; height: 6px; margin-left: -22px; background: repeating-linear-gradient(90deg, var(--rc, #888) 0 6px, transparent 6px 11px); opacity: .75; }
#ui .strip .stp.end span { left: auto; right: -4px; text-align: right; width: 120px; }
#ui .strip .stp.end i { border-radius: 4px; }
#ui .strip .veh { position: absolute; top: 3px; width: 18px; height: 18px; margin-left: -9px; border-radius: 6px; background: var(--accent); border: 2px solid var(--accent-ink); }
@media (min-width: 720px) {
  #ui .ctx { left: calc(var(--edge) + var(--sal)); bottom: calc(var(--edge) + var(--sab) + var(--bar-h) + var(--gap)); width: 384px; }
}
@media (max-width: 719px) {
  #ui .ctx { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); top: calc(var(--edge) + var(--sat) + var(--top-h) + 8px); transform: translateY(-10px); }
}

/* ---------------------------------------------------------------- touch controls */
#ui .pad { display: none; transition: opacity var(--t-slow) var(--ease); }
#ui.touch .pad { display: block; }
#ui.touch.panel-open .pad, #ui.touch.following .pad, #ui.touch.padidle .pad { opacity: 0; }
#ui.touch.panel-open .pad *, #ui.touch.following .pad * { pointer-events: none; }
#ui .stick { position: absolute; left: calc(18px + var(--sal)); bottom: calc(var(--edge) + var(--sab) + 56px + 22px); width: 96px; height: 96px; border-radius: 50%; touch-action: none; pointer-events: auto;
  background: rgb(var(--tint) / .26); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#ui .stick .knob, #ui .lift .knob { background: rgb(255 255 255 / .28); border: 1px solid rgb(255 255 255 / .55); box-shadow: 0 2px 8px rgb(0 0 0 / .3); }
#ui .stick .knob { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; transition: transform 160ms var(--ease), background var(--t-fast); }
#ui .stick.drag .knob, #ui .lift.drag .knob { transition: none; background: #fff; }
#ui .stick .arr { position: absolute; inset: 0; color: var(--fg-3); pointer-events: none; }
#ui .stick .arr .ic { position: absolute; width: 12px; height: 12px; }
#ui .stick .arr .ic:nth-child(1) { left: 50%; top: 5px; margin-left: -6px; }
#ui .stick .arr .ic:nth-child(2) { left: 50%; bottom: 5px; margin-left: -6px; }
#ui .stick .arr .ic:nth-child(3) { left: 5px; top: 50%; margin-top: -6px; }
#ui .stick .arr .ic:nth-child(4) { right: 5px; top: 50%; margin-top: -6px; }
#ui .lift { position: absolute; right: calc(18px + var(--sar)); bottom: calc(var(--edge) + var(--sab) + 56px + 22px); width: 46px; height: 132px; border-radius: 23px; touch-action: none; pointer-events: auto;
  background: rgb(var(--tint) / .26); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--fg-3); }
#ui .lift .ic { position: absolute; left: 50%; margin-left: -7px; width: 14px; height: 14px; }
#ui .lift .ic:first-of-type { top: 8px; } #ui .lift .ic:last-of-type { bottom: 8px; }
#ui .lift .knob { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; transition: transform 160ms var(--ease), background var(--t-fast); }
#ui .modes { position: absolute; right: calc(18px + var(--sar)); bottom: calc(var(--edge) + var(--sab) + 56px + 22px + 132px + 10px); display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
#ui .modes .ibtn { width: 46px; height: 46px; background: rgb(var(--tint) / .4); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#ui .modes .ibtn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
@media (min-width: 720px) {
  #ui .stick, #ui .lift { bottom: calc(var(--edge) + var(--sab) + var(--bar-h) + 22px); }
  #ui .modes { bottom: calc(var(--edge) + var(--sab) + var(--bar-h) + 22px + 132px + 10px); }
  #ui.touch.has-ctx .stick { bottom: calc(var(--edge) + var(--sab) + var(--bar-h) + 34px + var(--ctx-h, 150px)); }
}
/* walk / fly pair inside the HUD on pointer devices */
#ui .hud .c-mode { flex-direction: row; align-items: center; gap: 4px; padding: 0 8px; }
#ui .hud .c-mode .ibtn { width: 40px; height: 40px; min-width: 40px; background: none; color: var(--fg-2); border-radius: 10px; }
#ui .hud .c-mode .ibtn.on { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) { #ui .hud .c-mode .ibtn:hover { background: var(--fill); color: var(--fg); } }
#ui.touch .hud .c-mode { display: none; }

/* phone: bottom tab bar, compact HUD */
@media (max-width: 719px) {
  #ui .hud { right: calc(var(--edge) + var(--sar)); }
  #ui .hud .cell { padding: 0 12px; }
  #ui .hud .c-time .t1 { font-size: 17px; }
  #ui .hud .c-place { max-width: none; }
  #ui .hud .c-flight { min-width: 0; text-align: right; align-items: flex-end; }
  #ui .dock { top: auto; bottom: calc(var(--edge) + var(--sab)); left: calc(var(--edge) + var(--sal)); right: calc(var(--edge) + var(--sar)); padding: 0 4px; justify-content: space-around; border-radius: 20px; }
  #ui .dock button { flex: 1; flex-direction: column; gap: 3px; height: 48px; padding: 0; font-size: 10.5px; font-weight: 550; justify-content: center; }
  #ui .dock button .k { display: none; }
  #ui .dock button .ic { width: 22px; height: 22px; }
  #ui .dock .snd { flex: 0 0 48px; }
}
@media (max-width: 359px) { #ui .hud .c-flight { display: none !important; } }

/* ---------------------------------------------------------------- photo mode */
#ui .photo { position: absolute; left: 50%; bottom: calc(var(--edge) + var(--sab)); transform: translate(-50%, 12px); width: min(1040px, calc(100% - 2 * var(--edge)));
  display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 10px;
  opacity: 0; visibility: hidden; transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow); }
#ui.photo .photo { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease), visibility 0s; }
#ui.photo.idle .photo { opacity: 0; transform: translate(-50%, 12px); }
#ui.photo.idle .photo * { pointer-events: none; }
#ui.saving .photo { opacity: 0 !important; }
#ui.saving::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: rgb(0 0 0 / 0); transition: background 160ms ease; }
#ui.shutter::before { background: rgb(0 0 0 / .32); transition: none; }
#ui .photo .prow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
#ui .photo .pg { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#ui .photo .pg.grow { flex: 1 1 110px; }
#ui .photo .pg.wide { flex: 1 1 320px; }
#ui .photo .pg .lbl b { color: var(--fg-2); font-weight: 600; letter-spacing: 0; text-transform: none; margin-left: 4px; }
#ui .photo .seg > button { min-width: 36px; padding: 0 9px; font-size: 13px; }
#ui .photo .wxrow { display: flex; gap: 4px; padding-bottom: 6px; }
#ui .photo .wxrow .ibtn { width: 34px; height: 34px; min-width: 34px; }
#ui .photo .wxrow .ibtn .ic { width: 18px; height: 18px; }
#ui .photo .pg.acts { flex-direction: row; gap: 8px; padding-bottom: 6px; }
#ui .photo .scrub { flex: none; width: 100%; height: 50px; }
#ui .photo .pfd { display: none; }
#ui .photo.man .pfd { display: flex; }
/* a slider and its value side by side: the value never sits over the thumb */
#ui .photo .rv { display: flex; align-items: center; gap: 10px; min-width: 0; }
#ui .photo .rv .val { flex: none; min-width: 54px; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
#ui .photo .pacts-s { display: none; }
/* phone: one 56 px row (lens, exposure, save, more); the rest in a drawer that opens upward */
@media (max-width: 719px) {
  #ui .photo { padding: 6px 8px; gap: 6px; border-radius: 22px; }
  #ui .photo .prow { gap: 6px 8px; flex-wrap: nowrap; align-items: center; }
  #ui .photo .lbl { display: none; }
  #ui .photo .adv { display: none; }
  #ui .photo .rv .val { display: none; }
  #ui .photo .seg > button { min-width: 0; padding: 0 6px; font-size: 13px; }
  #ui .photo .pg.grow { flex: 1 1 64px; }
  #ui .photo .pacts-s { display: flex; flex-direction: row; gap: 4px; flex: none; }
  #ui .photo.more .prow:first-child { flex-wrap: wrap; }
  #ui .photo.more .prow:first-child > .pg:not(.adv) { order: -1; }
  #ui .photo.more .prow:first-child > .pg.adv { order: 0; }
  #ui .photo.more .adv { display: flex; }
  #ui .photo.more .adv .lbl, #ui .photo.more .adv .rv .val { display: inline; }
  #ui .photo.more .pfd { display: none; }
  #ui .photo.more.man .pfd { display: flex; }
  #ui .photo .prow.adv { flex-wrap: wrap; }
  #ui .photo .pg.wide, #ui .photo .pg.wx { flex: 1 1 100%; }
  #ui .photo .pg.acts { width: 100%; }
  #ui .photo .pg.acts .btn { flex: 1; }
  #ui .photo .pg.adv:not(.wide):not(.wx):not(.acts) { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- help, about */
#ui .kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: center; }
#ui kbd { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--fill); font: 600 11.5px/22px ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: center; color: var(--fg); text-shadow: none; }
#ui .kv .ks { display: flex; gap: 4px; white-space: nowrap; }
#ui .kv .kd { color: var(--fg-2); }
#ui .modal { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); background: rgb(4 6 10 / .45); pointer-events: auto;
  opacity: 0; visibility: hidden; transition: opacity var(--t) var(--ease), visibility 0s linear var(--t); }
#ui .modal.open { opacity: 1; visibility: visible; transition: opacity var(--t) var(--ease), visibility 0s; }
#ui .modal .sheet { width: min(820px, 100%); max-height: calc(100vh - 32px - var(--sat) - var(--sab)); max-height: calc(100dvh - 32px - var(--sat) - var(--sab)); min-height: 0; display: flex; flex-direction: column; transform: translateY(12px) scale(.985); transition: transform var(--t) var(--ease); background: rgb(var(--tint) / .82); }
#ui .modal.open .sheet { transform: none; }
#ui .modal .sheet header { display: flex; align-items: center; padding: 14px 12px 6px 22px; flex: none; }
#ui .modal .sheet header h2 { flex: 1; font-size: 18px; font-weight: 650; }
#ui .modal .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 36px; padding: 8px 22px 22px; overflow-y: auto; touch-action: pan-y; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
#ui .modal .cols h3, #ui .aboutbody h3 { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); margin: 10px 0 10px; }
#ui .aboutbody { overflow-y: auto; padding: 4px 22px 34px; touch-action: pan-y; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); user-select: text; -webkit-user-select: text; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
#ui .aboutbody .lead { color: var(--fg-2); line-height: 1.55; max-width: 66ch; margin-bottom: 8px; }
#ui .aboutbody .lead b { color: var(--fg); font-weight: 600; }
#ui .credits { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin-bottom: 14px; }
#ui .credits .cr h4 { font-size: 13.5px; font-weight: 620; margin-bottom: 2px; }
#ui .credits .cr p { font-size: 12.5px; color: var(--fg-2); line-height: 1.45; }
#ui .credits .cr p.lic { color: var(--fg-3); margin-top: 2px; }
@media (max-width: 719px) { #ui .modal .cols, #ui .credits { grid-template-columns: 1fr; } }
#ui .aboutbody .fan { font-weight: 600; color: var(--fg); margin: 2px 0 8px; }
#ui .aboutbody a { color: var(--fg); text-decoration: underline; text-decoration-color: rgb(244 246 249 / .45); text-underline-offset: 2px; pointer-events: auto; }
#ui .aboutbody a:hover { text-decoration-color: var(--fg); }
#ui .aboutbody .build { font-size: 11.5px; color: var(--fg-3); margin-top: 6px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
#ui .aboutbody .note { font-size: 12.5px; color: var(--fg-2); line-height: 1.45; }

/* ---------------------------------------------------------------- map-data credit (ODbL: always visible) */
#ui .attrib { position: absolute; right: calc(8px + var(--sar)); bottom: calc(1px + var(--sab)); display: flex; align-items: baseline; gap: 0; font-size: 10.5px; line-height: 14px; font-weight: 500;
  color: rgb(244 246 249 / .86); text-shadow: 0 0 3px rgb(0 0 0 / .85), 0 1px 2px rgb(0 0 0 / .6); pointer-events: auto; white-space: nowrap; }
#ui .attrib a, #ui .attrib button { color: inherit; text-decoration: none; font-size: inherit; line-height: inherit; padding: 0 2px; border-radius: 3px; }
#ui .attrib a:hover, #ui .attrib button:hover { text-decoration: underline; }
#ui.photo .attrib { opacity: .7; }
#ui.intro .attrib { opacity: 0; visibility: hidden; }
@media (max-width: 719px) { #ui .attrib { right: calc(12px + var(--sar)); bottom: calc(var(--edge) + var(--sab) + 56px + 3px); } #ui.photo .attrib { bottom: auto; top: calc(6px + var(--sat)); } }

/* ---------------------------------------------------------------- toast, hint */
#ui .toast { position: absolute; left: 50%; top: calc(var(--edge) + var(--sat) + var(--top-h) + 16px); transform: translate(-50%, -8px); padding: 10px 16px; border-radius: 999px; font-weight: 550; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
  opacity: 0; visibility: hidden; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t); pointer-events: none !important; display: flex; align-items: center; gap: 8px; z-index: 5; }
#ui .toast.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s; }
#ui .toast .ic { width: 18px; height: 18px; color: var(--accent); }
#ui .hint { position: absolute; left: 50%; transform: translate(-50%, 12px); padding: 12px 12px 12px 20px; display: flex; align-items: center; gap: 18px; max-width: calc(100% - 2 * var(--edge));
  opacity: 0; visibility: hidden; transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow); }
#ui .hint.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease), visibility 0s; }
#ui .hint .hs { display: flex; flex-wrap: wrap; gap: 8px 20px; }
#ui .hint .h { display: flex; align-items: center; gap: 8px; color: var(--fg-2); white-space: nowrap; }
#ui .hint .h b { color: var(--fg); font-weight: 600; }
@media (min-width: 720px) { #ui .hint { bottom: calc(var(--edge) + var(--sab) + var(--bar-h) + 20px); } }
@media (max-width: 719px) { #ui .hint { bottom: calc(var(--edge) + var(--sab) + 56px + 16px); width: calc(100% - 2 * var(--edge)); } }

/* ---------------------------------------------------------------- title, tour */
/* the title stands in the sky: a soft shade from the top, nothing over the city */
#ui .title { position: absolute; inset: 0; display: grid; place-items: start center; padding-top: calc(11vh + var(--sat)); text-align: center; pointer-events: none;
  background: linear-gradient(to bottom, rgb(5 7 11 / .45), rgb(5 7 11 / 0) 40%);
  transition: opacity 1400ms ease; }
#ui .title.out { opacity: 0; }
#ui .title .in { position: relative; }
#ui .title h1 { font-weight: 650; letter-spacing: .32em; font-size: clamp(22px, 4vw, 44px); margin: 0 0 .5em; text-indent: .32em; line-height: 1.4; text-shadow: 0 2px 24px rgb(0 0 0 / .45), 0 1px 3px rgb(0 0 0 / .35); }
#ui .title .sub { font-size: 14px; line-height: 1.4; opacity: .9; margin: 0; max-width: 34em; padding: 0 1.5em; text-shadow: 0 1px 10px rgb(0 0 0 / .55), 0 1px 2px rgb(0 0 0 / .4); }
#ui .title .load { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; white-space: nowrap; font-size: 12px; color: var(--fg-2); text-shadow: var(--text-shadow); transition: opacity 600ms ease; }
#ui .title .load .bar { width: 132px; height: 2px; border-radius: 1px; background: rgb(255 255 255 / .22); overflow: hidden; }
#ui .title .load .bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform 500ms var(--ease); }
#ui .title::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 15%; min-height: 96px; background: linear-gradient(to top, rgb(5 7 11 / .45), rgb(5 7 11 / 0)); pointer-events: none; }
#ui .title .legal { position: absolute; z-index: 1; left: 0; right: 0; bottom: calc(24px + var(--sab)); max-width: 62em; margin: 0 auto; line-height: 1.5; font-size: 12px; font-weight: 500; color: rgb(244 246 249 / .88); padding: 0 24px; text-shadow: var(--text-shadow), 0 1px 8px rgb(0 0 0 / .7); }
#ui .title .legal span { display: block; text-wrap: balance; }
#ui .title .legal a { color: inherit; text-decoration: underline; text-decoration-color: rgb(244 246 249 / .45); text-underline-offset: 2px; pointer-events: auto; }
#ui .title .legal a:hover, #ui .title .legal a:focus-visible { text-decoration-color: currentColor; }
#ui .fade { position: absolute; inset: 0; background: #05070b; opacity: 0; pointer-events: none; transition: opacity 1100ms ease; }
#ui .fade.on { opacity: 1; }
#ui .fade.quick { transition-duration: 220ms; }
#ui .caption { position: absolute; left: calc(32px + var(--sal)); bottom: calc(36px + var(--sab)); max-width: calc(100% - 64px); pointer-events: none; opacity: 0; transform: translateY(8px); transition: opacity 1200ms ease, transform 1200ms var(--ease); text-shadow: 0 2px 18px rgb(0 0 0 / .65), 0 0 2px rgb(0 0 0 / .4); }
#ui .caption.on { opacity: 1; transform: none; }
#ui .caption .ct { font-size: clamp(20px, 2.6vw, 30px); font-weight: 620; letter-spacing: .01em; }
#ui .caption .cs { margin-top: 4px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: rgb(244 246 249 / .86); font-weight: 550; }
#ui .tourbar { position: absolute; right: calc(var(--edge) + var(--sar)); top: calc(var(--edge) + var(--sat)); display: none; align-items: center; gap: 4px; padding: 4px 4px 4px 16px; border-radius: 999px; font-weight: 550; color: var(--fg-2); transition: opacity var(--t-slow) var(--ease); }
#ui.touring .tourbar { display: flex; }
#ui.touring.idle .tourbar { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  #ui *, #ui *::before, #ui *::after { transition-duration: 1ms !important; animation: none !important; }
}

/* Painted once, invisibly, while the world is quiet after boot (three frames per surface): the
   first real open then finds its glyphs, filters and layers ready. */
#ui .warm { visibility: visible !important; opacity: .004 !important; pointer-events: none !important; transition: none !important; }
#ui .sky.warmglass::before, #ui .sky.warmglass .sky-bar, #ui .sky.warmglass .sky-more { opacity: .004 !important; transition: none !important; }
#ui .sky.warmglass .sky-more { max-height: none; visibility: visible; padding: 14px 18px 6px; pointer-events: none; }
@media (max-width: 719px) { #ui .sky.warmglass { visibility: visible !important; opacity: .004 !important; pointer-events: none !important; transition: none !important; } }

/* QA A/B switches for the cost probe (nyc.send('ui.qa', 'noblur,nomask')): not for people */
#ui.qa-noblur .glass, #ui.qa-noblur .sky::before { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: var(--glass-solid) !important; }
#ui.qa-nomask * { -webkit-mask-image: none !important; mask-image: none !important; }
