/* GAID app. Brand from the landing page and logo: navy + sky from the mark, blue for actions,
   lime only for "listening to you". One family: Inter. */
@font-face {
  font-family: Inter;
  src: url('/brand/inter-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #002453;
  --sky: #008efb;
  --blue: #0067eb;
  --blue-press: #0052bd;
  --lime: #e6f45c;
  --ink: #17211c;
  --muted: #59675f;
  --faint: #8c9891;
  --line: #dfe6e1;
  --mist: #f2f5f3;
  --surface: #ffffff;
  --danger: #b4321f;
  --r-lg: 28px;
  --r-md: 16px;
  --r-sm: 12px;
  --lift: 0 -1px 0 rgba(0, 36, 83, 0.04), 0 -18px 40px rgba(0, 36, 83, 0.12);
  --float: 0 6px 20px rgba(0, 36, 83, 0.14);
  --safe-b: env(safe-area-inset-bottom);
  --safe-t: env(safe-area-inset-top);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; height: 100dvh; background: var(--mist); }
body { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 600; font-size: 16px;
  text-decoration: none; transition: background-color .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
@media (hover: hover) { .btn-primary:hover:not(:disabled) { background: var(--blue-press); } }
.btn-primary:disabled { background: #9db9e6; }
.btn-quiet { background: var(--mist); color: var(--ink); }
@media (hover: hover) { .btn-quiet:hover { background: #e6ece8; } }
.btn-quiet.danger { color: var(--danger); }
.btn-small { padding: 8px 16px; font-size: 14px; background: var(--mist); color: var(--blue); }
.btn-small.done { background: #e9f6ee; color: #1d7a45; }
.btn-xl { width: 100%; min-height: 56px; font-size: 17px; }
.btn-text { background: none; border: 0; color: var(--blue); font-weight: 600; padding: 12px; font-size: 15px; }
.btn-text.inline { padding: 0; font-size: inherit; }

/* ── the map ── */
#map { position: fixed; inset: 0; z-index: 0; background: #e9eeeb; }
/* OpenStreetMap is busy: calm it down so the guide's own markers stand out. */
.leaflet-tile-pane { filter: saturate(.3) contrast(.9) brightness(1.05); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .7) !important; }
.leaflet-bottom { bottom: var(--sheet-h, 260px); transition: bottom .3s; }
.leaflet-tooltip { font-family: Inter, sans-serif; font-size: 12px; border-radius: 8px; }
.walker-dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--sky); border: 3px solid #fff;
  box-shadow: 0 0 0 7px rgba(0, 142, 251, .2), 0 2px 6px rgba(0, 36, 83, .35);
}

/* ── top bar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.glass {
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 4px 16px rgba(0, 36, 83, .12);
}
.mark {
  height: 30px; width: auto; padding: 8px 11px; border-radius: 16px; box-sizing: content-box;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 4px 16px rgba(0, 36, 83, .12);
}
.where { flex: 1; min-width: 0; display: flex; justify-content: center; }
.where-line {
  max-width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  padding: 7px 16px; border-radius: 16px; color: var(--navy);
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 4px 16px rgba(0, 36, 83, .12);
}
.where-line b, .where-line span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where-line b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.where-line span { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.where-line span:empty { display: none; }
.where-line:empty { display: none; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; border: 0; flex: none;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center; box-shadow: 0 4px 16px rgba(0, 36, 83, .2);
}
.avatar.big { width: 52px; height: 52px; font-size: 20px; box-shadow: none; }

/* ── the sheet ── */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  max-height: 72dvh; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--lift);
  padding: 22px 20px calc(1px + var(--safe-b));
}
/* Sits in the space that used to be the sheet's bottom margin: no extra height. */
.disclaimer { order: 99; margin: -12px 0 0; font-size: 11px; line-height: 13px; color: var(--faint); text-align: center; }
.sheet > * { flex-shrink: 0; }
.now { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex-shrink: 1; overflow: hidden; }
.state { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.status { font-size: 14px; font-weight: 600; color: var(--muted); }
.pill { font-size: 12px; font-weight: 600; background: var(--mist); color: var(--muted); border-radius: 999px; padding: 3px 9px; }

/* The voice line: five bars that move while the guide talks. */
.wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.wave i { width: 3px; height: 6px; border-radius: 2px; background: var(--line); transition: background-color .2s; }
body[data-state='speaking'] .wave i { background: var(--sky); animation: bar 1s ease-in-out infinite; }
body[data-state='speaking'] .wave i:nth-child(2) { animation-delay: -.8s; }
body[data-state='speaking'] .wave i:nth-child(3) { animation-delay: -.45s; }
body[data-state='speaking'] .wave i:nth-child(4) { animation-delay: -.65s; }
body[data-state='speaking'] .wave i:nth-child(5) { animation-delay: -.2s; }
body[data-state='speaking'] .status { color: var(--navy); }
body[data-state='listening'] .wave i { background: var(--ink); animation: bar .5s ease-in-out infinite; }
body[data-state='connecting'] .wave i { background: var(--sky); animation: blink 1.2s ease-in-out infinite; }
body[data-state='connecting'] .wave i:nth-child(2) { animation-delay: .15s; }
body[data-state='connecting'] .wave i:nth-child(3) { animation-delay: .3s; }
body[data-state='connecting'] .wave i:nth-child(4) { animation-delay: .45s; }
body[data-state='connecting'] .wave i:nth-child(5) { animation-delay: .6s; }
@keyframes bar { 0%, 100% { height: 5px; } 50% { height: 18px; } }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.greeting {
  margin: 0; font-size: 30px; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; color: var(--navy);
  text-wrap: balance;
}
/* The guide's words, as it says them: the heart of the screen. */
.caption {
  font-size: 22px; line-height: 1.38; font-weight: 500; letter-spacing: -.012em; color: var(--ink);
  overflow-y: auto; max-height: 9.7em; min-height: 0; flex-shrink: 1; text-wrap: pretty;
  scrollbar-width: none;
}
.caption::-webkit-scrollbar { display: none; }
.caption:empty { display: none; }
.hint { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); max-width: 46ch; }
body.walking .greeting, body.walking .hint { display: none; }
body.walking .caption:empty { display: block; }
/* While the guide is still finding its words: three soft dots. */
body.walking .caption:empty::before { content: ''; display: block; width: 46px; height: 12px;
  background: radial-gradient(circle, var(--line) 4px, transparent 4.5px) 0 50% / 16px 12px repeat-x; }
body.walking[data-state='speaking'] .caption:empty::before { animation: think 1.2s ease-in-out infinite; }
@keyframes think { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ── controls ── */
.controls { display: flex; align-items: stretch; gap: 10px; }
.btn-start {
  flex: 1; min-height: 60px; border: 0; border-radius: 999px; background: var(--blue); color: #fff;
  font-size: 18px; font-weight: 650; letter-spacing: -.01em; transition: background-color .15s, transform .1s;
}
@media (hover: hover) { body:not(.walking) .btn-start:hover:not(:disabled) { background: var(--blue-press); } }
.btn-start:active:not(:disabled) { transform: scale(.98); }
.btn-start:disabled { opacity: .55; }
.ask, .ctl { display: none; }

/* During a walk: three round controls, like a call screen. End · Ask · Pocket. */
body.walking .controls {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; justify-items: center; gap: 0; padding: 2px 8px 0;
}
body.walking .btn-start, body.walking .ctl, body.walking .ask {
  background: none; border: 0; padding: 0; min-height: 0; border-radius: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
body.walking .ctl:not([hidden]) { display: flex; }
.orb, body.walking .btn-start::before {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mist); color: var(--navy); transition: transform .12s, background-color .15s;
}
.orb svg { width: 24px; height: 24px; }
/* "End" is drawn with CSS: the app script sets this button's text itself. */
body.walking .btn-start { font-size: 0; color: transparent; }
body.walking .btn-start::before {
  content: ''; background: var(--mist) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7' y='7' width='10' height='10' rx='2.5' fill='%23b4321f'/%3E%3C/svg%3E") center / 26px no-repeat;
}
body.walking .btn-start::after { content: 'End'; font-size: 12.5px; color: var(--muted); }
body.walking .btn-start:active::before, .ctl:active .orb { transform: scale(.94); }

body.walking .ask { display: flex; touch-action: none; }
.ask .ask-label { color: var(--navy); font-weight: 650; }
.orb-ask {
  width: 80px; height: 80px; background: var(--navy); color: #fff;
  box-shadow: 0 10px 24px rgba(0, 36, 83, .3), 0 0 0 7px rgba(0, 142, 251, .12);
}
.orb-ask svg { width: 30px; height: 30px; }
.ask:active .orb-ask { transform: scale(.96); }
.ask.listening .orb-ask { background: var(--lime); color: var(--ink); animation: ring 1.3s ease-out infinite; }
.ask.listening .ask-label { color: var(--ink); }
@keyframes ring {
  0% { box-shadow: 0 10px 24px rgba(0, 36, 83, .25), 0 0 0 0 rgba(230, 244, 92, .9); }
  100% { box-shadow: 0 10px 24px rgba(0, 36, 83, .25), 0 0 0 22px rgba(230, 244, 92, 0); }
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.45); } }

.type-ask { display: none; position: relative; }
body.walking .type-ask { display: flex; }
.type-ask input {
  flex: 1; min-width: 0; border: 0; background: var(--mist); border-radius: 999px;
  padding: 13px 52px 13px 18px; font-size: 16px;
}
.type-ask input:focus { outline: none; box-shadow: 0 0 0 2px var(--blue) inset; background: var(--surface); }
.type-ask input::placeholder { color: var(--faint); }
.type-ask button {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--blue); color: #fff;
  display: grid; place-items: center; transition: background-color .15s, opacity .15s;
}
.type-ask input:placeholder-shown + button { background: #c9d3ce; }
.type-ask button svg { width: 18px; height: 18px; }

/* recording */
.rec-badge { font-size: 14px; font-weight: 600; color: var(--danger); display: flex; align-items: center; gap: 8px; }
.rec-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
.rec-result { background: var(--mist); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.rec-links { display: flex; gap: 8px; flex-wrap: wrap; }
.note { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.45; }

.debug { font-size: 12px; }
.debug pre { white-space: pre-wrap; max-height: 160px; overflow: auto; }
.cards, .log { max-height: 160px; overflow: auto; }

/* ── pocket mode ── */
.pocket { position: fixed; inset: 0; z-index: 5000; background: #000; color: #6f6f6f; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.pocket-inner { text-align: center; padding: 24px; max-width: 320px; }
.pocket-title { font-size: 17px; color: #8a8a8a; margin: 14px 0 6px; }
.pocket-sub { font-size: 13px; margin: 6px 0; }
.pocket-dot { width: 10px; height: 10px; border-radius: 50%; background: #0b3a6b; margin: 0 auto; animation: pulse 2.4s infinite; }
.pocket-hold { height: 3px; background: #1d1d1d; border-radius: 2px; margin: 18px 0 8px; overflow: hidden; }
.pocket-hold span { display: block; height: 100%; width: 0; background: #1f5fa8; }

/* ── forms (settings and sign-up) ── */
.field { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink); }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  padding: 13px 14px; font-size: 16px; font-weight: 400; transition: border-color .15s;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2359675f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: none; }
.field input[aria-invalid='true'] { border-color: var(--danger); }
.pw { position: relative; display: block; }
.pw input { padding-right: 70px; }
.show-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 14px; padding: 8px; }

/* ── chips (mixes and styles): one swipeable row ── */
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -20px; padding: 2px 20px; scroll-padding: 0 20px;
}
.chips::-webkit-scrollbar { display: none; }
/* Soft edge on the right says "there's more: swipe". */
.chips { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chip {
  flex: none; height: 40px; padding: 0 17px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s, transform .1s;
}
.chip:active { transform: scale(.96); }
@media (hover: hover) { .chip:hover { border-color: #b9c6bf; } }
.chip[aria-pressed='true'], .chip[aria-checked='true'] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-hint { margin: -4px 2px 2px; font-size: 13.5px; color: var(--muted); min-height: 1.2em; }

/* ── cards and rows (grouped, like the phone's own Settings) ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  min-height: 54px; padding: 10px 16px; font-size: 15.5px; font-weight: 600; text-align: left;
  background: none; border: 0; color: var(--ink);
}
.row + .row { border-top: 1px solid var(--mist); }
.row-label { min-width: 0; }
.row-label small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.35; }
.row select {
  border: 0; background: transparent; color: var(--blue); font-size: 15.5px; font-weight: 600; text-align: right;
  appearance: none; -webkit-appearance: none; padding: 6px 22px 6px 6px; max-width: 60%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230067eb' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M8 10l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; background-size: 18px;
}
.row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.row-stack textarea {
  border: 0; background: var(--mist); border-radius: 12px; padding: 11px 13px; font-size: 15.5px; font-weight: 400; resize: none;
}
.row-stack textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--blue) inset; background: var(--surface); }
.row-btn { cursor: pointer; color: var(--blue); }
.row-btn.danger { color: var(--danger); }
@media (hover: hover) { .row-btn:hover { background: #f7f9f8; } }

/* ── topic sliders: glide freely, settle on a level; the fill gets bolder as it rises ── */
.sliders { padding: 4px 16px; }
.lv { padding: 12px 0 10px; --f: .33; --c: #2f8af5; }
.lv + .lv { border-top: 1px solid var(--mist); }
.lv-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.lv-name { font-size: 15.5px; font-weight: 600; }
.lv-val { font-size: 14px; font-weight: 650; color: var(--blue); transition: color .2s; }
.lv[data-level='0'] .lv-val { color: var(--faint); }
.lv-range {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.lv-range:focus { outline: none; }
.lv-range::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(to right, var(--c) 0 calc(15px + (100% - 30px) * var(--f)), #e7ece9 0);
}
.lv-range::-moz-range-track { height: 8px; border-radius: 4px; background: #e7ece9; }
.lv-range::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--c); }
.lv-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 3px 8px rgba(0, 36, 83, .22), 0 1px 2px rgba(0, 36, 83, .12);
  transition: transform .12s;
}
.lv-range::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 3px 8px rgba(0, 36, 83, .22); }
.lv-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.lv-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--sky), 0 3px 8px rgba(0, 36, 83, .22); }

/* ── switches ── */
.toggle { cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .sw { flex: none; width: 51px; height: 31px; border-radius: 999px; background: #dfe5e2; position: relative; transition: background-color .2s; }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .18); transition: transform .22s cubic-bezier(.3, .7, .3, 1); }
.toggle input:checked + .sw { background: #34c06a; }
.toggle input:checked + .sw::after { transform: translateX(20px); }
.toggle input:focus-visible + .sw { outline: 3px solid var(--sky); outline-offset: 2px; }

/* ── settings panel ── */
.panel {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 94dvh;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--mist); color: var(--ink);
  box-shadow: var(--lift); overscroll-behavior: contain;
}
.panel[open] { animation: rise .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
.panel::backdrop { background: rgba(0, 20, 45, .35); }
.panel form { padding: 0 20px; display: flex; flex-direction: column; gap: 26px; }
.panel-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -20px; padding: 18px 20px 14px; background: rgba(242, 245, 243, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { display: block; font-size: 18px; letter-spacing: -.01em; }
.who > div { min-width: 0; }
.who > div > span { display: block; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #e3e9e6; color: var(--muted); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.group { display: flex; flex-direction: column; gap: 12px; }
.group h2 { margin: 0 2px; font-size: 13px; font-weight: 650; letter-spacing: .01em; color: var(--muted); }
.panel .note { padding: 0 4px; }
.panel-foot {
  position: sticky; bottom: 0; margin: 0 -20px; padding: 12px 20px calc(14px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(242, 245, 243, 0), var(--mist) 30%);
}
@media (min-width: 700px) {
  .panel { margin: auto; border-radius: var(--r-lg); max-height: 88vh; }
}

/* ── onboarding ── */
.onboard {
  position: fixed; inset: 0; z-index: 3000; background: var(--surface); overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ob-progress {
  position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  padding: calc(14px + var(--safe-t)) 24px 8px; background: var(--surface);
}
.ob-progress i { height: 4px; border-radius: 2px; background: var(--line); transition: background-color .3s; }
.onboard[data-step='1'] .ob-progress i:nth-child(-n+1),
.onboard[data-step='2'] .ob-progress i:nth-child(-n+2),
.onboard[data-step='3'] .ob-progress i:nth-child(-n+3) { background: var(--blue); }
.onboard:not([data-step]) .ob-progress, .onboard[data-step=''] .ob-progress { display: none; }

.ob-screen {
  display: none; flex-direction: column; gap: 18px; max-width: 460px; margin: 0 auto;
  padding: 18px 24px calc(28px + var(--safe-b)); min-height: calc(100dvh - 40px);
}
.ob-screen.on { display: flex; animation: enter .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateX(14px); } }
.ob-screen h1 { margin: 6px 0 0; font-size: 32px; line-height: 1.08; font-weight: 750; letter-spacing: -.03em; color: var(--navy); }
.ob-screen h2 { margin: 8px 0 0; font-size: 18px; font-weight: 700; color: var(--navy); }
.lede { margin: -6px 0 4px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.ob-form { display: flex; flex-direction: column; gap: 16px; }
.form-error { margin: 0; padding: 12px 14px; border-radius: var(--r-sm); background: #fbeceA; background: #fdeeeb; color: var(--danger); font-size: 14px; font-weight: 500; line-height: 1.4; }
.form-error button { border: 0; background: none; color: var(--blue); font-weight: 600; padding: 0; text-decoration: underline; }
.fine { margin: 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.fine a { color: var(--muted); }
.switch { margin: auto 0 0; padding-top: 12px; text-align: center; font-size: 15px; color: var(--muted); }
.back { align-self: flex-start; width: 42px; height: 42px; margin-left: -10px; border: 0; border-radius: 50%; background: none; color: var(--navy); display: grid; place-items: center; }
.back:hover { background: var(--mist); }
.ob-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }

/* welcome: the photo carries it */
.ob-welcome { max-width: none; padding: 0; gap: 0; min-height: 100dvh; position: relative; }
.ob-welcome.on { animation: fade .5s ease; }
@keyframes fade { from { opacity: 0; } }
.ob-photo {
  position: absolute; inset: 0;
  background: url('/brand/walking-london-960.webp') center 60% / cover no-repeat;
}
.ob-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .55) 26%, rgba(255, 255, 255, 0) 44%, rgba(0, 20, 50, .35) 62%, rgba(0, 18, 45, .9) 100%);
}
.ob-welcome-body {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 100dvh;
  max-width: 460px; margin: 0 auto; padding: calc(36px + var(--safe-t)) 24px calc(24px + var(--safe-b));
}
.ob-logo { width: min(64vw, 260px); height: auto; align-self: center; }
.ob-welcome h1 { margin-top: auto; color: #fff; font-size: 40px; line-height: 1.02; letter-spacing: -.035em; font-weight: 780; }
.ob-welcome p { margin: 0 0 10px; color: rgba(255, 255, 255, .86); font-size: 17px; line-height: 1.5; }
.ob-welcome .btn-text { color: #fff; }



/* ── larger screens: the sheet becomes a side panel ── */
@media (min-width: 900px) {
  .sheet {
    left: 20px; right: auto; bottom: 20px; width: 420px; max-height: calc(100vh - 106px);
    border-radius: var(--r-lg); box-shadow: var(--float); padding: 26px;
    justify-content: flex-end;
  }
  body.walking .sheet { top: 86px; }
  /* Disclaimer centred between the last control and the bottom of the card. */
  .sheet { padding-bottom: 12px; }
  .disclaimer { margin-top: -2px; }
  body.walking .now { flex: 1; justify-content: flex-end; }
  .caption { max-height: none; }
  .leaflet-bottom { bottom: 0; }
  .where { justify-content: flex-start; padding-left: 8px; }
}

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

/* while the app checks who you are, show nothing that would flash */
body.booting .sheet, body.booting .topbar { visibility: hidden; }

/* Sign-up screens have wider side padding than the settings panel. */
.ob-screen .chips { margin: 0 -24px; padding: 2px 24px; scroll-padding: 0 24px; }
.ob-screen h2 { margin: 10px 0 -4px; }
