/* Pedal. Its own styles; nothing here is shared with bouchey.dev.
   Menus are paper and ink like the rest of the site. The riding display is built to be
   read from a bike a few metres from a screen: few numbers, large, on solid panels in the menus' look. */
:root {
  --paper: #F6F3ED; --ink: #1F1D1A; --muted: #5B564E; --rule: #D8D2C6; --accent: #9A4527;
  --serif: "Alegreya", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --glass: rgba(24, 22, 19, 0.72);
  --spark: #cfc8ba;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--sans); }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: none; }
body.riding { background: #000; overflow: hidden; }
body.riding #world { display: block; }
body.riding #menu { display: none; }

/* ---------- menus ---------- */
#menu { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
  padding: calc(1.5rem + env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px)) 3rem max(1.25rem, env(safe-area-inset-left, 0px)); }
/* Opened from the home screen (index.html: black-translucent), the phone's own bar is see-through with white words,
   over the top of the page; in a browser that edge has no height, so this band is only there from the home screen.
   In the light look a dark band behind the bar keeps its clock readable over the paper. */
html[data-theme="quiet"] body:not(.riding)::before { content: ''; position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: #0E1113; pointer-events: none; }
/* The top of the menus: the name, the tabs (on a wide screen), the devices button and the rider's initial on one row.
   Before a rider is in, the tagline under them across the whole width; once one is in (body.in), no tagline. */
:root { --safe-b: env(safe-area-inset-bottom, 0px); --tabbar-h: 58px; }
.masthead { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: .75rem; border-bottom: 2px solid var(--ink); padding-bottom: .4rem; min-height: 52px; }
.masthead h1 { grid-column: 1; grid-row: 1; }
.masthead .tabbar { grid-column: 2; grid-row: 1; }
.masthead .bar { grid-column: 3; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.masthead .tagline { grid-column: 1 / -1; grid-row: 2; }
body.in .masthead .tagline { display: none; }
/* the devices button: one drawing for every device */
html #menu .masthead button.tool { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
  border: 1.5px solid transparent; border-radius: 50%; background: transparent; color: var(--ink); box-shadow: none; }
html #menu .masthead button.tool:hover { background: var(--hover, rgba(31, 29, 26, .06)); border-color: var(--rule); }
.tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* its badge at the drawing's lower right says how the devices are together. Its shape says it as well as its colour:
   a tick (the trainer connected), a turning ring (connecting), ! (could not connect, or no resistance control), a play
   mark (the demo rider), nothing (no trainer yet). */
.tool.sensor { position: relative; }
html #menu .masthead button.tool[aria-expanded="true"] { background: var(--hover, rgba(31, 29, 26, .06)); border-color: var(--rule); }   /* its panel is open */
.tool .badge { position: absolute; right: 1px; bottom: 2px; width: 15px; height: 15px; border-radius: 50%; display: none; place-items: center; box-shadow: 0 0 0 2px var(--paper); }
.tool .badge svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tool .badge .fill { fill: #fff; stroke: none; }
/* ready to ride (a trainer connected, or the pretend rider on): no badge, the icon green in a steady green ring
   (Joe, 2 Dec 2026). The button's name still says which. */
html #menu .masthead button#t-devices[data-state="connected"], html #menu .masthead button#t-devices[data-state="demo"] { color: #7CF29C; border-radius: 50%; box-shadow: inset 0 0 0 2px #7CF29C; }
html[data-theme="quiet"] #menu .masthead button#t-devices[data-state="connected"], html[data-theme="quiet"] #menu .masthead button#t-devices[data-state="demo"] { color: #17703E; box-shadow: inset 0 0 0 2px #17703E; }
#t-devices[data-state="connected"] .badge, #t-devices[data-state="demo"] .badge { display: none; }
.tool[data-state="connected"] .badge { display: grid; background: #2B7A3D; }
.tool[data-state="warn"] .badge { display: grid; background: #8A5A00; }
.tool[data-state="failed"] .badge { display: grid; background: #B3261E; }
.tool[data-state="demo"] .badge { display: grid; background: #2F5DA8; }
.tool[data-state="connecting"] .badge { display: block; background: transparent; box-shadow: none; border: 2.5px solid #8A5A00; border-right-color: transparent; animation: badge-turn 1s linear infinite; }
@keyframes badge-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tool[data-state="connecting"] .badge { animation: none; border-style: dotted; } }
/* the rider's face, which opens their menu: the mint circle and a small ▾ beside it, one button (round 2 design,
   3 Dec 2026). The arrow is drawn in the text's colour and says nothing to a screen reader; the button keeps its name. */
html #menu .masthead button.avatar { display: inline-flex; align-items: center; justify-content: center; gap: 2px; flex: none; height: 44px; min-height: 44px; margin: 0; padding: 0;
  border-radius: 0; border: 0; box-shadow: none; background: none; color: var(--ink); font: 700 .95rem/1 var(--sans); letter-spacing: .02em; }
html #menu .masthead button.avatar:hover { background: none; }
html #menu .masthead button.avatar:hover #me-initial { opacity: .88; }
html #menu .masthead button.avatar[aria-expanded="true"] #me-initial { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--accent); }
.me-caret { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* the Devices panel, under the header when the devices button is pressed */
.sensor-panel { margin: .9rem 0 0; }
html #menu .sensor-panel .sp-head { margin: 0 0 .5rem; }
.sensor-panel .sensors { margin: 0; }
.sensor-close { display: flex; justify-content: flex-end; margin: .5rem 0 0; }
h1 { font: 700 2.6rem/1 var(--serif); margin: 0; letter-spacing: -.01em; }
h2 { font: 700 1.5rem/1.2 var(--serif); margin: 2rem 0 .5rem; }
.tagline { margin: .3rem 0 0; color: var(--muted); font-size: .95rem; }
p { margin: .5rem 0; }
.muted, .foot { color: var(--muted); font-size: .92rem; }
.foot { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: .75rem; }
a { color: var(--accent); }
.label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

button, .btn { font: 600 1rem var(--sans); min-height: 44px; padding: .5rem 1rem; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 3px; cursor: pointer; }
button:hover { background: var(--hover, rgba(31, 29, 26, .06)); }
button.strong { background: var(--ink); color: var(--paper); }
button.strong:hover { background: var(--strong-hover, #000); }
button.go { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; min-height: 0; padding: 0; color: var(--accent); text-decoration: underline; font-weight: 400; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }


.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.list h3 { font: 700 1.2rem/1.2 var(--serif); margin: 0; }
.list p { margin: .15rem 0 0; color: var(--muted); font-size: .95rem; }
.list .facts { font-variant-numeric: tabular-nums; color: var(--ink); font-size: .9rem; }
.list .credit { font-size: .8rem; }   /* who a real route's map data is from */
.list .acts { display: flex; gap: .5rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }
/* a route's difficulty: a square tag ruled in ink, one to four short bars rising to the level, then its word in small
   capitals. The word is the signal; the bars repeat it in print, never in colour alone. */
.lvl { display: inline-flex; align-items: center; gap: .35em; padding: 0 .4em; border: 1.5px solid currentColor; border-radius: 0; color: var(--ink);
  font-weight: 700; font-variant-caps: all-small-caps; letter-spacing: .08em; line-height: 1.45; white-space: nowrap; vertical-align: baseline; }
.lvl-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: .7em; }
.lvl-bars i { display: block; width: 3px; box-sizing: border-box; border: 1px solid currentColor; }
.lvl-bars i:nth-child(1) { height: 40%; } .lvl-bars i:nth-child(2) { height: 60%; } .lvl-bars i:nth-child(3) { height: 80%; } .lvl-bars i:nth-child(4) { height: 100%; }
.lvl-bars i.on { background: currentColor; }
.rm-times { margin: .7rem 0 0; font-size: .85rem; }
.spark { display: block; width: 100%; max-width: 22rem; height: 34px; margin-top: .35rem; }

.riders { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.riders button { min-width: 9rem; min-height: 5rem; font: 700 1.4rem var(--serif); }

.sensors { margin: 1rem 0 0; border: 1px solid var(--rule); border-radius: 3px; }
.sensors > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; }
.sensors > div + div { border-top: 1px solid var(--rule); }
.sensors ul { margin: .3rem 0; padding-left: 1.2rem; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--rule); margin-right: .5em; }
.dot.on { background: #3f8a4f; } .dot.wait { background: #d9a431; }
.sensors details { width: 100%; font-size: .9rem; color: var(--muted); }
.sensors summary { cursor: pointer; min-height: 32px; }
.sensors pre { margin: .4rem 0 0; font: 400 .8rem/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; color: var(--ink); }

form.sheet { display: grid; gap: .9rem; max-width: 26rem; margin-top: 1rem; }
form.sheet label { display: grid; gap: .25rem; font-weight: 600; font-size: .95rem; }
form.sheet label small, form.sheet .field small { font-weight: 400; color: var(--muted); }
/* Settings: short sections, each with a small "Saved." beside its heading; signing out and deleting in a box of their own */
form.sheet.settings { gap: 1.9rem; }
.group { display: grid; gap: .9rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--rule); padding-bottom: .3rem; }
.group-head h3 { margin: 0; }
.saved { color: var(--muted); font-size: .85rem; font-weight: 600; }
.group .field-error { margin: -.6rem 0 0; font-size: .9rem; }
.group > p { margin: 0; }
form.sheet.settings + p { margin-top: 1.4rem; }   /* Report a problem, under the sections */
label.check > input { flex: none; align-self: flex-start; margin-top: .2rem; }
input[aria-invalid="true"] { border-color: var(--error, #a12a1b); }
.danger { max-width: 26rem; margin: 2.5rem 0 0; padding: 0 1rem .4rem; border: 1.5px solid var(--error, #a12a1b); border-radius: 3px; }
.danger h2 { margin-top: 1rem; }
html[data-theme="dark"] .danger { border-radius: 2px; }
label.sheet-one { display: grid; gap: .25rem; max-width: 26rem; margin-top: .6rem; font-weight: 600; font-size: .95rem; }
input, select { font: 400 1.05rem var(--sans); min-height: 44px; padding: .4rem .6rem; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--field, #fff); color: var(--ink); width: 100%; }
textarea { display: block; font: 400 1rem/1.4 var(--sans); padding: .4rem .6rem; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--field, #fff); color: var(--ink); width: 100%; resize: vertical; }
#report-text { margin-top: .6rem; font: 400 .8rem/1.4 ui-monospace, Consolas, monospace; }
#report-box .row { margin-top: .6rem; }
.report-pre { margin: .4rem 0 0; font: 400 .8rem/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
#ov-box .list > li > div { min-width: 0; }
input[type="checkbox"] { width: 1.3rem; min-height: 1.3rem; height: 1.3rem; accent-color: var(--accent); }
input[type="range"] { padding: 0; border: 0; accent-color: var(--accent); background: none; }
label.check { display: flex !important; align-items: center; gap: .6rem; font-weight: 400 !important; }
label.check > span > small { display: block; color: var(--muted); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.error { color: var(--error, #a12a1b); font-weight: 600; }
.guide { margin: 1rem 0 0; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: 3px; }
.guide ol { margin: .4rem 0; padding-left: 1.7rem; }
.guide li { margin: .3rem 0; }
.guide p { margin: .4rem 0 0; }
/* feedback (main.js FEEDBACK): "How was that ride?" with Good / Okay / Rough as one ruled row, and "What should we add?" */
.fb .fb-rate { display: flex; margin: .6rem 0 0; }
.fb-rate button + button { border-left: 0; }
.fb-note { display: block; margin-top: .7rem; font-weight: 600; font-size: .95rem; }
.fb-note small { font-weight: 400; color: var(--muted); }
.fb-note textarea, .fb > textarea { margin-top: .35rem; }
.fb .row { margin-top: .6rem; }
.cr-privacy button { min-height: 44px; }
.notice { margin: 1rem 0 0; padding: .5rem .9rem; border-left: 3px solid var(--accent); }
.notice button { margin: .3rem .4rem 0 0; }

.numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0; border-top: 1px solid var(--rule); margin: 1rem 0; }
.numbers div { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
/* the summary's picture of the ride and its caption (rideshot.js): square, ink-ruled, printed */
.share-box { margin: 1rem 0 1.4rem; }
.share-box .shot-img { display: block; width: 100%; max-width: 22rem; height: auto; border: 1.5px solid var(--ink); margin: .3rem 0 .6rem; }
.share-box .caption { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; border: 1.5px dashed var(--muted); padding: .5rem .7rem; margin-top: .3rem; }
.share-box .caption span { flex: 1 1 12rem; }
.numbers b { display: block; font: 700 1.7rem/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.numbers span { color: var(--muted); font-size: .85rem; }

/* ---------- riding display ----------
   Four corners (Joe, 29 Nov 2026): watts and its zone, heart rate and cadence top left; the grade and the rest of the
   numbers top right; the route map bottom left; the buttons bottom right; the road's profile along the bottom. The
   middle is left to the road and the rider. One look in every theme (Joe, 1 Dec 2026): see-through black panels,
   about 60% black with a light blur behind them, light figures and mint, so the road shows through and the figures
   still read over snow, salt and sky. Square corners, thin rules, no rounded ends. The values here are set on
   body.riding so the first-ride tour's notes and the toast, which sit outside #hud, can use them too. */
body.riding {
  --h-panel: rgba(14, 17, 19, .6); --h-raise: rgba(34, 41, 46, .78); --h-edge: rgba(232, 236, 239, .16); --h-rule: rgba(232, 236, 239, .16); --h-ink: #E8ECEF; --h-muted: #B4BCC2;
  --h-blur: blur(6px);
  --h-accent: #7CF29C; --h-warn: #FF8A7A; --h-end-edge: #56616A; --h-num: 700;
  --h-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --h-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  /* the canvases (main.js reads these when a ride starts): the profile, the map and a workout's steps by zone */
  --h-strip: rgba(232, 236, 239, .22); --h-strip-done: #3FA862; --h-strip-mark: #7CF29C; --h-strip-climb: rgba(232, 236, 239, .4);
  --h-map-road: rgba(232, 236, 239, .5); --h-map-done: #7CF29C; --h-map-dot: #FFFFFF; --h-map-ring: #0E1113;
  --h-z1: #4A545B; --h-z2: #3E6B5A; --h-z3: #3A8A60; --h-z4: #3FA862; --h-z5: #62C985; --h-z6: #9AF5B5;
}
/* --hu: a hundredth of the screen's height as it is now (dvh: with a phone browser's own bars taken off), for the
   sizes that follow the height rather than the width */
#hud { --hu: 1vh; }
@supports (height: 1dvh) { #hud { --hu: 1dvh; } }
#hud { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; color: var(--h-ink); pointer-events: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  font-family: var(--h-sans); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
#hud b { font-family: var(--h-mono); font-weight: var(--h-num); letter-spacing: -.03em; white-space: nowrap; }
.panel { background: var(--h-panel); border: 1px solid var(--h-edge); border-radius: 0; padding: 10px 14px; }
.panel, #strip, #bends, #b-map, #hud button, .chip, #banner, #extra { -webkit-backdrop-filter: var(--h-blur); backdrop-filter: var(--h-blur); }
#hud .big span, #hud .stat span, #hud .grade span, #hud .gear span { font: 600 11px/1.25 var(--h-sans); letter-spacing: .09em; text-transform: uppercase; color: var(--h-muted); white-space: nowrap; }

/* the numbers: two panels, top left and top right */
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#hud-main { display: grid; grid-template-columns: auto auto; column-gap: 16px; row-gap: 6px; justify-content: start; }
#hud-right { display: grid; gap: 6px; align-content: start; }
#hud-main, #hud-right { flex: 1 1 0; min-width: 0; }
#zone-box { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; justify-self: start; }
#h-power { font-size: clamp(48px, 16vw, 104px); line-height: 1; }
.grade b, .gear b { font-size: clamp(26px, 8vw, 52px); line-height: 1; }   /* about half the watts (Joe, 1 Dec 2026) */
.big:not(#zone-box) { border-top: 1px solid var(--h-rule); padding-top: 6px; }
.big:not(#zone-box) b { display: block; font-size: clamp(24px, 7.6vw, 44px); line-height: 1.05; }
.big:not(#zone-box) span { display: block; white-space: normal; }
/* the power zone: a bar of six under the watts, filled up to the zone, and its number (Z1 to Z6) by the word */
.zone-bar { order: 1; align-self: stretch; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; height: 5px; margin: 4px 0 4px; }
.zone-bar i { background: var(--h-rule); }
#zone-box .lab { order: 2; }
#h-target { order: 3; font: 600 12px var(--h-mono); color: var(--h-muted); font-style: normal; }
#h-zone { font: var(--h-num) 11px/1 var(--h-mono); font-style: normal; letter-spacing: 0; color: var(--h-ink); border: 1px solid var(--h-muted); padding: 1px 4px; margin-left: 6px; }
#zone-box[data-zone="1"] .zone-bar i:nth-child(-n+1), #zone-box[data-zone="2"] .zone-bar i:nth-child(-n+2), #zone-box[data-zone="3"] .zone-bar i:nth-child(-n+3),
#zone-box[data-zone="4"] .zone-bar i:nth-child(-n+4), #zone-box[data-zone="5"] .zone-bar i:nth-child(-n+5), #zone-box[data-zone="6"] .zone-bar i:nth-child(-n+6) { background: var(--h-accent); }
/* the grade: a mark for up (in the accent) or down (grey); the figure itself stays plain */
.grade { display: grid; justify-items: start; }
.grade span { margin-top: 4px; }
/* the gear, with shifters: a figure the grade's size beside it, after a rule */
.grade-row { display: flex; align-items: flex-start; gap: 10px; }
.gear { display: grid; justify-items: start; border-left: 1px solid var(--h-rule); padding-left: 10px; }
/* on an upright phone the two a size down, so "-12.4" and "24" fit the panel side by side */
.grade-row:has(.gear:not([hidden])) b { font-size: clamp(18px, 6.2vw, 52px); }
@media (orientation: portrait) {   /* and, with the gear beside the grade, their words and rules a little closer */
  #hud .grade-row:has(.gear:not([hidden])) span { letter-spacing: .04em; }
  .grade-row:has(.gear:not([hidden])) { gap: 8px; } .grade-row:has(.gear:not([hidden])) .gear { padding-left: 8px; }
}
.gear[hidden] { display: none; }
.gear span { margin-top: 4px; }
.grade b::before { content: ''; display: inline-block; width: 0; height: 0; margin-right: .12em; vertical-align: .18em; border: .22em solid transparent; border-width: 0; }
.grade.up b::before { border-width: 0 .22em .34em; border-color: transparent transparent var(--h-accent); }
.grade.down b::before { border-width: .34em .22em 0; border-color: var(--h-muted) transparent transparent; }
/* the grade in the small figures, with the same marks (Joe, 3 Dec 2026: the distance is the big one now) */
.slope b::before { content: ''; display: inline-block; width: 0; height: 0; margin-right: .12em; vertical-align: .14em; border: .22em solid transparent; border-width: 0; }
.slope.up b::before { border-width: 0 .22em .34em; border-color: transparent transparent var(--h-accent); }
.slope.down b::before { border-width: .34em .22em 0; border-color: var(--h-muted) transparent transparent; }
/* on a route: how far along of how far in all, then a bar filling as the ride goes */
.lead { min-width: 0; }
#hud .lead .of { margin-top: 2px; }
.lead .of[hidden], .lead .prog[hidden] { display: none; }
.lead .prog { display: block; justify-self: stretch; min-width: 7em; height: 4px; margin-top: 6px; background: var(--h-rule); }
.lead .prog > i { display: block; height: 100%; width: 0; background: var(--h-accent); }
.hud-sec { display: grid; grid-template-columns: auto auto; gap: 4px 14px; justify-content: start; border-top: 1px solid var(--h-rule); padding-top: 6px; }
.stat b { font-size: clamp(15px, 4.4vw, 24px); margin-right: 3px; }
.hud-sec .stat span { display: block; margin-top: 1px; }
/* upright, the right panel is half the screen: everything in it keeps inside that half, a long word ("ft subidos",
   "% de pente") going onto a second line rather than out of the panel */
#hud-right { grid-template-columns: minmax(0, 1fr); }
.hud-sec { grid-template-columns: repeat(2, minmax(0, auto)); }
#hud .hud-sec .stat span, #hud .grade span, #hud .gear span { white-space: normal; }
.grade-row > * { min-width: 0; }
#h-ghost-box span, #h-step-box span { display: block; white-space: nowrap; }   /* the words go under the time, so the panel stays narrow */
#h-step-box b, #h-next-box b { font-size: clamp(14px, 4vw, 22px); display: block; margin: 0; }
/* a workout's step and the next are words of any length (a .zwo file's own, or Spanish and French): they wrap inside
   the panel rather than run out of it */
#hud #h-step, #hud #h-next, #hud #h-step-box span { white-space: normal; overflow-wrap: anywhere; }
#h-ghost-box, #h-step-box, #h-next-box { border-top: 1px solid var(--h-rule); padding-top: 6px; }
#hud #h-cad-target { margin-top: 3px; font: 600 13px var(--h-mono); color: var(--h-accent); }   /* the step's cadence target (coach.js cadText) */

#banner { align-self: center; background: var(--h-panel); border: 1px solid var(--h-edge); border-left: 3px solid var(--h-accent); border-radius: 0; padding: 1.2vh 2vw; font: var(--h-num) clamp(20px, 2.4vw, 34px)/1.2 var(--h-mono); text-align: center; max-width: calc(100vw - 20px); }
#banner small { display: block; font: 600 clamp(13px, 1.3vw, 18px)/1.3 var(--h-sans); color: var(--h-muted); margin-top: .4vh; }

/* the bottom: the map at the left, the buttons at the right, the profile under both */
.hud-bottom { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 10px; }
#strip { grid-column: 1 / -1; width: 100%; height: var(--strip-h); display: block; background: var(--h-panel); border: 1px solid var(--h-edge); }
.hud-bottom { --strip-h: 64px; }
/* the next climb, over the profile's top left corner: its top at the profile's top */
#climb { position: absolute; left: 1px; bottom: calc(var(--strip-h) - 1px); transform: translateY(100%); padding: 2px 8px; background: var(--h-panel);
  font: 500 12px/1.3 var(--h-mono); white-space: nowrap; max-width: calc(100% - 2px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
#climb[hidden] { display: none; }
#bends { grid-column: 1 / -1; display: flex; align-items: center; gap: 1vw; background: var(--h-panel); border: 1px solid var(--h-edge); padding: 4px 8px; font: 500 12px var(--h-mono); }
#bend-ticks { flex: 1; display: flex; gap: 3px; height: max(8px, 1.1vh); min-width: 0; }
#bend-ticks i { flex: 1; background: var(--h-rule); }
#bend-ticks i.on { background: var(--h-accent); }
#bend-ticks i.next { box-shadow: inset 0 0 0 1.5px var(--h-ink); }
#bend-next { white-space: nowrap; }
/* the route map: hidden behind a map button in the corner (Joe, 1 Dec 2026). A tap on the button shows the map there
   for 8 seconds (main.js showMap); a tap on the map makes it bigger, over the road above the buttons, and another small
   again, each tap giving it another 8 seconds. While a message is in the middle of the screen a big map goes back to
   its corner, and returns after. */
#hud #b-mapicon { grid-column: 1; grid-row: 1 / span 2; align-self: end; justify-self: start; padding: 0; transition: opacity .4s; }
#hud #b-map[hidden], #hud #b-mapicon[hidden] { display: none; }
#hud:has(#controls.idle) #b-mapicon { opacity: 0; }
#hud:has(#controls.idle) #b-mapicon, #hud:has(#controls.waking) #b-mapicon { pointer-events: none; }
#hud #b-map { grid-column: 1; grid-row: 1 / span 2; align-self: end; justify-self: start; position: relative; width: min(46vw, 210px); height: min(46vw, 210px);
  min-height: 0; padding: 0; background: var(--h-panel); border: 1px solid var(--h-edge); border-radius: 0; overflow: hidden; cursor: zoom-in; }
/* big (main.js fitBigMap sets its size): on an upright phone it stands over the road, its foot just above the buttons */
#hud #b-map.big { position: absolute; left: 0; bottom: calc(100% + 8px); cursor: zoom-out; }
#hud #b-map { min-width: min(46vw, 210px); }
#ride-map { display: block; width: 100%; height: 100%; }
/* like the buttons, while they are faded the map takes no tap: the tap that brings the buttons back must not also
   make the map big or small (a big map covers much of the screen) */
#hud:has(#controls.idle) #b-map, #hud:has(#controls.waking) #b-map { pointer-events: none; }
/* the sensors and the hill feel: faded with the buttons, except a warning (a sensor reconnecting), which stays */
#chips { grid-column: 2; grid-row: 1; justify-self: end; display: grid; justify-items: end; gap: 3px; }
.chip { transition: opacity .4s; background: var(--h-panel); border: 1px solid var(--h-edge); padding: 2px 6px; font: 500 11px/1.4 var(--h-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--h-muted); white-space: nowrap; }
.chip.off { color: var(--h-warn); border-color: var(--h-warn); font-weight: 700; }
#hud:has(#controls.idle) .chip:not(.off) { opacity: 0; }

/* the buttons: square, solid, a thin rule; 44 px at the least. Faded, they take no taps (main.js wake). */
.controls { grid-column: 2; grid-row: 2; justify-self: end; position: relative; display: grid; grid-template-columns: 52px 52px; gap: 6px; transition: opacity .4s; }
.controls.idle { opacity: 0; }
#hud .controls.idle button, #hud .controls.waking button { pointer-events: none; }   /* a tap on faded buttons only brings them back (main.js wake) */
#hud button { pointer-events: auto; min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid var(--h-edge); border-radius: 0; background: var(--h-panel); color: var(--h-ink);
  font: 600 15px/1 var(--h-sans); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#hud button:hover { background: var(--h-raise); }
#hud button:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }
#hud svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#b-extra svg { fill: currentColor; stroke: none; }
#hud #b-extra[aria-expanded="true"] { border-color: var(--h-accent); color: var(--h-accent); }
/* Easier and Harder drawn as − and +; their words (or "− 10 W") stay the buttons' names */
#hud #b-less, #hud #b-more { font-size: 0; padding: 0; }
#b-less::before, #b-more::before { font: 500 26px/1 var(--h-mono); }
#b-less::before { content: '\2212'; } #b-more::before { content: '+'; }
#hud #b-pause { grid-column: 1 / -1; }
/* End ride: it asks first (main.js endRide). A stop square, and an outline a shade stronger than the others. */
#hud #b-end { grid-column: 1 / -1; margin-top: 12px; border-color: var(--h-end-edge); white-space: nowrap; padding: 0 10px; }
#b-end::before { content: ''; width: 10px; height: 10px; flex: none; background: currentColor; }
/* the buttons used less often, behind "more" */
#extra { position: absolute; z-index: 3; right: calc(100% + 6px); bottom: 0; display: grid; min-width: 200px; background: var(--h-panel); border: 1px solid var(--h-edge); padding: 6px; }
#extra[hidden] { display: none; }
#hud #extra button { justify-content: flex-start; border-color: transparent; min-height: 48px; width: 100%; }
#hud #extra button + button { border-top-color: var(--h-rule); }
#hud #extra button[hidden] { display: none; }
/* the route's music, on or off: a speaker with sound coming out, or crossed out on a dashed button */
#b-music .spk { fill: currentColor; }
#b-music[aria-pressed="true"] .off, #b-music[aria-pressed="false"] .on, #b-sounds[aria-pressed="true"] .off, #b-sounds[aria-pressed="false"] .on { display: none; }
#hud #b-music[aria-pressed="false"], #hud #b-sounds[aria-pressed="false"] { border-style: dashed; color: var(--h-muted); }
/* after the camera button is pressed, the view's name for a moment, beside the buttons */
#view-name { position: absolute; right: calc(100% + 8px); bottom: 110px; background: var(--h-panel); border: 1px solid var(--h-edge); border-left: 3px solid var(--h-accent);
  padding: .3rem .8rem .3rem .65rem; font: 600 13px var(--h-sans); white-space: nowrap; pointer-events: none; }
body.riding #toast { background: var(--h-panel); color: var(--h-ink); border: 1px solid var(--h-edge); border-radius: 0; font-family: var(--h-sans); }

/* a phone on its side, a tablet or a laptop: the numbers in a row in each panel, the buttons in one row */
@media (orientation: landscape) {
  /* each panel as wide as its numbers and words, never squeezed narrower (its words would run out of it); if the
     two cannot sit side by side, the right one goes under the left rather than off the screen */
  .hud-top { flex-wrap: wrap; row-gap: 6px; }
  #hud-main, #hud-right { flex: 0 0 auto; max-width: 100%; }
  #hud-right { margin-left: auto; }
  #hud-main { grid-template-columns: auto auto auto; align-items: end; }
  #zone-box { grid-column: auto; }
  .big:not(#zone-box) { border-top: 0; padding: 0 0 0 14px; border-left: 1px solid var(--h-rule); }
  /* from the width, but no bigger than the height allows: a short, wide window (a laptop's browser with its bars,
     an iPad on its side) keeps the numbers in proportion */
  #h-power { font-size: clamp(44px, min(7vw, calc(var(--hu) * 12)), 104px); }
  .grade b, .gear b, .grade-row:has(.gear:not([hidden])) b { font-size: clamp(24px, min(3.5vw, calc(var(--hu) * 6.4)), 52px); }
  .grade-row { gap: 14px; } .gear { padding-left: 14px; }
  .big:not(#zone-box) b { font-size: clamp(24px, min(3.4vw, calc(var(--hu) * 6)), 48px); }
  .big:not(#zone-box) span { white-space: nowrap; }
  #hud-right { grid-template-columns: auto auto; align-items: end; column-gap: 14px; }
  .hud-sec { border-top: 0; padding: 0 0 0 14px; border-left: 1px solid var(--h-rule); }
  .hud-sec .stat span { display: inline; }
  #hud .hud-sec .stat span, #hud .grade span, #hud .gear span { white-space: nowrap; }
  .stat b { font-size: clamp(14px, min(1.7vw, calc(var(--hu) * 3)), 24px); }
  #h-step-box, #h-next-box { max-width: 12em; }   /* a long step's name wraps in its column */
  /* a workout's step and the next, or the gap to your best, in a third column, so the panel stays two lines high */
  .grade-row, .hud-sec { grid-row: 1 / span 2; }
  #h-ghost-box, #h-step-box { grid-column: 3; grid-row: 1; } #h-next-box { grid-column: 3; grid-row: 2; }
  #h-ghost-box, #h-step-box, #h-next-box { border-top: 0; padding: 0 0 0 14px; border-left: 1px solid var(--h-rule); align-self: center; }
  #h-step-box b, #h-next-box b { font-size: clamp(14px, min(1.7vw, calc(var(--hu) * 3)), 24px); }
  #hud #h-ghost-box span { white-space: normal; max-width: 8em; }   /* "behind your best" on two lines, so the panel fits a phone's width */
  #hud #b-map { width: min(24vw, 40vh, 280px); height: min(24vw, 40vh, 280px); }
  #hud #b-map.big { position: relative; bottom: auto; }
  #hud #b-map { min-width: min(24vw, 40vh, 280px); }
  #chips { display: flex; gap: 4px; }
  .controls { display: flex; flex-wrap: nowrap; gap: 6px; }
  #hud #b-less, #hud #b-more, #hud #b-view, #hud #b-extra { width: 48px; }
  #hud #b-pause { margin-left: 6px; padding: 0 16px; }
  #hud #b-end { margin: 0 0 0 12px; padding: 0 14px; }
  #extra { right: 0; bottom: calc(100% + 6px); }
  #view-name { right: 0; bottom: calc(100% + 6px); }
  .hud-bottom { --strip-h: clamp(40px, 10vh, 100px); }
}
@media (max-height: 500px) and (orientation: landscape) {   /* a phone on its side: a message of several lines set tighter */
  #banner.lines { padding: .4rem 1.2rem; font-size: 1.15rem; line-height: 1.15; }
  #banner.lines small { font-size: .85rem; margin-top: .1rem; }
}
@media (max-height: 420px) {   /* a phone on its side, its browser's own bars on screen: the numbers a size down, room for the bar of bends */
  .panel { padding: 6px 12px; }
  #h-power { font-size: 15vh; }
  .grade b, .gear b, .grade-row:has(.gear:not([hidden])) b { font-size: 8vh; }
  .big:not(#zone-box) b { font-size: 9vh; }
  #hud:has(#bends:not([hidden])) .hud-bottom { --strip-h: 8vh; }
  #climb { font-size: 11px; line-height: 1.2; padding: 1px 6px; }
  #hud:has(#bends:not([hidden])) #b-map { width: min(24vw, 30vh); height: min(24vw, 30vh); min-width: min(24vw, 30vh); }
  #bends { padding: 2px 8px; font-size: 11px; line-height: 1.2; }
  #bend-ticks { height: 6px; }
}
/* A phone on its side (Joe, 2 Dec 2026), or any screen on its side under 760 px wide: one thin strip across the top, sized from the screen's height, so it stays
   about a fifth of it however wide the phone is. Left to right: the watts with their zone (and a workout's target),
   heart rate, cadence, the grade (and gear), time over distance, then a workout's step or the gaps to your best and
   to friends. Speed and feet climbed are left out here. The two panels keep their own boxes (main.js fitBigMap and
   dev.js measure them) but meet with no gap, so they read as one strip. */
@media (orientation: landscape) and (max-height: 520px), (orientation: landscape) and (max-width: 760px) {
  #hud { --sg: 8px; padding-top: max(6px, env(safe-area-inset-top)); gap: 6px; }
  .hud-top { flex-wrap: wrap; gap: 0; align-items: stretch; }   /* in the rare case the two cannot share one line, the right one goes under */
  .panel { padding: 4px var(--sg) 5px; }
  #hud-main { flex: 0 0 auto; column-gap: var(--sg); }
  #hud-right { flex: 1 1 0; min-width: auto; margin-left: -1px; grid-template-columns: auto auto; grid-auto-columns: minmax(auto, max-content);
    column-gap: var(--sg); row-gap: 2px; align-items: end; justify-content: start; }
  #hud .big span, #hud .stat span, #hud .grade span, #hud .gear span { font-size: 10px; letter-spacing: .06em; }
  /* the watts: the figure, its zone's bar and a workout's target beside it, the word and the zone under both */
  #zone-box { display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr auto auto; column-gap: 8px; align-items: end; }
  #h-power { grid-area: 1 / 1 / 3 / 2; font-size: clamp(24px, calc(var(--hu) * 10), 44px); }
  .zone-bar { grid-area: 1 / 2; width: 100%; min-width: 34px; height: 4px; margin: 0 0 3px; }
  #h-target { grid-area: 2 / 2; font-size: 11px; line-height: 1.1; white-space: nowrap; }
  #zone-box .lab { grid-area: 3 / 1 / 4 / 3; }
  #h-zone { font-size: 10px; padding: 0 3px; margin-left: 4px; }
  .big:not(#zone-box) { padding-left: var(--sg); }
  .big:not(#zone-box) b, .grade b, .gear b, .grade-row:has(.gear:not([hidden])) b { font-size: clamp(17px, calc(var(--hu) * 6.2), 30px); }
  .grade span, .gear span { margin-top: 1px; }
  .grade-row { gap: var(--sg); } .gear { padding-left: var(--sg); }
  /* time over distance, each with its word beside it; speed and climbing left out */
  .hud-sec { grid-template-columns: auto; gap: 0; padding-left: var(--sg); align-self: stretch; align-content: space-between; }
  #hud-left .stat:has(#h-speed), #hud-left .stat:has(#h-climb) { display: none; }
  .stat b { font-size: clamp(14px, calc(var(--hu) * 5.4), 24px); line-height: 1.1; }
  .hud-sec .stat span { margin-left: 2px; }
  /* a workout's step: its name, the time left in it and the cadence to hold on one line, the next step under it.
     A name too long for the room ends in "…"; in less room still the time left and the cadence go under it. */
  #h-ghost-box, #h-step-box, #h-next-box, #h-friends { padding-left: var(--sg); max-width: none; }
  #h-step-box { grid-column: 3; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 7px; align-self: end; }
  #h-next-box { grid-column: 3; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; align-self: start; }
  #hud #h-step { flex: 0 1 auto; min-width: 2.2em; max-width: 9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(13px, calc(var(--hu) * 4.4), 18px); }
  #hud #h-step-box span { display: inline; white-space: nowrap; font-size: 11px; letter-spacing: .03em; }
  #hud #h-cad-target { margin-top: 0; font-size: 11px; letter-spacing: 0; }
  #hud #h-cad-target:empty, #hud #h-cad-target[hidden] { display: none; }
  #hud #h-next { order: 1; min-width: 0; white-space: nowrap; font-size: 12px; }
  #h-next-box span { letter-spacing: .03em; }
  /* on a route: the gap to your best, then up to three friends' gaps in a column, names ending in "…" if long */
  #h-ghost-box { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  #hud #h-ghost-box span { max-width: 7.5em; white-space: normal; }
  /* (the friends' column: under "friends on a route", further down) */
  /* the workout's bar along the bottom at half its height, the blocks ahead and where you are still on it */
  #hud:has(#h-step-box:not([hidden])) .hud-bottom { --strip-h: clamp(20px, 5vh, 50px); }
}
@media (min-width: 1000px) and (min-height: 600px) {   /* a laptop or a television: the words a size up, the buttons a little bigger */
  #hud .big span, #hud .stat span, #hud .grade span, #hud .gear span, #h-zone { font-size: 13px; }
  #climb { font-size: 14px; }
  .chip { font-size: 12px; }
  #hud button { font-size: 16px; min-height: 48px; }
  #hud #b-less, #hud #b-more, #hud #b-view, #hud #b-extra { width: 52px; }
}
@media (prefers-reduced-motion: reduce) { .controls, .chip, #hud #b-mapicon { transition: none; } }

/* the times between bends on the summary */
.splits-head { margin: 1.6rem 0 0; }
.splits { list-style: none; margin: .6rem 0 1rem; padding: 0; columns: 2 15rem; column-gap: 1.5rem; }   /* read down, then across */
.splits li { break-inside: avoid; display: grid; grid-template-columns: 1fr auto 4.8em; align-items: baseline; gap: .6rem; padding: .35rem 0; border-top: 1px solid var(--rule); }
.splits li span { color: var(--muted); }
.splits li b { font-variant-numeric: tabular-nums; }
.splits li em { font-style: normal; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.splits li.lo em { color: var(--accent); }
/* the app's own "are you sure?" box, in place of the browser's confirm() */
#ask { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .45); }
#ask[hidden] { display: none; }
.ask-box { background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 4px; padding: 1.2rem; max-width: 26rem; width: 100%; display: grid; gap: 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.ask-box p { margin: 0; }
.ask-box label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
.ask-box input { font: 600 1.05rem var(--sans); padding: .5rem .6rem; min-height: 44px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink); letter-spacing: .08em; }
.ask-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
/* On the riding screen ("End this ride?", main.js endRide) the box takes the riding screen's look whatever the menus'
   theme: see-through black, a little darker than the panels so the question reads over the road, square, light words,
   and two big buttons side by side, Keep riding ruled and End ride filled. */
body.riding #ask { background: rgba(0, 0, 0, .3); }
body.riding #ask .ask-box { background: rgba(14, 17, 19, .82); color: var(--h-ink); border: 1px solid var(--h-edge); border-radius: 0; box-shadow: none;
  -webkit-backdrop-filter: var(--h-blur); backdrop-filter: var(--h-blur); max-width: 24rem; padding: 1.4rem; gap: 1.2rem; font-family: var(--h-sans); text-shadow: none; }
body.riding #ask .ask-box p { font: 700 1.35rem/1.25 var(--h-sans); text-align: center; }
body.riding #ask .ask-buttons { flex-wrap: nowrap; gap: .6rem; }
body.riding #ask .ask-buttons button { flex: 1 1 0; min-height: 52px; padding: 0 .8rem; border-radius: 0; font: 600 1.05rem/1.1 var(--h-sans); }
body.riding #ask .ask-buttons button:not(.go) { background: transparent; border: 1px solid var(--h-muted); color: var(--h-ink); }
body.riding #ask .ask-buttons button:not(.go):hover { background: var(--h-raise); }
body.riding #ask .ask-buttons button.go { background: var(--h-ink); border: 1px solid var(--h-ink); color: #0E1113; }
body.riding #ask .ask-buttons button.go:hover { background: #FFFFFF; }
body.riding #ask .ask-buttons button:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 3px; }
#toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: 3px; max-width: 90vw; z-index: 5; }

@media (max-width: 700px) {
  .list > li { flex-direction: column; align-items: stretch; }
  .list .acts { justify-content: flex-start; }
}

/* leaderboard */
.board-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 .5rem; }
.board-controls label { display: flex; gap: .5rem; align-items: center; margin: 0 0 0 auto; }
.board-controls select { width: auto; }
/* Rank by: a row of square, ink-ruled tags, an icon and a word each; the chosen one filled. On a phone the icon sits over the word, five
   across, joined in one ruled strip. */
.rank { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin: 0 0 .75rem; }
.rank > span { font-weight: 600; font-size: .95rem; }
.rank-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
html #menu .rank-chips button { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .35rem .8rem; border-radius: 0; font-size: .95rem; }
.rank-chips svg { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html #menu .rank-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 560px) {
  .rank { display: grid; }
  .rank-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  html #menu .rank-chips button { flex-direction: column; justify-content: center; gap: .15rem; padding: .35rem .1rem; border-radius: 0; font-size: .78rem; line-height: 1.1; }
  html #menu .rank-chips button + button { margin-left: -1px; }   /* one ruled strip: neighbours share a rule */
  .rank-chips svg { width: 1.45em; height: 1.45em; }
}
@media (max-width: 340px) { html #menu .rank-chips button { font-size: .7rem; } }   /* the smallest phones: Distance and Climbing still fit */
/* Units in Settings: mi and km side by side, in the manner of Sunrise and Sunset */
form.sheet .field { display: grid; gap: .25rem; justify-items: start; font-weight: 600; font-size: .95rem; }
html #menu .seg { margin: 0; }
html #menu .seg button { min-width: 5rem; font-size: 1.05rem; border-radius: 0; }
html #menu .seg button:first-child { border-radius: 3px 0 0 3px; } html #menu .seg button:last-child { border-radius: 0 3px 3px 0; border-left: 0; }
html[data-theme="dark"] #menu .seg button:first-child { border-radius: 2px 0 0 2px; } html[data-theme="dark"] #menu .seg button:last-child { border-radius: 0 2px 2px 0; }
html #menu .seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
/* a chosen chip or unit is filled green, as This week is: mint in the dark look, the paper's dark green in the light one */
html[data-theme] #menu .seg button[aria-pressed="true"], html[data-theme] #menu .rank-chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.list.board > li.me h3 { color: var(--accent); }
.list h3 small { font: 400 .9rem var(--sans); color: var(--muted); }

/* ---------- Friends, at the top of the leaderboard (Joe, 3 Dec 2026) ----------
   Their three latest rides (a row each: face, name · route, time · distance · climb, when; a route ride is a button
   that opens its card), then the week's top three in one ruled strip of three, your own place tinted. Colours come
   from the look's own variables only, so either look restyles it. Kept in this one block. */
.friends { margin: 0 0 1.5rem; }
.fr-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; margin: .75rem 0 .25rem; }
html #menu .fr-head h2 { margin: 0; }
.fr-sub { color: var(--muted); font-size: .9rem; }
html #menu .fr-head button.link { margin-left: auto; min-height: 44px; padding: 0 .1rem; font-weight: 600; text-underline-offset: .2em; }
.fr-head + .share-box { margin: .25rem 0 .75rem; }
.fr-rides { list-style: none; margin: 0; padding: 0; }
.fr-rides > li { border-bottom: 1px solid var(--rule); }
html #menu .friends .fr-ride { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 44px; margin: 0; padding: .7rem 0;
  border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; }
html #menu .friends button.fr-ride:hover { background: var(--hover, rgba(31, 29, 26, .06)); }
.friends .av-m { width: 2.5rem; height: 2.5rem; font-size: .95rem; }
.fr-txt { display: grid; min-width: 0; line-height: 1.3; }
.fr-who { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-who b { font-weight: 700; }
.fr-facts { font-variant-numeric: tabular-nums; font-size: .92rem; }
html[data-theme="dark"] .fr-facts { font-family: "JetBrains Mono", ui-monospace, monospace; }
.fr-when { color: var(--muted); font-size: .88rem; }
.fr-none { margin: .5rem 0; }
.fr-kick { margin: 1rem 0 .35rem; color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.fr-top { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); }
.fr-top > li { display: flex; align-items: center; gap: .45rem; min-width: 0; min-height: 44px; padding: .4rem .6rem; font-variant-numeric: tabular-nums; }
.fr-top > li + li { border-left: 1px solid var(--rule); }
.fr-top > li.me { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.fr-top .pl { color: var(--muted); font-weight: 600; }
.friends .fr-top .av-s { margin: 0; top: 0; }
.fr-top .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-top b { margin-left: auto; white-space: nowrap; font-weight: 700; }
html[data-theme="dark"] .fr-top b { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 600; }
@media (max-width: 699px) {   /* a phone: place, face and number only (the name stays for screen readers) */
  .fr-top > li { flex-wrap: wrap; padding: .4rem .45rem; gap: .3rem; font-size: .9rem; }
  .fr-top .nm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fr-top.tall b { flex-basis: 100%; text-align: right; }   /* a long number ("5,285 ft"): under the face in every cell alike */
}
html #menu h2.board-h { margin-top: 1.5rem; }

/* ---------- looks, menus only ----------
   Light (still called quiet inside: warm paper since 3 Dec 2026) and dark. The two share one structure (the rules
   below say html[data-theme]); only the values differ. js/theme.js follows the device's own setting until the
   rider picks Light or Dark in their menu, and always sets data-theme on <html>; the :root values above are
   only a fallback if that script does not run. Every rule
   is scoped to body:not(.riding) or #menu; the riding display has its own values for each look, on body.riding (above). */
html[data-theme="dark"] body:not(.riding) {
  --paper: #0E1113; --ink: #E8ECEF; --muted: #9AA4AB; --rule: #2A3238; --accent: #7CF29C;
  --serif: "JetBrains Mono", ui-monospace, monospace; --sans: Inter, system-ui, sans-serif;
  --field: #161B1E; --hover: rgba(124, 242, 156, .08); --strong-hover: #FFFFFF; --error: #FF8A7A; --spark: #2F5B3E;
  --on-accent: #0E1113; --card-top: #3A444B;
  color-scheme: dark;
}
/* the light look: warm paper and ink, the dark green for what is chosen (round 2 design, 3 Dec 2026). It has the dark
   look's fonts (theme.js), so both read the same; only the colours change. */
html[data-theme="quiet"] body:not(.riding) {
  --paper: #F6F3ED; --ink: #1F1D1A; --muted: #5B564E; --rule: #D8D2C6; --accent: #17703E;
  --serif: Inter, system-ui, sans-serif; --sans: Inter, system-ui, sans-serif;
  --field: #FFFDF8; --hover: rgba(23, 112, 62, .07); --strong-hover: #3A3630; --error: #A12A1B; --spark: #CFC8BA;
  --on-accent: #FFFFFF; --card-top: #B9B1A3;
  color-scheme: light;
}
html[data-theme="quiet"] body:not(.riding) ::placeholder { color: var(--muted); opacity: 1; }   /* browsers' own grey is barely AA on paper */
html[data-theme] #menu h1 { color: var(--accent); text-transform: uppercase; letter-spacing: -.02em; }
html[data-theme] #menu h2 { font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html[data-theme] .masthead { border-bottom-color: var(--rule); border-bottom-width: 1px; }
/* square corners and thin rules, as the map is: a printed programme on paper, light or dark. On the light paper,
   buttons and fields keep their ink rule. */
html[data-theme] #menu button, html[data-theme] #menu input, html[data-theme] #menu select { border-radius: 2px; }
html[data-theme="dark"] #menu button, html[data-theme="dark"] #menu input, html[data-theme="dark"] #menu select { border-color: var(--rule); }
html[data-theme] #menu button.strong { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
html[data-theme] .sensors { background: var(--panel); border-radius: 2px; }
html[data-theme] .list > li { background: var(--panel); border: 1px solid var(--rule); border-top: 2px solid var(--card-top); border-radius: 0; padding: .9rem 1rem; margin-bottom: .5rem; }
html[data-theme] .list .facts, html[data-theme] .numbers b { font-family: "JetBrains Mono", ui-monospace, monospace; }
html[data-theme="dark"] #menu button.go { color: #0E1113; }

/* ---------- the opening title ----------
   About four seconds, shown by js/intro.js: Pedal's name made of a bike chain, drawn by js/chaintitle.js
   in 3D, or standing still (the SVG in index.html) when there should be no movement. It keeps its own
   backdrop in every look: paper, or the brand's green in Dark, the same as chaintitle.js
   draws behind the 3D, so nothing flickers as that takes over.
   --intro-ready tells that script this stylesheet knows this intro (it was 1 for the rolling wheel), and
   from 3 the first visit's screen below too. */
#intro { --intro-ready: 3; position: fixed; inset: 0; z-index: 20; overflow: hidden; color: #1F1D1A; background: radial-gradient(120% 80% at 50% 42%, #FFFDF8 0%, #F6F3ED 70%); transition: opacity .35s; container-type: size; }
html[data-theme="dark"] #intro { color: #E8ECEF; background: radial-gradient(120% 80% at 50% 42%, #161B1E 0%, #0E1113 70%); }
#intro.out { opacity: 0; }
.intro-stage { position: absolute; inset: 0; }
.intro-still { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: min(84cqw, 30cqh * 3.38); text-align: center; }
.intro-still svg { display: block; width: 100%; height: auto; }
.intro-tag { margin: .9em 0 0; font-size: max(15px, min(4.5cqw, 3.2cqh)); }
.intro-skip { position: absolute; left: 0; right: 0; bottom: 1.5rem; margin: 0; text-align: center; font-size: .85rem; opacity: 0; animation: intro-fade .6s ease-out 1s both; }
@keyframes intro-fade { from { opacity: 0; } to { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .intro-skip { animation: none; opacity: .7; } }

/* ---------- a first visit's opening ----------
   Shown by js/intro.js: the still chain title, the tagline and one big button, on the chain title's own
   backdrop. The tap starts the theme and the flight over the routes (js/flyover.js): the scenes fade in as
   canvases in .first-scenes, the title goes ("airborne"), a line of words sits high over a shot or two, and at the
   end the chain title plays in .first-chain ("landing", "chained"). Fades only: nothing flashes. */
#first { position: fixed; inset: 0; z-index: 21; overflow: hidden; transition: opacity .4s; container-type: size;
  --first-ink: #1F1D1A; --first-back: #F6F3ED; color: var(--first-ink); background: radial-gradient(120% 80% at 50% 42%, #FFFDF8 0%, #F6F3ED 70%); }
html[data-theme="dark"] #first { --first-ink: #E8ECEF; --first-back: #0E1113; background: radial-gradient(120% 80% at 50% 42%, #161B1E 0%, #0E1113 70%); }
#first.out { opacity: 0; pointer-events: none; }
.first-scenes, .first-chain, .first-scenes canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.first-scenes { transition: opacity .5s; }
.first-scenes canvas { display: block; opacity: 0; transition: opacity .1s linear; }
.first-scenes canvas.soft { transition-duration: .5s; }   /* the first scene, under the title; the rest cut in (FADE in flyover.js) */
.first-scenes canvas.on { opacity: 1; }
/* the scene that is ending holds its last picture and drifts closer while the next is built behind it */
.first-scenes canvas.hold { animation: first-hold 2.4s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes first-hold { to { transform: scale(1.07); } }
.first-door { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; transition: opacity .7s; }
.first-word { margin: 0; font: 700 3.4rem/1 var(--serif); letter-spacing: -.01em; }
.first-word.chained-word { width: min(84cqw, 26cqh * 3.38); }
.first-word svg { display: block; width: 100%; height: auto; }
.first-tag { margin: .9em 0 0; font-size: max(15px, min(4.5cqw, 3.2cqh)); }
.first-go { display: inline-flex; align-items: center; gap: .7rem; margin-top: 2.4rem; min-height: 4.4rem; padding: .8rem 2.2rem .8rem 1.8rem; border: 0; border-radius: 0;
  background: var(--first-ink); color: var(--first-back); font: 700 1.45rem/1.1 var(--sans);
  box-shadow: inset 0 0 0 4px var(--first-ink), inset 0 0 0 5px var(--first-back), 5px 5px 0 color-mix(in srgb, var(--first-ink) 22%, transparent); transition: opacity .3s, transform .15s; }
.first-go:hover { background: var(--first-ink); filter: brightness(1.15); }
.first-go:active { transform: scale(.97); }
.first-go:focus-visible, .first-skip:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.first-go:focus-visible { outline: 3px solid var(--first-ink); outline-offset: 4px; }   /* the button is ink on the backdrop: its ring is too */
.first-go svg { width: 1.7rem; height: 1.7rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.first-go span { text-align: left; }
.first-go small { display: block; font-weight: 400; font-size: .85rem; opacity: .85; }
.first-skip { position: absolute; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); min-width: 5rem; border-color: transparent; color: var(--first-ink); opacity: .75; }
/* the line over a shot (flyover.js), as in the promo reel Joe approved (v10, 29 Nov 2026): plain white words in Inter,
   with no box, border or colour, only a soft neutral shadow so they read over bright sky and snow alike. Placed below
   the Alpe's snowy tops (down to 21% of the height: the lens is the same up and down on every phone) and above the
   rider's helmet (from about 32%), at the reel's 30 px on a 390 px phone; a long line is two short ones. Each fades
   in over 0.42 s rising 18 px (easing out), and out in 0.2 s without moving before the next cut. In both looks:
   it is over the pictures, not the backdrop. */
.first-say { position: absolute; left: 50%; top: max(22cqh, calc(env(safe-area-inset-top) + 2.5rem)); transform: translate(-50%, 18px); margin: 0;
  max-width: min(calc(100% - 2.5rem), 9.5em); padding: 0; border: 0; background: none; color: #FFFFFF;
  font: 700 max(1.4rem, min(7.7cqw, 4.2cqh))/1.15 Inter, var(--sans), sans-serif; letter-spacing: -.01em; text-align: center; width: max-content; text-wrap: balance;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 12px rgba(0, 0, 0, .55), 0 0 22px rgba(0, 0, 0, .22);
  opacity: 0; transition: opacity .2s linear, transform 0s linear .2s; }
.first-say.on { opacity: 1; transform: translate(-50%, 0); transition: opacity .42s linear, transform .42s cubic-bezier(.33, 1, .68, 1); }
@media (prefers-reduced-motion: reduce) { .first-say { transform: translate(-50%, 0); } }
#first.landing .first-say { display: none; }
/* flying: the button goes at once, the title as the first scene comes; Skip sits on dark glass over the pictures */
#first.flying .first-go { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
#first.airborne .first-door { opacity: 0; }
#first.flying .first-skip { background: rgba(24, 22, 19, .55); color: #fff; border-color: transparent; opacity: 1; }
/* landing: the pictures go and the title rises in, the tagline on the last chord (--first-chord, set by flyover.js) */
#first.landing .first-scenes { opacity: 0; }
#first.landing .first-door { opacity: 1; transition: none; }
#first.landing .first-go { display: none; }
#first.landing .first-word { animation: first-rise .9s ease-out both; }
#first.landing .first-tag { animation: first-fade .9s ease-out var(--first-chord, 1.7s) both; }
#first.landing .first-skip { background: transparent; color: var(--first-ink); }
#first.chained .first-door { display: none; }
#first.chained .first-skip { display: none; }   /* the chain title is skipped by any tap or key */
/* blend: after a whole flight the chain title fades in over the last scene, which rides on under it (flyover.js XF) */
#first.blend .first-scenes { opacity: 1; transition: none; }
#first.blend .first-chain { animation: first-fade .29s ease-in-out both; }
@keyframes first-rise { from { opacity: 0; transform: translateY(.5em); } to { opacity: 1; transform: none; } }
@keyframes first-fade { from { opacity: 0; } to { opacity: 1; } }

/* morning or evening, on a real route's card */
.when { display: inline-flex; margin-right: .5rem; }
.when button { min-height: 44px; padding: .4rem .7rem; font-weight: 600; border-radius: 0; }
.when button:first-child { border-radius: 3px 0 0 3px; } .when button:last-child { border-radius: 0 3px 3px 0; border-left: 0; }
.when button + button { border-left: 0; }   /* three side by side (the workout cues) */
.when button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
/* ---------- a real route's preview (main.js openPreview, fillPreview) ----------
   On a phone: the card from edge to edge at the top, on a band of its own paper that holds the way back (a square ←
   ruled in the card's ink, clear of the route's name); what the route is like under it; and a bar fixed at the bottom
   with the level, the time, Sunrise or Sunset and Ride. The rest scrolls under the bar. On a wider screen on its side,
   or a phone on its side, the card stands on the left as a framed print, as large as fits, with a column beside it and the bar
   at its foot. Square corners, ruled; no capsules. */
#preview { position: fixed; inset: 0; z-index: 4; background: var(--paper); overflow: hidden; --pv-bar-h: 8rem; --pv-paper: #F0E6CE; --pv-ink: #1E3324; --pv-band: calc(env(safe-area-inset-top, 0px) + 56px); }
#preview[hidden] { display: none; }
body.riding #preview { display: none; }
body.previewing { overflow: hidden; }
.pv-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--pv-bar-h) + 1rem); scroll-padding-bottom: calc(var(--pv-bar-h) + .5rem); }
/* the card's two layers in one 4:5 frame: the picture, and its words over it (js/card.js); the stamp over both */
.pv-card { position: relative; background: var(--pv-paper); padding-top: var(--pv-band); }
.pv-card::before { content: ''; display: block; aspect-ratio: 4 / 5; }   /* holds the card's place while it is full screen */
.pv-card > .pv-frame { position: absolute; left: 0; right: 0; bottom: 0; top: var(--pv-band); }
.pv-frame { container-type: inline-size; overflow: hidden; background: var(--pv-paper); }
.pv-frame img, .pv-frame svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#pv-words.waiting { visibility: hidden; }
/* a tap on the card opens it full screen: a button over the whole card, under the way back */
html #preview button.pv-zoom { position: absolute; left: 0; right: 0; bottom: 0; top: var(--pv-band); z-index: 1; width: auto; min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
html #preview button.pv-zoom:focus-visible { outline: 3px solid #9A4527; outline-offset: -3px; }
/* the way back: a square on the card's paper, ruled in its ink, as the map's locator inset is */
html #preview button.pv-back { position: absolute; z-index: 2; left: max(10px, env(safe-area-inset-left, 0px)); top: calc(env(safe-area-inset-top, 0px) + 6px);
  display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
  border: 1.5px solid var(--pv-ink); border-radius: 0; background: var(--pv-paper); color: var(--pv-ink); box-shadow: 2px 2px 0 rgba(30, 51, 36, .28); }
.pv-back svg { display: block; width: 22px; height: 22px; }
html #preview button.pv-back:hover { background: #E4D7B0; }
html #preview button.pv-back:focus-visible { outline: 3px solid #9A4527; outline-offset: 2px; }
/* to the route before or after (main.js stepPreview): a sideways finger moves the card, the neighbour's picture
   beside it, and up and down stay the page's scroll (touch-action); the neighbours show only while it moves */
.pv-card { overflow: hidden; touch-action: pan-y; }
.pv-card > .pv-frame, .pv-peek { transform: translateX(var(--pv-dx, 0px)); transition: transform var(--pv-ms, 0ms) cubic-bezier(.2, .7, .3, 1); }
.pv-peek { position: absolute; left: 0; right: 0; bottom: 0; top: var(--pv-band); container-type: inline-size; overflow: hidden;
  background: var(--pv-paper); visibility: hidden; pointer-events: none; }
.pv-peek img, .pv-peek svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#pv-peek-prev { translate: calc(-100% - 12px) 0; }   /* 12 px: main.js PV_GAP */
#pv-peek-next { translate: calc(100% + 12px) 0; }
.pv-card.moving .pv-peek:not([data-id=""]) { visibility: visible; }   /* none past the first and last route */
/* which route of how many, with ‹ and › either side: printed in the card's ink on its paper, top right, no boxes */
.pv-nav { position: absolute; z-index: 2; right: max(4px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 6px); display: flex; align-items: center; color: var(--pv-ink); }
.pv-nav[hidden] { display: none; }
.pv-count { min-width: 3.4em; text-align: center; font-size: .8rem; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
html #preview button.pv-step { display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: transparent; color: inherit; box-shadow: none; }
.pv-step svg { display: block; width: 20px; height: 20px; }
html #preview button.pv-step:hover { background: rgba(30, 51, 36, .08); }
html #preview button.pv-step[aria-disabled="true"] { opacity: .3; cursor: default; background: transparent; }
html #preview button.pv-step:focus-visible { outline: 3px solid #9A4527; outline-offset: -3px; }

/* under the card: what the route is like, and the one line of times */
.pv-go { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; padding: 1rem max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.pv-go p { margin: 0; }
.pv-blurb { line-height: 1.45; }
.pv-blurb:empty { display: none; }
/* a route in stages (main.js showStages): a printed list, one row a stage, ruled in ink: its number, name, distance,
   climb and time, what is done, and Ride or Carry on for an open stage. No capsules: square buttons, as the bar's. */
.pv-stages[hidden] { display: none; }
.pv-stages-h { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pv-stage-list { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.pv-st { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) auto; align-items: center; column-gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--rule); }
.pv-st:first-child { border-top: 1.5px solid var(--ink); }
.pv-st-n { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 1.5px solid var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.pv-st[data-state="done"] .pv-st-n { background: var(--ink); color: var(--paper); }
.pv-st[data-state="locked"], .pv-st[data-state="epic"] { color: var(--muted); }
.pv-st[data-state="locked"] .pv-st-n, .pv-st[data-state="epic"] .pv-st-n { border-style: dashed; border-color: var(--muted); }
.pv-st-n svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.pv-go .pv-st-name { font-weight: 600; line-height: 1.25; }
.pv-go .pv-st-facts, .pv-go .pv-st-state { font-size: .82rem; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-st[data-next] .pv-st-state { color: var(--accent); font-weight: 600; }
html #preview .pv-st button { min-height: 44px; min-width: 4.6rem; margin: 0; padding: .3rem .8rem; border-radius: 0; font-size: .9rem; }
html[data-theme="dark"] #preview .pv-st button:not(.go) { border-color: var(--edge2); }
html[data-theme="dark"] #preview .pv-st button.go { color: #0E1113; }
.pv-times[hidden] { display: none; }
.pv-times { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
html #preview button.pv-extras { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 48px; margin: 0; padding: .55rem 0; border: 0; border-radius: 0;
  background: none; color: var(--ink); font: 400 .95rem/1.3 var(--sans); font-variant-numeric: tabular-nums; text-align: left; }
html #preview button.pv-extras:hover { background: none; }
#pv-extras-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-chev { flex: none; font-size: 1.4rem; line-height: 1; color: var(--muted); transition: transform .15s; }
.pv-extras[aria-expanded="true"] .pv-chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .pv-chev { transition: none; } }
.pv-more { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; padding: .1rem 0 .8rem; font-size: .9rem; }
.pv-more[hidden] { display: none; }
.pv-more > * { min-width: 0; }
.pv-go .pv-more .pv-times-head { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pv-fast { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.pv-fast li { display: grid; grid-template-columns: 1.4em auto minmax(0, 1fr) auto; align-items: center; column-gap: .35rem; border-top: 1px solid var(--rule); padding: .35rem 0; line-height: 1.25; }
.pv-fast li:first-child { border-top: 1.5px solid var(--ink); }
.pv-fast .pl { font-weight: 700; }
.pv-fast .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-fast b { font-variant-numeric: tabular-nums; }
.pv-fast li.me .nm, .pv-fast li.me .pl { color: var(--accent); font-weight: 700; }
.pv-you, .pv-race { font-variant-numeric: tabular-nums; }
.pv-race { display: flex; align-items: baseline; gap: .3rem; }
.pv-race span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-race button.link { flex: none; min-height: 44px; margin-left: auto; padding: 0 .2rem; }

/* the bar: the level over the time on the left, Sunrise or Sunset over Ride on the right; with a saved place, Carry on
   is the main button and Start over is under it, beside how far the journey has come */
.pv-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem .75rem;
  padding: .6rem max(16px, env(safe-area-inset-right, 0px)) calc(.6rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--paper); border-top: 1.5px solid var(--ink); }
.pv-bar p { margin: 0; }
.pv-tag { grid-column: 1; grid-row: 1; }
.pv-tag .lvl { font-size: .95rem; }
.pv-light { grid-column: 2; grid-row: 1; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }   /* the season (seasons.js) over Sunrise or Sunset */
.pv-light:empty { display: none; }
.pv-light .when { margin: 0; }
html #preview .pv-light .when button { min-height: 40px; padding: .2rem .7rem; font-size: .9rem; }
/* looks that open with stamps (tiers.js): each group with, under it, how many stamps open its greyed choices */
.pv-light .look { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
html #preview .when button.look-locked { color: var(--muted); border-style: dashed; background: transparent; display: inline-flex; align-items: center; gap: .25rem; }
html #preview .when button.look-locked svg { width: .85em; height: .85em; fill: none; stroke: currentColor; stroke-width: 2.2; }
.when-need { margin: 0; font-size: .74rem; color: var(--muted); }
.pv-weather:empty { display: none; }
.pv-weather { margin: .2rem 0 .9rem; }
.pv-weather .label { margin: 0 0 .3rem; }
.pv-weather .look { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; }
.pv-weather .when { flex-wrap: wrap; margin: 0; }
html #preview .pv-weather .when button { min-height: 40px; padding: .2rem .7rem; font-size: .9rem; }
.pv-when { grid-column: 1; grid-row: 2; line-height: 1.25; }
.pv-time { font-size: 1rem; font-variant-numeric: tabular-nums; }
.pv-for { display: block; font-size: .8rem; line-height: 1.3; }
#pv-start, #pv-resume { grid-column: 2; grid-row: 2; min-height: 52px; min-width: 9.5rem; font-size: 1.05rem; padding: .5rem 1.1rem; }
.pv-so-far { grid-column: 1; grid-row: 3; font-size: .8rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
#preview.carrying #pv-start { grid-row: 3; min-height: 44px; font-size: .95rem; justify-self: stretch; }
html[data-theme="dark"] #preview .pv-bar { border-top-color: var(--edge2); }
html[data-theme="dark"] #preview button.go { color: #0E1113; }
html[data-theme="dark"] #preview .pv-bar button:not(.go), html[data-theme="dark"] #preview .pv-race-pick button:not(.go):not(.link) { border-color: var(--edge2); }
html[data-theme="dark"] #preview .when button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* who comes along: a sheet over the card, a tick box a rider */
.pv-race-pick { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; max-height: 80%; overflow: auto; background: var(--paper); border-top: 2px solid var(--ink);
  padding: 1rem max(16px, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); box-shadow: 0 -10px 28px rgba(0, 0, 0, .22); }
.pv-race-pick[hidden] { display: none; }
.pv-race-pick h2 { margin: 0 0 .2rem; }
.pv-race-pick p { margin: 0 0 .6rem; }
.pv-race-pick ul { list-style: none; margin: 0 0 .8rem; padding: 0; }
.pv-race-pick li + li { border-top: 1px solid var(--rule); }
.pv-race-pick label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; min-height: 48px; cursor: pointer; }
.pv-race-pick input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.pv-race-pick .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-race-pick b { font-variant-numeric: tabular-nums; }
.pv-race-pick label:has(input:disabled) { color: var(--muted); cursor: default; }
.pv-race-pick button.go { min-height: 48px; min-width: 8rem; position: sticky; bottom: 0; }   /* Done stays in reach on a short screen */

/* the card full screen: on the dark of a lightbox in either look, as large as fits; pinch, drag and double tap are
   main.js's (touch-action: none hands every touch to it), and ✕ in the corner closes it */
.pv-zoomview { position: absolute; inset: 0; z-index: 4; background: #0B0D0E; }
.pv-zoomview[hidden] { display: none; }
.pv-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; container-type: size; display: grid; place-items: center; cursor: zoom-in; }
.pv-stage > .pv-frame { position: relative; width: min(100cqw, 80cqh); height: min(100cqh, 125cqw); transform-origin: 0 0; }
html #preview button.pv-unzoom { position: absolute; z-index: 1; right: max(10px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 10px);
  display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
  border: 1.5px solid var(--pv-ink); border-radius: 0; background: var(--pv-paper); color: var(--pv-ink); box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.pv-unzoom svg { display: block; width: 20px; height: 20px; }
html #preview button.pv-unzoom:hover { background: #E4D7B0; }

/* a wider screen on its side (a tablet or iPad turned, a laptop), any screen 1280 px wide, or a phone on its side: the
   card on the left as a framed print, as large as fits; beside it the route's words, and the bar at the foot of that
   column rather than fixed across the screen. A tablet held upright keeps the phone's way, the card across the whole
   width: beside a column of words it would be a third of the screen. */
@media (min-width: 641px) and (orientation: landscape), (min-width: 1280px), (orientation: landscape) and (max-height: 520px) {
  #preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem); grid-template-rows: minmax(0, 1fr) auto; column-gap: clamp(1rem, 3vw, 2.5rem);
    padding: calc(1rem + env(safe-area-inset-top, 0px)) max(1.5rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) max(1.5rem, env(safe-area-inset-left, 0px)); }
  .pv-scroll { display: contents; }
  .pv-card { grid-column: 1; grid-row: 1 / 3; min-height: 0; padding: 0 0 0 60px; background: none; container-type: size; }   /* 60 px kept for the ← */
  .pv-card::before { display: none; }
  /* the card against the column beside it, the way back in the corner of the space it leaves */
  .pv-card > .pv-frame { inset: 0; margin: auto 0 auto auto; width: min(100cqw, 80cqh); height: min(100cqh, 125cqw);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 10px 28px rgba(0, 0, 0, .22); }
  html #preview button.pv-zoom { inset: 0; margin: auto 0 auto auto; top: 0; width: min(100cqw, 80cqh); height: min(100cqh, 125cqw); }
  .pv-times { border-bottom: 0; }
  html #preview button.pv-back { left: 0; top: 0; }
  /* the neighbours framed as the card is; the card's shadow shows but while it moves */
  .pv-card { overflow: visible; }
  .pv-card.moving { overflow: hidden; }
  .pv-peek { inset: 0; margin: auto 0 auto auto; width: min(100cqw, 80cqh); height: min(100cqh, 125cqw); }
  /* ‹, the count and › down the strip beside the card, under the ←, in the page's ink */
  .pv-nav { left: 0; right: auto; top: 50%; width: 44px; flex-direction: column; color: var(--ink); transform: translateY(-50%); }
  .pv-count { min-width: 0; padding: .3rem 0; font-size: .75rem; letter-spacing: 0; }
  html #preview button.pv-step:hover { background: var(--rule); }
  .pv-go { grid-column: 2; grid-row: 1; align-self: end; align-content: end; max-height: 100%; min-height: 0; overflow-y: auto; padding: 0 0 1rem; }
  .pv-bar { position: static; grid-column: 2; grid-row: 2; padding: .8rem 0 0; background: none; }
  .pv-race-pick { left: auto; top: 0; width: min(24rem, 100%); max-height: none; border-top: 0; border-left: 2px solid var(--ink); }
}
/* a phone on its side: the route's blurb gives way to the times, so the bar keeps its room */
@media (orientation: landscape) and (max-height: 520px) {
  #preview { grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem); }
  .pv-go:has(.pv-times:not([hidden])) .pv-blurb { display: none; }
}

/* ---------- the map on the Routes tab (js/routemap.js) ----------
   A paper print in the route cards' inks, square and ruled in ink, in every look: only the title over it and the
   buttons around it follow the look. Nothing here is a capsule: the print's labels are square, ink-ruled tags with a
   thin leader line to their spot, the counts are circles, and the way back to the world is the print's own locator
   inset, as on an atlas page: a small world with the area outlined in rust, "World" under it, in a corner.
   A route's marker is a button 44 px tall: a 32 px label with room to tap above and below. The rules inside
   the print say html #menu so they win over the looks' button rules. */
.rm-where { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* for screen readers only: it says what the map shows */
.rm-title { font-weight: 600; color: var(--ink); }
.rm-title::after { content: '.'; }
html[data-theme] .rm-title { font-variant-caps: all-small-caps; letter-spacing: .06em; font-size: 1.1em; }
.rm-frame { position: relative; overflow: hidden; width: min(100%, calc((100svh - 7rem) * 2)); aspect-ratio: 2 / 1; margin: 1rem auto 0;
  background: #F0E7CF; border-radius: 0; box-shadow: 0 0 0 1px #1E3324; -webkit-tap-highlight-color: transparent; }
.rm-frame::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(30, 51, 36, .45); border-radius: 0; pointer-events: none; }   /* the print's inner rule */
.rm-world, .rm-leads { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rm-sea { fill: #F0E7CF; }
.rm-grat { fill: none; stroke: #1E3324; stroke-opacity: .12; stroke-width: .6; }
.rm-fine { opacity: 0; } .rm-world.near .rm-fine { opacity: 1; }
.rm-land { fill: #DDD0A4; stroke: #1E3324; stroke-width: .9; stroke-linejoin: round; }
.rm-lake { fill: #F0E7CF; stroke: #1E3324; stroke-width: .6; }
.rm-border { fill: none; stroke: #4F4A40; stroke-width: .8; stroke-dasharray: 3 2; stroke-opacity: .65; }
.rm-state { fill: none; stroke: #4F4A40; stroke-width: .6; stroke-dasharray: 1 2; stroke-opacity: .45; }
.rm-leads line { stroke: #1E3324; stroke-width: 1; }
.rm-leads circle { fill: #9A4527; stroke: #F0E7CF; stroke-width: 2; }
.rm-pins { position: absolute; inset: 0; pointer-events: none; }
html #menu .rm-frame button.rm-pin { position: absolute; pointer-events: auto; display: block; height: 44px; min-height: 44px; padding: 2px 0; margin: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #1E3324; font: 600 13px/1 "Public Sans", system-ui, sans-serif; letter-spacing: 0; text-transform: none; white-space: nowrap; }
/* a route's label: printed on the map's paper, square, ruled in ink */
.rm-label { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; height: 40px; padding: 0 9px; line-height: 13px; text-align: left; border-radius: 0; background: #F0E7CF; border: 1.5px solid #1E3324; box-shadow: 2px 2px 0 rgba(30, 51, 36, .28); }
/* its difficulty under the name: four short printed bars, as many inked as the level (routemap.js markHtml) */
.rm-mark { display: flex; gap: 2px; }
.rm-mark i { display: block; width: 8px; height: 4px; box-sizing: border-box; border: 1px solid #1E3324; }
.rm-mark i.on { background: #1E3324; }
/* an area's marker on the world: its number of routes in a circle, over its name in an atlas's spaced small capitals */
html #menu .rm-frame button.rm-area { display: flex; flex-direction: column; align-items: center; gap: 3px; height: auto; padding: 0; line-height: 14px; text-align: center; }
.rm-area b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #9A4527; color: #F0E7CF; border: 2px solid #F0E7CF; box-shadow: 0 0 0 1px #1E3324; font-size: 13px; }
.rm-area .rm-name { padding: 2px 6px; border-radius: 0; background: #F0E7CF; border: 1px solid #1E3324; font-variant-caps: all-small-caps; letter-spacing: .08em; font-size: 14px; }
html #menu .rm-frame button.rm-pin:hover { background: transparent; }
html #menu .rm-frame button.rm-pin:hover .rm-label, html #menu .rm-frame button.rm-area:hover .rm-name { background: #E4D7B0; }
html #menu .rm-frame button.rm-pin:focus-visible { outline: none; }
html #menu .rm-frame button.rm-pin:focus-visible .rm-label, html #menu .rm-frame button.rm-area:focus-visible .rm-name { outline: 3px solid #9A4527; outline-offset: 2px; }
/* the locator inset (routemap.js BACK gives its size): the world small, the area in view outlined, "World" under it */
html #menu .rm-frame button.rm-back { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 84px; height: 62px; min-height: 0; margin: 0; padding: 3px;
  border: 1.5px solid #1E3324; border-radius: 0; background: #F0E7CF; box-shadow: 2px 2px 0 rgba(30, 51, 36, .28); color: #1E3324;
  font: 600 12px/1 "Public Sans", system-ui, sans-serif; font-variant-caps: all-small-caps; letter-spacing: .1em; text-transform: none; }
.rm-back svg { display: block; width: 100%; height: 37px; border: 1px solid rgba(30, 51, 36, .55); }
.rm-back svg .rm-sea { fill: #F0E7CF; }
.rm-back use { fill: #DDD0A4; }
.rm-back .rm-here { fill: rgba(154, 69, 39, .18); stroke: #9A4527; stroke-width: 1.5; }
.rm-back span { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 1; }
.rm-back span::before { content: ''; width: 0; height: 0; border: 4px solid transparent; border-right: 5px solid currentColor; border-left: 0; }   /* a small printed arrow, pointing out */
html #menu .rm-frame button.rm-back:hover { background: #E4D7B0; }
html #menu .rm-frame button.rm-back:focus-visible { outline: 3px solid #9A4527; outline-offset: 2px; }
.rm-pins, .rm-leads, .rm-back { transition: opacity .2s; }
.rm-frame.moving .rm-pins, .rm-frame.moving .rm-leads, .rm-frame.moving .rm-back { opacity: 0; transition: none; }
@media (prefers-reduced-motion: reduce) { .rm-pins, .rm-leads, .rm-back { transition: none; } }
@media (max-width: 560px) { .rm-frame { aspect-ratio: 8 / 5; } }
.rm-credit { margin: .45rem 0 0; text-align: right; color: var(--muted); font-size: .8rem; }   /* Natural Earth is public domain: a courtesy */

/* ---------- the first-ride tour (tour.js) ----------
   The page dimmed round the one thing to tap (a square hole, ruled), and beside it a note: a square-cornered card
   ruled in ink with a heavier rule along its top, as a printed programme sets a notice, and a small square pointer
   turned to the target. The dimming takes no taps: everything under it still works. No pills, blur or gradients. */
#tour { position: fixed; inset: 0; z-index: 5; pointer-events: none; --tour-dim: rgba(17, 17, 17, .55); --tour-back: var(--paper); --tour-line: var(--ink); --tour-top: var(--accent); }
html[data-theme="dark"] body:not(.riding) #tour { --tour-dim: rgba(0, 0, 0, .62); --tour-back: #161B1E; --tour-line: #4A555D; }
html[data-theme="quiet"] body:not(.riding) #tour { --tour-dim: rgba(31, 29, 26, .5); --tour-back: var(--panel); }
.tour-hole { position: fixed; border-radius: 0; box-shadow: 0 0 0 2px var(--tour-back), 0 0 0 4px var(--tour-top), 0 0 0 200vmax var(--tour-dim); }
.tour-note { position: fixed; pointer-events: auto; box-sizing: border-box; padding: .7rem .9rem .5rem; background: var(--tour-back); color: var(--ink);
  border: 1.5px solid var(--tour-line); border-top: 4px solid var(--tour-top); border-radius: 0; box-shadow: none; font: 400 1rem/1.4 var(--sans); }
.tour-note:focus, .tour-note:focus-visible { outline: none; }   /* the note itself has the focus when it comes: it is already the one lit thing */
.tour-count { margin: 0 0 .25rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tour-text { margin: 0; }
.tour-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .25rem .8rem; margin-top: .35rem; }
#tour .tour-acts button { min-height: 44px; border-radius: 0; font: 600 .95rem var(--sans); }
#tour .tour-skip { order: -1; margin-right: auto; padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 400; }
#tour .tour-go { padding: .4rem 1rem; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); }
html[data-theme] body:not(.riding) #tour .tour-go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#tour button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* the pointer: a small square turned on its corner, half out of the note's edge, ruled as the edge it sits on */
.tour-tip { position: absolute; width: 12px; height: 12px; background: var(--tour-back); transform: translate(-50%, -50%) rotate(45deg); border: 0 solid var(--tour-line); }
.tour-note[data-side="below"] .tour-tip { top: -2px; left: var(--tip); border-width: 4px 0 0 4px; border-color: var(--tour-top); width: 14px; height: 14px; }
.tour-note[data-side="above"] .tour-tip { top: 100%; left: var(--tip); border-width: 0 1.5px 1.5px 0; }
.tour-note[data-side="right"] .tour-tip { left: 0; top: var(--tip); border-width: 0 0 1.5px 1.5px; }
.tour-note[data-side="left"] .tour-tip { left: 100%; top: var(--tip); border-width: 1.5px 1.5px 0 0; }
.tour-note[data-side="over"] .tour-tip { display: none; }
.tour-say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
/* on the riding screen: no dimming, no buttons, no taps; the riding display's own panel, with its accent rule */
#tour.tour-riding { --tour-back: var(--h-panel); --tour-line: var(--h-edge); --tour-top: var(--h-accent); }
#tour.tour-riding .tour-hole, #tour.tour-riding .tour-acts { display: none; }
/* short, so it fits under the buttons over the profile strip rather than over the buttons */
#tour.tour-riding .tour-note { pointer-events: none; color: var(--h-ink); padding: .45rem .75rem .5rem; font: 400 .95rem/1.35 var(--h-sans); }
#tour.tour-riding .tour-count { display: none; }

/* ---------- the Credits screen (js/credits.js) ----------
   A page over the menus, as a route's preview is: plain ruled sections, small-caps headings, links underlined. */
#credits, #help, #privacy-terms { position: fixed; inset: 0; z-index: 4; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--paper); color: var(--ink);
  padding: calc(.6rem + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
#credits[hidden], body.riding #credits, #help[hidden], body.riding #help, #privacy-terms[hidden], body.riding #privacy-terms { display: none; }
body.crediting, body.helping, body.privacying { overflow: hidden; }
.cr-top, .cr-body { max-width: 46rem; margin: 0 auto; }
.cr-body { overflow-wrap: anywhere; }
.cr-body h2 { margin-top: 1.2rem; }
.cr-intro { color: var(--muted); }
.cr-body a { color: inherit; text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
.cr-body a:hover { color: var(--accent); }
.cr-group { margin-top: 2rem; }
.cr-head { margin: 0; padding-bottom: .3rem; border-bottom: 2px solid var(--ink); font: 700 1.05rem/1.3 var(--sans); font-variant-caps: all-small-caps; letter-spacing: .12em; }
.cr-route { border-bottom: 1px solid var(--rule); padding: .9rem 0 .4rem; }
.cr-route h4 { margin: 0; font: 700 1.1rem/1.25 var(--serif); }
.cr-place { display: block; margin-top: .1rem; font: 600 .8rem/1.3 var(--sans); font-variant-caps: all-small-caps; letter-spacing: .1em; color: var(--muted); }
.cr-list { list-style: none; margin: 0; padding: 0; }
.cr-list > li { padding: .55rem 0; }
.cr-group > .cr-list > li { border-bottom: 1px solid var(--rule); }
.cr-names { list-style: none; margin: .45rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem 0; font-size: .95rem; }
.cr-names li:not(:last-child)::after { content: '\00A0\00B7\00A0'; color: var(--muted); }
.cr-list > li[id] { scroll-margin-top: 1rem; }
.cr-list > li:focus { outline: none; }
.cr-list > li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cr-list p { margin: 0; }
.cr-src { font-weight: 600; }
.cr-lic { font-weight: 400; font-size: .85rem; color: var(--muted); }
.cr-lic::before { content: '\00B7\00A0'; }
.cr-use { color: var(--muted); font-size: .92rem; }
.cr-credit { font: 400 .85rem/1.45 var(--mono, ui-monospace, Consolas, monospace); margin-top: .15rem !important; }
.cr-foot { margin-top: 1.5rem; color: var(--muted); font-size: .9rem; }
html[data-theme] :is(#credits, #help, #privacy-terms) { --mono: "JetBrains Mono", ui-monospace, monospace; }
html[data-theme] .cr-body h2 { font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html[data-theme] .cr-head { border-bottom: 1px solid var(--accent); color: var(--accent); }
html[data-theme] :is(#credits, #help, #privacy-terms) button { border-radius: 2px; }
html[data-theme="dark"] :is(#credits, #help, #privacy-terms) button { border-color: var(--rule); }
.foot-credits { margin-left: .6rem; }

/* ---------- Privacy & terms (js/privacy.js) ----------
   The Credits screen's page (the rules above): each part under a ruled heading, as Credits' groups are, then plain
   reading text, no wider than a comfortable line. */
.pt-note { margin: 1rem 0 0; padding: .55rem .75rem; border-left: 3px solid var(--accent); }
.pt-text { max-width: 38rem; }
.pt-text section + section { margin-top: 2.6rem; }
.pt-part { margin: 1.6rem 0 0; padding-bottom: .3rem; border-bottom: 2px solid var(--ink); font: 700 1.05rem/1.3 var(--sans); font-variant-caps: all-small-caps; letter-spacing: .12em; scroll-margin-top: 1rem; }
.pt-part:focus { outline: none; }
.pt-part:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-date { margin: .5rem 0 0; color: var(--muted); font-size: .9rem; }
.pt-date strong { font-weight: 600; }
.pt-text h4 { margin: 1.5rem 0 .35rem; font: 700 1.1rem/1.25 var(--serif); }
.pt-text p { margin: .5rem 0 0; }
.pt-text ul, .pt-text ol { margin: .5rem 0 0; padding-left: 1.3rem; }
.pt-text li + li { margin-top: .45rem; }
.pt-text ol { margin-top: 1rem; }
.pt-text ol li::marker { font-variant-numeric: tabular-nums; font-weight: 700; }
html[data-theme] .pt-part { border-bottom: 1px solid var(--accent); color: var(--accent); }
.signup-terms a { color: inherit; text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }

/* ---------- Help & FAQ (js/help.js) ----------
   The Credits screen's page (the rules above), with each question a ruled row that unfolds its answer. The marker is a
   printed plus that turns to a minus: square-cornered, ink, the accent once open. */
.hp-list { margin-top: 1.4rem; border-top: 2px solid var(--ink); }
.hp-q { border-bottom: 1px solid var(--rule); }
.hp-q summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; padding: .7rem 0;
  cursor: pointer; list-style: none; font: 600 1.05rem/1.35 var(--sans); }
.hp-q summary::-webkit-details-marker { display: none; }
.hp-q summary::after { content: '+'; flex: none; width: 1em; text-align: center; font: 400 1.4rem/1 ui-monospace, Consolas, monospace; }
.hp-q[open] summary::after { content: '\2212'; color: var(--accent); }
.hp-q summary:focus { outline: none; }
.hp-q summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp-a { padding: 0 0 1rem; max-width: 38rem; }
.hp-a p { margin: 0; }
.hp-a ol { margin: 0; padding-left: 1.4rem; }
.hp-a li + li { margin-top: .45rem; }
.hp-a li::marker { font-variant-numeric: tabular-nums; font-weight: 700; }
.hp-q[id] { scroll-margin-top: 1rem; }
html[data-theme] .hp-list { border-top: 1px solid var(--accent); }
/* the small links to one question: Trouble connecting? in the Devices panel, On iPhone? on the first screen, Strava?
   on the summary */
.help-link { font-size: .9rem; color: inherit; text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
.help-link:hover { color: var(--accent); }
.sensor-close:has(.help-link) { justify-content: space-between; align-items: center; gap: 1rem; }
.sensor-close .help-link { color: var(--muted); }
.help-line { margin: .4rem 0 0; text-align: center; color: var(--muted); }

/* ---------- the route passport (js/passport-ui.js, the stamps in js/stamps.js) ---------- */
/* On the route's card: the stamp over the card's two layers in its frame (.pv-frame), placed in parts of the
   card (stamps.js cardSpot), in its paper ink in either look; a little see-through, with a faint glow of the
   card's paper round the ink, so the time cut out of the band reads over a busy picture (the image to share
   does the same, stamps.js shareImage) */
.pv-stamp { position: absolute; aspect-ratio: 1; pointer-events: none; opacity: .92; filter: drop-shadow(0 0 .5cqw rgba(243, 235, 216, .9)); }
.pv-stamp svg, .pp-art svg, .pp-big svg, .sum-stamp-art svg { display: block; width: 100%; height: 100%; }
.pv-frame .pv-stamp svg { position: static; }   /* not laid over the frame as its picture and words are */
/* the Passport strip at the top of History: a small page for each real route, in a row that scrolls sideways */
.pp { margin: .3rem 0 1.2rem; }
.pp, .pp-view { --pp-page: #FBF9F4; }
html[data-theme="dark"] .pp, html[data-theme="dark"] .pp-view { --pp-page: #151A1E; }
.pp-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .7rem; }
.pp-head h3 { margin: 0; }
.pp-note { margin: .2rem 0 0; }
.pp-strip { list-style: none; display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x proximity; margin: .5rem -1.25rem 0; padding: .2rem 1.25rem .7rem; }
.pp-strip li { flex: 0 0 auto; display: flex; scroll-snap-align: start; scroll-margin-left: 1.25rem; }
html #menu button.pp-page { display: grid; justify-items: center; align-content: start; gap: .15rem; width: 8.4rem; min-height: 0; padding: .5rem .35rem .55rem;
  border: 1px solid var(--rule); border-radius: 2px; background: var(--pp-page); color: var(--ink); font: 400 .8rem/1.25 var(--sans); text-align: center; }
html #menu button.pp-page:hover { border-color: var(--muted); }
.pp-art { display: block; width: min(7rem, 100%); aspect-ratio: 1; color: var(--muted); }
/* wider screens: two rows of five, no scrolling sideways (awkward with a mouse) */
@media (min-width: 640px) {
  .pp-strip { flex-wrap: wrap; overflow: visible; margin: .5rem 0 0; padding: .2rem 0 .7rem; }
  .pp-strip li { flex: 0 0 calc((100% - 2.4rem) / 5); }
  html #menu button.pp-page { width: 100%; }
}
.pp-empty .pp-art { opacity: .55; }
.pp-name { font-weight: 600; }
.pp-time { color: var(--muted); font-variant-numeric: tabular-nums; }
html:not([data-theme="dark"]) .pp-art .stamp:not(.stamp-blank), html:not([data-theme="dark"]) .pp-big .stamp:not(.stamp-blank),
html:not([data-theme="dark"]) .sum-stamp-art .stamp { mix-blend-mode: multiply; }
/* a passport page, bigger, over the menus */
.pp-view { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .5); }
.pp-sheet { width: 100%; max-width: 24rem; max-height: 100%; overflow-y: auto; display: grid; justify-items: center; gap: .5rem; padding: 1.1rem 1.2rem 1.2rem;
  background: var(--pp-page); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 3px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
html[data-theme="dark"] .pp-sheet { border-color: var(--rule); }
.pp-big { width: min(68vw, 16rem); aspect-ratio: 1; color: var(--muted); }
.pp-sheet h2 { margin: 0; }
.pp-sheet p { margin: 0; }
/* a route in stages: each stage's own stamp under the route's, three or so across (passport-ui.js openPage) */
.pp-stages { list-style: none; margin: .2rem 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .4rem; }
.pp-stages li { display: grid; justify-items: center; gap: .1rem; font-size: .78rem; line-height: 1.2; }
.pp-stages .pp-art { width: min(5.5rem, 100%); }
.pp-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem 1rem; font-variant-numeric: tabular-nums; }
/* Medals (medals.js medalHtml): a round medal on a short ribbon, printed in its metal with an ink ring; its name beside
   it or for a screen reader only. On a passport page at its top corner, on the route card's stamp at the stamp's
   lower edge, on the shelf's card before the best time. A circle: no pills. */
.medal { display: inline-flex; align-items: center; gap: .3em; vertical-align: middle; line-height: 1; }
.medal svg { width: 1.3em; height: 1.3em; flex: none; overflow: visible; }
.medal-rib { fill: #3E5B78; stroke: var(--ink); stroke-width: .9; stroke-linejoin: round; }
.medal-disc { stroke: var(--ink); stroke-width: 1.1; }
.medal-in { fill: none; stroke: rgba(31, 29, 26, .35); stroke-width: .8; }
.medal-bronze .medal-disc { fill: #B9773E; }
.medal-silver .medal-disc { fill: #C3C8CC; }
.medal-gold .medal-disc { fill: #E1B33A; }
.medal-name { font-weight: 600; font-size: .9em; }
html[data-theme="dark"] .medal-rib, html[data-theme="dark"] .medal-disc { stroke: #14130F; }
html[data-theme="dark"] .medal-rib { fill: #7E9DBD; }   /* the ribbon readable on the dark page */
html #menu button.pp-page { position: relative; }
.pp-medal { position: absolute; top: .3rem; right: .3rem; font-size: 1.05rem; }
.pp-medal-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .2rem .6rem; font-variant-numeric: tabular-nums; }
.pp-medal-how { font-size: .8rem; max-width: 20rem; }
.sum-stamp-side .pp-medal-line { justify-content: flex-start; margin: .25rem 0; }
.pv-stamp .pv-medal { position: absolute; right: -2%; bottom: 0; width: 30%; }
.pv-stamp .pv-medal svg { width: 100%; height: auto; }
.rc-best .medal svg { width: 1.15em; height: 1.15em; }
.pp-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .3rem; }
html[data-theme="dark"] .pp-sheet button { border-radius: 2px; border-color: var(--rule); }
html[data-theme="dark"] .pp-sheet button.go { color: #0E1113; border-color: var(--accent); }
/* on the summary: the stamp lands (a thunk), with Share beside it */
.sum-stamp { display: flex; align-items: center; gap: 1rem; margin: .6rem 0 .4rem; }
.sum-stamp-art { flex: 0 0 auto; width: 10.5rem; height: 10.5rem; }
.sum-stamp-side p { margin: 0 0 .35rem; }
.sum-stamp-art.thunk { animation: pp-thunk .6s .3s both; }
@keyframes pp-thunk {
  0% { transform: scale(2.3) rotate(-10deg); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, .9, .4); }
  55% { transform: scale(.93) rotate(1deg); opacity: 1; animation-timing-function: ease-out; }
  75% { transform: scale(1.025); }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .sum-stamp-art.thunk { animation: none; } }

/* ---------- friends on a route (js/friends.js) ----------
   While riding: the gap to each friend's ghost, under the gap to your best, each row led by a square in that
   friend's tint (the words stay in the panel's ink, readable in either look). On a phone on its side the list is a
   column of its own, so the panel stays two lines high. On the route's card: the fastest riders in three columns,
   your own place under them, and who comes along, chosen in a sheet over the card. Square corners throughout. */
#h-friends { border-top: 1px solid var(--h-rule); padding-top: 6px; }
#h-friends[hidden] { display: none; }
#h-friends > span { display: block; }
#h-friends ul { list-style: none; margin: 3px 0 0; padding: 0; display: grid; gap: 2px; }
#h-friends li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; column-gap: 6px; font: 600 13px/1.25 var(--h-sans); }
#h-friends li i { width: 9px; height: 9px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
#hud #h-friends li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7em; font: inherit; letter-spacing: 0; text-transform: none; color: var(--h-ink); }
#hud #h-friends li b { font-size: 14px; justify-self: end; }
/* on its side: one row under the numbers, the full width of the panel, so the names have room */
@media (orientation: landscape) {
  #h-friends { grid-column: 1 / span 3; grid-row: 3; display: flex; align-items: center; gap: 14px; }
  #h-friends ul { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0; }
  #h-friends li { font-size: 12px; line-height: 1.15; }
  #hud #h-friends li span { max-width: 6.5em; }
  #hud #h-friends li b { font-size: 13px; }
}
/* a phone on its side, its numbers in one thin strip: the first three friends in a column of their own at the end of
   the strip, without the word "friends", so the strip stays two lines high */
@media (orientation: landscape) and (max-height: 520px), (orientation: landscape) and (max-width: 760px) {
  #h-friends { grid-column: 4; grid-row: 1 / span 2; border-top: 0; padding: 0 0 0 var(--sg); border-left: 1px solid var(--h-rule); display: block; align-self: center; }
  #h-friends > span { display: none; }
  #h-friends ul { display: grid; gap: 0; margin: 0; }
  #h-friends li { font-size: 11px; line-height: 1.2; }
  #h-friends li:nth-child(n+4) { display: none; }
  #hud #h-friends li span { max-width: 6em; }
  #hud #h-friends li b { font-size: 11px; }
}


/* the coach's voice, under Workout cues (main.js cuesPicker, coach.js): the list, Test, and the iPhone tip, stacked */
.voice-pick { display: grid; gap: .5rem; justify-items: start; margin-top: .7rem; }
.voice-pick[hidden] { display: none; }
.voice-pick label { display: grid; gap: .3rem; width: 100%; }
.voice-pick small { display: block; line-height: 1.4; }

/* ---------- the tab bar ----------
   One row of tabs (main.js setTabs). On the desktop layout (html.desk: README "Desktop") it sits in the top bar, each
   tab a drawing and its word, the one shown ruled underneath on the bar's own rule. Everywhere else (html:not(.desk):
   every phone, upright or on its side, every tablet and iPad, a laptop under 1280 px or without a mouse) it is fixed
   to the bottom of the screen, within reach of a thumb, above the home indicator (safe-area-inset-bottom): a drawing
   over a short word, the one shown ruled along its top edge; on a tablet (html.tab-wide) the drawing beside its word.
   Under the route's card, Credits, the "Delete?" box and the opening (their z-index is higher); gone on the riding
   screen with the rest of the menus. Kept last in this file, after the looks' button rules it overrides. */
.tabbar { display: flex; align-items: stretch; gap: 1.1rem; min-width: 0; }
html #menu .tabbar button { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin: 0 0 calc(-.4rem - 2px); padding: .5rem 0 calc(.5rem - 3px);
  border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
html #menu .tabbar button:hover { color: var(--ink); background: none; }
html #menu .tabbar button[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabbar svg { flex: none; width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
/* One short movement when a tab is chosen: the road's dashes come towards you, the stopwatch hand goes round, the
   calendar hops, the trophy lifts. */
.tabbar .ti-move { transform-box: fill-box; transform-origin: center; }
.tabbar button[aria-current="page"] .ti-move { animation: .6s ease-out 1 both; }
.tabbar button[data-tab="ride"][aria-current="page"] .ti-move { animation-name: ti-road; }
.tabbar button[data-tab="workouts"][aria-current="page"] .ti-move { animation-name: ti-turn; transform-origin: 50% 100%; }
.tabbar button[data-tab="history"][aria-current="page"] .ti-move { animation-name: ti-hop; }
.tabbar button[data-tab="board"][aria-current="page"] .ti-move { animation-name: ti-lift; }
@keyframes ti-road { from { transform: translateY(-5px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ti-turn { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ti-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-3px); } }
@keyframes ti-lift { 0%, 100% { transform: none; } 40% { transform: translateY(-2px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .tabbar .ti-move { animation: none !important; } }
/* the mobile layout (not desk): the bar fixed to the bottom of the screen */
html:not(.desk) .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; gap: 0; background: var(--paper); border-top: 1px solid var(--rule);
  padding: 0 env(safe-area-inset-right, 0px) var(--safe-b) env(safe-area-inset-left, 0px); }
html:not(.desk) #menu .tabbar button { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; height: var(--tabbar-h); margin: -1px 0 0; padding: 5px 2px 4px;
  border-bottom: 0; border-top: 3px solid transparent; font-size: .74rem; line-height: 1.15; letter-spacing: .01em; }
html:not(.desk) #menu .tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
html:not(.desk) #menu .tabbar button[aria-current="page"] { border-top-color: var(--accent); }
html:not(.desk) .tabbar svg { width: 24px; height: 24px; }
/* a tablet: room for the drawing beside its word */
html.tab-wide #menu .tabbar button { flex-direction: row; gap: .55rem; font-size: .95rem; }
/* the page keeps clear of the bar: its last words and buttons scroll up above it, as does the toast */
html:not(.desk) body.tabbed #menu { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 1.25rem); }
html:not(.desk) body.tabbed:not(.riding) #toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + .75rem); }
@media (max-width: 640px) {
  /* the big PEDAL: room for the two buttons beside it (the devices button, and the face with its ▾) */
  html[data-theme] #menu .masthead h1 { font-size: clamp(1.6rem, calc((100vw - 166px) / 5), 2.6rem); }
}

/* ---------- the rider's menu ----------
   From the rider's initial: a printed panel hung from the header's rule at the right, square-cornered and ruled in
   ink (mint along its top in the dark look), its rows plain lines of type with a small drawing each. */
.me-menu { position: absolute; z-index: 3; right: 0; top: calc(100% + 6px); width: min(20rem, calc(100vw - 1.5rem)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-top-width: 3px; padding: .2rem 0 .35rem; }
html[data-theme="dark"] .me-menu { background: #161B1E; border-color: var(--rule); border-top-color: var(--accent); }
html[data-theme="quiet"] .me-menu { background: var(--panel); border-top-color: var(--accent); }
.mm-who { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .25rem .5rem .3rem 1rem; border-bottom: 1px solid var(--rule); margin-bottom: .25rem; }
.mm-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 1.1rem/1.2 var(--serif); }
.mm-me { display: grid; min-width: 0; }
.mm-level { font-size: .78rem; color: var(--muted); }
/* a rider's passport level (tiers.js): a small square ink-ruled tag with its rank in five short bars, as a route's level */
.rlv { display: inline-flex; align-items: center; gap: .3em; margin-left: .35em; padding: .05em .4em; border: 1px solid currentColor; border-radius: 0;
  font: 600 .66rem/1.5 var(--sans); letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.rlv-bars { display: inline-flex; align-items: flex-end; gap: 1px; height: .8em; }
.rlv-bars i { display: block; width: 3px; background: currentColor; opacity: .25; }
.rlv-bars i:nth-child(1) { height: 20%; } .rlv-bars i:nth-child(2) { height: 40%; } .rlv-bars i:nth-child(3) { height: 60%; } .rlv-bars i:nth-child(4) { height: 80%; } .rlv-bars i:nth-child(5) { height: 100%; }
.rlv-bars i.on { opacity: 1; }
.pp-level { margin: .3rem 0 0; font-size: .85rem; }
.pp-level .rlv { margin-left: 0; font-size: .72rem; }
html #menu .me-menu button { border-radius: 0; box-shadow: none; }
html #menu .me-menu .mm-switch { flex: none; min-height: 44px; margin: 0; padding: 0 .5rem; border: 0; background: none; color: var(--accent); font: 400 .92rem var(--sans); text-decoration: underline; text-underline-offset: 3px; }
html #menu .me-menu > button { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 46px; margin: 0; padding: .45rem 1rem;
  border: 0; background: transparent; color: var(--ink); font: 400 1rem/1.3 var(--sans); text-align: left; }
html #menu .me-menu > button:hover, html #menu .me-menu .mm-switch:hover { background: var(--hover, rgba(31, 29, 26, .06)); }
html #menu .me-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.me-menu svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.me-menu svg .fill { fill: currentColor; }
/* the look: Light and Dark side by side, the one on in ink (mint in the dark look) */
.mm-row { display: flex; align-items: center; gap: .8rem; min-height: 50px; padding: .2rem 1rem; }
.mm-row > span:first-of-type { flex: 1; }
.mm-seg { display: inline-flex; }
html #menu .me-menu .mm-seg button { min-height: 38px; min-width: 4.2rem; margin: 0; padding: 0 .7rem; border: 1px solid var(--ink); background: none; color: var(--ink); font: 600 .88rem var(--sans); }
html #menu .me-menu .mm-seg button + button { border-left: 0; }
html #menu .me-menu .mm-seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
html[data-theme="dark"] #menu .me-menu .mm-seg button { border-color: var(--rule); }
html[data-theme] #menu .me-menu .mm-seg button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* the menus' music: a square box, ticked when on */
.mm-tick { margin-left: auto; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--ink); position: relative; }
html[data-theme="dark"] .mm-tick { border-color: var(--muted); }
#menu-music[aria-checked="true"] .mm-tick { background: var(--ink); border-color: var(--ink); }
html[data-theme] #menu-music[aria-checked="true"] .mm-tick { background: var(--accent); border-color: var(--accent); }
#menu-music[aria-checked="true"] .mm-tick::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg); }
html[data-theme] #menu-music[aria-checked="true"] .mm-tick::after { border-color: var(--on-accent); }
.me-menu hr { border: 0; border-top: 1px solid var(--rule); margin: .25rem 0; }

/* ---------- the feedback sheet ----------
   What should Pedal add? or Report a problem, over the dimmed menus: from the bottom edge on a phone, its words above
   the home indicator; in the middle of a wider screen. Square corners, a heavy rule along the top. */
.fb-sheet { position: fixed; inset: 0; z-index: 5; display: grid; align-items: end; justify-items: center; background: rgba(0, 0, 0, .45); }
.fb-sheet[hidden] { display: none; }
body.sheeted { overflow: hidden; }
.fb-panel { width: 100%; max-width: 34rem; max-height: 92dvh; overflow-y: auto; background: var(--paper); color: var(--ink); border-top: 3px solid var(--ink);
  padding: 1rem max(1.1rem, env(safe-area-inset-right, 0px)) calc(1.1rem + var(--safe-b)) max(1.1rem, env(safe-area-inset-left, 0px)); }
html[data-theme] .fb-panel { border-top-color: var(--accent); }
.fb-panel .guide { margin: 0; padding: 0; border: 0; }
.fb-panel .label { margin: 0 0 .6rem; }
.fb-panel button { border-radius: 0; }
html[data-theme="dark"] .fb-panel button { border-color: var(--rule); }
html[data-theme="dark"] .fb-panel button.strong { background: var(--accent); border-color: var(--accent); color: #0E1113; }
.fb-panel textarea { border-radius: 0; }
html[data-theme="dark"] .fb-panel textarea { border-color: var(--rule); }
.fb-panel .row { margin-top: .7rem; }
@media (min-width: 641px) {
  .fb-sheet { align-items: center; padding: 1rem; }
  .fb-panel { border: 1.5px solid var(--ink); border-top-width: 3px; padding-bottom: 1.1rem; }
  html[data-theme="dark"] .fb-panel { border-color: var(--rule); border-top-color: var(--accent); }
  html[data-theme="quiet"] .fb-panel { border-top-color: var(--accent); }
}

/* Nothing connected yet: the devices button pulses, a mint ring growing and fading (main.js renderSensorButtons). With
   less motion asked for, a still mint ring instead. */
@keyframes devices-pulse { 0% { box-shadow: 0 0 0 0 rgba(124, 242, 156, .55); } 70% { box-shadow: 0 0 0 12px rgba(124, 242, 156, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 242, 156, 0); } }
#t-devices.needs { border-radius: 50%; animation: devices-pulse 1.8s ease-out infinite; }
html[data-theme="quiet"] #t-devices.needs { animation-name: devices-pulse-light; }
@keyframes devices-pulse-light { 0% { box-shadow: 0 0 0 0 rgba(23, 112, 62, .45); } 70% { box-shadow: 0 0 0 12px rgba(23, 112, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(23, 112, 62, 0); } }
@media (prefers-reduced-motion: reduce) { #t-devices.needs { animation: none; box-shadow: 0 0 0 2px #7CF29C; } html[data-theme="quiet"] #t-devices.needs { box-shadow: 0 0 0 2px #17703E; } }

/* ---------- the home redesign (Joe approved it, 2 Dec 2026) ----------
   Rules that must win over each look's own say html[data-theme] (every look: theme.js always sets it).
   One type system: names in the sans; monospace only for numbers and small labels. One section label (small mono
   capitals, muted). One primary button, mint with dark letters in both looks (a darker green rule round it in the
   light look, where mint alone is faint on paper), and one secondary, ruled. Square corners, no gradients. */
html[data-theme] { --mint: #7CF29C; --mint-hover: #9AF5B5; --mint-ink: #0E1113; --mint-edge: #7CF29C; --panel: #161B1E; --edge2: #4A555D; }
html[data-theme="quiet"] { --mint-edge: #17703E; --panel: #FFFDF8; --edge2: #1F1D1A; }
html[data-theme] body:not(.riding) { --serif: Inter, system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace; }
html[data-theme] #menu h1 { font-family: "JetBrains Mono", ui-monospace, monospace; }   /* the PEDAL wordmark, in both looks */
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px !important; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* the one section label, on the tabs, Settings and the first screen (the summary keeps its own headings) */
html[data-theme] body.tabbed #menu h2, html[data-theme] #menu .hero ~ h2, html[data-theme] #menu .shelf-head, html[data-theme] #menu h3.label {
  font: 600 .74rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 1.9rem 0 .6rem; }
html[data-theme] #menu .group-head h3.label { margin: 0; }
/* names in the sans, facts in the sans with even figures */
html[data-theme] #menu .list h3, html[data-theme] #menu .riders button { font-family: var(--sans); font-weight: 600; }
html[data-theme] #menu .list h3 { font-size: 1.1rem; }
html[data-theme] .list .facts { font-family: var(--sans); }
html[data-theme] .list .facts, html[data-theme] .facts { font-variant-numeric: tabular-nums; }
/* the one primary button */
html[data-theme] #menu button.go, html[data-theme] #menu button.strong, html[data-theme] #preview button.go, html[data-theme] .pp-sheet button.go,
html[data-theme] #ask button.go, html[data-theme] .fb-panel button.strong, html[data-theme] body:not(.riding) #tour .tour-go {
  background: var(--mint); border: 1.5px solid var(--mint-edge); color: var(--mint-ink); border-radius: 0; }
html[data-theme] #menu button.go:hover, html[data-theme] #menu button.strong:hover, html[data-theme] #preview button.go:hover { background: var(--mint-hover); }
/* the one secondary button: ruled, square; a rule that shows in the dark look */
html[data-theme] #menu button, html[data-theme] #preview button { border-radius: 0; }
html[data-theme="dark"] #menu :is(.today, .ways, .wrow, .empty, .list .acts, .wgroup) button:not(.go),
html[data-theme="dark"] #preview .pv-bar button:not(.go) { border-color: var(--edge2); }
/* the footer only on the first screen: with a rider in, Credits is in their menu */
html[data-theme] body.in .foot { display: none; }

/* the first screen: a still from the 3D world, the tagline, the riders, the ways in */
html[data-theme] body:has(#view .hero) .masthead .tagline { display: none; }
.hero { margin: 1.1rem 0 0; border: 1px solid var(--rule); background: #2A2622; }
.hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-line { margin: .9rem 0 0; font: 600 1.4rem/1.25 var(--sans); color: var(--ink); }
.ways { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.3rem 0 .4rem; }
.ways button { flex: 1 1 8rem; }
.ways .ways-note { flex: 1 1 100%; margin: -.2rem 0 .5rem; text-align: center; }
html[data-theme] #menu .ways button.go { flex: 1 1 100%; min-height: 56px; font-size: 1.15rem; }
html[data-theme] #menu .riders { margin: 0 0 .4rem; }
html[data-theme] #menu .riders button { min-width: 8rem; min-height: 3.6rem; font-size: 1.2rem; }
/* touch and hold to choose (hold.js): a bar fills along the button's foot as it is held, as on End ride. No text
   selection, no iOS callout and no double-tap zoom on a long press; a scroll that starts here still scrolls. */
button.holdable { position: relative; overflow: hidden; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button.holdable::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 5px; background: var(--mint-edge, var(--accent)); transform: scaleX(var(--hold, 0)); transform-origin: left; pointer-events: none; }
button.holdable.go::after { background: currentColor; }   /* on the mint button, the bar in the button's ink */
button.holdable.holding { border-color: var(--mint-edge, var(--accent)); }
@media (prefers-reduced-motion: reduce) { button.holdable::after { transition: none; } }
.hold-hint { position: absolute; z-index: 5; margin: 0; padding: .35rem .6rem; background: var(--panel, var(--paper)); color: var(--ink);
  border: 1px solid var(--rule, var(--ink)); border-left: 3px solid var(--mint-edge, var(--accent)); font: 600 .9rem var(--sans); white-space: nowrap; pointer-events: none; }
.hold-hint:not(.show) { width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }

/* the Today panel, at the top of the Routes tab (main.js todayHtml): a printed panel, a mint rule along its top */
.today { margin: 1.1rem 0 0; padding: .8rem 1rem 1rem; border: 1px solid var(--rule); border-top: 3px solid var(--mint-edge); background: var(--panel); }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
html[data-theme] body.tabbed #menu .today-head h2 { margin: 0; }
.week { display: flex; gap: 5px; }
.week span { display: grid; justify-items: center; gap: 3px; width: 16px; font: 600 .62rem/1 var(--mono); color: var(--muted); }
.week i { display: block; width: 14px; height: 14px; border: 1.5px solid var(--edge2); opacity: .55; }
.week .rode i { background: var(--mint); border-color: var(--mint-edge); opacity: 1; }
.week .now { color: var(--ink); } .week .now i { opacity: 1; }
.today .streak { margin: .55rem 0 0; font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.today-go { display: flex; gap: .5rem; margin-top: .8rem; align-items: stretch; }
html[data-theme] #menu #today-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .1rem;
  min-height: 58px; padding: .5rem .9rem; text-align: left; font-size: 1.05rem; line-height: 1.25; }
#today-main small { font: 600 .8rem/1.3 var(--sans); opacity: .78; font-variant-numeric: tabular-nums; }
html[data-theme] #menu #today-free { flex: none; padding: .5rem .8rem; }
.today.waiting .today-go, .today.waiting .streak, .today.waiting .week { visibility: hidden; }
.today-notes .notice { margin: .9rem 0 0; padding: .1rem 0 .1rem .8rem; font-size: .92rem; }
.today-notes .notice button { min-height: 44px; }

/* the routes, a shelf of cards per area (main.js shelvesHtml): a grid on a wide screen, a row that swipes on a phone */
.shelf-box { margin-top: .4rem; }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 1rem; }
.rc { position: relative; display: flex; flex-direction: column; border: 1px solid var(--rule); background: var(--panel); }
.rc:hover { border-color: var(--edge2); }
.rc-pic { aspect-ratio: 10 / 7; overflow: hidden; background: #F0E7CF; border-bottom: 1px solid var(--rule); }
.rc-pic img { display: block; width: 112%; max-width: none; height: 100%; margin-left: -6%; object-fit: cover; object-position: 50% 45.5%; }   /* the card's land (rows 205 to 655 of 900, every card), without its paper margins */
.rc-text { display: grid; gap: .2rem; padding: .6rem .75rem .75rem; }
.rc-text p { margin: 0; }
.rc-place { font: 500 .7rem/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.rc-name { margin: 0; font: 600 1.1rem/1.2 var(--sans); }
html #menu .rc-name button { display: inline; min-height: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.rc-name button::after { content: ''; position: absolute; inset: 0; }   /* the whole card is the button */
html #menu .rc-name button:focus-visible { outline: none; }
.rc:has(.rc-name button:focus-visible) { outline: 3px solid var(--mint-edge); outline-offset: -3px; }
.rc-level { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; margin-top: .25rem !important; font-size: .85rem; }
.rc-time { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-facts { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.rc-best { font-size: .8rem; font-variant-numeric: tabular-nums; }
/* the mobile layout (not desk): a row that swipes, the next card peeking in; on a tablet, bigger cards (20rem) */
html:not(.desk) .shelf { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  gap: .75rem; margin: 0 -1.25rem; padding: 0 1.25rem .5rem; scroll-padding-inline: 1.25rem; }
html:not(.desk) .shelf::-webkit-scrollbar { display: none; }
html:not(.desk) .shelf > li { flex: 0 0 min(74%, 17rem); scroll-snap-align: start; }
html.tab-wide .shelf { gap: 1rem; margin: 0 -2rem; padding: 0 2rem .5rem; scroll-padding-inline: 2rem; }
html.tab-wide .shelf > li { flex-basis: 20rem; }

/* the Workouts tab, grouped (main.js workoutsHtml): compact rows, the name and figures beside Start, the bars under */
html[data-theme] #menu .wk-intro { margin-top: 1.1rem; }
html[data-theme] #menu .wgroup .shelf-head { margin-top: 1.6rem; }
.wlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.wrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text acts" "spark spark"; gap: .35rem .9rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.wrow-text { grid-area: text; min-width: 0; }
.wrow-text p { margin: .1rem 0 0; }
.wrow h4 { margin: 0; font: 600 1.05rem/1.25 var(--sans); }
.wrow .facts { font-size: .85rem; color: var(--muted); }
.wrow-blurb { font-size: .88rem; color: var(--muted); }
.wrow .spark { grid-area: spark; max-width: none; height: 26px; margin: 0; }
.wrow .acts { grid-area: acts; display: flex; gap: .4rem; }
html[data-theme] #menu .wrow .acts button { min-height: 44px; padding: .4rem 1rem; }
@media (max-width: 640px) { .wrow:has(.spark) .wrow-blurb { display: none; } }   /* compact on a phone: the bars say it */

/* History's empty state */
.empty { margin: 1rem 0 0; padding: 1rem; border: 1px dashed var(--edge2); }
.empty p { margin: 0 0 .4rem; }
.empty-line { font-weight: 600; font-size: 1.05rem; }
html[data-theme] #menu .empty button.go { margin-top: .4rem; min-width: 10rem; }

/* ---------- riders' faces (js/avatar.js): a circle with their picture, badge or initials (Joe, 2 Dec 2026) ---------- */
.av { display: inline-grid; place-items: center; flex: none; width: 1.6em; height: 1.6em; border-radius: 50%; overflow: hidden; vertical-align: middle;
  background: var(--accent); color: var(--paper); font: 700 .68em/1 var(--sans); letter-spacing: .02em; }
html[data-theme="dark"] .av { color: #0E1113; }
.av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.av svg { width: 66%; height: 66%; }
.av-badge, .av-pic { color: #fff; }
.av-s { width: 1.55rem; height: 1.55rem; font-size: .62rem; margin: 0 .45rem 0 0; position: relative; top: -.08em; }
.pv-fast .av-s { margin: 0; top: 0; }
.av-big { width: 72px; height: 72px; font-size: 1.6rem; }
/* the menu button at the top: the face fills it; initials keep the button's own look */
#me-initial { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--mint); color: var(--mint-ink); }
#me-initial .av { width: 100%; height: 100%; font: inherit; }
#me-initial .av:not(.av-badge):not(.av-pic) { background: none; color: inherit; }
/* the route card's line of times: the fastest rider's face before it */
#pv-extras-face:empty { display: none; }
#pv-extras-face .av-s { margin: 0; top: 0; }
/* Settings: the Picture group, above the rest */
.pic-set { max-width: 26rem; margin-top: 1rem; }
.pic-row { display: flex; align-items: center; gap: 1rem; }
/* the rider's name, with its own Save, above the face */
.name-f { display: grid; gap: .25rem; margin: .6rem 0 1rem; }
.name-f label { font-weight: 600; font-size: .95rem; }
.name-line { display: flex; gap: .5rem; }
.name-line input { flex: 1; min-width: 0; }
.name-line button { flex: none; }
.pic-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.pic-btns p { margin: 0; }
.badge-row { display: grid; grid-template-columns: repeat(8, minmax(0, 44px)); gap: .3rem; }
html[data-theme] #menu .badge-row button { width: 100%; height: auto; aspect-ratio: 1; min-height: 0; padding: 0; border: 0; display: grid; place-items: center; }
html[data-theme] #menu .badge-row button.sym { background: var(--muted); }
html[data-theme] #menu .badge-row button svg { width: 60%; height: 60%; }
html[data-theme] #menu .badge-row button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
/* the crop screen (js/avatar-ui.js): the photo behind a round frame, the rest of it dimmed */
.crop-back { position: fixed; inset: 0; z-index: 7; display: grid; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .6); }
.crop-box { background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); padding: 1.1rem; width: 100%; max-width: 22rem; display: grid; gap: .8rem; justify-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.crop-box h2 { margin: 0; justify-self: start; font-size: 1.2rem; }
.crop-frame { position: relative; width: min(260px, 70vw); aspect-ratio: 1; overflow: hidden; touch-action: none; cursor: grab; background: #000; user-select: none; -webkit-user-select: none; }
.crop-frame:active { cursor: grabbing; }
.crop-frame canvas { display: block; width: 100%; height: 100%; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); pointer-events: none; }
.crop-frame:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.crop-hint { margin: 0; font-size: .85rem; text-align: center; }
.crop-box .error { margin: 0; }
.crop-zoom { display: flex; gap: .6rem; }
.crop-zoom button { min-width: 52px; font-size: 1.3rem; line-height: 1; }
.crop-box .ask-buttons { justify-self: stretch; }
html[data-theme] #crop button { border-radius: 0; }
html[data-theme] #crop button.go { background: var(--mint); border: 1.5px solid var(--mint-edge); color: var(--mint-ink); }

/* An Epic route still locked (main.js showLock, epic.js): the lock and the count where Ride is, a small lock mark on
   its shelf card, and on the summary that opens it, the route's card with "unlocked". Square corners, a printed look. */
svg.lock { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; }
#preview.locked #pv-start, #preview.locked #pv-resume, #preview.locked #pv-so-far { display: none; }
.pv-bar .pv-lock { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: .55rem; min-height: 52px; max-width: 12rem; padding: .35rem .75rem;
  border: 1.5px solid var(--ink); border-radius: 0; color: var(--ink); }
.pv-lock[hidden] { display: none; }
.pv-lock svg.lock { width: 1.35rem; height: 1.35rem; }
.pv-lock-text { display: grid; line-height: 1.2; }
.pv-lock-text strong { font: 600 .95rem/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.pv-lock-text small { font-size: .75rem; color: var(--muted); }
html[data-theme="dark"] #preview .pv-lock { border-color: var(--edge2); }
.rc-pic { position: relative; }
.rc-lock { position: absolute; top: .5rem; left: .5rem; display: flex; align-items: center; gap: .3rem; margin: 0; padding: .2rem .45rem;
  border: 1.5px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: 600 .7rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.rc-lock[hidden] { display: none; }
.rc-lock svg.lock { width: .95rem; height: .95rem; }
.epic-unlock { display: flex; align-items: center; gap: 1rem; margin: .6rem 0 .8rem; padding: .8rem; border: 1.5px solid var(--ink); border-radius: 0; }
.epic-unlock[hidden] { display: none; }
.epic-unlock .epic-card { flex: none; width: 8.5rem; border: 1px solid var(--rule); }   /* the shelf card's crop of the route's card (.rc-pic) */
.epic-unlock h3 { margin: .15rem 0 .3rem; font: 600 1.15rem/1.25 var(--sans); }
.epic-unlock p { margin: 0 0 .5rem; }
.epic-unlock .label { display: flex; align-items: center; gap: .35rem; }
html[data-theme="dark"] .epic-unlock { border-color: var(--edge2); }

/* ---------- the play circle (Joe chose option B, 3 Dec 2026) ----------
   Every "go ride" button: a mint circle with a dark play mark, and the button's words beside it. The Today panel's
   button, the route card's Ride this route and Carry on, and Start on each workout (main.js, index.html: class
   "go play"). Circles here only, never capsules. The circle is drawn by the button's ::before, so the words stay the
   button's own text (its name for a screen reader, and what the JS rewrites: Loading, Start over, Carry on from).
   Start over is the same button without .go: no circle, the ruled secondary as before. On a desktop (html.desk,
   set elsewhere) "Enter" shows under the words of the main button, drawn by ::after with empty alt text, so it
   never becomes part of the button's name. Mint with dark letters in both looks; in the light look the circle has
   the darker green rule round it, as the other mint buttons do, since mint alone is faint on paper. */
html[data-theme] { --play-d: 72px; --play-gap: .8rem; --play-ring: rgba(124, 242, 156, .16);
  --play-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='%230E1113'/%3E%3C/svg%3E"); }
html[data-theme="quiet"] { --play-ring: rgba(23, 112, 62, .12); }
html[data-theme] #menu #today-main.play:not([hidden]), html[data-theme] #preview button.play.go:not([hidden]), html[data-theme] #menu .wrow button.play.go:not([hidden]) {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .1rem;
  min-width: 0; min-height: var(--play-d); padding: 0 0 0 calc(var(--play-d) + var(--play-gap));
  background: none; border: 0; border-radius: 0; color: var(--ink); text-align: left; font: 700 1.05rem/1.2 var(--sans); }
html[data-theme] #menu button.play.go::before, html[data-theme] #preview button.play.go::before {
  content: ''; position: absolute; left: 0; top: calc(50% - var(--play-d) / 2); box-sizing: border-box; width: var(--play-d); height: var(--play-d);
  border-radius: 50%; border: 1.5px solid var(--mint-edge); background: var(--mint) var(--play-mark) 58% 50% / 44% no-repeat; box-shadow: 0 0 0 4px var(--play-ring); }
html[data-theme] #menu button.play.go:hover, html[data-theme] #preview button.play.go:hover { background: none; }
html[data-theme] #menu button.play.go:hover::before, html[data-theme] #preview button.play.go:hover::before { background-color: var(--mint-hover); }
/* the focus ring round the circle, not a box round circle and words */
html[data-theme] #menu button.play.go:focus-visible, html[data-theme] #preview button.play.go:focus-visible { outline: 0; }
html[data-theme] #menu button.play.go:focus-visible::before, html[data-theme] #preview button.play.go:focus-visible::before { outline: 3px solid var(--accent); outline-offset: 5px; }
@media (prefers-reduced-motion: no-preference) {
  html[data-theme] #menu button.play.go::before, html[data-theme] #preview button.play.go::before { transition: transform .12s ease-out; }
  html[data-theme] #menu button.play.go:not(:disabled):active::before, html[data-theme] #preview button.play.go:not(:disabled):active::before { transform: scale(.94); }
}
/* Enter, on a desktop only, under the main button's words */
html.desk[data-theme] #menu #today-main.play::after, html.desk[data-theme] #preview button.play.go::after {
  content: 'Enter' / ''; order: 1; margin-top: .3rem; padding: .05rem .35rem; border: 1px solid var(--edge2); color: var(--muted); font: 500 .72rem/1.3 var(--mono); letter-spacing: .04em; }
/* the Today panel: a bigger circle, its words beside it, Free ride a plain link under them */
.today { --play-d: 80px; }
html[data-theme] #menu .today-go { flex-direction: column; align-items: flex-start; gap: 0; margin-top: 1rem; }
html[data-theme] #menu #today-main.play { flex: none; max-width: 100%; font-size: 1.1rem; }
html[data-theme] #menu #today-free { min-height: 44px; margin: -.2rem 0 0 calc(var(--play-d) + var(--play-gap)); padding: 0;
  border: 0; background: none; color: var(--ink); font: 500 .95rem var(--sans); text-decoration: underline; text-decoration-color: var(--mint-edge); text-decoration-thickness: 2px; text-underline-offset: 4px; }
html[data-theme] #menu #today-free:hover { color: var(--muted); }
@media (min-width: 900px) { .today { --play-d: 92px; } }
/* the route card's bar: the words wrap to two lines rather than squeeze the time beside them */
html[data-theme] #preview button.play.go { max-width: calc(var(--play-d) + var(--play-gap) + 8.5rem); font-size: 1.02rem; }
@media (max-width: 480px) {   /* on a phone a little smaller, so the bar keeps its width for the time beside it */
  #preview { --play-d: 64px; --play-gap: .65rem; }
  html[data-theme] #preview button.play.go { max-width: calc(var(--play-d) + var(--play-gap) + 7.6rem); }
}
/* Start on a workout: a small circle, the word beside it */
html[data-theme] #menu .wrow button.play.go { --play-d: 44px; --play-gap: .55rem; font-size: .98rem; }
html[data-theme] #menu .wrow button.play.go::before { box-shadow: 0 0 0 3px var(--play-ring); }

/* Strava (strava.js): Settings' group, History's line. Strava's own button and marks are shown as they come
   (vendor/strava/), never restyled: the button loses only the app's own button look around it. */
.strava-box { margin-top: 1.9rem; }
.strava-box[hidden] { display: none; }
.strava-box p { margin: 0; }
button.strava-connect { display: inline-block; min-height: 0; padding: 0; border: 0; border-radius: 6px; background: none; box-shadow: none; line-height: 0; cursor: pointer; }
button.strava-connect:hover, button.strava-connect:active { background: none; box-shadow: none; transform: none; opacity: 1; }
button.strava-connect:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button.strava-connect img { display: block; width: 237px; height: 48px; }
.strava-mark { line-height: 0; }
.strava-mark img { display: block; width: auto; height: 18px; }
.strava-mark .on-dark, html[data-theme="dark"] .strava-mark .on-light { display: none; }
html[data-theme="dark"] .strava-mark .on-dark { display: block; }
.strava-note { padding: .5rem .7rem; border-left: 4px solid var(--accent); }
.strava-line { margin: .25rem 0 0; font-size: .92rem; }
.strava-line[hidden] { display: none; }
a.strava-view { font-weight: 700; text-decoration: underline; color: var(--ink); }   /* Strava's rule: bold, underlined or #FC5200 */
html[data-theme="dark"] a.strava-view { color: #FC5200; }

/* ---------- the roomier mobile layout of a tablet or iPad (html.tab-wide: 768 px wide or more, not desk) ----------
   The phone's layout and order with more room (design round 2, 09 and 10): the page up to 1200 px wide with 32 px at
   the sides, the shelves' cards 20rem wide (shelves above), lists and tables up to 960 px, Settings as narrow as on a
   phone. Held on its side, Today beside the map so the cards show above the tab bar. Only on the tabs: the first
   screen, sign in and the summary keep the phone's width. */
html.tab-wide body.tabbed #menu { max-width: 75rem; padding-left: max(2rem, env(safe-area-inset-left, 0px)); padding-right: max(2rem, env(safe-area-inset-right, 0px)); }
html.tab-wide #pane:not([data-screen="ride"]) { max-width: 60rem; }
html.tab-wide #pane[data-screen="settings"] { max-width: 46rem; }
@media (orientation: landscape) {
  html.tab-wide #pane[data-screen="ride"] { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 1.5rem; align-items: start; }
  html.tab-wide #pane[data-screen="ride"] > * { grid-column: 1 / -1; }
  html.tab-wide #pane[data-screen="ride"] > .today { grid-column: 1; grid-row: 1 / span 2; }
  html.tab-wide #pane[data-screen="ride"] > .rm { grid-column: 2; grid-row: 1; }
  html.tab-wide #pane[data-screen="ride"] > .rm-times { grid-column: 2; grid-row: 2; }
  html.tab-wide #pane[data-screen="ride"] .rm-frame { margin-top: 1.1rem; }
}

/* ---------- the desktop shell (html.desk; README "Desktop") ----------
   A wide screen with a mouse or trackpad (js/desk.js). A bar across the whole width, 64 px tall, that stays at the
   top: PEDAL, the four tabs, and at the right the devices button and the rider's picture, whose menu hangs under it.
   The page under it up to 1440 px wide with 32 px at the sides. Only the shell is here: each desktop screen keeps its
   own rules in a block of its own, every one starting html.desk. */
html.desk #menu { max-width: none; padding: 0 0 3rem; }
html.desk { scroll-padding-top: 72px; }   /* what the browser scrolls to (a field in focus, a link) stays clear of the bar */
html.desk #menu > .masthead { position: sticky; top: 0; z-index: 4; min-height: 64px; padding: 0 max(32px, calc((100% - 1440px) / 2 + 32px));
  column-gap: 2.5rem; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--rule); }
html.desk #menu .masthead h1 { align-self: center; font-size: 2.1rem; }
html.desk #menu .masthead .bar { align-self: center; gap: .75rem; }
html.desk #menu .masthead .tagline { padding-bottom: .5rem; }
html.desk .masthead .tabbar { align-self: stretch; gap: 2.25rem; }
html.desk #menu .tabbar button { min-height: 64px; height: 100%; margin: 0 0 -1px; padding: 0 .3rem; border-bottom: 3px solid transparent; gap: .55rem; font-size: 1rem; }
html.desk .tabbar svg { width: 22px; height: 22px; }
/* the page under the bar; the first screen (riders, sign in) stays the phone's width */
html.desk #view, html.desk #menu > .sensor-panel, html.desk #menu > .foot { max-width: 1440px; margin-left: auto; margin-right: auto; padding-left: 32px; padding-right: 32px; }
html.desk body:not(.tabbed) #view, html.desk body:not(.tabbed) #menu > .foot { max-width: calc(46rem + 64px); }
html.desk #menu > .foot { padding-top: .75rem; }
/* the rider's menu: a dropdown under the picture. No Devices row: the bar has its button (design round 2) */
html.desk .me-menu { right: max(32px, calc((100% - 1440px) / 2 + 32px)); top: calc(100% + 1px); }
html.desk #menu .me-menu > #menu-devices { display: none; }

/* ---------- the list of keyboard shortcuts (html.desk only: main.js, "keys") ----------
   ? opens it, Esc or a click outside closes it. A small printed panel, a mint rule along its top; each key in a square
   ruled box. Nowhere else does the app show a key. Its wording is placeholder. */
#keys { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .45); }
#keys[hidden] { display: none; }
.keys-box { width: 100%; max-width: 22rem; padding: 1rem 1.25rem 1.1rem; background: var(--panel, var(--paper)); color: var(--ink);
  border: 1px solid var(--rule); border-top: 3px solid var(--mint-edge, var(--accent)); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
html[data-theme] .keys-box h2 { margin: 0 0 .6rem; font: 600 .74rem/1.3 var(--mono, monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.keys-box dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem .9rem; align-items: center; margin: 0; }
.keys-box dt { justify-self: start; }
.keys-box dd { margin: 0; }
.keys-box kbd { display: inline-block; min-width: 1.9em; padding: .1em .45em; border: 1px solid var(--edge2, var(--ink)); text-align: center; font: 600 .85rem/1.4 var(--mono, monospace); }
.keys-box p { display: flex; justify-content: flex-end; margin: .9rem 0 0; }
html[data-theme] .keys-box button { border-radius: 0; }

/* ==================== DESKTOP ROUTES (html.desk only; main.js deskRoutesHtml, deskToday, deskPanel) =============
   A wide screen with a mouse (html.desk, set by the desktop shell). Every rule here starts with html.desk, so phones
   and iPads never see any of it. The Today strip across the top; the list (search, levels, notes, two columns of
   cards) beside the map, which stays in view; a route's card as a panel over the map, the list dimmed beside it.
   --desk-top is the height of the shell's top bar (64 px unless it says otherwise). */
html.desk #menu:has(.rt-desk) { max-width: 1440px; padding-left: 32px; padding-right: 32px; padding-bottom: 0; }   /* the shell's content width, again */
/* the page fills the window below the top bar (main.js deskSize measures it): the strip, then the list and the map
   sharing what is left; only the list scrolls */
html.desk #pane:has(> .rt-desk) { display: flex; flex-direction: column; height: var(--rt-h, calc(100vh - var(--desk-top, 64px))); }
html.desk #pane > .td-desk { flex: none; }
html.desk #pane .rc[hidden], html.desk #pane .rm-group[hidden], html.desk .td-desk [hidden] { display: none; }

/* the strip: the next ride | its button | this week */
html.desk[data-theme] #menu .td-desk { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 32px; margin: 8px 0 0; padding: 20px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; }
html.desk .td-next { display: flex; align-items: center; gap: 20px; min-width: 0; }
html.desk .td-pic { flex: none; width: 150px; aspect-ratio: 10 / 7; border: 1px solid var(--rule); }
html.desk .td-what { flex: 1 1 auto; display: grid; gap: 6px; min-width: 0; }
html.desk[data-theme] body.tabbed #menu .td-desk h2 { margin: 0; }
html.desk .td-title { margin: 0; font: 600 1.45rem/1.2 var(--sans); color: var(--ink); text-wrap: balance; }
html.desk .td-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin: 0; font-size: 1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
html.desk .td-sub .lvl { font-size: .85rem; }
html.desk .td-bar { display: flex; gap: 3px; max-width: 30rem; margin-top: 4px; }
html.desk .td-bar i { display: block; flex: 1 1 0; height: 7px; background: var(--rule); }
html.desk .td-bar i.on { background: var(--mint); }
html.desk .td-desk { --play-d: 64px; }   /* the play circle (the play-circle block above), a size down in the strip */
html.desk[data-theme] #menu .td-desk .today-go { margin: 0; }
html.desk[data-theme] #menu .td-desk #today-main.play { font-size: 1.15rem; }
html.desk .td-or { margin: -.1rem 0 0 calc(var(--play-d) + var(--play-gap)); color: var(--muted); }
html.desk[data-theme] #menu .td-or #today-free { min-height: 32px; margin: 0; }
html.desk .td-week { display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px 24px; padding-left: 28px; border-left: 1px solid var(--rule); }
html.desk[data-theme] body.tabbed #menu .td-week .today-head { display: grid; gap: 8px; justify-content: start; }
html.desk .td-label { margin: 0; font: 600 .74rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
html.desk .td-desk .week span { width: 22px; }
html.desk .td-desk .week i { width: 20px; height: 20px; }
html.desk .td-totals { display: flex; gap: 18px; margin: 0; }
html.desk .td-totals div { display: flex; flex-direction: column-reverse; gap: 2px; }
html.desk .td-totals dd { margin: 0; font: 600 1.25rem/1.1 var(--mono); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
html.desk .td-totals dt { font-size: .82rem; color: var(--muted); }
html.desk .td-desk .streak { grid-column: 1 / 3; margin: 0; font-size: .95rem; color: var(--mint-edge); }
@media (max-width: 1399px) {   /* the smallest desktops (1280): the strip set tighter, so the list keeps a full row of cards */
  html.desk[data-theme] #menu .td-desk { gap: 0 20px; padding: 14px 0; }
  html.desk .td-pic { width: 112px; }
  html.desk .td-next { gap: 14px; }
  html.desk .td-title { font-size: 1.2rem; }
  html.desk .td-sub { font-size: .9rem; }
  html.desk .td-desk { --play-d: 56px; }
  html.desk .td-week { gap: 6px 16px; padding-left: 20px; }
  html.desk .td-desk .week span { width: 16px; }
  html.desk .td-desk .week i { width: 15px; height: 15px; }
  html.desk .td-totals { gap: 12px; }
  html.desk .td-totals dd { font-size: 1.02rem; }
  html.desk .td-totals dt { font-size: .75rem; }
}

/* the list beside the map */
html.desk .rt-desk { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); grid-template-rows: minmax(0, 1fr); gap: 32px; padding-top: 20px; }
html.desk .rt-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 24px 0; scrollbar-width: thin; }
html.desk .rt-tools { position: sticky; top: 0; z-index: 2; display: flex; gap: 12px; align-items: stretch; padding-bottom: 4px; background: var(--paper); }
html.desk .rt-search { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
html.desk .rt-search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; translate: 0 -50%; fill: none; stroke: var(--muted); stroke-width: 2; pointer-events: none; }
html.desk[data-theme] #menu .rt-search input { width: 100%; min-height: 44px; margin: 0; padding: 0 .8rem 0 2.4rem; border: 1px solid var(--edge2); border-radius: 0; background: var(--panel); color: var(--ink); font: 1rem var(--sans); }
html.desk[data-theme] #menu .rt-search input:focus-visible { outline: 2px solid var(--mint-edge); outline-offset: 0; }
html.desk .rt-levels { display: flex; flex: none; }
html.desk[data-theme] #menu .rt-levels button { min-height: 44px; margin: 0 0 0 -1px; padding: 0 .85rem; border: 1px solid var(--edge2); border-radius: 0; background: var(--panel); color: var(--ink); font: 600 .95rem var(--sans); }
html.desk[data-theme] #menu .rt-levels button:hover { background: var(--hover, var(--rule)); }
html.desk[data-theme] #menu .rt-levels button[aria-pressed="true"] { position: relative; background: var(--mint); border-color: var(--mint-edge); color: var(--mint-ink); }
html.desk .rt-notes .notice { margin: 16px 0 0; padding: .7rem 1rem; border: 1px solid var(--rule); border-left: 3px solid var(--accent); background: var(--panel); }
html.desk .rt-list .rm-times { margin-top: 14px; }
html.desk[data-theme] #menu .rt-list .shelf-head { margin: 22px 0 10px; }
html.desk .rt-count { margin-left: .8em; letter-spacing: .04em; text-transform: none; }
html.desk .rt-list .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
html.desk .rt-list .rc { transition: border-color .12s; }
html.desk .rt-list .rc:hover, html.desk .rt-list .rc.lit { border-color: var(--mint-edge); box-shadow: inset 0 0 0 1px var(--mint-edge); }
html.desk .rt-none { margin: 24px 0 0; color: var(--muted); }
/* the map: the height of the list beside it, staying put as the list scrolls */
html.desk .rt-desk > .rm { min-height: 0; }
html.desk .rt-desk .rm-frame { width: 100%; height: 100%; aspect-ratio: auto; margin: 0; }
html.desk .rm-tabs { position: absolute; left: 16px; bottom: 16px; z-index: 1; display: flex; }
html.desk[data-theme] #menu .rm-tabs button { min-height: 36px; margin: 0 0 0 -1.5px; padding: 0 12px; border: 1.5px solid #1E3324; border-radius: 0; background: #F0E7CF; color: #1E3324;
  font: 600 12px/1 "Public Sans", system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; box-shadow: none; }
html.desk[data-theme] #menu .rm-tabs button:hover { background: #E4D7B0; }
html.desk[data-theme] #menu .rm-tabs button[aria-pressed="true"] { background: #1E3324; color: #F0E7CF; }
html.desk[data-theme] #menu .rm-tabs button:focus-visible { outline: 3px solid #9A4527; outline-offset: 2px; }
/* a route lit from its card: its label inked, its spot bigger */
html.desk #menu .rm-frame button.rm-route.lit .rm-label { background: #1E3324; color: #F0E7CF; box-shadow: 2px 2px 0 rgba(154, 69, 39, .55); }
html.desk #menu .rm-frame button.rm-route.lit .rm-mark i { border-color: #F0E7CF; }
html.desk #menu .rm-frame button.rm-route.lit .rm-mark i.on { background: #F0E7CF; }
html.desk .rm-leads circle.lit { r: 8px; fill: #1E3324; }

/* a route's card: a panel over the map (and the strip), its left edge in the gutter between the list's two columns
   (main.js deskPanelEdge sets --pv-left), the list dimmed beside it; Previous, the count, Next and Close over the card,
   the details beside it, Ride at the foot */
html.desk #preview.pv-desk { top: var(--desk-top, 64px); grid-template-columns: var(--pv-left, 40%) minmax(0, 1fr) minmax(18rem, 25rem); grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 0; padding: 0; background: linear-gradient(90deg, rgba(5, 7, 8, .62) var(--pv-left, 40%), var(--paper) 0); outline: none; }
html.desk[data-theme="quiet"] #preview.pv-desk { background: linear-gradient(90deg, rgba(31, 29, 26, .42) var(--pv-left, 40%), var(--paper) 0); }
html.desk #preview.pv-desk .pv-card { grid-column: 2; grid-row: 1 / 3; padding: 0; border-left: 1px solid var(--rule); }
html.desk #preview.pv-desk .pv-card > .pv-frame, html.desk #preview.pv-desk .pv-peek, html.desk #preview.pv-desk button.pv-zoom {
  inset: 76px 24px 24px 32px; margin: auto; width: min(100cqw - 56px, (100cqh - 100px) * .8); height: min(100cqh - 100px, (100cqw - 56px) * 1.25); }
html.desk #preview.pv-desk .pv-nav { left: 32px; right: auto; top: 16px; width: auto; flex-direction: row; gap: 10px; transform: none; color: var(--ink); }
html.desk #preview.pv-desk button.pv-step, html.desk #preview.pv-desk button.pv-back { display: flex; align-items: center; gap: .5rem; width: auto; height: 44px; padding: 0 14px;
  border: 1px solid var(--edge2); background: transparent; color: var(--ink); box-shadow: none; font: 600 .95rem var(--sans); }
html.desk #preview.pv-desk button.pv-step:hover, html.desk #preview.pv-desk button.pv-back:hover { background: var(--rule); }
html.desk #preview.pv-desk .pv-count { min-width: 4.2em; padding: 0; font: 600 1rem var(--mono); letter-spacing: 0; }
html.desk #preview.pv-desk button.pv-back { left: auto; right: 24px; top: 16px; }
html.desk #preview.pv-desk .pv-back > svg { display: none; }
html.desk #preview.pv-desk .pv-word { display: inline-flex; align-items: center; gap: .5rem; }
html.desk #preview.pv-desk .pv-back svg.pv-x { display: block; width: 18px; height: 18px; }
html.desk #preview.pv-desk .pv-go { grid-column: 3; grid-row: 1; align-self: stretch; align-content: start; gap: 1rem; max-height: none; padding: 28px 32px 16px 28px; border-left: 1px solid var(--rule); }
html.desk #preview.pv-desk .pv-bar { grid-column: 3; grid-row: 2; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 14px; padding: 16px 32px 24px 28px; border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
html.desk #preview.pv-desk :is(.pv-tag, .pv-when) { display: none; }
html.desk #preview.pv-desk .pv-light { grid-column: 1 / 3; grid-row: 1; justify-self: end; }
html.desk #preview.pv-desk :is(#pv-start, #pv-resume) { grid-column: 1 / 3; grid-row: 2; justify-self: start; }
html.desk #preview.pv-desk.carrying #pv-start { grid-column: 1 / 3; grid-row: 3; justify-self: stretch; }
html.desk #preview.pv-desk .pv-so-far { grid-column: 1 / 3; grid-row: 4; }
html.desk #preview.pv-desk .pv-lock { grid-column: 1 / 3; grid-row: 2; justify-self: stretch; }
html.desk #preview.pv-desk .pv-head { display: grid; gap: 8px; }
html.desk #preview.pv-desk .pv-head p, html.desk #preview.pv-desk .pv-pass p { margin: 0; }
html.desk .pv-place { font: 500 .78rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html.desk .pv-name { margin: 0; font: 700 2rem/1.15 var(--sans); color: var(--ink); }
html.desk .pv-head-when .pv-time { font-size: 1.6rem; }
html.desk .pv-head-when .pv-for { margin-top: 2px; font-size: .9rem; }
html.desk #preview.pv-desk .pv-blurb { margin: 0; font-size: 1.02rem; }
html.desk #preview.pv-desk .pv-times { border-top: 1px solid var(--rule); }
html.desk .pv-pass { display: grid; gap: 6px; padding-top: 1rem; border-top: 1px solid var(--rule); }
html.desk .pv-pass:empty { display: none; }
html.desk .pv-pass-on { font-weight: 700; font-size: 1.1rem; }
html.desk .pv-pass dl { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; margin: 0; color: var(--muted); }
html.desk .pv-pass dl div { display: flex; gap: .4rem; }
html.desk .pv-pass dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
html.desk #preview.pv-desk .pv-race-pick { top: 0; }
/* ---------- desktop: Settings' section list and the leaderboard's wide table (Joe's round 2 design, 3 Dec 2026) ----------
   Only under html.desk, the class the desktop shell sets on a window 1280 px or wider with a mouse or trackpad;
   phones and iPads never see these rules. The shell gives the page its width (up to 1440 px) and the 64 px bar
   above it; the section list sticks just under that bar. Colours are the look's own (--accent, --rule, --muted). */
html.desk #pane[data-screen="settings"] { display: grid; grid-template-columns: 14rem minmax(0, 560px); grid-template-areas: "head head" "hello hello" "nav main";
  column-gap: 4rem; align-items: start; }
html.desk #menu #set-h { grid-area: head; margin: 1.5rem 0 1.75rem; font: 700 2.1rem/1.15 var(--sans); letter-spacing: -.01em; text-transform: none; color: var(--ink); }
html.desk .set-welcome { grid-area: hello; margin: -.75rem 0 1.5rem; }
html.desk .set-nav { grid-area: nav; position: sticky; top: calc(64px + 1.5rem); }
html.desk .set-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
html.desk #menu .set-nav button { display: block; width: 100%; min-height: 48px; margin: 0; padding: .5rem 1rem .5rem 1.25rem; border: 0; border-radius: 0;
  background: none; color: var(--muted); font: 500 1rem/1.3 var(--sans); text-align: left; }
html.desk #menu .set-nav button:hover { background: var(--hover, rgba(31, 29, 26, .06)); color: var(--ink); }
html.desk #menu .set-nav button[aria-current] { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
html.desk .set-main { grid-area: main; min-width: 0; }
html.desk .set-main form.sheet, html.desk .set-main .pic-set, html.desk .set-main .danger, html.desk .set-main label.sheet-one { max-width: none; }
html.desk .set-main > *, html.desk .set-main fieldset { scroll-margin-top: 1rem; }   /* below the shell's own scroll-padding-top, which keeps clear of its bar */
html.desk .set-main .pic-set { margin-top: 0; }
html.desk .set-main h2[tabindex="-1"]:focus, html.desk .set-main h3[tabindex="-1"]:focus { outline: none; }

/* the leaderboard: Friends across the top (their latest rides as cards, the week's top three beside them), then the
   heading with This week / This month and Rank by on its right as two square strips, then the table */
html.desk #pane[data-screen="board"] { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "fr fr" "head ctl" "note note" "table table";
  column-gap: 2rem; align-items: center; }
html.desk .friends { grid-area: fr; display: grid; grid-template-columns: minmax(0, 3fr) minmax(16rem, 1fr); grid-template-areas: "fhead top" "finv top" "rides top";
  column-gap: 2.5rem; align-items: start; margin: 0 0 1.75rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
html.desk .fr-head { grid-area: fhead; margin-top: .25rem; }
html.desk .friends #fr-invite { grid-area: finv; }
html.desk #fr-body { display: contents; }
html.desk .fr-rides, html.desk .fr-none { grid-area: rides; }
html.desk #fr-top { grid-area: top; }
html.desk .fr-rides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: .5rem; }
html.desk .fr-rides > li { border: 1px solid var(--rule); background: var(--field, transparent); }
html.desk #menu .friends .fr-ride { height: 100%; padding: 1rem; align-items: flex-start; }
html.desk .fr-who { white-space: normal; }
html.desk .fr-facts > span { white-space: nowrap; }   /* a card breaks its line between two facts, never inside one */
html.desk .fr-kick { margin: .5rem 0 .6rem; }
html.desk .fr-top { grid-template-columns: minmax(0, 1fr); }
html.desk .fr-top > li { min-height: 52px; padding: .5rem 1rem; gap: .75rem; }
html.desk .fr-top > li + li { border-left: 0; border-top: 1px solid var(--rule); }
html.desk .fr-top > li.me { box-shadow: inset 3px 0 0 var(--accent); }
html.desk .friends .fr-top .av-s { width: 2rem; height: 2rem; font-size: .75rem; }
html.desk #menu h2.board-h { grid-area: head; margin: 0; }
html.desk #board-note { grid-area: note; }
html.desk #board { display: contents; }
html.desk .bw-ctl { grid-area: ctl; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .75rem 1.5rem; }
html.desk #menu .bw-ctl .board-controls, html.desk #menu .bw-ctl .rank-chips { display: flex; flex-wrap: nowrap; gap: 0; margin: 0; }
html.desk .bw-ctl .rank { flex-wrap: nowrap; margin: 0; gap: .75rem; }
html.desk .bw-ctl .rank > span { font-weight: 400; color: var(--muted); }
html.desk #menu .bw-ctl button { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; margin: 0; padding: .4rem 1rem; border-radius: 0;
  background: none; color: var(--ink); font-size: .95rem; font-weight: 500; white-space: nowrap; }
html.desk #menu .bw-ctl button + button { margin-left: -1px; }
html.desk #menu .bw-ctl button:hover { background: var(--hover, rgba(31, 29, 26, .06)); }
html.desk #menu .bw-ctl button[aria-pressed="true"] { position: relative; background: var(--accent); border-color: var(--accent); color: var(--paper); font-weight: 600; }
html.desk .bw, html.desk .bw-quiet { grid-area: table; }
html.desk .bw { width: 100%; margin-top: 1.25rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
html.desk .bw th, html.desk .bw td { padding: .7rem .85rem; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
html.desk .bw thead th { padding-top: .3rem; padding-bottom: .5rem; color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
html.desk .bw .num { text-align: right; }
html.desk #menu .bw thead button { min-height: 32px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit;
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
html.desk #menu .bw thead button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }
html.desk #menu .bw thead th.on button { color: var(--accent); }
html.desk .bw thead th.on button::after { content: ""; display: inline-block; margin-left: .4em; vertical-align: .15em;
  border-left: .3em solid transparent; border-right: .3em solid transparent; border-top: .4em solid currentColor; }
html.desk .bw .on { background: color-mix(in srgb, var(--accent) 7%, transparent); }
html.desk .bw tr.me > * { background: color-mix(in srgb, var(--accent) 13%, transparent); }
html.desk .bw tr.me > .on { background: color-mix(in srgb, var(--accent) 19%, transparent); }
html.desk .bw tr.me > :first-child { box-shadow: inset 4px 0 0 var(--accent); }
html.desk .bw td.on { font-weight: 700; }
html.desk .bw .bw-n { width: 3.5rem; }
html.desk .bw td.bw-n { font-size: 1.3rem; font-weight: 700; }
html.desk .bw th.bw-who { font-weight: 600; }
html.desk .bw thead th { white-space: normal; }   /* a long heading (another language) takes two lines rather than widening the page */
html.desk .bw tbody th.bw-who { font-size: 1.05rem; text-transform: none; letter-spacing: 0; }
html.desk .bw-rider { display: flex; align-items: center; gap: .85rem; min-width: 0; }
html.desk .bw-name { overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
html.desk .bw-rider small { color: var(--muted); font-weight: 400; }
html.desk .bw .av-m { width: 2.4rem; height: 2.4rem; font-size: .9rem; }
html.desk .bw td.bw-none { color: var(--muted); }
html.desk .bw-quiet { margin: 1.25rem 0 0; }
html[data-theme="dark"].desk .bw td.num, html[data-theme="dark"].desk .bw td.bw-n { font-family: "JetBrains Mono", ui-monospace, monospace; }
html[data-theme="dark"].desk #menu .bw-ctl button[aria-pressed="true"] { color: #0E1113; }
/* ---------- a desktop's History and Workouts (desk-pages.js; html.desk, set by the desktop shell) ----------
   Everything here is under html.desk, so phones and iPads keep their lists. History: the passport strip in one row,
   then a table of rides whose column heads sort it; a row's Download, Email and Delete show while the pointer is on
   it or the focus is in it (always there for Tab and a screen reader, only faded out). Workouts: the table with each
   workout's shape, a filter by type, and the chosen workout in a panel to the right. Dense, as a desk page is. */
html.desk #menu .pp-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(6.5rem, 1fr); gap: .6rem; overflow-x: auto; margin: .6rem 0 0; padding: .2rem 0 .6rem; }
html.desk #menu .pp-strip li { flex: none; display: flex; }
html.desk #menu button.pp-page { width: 100%; padding: .6rem .4rem; }
html.desk #menu .pp-art { width: min(5.5rem, 100%); }
html.desk #menu .pp-name { font-size: .88rem; line-height: 1.25; text-align: center; }
html.desk #menu .pp-time { font: .82rem var(--mono, ui-monospace, monospace); color: var(--accent); }
html.desk .dk-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
html.desk .dk-table th, html.desk .dk-table td { padding: .55rem .75rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rule); }
html.desk .dk-table thead th { font: 600 .74rem/1.2 var(--mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); white-space: nowrap; }
html.desk .dk-table .num { text-align: right; white-space: nowrap; }
html.desk .dk-table tbody td.num, html.desk .dk-date { font-family: var(--mono, ui-monospace, monospace); font-size: .95rem; }
html.desk .dk-table th.dk-name { font-weight: 600; }
html.desk #menu button.dk-sort { min-height: 32px; padding: .2rem 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; display: inline-flex; align-items: center; gap: .35rem; }
html.desk #menu button.dk-sort:hover { color: var(--ink); background: none; }
html.desk .dk-table th[aria-sort] { color: var(--accent); }
html.desk .dk-arrow { display: inline-block; width: .7em; }
html.desk th[aria-sort="descending"] .dk-arrow::after { content: '▾'; }
html.desk th[aria-sort="ascending"] .dk-arrow::after { content: '▴'; }
html.desk .dk-table th.num button.dk-sort { flex-direction: row-reverse; }   /* the arrow on the side away from the numbers */
html.desk .dk-rides { margin-top: 1rem; }
html.desk .dk-rides tbody tr { height: 3.6rem; }
html.desk .dk-rides tbody tr:hover, html.desk .dk-rides tbody tr:focus-within { background: var(--hover); }
html.desk .dk-date { white-space: nowrap; }
html.desk .dk-rides:not(:has(.strava-line:not([hidden]))) .dk-strava { display: none; }   /* Strava on but nothing sent: no empty column */
html.desk .dk-strava .strava-line { display: block; min-width: 14rem; margin: 0; }   /* "Couldn't send … Retry" on two lines at most */
html.desk .dk-acts { width: 1%; white-space: nowrap; text-align: right; }
html.desk .dk-acts .acts { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: nowrap; }
html.desk #menu .dk-acts button { min-height: 36px; padding: .3rem .7rem; font-size: .88rem; }
html.desk .dk-rides .dk-acts .acts { opacity: 0; transition: opacity .12s; }
html.desk .dk-rides tr:hover .dk-acts .acts, html.desk .dk-rides tr:focus-within .dk-acts .acts { opacity: 1; }
@media (prefers-reduced-motion: reduce) { html.desk .dk-rides .dk-acts .acts { transition: none; } }

html.desk .dk-work { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 0 2rem; align-items: start; }
html.desk .dk-wmain .wk-intro { margin: 1rem 0 0; max-width: 52rem; }
html.desk .dk-wbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0 .4rem; }
html.desk .dk-seg { display: flex; border: 1px solid var(--rule); }
html.desk #menu .dk-seg button { min-height: 40px; padding: .35rem .9rem; border: 0; border-right: 1px solid var(--rule); border-radius: 0; font-weight: 500; display: inline-flex; gap: .45rem; align-items: baseline; }
html.desk #menu .dk-seg button:last-child { border-right: 0; }
html.desk #menu .dk-seg button[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
html.desk .dk-n { font: .8rem var(--mono, ui-monospace, monospace); opacity: .75; }
html.desk .dk-wtable tbody tr { cursor: pointer; }
html.desk .dk-wtable tbody tr:hover { background: var(--hover); }
html.desk .dk-wtable tbody tr.on { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
html.desk #menu button.dk-pick { display: block; min-height: 0; padding: 0; border: 0; background: none; font: 600 1.02rem/1.3 var(--sans); color: var(--ink); text-align: left; }
html.desk .dk-wtable th.dk-name { width: 40%; max-width: 0; }   /* the name and blurb take what is left, the blurb cut short with … */
html.desk .dk-blurb { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; font-size: .88rem; color: var(--muted); }
html.desk .dk-type { font: .78rem var(--mono, ui-monospace, monospace); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html.desk .dk-shape { width: 22%; min-width: 8rem; }
html.desk .dk-shape .spark { max-width: none; height: 30px; margin: 0; }
html.desk .dk-flat { display: block; height: 30px; background: linear-gradient(to bottom, transparent 35%, #4f8fbf 35%, #4f8fbf 85%, transparent 85%); }   /* ERG mode: one steady power, Endurance's colour */
html.desk .dk-wpanel { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; margin-top: 1rem; padding: 1.2rem 1.3rem; border-left: 1px solid var(--rule); background: var(--field, transparent); }   /* held below the 64px top bar (desk-shell) as the page scrolls, Start always in view */
html.desk .dk-wpanel .label { margin: 0; color: var(--muted); }
html.desk #menu .dk-wpanel h3 { margin: .25rem 0 .2rem; font: 700 1.6rem/1.15 var(--sans); }
html.desk .dk-facts { margin: 0; font: .9rem var(--mono, ui-monospace, monospace); color: var(--muted); }
html.desk .dk-about { margin: .5rem 0 0; }
html.desk .dk-big { position: relative; margin: 1.2rem 0 .3rem; padding-bottom: 1.4rem; }
html.desk .dk-big canvas { display: block; width: 100%; height: 150px; }
html.desk .dk-ftp { position: absolute; right: 0; top: 0; transform: translateY(-110%); padding: 0 .2rem; background: var(--field, var(--paper)); font: .72rem var(--mono, ui-monospace, monospace); letter-spacing: .06em; color: var(--muted); }   /* over a step that rises past FTP, still readable */
html.desk .dk-marks { position: absolute; left: 0; right: 2rem; bottom: 0; height: 1.2rem; font: .72rem var(--mono, ui-monospace, monospace); color: var(--muted); }
html.desk .dk-marks span { position: absolute; transform: translateX(-50%); }
html.desk .dk-marks span:first-child { transform: none; }
html.desk .dk-marks .dk-min { left: auto; right: -2rem; transform: none; }
html.desk .dk-steps { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .92rem; font-variant-numeric: tabular-nums; }
html.desk .dk-steps td { padding: .3rem .3rem; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
html.desk .dk-steps .dk-rep tr:not(:first-child) td:first-child { padding-left: 1.2rem; }
html.desk .dk-steps .num, html.desk .dk-st { font-family: var(--mono, ui-monospace, monospace); font-size: .85rem; white-space: nowrap; }
html.desk .dk-steps .num { text-align: right; }
html.desk .dk-st { color: var(--muted); }
html.desk .dk-sl { font-weight: 600; }
html.desk .dk-times { font: 600 .8rem var(--mono, ui-monospace, monospace); color: var(--muted); padding-top: .5rem; }
html.desk .dk-sw { width: 1.4rem; }
html.desk .dk-sw i, html.desk .dk-zones i { display: inline-block; width: .7rem; height: .7rem; vertical-align: baseline; }
html.desk .dk-zones { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .9rem 0 0; padding: 0; font: .78rem var(--mono, ui-monospace, monospace); color: var(--muted); }
html.desk .dk-zones i { margin-right: .35rem; }
html.desk .dk-go { position: sticky; bottom: -1.2rem; display: flex; flex-direction: column; align-items: flex-start; margin: 1rem -1.3rem -1.2rem; padding: 1rem 1.3rem 1.2rem; background: var(--field, var(--paper)); }
/* Start: the play circle (drawn by the play-circle block above): a small one in each row, the main one in the
   panel, the words beside each */
html.desk[data-theme] #menu .dk-work button.play.go:not([hidden]) { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-width: 0; min-height: var(--play-d); padding: 0 0 0 calc(var(--play-d) + var(--play-gap)); background: none; border: 0; border-radius: 0; color: var(--ink); text-align: left; font: 700 .95rem/1.2 var(--sans); }
html.desk[data-theme] #menu .dk-wtable button.play.go { --play-d: 36px; --play-gap: .5rem; }
html.desk[data-theme] #menu .dk-wtable button.play.go::before { box-shadow: 0 0 0 3px var(--play-ring); }
html.desk[data-theme] #menu .dk-go button.play.go.dk-start { --play-d: 64px; font-size: 1.2rem; }
html.desk #menu .dk-go button.dk-remove { display: block; margin: .5rem 0 0; color: var(--muted); }
