/* Layout only: where things sit on the menu pages and in the ride HUD. Looks come from components.css. */

/* the page light stays put behind scrolling content: a fixed layer of its own (the GPU just moves the page over it),
   not background-attachment: fixed, which repaints the whole window on every scrolled frame */
body { background: transparent; }   /* html has the base colour; an opaque body would cover the layer below */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--page-bg); pointer-events: none; }

/* ---------- auth pages (login, invite): the card; the page around it is the landing page's (landing.css) ---------- */
.auth-card { width: min(420px, 100%); }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .helptext, .auth-card ul { color: var(--text-muted); font-size: var(--fs-xs); margin: 0; padding-left: 18px; }
.auth-card input { font: inherit; color: var(--text); background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: var(--tap); padding: 10px 14px; width: 100%; }

/* ---------- app shell ---------- */
/* the title bar is fixed, not sticky: when you scroll past the end the page rubber-bands (natively), the bar stays put.
   TopBar.vue keeps --topbar-h up to date, and the page starts below it. */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: calc(10px + var(--safe-t)) calc(18px + var(--safe-r)) 10px calc(18px + var(--safe-l)); border-bottom: 1px solid var(--line); }
/* the bar's glass sits on its own layer: an element with a backdrop-filter hides the page from blurs inside it, so the
   user menu's dropdown (a child of the bar) could not blur what is behind it */
.topbar::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--bar-top); backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass); }
#devstatus { margin-left: auto; flex: none; }
.titleleft { min-width: 0; display: flex; align-items: center; min-height: var(--tap); }
.navtabs { display: flex; gap: var(--s1); }
.usermenu { flex: none; }
.devstatus { min-height: 40px; padding: 0 10px; gap: 4px; color: var(--text-muted); }
.devstatus b { font-size: 14px; }
.devstatus.is-ok { color: var(--ok); } .devstatus.is-warn { color: var(--warn); }
.devstatus.is-busy-dev .icon { animation: spin 1.2s linear infinite; }
/* a page's own content (App.vue wraps it for the page transition) lays out like the page itself */
.page__in { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.page { max-width: 1100px; margin: 0 auto; padding: calc(var(--topbar-h, 69px) + 18px) calc(16px + var(--safe-r)) calc(120px + var(--safe-b)) calc(16px + var(--safe-l)); display: flex; flex-direction: column; gap: var(--s4); }
.startbar { position: sticky; bottom: calc(12px + var(--safe-b)); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s3) var(--s3) 18px; border-radius: var(--r-xl); background: var(--bar); border: 1px solid var(--line); backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.toast--app { top: auto; bottom: calc(100px + var(--safe-b)); }
@media (max-width: 760px) {
  .usermenu__name { display: none; }
  .brand { font-size: 18px; }
  .page { padding-bottom: calc(150px + var(--safe-b)); gap: var(--s3); }
  .card { padding: 14px; }
  .startbar { flex-direction: column; align-items: stretch; }
}
.routesview { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s3); align-items: start; }
.routesview__map { position: sticky; top: calc(var(--topbar-h, 69px) + 12px); height: clamp(260px, calc(100vh - var(--topbar-h, 69px) - 200px), 720px); }
.routesview__side { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.routesview__side h3 { margin: 0; }
@media (max-width: 900px) { .routesview { grid-template-columns: minmax(0, 1fr); } .routesview__map { position: static; height: min(55vh, 560px); } }
@media (max-height: 500px) and (orientation: landscape) { .routesview__map { position: static; height: calc(100vh - var(--topbar-h, 69px) - 24px); } }
.hero-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.hero-actions .btn { min-height: var(--tap-lg); font-size: 17px; padding: 0 28px; box-shadow: none; }
@media (max-width: 560px) { .hero-actions .btn { flex: 1; } }

/* ================= ride HUD ================= */
body.riding { overflow: hidden; background: var(--shade); }
#ride { position: fixed; inset: 0; z-index: 50; overflow: hidden; user-select: none; -webkit-user-select: none; }
.world-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; inset: 0; pointer-events: none; --bottom-h: 120px; --left-w: min(360px, calc(100% - 230px)); --right-w: 160px; --edge: 12px; }
.hud > *, .hud-left > *, .hud-right > * { pointer-events: auto; }
.hud > .hud-fps { position: absolute; top: calc(2px + var(--safe-t)); right: calc(6px + var(--safe-r)); pointer-events: none;
  font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-on-art); opacity: .75; }

/* left column: live numbers, then (in a workout) the steps */
.hud-left { position: absolute; top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l)); width: var(--left-w);
  display: flex; flex-direction: column; gap: var(--s2); pointer-events: none; }
/* one panel for the numbers: live (power, heart rate, cadence, speed) on top, the ride so far below a hairline;
   columns line up so avg W sits under W and avg bpm under bpm */
.dash { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: end; gap: 0 var(--s4); pointer-events: none; }
/* 7-segment numbers (the font's metrics are widened in main.js so changing digits repaint cleanly); the big one is fixed
   at three digits, right-aligned like a real display, so the panel doesn't shift when the number gets shorter */
.dash .stat__value, .wo-head b, .hud-wo .step__time, .pause .stat__value { font-family: var(--font-digits); font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.dash .stat--hero .stat__value { min-width: 2.55em; text-align: right;
  text-shadow: 0 0 10px color-mix(in srgb, currentColor 75%, transparent), 0 0 24px color-mix(in srgb, currentColor 45%, transparent); }   /* glows in its zone colour */
.dash .stat__value { font-size: 22px; }
.dash .stat--hero .stat__value { font-size: 38px; }
.dash em { font-style: normal; text-transform: none; letter-spacing: 0; }
.dash__totals { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.dash__totals .stat__value { font-size: 14px; }
.dash__totals .stat__label { font-size: 10px; }
/* the workout panel, under the numbers: interval N of M · total to go, the current interval (target, % FTP · rpm,
   left / planned) and the next four, then the coaching text */
.hud-wo { display: flex; flex-direction: column; gap: 4px; padding: var(--s2) 10px; }
.wo-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); font-size: var(--fs-xs); color: var(--text-on-art-muted); white-space: nowrap; }
.wo-head b { font-size: 13px; color: var(--text-on-art); }
.wo-head b[data-v="woIdx"] { font-family: var(--font); font-size: var(--fs-sm); }
.hud-wo > .progress { margin-bottom: 4px; }
.hud-wo .step.is-done, .pause__steps .step.is-done { opacity: .5; }
.hud-wo .step__foot { grid-column: 2 / -1; padding: 2px 0 1px; }
.hud-wo .step__foot .progress { height: 3px; }
/* every interval, scrollable (wheel / touch); follows the current one by itself, fading out at the edges */
.hud-wo .steps { gap: 2px; position: relative; max-height: 178px; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent, var(--shade) 8px, var(--shade) calc(100% - 12px), transparent);
  mask-image: linear-gradient(to bottom, transparent, var(--shade) 8px, var(--shade) calc(100% - 12px), transparent); }
.hud-wo .steps::-webkit-scrollbar, .pause__steps::-webkit-scrollbar { display: none; }
.hud-wo__list { position: relative; }
.hud-wo__now { position: absolute; left: calc(50% - var(--round-sm) / 2); bottom: 6px; width: var(--round-sm); height: var(--round-sm); z-index: 1; }   /* back to the current interval */
/* the pause menu's complete list: number, target, % FTP · rpm, start in the workout (muted), duration */
.pause__steps { position: relative; max-height: 300px; overflow-y: auto; scrollbar-width: none; gap: 2px; }
.pause__steps .step__label { min-width: 1.6em; text-align: right; }
.pause__steps .step__time { font-family: var(--font-digits); font-weight: 700; font-size: 12px; line-height: 1.2; }
.pause__steps .step__time:nth-last-of-type(2) { color: var(--text-muted); }
.pause__steps .step { grid-template-columns: 4px minmax(0, 1fr) auto auto; min-height: var(--tap); cursor: pointer; }   /* tap → Jump here */
.pause__steps .step:hover { background: var(--fill); }
.pause__steps .step.is-picked { background: var(--hud-on); opacity: 1; }
.pause__jump .btn { white-space: nowrap; flex: none; }
.pause__jump { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s1) 0 var(--s2) var(--s3); }
.hud-wo .step:not(.is-now) .step__sub { display: none; }
.hud-wo .step.is-now .step__title { font-size: 17px; }
.wo-text { font-size: var(--fs-xs); color: var(--text-on-art-muted); }
.cad-ok { color: var(--ok); } .cad-off { color: var(--warn); }

/* right column: minimap, then gradient + route, then nearby riders */
.hud-right { position: absolute; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); width: var(--right-w); display: flex; flex-direction: column; gap: 6px; align-items: stretch; pointer-events: none; }
.minimap { width: 160px; height: 160px; border-radius: 50%; background: var(--glass); border: var(--hud-border) solid var(--line-strong); cursor: pointer; backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.hud-info { display: flex; flex-direction: column; gap: 0; padding: 2px 8px 4px; border-radius: var(--r-sm); }
.hud-info__top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; line-height: 1.2; }
.hud-grade { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-info .profile { width: 100%; height: 18px; display: block; }
.hud-info .routeinfo { font-size: 10px; opacity: .75; white-space: nowrap; }
.hud-friends { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); pointer-events: none; }
.hud-friends .panel { display: flex; gap: 8px; align-items: center; padding: var(--s1) 8px; font-size: 13px; }

.hud-side { position: absolute; right: calc(var(--edge) + var(--safe-r)); bottom: calc(var(--edge) + var(--safe-b));   /* bottom-right corner; the chart stops left of it */
  display: flex; flex-direction: column; gap: 10px; align-items: center; }
/* behind the FAB: ERG / SIM, harder / easier, camera – a column opening upwards (or, without room above, a row to the
   left: .is-left, decided on opening), a bit smaller than the persistent buttons */
.hud-fab { position: relative; width: var(--round); height: var(--round); }
.hud-more { position: absolute; bottom: calc(100% + 10px); left: 0; width: var(--round); display: flex; flex-direction: column-reverse; gap: 8px; align-items: center; }
.hud-more.is-left { bottom: auto; left: auto; width: auto; top: calc((var(--round) - var(--round-sm)) / 2); right: calc(100% + 10px); flex-direction: row-reverse; }
.hud-more > * { display: flex; }
.hud-more .btn--round { width: var(--round-sm); height: var(--round-sm); }
.hud-more .hud-adj { flex-direction: column; }
.hud-more.is-left .hud-adj { flex-direction: row-reverse; }
.hud-more > * { opacity: 0; visibility: hidden; translate: 0 40px; scale: .8;     /* closed: tucked into the FAB (translate/scale leave the press bounce's transform alone) */
  transition: opacity .18s, translate .22s ease-in, scale .22s ease-in, visibility 0s .22s; }
.hud-more.is-left > * { translate: 40px 0; }
.hud-more.is-open > * { opacity: 1; visibility: visible; translate: 0 0; scale: 1;      /* open: out, springy */
  transition: opacity .22s, translate .38s var(--ease-bounce), scale .38s var(--ease-bounce), visibility 0s; }
.hud-more.is-open > :nth-child(2) { transition-delay: .04s; } .hud-more.is-open > :nth-child(3) { transition-delay: .08s; } .hud-more.is-open > :nth-child(4) { transition-delay: .12s; }
.hud-more:not(.is-open) > :nth-child(3) { transition-delay: .03s, .03s, .03s, .25s; }    /* closing: the far one first */
.hud-more:not(.is-open) > :nth-child(2) { transition-delay: .06s, .06s, .06s, .28s; }
.hud-more:not(.is-open) > :nth-child(1) { transition-delay: .09s, .09s, .09s, .31s; }
[data-act="more"] .icon { animation: fab-turn .3s var(--ease-bounce); }
@keyframes fab-turn { from { transform: rotate(-90deg) scale(.7); } }
@media (prefers-reduced-motion: reduce) { .hud-more > *, .hud-more.is-open > * { transition: none; } [data-act="more"] .icon { animation: none; } }
.hud-adj { display: flex; align-items: center; gap: var(--s1); background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.hud-adj span { font-size: 13px; font-weight: 750; min-width: 50px; text-align: center; }

/* bottom centre: junction choice (and anything else down there), stacked so they never overlap */
.hud-stack { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h) + 20px + var(--safe-b)); width: min(460px, calc(100% - 200px));
  display: flex; flex-direction: column-reverse; align-items: center; gap: var(--s2); pointer-events: none; }
.hud-stack > * { pointer-events: auto; }
/* junction choice: quiet – no box, a small distance label and the choices as glass buttons side by side */
.junction { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.junction .row { gap: 6px; }
.junction .btn { justify-content: flex-start; gap: 6px; padding: 0 10px; font-size: 14px; background: var(--glass); border-color: var(--line-strong);
  color: var(--text-on-art-muted); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); box-shadow: none; }
.junction .btn.is-on { background: var(--hud-on); border-color: var(--text-on-art); color: var(--text-on-art); }
.jdist { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--glass); }

/* bottom: power + heart-rate history, then the road ahead */
/* bottom: power + heart-rate history, full width, drawn straight over the world (no box) */
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--bottom-h) + var(--safe-b)); padding: 0 calc(var(--round) + 2 * var(--edge) + var(--safe-r)) var(--safe-b) var(--safe-l); pointer-events: none; }
.history { display: block; width: 100%; height: 100%; }
.hud .toast { background: var(--glass); border: var(--hud-border) solid var(--line-strong); color: var(--text-on-art); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);   /* the same glass as every HUD panel */
  position: absolute; top: auto; bottom: calc(var(--bottom-h) + 150px + var(--safe-b)); }
.celebrate { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }   /* workout finished: fireworks over the HUD */
.sync-dot { position: absolute; left: calc(4px + var(--safe-l)); top: calc(4px + var(--safe-t)); width: 10px; height: 10px; border-radius: 50%; background: var(--ok); opacity: .8; }
.sync-dot.is-warn { background: var(--warn); } .sync-dot.is-bad { background: var(--bad); }

/* paused: the world slows to a stop while it blurs and dims; the cards come in across the screen (no sheet) */
.pause-ov { place-items: start center; padding-top: 0; background: transparent; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
  transition: background .8s ease, backdrop-filter .8s ease, -webkit-backdrop-filter .8s ease; }
.pause-ov.is-on { background: var(--pause-veil); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pause { width: min(1100px, 100%); margin: auto 0; padding-top: calc(var(--s4) + var(--safe-t)); display: flex; flex-direction: column; gap: var(--s3); transition: opacity .3s, translate .3s; }
.pause-ov:not(.is-on) .pause { opacity: 0; translate: 0 12px; }
.pause__head { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
  position: sticky; top: var(--safe-t); z-index: 2; background: var(--sheet-grad); box-shadow: var(--shadow); }   /* Resume / End ride stay in reach while the cards scroll */
.pause__title { display: flex; flex-direction: column; gap: 2px; }
.pause__title h1 { margin: 0; }
.pause__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-auto-flow: dense; gap: var(--s3); }
.pause__wide { grid-column: 1 / -1; }
.pause__ftp { display: flex; flex-direction: column; gap: var(--s1); }
.pause__ftp .row { flex-wrap: nowrap; }
.pause__group { display: flex; flex-direction: column; gap: 4px; }
.pause__group + .pause__group { padding-top: var(--s3); border-top: 1px solid var(--line); }
.pause__group .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2) var(--s3); }   /* both rows on the same four columns */
.pause__group .stat { min-width: 0; }
.pause__group .stat__value, .pause__group .stat__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pause__span2 { grid-column: span 2; }                 /* This ride: room for four numbers side by side */
@media (max-width: 720px) { .pause__span2 { grid-column: auto; } }
@media (max-width: 560px) { .pause__group .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pause__sub { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.pause__wo { display: flex; flex-direction: column; gap: 2px; }
.pause__wo .chart { height: 40px; margin-top: var(--s2); background: none; }
@media (max-width: 560px) { .modal .link-row__media .thumb--workout { width: 120px; height: 44px; } }
.pause__chart { display: block; width: 100%; height: 96px; }
.pause__btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.pause__btns .btn { justify-content: flex-start; white-space: nowrap; }
.pause-ov.is-fresh .card { animation: pause-card .55s var(--ease-bounce) both; animation-delay: calc(.25s + var(--i, 0) * .06s); }
@keyframes pause-card { from { opacity: 0; translate: 0 24px; scale: .96; } }
@media (prefers-reduced-motion: reduce) { .pause-ov, .pause { transition: none; } .pause-ov.is-fresh .card { animation: none; } }

/* the big map */
.mapov { display: flex; flex-direction: column; place-items: stretch; gap: 10px; background: var(--scrim-strong);
  padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); }
.mapwrap { position: relative; flex: 1; min-height: 0; min-width: 0; }
/* browse: world tabs (smaller than on Ride now), the map, and the world's routes beside it (below on phones) */
.mapov__worlds { flex: none; }
.mapov__worlds .tabstrip__tab { width: 160px; height: 54px; }
.mapov__body { flex: 1; min-height: 0; display: flex; gap: 10px; }
.mapov__side { width: 340px; flex: none; display: flex; flex-direction: column; gap: var(--s2); overflow-y: auto; }
.mapov__side h3 { margin: 0; }
.mapov__side > * { flex: none; }   /* scroll the column, don't squeeze the rows */
@media (min-width: 561px) { .mapov__side .choice { grid-template-columns: 28px minmax(0, 1fr) repeat(2, 56px); gap: var(--s2); } }
@media (max-width: 560px) { .mapov .map-summary { display: none; } }   /* the phone map is small: the route list says enough */
@media (max-width: 800px) { .mapov__body { flex-direction: column; } .mapov__side { width: auto; max-height: 40%; } }
@media (max-height: 500px) and (orientation: landscape) { .mapov__worlds .tabstrip__tab { height: 44px; } .mapov__side { width: 280px; } .mapov__body { flex-direction: row; } .mapov__side { max-height: none; } }
.bigmap { width: 100%; height: 100%; display: block; border-radius: var(--r-lg); background: var(--map-ground); border: 1px solid var(--line); cursor: crosshair; }
.map-summary { position: absolute; top: 10px; left: 10px; display: grid; grid-template-columns: auto auto; gap: 8px 18px; pointer-events: none; }
.map-summary .stat__value { font-size: 22px; }
.map-legend { position: absolute; bottom: 10px; left: 10px; font-size: 12px; display: flex; gap: 12px; pointer-events: none; }
.map-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.tp-confirm { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s2) var(--s3); width: max-content; max-width: calc(100% - 20px); }
.loading { position: absolute; inset: 0; z-index: 9; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); color: var(--text-muted);
  letter-spacing: .16em; text-transform: uppercase; font-size: 13px; transition: opacity .6s; }

/* ---- phones and small windows ---- */
@media (max-width: 700px), (max-height: 500px) {
  .hud { --bottom-h: 84px; }
  .hud-info .profile { height: 16px; }
  .hud-grade { font-size: 12px; }
  /* phones: the numbers, map and charts shrink so more of the world shows; buttons keep their full size */
  .hud { --bottom-h: 60px; --edge: 8px; --right-w: 92px; --left-w: calc(100% - 124px); }
  .dash { gap: 0 var(--s2); padding: 5px 8px; border-radius: var(--r-sm); }
  .dash .stat__value { font-size: 13px; } .dash .stat--hero .stat__value { font-size: 21px; }
  .dash .stat__label { font-size: 8px; letter-spacing: .05em; }
  .dash__totals { margin-top: 3px; padding-top: 3px; }
  .dash__totals .stat__value { font-size: 10px; } .dash__totals .stat__label { font-size: 7px; }
  .hud-left, .hud-right { top: calc(var(--edge) + var(--safe-t)); }
  .hud-left { left: calc(var(--edge) + var(--safe-l)); } .hud-right { right: calc(var(--edge) + var(--safe-r)); gap: 4px; }
  .minimap { width: 92px; height: 92px; }
  .hud-info { padding: 1px 6px 2px; }
  .hud-info .profile { height: 12px; }
  .hud-grade { font-size: 11px; } .hud-info .routeinfo { font-size: 9px; }
  .hud-friends { display: none; }
  .hud-wo { gap: 2px; padding: 5px 8px; border-radius: var(--r-sm); }
  .hud-wo .steps { max-height: 132px; }
  .wo-head, .wo-text { font-size: 9px; }
  .hud-wo .step--mini .step__title { font-size: 12px; } .hud-wo .step.is-now .step__title { font-size: 14px; }
  .hud-wo .step--mini .step__time, .hud-wo .step--mini .step__sub { font-size: 10px; }
  .hud-side { gap: 8px; }
  .hud-stack { width: calc(100% - 2 * var(--edge)); }
  .junction .btn { font-size: 13px; padding: 0 10px; }
  .hud .toast { bottom: auto; top: calc(200px + var(--safe-t)); }
}
@media (max-width: 700px) and (orientation: portrait) {
  .hud .toast { top: auto; bottom: calc(var(--bottom-h) + 200px + var(--safe-b)); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .hud { --left-w: 230px; }
  .wo-text { display: none; }
  .hud-wo .steps { max-height: 70px; }               /* about three intervals fit above the bottom chart */
  .hud-side { flex-direction: row; }   /* pause at the right edge, the FAB left of it, its row further left */
  .hud-bottom { padding-right: calc(2 * var(--round) + 8px + 2 * var(--edge) + var(--safe-r)); }
}

/* ---------- profile ---------- */
.profile-hero { display: flex; align-items: center; gap: var(--s6); flex-wrap: wrap; padding: var(--s2) 0; }
.profile-hero__main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.profile-hero__name { font-size: var(--fs-xl); line-height: 1.15; margin: 0; }
.profile-hero__actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s4); }
@media (max-width: 560px) { .profile-hero { flex-direction: column; text-align: center; } .profile-hero__main { align-items: center; } .profile-hero__actions { justify-content: center; } }

/* ---------- forms: rows of fields in equal columns that always span the card (stacked on phones) ---------- */
.form-cols { display: grid; gap: var(--s3) var(--s4); align-items: start; }
.form-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .form-cols { grid-template-columns: minmax(0, 1fr); } }

/* the finish overview (FinishRide.vue): the pause menu's tiles over the paused ride – the world shows through the veil –
   scrolling on its own; the fireworks / confetti canvas sits fixed behind the cards; the actions are the sticky top tile */
.finish { position: fixed; inset: 0; z-index: 50; overflow-y: auto; display: flex; justify-content: center; background: var(--pause-veil);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 0 calc(var(--s3) + var(--safe-r)) calc(var(--s4) + var(--safe-b)) calc(var(--s3) + var(--safe-l)); }
.finish__fx { position: fixed; inset: 0; pointer-events: none; }
.finish__inner { position: relative; margin: auto 0; }   /* centred both ways; scrolls from the top when taller than the screen */
.finish__hero { padding-top: calc(var(--s4) + var(--safe-t)); display: flex; flex-direction: column; gap: 2px; }   /* on the veil, above the tiles */
.finish__hero h1 { margin: 0; font-size: 34px; }
.finish__inner { padding-top: 0; }
.finish__line { margin: 0; }
/* the head tile: the name field and the buttons on one row, the same height; "Name" above the field, the upload note
   under the buttons from Save & upload's left edge (never widening them) */
.finish__head { display: grid; grid-template-columns: minmax(180px, 1fr) auto; grid-template-areas: "label ." "name btns" ". msg"; gap: var(--s1) var(--s3); align-items: stretch; }
.finish__namelabel { grid-area: label; }
.finish__name { grid-area: name; height: auto; }
.finish__btns { grid-area: btns; display: grid; grid-template-columns: repeat(4, auto); gap: var(--s2); }
.finish__btns .btn { justify-content: center; white-space: nowrap; }
.finish__msg { grid-area: msg; margin: 0; max-width: 0; min-width: 100%; }
@media (max-width: 900px) {
  .finish__head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "name" "btns" "msg"; }
  .finish__btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.finish .card { animation: pause-card .55s var(--ease-bounce) both; animation-delay: calc(.15s + var(--i, 0) * .06s); }
@media (prefers-reduced-motion: reduce) { .finish .card { animation: none; } }
