/* Instrument Sans, hosted with the app so it works offline. Its width axis
   gives the peak names on the view a condensed, map-lettering cut. */
@font-face { font-family: "Instrument Sans"; src: url(fonts/instrument-sans-latin.woff2) format("woff2"); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; src: url(fonts/instrument-sans-latin-ext.woff2) format("woff2"); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* The same font fixed at its condensed width, by name, for canvas text. */
@font-face { font-family: "Instrument Sans Condensed"; src: url(fonts/instrument-sans-latin.woff2) format("woff2"); font-weight: 400 700; font-stretch: 75%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans Condensed"; src: url(fonts/instrument-sans-latin-ext.woff2) format("woff2"); font-weight: 400 700; font-stretch: 75%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #0b1322;
  --panel: rgba(12, 20, 34, 0.86);
  --panel-solid: #101a2b;
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef3fa;
  --muted: #9aabc2;
  --accent: #ffc857;
  --accent-2: #5ad1ff;
  --ok: #6fe3a1;
  --bad: #ff7a7a;
  --radius: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* A phone on its side has the notch (or the camera's cut-out) at one end. */
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --side: 0px; /* the side card's width, where the sheet is one (wide screens) */
  --peek: 92px;
  /* Motion, as js/motion.js has it: the same durations and curves. */
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 360ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.05);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font: 15px/1.45 var(--font); font-feature-settings: "tnum" 1; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
svg { fill: currentColor; }
/* Line icons: one stroke weight everywhere. */
svg.i { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

#app { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
/* The landscape on the GPU (gl-terrain.js): the sky, then the land, under the view's lines and names. */
#sky, #gl { position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none; }
#app[data-gfx="gl"]:not([data-mode="ar"]) #sky, #app[data-gfx="gl"]:not([data-mode="ar"]) #gl { display: block; }
#cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
#app[data-mode="ar"] #cam { display: block; }
/* Camera mode drawn natively (Android): the camera and names are behind the page. */
html.native-ar, html.native-ar body { background: transparent; }
html.native-ar #app[data-mode="ar"] #cam { display: none; }
#app:not([data-mode="ar"]) .ar-only { display: none !important; }
/* The controls of a mode arrive one after another (--i: their order). */
#app[data-mode="ar"] .ar-only:not(.aim-tag), #app[data-mode="pano"] .pano-only, #app[data-mode="pano"] .fabs .rail:not(.ar-only) { animation: hudIn var(--dur-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
html.lite #app .ar-only, html.lite #app .pano-only, html.lite #app .rail { animation-delay: 0ms; }

/* Top bar */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 12px 10px;
  background: linear-gradient(rgba(6, 11, 20, 0.85), rgba(6, 11, 20, 0));
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: 0.2px; }
.brand svg { width: 22px; height: 22px; color: var(--accent); }
.chip {
  transition: border-color var(--dur-fast);
  display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1;
  padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); text-align: left;
}
.chip svg { width: 16px; height: 16px; flex: none; color: var(--accent-2); }
.loc-text { display: flex; flex-direction: column; min-width: 0; }
.loc-text b, .loc-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-text b { font-size: 13px; }
.loc-text small { color: var(--muted); font-size: 11px; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; flex: none; }
.seg button { border: 0; background: none; padding: 6px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: #1b1404; }

/* HUD */
.hud { position: absolute; z-index: 4; left: calc(12px + var(--safe-l)); bottom: calc(var(--peek) + var(--safe-b) + 46px); display: flex; align-items: center; gap: 6px; pointer-events: none; }
.compass { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); }
.compass svg { width: 30px; height: 30px; }
.compass circle { fill: none; stroke: rgba(255, 255, 255, 0.25); stroke-width: 2; }
.compass #needle { fill: var(--accent); transform-origin: 20px 20px; }
.compass b { display: block; font-size: 13px; line-height: 1.1; }
.compass small { color: var(--muted); font-size: 10.5px; }
.tag { font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px 8px; }

.fabs { position: absolute; z-index: 4; right: calc(12px + var(--safe-r)); bottom: calc(var(--peek) + var(--safe-b) + 14px); display: flex; flex-direction: column; gap: 10px; }
.rail { display: flex; flex-direction: column; padding: 3px; gap: 2px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.fab { width: 44px; height: 44px; border-radius: 13px; border: 0; background: transparent; display: grid; place-items: center; transition: background var(--dur-fast), transform var(--dur-fast); }
.fab svg { width: 21px; height: 21px; }
.fab:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.08); }
.fab.active { background: var(--accent); color: #1b1404; }
/* First launches: a word beside each round button (fab-hints, js/app.js). */
.fab[data-hint] { position: relative; }
html.fab-hints .rail .fab[data-hint]::after { content: attr(data-hint); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 5px 9px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); color: var(--text, #fff); font-size: 12.5px; font-weight: 600; line-height: 1.2; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); animation: fabHintIn 0.3s ease-out both; }
@keyframes fabHintIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html.fab-hints .rail .fab[data-hint]::after { animation: none; } }
/* A phone on its side: the tip cards sit where the words would go. */
@media (max-height: 500px) { html.fab-hints .rail .fab[data-hint]::after { display: none; } }
@media (hover: hover) { .fab:hover:not(.active) { background: rgba(255, 255, 255, 0.07); } }
.fab:focus-visible, .btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.align-bar {
  position: absolute; z-index: 6; left: 12px; right: 12px; top: calc(var(--safe-t) + 64px); animation: panelIn var(--dur) var(--ease);
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--panel-solid); border: 1px solid var(--accent);
}
.align-bar span { flex: 1; font-size: 13px; line-height: 1.35; }
.align-bar b { color: var(--accent); }
/* Held still on the mountains: a thin bar fills while the skyline is matched. */
.hold-bar { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.hold-bar[hidden] { display: none; }
.hold-bar b { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); transition: width 0.25s linear; }
@media (prefers-reduced-motion: reduce) { .hold-bar b { transition: none; } }
.fab.snap svg { fill: var(--accent); }
.btn { border: 0; border-radius: 10px; background: var(--accent); color: #1b1404; font-weight: 600; padding: 8px 12px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: 12.5px; }

.status {
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(280px, 80vw); padding: 14px 16px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line);
  text-align: center; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: statusIn var(--dur) var(--ease);
  transition: top var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease), padding var(--dur-slow) var(--ease), border-radius var(--dur-slow) var(--ease);
}
@keyframes statusIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
/* The scene is showing: a slim pill under the top bar, out of its way. */
.status.compact { top: calc(var(--safe-t) + 66px); transform: translate(-50%, 0); padding: 8px 14px; border-radius: 999px; font-size: 12.5px; }
.status.compact .bar { display: none; }
.status .bar { margin-top: 10px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.status .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 80ms linear; }
/* Above the shutter and left of the buttons, as the time bar is: a message never
   covers what you'd tap (it sat over the shutter and More for its 5 s). */
.toast {
  position: absolute; z-index: 25; left: calc(50% - 32px); bottom: calc(var(--peek) + var(--safe-b) + 112px); transform: translateX(-50%); /* above any panel */
  width: max-content; max-width: calc(100vw - 88px); padding: 11px 16px; border-radius: 14px; background: #1c2a42; border: 1px solid var(--line); font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: toastIn var(--dur) var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
#app:has(#timeBar:not([hidden])) .toast { bottom: calc(var(--peek) + var(--safe-b) + 268px); } /* over the time bar, not on it */
/* No buttons beside it (camera mode, the drone, a panel): the middle, full width. */
#app[data-mode="ar"] .toast, #app.drone-on .toast, #app:has(.panel:not([hidden])) .toast { left: 50%; max-width: calc(100vw - 32px); }
/* Camera mode: over the zoom and the compass chip, and over the card there when one shows
   (not-here, or the Point at the mountains guide). */
#app[data-mode="ar"] .toast { bottom: calc(var(--peek) + var(--safe-b) + 172px); }
#app[data-mode="ar"]:has(#hereBar:not([hidden])) .toast { bottom: calc(var(--peek) + var(--safe-b) + 178px + var(--here-h, 58px)); }
/* The line-up message and the not-here card: one over the other, not on it. */
#app[data-mode="ar"]:has(#hereBar:not([hidden])) .align-bar { bottom: calc(var(--peek) + var(--safe-b) + 178px + var(--here-h, 58px)); }
/* A message over the line-up bar too, when that is up. */
#app[data-mode="ar"]:has(#alignBar:not([hidden])) .toast { bottom: calc(var(--peek) + var(--safe-b) + 228px); }
#app[data-mode="ar"]:has(#alignBar:not([hidden])):has(#hereBar:not([hidden])) .toast { bottom: calc(var(--peek) + var(--safe-b) + 236px + var(--here-h, 58px)); }

/* Bottom sheet */
.sheet {
  position: absolute; z-index: 7; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  height: min(78vh, 680px);
  transform: translateY(calc(100% - var(--peek) - var(--safe-b)));
  transition: transform var(--dur) var(--ease);
  background: var(--panel-solid); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
}
.sheet.open { transform: translateY(0); }
/* Closed, it shows the title row only: the tabs below it were half-cut by the
   screen's edge, so they come in as it opens. */
.sheet .tabs { transition: opacity var(--dur-fast); }
.sheet:not(.open):not(.dragging) .tabs { opacity: 0; pointer-events: none; }
.handle { position: relative; border: 0; background: none; padding: 8px 0 4px; display: grid; place-items: center; }
/* A finger-sized grip around the small bar. */
.handle::before { content: ''; position: absolute; inset: -10px 0 0; } /* upward only: below are the arrows */
.handle i { width: 40px; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); }
.peek { padding: 0 10px 0 16px; min-height: 44px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.peek .nav { flex: none; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; }
.peek .nav svg { width: 18px; height: 18px; }
.peek .nav:active { background: rgba(255, 255, 255, 0.12); }
.peek .nav:disabled { opacity: 0.3; }
.peek .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.peek .t { flex: 1; min-width: 0; }
.peek b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek small { color: var(--muted); }
.tabs { display: flex; gap: 2px; padding: 10px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; border: 0; background: none; padding: 8px 11px 10px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; transition: color var(--dur-fast), border-color var(--dur-fast); }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.body { overflow-y: auto; padding: 14px 16px calc(24px + var(--safe-b)); flex: 1; -webkit-overflow-scrolling: touch; }

.peak-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.peak-head h2 { margin: 0; font-size: 22px; line-height: 1.15; }
.peak-head .local { color: var(--muted); font-size: 13px; }
.peak-head .big { margin-left: auto; text-align: right; }
.peak-head .big b { font-size: 22px; display: block; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; color: #111; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; }
.stat small { display: block; color: var(--muted); font-size: 11px; }
.stat b { font-size: 15px; }
.stat em { display: block; font-style: normal; color: var(--muted); font-size: 11px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 22px 0 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions a.btn { text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: rgba(255, 255, 255, 0.08); }
.chart .tick { fill: var(--muted); font-size: 9.5px; }
.chart .lbl { fill: var(--text); font-size: 10.5px; font-weight: 600; }
.chart .terrain { fill: rgba(111, 140, 170, 0.45); stroke: #9fb7d2; stroke-width: 1; }
.chart .flat { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-dasharray: 2 3; }
.chart .sight { stroke-width: 1.6; stroke-dasharray: 5 4; }
.chart .sight.ok { stroke: var(--ok); }
.chart .sight.blocked { stroke: var(--bad); }
.chart .block { fill: var(--bad); }
.chart .you { fill: var(--accent-2); stroke: #fff; stroke-width: 1.5; }
.chart .summit { fill: var(--accent); }
.chart .ring { fill: none; stroke: rgba(255, 255, 255, 0.09); }
.chart .cone { fill: rgba(255, 200, 87, 0.12); stroke: rgba(255, 200, 87, 0.5); }
.chart .shed { fill: rgba(90, 209, 255, 0.16); stroke: rgba(90, 209, 255, 0.7); stroke-width: 1; }
.chart .card { fill: var(--accent); font-size: 11px; font-weight: 700; }
.chart circle[data-peak] { stroke: rgba(0, 0, 0, 0.5); stroke-width: 0.6; cursor: pointer; }
.chart circle.sel { stroke: #fff; stroke-width: 2; }
.chart .sunline { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .skyline { fill: none; stroke: #9fb7d2; stroke-width: 1.4; }
.chart .lit { fill: rgba(255, 200, 87, 0.09); }
.ring-chart { max-width: 320px; margin: 0 auto; }
.chart-note { color: var(--muted); font-size: 11.5px; margin: 6px 0 0; }

.ladder { display: flex; flex-direction: column; gap: 6px; }
.ladder-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 1.4fr auto; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 0; text-align: left; }
.ladder-row.sel .ladder-name { color: var(--accent); }
/* Long names ("Annapurna Middle Peak") take a second line rather than an ellipsis. */
.ladder-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.2; font-weight: 600; font-size: 13px; }
.ladder-bar { height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 6px; overflow: hidden; }
.ladder-bar i { display: block; height: 100%; border-radius: 6px; }
.ladder-val { font-size: 12.5px; font-weight: 600; text-align: right; }
.ladder-val small { display: block; color: var(--muted); font-weight: 400; font-size: 10.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.sun-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.empty { text-align: center; padding: 18px 8px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--accent); opacity: 0.8; }

/* Panels */
.panel {
  position: absolute; z-index: 8; inset: 0; background: var(--bg); padding-left: var(--safe-l); padding-right: var(--safe-r);
  display: flex; flex-direction: column; padding-top: var(--safe-t);
  animation: panelIn var(--dur) var(--ease);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(24px); } }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 17px; flex: 1; }
/* Suggest a peak (suggest.js): a short form. */
.suggest-form { display: grid; gap: 12px; padding: 14px 16px 20px; overflow-y: auto; }
.suggest-form p { margin: 0; }
.suggest-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.suggest-form label small { font-weight: 400; color: var(--muted); }
.suggest-form input, .suggest-form textarea { font: inherit; font-weight: 400; color: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }
.suggest-form textarea { resize: vertical; }
.close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); flex: none; font-size: 15px; }
.search { flex: 1; }
.search input {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-solid); color: var(--text); font: inherit; font-size: 16px;
}
.search-area { flex: none; max-height: 52vh; overflow-y: auto; }
.results { list-style: none; margin: 0; padding: 0; }
.results:empty { display: none; }
.results .mini-title { padding: 12px 14px 4px; }
.results li button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.results li button > span { flex: 1; min-width: 0; }
.results li button b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results li button:active { background: rgba(255, 255, 255, 0.05); }
/* Two lines: same-named places differ at the end ("…Singrauli, Madhya Pradesh"). */
.results small { color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.results .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.results .val { font-weight: 600; font-size: 13px; text-align: right; flex: none; }
.results mark { background: none; color: var(--accent); }
.mini-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 12px; }
.presets-wrap { padding-top: 10px; }
.presets-wrap:empty { display: none; }
.presets { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 10px; flex: none; scrollbar-width: none; }
.presets button { flex: none; min-height: 40px; border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 6px 14px; font-size: 12.5px; white-space: nowrap; }
.presets button small { margin-left: 6px; color: var(--muted); font-size: 11px; }
/* A row that scrolls sideways fades out on the side that has more (New Zealand,
   Poon Hill sat cut at the edge, nothing saying there was more). Only while there
   is more that way: the fade follows the row's own scroll. */
@property --fade-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fade-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes edgeFade { 0% { --fade-l: 0px; --fade-r: 32px; } 6%, 94% { --fade-l: 32px; --fade-r: 32px; } 100% { --fade-l: 32px; --fade-r: 0px; } }
@supports (animation-timeline: scroll()) {
  .presets, .cap-show, .reel-row:not(.peaks) {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
    animation: edgeFade linear both; animation-timeline: scroll(x self);
  }
}
.map { flex: 1; min-height: 200px; background: #0f1828; }
.hint { margin: 0; padding: 8px 12px calc(8px + var(--safe-b)); color: var(--muted); font-size: 11.5px; }
.form { padding: 12px 16px calc(24px + var(--safe-b)); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; max-width: 560px; width: 100%; margin: 0 auto; }
.group { display: flex; flex-direction: column; gap: 16px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.group-title { font-size: 15px; font-weight: 600; color: var(--text); }
.group .muted.small { margin: -6px 0 0; }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 13.5px; }
.field .seg { align-self: stretch; }
.field .seg button { flex: 1; padding: 8px 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.form label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-weight: 600; font-size: 13.5px; }
.form label.row { justify-content: flex-start; align-items: center; gap: 10px; }
.form output { color: var(--accent); font-weight: 600; }
.form input[type="range"] { width: 100%; accent-color: var(--accent); }
.form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.leaflet-container { background: #0f1828; font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-solid); color: var(--text); }

/* Wide screens, and phones turned on their side (short and wide): the sheet is
   a card at the right (--side wide), the controls in the room left of it. */
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  :root { --side: min(400px, 44vw); }
  #app { --peek: 0px; } /* no bottom sheet to stand clear of */
  .sheet { left: auto; right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); margin: 0; width: var(--side); border-radius: 20px; border-bottom: 1px solid var(--line); height: min(80vh, 720px, calc(100% - var(--safe-t) - var(--safe-b) - 84px)); }
  .fabs { right: calc(var(--side) + 32px + var(--safe-r)); bottom: calc(24px + var(--safe-b)); }
  /* Over the shutter, in the middle of the view left of the card, clear of the buttons. */
  .toast { left: calc(50% - var(--side) / 2 - 10px); bottom: calc(136px + var(--safe-b)); max-width: calc(100vw - var(--side) - 164px - var(--safe-l) - var(--safe-r)); }
  #app:has(#timeBar:not([hidden])) .toast { bottom: calc(280px + var(--safe-b)); } /* and the time bar */
}

/* Capture button */
.shutter {
  position: absolute; z-index: 5; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--peek) + var(--safe-b) + 34px);
  width: 68px; height: 68px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.92);
  background: rgba(10, 16, 26, 0.35); display: grid; place-items: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px);
}
.shutter span { width: 50px; height: 50px; border-radius: 50%; background: var(--accent); transition: transform var(--dur-fast); }
.shutter:active span { transform: scale(0.86); }
#app::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 20; transition: opacity 0.35s; }
#app.flash::after { opacity: 0.85; transition: none; }
/* A dip through dark (the steady camera stopping: no picture to dissolve from). */
#app.dim::after { background: var(--bg); opacity: 1; transition: opacity var(--dur-slow) var(--ease); }
#app.dim.clear::after { opacity: 0; }

/* Time of day */
.time-bar {
  position: absolute; z-index: 6; left: calc(12px + var(--safe-l)); right: calc(76px + var(--safe-r)); max-width: 520px;
  bottom: calc(var(--peek) + var(--safe-b) + 112px);
  padding: 12px 14px; border-radius: 18px; background: var(--panel-solid); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.time-row { display: flex; align-items: center; gap: 10px; }
.time-row b { font-size: 18px; }
.time-row small { color: var(--muted); flex: 1; }
.time-bar input[type="range"] {
  width: 100%; margin: 10px 0 8px; accent-color: var(--accent); height: 22px;
  background: linear-gradient(90deg, #0b1226 0%, #1b2650 22%, #f0a46a 27%, #8fb3d6 35%, #bcd5ea 50%, #8fb3d6 65%, #f0a46a 73%, #1b2650 78%, #0b1226 100%);
  border-radius: 11px; appearance: none; -webkit-appearance: none;
}
.time-bar input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #ffd27a; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.time-bar input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #ffd27a; border: 3px solid #fff; }
/* All four in the bar's width, down to a 360 px phone (Sunset was cut to an S). */
/* Four in a row, as wide as each other; with the phone's text set large
   (Android grows it in the app), never narrower than their words: they wrap
   to a second row rather than run into each other. */
.time-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.time-watch { display: none; gap: 6px; margin-top: 8px; }
#app.drone-on .time-watch { display: flex; }
.time-watch button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 999px; border: 1px solid var(--accent); background: rgba(255, 200, 87, 0.12); color: inherit; font: inherit; font-size: 13px; font-weight: 600; }
.time-watch button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.time-watch button.on { background: var(--accent); color: #1a1405; }
.time-chips button { flex: 1 1 0; min-width: max-content; border: 1px solid var(--line); background: rgba(255,255,255,0.05); border-radius: 22px; min-height: 44px; padding: 0 2px; font-size: 12.5px; font-weight: 600; white-space: nowrap; } /* a finger's size */

/* Share card panel */
#capShare { background: var(--accent); color: #1b1404; }
#capShare.ghost { background: transparent; color: var(--text); border: 1px solid rgba(255, 255, 255, 0.22); }

/* Summit log */
.log-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(24px + var(--safe-b)); max-width: 640px; width: 100%; margin: 0 auto; }
.log-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.log-hero div { text-align: center; padding: 16px 6px; border-radius: 16px; background: linear-gradient(160deg, rgba(255,200,87,0.16), rgba(90,209,255,0.06)); border: 1px solid var(--line); }
.log-hero b { display: block; font-size: 30px; color: var(--accent); line-height: 1.1; }
.log-hero small { color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.badge-card { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); opacity: 0.55; }
.badge-card.got { opacity: 1; border-color: rgba(255,200,87,0.5); background: rgba(255,200,87,0.08); }
.badge-card i { font-style: normal; color: var(--accent); font-size: 18px; }
.badge-card b { display: block; font-size: 13.5px; }
.badge-card small { color: var(--muted); font-size: 11.5px; }
.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cap-thumb { border: 1px solid var(--line); background: var(--panel-solid); border-radius: 14px; padding: 0; overflow: hidden; text-align: left; }
.cap-thumb img { width: 100%; display: block; aspect-ratio: 9 / 12; object-fit: cover; }
.cap-thumb span { display: block; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.cap-thumb small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }

.form select { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--text); font: inherit; }
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  .shutter { left: calc(50% - var(--side) / 2 - 10px); bottom: 32px; }
  .time-bar { bottom: calc(120px + var(--safe-b)); left: calc(24px + var(--safe-l)); right: calc(var(--side) + 40px); }
}

/* Share templates */
.cap-preview img.transparent {
  background-color: #3a4a5c;
  background-image: linear-gradient(45deg, #2c3a4a 25%, transparent 25%), linear-gradient(-45deg, #2c3a4a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2c3a4a 75%), linear-gradient(-45deg, transparent 75%, #2c3a4a 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

/* Buttons */
.btn { transition: transform var(--dur-fast), filter var(--dur-fast); }
.btn:active { transform: scale(0.97); filter: brightness(0.92); }
.btn.big { width: 100%; padding: 14px 16px; font-size: 15.5px; border-radius: 14px; }

/* All peaks list */
.list-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.list-tools .seg { align-self: flex-start; }
.list-tools input {
  width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: var(--text); font: inherit; font-size: 16px;
}
.list-tools .seg button { padding: 6px 9px; }
.plist { display: flex; flex-direction: column; }
.prow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 9px 2px; text-align: left; width: 100%; }
.prow:active { background: rgba(255, 255, 255, 0.04); }
.prow .dot { width: 10px; height: 10px; border-radius: 50%; }
.prow b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .val { text-align: right; font-weight: 600; font-size: 13px; }
.prow.sel b { color: var(--accent); }
.list-more { width: 100%; margin-top: 10px; }

/* Peak detail extras */
.coords { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.coords button { border: 1px solid var(--line); background: none; color: var(--text); border-radius: 8px; padding: 2px 8px; font-size: 11.5px; }

/* Summit log extras */
.badge-card i { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); margin-bottom: 6px; font-size: 16px; }
.badge-card.got i { background: rgba(255, 200, 87, 0.2); }
.progress { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 2px 0 14px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff9f5a); border-radius: 4px; }

/* Welcome: full screen and opaque (the app loads behind it, unseen). The
   skyline at the top names its summits one by one, as the app does. */
.welcome {
  position: absolute; inset: 0; z-index: 30; overflow-y: auto;
  background: linear-gradient(180deg, #0b1730 0%, #10223d 34%, #0b1322 62%);
  animation: fadeIn var(--dur-slow) ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.welcome-inner {
  min-height: 100%; width: min(100%, 460px); margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 12px) 20px calc(18px + var(--safe-b));
}
.update { z-index: 60; }
.update .welcome-inner { justify-content: center; }
.update .welcome-actions { margin-top: 28px; }
.welcome-scene { position: relative; margin: 0 -20px; aspect-ratio: 390 / 230; flex: none; }
.w-box { position: absolute; inset: 0; } /* the skyline and its names, at the drawing's shape */
.welcome-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Upright, the welcome is one screen with nothing to scroll (14 Nov: it
   scrolled on every phone, the S24 too). The skyline takes the height left
   over, at its own shape (so the names stay on their summits); on shorter
   screens the line under the title, then the trips' second lines, give way.
   Only with the phone's text set large, when the skyline has given all its
   room, does it scroll (it was cut off there, its last button out of reach). */
@supports (container-type: size) {
  @media (orientation: portrait) {
    .welcome:not(.update) .welcome-scene { flex: 1 1 0; min-height: 0; aspect-ratio: auto; container: w-scene / size; display: flex; align-items: flex-end; justify-content: center; }
    .welcome:not(.update) .w-box { position: relative; inset: auto; flex: none; width: min(100cqw, 100cqh * 390 / 230); aspect-ratio: 390 / 230; container-type: inline-size; }
    /* The names shrink with the skyline, so they keep clear of each other. */
    .welcome:not(.update) .w-pill { font-size: clamp(10.5px, 3.6cqw, 14px); height: 1.72em; padding: 0 0.7em 0 0.55em; gap: 0.42em; border-radius: 0.86em; }
    .welcome:not(.update) .w-pill em { font-size: 0.86em; }
    .welcome:not(.update) .w-pill i { width: 0.5em; height: 0.5em; }
    .welcome:not(.update) .welcome-actions { padding-top: 14px; gap: 2px; }
    .welcome:not(.update) .welcome-actions .btn.ghost { min-height: 44px; padding-top: 0; padding-bottom: 0; }
  }
  /* A narrow phone: each button's words on one line. */
  @media (orientation: portrait) and (max-width: 359px) { .welcome:not(.update) .welcome-actions .btn { font-size: 14px; letter-spacing: -0.1px; padding-left: 10px; padding-right: 10px; } }
  /* Next to nothing left for it (the phone's text set large): none, rather
     than its names piled on each other over the title. */
  @container w-scene (max-height: 90px) { .w-box { display: none; } }
  /* A small skyline: two names, readable, rather than four on top of each other. */
  @container (max-width: 280px) { .w-pill em, .w-pill.w-l2, .w-pill.w-l3, .w-lead .w-l2, .w-lead .w-l3 { display: none; } }
  @media (orientation: portrait) and (max-height: 880px) { .welcome:not(.update) .welcome-text p { display: none; } .welcome:not(.update) .trip { padding-top: 10px; padding-bottom: 10px; } }
  @media (orientation: portrait) and (max-height: 700px) { .welcome:not(.update) .trip small { display: none; } .welcome:not(.update) .trip { min-height: 48px; } }
  @media (orientation: portrait) and (max-height: 600px) { .welcome:not(.update) .welcome-scene { display: none; } .welcome:not(.update) .welcome-text { margin-top: 8px; } }
}
.w-ridge { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.3; stroke-linejoin: round; }
.w-ridge.w-near { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1; }
.w-lead line { stroke: rgba(255, 255, 255, 0.6); stroke-width: 1; }
.w-lead circle { fill: #fff; }
.w-pill {
  position: absolute; left: calc(var(--x) / 390 * 100%); top: calc(var(--y) / 230 * 100%); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 12px; white-space: nowrap;
  background: rgba(10, 16, 26, 0.78); border: 1px solid rgba(255, 255, 255, 0.12);
  font: 600 14px/1 "Instrument Sans Condensed", var(--font); color: #f3f6fb;
}
.w-pill.w-right { transform: translateX(-78%); }
.w-pill i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.w-pill em { font: 500 12px/1 "Instrument Sans Condensed", var(--font); font-style: normal; color: rgba(220, 230, 245, 0.72); }
/* The one moment: the names arrive in turn, each with its line to the summit. */
.welcome .w-l1, .welcome .w-l2, .welcome .w-l3, .welcome .w-l4 { animation: nameIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.welcome .w-l1 { animation-delay: 0.35s; }
.welcome .w-l2 { animation-delay: 0.75s; }
.welcome .w-l3 { animation-delay: 1.15s; }
.welcome .w-l4 { animation-delay: 1.55s; }
@keyframes nameIn { from { opacity: 0; translate: 0 6px; } }
.welcome-text { margin-top: 18px; }
.welcome h1 { margin: 0; font: 700 clamp(34px, 10vw, 46px)/0.98 "Instrument Sans Condensed", var(--font); letter-spacing: -0.3px; text-wrap: balance; }
.welcome p { margin: 10px 0 0; color: #c9d5e5; font-size: 15px; line-height: 1.5; max-width: 34em; }
.welcome-actions { margin-top: auto; padding-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.welcome-actions .btn.ghost { border-color: transparent; background: none; }
.welcome small { text-align: center; font-size: 11.5px; line-height: 1.45; margin-top: 4px; }
.trips { margin-top: 16px; }
.trips-q { margin: 0 0 8px !important; font-size: 13px !important; font-weight: 600; color: var(--muted) !important; }
.trip-list { display: flex; flex-direction: column; gap: 8px; }
.trip { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.trip:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.09); }
.trip .i { width: 22px; height: 22px; flex: none; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.trip b { display: block; font-size: 16px; font-weight: 600; }
.welcome .trip small { display: block; margin: 2px 0 0; font-size: 13px; text-align: left; color: var(--muted); }
.trip::after { content: '›'; margin-left: auto; padding-left: 8px; font-size: 22px; color: var(--muted); }
#welcomeCamera .i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
#welcomeCamera { display: flex; align-items: center; justify-content: center; gap: 8px; }
#welcomePhoto { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
#welcomePhoto .i { width: 18px; height: 18px; color: var(--accent); }
@media (max-height: 700px) { .welcome p { display: none; } }
/* Short screens: the buttons stay in view (the tips come again as the gesture hint). */
@media (max-height: 700px) { .welcome-text { margin-top: 10px; } }
@media (prefers-reduced-motion: reduce) { .welcome, .welcome .w-l1, .welcome .w-l2, .welcome .w-l3, .welcome .w-l4 { animation: none; } }

/* Boot: the controls arrive one after another once the first picture is up. */
.booting .topbar, .booting .sheet, .booting .fabs, .booting .hud { opacity: 0; }
body:not(.booting) .topbar, body:not(.booting) .fabs, body:not(.booting) .hud { animation: hudIn var(--dur-slow) var(--ease) both; }
body:not(.booting) .sheet { animation: fadeIn var(--dur-slow) var(--ease) both; animation-delay: 60ms; }
body:not(.booting) .fabs { animation-delay: 120ms; }
body:not(.booting) .hud { animation-delay: 180ms; }
html.lite body:not(.booting) :is(.sheet, .fabs, .hud) { animation-delay: 0ms; }
@keyframes hudIn { from { opacity: 0; transform: translateY(10px); } }

/* First-use gesture hint */
.gesture-hint {
  position: absolute; z-index: 6; left: 50%; top: 44%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none;
  padding: 16px 18px; border-radius: 18px; background: rgba(10, 16, 26, 0.72); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-weight: 600; font-size: 13px; text-align: center;
  animation: fadeIn var(--dur-slow) ease-out;
}
.gh-hand { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.18); animation: swipe 1.8s ease-in-out infinite; }
@keyframes swipe { 0%, 100% { transform: translateX(-46px); } 50% { transform: translateX(46px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.badge-card:not(.got) i { filter: grayscale(1); opacity: 0.7; }
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  .chip { flex: 0 1 auto; min-width: 220px; max-width: 420px; margin-right: auto; }
}

/* Capture result: verified rewards, or why a view didn't count */
.unlocks { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }

/* Summit log: level, challenges, collections */
.level-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; margin-bottom: 10px; border: 1px solid rgba(255, 200, 87, 0.4); background: linear-gradient(135deg, rgba(255, 200, 87, 0.2), rgba(255, 159, 90, 0.06) 60%, rgba(90, 209, 255, 0.05)); }
.lvl-num { flex: none; width: 64px; height: 64px; border-radius: 18px; background: var(--accent); color: #1b1404; display: grid; place-items: center; align-content: center; line-height: 1; }
.lvl-num small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.lvl-num b { font: 700 32px/1 var(--font); font-stretch: 75%; }
.lvl-body { flex: 1; min-width: 0; }
.lvl-body > b { display: block; font: 700 24px/1.1 var(--font); font-stretch: 75%; letter-spacing: 0.3px; }
.lvl-body .progress { margin: 8px 0 6px; }
.lvl-body small { color: var(--muted); font-size: 11.5px; }
.challenges { display: flex; flex-direction: column; gap: 8px; }
.challenge { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.challenge > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.challenge b { font-size: 13.5px; }
.challenge small { color: var(--muted); font-size: 11.5px; }
.challenge .progress { margin: 8px 0 0; }
.challenge.done { border-color: rgba(111, 227, 161, 0.5); }
.challenge.done b::after { content: ' ✓'; color: var(--ok); }
.collection { display: flex; flex-wrap: wrap; gap: 6px; }
.collection span { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, 0.18); color: var(--muted); }
.collection span.got { border: 1px solid rgba(255, 200, 87, 0.6); background: rgba(255, 200, 87, 0.14); color: var(--text); }
.cap-thumb { position: relative; }
.cap-thumb .tick { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #1b1404; font-style: normal; font-weight: 800; font-size: 13px; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }

/* Share: a story editor. The card fills the screen; controls sit in one dock. */
.cap-panel { background: #05080e; }
.cap-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; flex: none; }
.cap-icon { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); display: grid; place-items: center; color: var(--text); }
.cap-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cap-icon:active { transform: scale(0.94); }
.cap-icon.danger { color: var(--bad); }
.cap-icon:focus-visible, .cap-chip:focus-visible, .cap-template:focus-visible, .cap-result:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cap-result { flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255, 255, 255, 0.05); padding: 0 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; animation: panelIn var(--dur) var(--ease); }
.cap-result span { overflow: hidden; text-overflow: ellipsis; }
.cap-result b { color: var(--text); flex: none; }
.cap-result i { font-style: normal; flex: none; opacity: 0.7; font-size: 11px; transition: transform var(--dur); }
.cap-result[aria-expanded="true"] i { transform: rotate(180deg); }
.cap-result.verified { border-color: rgba(255, 200, 87, 0.5); background: rgba(255, 200, 87, 0.12); color: var(--text); }
.cap-result.verified b { color: var(--accent); }
.cap-result.unlocked { animation: panelIn var(--dur) var(--ease), glow 1.6s ease-out 0.3s 2; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(255, 200, 87, 0.18); } }
.cap-detail { margin: 2px 12px 6px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-size: 13px; color: var(--muted); flex: none; animation: panelIn var(--dur) var(--ease); }
.cap-detail p { margin: 0; line-height: 1.45; }
.cap-detail p b { color: var(--accent); font-variant-numeric: tabular-nums; }
.cap-detail .res-level { margin-top: 4px; color: var(--text); font-weight: 600; }
/* One row, swiped sideways, however many: it fades out at the edge so it reads as more. */
.res-chips { display: flex; align-items: center; gap: 6px; margin: 8px -14px 0; padding: 0 14px 2px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.res-chips::-webkit-scrollbar { display: none; }
.res-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; box-sizing: border-box; height: 28px; line-height: 1; padding: 0 11px 0 8px; border-radius: 14px; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--text); background: rgba(255, 200, 87, 0.12); border: 1px solid rgba(255, 200, 87, 0.35); }
.res-chip.res-peak { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.res-chip i { font-style: normal; font-size: 13px; line-height: 1; }
.res-chip svg.i, .res-level svg.i, .cap-result svg.i { width: 14px; height: 14px; vertical-align: -2px; }
svg.i.star { color: var(--accent); fill: currentColor; stroke-width: 1.5; }
.res-chips .res-chip:last-child { margin-right: 18px; }
.cap-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 16px; }
.cap-preview { position: relative; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; display: flex; align-items: center; justify-content: center; }
.cap-preview img { max-width: 100%; max-height: 100%; display: block; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); background: #0f1828; }
.cap-preview img:not([src]) { width: 100%; height: 100%; visibility: hidden; }
.cap-busy { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 600; font-size: 14px; background: rgba(5, 8, 14, 0.55); border-radius: 12px; }
.cap-dock { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 8px 12px calc(12px + var(--safe-b)); background: linear-gradient(rgba(5, 8, 14, 0), #05080e 18px); }
.cap-show { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; padding: 2px; }
.cap-show::-webkit-scrollbar { display: none; }
.cap-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.cap-chip[aria-pressed]::before { content: '+'; font-size: 16px; font-weight: 500; line-height: 1; width: 10px; text-align: center; }
.cap-chip[aria-pressed="true"] { color: #0b1322; background: var(--text); border-color: var(--text); }
.cap-chip[aria-pressed="true"]::before { content: '✓'; font-size: 13px; font-weight: 800; }
.cap-chip.photo { color: var(--accent); background: rgba(255, 200, 87, 0.1); border-color: rgba(255, 200, 87, 0.6); }
.cap-chip.photo svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.cap-chip:disabled { opacity: 0.35; }
.cap-tip { margin: -2px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.cap-title { display: flex; gap: 8px; margin: 0; }
.cap-title input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); font: inherit; font-size: 15px; }
.cap-title .btn { flex: none; height: 38px; }

.cap-actions { display: flex; gap: 10px; align-items: center; }
.cap-actions .btn { flex: 1; margin: 0; height: 50px; padding: 0 16px; border-radius: 25px; font-size: 16px; font-weight: 700; }
@media (min-width: 700px) { .cap-dock { width: 460px; align-self: center; } }
@media (max-width: 400px) {
  .cap-show { gap: 5px; }
  .cap-chip { padding: 0 10px; gap: 5px; font-size: 12.5px; }
}

/* Camera mode without compass readings: one tap to ask again. */
.compass-bar { position: absolute; z-index: 6; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); top: calc(var(--safe-t) + 64px); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 16px; background: rgba(12, 20, 34, 0.94); border: 1px solid rgba(255, 200, 87, 0.5); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 13.5px; line-height: 1.35; animation: panelIn var(--dur) var(--ease); }
.compass-bar span { flex: 1; }
.fig8 { flex: none; width: 48px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.fig8 .fig8-dot { fill: #fff; stroke: none; }
.fig8-bar b { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .fig8 .fig8-dot { display: none; } }
.compass-bar .btn { flex: none; margin: 0; padding: 9px 14px; font-size: 13.5px; white-space: nowrap; }
#app:not([data-mode="ar"]) .compass-bar { display: none; }
#hereBar { top: auto; bottom: calc(var(--peek) + var(--safe-b) + 170px); }
@media (min-width: 700px) { .compass-bar { left: 50%; right: auto; transform: translateX(-50%); width: 520px; } }

/* Camera mode: just the view. The panel shows only when a peak is tapped; the
   tools reduce to snap, zoom and the shutter. */
#app[data-mode="ar"]:not([data-picked]) { --peek: 0px; }
#app[data-mode="ar"]:not([data-picked]) .sheet { pointer-events: none; }
#app[data-mode="ar"] .fabs .rail:not(.ar-only), #app[data-mode="ar"] #fovTag, #app[data-mode="ar"] .time-bar { display: none !important; }
#app[data-mode="ar"] .fabs { bottom: calc(var(--peek) + var(--safe-b) + 40px); }
#app[data-mode="ar"] .hud { bottom: calc(var(--peek) + var(--safe-b) + 54px); }
/* In the camera, the trust chip sits above the compass, clear of the shutter. */
#app[data-mode="ar"] .hud { flex-direction: column-reverse; align-items: flex-start; }
/* Calmer camera (app.js wakeTopbar): once the names are exact the compass
   reading goes (the scale along the bottom has the heading; its space is kept
   so the chip doesn't jump), and the top bar's buttons fade a few seconds after
   the last touch. The children fade, not the bar: its arrival animation holds
   the bar's own opacity. */
#app[data-mode="ar"] .compass { transition: opacity var(--dur-slow) var(--ease), visibility 0s; }
#app[data-mode="ar"][data-exact] .compass { opacity: 0; visibility: hidden; transition: opacity var(--dur-slow) var(--ease), visibility 0s var(--dur-slow); }
.topbar > * { transition: opacity var(--dur) var(--ease); }
#app[data-mode="ar"][data-calm]:not([data-picked]) .topbar > * { opacity: 0.3; transition: opacity 0.8s var(--ease); }
#app[data-mode="ar"] .shutter { bottom: calc(var(--peek) + var(--safe-b) + 34px); }
.zoom-bar { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(var(--peek) + var(--safe-b) + 116px); display: flex; gap: 6px; padding: 4px; border-radius: 22px; background: rgba(10, 16, 26, 0.45); backdrop-filter: blur(8px); }
.zoom-bar button { min-width: 38px; height: 38px; border-radius: 19px; border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; padding: 0 8px; transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast); }
.zoom-bar button.on { background: rgba(255, 255, 255, 0.92); color: #0b1322; transform: scale(1.08); }
.zoom-bar button[hidden] { display: none; }
#cam { transition: transform var(--dur-fast) ease-out; transform-origin: 50% 50%; }
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) and (min-width: 560px) { .zoom-bar { left: calc(50% - var(--side) / 2 - 10px); bottom: calc(134px + var(--safe-b)); } }
/* Video (the steady camera): right of the shutter, its middle level with the shutter's; filled while the shutter films. */
.cam-video {
  position: absolute; z-index: 5; left: calc(50% + 60px); bottom: calc(var(--peek) + var(--safe-b) + 44px);
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.cam-video[hidden] { display: none; }
.cam-video svg { width: 22px; height: 22px; }
.cam-video:active { transform: scale(0.92); }
#app.recording .cam-video, #app.recording .cam-last, #app.recording .cam-sound { visibility: hidden; }
/* Video's sound switch: small, right of Video, while Video is picked; struck through when off. */
.cam-sound {
  position: absolute; z-index: 5; left: calc(50% + 118px); bottom: calc(var(--peek) + var(--safe-b) + 48px);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.cam-sound[hidden] { display: none; }
.cam-sound svg { width: 19px; height: 19px; }
.cam-sound .slash { display: none; }
.cam-sound.off { color: #ff8a8d; }
.cam-sound.off .slash { display: inline; }
.cam-sound:active { transform: scale(0.92); }
/* The last shot, left of the shutter (mirroring Video): the picture in a ring; a video's with a small play mark. */
.cam-last {
  position: absolute; z-index: 5; right: calc(50% + 60px); bottom: calc(var(--peek) + var(--safe-b) + 44px);
  width: 48px; height: 48px; border-radius: 50%; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.92); background: var(--panel); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.cam-last[hidden] { display: none; }
.cam-last img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-last.video::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -7px 0 0 -4px; border: 7px solid transparent; border-left: 11px solid #fff; border-right: 0; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.cam-last:active { transform: scale(0.92); }
.cam-last.pop { animation: lastPop 0.45s var(--ease); }
@keyframes lastPop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .cam-last.pop { animation: none; } }
/* With the last shot beside the shutter, a phone held upright keeps the compass to its needle: the heading is on the ruler below. */
@media (max-width: 559px) { #app[data-mode="ar"]:has(#camLast:not([hidden])) .compass > div { display: none; } #app[data-mode="ar"]:has(#camLast:not([hidden])) .compass { padding-right: 5px; } }
/* Filming: the shutter's middle red, a rounded square while recording. */
#app[data-cam="video"] .shutter span { background: #e5484d; transition: transform var(--dur-fast), border-radius var(--dur-fast); }
#app.recording .shutter span { border-radius: 9px; transform: scale(0.56); }
/* The time filmed, right of the shutter (where the Video button was). */
.rec-badge { position: absolute; z-index: 6; left: calc(50% + 54px); bottom: calc(var(--peek) + var(--safe-b) + 53px); display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 15px; background: rgba(10, 16, 26, 0.6); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.rec-badge[hidden] { display: none; }
.rec-badge i { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; animation: recBlink 1.2s steps(2, jump-none) infinite; }
@keyframes recBlink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .rec-badge i { animation: none; } }
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  .cam-video { left: calc(50% - var(--side) / 2 + 50px); bottom: calc(62px + var(--safe-b)); }
  .rec-badge { left: calc(50% - var(--side) / 2 + 44px); bottom: calc(71px + var(--safe-b)); }
  .cam-last { right: calc(50% + var(--side) / 2 + 50px); bottom: calc(62px + var(--safe-b)); }
  .cam-sound { left: calc(50% - var(--side) / 2 + 108px); bottom: calc(66px + var(--safe-b)); }
}
#app[data-mode="ar"] .align-bar { top: auto; bottom: calc(var(--peek) + var(--safe-b) + 170px); }
/* The compass chip's menu says what the guide says: the guide steps aside, not half under it. */
#app:has(#alignMenu:not([hidden])) #alignBar { visibility: hidden; }

/* First look at a place in camera mode: point, hold still, it lines up. */
.align-guide { position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 70px); width: min(calc(100% - 24px), 420px); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 18px; background: rgba(10, 16, 26, 0.9); border: 1px solid rgba(255, 200, 87, 0.45); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 14px; font-weight: 600; animation: panelIn var(--dur) var(--ease); }
.align-guide span { flex: 1; }
.align-guide .btn { flex: none; margin: 0; padding: 8px 12px; font-size: 13px; }
.guide-scan { position: relative; width: 34px; height: 24px; flex: none; border-bottom: 2px solid var(--accent); overflow: hidden; }
.guide-scan::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: linear-gradient(transparent, rgba(255, 200, 87, 0.35)); clip-path: polygon(0 100%, 22% 40%, 38% 70%, 58% 10%, 78% 60%, 100% 30%, 100% 100%); }
.guide-scan i { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 8px #fff; animation: scan 1.4s ease-in-out infinite alternate; }
@keyframes scan { from { left: 0; } to { left: calc(100% - 2px); } }

/* What's that? card at the tapped spot. */
.pick-card { position: absolute; z-index: 6; max-width: 280px; padding: 10px 14px; border-radius: 14px; background: rgba(10, 16, 26, 0.94); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; gap: 3px; pointer-events: auto; animation: pickIn var(--dur-fast) ease-out; }
.pick-card b { font-size: 15px; }
.pick-card b small { font-weight: 600; color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.pick-card span { font-size: 12.5px; color: var(--muted); }
.pick-card .btn { align-self: flex-start; margin-top: 6px; padding: 6px 12px; font-size: 12.5px; }
.pick-card::after { content: ''; position: absolute; left: var(--tip, 50%); bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: inherit; border-right: 1px solid rgba(255, 255, 255, 0.14); border-bottom: 1px solid rgba(255, 255, 255, 0.14); transform: rotate(45deg); }
.pick-card.below::after { bottom: auto; top: -6px; transform: rotate(225deg); }
@keyframes pickIn { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
@media (prefers-reduced-motion: reduce) { .guide-scan i { animation: none; } }

/* Will the mountains be out? */
.sky-box { margin-bottom: 6px; }
.sky-now { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); margin-bottom: 10px; }
.sky-now b { font-size: 15px; }
.sky-now span { color: var(--muted); font-size: 13px; }
.sky-now.clear b { color: #7ee2a8; } .sky-now.part b { color: #ffd479; } .sky-now.mostly b, .sky-now.hidden b { color: #ff9b8a; }
.sky-strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; align-items: end; height: 54px; padding-bottom: 16px; position: relative; }
.sky-strip i { position: relative; display: block; height: var(--h); border-radius: 3px 3px 1px 1px; background: #ff9b8a; opacity: 0.85; }
.sky-strip i.clear { background: #7ee2a8; } .sky-strip i.part { background: #ffd479; } .sky-strip i.mostly { background: #ffb38a; }
.sky-strip em { position: absolute; top: calc(100% + 3px); left: 0; font-style: normal; font-size: 10px; color: var(--muted); }
.stats.glow .stat b { color: #ffb4a2; }
.story { display: flex; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: inherit; text-decoration: none; margin-bottom: 6px; }
.story img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex: none; background: #1a2638; }
.story span { font-size: 13px; line-height: 1.45; color: #d5deea; }
.story small { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }

/* Where can I see it? */
.spots { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.spots small { color: var(--muted); font-size: 12px; }
.spot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); font: inherit; text-align: left; }
.spot b { font-size: 13.5px; } .spot span { flex: 1; color: var(--muted); font-size: 12.5px; }
.spot i { font-style: normal; font-weight: 700; font-size: 12.5px; color: #1b1404; background: var(--accent); border-radius: 8px; padding: 3px 9px; }

/* Camera mode: aiming dot and the name of the peak under it. */
.aim { position: absolute; z-index: 3; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); pointer-events: none; transition: transform var(--dur-fast), border-color var(--dur-fast); }
.aim::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fff; }
.aim.on { transform: scale(1.35); border-color: var(--accent); }
.aim-tag { position: absolute; z-index: 4; left: 50%; top: calc(50% + 22px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 14px; border-radius: 14px; border: 0; background: rgba(10, 16, 26, 0.78); backdrop-filter: blur(6px); color: #fff; font: inherit; animation: pickIn var(--dur-fast) ease-out; white-space: nowrap; }
.aim-tag b { font-size: 17px; font-weight: 800; letter-spacing: 0.2px; }
.aim-tag span { font-size: 12px; color: #cfd9e6; }

/* ---------- Motion: small touches that make it feel finished ---------- */
/* The captured picture shrinks into the card preview. */
.fly-shot { position: fixed; z-index: 30; object-fit: cover; pointer-events: none; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }

/* Gliding pill and underline for the active option. */
.tabs { position: relative; }
.tabs .slider { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 2px; background: var(--accent); transition: transform var(--dur-slow) var(--spring), width var(--dur-slow) var(--spring); }
.tabs button.on { border-color: transparent; }
#sheetBody.tab-in > * { animation: tabIn var(--dur) var(--ease) both; }
#sheetBody.tab-in > *:nth-child(2) { animation-delay: 0.03s; }
#sheetBody.tab-in > *:nth-child(3) { animation-delay: 0.06s; }
#sheetBody.tab-in > *:nth-child(n + 4) { animation-delay: 0.09s; }
@keyframes tabIn { from { opacity: 0; transform: translateY(8px); } }

/* Rendering: a soft light sweep instead of a flat overlay. */
.cap-busy { background: linear-gradient(110deg, rgba(5, 8, 14, 0.62) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(5, 8, 14, 0.62) 70%) 0 0 / 300% 100%; animation: sweep 1.4s linear infinite; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* Verified: a gold glint runs across the result line. */
.cap-result { position: relative; }
.cap-result.shine::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 236, 180, 0.55) 50%, transparent 70%) 0 0 / 250% 100% no-repeat; animation: glint 1.1s ease-out 0.15s both; pointer-events: none; }
@keyframes glint { from { background-position: 120% 0; } to { background-position: -40% 0; } }
.cap-result .pts { font-variant-numeric: tabular-nums; }

/* Done: Share turns green with a tick for a moment. */
#capShare { transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
#capShare.done { background: #7ee2a8; color: #0b2414; }
#capSave.done { background: #7ee2a8; color: #0b2414; }
.btn .tick { display: inline-block; animation: tickIn 0.35s cubic-bezier(0.2, 0.9, 0.25, 1.4); }
@keyframes tickIn { from { transform: scale(0) rotate(-30deg); } }

/* Pressable things give a little. */
.fab:active, .cap-icon:active, .cap-chip:active, .cap-template:active, .zoom-bar button:active, .spot:active { transform: scale(0.93); }
.cap-chip, .cap-icon, .spot { transition: transform var(--dur-fast), background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.cap-chip[aria-pressed="true"]::before { animation: tickIn 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.4); }

/* Toasts leave as gently as they arrive. */
.toast.out { animation: toastOut var(--dur) ease-in forwards; }
/* Undo and the like: a finger-sized target that doesn't make the toast taller. */
.toast-act { margin: -12px -8px -12px 10px; padding: 12px 10px; min-height: 44px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.toast-act + .toast-act { margin-left: -4px; }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 8px); } }

/* Camera fades in rather than snapping on. */
#app[data-mode="ar"] #cam { animation: camIn var(--dur-slow) ease-out; }
@keyframes camIn { from { opacity: 0; } }

/* The shutter ring ripples when a capture is taken. */
.shutter::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.9); opacity: 0; pointer-events: none; }
#app.flash .shutter::after { animation: ripple 0.55s ease-out; }
@keyframes ripple { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }

@media (prefers-reduced-motion: reduce) {
  .cap-busy, #sheetBody.tab-in > *, .cap-result.shine::after, #app.flash .shutter::after, #app[data-mode="ar"] #cam { animation: none !important; }
  .tabs .slider { transition: none; }
}

/* Selected summit: a slow, soft pulse. */
.sel-pulse { position: absolute; z-index: 2; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.sel-pulse i { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--accent); animation: selPulse 1.8s ease-out infinite; }
.tap-me { position: absolute; z-index: 5; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.tap-me span { position: absolute; top: 34px; left: 0; transform: translateX(-50%); white-space: nowrap; padding: 8px 12px; border-radius: 12px; background: var(--accent); color: #1b1404; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); animation: tapBob 1.6s ease-in-out infinite; }
.tap-me span::after { content: ''; position: absolute; left: 50%; top: -5px; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom-color: var(--accent); }
.tap-me b { display: block; font-size: 13.5px; font-weight: 700; }
.tap-me small { display: block; font-size: 11.5px; font-weight: 500; opacity: 0.75; }
@keyframes tapBob { 50% { transform: translate(-50%, 4px); } }
@keyframes selPulse { from { transform: scale(0.45); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sel-pulse i { animation: none; opacity: 0.5; } }

/* Match a peak: the same card as the guide, with room for two lines. */
/* Line up (Calibrate): one sentence, the buttons for the step beneath it. */
.line-up-bar { flex-wrap: wrap; row-gap: 8px; }
.line-up-bar span { flex: 1 1 100%; font-weight: 500; line-height: 1.4; font-size: 13.5px; }
.line-up-bar .btn[hidden] { display: none; }
.line-up-bar.compact { flex-wrap: nowrap; padding: 8px 8px 8px 14px; }
.line-up-bar.compact span { flex: 1 1 auto; font-size: 14px; font-weight: 600; }
.lens-tag { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 5px 10px; border-radius: 12px; background: rgba(10, 16, 26, 0.75); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.lens-tag[hidden] { display: none; }
.lens-tag.go { animation: lensTag 1.6s ease-out forwards; }
@keyframes lensTag { 0% { opacity: 0; transform: translate(6px, -50%); } 15%, 75% { opacity: 1; transform: translate(0, -50%); } 100% { opacity: 0; } }
.zoom-dial { position: absolute; left: 50%; bottom: calc(100% + 10px); width: 260px; height: 44px; margin-left: -130px; border-radius: 22px; background: rgba(10, 16, 26, 0.6); backdrop-filter: blur(8px); overflow: hidden; pointer-events: none; }
.zoom-dial[hidden] { display: none; }
.zd-ticks { position: absolute; inset: 0; }
.zd-ticks span { position: absolute; bottom: 6px; transform: translateX(-50%); color: #fff; font-size: 12px; font-weight: 700; }
.zd-ticks i { position: absolute; top: 6px; width: 1px; height: 8px; background: rgba(255, 255, 255, 0.55); }
.zd-ticks i.big { height: 14px; background: #fff; }
.zd-mark { position: absolute; left: 50%; top: 2px; width: 3px; height: 22px; margin-left: -1.5px; border-radius: 2px; background: #ffd54a; }
#zoomPill { touch-action: none; }
/* Where the mountains are, when they are off the screen. */
.peak-guide { position: absolute; z-index: 6; left: 0; top: 0; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border: 0; border-radius: 22px; background: rgba(10, 16, 26, 0.78); backdrop-filter: blur(6px); color: #fff; font: inherit; white-space: nowrap; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); transition: left 0.12s linear, top 0.12s linear; }
.peak-guide[hidden] { display: none; }
.peak-guide i { width: 26px; height: 26px; flex: none; border-radius: 50%; background: #fff; position: relative; transform: rotate(var(--a, 0deg)); }
.peak-guide i::after { content: ''; position: absolute; left: 50%; top: 50%; margin: -6px 0 0 -3px; border: 6px solid transparent; border-left: 9px solid #0b1322; }
.peak-guide span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.peak-guide b { font-size: 14px; font-weight: 800; }
.peak-guide small { font-size: 11.5px; color: #cfd9e6; }
.peak-guide.picked { box-shadow: 0 0 0 2px #ffc857, 0 4px 16px rgba(0, 0, 0, 0.3); }
/* The peak just pointed at: a gold ring on it for a moment. */
.peak-found { position: absolute; z-index: 6; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 3px solid #ffc857; border-radius: 50%; pointer-events: none; box-shadow: 0 0 18px rgba(255, 200, 87, 0.6); animation: peakFound 1.1s ease-out infinite; transition: left 0.12s linear, top 0.12s linear; }
.peak-found[hidden] { display: none; }
@keyframes peakFound { from { transform: scale(1.5); opacity: 0.2; } 40% { transform: scale(1); opacity: 1; } to { transform: scale(1); opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) { .peak-found { animation: none; } }
.peak-guide.near { animation: peakNear 0.9s ease-in-out infinite; }
@keyframes peakNear { 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.25); } }
@media (prefers-reduced-motion: reduce) { .peak-guide.near { animation: none; } }
.ev-slider { position: absolute; z-index: 7; left: 0; top: 0; width: 44px; height: 150px; margin: -75px 0 0 0; touch-action: none; }
.ev-slider[hidden] { display: none; }
.ev-line { position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: rgba(255, 213, 74, 0.7); border-radius: 1px; }
.ev-knob { position: absolute; left: 6px; top: 50%; width: 32px; height: 32px; margin-top: -16px; display: grid; place-items: center; border-radius: 50%; background: #ffd54a; color: #3a2a00; font-size: 17px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); transform: translateY(var(--y, 0px)); }
.hold-still { position: absolute; inset: 0; z-index: 8; background: #000; }
.hold-still[hidden] { display: none; }
.hold-still .hold-close { left: auto; right: 16px; bottom: auto; top: calc(var(--safe-t, 0px) + 64px); transform: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(10, 16, 26, 0.75); color: #fff; font-size: 18px; }
.hold-still button { position: absolute; left: 50%; bottom: calc(var(--safe-b, 0px) + 40px); transform: translateX(-50%); padding: 12px 22px; border-radius: 24px; font-size: 15px; font-weight: 800; }
.hold-still img { width: 100%; height: 100%; object-fit: cover; animation: freezeIn 0.25s ease-out; }
.hold-still span { position: absolute; left: 50%; top: calc(var(--safe-t, 0px) + 70px); transform: translateX(-50%); padding: 7px 14px; border-radius: 16px; background: rgba(10, 16, 26, 0.75); color: #fff; font-size: 13px; font-weight: 700; }
@keyframes freezeIn { from { filter: brightness(1.6); } to { filter: none; } }
/* After dark in camera mode: the names, lines and controls in dim red. */
html.night #app[data-mode="ar"] #view { filter: sepia(1) saturate(5) hue-rotate(-45deg) brightness(0.75); }
html.night #app[data-mode="ar"] .trust, html.night #app[data-mode="ar"] .zoom-bar, html.night #app[data-mode="ar"] .peak-guide { filter: sepia(1) saturate(3) hue-rotate(-45deg) brightness(0.8); }
/* First time in camera mode: three steps, each done by doing it. */
.coach { position: absolute; z-index: 7; left: 50%; top: calc(var(--safe-t, 0px) + 70px); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 24px); padding: 10px 12px; border-radius: 20px; background: rgba(10, 16, 26, 0.82); backdrop-filter: blur(8px); color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); animation: fadeIn var(--dur-slow) ease-out; }
.coach[hidden] { display: none; }
/* With the guide up, a card at the top (Line up, Drag the names) opens below it, not over it. */
body:has(.coach:not([hidden])) :is(.align-guide, .compass-bar) { top: calc(var(--safe-t) + 78px + var(--coach-h, 40px)); }
.coach p { flex-basis: 100%; margin: 0; text-align: center; font-size: 14px; font-weight: 600; }
.focus-ring { position: absolute; z-index: 6; left: 0; top: 0; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; border: 2px solid #ffd54a; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); pointer-events: none; }
.focus-ring[hidden] { display: none; }
.focus-ring.go { animation: focusIn 1.1s ease-out forwards; }
@keyframes focusIn { 0% { transform: scale(1.5); opacity: 0; } 18% { transform: scale(1); opacity: 1; } 30% { transform: scale(1.06); } 42% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.zoom-bar.pinching #zoomPill { transform: scale(1.5); background: rgba(255, 255, 255, 0.95); color: #0b1322; }
.zoom-bar #zoomPill { transition: transform 0.15s ease-out, background 0.15s; min-width: 52px; }
@media (prefers-reduced-motion: reduce) { .focus-ring.go { animation: none; } }
.sun-guide { position: absolute; z-index: 6; left: 0; top: 0; width: 56px; height: 56px; margin: -28px 0 0 -28px; pointer-events: none; transition: opacity 0.25s; }
.sun-guide[hidden] { display: none; }
.sun-guide b { position: absolute; inset: 8px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #ffe9a8 0%, #ffbf3c 70%); color: #8a4b00; font-size: 22px; box-shadow: 0 0 0 4px rgba(255, 196, 60, 0.35), 0 0 26px rgba(255, 196, 60, 0.9); animation: sunPulse 1.1s ease-in-out infinite; }
.sun-guide i { position: absolute; inset: 0; transform: rotate(var(--a, 0deg)); }
.sun-guide i::after { content: ''; position: absolute; right: -14px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-left: 14px solid #ffc43c; filter: drop-shadow(0 0 6px rgba(255, 196, 60, 0.9)); animation: sunNudge 0.9s ease-in-out infinite; }
@keyframes sunPulse { 50% { transform: scale(1.12); } }
@keyframes sunNudge { 50% { transform: translateX(6px); } }
/* Locking on: a gold ring flies to the sun, fills, and turns green. */
.sun-lock { position: absolute; z-index: 6; left: 0; top: 0; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; pointer-events: none; transition: left 0.25s ease-out, top 0.25s ease-out, transform 0.25s, opacity 0.25s;
  background: conic-gradient(#ffc43c calc(var(--p, 0) * 1turn), rgba(255, 255, 255, 0.25) 0); -webkit-mask: radial-gradient(circle, transparent 31px, #000 32px); mask: radial-gradient(circle, transparent 31px, #000 32px); }
.sun-lock[hidden] { display: none; }
.sun-lock.seen { animation: lockIn 0.35s ease-out; }
.sun-lock.locked { background: #22c55e; transform: scale(1.25); opacity: 0; transition: transform 0.6s ease-out 0.3s, opacity 0.6s ease-out 0.3s; }
@keyframes lockIn { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sun-guide b, .sun-guide i::after, .sun-lock.seen { animation: none; } }
.btn.lock { background: #22c55e; color: #04220f; }
/* Locked: a green disc pops in, the tick draws itself, a ring spreads, then it all fades. */
.calib-done { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.calib-done[hidden] { display: none; }
.calib-done i { position: relative; width: 84px; height: 84px; border-radius: 50%; background: #22c55e; box-shadow: 0 6px 24px rgba(34, 197, 94, 0.45); }
.calib-done i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid #22c55e; }
.calib-done svg { position: absolute; inset: 16px; fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.calib-done b { padding: 6px 14px; border-radius: 14px; background: rgba(10, 16, 26, 0.78); color: #fff; font-size: 16px; font-weight: 800; }
.calib-done.go { animation: calibOut 1.7s ease-in forwards; }
.calib-done.go i { animation: calibPop 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); }
.calib-done.go i::after { animation: calibRing 0.9s 0.15s ease-out forwards; }
.calib-done.go svg { animation: calibTick 0.35s 0.25s ease-out forwards; }
@keyframes calibPop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes calibTick { to { stroke-dashoffset: 0; } }
@keyframes calibRing { from { transform: scale(1); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }
@keyframes calibOut { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .calib-done.go, .calib-done.go i, .calib-done.go i::after { animation: none; } .calib-done.go svg { animation: none; stroke-dashoffset: 0; } }
.aim.sun { width: 56px; height: 56px; margin: -28px 0 0 -28px; border: 2px dashed rgba(255, 214, 130, 0.95); }
.align-bar .btn { flex: none; padding: 7px 10px; font-size: 12.5px; }

/* Hold still to lock: a ring fills around the aiming dot. */
.calib { position: absolute; z-index: 5; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.calib-ring { position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1turn), rgba(255, 255, 255, 0.18) 0);
  -webkit-mask: radial-gradient(circle, transparent 41px, #000 42px, #000 45px, transparent 46px);
  mask: radial-gradient(circle, transparent 41px, #000 42px, #000 45px, transparent 46px);
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.5)); animation: pickIn var(--dur) var(--ease); }
.calib span { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); white-space: nowrap; padding: 6px 14px; border-radius: 14px; background: rgba(10, 16, 26, 0.8); backdrop-filter: blur(6px); color: #fff; font-size: 14px; font-weight: 700; }
.fab.snap.locked { background: rgba(255, 200, 87, 0.18); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Locked: the ring pops and the label turns gold. */
.calib.done .calib-ring { background: var(--accent); animation: lockPop 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.4); }
.calib.done span { background: var(--accent); color: #1b1404; animation: pickIn var(--dur) var(--ease); }
.calib.done span::before { content: '✓ '; }
@keyframes lockPop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .calib.done .calib-ring { animation: none; } }

/* Is the drawing confirmed by the camera? Gold when lined up with the skyline
   (or a matched peak), grey on the compass alone, breathing while it looks. */
.trust { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border-radius: 14px; font: 600 12px/1 inherit; font-family: inherit; color: var(--muted); background: var(--panel); border: 1px solid var(--line); transition: color var(--dur-slow), border-color var(--dur-slow), background var(--dur-slow); }
.trust i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.trust[data-state="ok"] { color: #4ade80; border-color: rgba(74, 222, 128, 0.55); background: rgba(6, 34, 18, 0.82); }
.trust[data-state="ok"] i { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); animation: trustPing 2.4s ease-out 1; }
.trust[data-state="compass"] { color: #fbbf24; border-color: rgba(251, 191, 36, 0.45); }
.trust[data-state="unsure"] { color: #f87171; border-color: rgba(248, 113, 113, 0.55); background: rgba(40, 8, 8, 0.82); }
.trust[data-state="looking"] { color: #fff; }
.trust[data-state="looking"] i { animation: trustBreath 0.9s ease-in-out infinite alternate; }
@keyframes trustPing { to { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } }
@keyframes trustBreath { from { opacity: 0.25; transform: scale(0.7); } to { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .trust i { animation: none !important; } }
/* "Rough · Fix": the Fix is a small button inside the chip, so it plainly can be tapped. */
.trust-act { margin: 0 -6px 0 3px; padding: 4px 9px; border-radius: 10px; font-weight: 700; font-size: 12px; line-height: 1; color: #1b1404; background: #fbbf24; }
.trust-act[hidden] { display: none; }
.trust[data-state="unsure"] .trust-act { color: #2a0707; background: #f87171; }


/* ---------- Calm layout ----------
   One place to look at a time: the place and the mode on top, names on the
   view, one column of tools, details in the sheet. Gold only where it means
   something (the mode you're in, a confirmed alignment, the shutter). */
.topbar { gap: 10px; padding-left: calc(14px + var(--safe-l)); padding-right: calc(14px + var(--safe-r)); }
.chip.loc { padding: 7px 12px 7px 10px; border-radius: 14px; gap: 8px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.chip.loc svg { width: 18px; height: 18px; color: var(--accent); }
.loc-text b { font-size: 14.5px; font-weight: 600; letter-spacing: -0.1px; }
.loc-text small { font-size: 12px; }
.seg { border-radius: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.seg button { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; padding: 7px 11px; border-radius: 11px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.seg button svg { width: 16px; height: 16px; }
.field .seg button { justify-content: center; }
/* Narrow phones: the mode you're in keeps its name; the other is just its icon. */
@media (max-width: 420px) { .topbar .seg button:not(.on) span { display: none; } .topbar .seg button { padding: 7px 10px; min-width: 44px; min-height: 40px; justify-content: center; } .topbar .seg button svg { width: 18px; height: 18px; } }

.compass { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.compass b { font-size: 14px; font-weight: 600; }
.compass small { font-size: 11.5px; }
.fab svg { width: 22px; height: 22px; }
.rail { border-radius: 18px; padding: 4px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#app[data-mode="ar"] .pano-only { display: none !important; }
.fab[aria-expanded="true"] { background: rgba(255, 255, 255, 0.1); }

/* Small menus: More (by the tools) and alignment (by the trust chip). */
.menu { position: absolute; z-index: 8; min-width: 220px; padding: 6px; border-radius: 16px; background: rgba(16, 26, 43, 0.97); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); transform-origin: 100% 100%; animation: menuIn 0.16s cubic-bezier(0.2, 0.9, 0.25, 1.2); }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 11px; background: none; text-align: left; font-size: 15px; font-weight: 500; }
.menu button svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.menu button:active, .menu button:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
#moreMenu { right: calc(70px + var(--safe-r)); bottom: calc(var(--peek) + var(--safe-b) + 14px); }
.align-menu { left: calc(12px + var(--safe-l)); bottom: calc(var(--peek) + var(--safe-b) + 150px); transform-origin: 0 100%; max-width: min(320px, calc(100% - 24px)); }
.align-menu p { margin: 6px 12px 8px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
/* Each way to fix the names: what it is, and in a line how. */
.align-menu button { align-items: flex-start; }
.align-menu button > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.align-menu button b { font-weight: 600; }
.align-menu button small { color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.35; }
.align-menu button svg, .align-sun { margin-top: 1px; }
.align-sun { width: 20px; height: 20px; flex: none; display: grid; place-items: center; font-style: normal; font-size: 17px; line-height: 1; color: #ffc43c; }
.align-menu button:disabled { opacity: 0.5; }
.align-menu .align-tip { margin: 4px 12px 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; }
@keyframes menuIn { from { opacity: 0; transform: scale(0.94) translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .menu { animation: none; } }

.align-bar { border-color: rgba(255, 200, 87, 0.5); }
.align-bar span { font-size: 14px; }
.trust { height: 30px; font-size: 13px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* Peak details: the name and height first, three facts, then the rest. */
.peak-head { align-items: flex-end; margin-bottom: 16px; }
.peak-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.1; }
.peak-head .local { font-size: 14px; margin-top: 2px; }
.peak-head .big b { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.peak-head .big small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.peak-head .big .dot { width: 8px; height: 8px; border-radius: 50%; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); padding: 12px 0; }
.facts > div { padding: 0 12px; border-left: 1px solid var(--line); }
.facts > div:first-child { padding-left: 0; border-left: 0; }
.facts small { display: block; color: var(--muted); font-size: 12.5px; }
.facts b { font-size: 17px; font-weight: 600; }
.facts b .muted { font-weight: 500; font-size: 14px; }
.facts.glow { grid-template-columns: repeat(2, 1fr); }
.facts.glow b { color: #ffb4a2; }
/* The Sun tab's night: a line of plain words above the Moon's times, and the Milky Way's. */
.night-note { margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
.vis { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; }
.vis i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.vis.bad i { background: var(--bad); }
.actions.main { margin-top: 16px; }
.actions.main .btn { flex: 1; padding: 12px 14px; font-size: 15px; border-radius: 13px; }
/* A peak's card: the treks passing it (each opens on the Treks screen), and its line in the summit log. */
.peak-treks { display: flex; flex-direction: column; gap: 6px; }
.trek-link { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: 9px 36px 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc857' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") right 10px center / 18px no-repeat; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.trek-link b { font-size: 14px; }
.trek-link small { color: var(--muted); font-size: 12px; }
.trek-link:active { transform: scale(0.98); }
.peak-seen { margin: 12px 0 0; font-size: 14px; }
.peak-seen .link { color: var(--ok); font-weight: 600; }
details.more { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--muted); list-style: none; display: flex; justify-content: space-between; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: ""; width: 8px; height: 8px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg); margin: 4px 4px 0 0; transition: transform var(--dur); }
details.more[open] summary::after { transform: rotate(225deg); margin-top: 8px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0 0 6px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.btn.link, button.link { border: 0; background: none; color: var(--accent); padding: 0 0 0 6px; font-weight: 600; }
button.link:not(.cap-from .link) { position: relative; }
button.link:not(.cap-from .link)::before { content: ''; position: absolute; inset: -12px -8px; } /* a line of text to see, 44 px to touch */

details.group.adv summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.group.adv summary::-webkit-details-marker { display: none; }
details.group.adv summary::after { content: "Show"; color: var(--muted); font-size: 13px; font-weight: 500; }
details.group.adv[open] summary::after { content: "Hide"; }
details.group.adv:not([open]) { gap: 0; }

/* What the aiming dot is on: a quiet caption, not a card. */
.aim-tag { flex-direction: row; align-items: baseline; gap: 8px; padding: 5px 12px; border-radius: 12px; background: rgba(10, 16, 26, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.aim-tag b { font-size: 14px; font-weight: 600; font-stretch: 75%; letter-spacing: 0; }
.aim-tag span { font-size: 12px; color: rgba(225, 233, 245, 0.75); }

/* Capture: quieter controls, so the card is what you look at. */
.cap-chip { height: 32px; font-weight: 500; background: transparent; }
.cap-chip[aria-pressed="true"] { color: var(--text); background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.18); }
.cap-chip[aria-pressed="true"]::before { font-weight: 700; color: var(--accent); }
.cap-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; }
.cap-actions .btn svg { width: 20px; height: 20px; }
.cap-actions .btn.ghost { flex: 0.7; }
.cap-preview img { border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06); }

/* A tool column with nothing to show takes no space. */
.rail:not(:has(> :not([hidden]))) { display: none; }
.empty svg.i { width: 40px; height: 40px; color: var(--accent); }
.facts em { display: block; font-style: normal; color: var(--muted); font-size: 12.5px; margin-top: 1px; line-height: 1.3; }
.facts:not(.glow) { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.facts + .facts { border-top: 0; }

/* Offline areas */
.off-lead { margin-top: -8px !important; }
.off-prog { display: flex; flex-direction: column; gap: 6px; }
.off-prog .bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.off-prog .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.2s; }
.off-prog span { font-size: 13px; color: var(--muted); }
.off-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.off-row:first-child { border-top: 0; }
.off-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.off-row small { color: var(--muted); font-size: 12.5px; }
.cap-preview video { max-width: 100%; max-height: 100%; display: block; border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06); background: #0f1828; }
.cap-actions .btn:disabled { opacity: 0.5; }

/* The sheet is dragged by these; the tabs still scroll sideways. */
#sheetHandle, #sheetPeek { touch-action: none; }
#sheet .tabs { touch-action: pan-x; }
#sheetHandle { cursor: grab; width: 100%; }

/* The compass badge: tap to follow the phone in the panorama. */
.compass { pointer-events: auto; cursor: pointer; transition: border-color var(--dur), background var(--dur), box-shadow var(--dur); }
.compass:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.compass:active { transform: scale(0.96); }
.compass.following { border-color: rgba(255, 200, 87, 0.7); background: rgba(40, 30, 8, 0.85); box-shadow: 0 0 0 4px rgba(255, 200, 87, 0.14); }
.compass.following circle { stroke: rgba(255, 200, 87, 0.75); }
.compass.following small { color: var(--accent); }
#app[data-mode="ar"] .compass { cursor: default; }
.palign-intro { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 14, 0.6); }
.palign-intro .ask p { margin: 0 0 4px; color: var(--text); line-height: 1.45; font-weight: 500; }
.cap-busy .ask, .palign-intro .ask { display: flex; flex-direction: column; align-items: stretch; gap: 10px; max-width: 280px; padding: 18px; border-radius: 16px; background: rgba(10, 16, 26, 0.92); text-align: center; }
.cap-busy .ask p { margin: 0 0 4px; color: var(--text); font-weight: 500; line-height: 1.4; }
/* The frozen picture while a still is taken (under the controls, over the camera). */
.freeze { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* The reel's motion: a small choice under the styles. */
.cap-listen { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: rgba(10, 16, 26, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cap-listen svg { width: 22px; height: 22px; }
.cap-listen .on, .cap-listen.playing .off { display: none; }
.cap-listen.playing .on { display: inline; }
.cap-listen.playing { color: var(--accent); }

/* Card style: six small drawings of the layouts, all in view at once. The one
   chosen is drawn in gold; the rest of the dock stays quiet. */
/* The card styles: one slim row of words, the chosen one bright with a gold
   line under it (Reel with a small play mark: it is the video). Half the
   height the big icons took, so the card above gets the room. */
/* Never narrower than their words: with the phone's text set large the row
   slides sideways instead of the words running into each other. */
.cap-styles { display: flex; justify-content: space-between; width: 100%; max-width: 420px; margin: 0 auto; border-bottom: 1px solid rgba(255, 255, 255, 0.07); overflow-x: auto; scrollbar-width: none; }
.cap-styles::-webkit-scrollbar { display: none; }
.cap-template { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; flex: 1 0 auto; height: 38px; padding: 0 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; cursor: pointer; transition: color var(--dur); }
.cap-template svg.g { display: none; }
.cap-template[data-template="reel"] svg.g { display: block; width: 9px; height: 11px; }
.cap-template .g .solid { fill: currentColor; }
.cap-template::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.25, 1.4); }
.cap-template.on { color: var(--text); }
.cap-template.on::after { transform: scaleX(1); }
.cap-template.on svg.g { color: var(--accent); }
.cap-template:disabled { opacity: 0.35; }
@media (max-width: 359px) { .cap-template { font-size: 12.5px; } }
@media (prefers-reduced-motion: reduce) { .cap-template::after { transition: none; } }

/* Reel motion: a quiet text choice under the styles, a gold dot on the one chosen. */
/* Links that look like the rest of the app: a link as a button, and credits
   in the text's own colour. */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
.muted a { color: inherit; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 2px; }

/* A low-memory phone (js/device.js): no frosted-glass blurs. Over the camera
   or a moving panorama each one is redrawn every frame, which a small GPU
   can't keep up with. The panels are nearly opaque without it. */
html.lite { --dur-fast: 80ms; --dur: 150ms; --dur-slow: 200ms; } /* short crossfades only */
html.lite * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.lite .zoom-bar, html.lite .aim-tag { background: rgba(10, 16, 26, 0.8); }

/* Lining a photo up by hand: the photo with the terrain's outline over it. */
/* The photo flow's steps: while one is up there is nothing to share yet. */
#capPanel[data-step="place"] .cap-stage, #capPanel[data-step="place"] .cap-dock,
#capPanel[data-step="finding"] .cap-dock, #capPanel[data-step="check"] .cap-dock, #capPanel[data-step="aligning"] .cap-dock, #capPanel[data-step="failed"] .cap-dock { display: none; }
#capPanel:is([data-step="place"], [data-step="finding"], [data-step="check"], [data-step="aligning"], [data-step="failed"]) #capSave { visibility: hidden; }
/* Under the card: where it was taken, and how Altura knows. */
.cap-from { margin: -4px 0 0; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.cap-from > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-from .link { flex: none; min-height: 36px; padding: 0 6px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; }
/* What Altura is doing with the photo: a list that ticks, over the photo. */
.cap-trace { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.cap-steps { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 2; padding: 12px 14px; border-radius: 14px; background: rgba(10, 16, 26, 0.88); }
html.lite .cap-steps { background: rgba(10, 16, 26, 0.95); }
.cap-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cap-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text); transition: opacity var(--dur) var(--ease); }
.cap-steps li i { position: relative; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.28); box-sizing: border-box; }
.cap-steps li.todo { opacity: 0.45; }
.cap-steps li.on i { border-color: var(--accent); border-top-color: transparent; animation: stepSpin 0.8s linear infinite; }
.cap-steps li.done i { border-color: var(--accent); background: var(--accent); }
.cap-steps li.done i::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px; border: solid #1b1404; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cap-steps small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }
@keyframes stepSpin { to { transform: rotate(360deg); } }
#capPanel[data-step="finding"] .cap-busy { color: transparent; } /* the list says it; the dim and shimmer stay */
/* A guess asked about (app.js askGuesses): the photo undimmed with the guess's names on their summits, the question a bar under the mountains. */
#capPanel[data-step="check"] .cap-busy { inset: auto 10px 10px; display: block; background: none; animation: none; }
#capPanel[data-step="check"] .cap-busy .ask { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: none; width: 100%; box-sizing: border-box; padding: 12px 14px 14px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#capPanel[data-step="check"] .cap-busy .ask p, #capPanel[data-step="check"] .cap-busy .ask .ask-more { grid-column: 1 / -1; }
.cap-busy .ask .ask-more { justify-self: center; padding: 4px 8px; font-size: 13.5px; }
/* It didn't work out: the photo stays, with why and a way forward. */
.cap-fail { flex: none; margin: 0 12px calc(12px + var(--safe-b)); padding: 16px; border-radius: 16px; background: var(--panel-solid); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; animation: panelIn var(--dur) var(--ease); }
.cap-fail h3 { margin: 0; font-size: 17px; }
.cap-fail p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.cap-fail-tips { margin: 2px 0; padding-left: 18px; color: var(--text); font-size: 12.5px; line-height: 1.55; }
.cap-fail-tips:empty { display: none; }
.cap-fail-bar { display: flex; gap: 8px; margin-top: 6px; }
.cap-fail-bar .btn { flex: 1; min-height: 46px; }
.cap-fail-bar .btn.ghost { flex: 0 0 auto; padding-left: 22px; padding-right: 22px; }
#capPanel[data-step="failed"] .cap-busy { display: none; } /* the photo, undimmed, above the reason */
/* Where was it taken: the photo, a map with a pin, quick places, one button. */
.cap-place { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 0 12px calc(12px + var(--safe-b)); animation: panelIn var(--dur) var(--ease); }
.cap-place-photo { display: flex; align-items: center; gap: 12px; flex: none; }
.cap-place-photo img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; background: #0f1828; flex: none; }
.cap-place-facts { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.cap-place-facts b { color: var(--text); font-size: 13px; font-weight: 600; }
.cap-place-title { margin: 2px 0 0; font-size: 20px; font-weight: 700; flex: none; }
.cap-place-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; flex: none; }
.cap-place .search { flex: none; }
.cap-place .results { flex: none; max-height: 22vh; overflow-y: auto; border-radius: 12px; background: var(--panel-solid); }
.cap-place .presets { padding: 0; }
.cap-place-map { flex: 1; min-height: 180px; border-radius: 14px; overflow: hidden; background: #0f1828; position: relative; }
.cap-place-map > p { padding: 16px; margin: 0; color: var(--muted); font-size: 13px; }
.cap-place-name { margin: 0; flex: none; min-height: 18px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-place-bar { flex: none; }
.cap-place-bar .btn { width: 100%; min-height: 50px; }
/* The pin: a gold drop, drawn here (no image to fetch). */
.place-pin i { display: block; width: 26px; height: 26px; margin: 0 1px; border-radius: 50% 50% 50% 0; background: var(--accent); border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); transform: rotate(-45deg); }
.palign { position: absolute; inset: 0; z-index: 3; border-radius: 14px; overflow: hidden; background: #0b1220; }
.palign canvas { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 64px); touch-action: none; cursor: grab; }
.palign-hint { position: absolute; top: 10px; left: 10px; right: 10px; margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(10, 16, 26, 0.78); color: var(--text); font-size: 13px; line-height: 1.35; text-align: center; pointer-events: none; }
.palign-bar .btn { padding-left: 6px; padding-right: 6px; font-size: 14px; }
.palign-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; box-sizing: border-box; display: flex; gap: 8px; padding: 10px; background: rgba(10, 16, 26, 0.92); }
.palign-bar .btn { flex: 1; min-height: 44px; }

/* The reel's tools: three tabs (Motion, Music, Text) and its length, then the
   chosen tab's options, two rows high whichever it is, so the card above
   never jumps as you move between them. */
.reel-tools { display: flex; flex-direction: column; gap: 8px; }
.reel-tabs { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reel-tablist, .reel-length { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.reel-tablist button, .reel-length button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); }
.reel-length button { padding: 0 10px; font-size: 13px; }
.reel-tablist svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reel-tablist [aria-selected="true"], .reel-length [aria-checked="true"] { background: rgba(255, 255, 255, 0.13); color: var(--text); }
.reel-tablist [aria-selected="true"] svg { color: var(--accent); }
.reel-tablist button:focus-visible, .reel-length button:focus-visible, .reel-row button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.reel-panel { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 88px; }
.reel-panel[hidden] { display: none; }
.reel-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; padding: 2px; }
.reel-row::-webkit-scrollbar { display: none; }
.reel-row[hidden] { display: none; }
.reel-row button { flex: none; height: 38px; padding: 0 15px; border-radius: 19px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast); }
.reel-row button:active { transform: scale(0.94); }
.reel-row button[aria-checked="true"] { color: #0b1322; background: var(--text); border-color: var(--text); }
.reel-row.peaks { justify-content: flex-start; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); padding-right: 30px; }
.reel-row.peaks button { height: 34px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.reel-row.peaks button small { margin-left: 6px; opacity: 0.7; font-size: 11.5px; }
.reel-row.peaks button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.reel-label { flex: none; align-self: center; padding: 0 4px 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.reel-hint { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
#panText .cap-title { margin: 0; }
@media (max-width: 419px) { .reel-tablist svg { display: none; } .reel-tablist button, .reel-length button { padding: 0 11px; } }
@media (max-width: 339px) { .reel-tablist button, .reel-length button { padding: 0 8px; font-size: 13px; } }

/* Making a card over one already there: a slim bar at its foot, the card dimmed
   but still to look at (and the reel still playing). */
.cap-busy.soft { inset: auto 10px 10px; height: auto; display: block; line-height: 1.35; padding: 11px 14px 19px; background: rgba(5, 8, 14, 0.8); color: var(--text); font-size: 13px; border-radius: 10px; animation: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cap-busy.progress::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 3px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 0 / calc(var(--p, 0) * 100%) 100% no-repeat, rgba(255, 255, 255, 0.16); }
.cap-busy.progress { height: auto; margin: 0; animation: none; } /* not the 6 px bar .progress is elsewhere: the whole preview; no sweep, the bar moves (a full-size sweep repainting slows the reel being made) */
.cap-busy:not(.soft).progress::after { left: 25%; right: 25%; bottom: calc(50% - 26px); }
.cap-preview:has(> .cap-busy.soft:not([hidden])) > img, .cap-preview:has(> .cap-busy.soft:not([hidden])) > video { opacity: 0.5; transition: opacity var(--dur); }

/* Sharing: one wide Share for every app, and beside it a small round button
   straight to Instagram (in its colours), where it is installed. */
.cap-actions .cap-icon.insta { flex: none; width: 50px; height: 50px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); box-shadow: 0 6px 18px rgba(214, 36, 159, 0.28); }
.cap-actions .cap-icon.insta svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.cap-actions .cap-icon.insta .dot { fill: currentColor; stroke: none; }
.cap-actions .cap-icon.insta:disabled { opacity: 0.4; box-shadow: none; }
.cap-actions .cap-icon.insta.done { background: #7ee2a8; color: #0b2414; }

/* The reel preview: how far it has played, and a play mark while paused. */
.cap-played { position: absolute; left: 14px; right: 14px; bottom: 7px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); overflow: hidden; pointer-events: none; }
.cap-played[hidden] { display: none; }
.cap-played i { display: block; height: 100%; background: rgba(255, 255, 255, 0.9); transform-origin: left; transform: scaleX(var(--t, 0)); }
/* A photo picked, not yet read: its mark, breathing, where it will show. */
.cap-preview.opening::after { content: ''; position: absolute; left: 50%; top: 42%; z-index: 1; width: 64px; height: 64px; margin: -32px 0 0 -32px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc857' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='m3 17 5.5-6 4 4.5 2.5-2.5L21 18'/%3E%3Ccircle cx='16' cy='8.5' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; animation: photoBreathe 1.6s ease-in-out infinite; }
@keyframes photoBreathe { 0%, 100% { opacity: 0.35; transform: scale(0.94); } 50% { opacity: 0.9; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .cap-preview.opening::after { animation: none; opacity: 0.6; } }
.cap-preview.paused::after { content: ''; position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: rgba(5, 8, 14, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='white'/%3E%3C/svg%3E") center / 34px no-repeat; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); pointer-events: none; animation: panelIn var(--dur) var(--ease); }
#capVid { cursor: pointer; }

/* ---------- Desktop: a window, not a stretched phone ----------
   The sheet is a card at the right; the controls sit in the space left of it;
   settings, the summit log and offline areas open as dialogs over the view,
   the map as a large one; nothing runs the full width of a wide screen. */
@media (min-width: 900px), (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  /* Collapsed, the sheet shows just its title row (no half-cut tabs). */
  .sheet { --peek-d: 78px; transition: transform var(--dur) var(--ease), clip-path var(--dur) var(--ease); clip-path: inset(0 0 0 0 round 20px); }
  .sheet:not(.open) { transform: translateY(calc(100% - var(--peek-d))); clip-path: inset(0 0 calc(100% - var(--peek-d)) 0 round 20px); box-shadow: none; }
  .sheet:not(.open) .tabs { visibility: hidden; }
  /* Clear of the compass scale drawn along the bottom. */
  .shutter, #app[data-mode="ar"] .shutter { bottom: calc(52px + var(--safe-b)); }
  .hud, #app[data-mode="ar"] .hud { bottom: calc(64px + var(--safe-b)); left: calc(16px + var(--safe-l)); }
  #app[data-mode="ar"] .fabs { bottom: calc(24px + var(--safe-b)); }
  #moreMenu { right: calc(var(--side) + 88px + var(--safe-r)); bottom: calc(24px + var(--safe-b)); transform-origin: 100% 100%; }
  .time-bar { right: calc(var(--side) + 96px + var(--safe-r)); } /* clear of the buttons beside it */
  /* Camera mode: the zoom over the shutter, the messages over the zoom. */
  #app[data-mode="ar"] .toast { bottom: calc(196px + var(--safe-b)); }
  #hereBar, #app[data-mode="ar"] .align-bar { bottom: calc(196px + var(--safe-b)); }
  #app[data-mode="ar"]:has(#hereBar:not([hidden])) .align-bar { bottom: calc(204px + var(--safe-b) + var(--here-h, 58px)); }
  #app[data-mode="ar"]:has(#alignBar:not([hidden])) .toast { bottom: calc(254px + var(--safe-b)); }
  #app[data-mode="ar"]:has(#alignBar:not([hidden])):has(#hereBar:not([hidden])) .toast { bottom: calc(262px + var(--safe-b) + var(--here-h, 58px)); }
  #app[data-mode="ar"]:has(#hereBar:not([hidden])) .toast { bottom: calc(204px + var(--safe-b) + var(--here-h, 58px)); }
}
/* A big screen (not a phone on its side): panels open as dialogs over the view. */
@media (min-width: 900px) and (min-height: 561px) {
  /* Dialogs: centred, with the view dimmed behind. */
  #setPanel, #logPanel, #offPanel, #photosPanel {
    inset: 0; margin: auto; width: min(640px, calc(100% - 48px)); height: min(86vh, 900px); padding-top: 0;
    border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
    box-shadow: 0 0 0 100vmax rgba(4, 8, 16, 0.6), 0 30px 80px rgba(0, 0, 0, 0.6);
  }
  #mapPanel, #trekPanel {
    inset: 0; margin: auto; width: min(1200px, calc(100% - 48px)); height: min(90vh, 1000px); padding-top: 0;
    border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
    box-shadow: 0 0 0 100vmax rgba(4, 8, 16, 0.6), 0 30px 80px rgba(0, 0, 0, 0.6);
  }
  :is(#setPanel, #logPanel, #offPanel, #mapPanel, #photosPanel, #trekPanel) .panel-head { padding: 12px 12px 12px 20px; }
  #setPanel .form, #offPanel .form { max-width: none; padding-left: 20px; padding-right: 20px; }
  .log-body { max-width: none; padding-left: 20px; padding-right: 20px; }

  /* The share screen keeps its bars to the card's width. */
  .cap-top { width: min(720px, 100%); margin: 0 auto; }
}
/* A long checkbox label wraps beside its box, not under it. */
.form label.row { flex-wrap: nowrap; }
.form label.row input { flex: none; }

/* A phone zooms the page into any text box set smaller than 16 px (iOS), and
   doesn't zoom back: text boxes are 16 px on touch screens. */
@media (pointer: coarse) {
  input[type="text"], input[type="search"], input:not([type]), input[type="number"], select, textarea { font-size: 16px; }
}
/* No double-tap zoom on buttons (the view has its own). */
html { touch-action: manipulation; }

/* An offer with a button (install Altura, reload for a new version): under
   the top bar, out of the way of the view's own controls. */
.offer {
  position: absolute; z-index: 24; left: 50%; top: calc(var(--safe-t) + 70px); transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px;
  border-radius: 16px; background: #1c2a42; border: 1px solid rgba(255, 200, 87, 0.45); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 13.5px; line-height: 1.35; animation: panelIn var(--dur) var(--ease);
}
.offer span { flex: 1; min-width: 0; }
.offer .btn { flex: none; margin: 0; padding: 8px 14px; background: var(--accent); color: #1b1404; border: 0; }
.offer-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; }
.offer-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- the drone (js/drone.js) ---------- */
#app:not([data-gfx="gl"]) #flyBtn { display: none; }
#app.drone-on > :not(canvas, video, #drone, #toast) { visibility: hidden !important; }
.drone { position: absolute; inset: 0; z-index: 30; touch-action: none; user-select: none; -webkit-user-select: none; }
.drone[hidden] { display: none; }
.drone-top { position: absolute; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); top: calc(var(--safe-t) + 10px); display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.drone-top > * { pointer-events: auto; }
.drone-top .btn, .drone-top .btn.small { min-height: 44px; padding: 0 18px; } /* Done: a finger's size (over .btn.small's 40 px) */
.drone-tag { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 600; font-size: 13px; }
.drone-tag svg { width: 16px; height: 16px; }
.drone-lift { position: absolute; right: calc(18px + var(--safe-r)); top: 50%; height: min(42vh, 280px); width: 36px; transform: translateY(-50%); border-radius: 18px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); touch-action: none; transition: opacity var(--dur-fast); }
.drone-lift::before { content: ""; position: absolute; left: 50%; top: 14px; bottom: 14px; width: 2px; margin-left: -1px; background: var(--line); border-radius: 1px; }
.drone-lift i { position: absolute; left: 50%; bottom: 50%; width: 24px; height: 24px; margin: 0 0 -12px -12px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
.drone-lift.off { opacity: 0.45; pointer-events: none; }
/* Follow the ground: under the slider; lit while on. Beside its foot where the screen is short (the bar is near). */
.drone-follow { position: absolute; right: calc(18px + var(--safe-r)); top: calc(50% + min(21vh, 140px) + 10px); width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: inherit; }
.drone-follow[hidden] { display: none; }
.drone-follow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.drone-follow .trace, .drone-follow .flat { stroke-dasharray: 2 2.6; }
.drone-follow[aria-pressed="false"] .trace, .drone-follow[aria-pressed="true"] .flat { display: none; }
.drone-follow[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1a1405; }
@media (max-height: 700px) { .drone-follow { right: calc(62px + var(--safe-r)); top: calc(50% + min(21vh, 140px) - 36px); } }
/* Where am I: home's way on a dial that turns with the view (up is ahead), and how far. */
.drone-where { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: inherit; font: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.drone-where[hidden] { display: none; }
.drone-where svg { width: 32px; height: 32px; }
.drone-where .ring { fill: rgba(255, 255, 255, 0.06); stroke: var(--line); }
.drone-where .n, .drone-where .to { transform-origin: 18px 18px; transform-box: view-box; }
.drone-where .n path { fill: #ff6b6b; }
.drone-where .to path { fill: var(--accent); }
.drone-top.full .drone-tag-text { display: none; } /* REC and the dial both up: the tag keeps its icon only */
/* Over the height slider, not under it: under it, the trek bar (taller, and
   raised by the gesture bar) came up to it (14 Nov, S24). */
.drone-lift-text { position: absolute; right: calc(10px + var(--safe-r)); top: calc(50% - min(21vh, 140px) - 10px); transform: translateY(-100%); padding: 4px 9px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.drone-bar { position: absolute; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(var(--safe-b) + 16px); display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); font-size: 14px; font-weight: 600; }
.drone-bar #droneMsg { min-width: 0; overflow: hidden; padding: 0 4px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; text-wrap: balance; } /* two lines at most, even: a hint read whole on a small phone */
.drone-acts { display: flex; flex-direction: column; gap: 6px; }
.drone-row { display: flex; gap: 6px; }
.drone-row:not(:has(> :not([hidden]))) { display: none; }
.drone-act { flex: 1 1 0; justify-content: center; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); font: inherit; font-size: 13px; color: inherit; }
.drone-act[hidden] { display: none; }
/* Small phones (320–359 px): three to a row ("Back to you" with Hold and Land) on one line each. */
@media (max-width: 359px) { .drone-act { padding: 0 6px; gap: 4px; white-space: nowrap; } }
.drone-act svg { width: 16px; height: 16px; }
.drone-act:active { transform: scale(0.95); }
/* A shot shown before it's made: Push in / Reveal / Orbit, then Record it or Close; the land clear meanwhile. */
.drone-shotbar { display: flex; flex-direction: column; gap: 8px; }
.drone-shotbar[hidden] { display: none; }
.drone-shotbar-kinds { display: flex; gap: 6px; }
.drone-shotbar-note { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.drone-shotbar-note small { font-size: 12px; font-weight: 500; opacity: 0.8; }
.drone-shotbar-line { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.drone-shotbar-line i { display: block; height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(0); will-change: transform; }
.drone-shotbar-kinds .drone-chip { flex: 1 1 0; justify-content: center; height: 40px; font-size: 13px; }
.drone-act-rec { border-color: var(--accent); }
.drone.shooting .drone-acts, .drone.shooting .drone-stick, .drone.shooting .drone-lift, .drone.shooting .drone-lift-text, .drone.shooting .drone-follow, .drone.shooting .drone-treks { display: none; }
.drone-cover { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.drone-cover[hidden] { display: none; }
.drone-trekbar { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.drone-trekbar[hidden] { display: none; }
.drone-trekbar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.drone-trekbar-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--accent); }
.drone-trekbar-where { display: flex; flex-direction: column; min-width: 0; }
.drone-trekbar-where small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text); opacity: 0.85; font-variant-numeric: tabular-nums; }
.drone-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: inherit; font: inherit; font-size: 12px; }
.drone-chip svg { width: 15px; height: 15px; }
.drone-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1a1405; }
/* The track: a finger's height to grab, a thin line drawn in it. */
.drone-trekbar-track { position: relative; height: 28px; touch-action: none; cursor: pointer; }
.drone-trekbar-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--line); }
.drone-trekbar-track .fill { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--accent); transform-origin: left center; transform: scaleX(0); will-change: transform; }
.drone-trekbar-track .marks i { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff6df; box-shadow: 0 0 0 1.5px rgba(10, 16, 26, 0.7); }
.drone-trekbar-track .knob { position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); will-change: left; }
.drone-treks { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 28px + var(--drone-bar-h, 100px)); /* over the bar, however many rows */ display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 16px; background: var(--panel-solid, var(--panel)); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.drone-treks[hidden] { display: none; }
/* The stick: push to fly. Bottom left over the bar (a thumb's reach), clear
   of Android's back swipe at the edge; as high as the bar with its two rows
   of buttons, so it doesn't jump when Back to you comes. */
.drone-stick { position: absolute; left: calc(28px + var(--safe-l)); bottom: calc(var(--safe-b) + 28px + max(var(--drone-bar-h, 100px), 142px)); width: 112px; height: 112px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); touch-action: none; }
.drone-stick[hidden], .drone-treks:not([hidden]) ~ .drone-stick, .drone-pick:not([hidden]) ~ .drone-stick, #app.drone-time .drone-stick { display: none; }
/* A summit tapped: its card over the bar, Fly there under the thumb. */
.drone-pick { position: absolute; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(var(--safe-b) + 24px + var(--drone-bar-h, 100px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--panel-solid, var(--panel)); border: 1px solid var(--accent); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.drone-pick[hidden] { display: none; }
.drone-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drone-pick-text b { font-size: 16px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drone-pick-text small { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drone-pick .btn.small#dronePickFly { flex: none; min-height: 44px; padding: 0 18px; border: 0; background: var(--accent); color: #1a1405; font-weight: 700; }
.drone-pick { flex-wrap: wrap; }
.drone-pick-acts { flex: 1 1 100%; display: flex; gap: 8px; }
.drone-pick-acts .btn { flex: 1 1 0; min-height: 44px; }
.drone-pick-x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 15px; }
/* Recording: a red pill at the top, the button turns to Stop. */
.drone-recpill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: rgba(214, 40, 40, 0.92); color: #fff; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.drone-recpill[hidden] { display: none; }
.drone-recpill i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: rec-blink 1s steps(2, jump-none) infinite; }
@keyframes rec-blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .drone-recpill i { animation: none; } }
.rec-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #e5484d; }
#droneRec.on { border-color: #e5484d; color: #fff; background: rgba(229, 72, 77, 0.18); }
#droneRec.on .rec-dot { border-radius: 2px; } /* a square: stop */
.drone-stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); pointer-events: none; will-change: transform; }
.drone-trek { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; text-align: left; }
.drone-trek:active, .drone-trek:hover { background: rgba(255, 255, 255, 0.06); }
.drone-trek small { color: var(--muted); font-weight: 500; }
.drone-shots .drone-trek b { display: inline-flex; align-items: center; gap: 8px; }
.drone-rec { position: absolute; left: 50%; top: 40%; width: min(320px, calc(100% - 32px)); transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--panel-solid, var(--panel)); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); z-index: 2; }
.drone-rec[hidden] { display: none; }
.drone-rec-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.drone-rec-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.drone-rec-acts { display: flex; gap: 8px; justify-content: flex-end; }
.drone-rec-acts [hidden] { display: none; }
/* The time of day over the drone: the panorama's own bar, over the drone's. */
#app.drone-on.drone-time > #timeBar:not([hidden]) { visibility: visible !important; z-index: 31; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 28px + var(--drone-bar-h, 100px)); }
@media (min-width: 700px) { .drone-bar, .drone-treks, .drone-pick, #app.drone-on.drone-time > #timeBar:not([hidden]) { left: 50%; right: auto; width: 520px; transform: translateX(-50%); } }

/* Alpenglow alerts: the switches under a peak's Alpenglow times, and the list in Settings. */
.glow-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.glow-alert > span { color: var(--muted); font-size: 13px; font-weight: 600; margin-right: 2px; }
.glow-alert .cap-chip[aria-pressed="true"]::before { color: #ffb4a2; }
.glow-alert-note { margin: 8px 0 0; }
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.alert-row div { min-width: 0; }
.alert-row b { display: block; font-size: 14px; font-weight: 600; }
.alert-row small { display: block; color: var(--muted); font-size: 12.5px; }
.alert-row .btn { flex: none; }
/* Your photos: every photo named or tried, kept on the device (photo-store.js). */
.photo-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.photo-list li { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.photo-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; background: none; color: inherit; text-align: left; font: inherit; border-radius: 14px; }
.photo-open:active { background: rgba(255, 255, 255, 0.06); }
.photo-open img { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.photo-open span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.photo-open b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-open small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-chip { flex: none; font-style: normal; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: var(--text); }
.photo-chip.ready { background: var(--accent); color: #1b1404; }
.photo-chip.working { background: rgba(90, 209, 255, 0.18); color: #9fe3ff; }
.photo-chip.failed, .photo-chip.stopped { color: var(--muted); }
.photo-del { flex: none; width: 40px; height: 40px; margin-right: 4px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 15px; }
.photo-del:active { background: rgba(255, 255, 255, 0.07); }
/* Its top: Choose photos, and which photos work best (open while none are named). */
.photos-new p { margin: 0 0 12px; line-height: 1.45; }
.photos-new .btn.big { display: flex; align-items: center; justify-content: center; gap: 8px; }
.photos-new .btn .i { width: 20px; height: 20px; }
.photo-chip.beta { margin-left: 4px; vertical-align: 1px; background: rgba(90, 209, 255, 0.16); color: #9fe3ff; }
.photo-guide { margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); padding: 0 14px; }
.photo-guide summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; font-weight: 600; }
.photo-guide summary::-webkit-details-marker { display: none; }
.photo-guide summary::after { content: ""; width: 8px; height: 8px; border-right: 1.75px solid var(--muted); border-bottom: 1.75px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 0; transition: transform var(--dur); }
.photo-guide[open] summary::after { transform: rotate(225deg); margin: 4px 4px 0 0; }
.pg-tier { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.pg-tier::before { content: ""; box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%; }
.pg-tier.high { color: var(--ok); }
.pg-tier.high::before { background: var(--ok); }
.pg-tier.low { color: var(--accent); }
.pg-tier.low::before { border: 2px solid var(--accent); }
.photo-guide ul { list-style: none; margin: 0 0 10px; padding: 0; }
.photo-guide li { padding: 7px 0 7px 18px; border-bottom: 1px solid var(--line); }
.photo-guide li:last-child { border-bottom: 0; }
.photo-guide li b { display: block; font-size: 14px; font-weight: 600; }
.photo-guide li small { display: block; margin-top: 1px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.pg-note { margin: 4px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(90, 209, 255, 0.08); font-size: 13px; line-height: 1.45; }
.photos-sub { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.photos-none { margin: 0; }
/* From the camera: its photos and videos, two to a row, smaller than the log's. */
.photos-cam { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 0 0 14px; }
.photos-cam .cap-thumb img, .photos-cam .cap-none { aspect-ratio: 3 / 4; }
.photos-cam .cap-thumb span { padding: 6px 8px; font-size: 12px; }
.photos-cam .cap-thumb small { font-size: 10.5px; }
.photos-cam-all { display: block; margin: -4px 0 16px; }
/* The menu's count of finished photos not yet opened, and a dot on its button. */
.menu-dot { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #1b1404; font-style: normal; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; box-sizing: border-box; }
.menu-dot[hidden] { display: none; }
#moreBtn { position: relative; }
/* ::before: ::after is the first launches' word beside it (fab-hints), which made the dot a big pill. */
#moreBtn.has-dot::before { content: ''; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* A photo named behind (or waiting its turn): the menu's dot turns, the button's breathes. */
.menu-dot.busy { min-width: 0; width: 16px; height: 16px; padding: 0; background: none; border: 2px solid var(--accent); border-right-color: transparent; animation: dotSpin 0.9s linear infinite; }
#moreBtn.busy::before { animation: glowDot 1.4s ease-in-out infinite; }
@keyframes dotSpin { to { transform: rotate(360deg); } }
@keyframes glowDot { 50% { transform: scale(1.5); opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .menu-dot.busy, #moreBtn.busy::before { animation: none; } }
/* Under the photo's steps: it takes its time, and they needn't wait for it. */
.cap-steps-note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.cap-steps.quick .cap-steps-note { display: none; }
.cap-steps-note .link { font: inherit; font-weight: 600; padding: 6px 4px; margin: -6px 0; }
.cap-thumb .cap-none { display: block; aspect-ratio: 9 / 12; background: linear-gradient(160deg, #24324a, #0b1322); }
.cap-thumb.video img { outline: 2px solid rgba(255, 200, 87, 0.6); outline-offset: -2px; }

/* Treks (trek-screen.js): chips by country, cards, then one trek's days */
.trek-list, .trek-detail { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.trek-list[hidden], .trek-detail[hidden] { display: none; }
.trek-find { padding: 12px 12px 0; }
.trek-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; position: sticky; top: 0; z-index: 1; background: var(--bg); }
.trek-chips button { flex: none; min-height: 40px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 18px; padding: 6px 14px; font: inherit; font-size: 13px; }
/* Cards scroll under this bar, so its edge is its own colour, not a see-through fade. */
.trek-chips::after { content: ''; flex: none; position: sticky; right: -12px; width: 32px; margin: -10px 0 -10px -6px; background: linear-gradient(90deg, transparent, var(--bg) 70%); pointer-events: none; }
.trek-chips button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #1b1404; font-weight: 600; }
.trek-cards { list-style: none; margin: 0; padding: 4px 12px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.trek-card { width: 100%; display: flex; flex-direction: column; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-solid); color: inherit; font: inherit; text-align: left; transition: transform var(--dur-fast) var(--ease); }
.trek-card:active { transform: scale(0.98); }
.trek-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: linear-gradient(160deg, #23324d, #0e1626 70%); }
.trek-card img.none { visibility: hidden; height: 0; aspect-ratio: auto; }
.trek-card span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.trek-card b { font-size: 15.5px; }
.trek-card small { color: var(--muted); font-size: 12.5px; }
.trek-none { padding: 24px 4px; color: var(--muted); text-align: center; }
.trek-detail { padding: 12px 14px calc(24px + var(--safe-b)); }
.trek-where { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.trek-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.trek-facts li { padding: 4px 10px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.trek-profile { display: block; width: 100%; height: auto; margin: 4px 0 12px; border-radius: 12px; background: var(--panel-solid); }
.trek-profile .ground { fill: rgba(255, 200, 87, 0.14); }
.trek-profile .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.trek-profile .tick { stroke: rgba(255, 255, 255, 0.16); stroke-dasharray: 3 4; }
.trek-profile .top { fill: var(--accent); }
.trek-profile text { fill: var(--muted); font: 600 12px var(--font); }
.trek-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.trek-acts .btn.big { grid-column: 1 / -1; }
.trek-acts .btn.ghost { display: flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; font-weight: 600; }
.trek-acts .btn:disabled { opacity: 0.45; }
.trek-detail h3 { margin: 20px 0 8px; font-size: 15px; }
.trek-detail h3:focus { outline: none; }
.trek-detail p { margin: 0 0 8px; line-height: 1.5; }
.trek-days { margin: 0; padding: 0; list-style: none; }
.trek-days li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.trek-days li b { color: var(--accent); margin-right: 4px; }
.trek-days li small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.trek-days li.rest { color: var(--muted); }
.off-trek { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drone-trek.all b { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .trek-card { transition: none; } }
.trek-budget { overflow-x: auto; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; }
.trek-budget table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.trek-budget th, .trek-budget td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.trek-budget th { color: var(--muted); font-weight: 600; background: var(--panel-solid); }
.trek-budget tr.total td { font-weight: 700; color: var(--accent); border-bottom: 0; }
/* Dev builds, truth switch: a crosshair in the middle of the camera picture to hold a known summit on (js/truth.js pickLandmark). */
.truth-aim { position: fixed; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; pointer-events: none; z-index: 5; }
.truth-aim::before, .truth-aim::after { content: ''; position: absolute; background: #ff3b6b; }
.truth-aim::before { left: 13.5px; top: 0; width: 1px; height: 28px; }
.truth-aim::after { top: 13.5px; left: 0; height: 1px; width: 28px; }

/* ---------- every screen size ---------- */
/* The drone's lists sit clear of its height slider at the right, and never run
   off the top of a short screen (they scroll instead). */
.drone-treks { left: calc(12px + var(--safe-l)); right: calc(66px + var(--safe-r)); max-height: calc(100% - var(--safe-t) - var(--safe-b) - 192px); overflow-y: auto; overscroll-behavior: contain; }
#app.drone-on.drone-time > #timeBar:not([hidden]) { left: calc(12px + var(--safe-l)); right: calc(66px + var(--safe-r)); }
@media (min-width: 700px) { .drone-treks, #app.drone-on.drone-time > #timeBar:not([hidden]) { left: 50%; right: auto; } }

/* The time bar's line: the sun's height stays on one line beside the time. */
.time-row small { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) { .time-chips button { font-size: 12px; letter-spacing: -0.2px; } .time-row b { font-size: 16.5px; } .time-row { gap: 5px; } }
/* A narrow phone (320-359 px): words that are only extra go, so what matters
   isn't cut ("5,341 m gr…", the drone's km line). */
@media (max-width: 359px) {
  .wide-only { display: none; }
  .drone-chip { width: 32px; padding: 0; justify-content: center; }
  .facts b { font-size: 15.5px; }
  .chip.loc { padding-left: 8px; padding-right: 8px; gap: 6px; }
  .chip.loc svg { width: 16px; height: 16px; }
  .loc-text b { font-size: 13.5px; }
  .time-row small { font-size: 11px; letter-spacing: -0.2px; }
}
.facts b { white-space: nowrap; }

/* Short screens: the map keeps a useful size beside the results; the More
   menu comes down to the bottom edge, and scrolls if it still can't fit. */
.menu { max-height: calc(100% - var(--safe-t) - var(--safe-b) - 72px); overflow-y: auto; overscroll-behavior: contain; }
@media (orientation: landscape) and (max-height: 560px) { #moreMenu { bottom: calc(8px + var(--safe-b)); } }
@media (max-height: 600px) {
  .search-area { max-height: 40vh; }
  .map { min-height: 120px; }
}
/* Long text never runs the width of a big screen. */
.hint, #tooOldWhy { max-width: 72ch; }
#tooOld p, #tooOld h1 { margin-left: auto !important; margin-right: auto !important; max-width: 36em; }
.trek-detail { padding-left: max(14px, calc((100% - 760px) / 2)); padding-right: max(14px, calc((100% - 760px) / 2)); }

/* A big screen: the photo's questions keep to the card's width, as its top bar does. */
@media (min-width: 900px) { .cap-place, .cap-fail { width: min(720px, calc(100% - 24px)); margin-left: auto; margin-right: auto; } .cap-place { padding-left: 0; padding-right: 0; } }
/* A phone on its side: the share screen puts the card at the left, its
   choices at the right, so the card is as tall as the screen. */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  .cap-panel { display: grid; grid-template-columns: minmax(0, 1fr) min(420px, 52%); grid-template-rows: auto auto minmax(0, 1fr); }
  .cap-panel > * { grid-column: 2; min-width: 0; }
  .cap-panel > .cap-top { grid-row: 1; width: auto; margin: 0; }
  .cap-panel > .cap-detail { grid-row: 2; }
  .cap-panel > .cap-stage { grid-column: 1; grid-row: 1 / -1; padding: 10px 8px 10px 16px; }
  .cap-panel > .cap-dock, .cap-panel > .cap-fail { grid-row: 3; align-self: center; width: auto; max-height: 100%; overflow-y: auto; background: none; }
  .cap-panel > .cap-fail { margin: 8px 12px calc(8px + var(--safe-b)); }
  .cap-panel > .cap-place { grid-column: 1 / -1; grid-row: 2 / -1; overflow-y: auto; }
  /* Where was it taken: the question at the left, the map and Continue at the right. */
  #capPanel[data-step="place"] .cap-top { grid-column: 1 / -1; }
  .cap-place { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: min-content; column-gap: 16px; align-content: start; padding-left: 16px; padding-right: 16px; }
  .cap-place > * { grid-column: 1; min-width: 0; }
  .cap-place > .cap-place-map { grid-column: 2; grid-row: 1 / span 6; min-height: 180px; }
  .cap-place > .cap-place-name, .cap-place > .cap-place-bar { grid-column: 2; }
  /* Working a photo out, or lining it up by hand: the photo under the top bar, the whole width. */
  #capPanel:is([data-step="finding"], [data-step="check"], [data-step="aligning"]) .cap-stage { grid-column: 1 / -1; grid-row: 2 / -1; }
  #capPanel:is([data-step="finding"], [data-step="check"], [data-step="aligning"]) .cap-top { grid-column: 1 / -1; }
  /* The welcome: the skyline and the line at the left, the choices at the right. */
  .welcome:not(.update) .welcome-inner { width: min(100%, 920px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 28px; align-content: start; align-content: safe center; /* never cut off at the top */ padding-left: calc(20px + var(--safe-l)); padding-right: calc(20px + var(--safe-r)); }
  .welcome-scene { grid-column: 1; grid-row: 1; margin: 0; align-self: end; }
  .welcome-text { grid-column: 1; grid-row: 2; }
  .trips { grid-column: 2; grid-row: 1; margin-top: 0; align-self: end; }
  .welcome-actions { grid-column: 2; grid-row: 2; margin-top: 0; padding-top: 12px; }
  .trip { padding: 9px 14px; }
  .update .welcome-inner { padding-left: calc(20px + var(--safe-l)); padding-right: calc(20px + var(--safe-r)); }
}

/* Finger-sized targets on touch screens: small-looking buttons answer a
   finger's tap around them, without growing (an invisible margin of tap). */
@media (pointer: coarse) {
  .close, .photo-del { width: 44px; height: 44px; }
  .cap-icon, .cap-result { min-width: 44px; height: 44px; }
  .tabs button { min-height: 44px; }
  .form select, .welcome-actions .btn, .update .btn { min-height: 44px; }
  .form label.row { min-height: 44px; }
  .topbar .seg button, .time-chips button, #timeNow, .list-tools .seg button, .field .seg button, .btn.small, .presets button, .trek-chips button,
  .cap-template, .reel-tablist button, .reel-length button, .drone-act, .zoom-bar button, .compass-bar .btn, .trust, .coords button, .cap-from .link, .align-guide .btn, .offer .btn, .glow-alert .cap-chip, .reel-row button { position: relative; }
  .topbar .seg button::before, .time-chips button::before, #timeNow::before, .list-tools .seg button::before, .field .seg button::before, .btn.small::before, .presets button::before, .trek-chips button::before,
  .cap-template::before, .reel-tablist button::before, .reel-length button::before, .drone-act::before, .zoom-bar button::before, .compass-bar .btn::before, .trust::before, .coords button::before, .align-guide .btn::before, .offer .btn::before, .reel-row button::before {
    content: ''; position: absolute; inset: -6px 0;
  }
  .zoom-bar button::before { inset: -6px -3px; }
  .cap-chip { position: relative; }
  .cap-chip::after { content: ''; position: absolute; inset: -6px -2px; }
  .drone-lift::after { content: ''; position: absolute; inset: 0 -5px; }
  .leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
  /* Rows that scroll sideways clip what sticks out: a little room for it. */
  .presets, .trek-chips, .cap-show, .reel-row { padding-top: 7px; padding-bottom: 7px; }
}
/* A small phone upright: the welcome's main button comes into view without
   scrolling (tighter trip rows). */
@media (orientation: portrait) and (max-height: 640px) {
  .welcome h1 { font-size: clamp(30px, 9vw, 40px); }
  .trip b { font-size: 15px; }
  .trips { margin-top: 10px; }
  .trip { padding: 8px 12px; }
  .welcome .trip small { font-size: 12px; }
}

/* Finger-sized targets (an audit at phone size, 12 Nov: these were 22-32 px tall).
   Where a bigger look would crowd the screen, the touch area grows, not the look. */
.btn.small { min-height: 40px; }
.seg[aria-label="Sort by"] button { min-height: 40px; }
.cap-chip { height: 36px; }
.leaflet-container.leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; } /* over Leaflet's own 30 px, which loads later */
details.group.adv summary { min-height: 44px; margin: -11px 0; }
.trust { position: relative; }
.trust::before { content: ''; position: absolute; inset: -7px -4px; } /* the camera's compass chip: 30 px to see, 44 to touch */

/* Camera mode with the phone on its side (it turns with the phone): held as a
   camera app holds it. The picture has the screen; the controls stand in one
   column at the right edge: the shutter half way up, Video above it, the time
   filmed below it, the zoom upright beside it (the larger step on top). The
   messages keep to the top left, clear of the column and of the aiming ring;
   the peak's card shows only once a peak is tapped, as upright, low on the
   right under the column (opened, it covers it, as upright).
   (13 Nov on the S24: the controls sat in a heap under the middle of the view,
   the messages stacked off the top, the card covered a third of the picture.) */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) {
  #app[data-mode="ar"] { --col: calc(var(--safe-r) + 20px); }
  #app[data-mode="ar"]:not([data-picked]) .sheet { opacity: 0; visibility: hidden; }
  #app[data-mode="ar"] .shutter { left: auto; right: var(--col); top: 50%; bottom: auto; transform: translateY(-50%); transition: right var(--dur) var(--ease); }
  #app[data-mode="ar"] .cam-video { left: auto; right: calc(var(--col) + 10px); top: calc(50% - 34px - 16px - 48px); bottom: auto; }
  #app[data-mode="ar"] .rec-badge { left: auto; right: calc(var(--col) + 34px); top: calc(50% + 34px + 14px); bottom: auto; transform: translateX(50%); }
  #app[data-mode="ar"] .cam-last { right: calc(var(--col) + 10px); top: calc(50% + 34px + 16px); bottom: auto; }
  #app[data-mode="ar"] .cam-sound { left: auto; right: calc(var(--col) + 14px); top: calc(50% - 34px - 16px - 48px - 12px - 40px); bottom: auto; }
  #app[data-mode="ar"] .zoom-bar { left: auto; right: calc(var(--col) + 82px); top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column-reverse; }
  #app[data-mode="ar"] .zoom-dial { left: auto; right: calc(100% + 10px); bottom: auto; top: 50%; margin: -22px 0 0; }
  /* The messages: the line-up's and the not-here card along the top left, one under the other; the others low in the middle. */
  #app[data-mode="ar"] .align-bar, #app[data-mode="ar"] #hereBar { top: calc(var(--safe-t) + 68px); bottom: auto; left: calc(16px + var(--safe-l)); right: auto; width: min(380px, calc(50% - 36px - var(--safe-l))); transform: none; }
  #app[data-mode="ar"]:has(#alignBar:not([hidden])) #hereBar { top: calc(var(--safe-t) + 122px); }
  #app[data-mode="ar"] .toast, #app[data-mode="ar"]:has(#hereBar:not([hidden])) .toast, #app[data-mode="ar"]:has(#alignBar:not([hidden])) .toast, #app[data-mode="ar"]:has(#alignBar:not([hidden])):has(#hereBar:not([hidden])) .toast {
    top: auto; bottom: calc(44px + var(--safe-b)); left: calc((100% - var(--col) - 130px) / 2 + 70px); max-width: min(480px, calc(100% - var(--col) - 330px));
  }
  /* A peak tapped: its card low on the right; the messages above it. */
  #app[data-mode="ar"][data-picked] .toast, #app[data-mode="ar"][data-picked]:has(#hereBar:not([hidden])) .toast, #app[data-mode="ar"][data-picked]:has(#alignBar:not([hidden])) .toast, #app[data-mode="ar"][data-picked]:has(#alignBar:not([hidden])):has(#hereBar:not([hidden])) .toast { bottom: calc(118px + var(--safe-b)); }
}

