/* ==========================================================================
   Forge — styles

   Every spacing, type, colour, radius and shadow value here comes from
   css/tokens.css — there are no hex colours and no ad-hoc sizes below. What
   remains literal is deliberate: hairline and outline widths (1-3px), a blur
   radius, one responsive grid threshold, and the rest timer's 1s tick, which
   has to match the clock rather than a motion scale.

   Direction: "Coach+" — dark, one accent, low density, a display title on
   every screen and the numbers doing the talking. The accent was amber until
   the v270 rebrand and is blue now; "amber" in the comments below means it.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior-y: none;
}
/* One size for the whole app, from the screen's width (v303). Type, spacing,
   bars and figures are all rem, so they grow and shrink together and the
   layout stays the same on every phone: 94% on a 320px phone, 100% at 375px,
   about 106% on a 430px Pro Max, 108% at most. The percentages keep the
   browser's own text-size setting (Android, desktop); --type-scale carries
   iOS's Text Size, set in app.js and capped there. */
html {
  font-size: calc(var(--type-scale, 1) * clamp(94%, calc(59% + 1.75vw), 108%));
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}

/* No scrollbar gutter, anywhere that scrolls. This is a phone app, where there
   is none to begin with, and on a desktop browser its arrival and departure
   changes the width of the viewport by the width of the bar — so every screen
   that happens to scroll is laid out a few pixels narrower than one that does
   not, and switching between them shifts everything sideways.

   Everything, not just the page: the app has four scroll containers, and the
   page is only one of them. The screen arriving in a swipe scrolls on its own
   while it slides, so a bar appeared down its edge for as long as a finger was
   down and vanished when the gesture ended. The sheet and the sign-in gate
   scroll too. */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* One warm bloom behind the top of the screen, fixed so it does not scroll
   away and stays where the greeting is.

   A pseudo-element rather than a gradient on `background`, because body's
   background paints the whole canvas and a gradient there would be stretched
   by the scroll height — tall screens would wash out and short ones would band.
   It sits behind everything: body's own children paint after it, and every
   layer that matters carries a z-index of its own. */
body::before {
  content: '';
  position: fixed; inset: 0 0 auto; height: 100vh;
  /* The first layer holds the page at --bg down to the bottom of the status
     bar, then lets the bloom in over the next 160px on an eased curve. The
     bar above may be opaque black (index.html), and the bloom is at its
     brightest right at the top, so something has to bring the two together.

     It was a straight 48px ramp, and on the phone that read as a shelf: a
     hard start under the clock, a hard corner where the ramp met the bloom,
     and the light rising three times faster than it fell. The eye finds the
     corners of a linear ramp and draws them as lines. These stops are
     smoothstep, 1 - t^2(3 - 2t), sampled every eighth: no corner at either
     end, so the amber grows out of the black and rounds over at the top.

     The bloom reaches to 80% where it stopped at 70%, because the longer
     fade takes light off its top and this puts it back further down, around
     the greeting. It is centred on the bottom of the status bar, not on the
     top of the glass: in an installed app the first 59px are behind the clock
     and under the fade, and a bloom centred up there had spent a third of its
     light before any of it could be seen -- the app was dimmer than the same
     page in a browser. tools/check-glow.py checks every row of the result,
     in both places, against every ink colour (DESIGN.md). With no
     status bar to clear, --safe-top is 0 and the fade starts at the top. */
  background:
    linear-gradient(to bottom,
      var(--bg) var(--safe-top),
      color-mix(in srgb, var(--bg) 96%, transparent) calc(var(--safe-top) + 20px),
      color-mix(in srgb, var(--bg) 84%, transparent) calc(var(--safe-top) + 40px),
      color-mix(in srgb, var(--bg) 68%, transparent) calc(var(--safe-top) + 60px),
      color-mix(in srgb, var(--bg) 50%, transparent) calc(var(--safe-top) + 80px),
      color-mix(in srgb, var(--bg) 32%, transparent) calc(var(--safe-top) + 100px),
      color-mix(in srgb, var(--bg) 16%, transparent) calc(var(--safe-top) + 120px),
      color-mix(in srgb, var(--bg) 4%, transparent) calc(var(--safe-top) + 140px),
      transparent calc(var(--safe-top) + 160px)),
    /* G9 since v278: three lights, each from its own edge. Their alphas are
       tokens; tools/check-glow.py reads these three lines to check them. */
    radial-gradient(70% 45% at 0 var(--safe-top), var(--glow) 0%, transparent 70%),
    radial-gradient(70% 45% at 100% 18%, var(--glow-2) 0%, transparent 70%),
    radial-gradient(80% 50% at 20% 100%, var(--glow-3) 0%, transparent 70%);
  pointer-events: none;
  /* Behind the content, which needs saying out loud.
     A positioned element with `z-index: auto` paints AFTER every non-positioned
     block in the document — so without this the bloom was not behind the app at
     all, it was a warm film laid over the top of it. Every card, every day cell
     and every line of text was being tinted by it, which is why changing a
     card's own colour never made any difference to how the card looked.
     Negative z-index puts it where it was always meant to be: over the page
     background, under everything drawn on the page. */
  z-index: -1;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tr-title);
  line-height: var(--lh-tight);
}
p { margin: 0 0 0.75em; }
p:last-child { margin-bottom: 0; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* ============================================================ LAYOUT ==== */

.app { display: flex; flex-direction: column; min-height: 100dvh; }

/* The top bar carries actions only. The screen's name is the display title
   inside the view, and the tab bar already says which tab you are on — a
   third label would be chrome for its own sake. */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--safe-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--sp-8); padding: var(--sp-8) var(--gutter);
  min-height: var(--sp-40);
}
.topbar__actions { display: flex; gap: var(--sp-8); }
/* Nothing at all when it is empty — no minimum height and no padding either.
   Zeroing the minimum alone left the eight pixels above and below it, which is
   the same sixteen the bar had before. All of it was the top bar reserving room
   for actions no screen has ever given it, above every screen in the app. The
   moment one does, this stops matching and the bar takes its height back. */
.topbar:not(:has(.topbar__actions > *)) .topbar__inner {
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* And when it is empty it is plain black -- the page colour, no tint and no
   blur -- and exactly as tall as the iPhone's status bar.

   Made solid in v254 to stop the blur iOS 26 lays under the clock. WebKit's
   source says it drops that blur when it finds a solid fixed or sticky box at
   the top edge (LocalFrameView::fixedContainerEdges, then
   _shouldHideTopScrollPocket in WKWebView) -- but only where the app hosting
   the page reports the status bar as covering it, and an app on the Home
   Screen evidently does not: on a real iPhone the band turned black and the
   blur stayed. What keeps the screen clear of it is --pocket (tokens.css).

   Left solid because it changes nothing to see: the fade at the top of the
   bloom paints the same black over the same band. */
.topbar:not(:has(.topbar__actions > *)) {
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* A column, so a view can be told to fill it. Without a definite height to
   stretch into, a screen has no way to put something at the bottom of the
   visible area except by taking it out of flow — which is how the recovery
   strip came to be a fixed element inside a view that gets transformed during
   a swipe, and a fixed element inside a transformed ancestor is not fixed to
   the viewport at all. */
.views { flex: 1; display: flex; flex-direction: column; }
.view { flex: 1 0 auto; }
.view {
  /* Explicitly full width. `.views` is a flex column, and a flex item with auto
     margins across the cross axis is not stretched to fill it — the margins
     take the free space and the item is sized to its own content instead. The
     home screen, being the one view that is itself a flex column, shrank to
     336px inside a 375px phone and its cards pulled away from the edges. The
     max-width and the auto margins still do their job on a wide screen. */
  width: 100%;
  /* --pocket on top: the band an iPhone blurs under the clock, left empty.
     Zero anywhere else. On the view rather than on the container around it,
     so the screen that slides in during a swipe -- which is lifted out of the
     container -- brings the same space with it. */
  padding: var(--pocket) var(--gutter) calc(var(--tabbar-clear) + var(--sp-32));
  max-width: var(--content-max); margin: 0 auto;
}
/* `!important`, because hiding a screen has to beat anything the screen itself
   says about how it is laid out.

   `#view-home` needs `display: flex` so its last block can be pushed to the
   bottom — and an id selector outranks an attribute one, so setting `hidden`
   on the home screen stopped doing anything at all. It stayed on the page,
   above whichever screen was switched to, and the two stacked. Every tap and
   every swipe looked broken; the DOM said one screen was visible and the
   glass showed two. */
.view[hidden] { display: none !important; }

/* ---- swiping between tabs ---------------------------------------------- */
/* The browser keeps vertical scrolling; the horizontal axis is ours, which is
   what lets the move handler cancel a page scroll it has already claimed. */
.view { touch-action: pan-y; }

/* While a gesture is live the screen being left is translated, and without
   this it would push the page sideways and hand the body a scrollbar. `clip`
   rather than `hidden` so it makes no scroll container of its own — and so it
   does not clip the arriving screen, which is fixed to the viewport. */
.views.is-swiping { overflow-x: clip; }

/* The screen arriving. Lifted out of flow and laid over the viewport: left in
   place it would add a second screen's height to the page the instant a
   gesture began. It carries the same gutter and column width as any view,
   because it is the same element — only its position changes. */
/* `top` is set on the element while it slides, to the bottom edge of the top
   bar: this is fixed to the viewport, and zero would put it above a bar the
   screen it is replacing sits below. */
.view.is-arriving {
  position: fixed; left: 0; right: 0; bottom: 0;
  margin: 0 auto; z-index: 30;
  overflow-y: auto; overscroll-behavior: contain;
  will-change: transform;
}
.view.is-leaving { will-change: transform; }

/* ---- screen head: the Coach+ opening on every screen -------------------- */

/* A fifth off the top, on every screen that has a head.

   The space being measured is the whole gap from the top of the glass down to
   the first line: on a phone that is roughly 59 pixels of safe area under the
   notch, 8 of top bar, and 24 of this — 91 in total, of which a fifth is 18.
   The safe area is the notch and cannot move, so the 18 comes out of the other
   two: the top bar gives up all 8 above, and this gives up 12, landing on the
   spacing scale's own step rather than on a number invented to hit 18 exactly. */
/* Points left, because it goes back — the mirror of every other chevron in the
   app, which point at what they open. */
.screen-back {
  display: inline-flex; align-items: center; gap: var(--sp-4);
  background: none; border: 0; padding: var(--sp-12) 0 var(--sp-4); margin: 0;
  font: inherit; font-size: var(--fs-meta); color: var(--accent); cursor: pointer;
}
.screen-back__ico {
  width: var(--sp-16); height: var(--sp-16); flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  transform: rotate(180deg);
}
.screen-back:active { opacity: 0.6; }

.screen-head { padding: var(--sp-12) 0 var(--sp-20); }
/* The head brings its own top padding; after a back control that is a gap
   twice over. */
.screen-back + .screen-head { padding-top: 0; }

/* Title left, optional screen-level control right, aligned on their baselines
   so the button sits with the title rather than floating under it. */
.screen-head__top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-16);
}
.screen-head__main { min-width: 0; }

/* One line, always. A kicker is an orienting label; three wrapped lines of
   tracked uppercase stop being one and start competing with the title.
   Programme names are free text, so this is a real case, not a hypothetical. */
.screen-head__kicker {
  font-size: var(--fs-tiny); font-weight: var(--fw-bold);
  letter-spacing: var(--tr-kicker); text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Three lines is the ceiling. The approved title runs to two; a day renamed to
   list six muscle groups reached four and 155px, pushing the figure, the
   numbers and the start button off the screen. Long names still read — they
   just stop being able to take the whole viewport. `break-word` catches the
   other end: one unbroken 40-character word would otherwise overflow sideways
   at this size. */
.screen-head__title {
  margin-top: var(--sp-8);
  font-size: var(--fs-display); line-height: var(--lh-display);
  font-weight: var(--fw-display); letter-spacing: var(--tr-display);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: break-word;
  /* Descenders. `-webkit-line-clamp` requires `overflow: hidden`, and the box
     it clips to is line-height tall — 38.8px at a 1.02 leading — while the
     font actually needs 51px to draw Hpg in full. The 12px difference splits
     above and below, so the tails of g, p, q and y were being cut off.
     Measured on Segoe UI: the descender of "Progress" reached 4.2px past the
     clip. 0.22em covers that with room for Roboto, whose descender is deeper
     than the Apple and Microsoft faces ahead of it in the stack. The matching
     negative margin cancels the padding, so the spacing below the title is
     unchanged; both are in em, so they track the fluid display size. */
  padding-bottom: 0.22em;
  margin-bottom: -0.22em;
}

.screen-head__sub {
  margin-top: var(--sp-12);
  font-size: var(--fs-meta); color: var(--dim);
}
.screen-head__aside { margin-top: var(--sp-16); }

/* ============================================================ TABBAR ==== */

/* A floating bar: inset from the sides, lifted off the bottom, rounded on all
   four corners.

   It is drawn on --surface rather than --sunken. Sunken is black now, and a
   black bar floating on a black page has no edge at all — the surface step is
   what gives it one, the same way every card on the screen gets one. The top
   border went with the corners: a hairline across a rounded floating shape
   reads as a seam, so the ring carries the edge instead. */
.tabbar {
  position: fixed; z-index: 50;
  left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--safe-bottom) + var(--tabbar-lift));
  max-width: calc(var(--content-max) - 2 * var(--gutter));
  margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  /* Thin glass since v275; background-color, so it can thin out with a
     transition while the bar steps back. */
  background-color: var(--glass-fill);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--r-xl);
  box-shadow: var(--glass-rim), var(--shadow-float);
  transform-origin: 50% 100%;
  transition: transform var(--dur-sheet) var(--ease-out),
              background-color var(--dur-sheet) var(--ease-out);
}
/* Stepping back while you read down a screen, the way iOS 26 and Instagram do:
   a little smaller, a little clearer. Every tab stays where a thumb expects
   it. Asked for on 13/11/2026 (choice "1"). */
.tabbar.is-min {
  transform: scale(0.86) translateY(var(--sp-4));
  background-color: var(--glass-fill-min);
}
.tab {
  display: flex; align-items: center; justify-content: center;
  position: relative;
  height: var(--tabbar-h);
  background: none; border: 0; cursor: pointer;
  color: var(--faint);
}

/* Lucide, and therefore stroked rather than filled. The set this replaced was
   solid-fill paths from mixed sources, which is why the gear read as a heavy
   blob while the dumbbell and the chart read as hairlines: they were not the
   same kind of drawing. One stroke width across all six is what makes them a
   set.

   Every icon is 24px in a 24-unit viewBox, so the stroke lands on whole pixels
   instead of straddling them. */
.tab svg {
  width: var(--sp-24); height: var(--sp-24); flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Drawn at full size. It used to be scaled down to sit under a label without
     crowding it; with the labels gone there is nothing to balance against, and
     a shrunken glyph alone in the cell just reads as small. */
}

/* Active is a glass lens behind the glyph, not a recolour of the glyph itself:
   a filled variant or a heavier stroke changes the glyph's optical size and
   shifts the row. The short accent rule that sat under the lens until v275
   was taken out at the user's request (13/11/2026); the lens says it alone. */
.tab.is-active { color: var(--ink); }

/* The chip. Square, and centred on the glyph rather than on the tab, so the
   glyph sits in the middle of it. Behind the glyph, which is why it is a
   negative z-index: the tab paints no background of its own, so this lands on
   the bar's.

   On `has-mark`, not `is-active`. The two used to be the same class and that
   made everything wait for the slowest part of it: the square cannot be on two
   tabs at once, so it can only change hands when it finishes travelling — and
   the white glyph and the amber rule, riding on the same class, arrived at the
   end of the journey with it. The tab you pressed sat looking unpressed for
   half a second. Now `is-active` moves the instant you tap and `has-mark`
   follows the square. */
.tab.has-mark::before {
  content: '';
  position: absolute; z-index: -1;
  width: var(--tab-chip); height: var(--tab-chip);
  background: var(--glass-lens);
  /* Driven a frame at a time while the mark is moving, and unset the rest of
     the time. The origin is the trailing edge, which is the whole idea: a scale
     leaves its origin alone, so the side the square came from stays exactly
     where it was while the other side is drawn out ahead of it. */
  transform-origin: var(--mark-origin, center);
  transform: translateX(var(--mark-x, 0px))
             scaleX(var(--mark-sx, 1))
             scaleY(var(--mark-sy, 1));
  /* The corners keep their shape while the sides run. Same cancellation as the
     profile's pill: a scale stretches a corner as readily as an edge, so the
     horizontal radius is divided by the factor the transform multiplies it by
     and multiplied by the vertical one, which leaves every corner as round as
     the square is tall at that instant. Only the flats between them lengthen. */
  border-radius: calc(var(--r-md) * var(--mark-sy, 1) / var(--mark-sx, 1))
                 / var(--r-md);
}


.tab:active { opacity: 0.6; }

/* Every label is now for listening only: the bar shows icons, and the text is
   what a screen reader announces. Not display:none — that would take it out of
   the accessibility tree along with the pixels. */
.tab span {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}


/* ============================================================== CARD ==== */

.card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--ring);
  padding: var(--sp-20);
  margin-bottom: var(--sp-12);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-12); margin-bottom: var(--sp-12);
}
.card__title { font-size: var(--fs-title); font-weight: var(--fw-bold); overflow-wrap: break-word; }
.card__sub { color: var(--dim); font-size: var(--fs-meta); margin-top: var(--sp-2); }

.section-label {
  font-size: var(--fs-micro); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: var(--tr-caps); color: var(--faint);
  margin: var(--sp-32) var(--sp-2) var(--sp-12);
}
.section-label:first-child { margin-top: var(--sp-4); }

/* =========================================================== BUTTONS ==== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-6);
  min-height: var(--tap-min); padding: 0 var(--sp-20);
  border: 1px solid var(--line-strong); border-radius: var(--r-full);
  background: var(--surface-2); color: var(--ink);
  font-size: var(--fs-body); font-weight: var(--fw-medium);
  letter-spacing: var(--tr-title); cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent);
  font-weight: var(--fw-bold);
}
.btn--ghost  { background: transparent; }
.btn--danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn--block  { width: 100%; }
.btn--sm     { min-height: var(--sp-40); padding: 0 var(--sp-12); font-size: var(--fs-small); position: relative; }
/* Same treatment: smaller button, full-size target. */
.btn--sm::after {
  content: ''; position: absolute; left: 0; right: 0;
  top: 50%; transform: translateY(-50%); height: var(--tap-min);
}
/* The primary call to action. Taller and rounder than a normal button, so it
   reads as the one thing to do on the screen. */
.btn--lg     { min-height: var(--sp-64); border-radius: var(--r-full); font-size: var(--fs-title); }

/* A button carrying somebody else's mark. The gap is wider than the button's
   own because a logo is not a glyph in the label — it needs air on both sides
   to stay a separate object, which is also what Google's guidelines ask for. */
.btn--provider { gap: var(--sp-8); }
/* Height only, width from the file. The G's own box is 118x120, so pinning
   both would stretch it 1.7% wide — small, but it is a logo, and the one rule
   every set of brand guidelines agrees on is that you do not reshape it. */
.btn__mark {
  height: var(--sp-20); width: auto;
  flex: none; display: block;
}

/* A button that opens what is sitting under it. The chevron is the only thing
   that says so — down while it is shut, up while it is open — and it is the
   same mark the home cards and the recovery rows carry, turned a quarter.
   Rotated rather than swapped for a second glyph, so the two states cannot
   drift out of shape; the same argument as the star's one outline.

   The turn is a transition on an element already on screen, not on one built
   carrying its final state, so it actually runs — see the Dead Transition Rule
   in DESIGN.md. --dur-base is the token tokens.css names for dropdowns. */
.btn__chev {
  flex: none; width: var(--sp-16); height: var(--sp-16);
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  transform: rotate(90deg);
  transition: transform var(--dur-base) var(--ease-out);
}
[aria-expanded="true"] > .btn__chev { transform: rotate(-90deg); }

/* The panel it opens. The gap belongs to the panel and not to the button below
   it, so a shut panel leaves nothing behind. */
.addfriend { margin-top: var(--sp-16); }
/* Disabled, not dimmed. Fading the whole button with opacity dropped its
   label to 2.42:1 — and on this app a disabled button always carries the
   sentence explaining why it is disabled, so an unreadable label defeats the
   point of showing it at all. An explicit muted surface keeps the text legible
   while reading as clearly inactive. */
.btn:disabled,
.btn--primary:disabled {
  cursor: not-allowed;
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--dim);
  font-weight: var(--fw-medium);
}
.btn:disabled:active { transform: none; }

.btn-row { display: flex; gap: var(--sp-8); }
.btn-row > .btn { flex: 1; }

/* ============================================================= PILLS ==== */

.pill {
  display: inline-flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-8); border-radius: var(--r-full);
  font-size: var(--fs-small); font-weight: var(--fw-medium);
  background: var(--surface-2); color: var(--dim);
  white-space: nowrap;
}
.pill--accent  { background: var(--accent-soft);  color: var(--accent); }
/* The mark on a live badge, in the pill's own colour. A dot rather than a
   second word: the pill already says what is happening, and the dot is what
   makes it read as happening now rather than as a label. It is not animated —
   a pulse on a list of friends would be four things blinking at once, and the
   app's motion rules spend movement on what the finger just touched. */
.pill__dot {
  flex: none; width: var(--sp-6); height: var(--sp-6);
  border-radius: var(--r-full); background: currentColor;
}
.pill--success { background: var(--success-soft); color: var(--success); }
.pill--primary { background: var(--info-soft);    color: var(--info); }
.pill--warn    { background: var(--warn-soft);    color: var(--warn); }
.pill--danger  { background: var(--danger-soft);  color: var(--danger); }

/* Muscle chips — the Coach+ header names the muscles in the accent, and the
   figure below shows where they are. */
.chip-row { display: flex; gap: var(--sp-6); flex-wrap: wrap; }

/* ====================================================== EVIDENCE TAG ==== */

.evidence {
  display: inline-flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-8) var(--sp-2) var(--sp-6);
  border-radius: var(--r-full);
  background: var(--info-soft); color: var(--info);
  border: 0; font-size: var(--fs-small); font-weight: var(--fw-medium);
  cursor: pointer; min-height: var(--sp-24);
}
.evidence::before {
  content: ''; width: var(--sp-12); height: var(--sp-12); flex: none;
  background: currentColor;
  -webkit-mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z'/%3E%3C/svg%3E");
  mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z'/%3E%3C/svg%3E");
}
.evidence:active { opacity: 0.6; }

.source-card {
  border-radius: var(--r-sm); box-shadow: var(--ring);
  padding: var(--sp-12); margin-bottom: var(--sp-8); background: var(--surface-2);
}
.source-card__title { font-weight: var(--fw-medium); font-size: var(--fs-body); margin-bottom: var(--sp-2); }
.source-card__meta  { color: var(--faint); font-size: var(--fs-small); margin-bottom: var(--sp-6); }
.source-card__note  { color: var(--dim); font-size: var(--fs-meta); }
.source-card__link  { color: var(--info); font-size: var(--fs-small); text-decoration: none; font-weight: var(--fw-medium); }
.source-card__link::after { content: ' \2197'; }

/* ========================================================== EXERCISE ==== */

.ex-card {
  background: var(--surface); box-shadow: var(--ring);
  border-radius: var(--r-md); margin-bottom: var(--sp-12); overflow: hidden;
}
.ex-card__head {
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-12) var(--sp-16); cursor: pointer;
}
/* Square: the illustration stage is 1:1, so a portrait box would just add
   dead space under the figure. */
.ex-card__thumb {
  width: var(--sp-64); height: var(--sp-64); flex: none;
  background: var(--sunken); border-radius: var(--r-sm);
  display: grid; place-items: center; overflow: hidden;
}
.ex-card__thumb svg { width: 100%; height: 100%; }
.ex-card__info { flex: 1; min-width: 0; }
.ex-card__name {
  font-weight: var(--fw-medium); font-size: var(--fs-title); letter-spacing: var(--tr-title);
  overflow-wrap: break-word;
}
.ex-card__meta { color: var(--dim); font-size: var(--fs-meta); margin-top: var(--sp-2); }
/* Stroked, not filled. This said `fill: var(--faint)` while the markup set
   `stroke: currentColor`, so the chevron was painted both ways at once — a
   solid wedge with a hard mitred corner, next to the clean rounded strokes
   every other arrow in the app is drawn with. */
.ex-card__chev {
  width: var(--sp-20); height: var(--sp-20); color: var(--faint);
}
/* The star sits inside a row that is itself a button, so it needs its own tap
   target rather than borrowing the row's. 40px square, which clears the 44px
   minimum once the row's own padding is counted. */
.favstar {
  flex: none; display: grid; place-items: center;
  width: var(--sp-40); height: var(--sp-40);
  margin: calc(-1 * var(--sp-8)) 0;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--faint);
}
.favstar.is-on { color: var(--accent); }
.favstar__ico {
  width: var(--sp-20); height: var(--sp-20);
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Filled only when starred: one outline, two states, so the two can never be
   drawn as different shapes. */
.favstar.is-on .favstar__ico { fill: currentColor; }
.ex-card__body { padding: 0 var(--sp-16) var(--sp-16); }

/* ======================================================== SET LOGGER ==== */

.sets { display: flex; flex-direction: column; gap: var(--sp-8); }
/* The heading between the plan's sets and the ones done on top of it. Closer
   than a section label usually sits: it divides one list, not two screens. */
.sets__extra { margin: var(--sp-8) var(--sp-2) 0; }

.set-row {
  display: grid; grid-template-columns: var(--sp-24) 1fr 1fr var(--sp-48) var(--tap-min);
  gap: var(--sp-8); align-items: center;
}
/* Completing a set is the most frequent thing anyone does in this app — about
   twenty times a session — so the confirmation is colour only and deliberately
   near-imperceptible. No transform: a pop would be charming the first time and
   tiring by the fifth. The row updates in place rather than through a re-render,
   which is what makes any transition here possible at all. */
.set-row__num {
  font-family: var(--mono); font-size: var(--fs-small); font-weight: var(--fw-bold);
  color: var(--faint); text-align: center;
  transition: color var(--dur-fast) var(--ease-out);
}
.set-row.is-done .set-row__num { color: var(--accent); }

.numfield { position: relative; }
.numfield input {
  width: 100%; height: var(--sp-48); padding: var(--sp-16) var(--sp-8) var(--sp-4);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: var(--fs-title); font-weight: var(--fw-bold);
  text-align: center; -moz-appearance: textfield;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.numfield input::-webkit-outer-spin-button,
.numfield input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.numfield input:focus { outline: 2px solid var(--info); outline-offset: -1px; }
.numfield label {
  position: absolute; top: var(--sp-4); left: 0; right: 0;
  text-align: center; font-size: var(--fs-micro); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--tr-caps);
  color: var(--faint); pointer-events: none;
}
.set-row.is-done .numfield input { background: var(--accent-soft); border-color: var(--accent-line); }

/* The same row, minus the effort box and the tick. Editing a workout that is
   over has two numbers worth changing and one thing worth doing to the row,
   so it is four columns rather than five. */
.set-row--edit {
  grid-template-columns: var(--sp-24) 1fr 1fr var(--tap-min);
  margin-top: var(--sp-6);
}
/* Cardio has a third number, its effort, in the narrow column a lift's RIR
   takes on the live row. */
.set-row--edit-wide { grid-template-columns: var(--sp-24) 1fr 1fr var(--sp-48) var(--tap-min); }

/* The name of a finished workout, with its Edit beside rather than under.
   Not .histhead: that one is the release-notes header, and borrowing it would
   restyle the update history. */
.sessionhead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-8);
}

.set-row__check {
  width: var(--tap-min); height: var(--tap-min); border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-press) var(--ease-out);
}
.set-row__check:active { transform: scale(0.96); }
.set-row__check svg {
  width: var(--sp-20); height: var(--sp-20); fill: var(--faint);
  transition: fill var(--dur-fast) var(--ease-out);
}
.set-row.is-done .set-row__check { background: var(--accent-fill); border-color: var(--accent-fill); }
.set-row.is-done .set-row__check svg { fill: var(--on-accent); }

.set-hint {
  display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap;
  padding: var(--sp-8) var(--sp-12); margin-bottom: var(--sp-12);
  background: var(--info-soft); border-radius: var(--r-sm);
  font-size: var(--fs-meta); color: var(--ink);
}
.set-hint strong { color: var(--info); }

.prev-line {
  font-family: var(--mono); font-size: var(--fs-small);
  color: var(--faint); margin-top: var(--sp-8);
}

/* ========================================================= BODY MAP ==== */

/* Anatomy artwork is a set of separate paths, so highlighting is a fill
   change per path rather than an overlay. Idle muscle keeps a visible fill so
   the figure still reads as a body when nothing is selected.

   Monochrome on purpose: primary is the accent, assisting is the same amber
   in shadow. A second hue would compete with the chips that already name the
   muscles above. */

.bodymap-wrap {
  display: flex; gap: var(--sp-4); align-items: center; justify-content: center;
  padding: var(--sp-4) 0;
}
/* --fig-body-max-h is unset on tall screens, so max-height resolves to none
   and the width cap alone governs — exactly the approved proportions. Short
   screens set it, and height takes over as the binding constraint. */
.body-map {
  width: 100%; max-width: var(--fig-body); height: auto; display: block;
  max-height: var(--fig-body-max-h, none);
}

/* No transition on fill. Every path is created with its final role class and
   the whole figure is replaced when the view changes, so a fill transition
   could never fire — it was dead code carried over from the old stylesheet,
   the same defect the progress bars had. Switching front/back replaces the
   figure wholesale; there is no in-place recolour to smooth. */
.anat--outline   { fill: var(--anat-outline); }
.anat--idle      { fill: var(--anat-idle); }
.anat--primary   { fill: var(--anat-primary); }
.anat--secondary { fill: var(--anat-secondary); }

/* The fade behind picking a muscle on the recovery screen.

   The transition lives on .anat, which every path carries from birth, while the
   colour change arrives later as .anat--picked toggled on a node already in the
   document. That order is the whole trick: DESIGN.md's Dead Transition Rule
   records two animations this codebase shipped blind because the element was
   created already wearing its final class, so there was never a from-value to
   move away from. Nothing here may go back to rebuilding the map on selection.

   --dur-base is the token annotated "colour and fill changes" in tokens.css. */
.anat { transition: fill var(--dur-base) var(--ease-out); }
.anat--picked { fill: var(--anat-picked); }

.anat--interactive { cursor: pointer; }
.anat--interactive:focus-visible { outline: 2px solid var(--info); }

.view-toggle {
  display: inline-flex; background: var(--surface-2); border-radius: var(--r-full);
  padding: var(--sp-2); gap: var(--sp-2); box-shadow: var(--ring);
}
.view-toggle button {
  min-height: var(--sp-32); padding: 0 var(--sp-16); border: 0; border-radius: var(--r-full);
  background: none; font-size: var(--fs-small); font-weight: var(--fw-medium);
  color: var(--dim); cursor: pointer;
}
.view-toggle button.is-active { background: var(--accent-soft); color: var(--accent); }

/* ===================================================== STATS STRIP ==== */

/* Three ruled columns. The screen head says what the day is; the strip says
   how big it is. Neither repeats the other. */
.statstrip {
  display: flex; padding: var(--sp-16) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.statstrip__cell { flex: 1; text-align: center; }
.statstrip__cell + .statstrip__cell { border-left: 1px solid var(--line); }
.statstrip__value {
  display: block; font-size: var(--fs-lead); font-weight: var(--fw-bold);
  letter-spacing: var(--tr-lead); font-variant-numeric: tabular-nums;
}
.statstrip__label {
  display: block; margin-top: var(--sp-4); font-size: var(--fs-micro);
  letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--faint);
}

/* A fact and its name, one per line. The label carries the quiet colour and
   the value the ink: which of the two you are looking for decides which way
   round that goes, and on this screen you are reading the values. */
.detailrow {
  display: flex; align-items: baseline; gap: var(--sp-12);
  padding: var(--sp-12) 0; font-size: var(--fs-meta);
}
.detailrow + .detailrow { border-top: 1px solid var(--line-soft); }
.detailrow__label { flex: 1; color: var(--dim); }
.detailrow__value {
  color: var(--ink); font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums; text-align: right;
}

/* ==================================================== EXERCISE LIST ==== */

.exlist { list-style: none; margin: 0; padding: 0; }
/* In a card since v273, like Your details: rows a hairline apart. Clear of
   the stats strip's rules above it (v275: the card sat on them). */
.exlist-card { margin-top: var(--sp-24); }
.exlist-card .exlist { margin-top: var(--sp-4); }
.exlist__item {
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-12) 0;
}
.exlist__item + .exlist__item { border-top: 1px solid var(--line-soft); }
.exlist__n {
  font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--faint);
  font-variant-numeric: tabular-nums; width: var(--sp-20); flex: none;
}
.exlist__body { flex: 1; min-width: 0; }
.exlist__name {
  font-size: var(--fs-body); font-weight: var(--fw-medium);
  overflow-wrap: break-word;
}
.exlist__meta { margin-top: var(--sp-2); font-size: var(--fs-meta); color: var(--faint); }
.exlist__sets {
  font-size: var(--fs-meta); font-weight: var(--fw-medium); color: var(--ink);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* ==================================================== MOVEMENT DIAG ==== */

/* Illustration frames are stacked and crossfaded. The artwork is monochrome
   `fill="currentColor"`, so `color` here drives it and the same file renders
   correctly in both themes. */

.movement {
  width: 100%; max-width: var(--fig-move); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  color: var(--ink);
}
.movement__stage { position: relative; width: 100%; aspect-ratio: 1; }
.movement__frame {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity var(--dur-base) var(--ease-in-out);
}
.movement__frame.is-active { opacity: 1; }
.movement__frame svg { width: 100%; height: 100%; display: block; }

.movement__phase {
  font-size: var(--fs-micro); font-weight: var(--fw-bold); color: var(--faint);
  text-transform: uppercase; letter-spacing: var(--tr-caps);
  min-height: 1em;
}

/* Loading. The stage is square and empty until the first SVG arrives, which
   reads as broken rather than pending — so it gets a surface of its own and a
   slow sweep. A keyframe is right here where it was wrong for the toasts:
   this is predetermined, looping, and runs off the main thread. */
.movement.is-loading .movement__stage,
.ex-card__thumb.is-pending,
.skel {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  overflow: hidden; position: relative;
}
.movement.is-loading .movement__stage::after,
.ex-card__thumb.is-pending::after,
.skel::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    transparent 20%, var(--shine, color-mix(in srgb, var(--ink) 6%, transparent)) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.4s var(--ease-in-out) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* The shapes a screen makes while it has nothing to put in them. Same sweep as
   a loading illustration, because it means the same thing and a second one
   would only be a second thing to keep in step.

   Sizes are in the spacing scale rather than guessed, so a skeleton line sits
   on the same rhythm as the text it stands in for. */
.skel { display: block; }
/* A stand-in for a line of text. Its height is set at the call site from the
   type token the real line uses, so the shape sits on the same rhythm as the
   words it replaces and follows the scale if that ever moves — a height fixed
   here would have been a fourth place to keep in step. */
.skel--line { border-radius: var(--r-full); }
.skel--face {
  width: var(--sp-40); height: var(--sp-40);
  border-radius: var(--r-full); flex: none;
}
/* The line that says why the shapes are empty. It is not decoration: a
   skeleton with nothing coming is a loading state that never ends. */
.skel-note {
  margin-top: var(--sp-16); text-align: center;
  font-size: var(--fs-meta); color: var(--dim);
}

@media (prefers-reduced-motion: reduce) {
  /* No sweep. The tinted surface alone still says "not empty, not broken". */
  .movement.is-loading .movement__stage::after,
  .ex-card__thumb.is-pending::after,
  .skel::after { animation: none; }
  /* No shake either. The red edge and the message above the box carry the
     whole meaning on their own; the movement was only ever the emphasis. */
  .field input.is-wrong { animation: none; }
}

/* Failure. Names what is missing and offers the way back, rather than leaving
   a grey square with no exit. */
.movement--missing {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-8); min-height: var(--sp-64);
  color: var(--faint); font-size: var(--fs-small); text-align: center;
}
.movement--missing .movement__stage { display: none; }
.movement__msg { margin: 0; max-width: 26ch; }

/* In a thumbnail there is no room to explain or to offer a retry — the card
   still opens to the sheet, which shows both. */
/* The mark, drawn in the icon idiom the rest of the app uses: 2px strokes,
   round caps, currentColor. An empty outlined square used to stand here, which
   read as a component that had failed rather than as artwork that never
   existed. */
.movement__glyph {
  width: var(--sp-32); height: var(--sp-32); flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  color: var(--dim); opacity: 0.7;
}

/* In a thumbnail there is no room for the sentence, and the card still opens to
   the sheet where it is spelled out. */
.ex-card__thumb .movement--missing .movement__msg,
.ex-card__thumb .movement--missing .btn { display: none; }
.ex-card__thumb .movement__glyph { width: var(--sp-24); height: var(--sp-24); }

/* Thumbnails: no crossfade, no label, just the mid-rep pose. */
.ex-card__thumb .movement { max-width: 100%; gap: 0; }
.ex-card__thumb .movement__frame { transition: none; }

/* Swap and remove, at the foot of the card. Wrapping rather than shrinking:
   "Remove from today" is four words, and squeezing it in beside Swap on a
   narrow phone clips it instead of moving it. */
.ex-card__acts {
  display: flex; flex-wrap: wrap; gap: var(--sp-8);
  margin-top: var(--sp-12);
}

/* ======================================================= REST TIMER ==== */

/* The `hidden` attribute only wins when nothing sets `display` more
   specifically — a bare `.resttimer { display: flex }` silently overrides the
   UA stylesheet and leaves the bar permanently on screen. */
.resttimer[hidden] { display: none; }

.resttimer {
  position: fixed; left: var(--sp-12); right: var(--sp-12);
  bottom: calc(var(--tabbar-clear) + var(--sp-12));
  z-index: 45;
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-8) var(--sp-12);
  background: var(--surface); border: 1px solid var(--accent-line);
  border-radius: var(--r-md); box-shadow: var(--shadow-float);
  /* Appears after every completed set, so roughly twenty times a session.
     Faster than the sheet on purpose: at that frequency the job is only to
     stop the bar from teleporting over the content mid-set. */
  transform: translateY(0); opacity: 1;
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              display var(--dur-exit) allow-discrete;
}
.resttimer[hidden] {
  opacity: 0; transform: translateY(var(--rise));
  transition-duration: var(--dur-exit);
}
@starting-style {
  .resttimer:not([hidden]) { opacity: 0; transform: translateY(var(--rise)); }
}

.resttimer__ring { position: relative; width: var(--sp-48); height: var(--sp-48); flex: none; }
.resttimer__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.resttimer__track    { fill: none; stroke: var(--line-strong); stroke-width: 4; }
.resttimer__progress {
  fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 0;
  /* 1s linear is the timer's own cadence, not a UI animation — it must
     match the once-per-second tick exactly, so it is not tokenised. */
  transition: stroke-dashoffset 1s linear;
}
.resttimer__count {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: var(--fs-small); font-weight: var(--fw-bold);
}
/* The bar floats over the content, so its height has to be predictable. The
   lift name gets one line, the reason two; both are advisory, and the full
   text is a tap away on the Rest evidence tag. */
.resttimer__body { flex: 1; min-width: 0; }
.resttimer__body strong {
  display: block; font-size: var(--fs-meta);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.resttimer__why {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-small); color: var(--faint);
}
/* Full tap target: these are pressed mid-set, one-handed, with chalk on your
   fingers. --sp-40 left them at 40px, under the floor this system declares. */
.resttimer__add, .resttimer__skip {
  min-height: var(--tap-min); padding: 0 var(--sp-12); flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: var(--fs-small);
  font-weight: var(--fw-medium); cursor: pointer;
}
.resttimer.is-done { border-color: var(--accent); background: var(--accent-soft); }

/* =========================================================== SHEET ==== */

/* The sheet arrives from the bottom edge and leaves through it — the same path
   both ways, which is what makes a swipe-down feel like the obvious way to
   close it even before anyone tries.

   Transitions rather than keyframes: a sheet can be reopened before it has
   finished closing, and a transition retargets from wherever it is while a
   keyframe would restart from the bottom of the screen.

   `allow-discrete` on `display` is what lets the exit play at all, since the
   panel is hidden with the `hidden` attribute. Where it is unsupported the
   sheet simply appears and disappears instantly, which is exactly how it
   behaved before — so the fallback costs nothing. */
.sheet {
  position: fixed; inset: 0; z-index: 100;
  transition: display var(--dur-exit) allow-discrete;
}
.sheet[hidden] { display: none; }

.sheet__scrim {
  position: absolute; inset: 0; background: var(--scrim);
  opacity: 1;
  transition: opacity var(--dur-sheet) var(--ease-out);
}
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-sheet);
  padding-bottom: var(--safe-bottom);
  transform: translateY(0); opacity: 1;
  /* The iOS drawer curve: almost all of the travel happens up front, so the
     panel is legible long before it has finished settling. */
  transition: transform var(--dur-sheet) var(--ease-drawer),
              opacity var(--dur-sheet) var(--ease-out);
}

/* Closed state, and the state it enters from. Exits run shorter than entrances
   — the user has already decided by then. */
.sheet[hidden] .sheet__scrim { opacity: 0; transition-duration: var(--dur-exit); }
.sheet[hidden] .sheet__panel {
  transform: translateY(var(--sheet-out)); opacity: var(--sheet-fade);
  transition-duration: var(--dur-exit);
}
@starting-style {
  .sheet:not([hidden]) .sheet__scrim { opacity: 0; }
  .sheet:not([hidden]) .sheet__panel {
    transform: translateY(var(--sheet-out)); opacity: var(--sheet-fade);
  }
}
.sheet__grab {
  height: var(--sp-24); display: grid; place-items: center; flex: none; cursor: grab;
  /* The browser must not claim the vertical gesture for scrolling, or the drag
     never receives the pointermove events it is made of. */
  touch-action: none;
}
.sheet__grab:active { cursor: grabbing; }
/* The header drags too — it is the other part of the sheet that never scrolls,
   and reaching for a 24px bar is a poor target on a phone. Its buttons opt out
   in the handler rather than here, so the close control keeps working. */
.sheet__head { touch-action: none; }
/* Scaling toward the bottom edge reads as the panel receding into the screen it
   came from, rather than shrinking away from a point in the middle of itself. */
.sheet__panel { transform-origin: center bottom; }

/* The panel is pinned to the bottom edge, so any upward travel lifts its
   bottom off the screen and the app shows through the gap underneath. Every
   sheet has always allowed that travel -- the resisted tug when you pull the
   wrong way -- so the seam was always possible; the swipe-up gesture on the
   update notice just made it happen on purpose, every time.

   This continues the panel's own surface past the bottom edge, so a lift
   reveals more sheet instead of a seam. It is a child of the panel, so it
   travels with it and needs no transform of its own, and it is out of flow,
   so it changes no layout and no scroll height.

   No z-index: it sits entirely below the panel and overlaps none of its
   content, so paint order never comes up. 60vh is far past anything a drag
   reaches -- the whole of it is off-screen at rest, and one painted
   rectangle that nobody sees costs nothing. */
.sheet__panel::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%;
  height: 60vh; background: var(--surface);
}
.sheet__grab::before {
  content: ''; width: var(--sp-40); height: var(--sp-4);
  border-radius: var(--r-full); background: var(--line-strong);
}
/* No space-between any more: with the close button gone the title is the only
   child, and space-between on a single item is just flex-start wearing a hat. */
.sheet__head {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--sp-4);
  padding: 0 var(--sp-20) var(--sp-12); flex: none;
}
/* Above the title, where a back control belongs and where the eye lands first.
   It is a link in everything but markup, so it looks like one rather than
   competing with the amber buttons inside the sheet. */
.sheet__back {
  background: none; border: 0; padding: var(--sp-2) 0; margin: 0;
  font: inherit; font-size: var(--fs-meta); color: var(--accent);
  cursor: pointer; text-align: left;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet__back:active { opacity: 0.6; }
.sheet__head h2 {
  font-size: var(--fs-lead); letter-spacing: var(--tr-lead);
  min-width: 0; overflow-wrap: break-word;
}
/* The panel takes focus when the sheet opens. It is a container, not a control,
   so the ring would be a large rectangle around the whole dialog announcing
   nothing — the title beside it already says where you are. */
.sheet__panel:focus { outline: none; }
.sheet__body { padding: 0 var(--sp-20) var(--sp-24); overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ===================================================== SIDEWAYS ====

   An iPhone cannot be stopped from turning by a web app. The manifest asks
   for portrait and js/app.js asks again at runtime through the Screen
   Orientation API; Android honours both, and iOS honours neither -- it has
   never shipped that API and ignores the manifest member. Only the device's
   own rotation lock, in Control Centre, actually holds a phone upright, and
   that is the owner's setting for every app rather than ours for one.

   So this is the other half of the answer: the phone still turns, and the app
   declines to be read that way.

   Gated on height as well as orientation, because "wider than tall" describes
   every desktop window ever opened. A phone on its side is short -- the
   tallest iPhone is 430px that way -- so 500px tells a turned phone from a
   laptop without naming a single device. An iPad in landscape is far taller
   than that and is left alone, which is right: there is room to read it
   sideways on one.

   Not orientation itself (v306). The on-screen keyboard shortens the page,
   and an upright phone typing a friend code came out wider than tall and was
   told to turn upright. A keyboard takes height and leaves width alone; a turn
   makes the page wide and flat. So: at least 560px wide (no phone is that
   wide upright; the smallest turned iPhone is 568) and at least 3:2 (a turned
   phone is 16:9 or flatter; an unfolded foldable with its keyboard up is
   about 7:5).

   Nothing underneath is torn down. The app is still there, still holding
   whatever was on screen; turning back reveals it exactly as it was.
   ==================================================================== */
.rotate { display: none; }

@media (min-aspect-ratio: 3/2) and (min-width: 560px) and (max-height: 500px) {
  .rotate {
    position: fixed; inset: 0;
    /* Above everything, including the splash at 300: opening the app sideways
       should say this rather than play an intro nobody can read. */
    z-index: 400;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--sp-8); padding: var(--gutter);
    background: var(--bg); color: var(--ink); text-align: center;
  }
  .rotate__title {
    font-size: var(--fs-lead); font-weight: var(--fw-bold);
    letter-spacing: var(--tr-title);
  }
  .rotate__sub { font-size: var(--fs-body); color: var(--dim); max-width: 34ch; }
}

/* =========================================================== TOAST ==== */

/* Rises from the bottom and sinks back the same way. Toasts stack up quickly
   when several saves land together, so this is a transition, not a keyframe:
   a second toast retargets from wherever the first one is instead of snapping
   back to the start. */
.toast {
  position: fixed; left: 50%;
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              display var(--dur-exit) allow-discrete;
  bottom: calc(var(--tabbar-clear) + var(--sp-20));
  z-index: 200; max-width: calc(100% - var(--sp-32));
  /* Not --r-full: a message that wraps to two lines turns a pill into a
     bubble. A large-but-finite radius reads right at any line count. */
  padding: var(--sp-12) var(--sp-20); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
  font-size: var(--fs-meta); font-weight: var(--fw-medium); text-align: center;
}
.toast[hidden] {
  display: none;
  opacity: 0; transform: translateX(-50%) translateY(var(--rise));
  transition-duration: var(--dur-exit);
}
@starting-style {
  .toast:not([hidden]) {
    opacity: 0; transform: translateX(-50%) translateY(var(--rise));
  }
}
.toast--error { border-color: var(--danger); color: var(--danger); }
.toast--ok    { border-color: var(--accent-line); }

/* ======================================================== CALENDAR ==== */

.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-12);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--sp-4); }
.cal-dow {
  text-align: center; font-size: var(--fs-micro); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--tr-caps);
  color: var(--faint); padding-bottom: var(--sp-4);
}
.cal-day {
  aspect-ratio: 1; border-radius: var(--r-sm);
  border: 1px solid transparent; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-2); cursor: pointer; padding: 0; position: relative;
  color: var(--ink);
}
.cal-day__num { font-size: var(--fs-small); font-weight: var(--fw-medium); }
.cal-day__dot { width: var(--sp-4); height: var(--sp-4); border-radius: 50%; background: transparent; }
.cal-day.is-empty { visibility: hidden; }
.cal-day.is-today { border-color: var(--accent); }
/* Green, not amber. The home strip has always marked a trained day with a
   green tick, and the calendar marking the same fact in amber meant the two
   screens disagreed about the colour of "done". Amber is left to say *today*,
   which is what the border on this grid already uses it for — so a day that is
   both gets an amber edge round a green fill and still reads as both. */
/* Three states, three tinted squares, each with its dot in the full colour:
   done, missed and scheduled. The tint is what you see from across the month
   and the dot is what tells you which it is up close.

   Green, not amber, for done. The home strip has always marked a trained day
   with a green tick, and the calendar marking the same fact in amber meant the
   two screens disagreed about the colour of "done". Amber is left to say
   *today*, which is what the border on this grid uses it for — so a day that
   is both gets an amber edge round a green fill and still reads as both. */
.cal-day.is-done  { background: var(--success-soft); }
.cal-day.is-done  .cal-day__dot { background: var(--success); }
.cal-day.is-missed { background: var(--danger-soft); }
.cal-day.is-missed .cal-day__dot { background: var(--danger); }
.cal-day.is-planned { background: var(--info-soft); }
.cal-day.is-planned .cal-day__dot { background: var(--info); }
/* Rest carries nothing at all — no tint, no dot. With the three above filled
   in, an unmarked day is the signal, and it was the wrong way round before:
   rest was the one square on the grid you could see while the days that
   actually needed marking had only a dot. */
.cal-day.is-rest  .cal-day__num { color: var(--faint); }
/* Before the programme started: shown, but visibly not part of the plan. */
.cal-day.is-before { opacity: 0.35; }
.cal-day.is-before .cal-day__num { color: var(--faint); }

/* Four items never fit one row at 375px, and free-wrapping orphans the last
   one. A grid wraps to a tidy 2x2 on a phone and opens to four across when
   there is room. */
.legend-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--sp-8) var(--sp-12); margin-top: var(--sp-16);
  font-size: var(--fs-micro); letter-spacing: var(--tr-caps);
  text-transform: uppercase; color: var(--faint);
}
.legend-row span { display: inline-flex; align-items: center; gap: var(--sp-6); }
.legend-row i { width: var(--sp-6); height: var(--sp-6); border-radius: 50%; display: block; }
/* Hollow, for a state whose mark is the absence of one. A filled swatch beside
   "Rest" pointed at a square that no longer exists — and before that, at a
   square while the day itself carried no dot at all. */
.legend-row i.is-hollow {
  background: none; box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

/* ======================================================== PROGRESS ==== */

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); margin-bottom: var(--sp-12); }
.stat {
  background: var(--surface); box-shadow: var(--ring);
  border-radius: var(--r-md); padding: var(--sp-16);
}
.stat__value {
  font-size: var(--fs-figure); font-weight: var(--fw-bold); line-height: var(--lh-tight);
  letter-spacing: var(--tr-lead); font-variant-numeric: tabular-nums;
}
.stat .evidence { margin-top: var(--sp-8); }
.stat__label {
  font-size: var(--fs-micro); letter-spacing: var(--tr-caps); text-transform: uppercase;
  color: var(--faint); margin-top: var(--sp-4);
}

/* Sets per week on Progress (v271): eight bars, the last 7 days in the accent.
   A bar never drops below a stub, so an empty week still reads as a week. */
.weekbars {
  display: flex; align-items: flex-end; gap: var(--sp-8);
  height: calc(var(--sp-64) + var(--sp-48)); margin-top: var(--sp-16);
}
.weekbars__col {
  flex: 1; height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; gap: var(--sp-4);
}
.weekbars__n   { font-size: var(--fs-micro); color: var(--faint); font-variant-numeric: tabular-nums; }
.weekbars__bar { width: 100%; min-height: var(--sp-4); border-radius: var(--r-full); background: var(--surface-2); }
.weekbars__col.is-now .weekbars__bar { background: var(--accent-fill); }
.weekbars__col.is-now .weekbars__n   { color: var(--accent); }
.weekbars__axis {
  display: flex; justify-content: space-between; margin-top: var(--sp-8);
  font-size: var(--fs-micro); letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--faint);
}
/* The estimated 1RM beside a lift's name; up is green, the colour of done. */
.rm          { text-align: right; font-variant-numeric: tabular-nums; }
.rm__value   { font-weight: var(--fw-bold); }
.rm__change  { font-size: var(--fs-small); color: var(--dim); }
.rm__change.is-up { color: var(--success); }

.vol-row {
  display: grid; grid-template-columns: 1fr var(--sp-48); gap: var(--sp-12);
  align-items: center; padding: var(--sp-8) 0;
  border-bottom: 1px solid var(--line);
}
.vol-row:last-child { border-bottom: 0; }
.vol-row__name { font-size: var(--fs-meta); font-weight: var(--fw-medium); }
.vol-row__note { font-size: var(--fs-small); color: var(--faint); margin-top: var(--sp-2); }
.vol-row__bar {
  height: var(--sp-4); border-radius: var(--r-full); background: var(--surface-2);
  margin-top: var(--sp-6); overflow: hidden;
}
.vol-row__fill { height: 100%; border-radius: var(--r-full); }
.vol-row__sets {
  font-size: var(--fs-title); font-weight: var(--fw-bold); text-align: right;
  font-variant-numeric: tabular-nums;
}

.fill--none     { background: var(--vol-none); }
.fill--low      { background: var(--vol-low); }
.fill--building { background: var(--vol-building); }
.fill--good     { background: var(--vol-good); }
.fill--high     { background: var(--vol-high); }

.sparkline { width: 100%; height: auto; }
.sparkline__line  { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sparkline__fill  { fill: var(--accent-soft); stroke: none; }
.sparkline__dot   { fill: var(--accent); }
.sparkline__empty { fill: var(--faint); font-size: var(--fs-tiny); font-family: var(--font); }

/* ======================================================= NUTRITION ==== */

.kcal { display: flex; align-items: baseline; gap: var(--sp-8); margin-top: var(--sp-6); }
.kcal__value {
  font-size: var(--fs-display); font-weight: var(--fw-display);
  line-height: var(--lh-display); letter-spacing: var(--tr-display);
  font-variant-numeric: tabular-nums;
}
.kcal__unit { color: var(--dim); font-size: var(--fs-meta); }

/* ---- body mass index ----------------------------------------------------
   The one place in the app where the semantic colours carry a scale rather
   than a state. They are allowed to here because the scale *is* the meaning:
   the bands are WHO's four, and the colour is what says which one you are in
   without reading. Amber stays out of it — this is not a control, and an
   accent on it would read as something to press.

   The number takes the band's colour and the band's name is spelled out under
   it, so the colour is never the only thing saying which band it is. */
.bmi__value {
  margin-top: var(--sp-12);
  text-align: center;
  font-size: var(--fs-display); font-weight: var(--fw-display);
  line-height: var(--lh-display); letter-spacing: var(--tr-display);
  font-variant-numeric: tabular-nums;
}
.bmi__value--info    { color: var(--info); }
.bmi__value--success { color: var(--success); }
.bmi__value--warn    { color: var(--warn); }
.bmi__value--danger  { color: var(--danger); }
.bmi__band {
  text-align: center; color: var(--dim);
  font-size: var(--fs-meta); margin-top: var(--sp-2);
}

/* The scale, 15 to 40, as one blended bar. The gradient itself is written in
   app.js from the same landmarks the rows are built from, so the colour cannot
   drift away from the numbers it is colouring; all this rule owns is the shape.

   Drawn to the numbers rather than in four equal blocks: the healthy band
   really is that narrow next to the one above it, and that is worth seeing. */
.bmibar {
  position: relative;
  height: var(--sp-8); margin-top: var(--sp-20);
  border-radius: var(--r-full);
}
/* A triangle pointing down at the spot, drawn with borders so it needs no
   file and no second element. Translated by half its own width so that it
   points at the value rather than starting there. */
.bmibar__mark {
  position: absolute; top: calc(var(--sp-8) * -1);
  width: 0; height: 0; transform: translateX(-50%);
  border-left: var(--sp-6) solid transparent;
  border-right: var(--sp-6) solid transparent;
  border-top: var(--sp-6) solid var(--ink);
}

.bmirows { margin-top: var(--sp-16); }
.bmirow {
  display: flex; align-items: center; gap: var(--sp-8);
  padding: var(--sp-6) var(--sp-8);
  border-radius: var(--r-sm);
  font-size: var(--fs-meta); color: var(--dim);
}
/* The row you are in, lifted by a surface rather than by a colour: the dot is
   already carrying the colour, and a second one would leave the row competing
   with the number above it. */
.bmirow.is-on { background: var(--surface-2); color: var(--ink); }
.bmirow__dot {
  flex: none; width: var(--sp-8); height: var(--sp-8);
  border-radius: var(--r-full);
}
.bmirow__dot--info    { background: var(--info); }
.bmirow__dot--success { background: var(--success); }
.bmirow__dot--warn    { background: var(--warn); }
.bmirow__dot--danger  { background: var(--danger); }
.bmirow__name  { flex: 1; }
.bmirow__range { color: var(--faint); font-variant-numeric: tabular-nums; }

.macro { margin-bottom: var(--sp-16); }
.macro:last-of-type { margin-bottom: var(--sp-8); }
.macro__head { display: flex; align-items: baseline; gap: var(--sp-8); margin-bottom: var(--sp-6); }
.macro__name  { font-weight: var(--fw-medium); font-size: var(--fs-meta); flex: 1; }
.macro__grams { font-weight: var(--fw-bold); font-size: var(--fs-title); font-variant-numeric: tabular-nums; }
.macro__perkg { font-weight: var(--fw-regular); font-size: var(--fs-small); color: var(--dim); }
.macro__pct   {
  color: var(--faint); font-size: var(--fs-small); min-width: var(--sp-32);
  text-align: right; font-variant-numeric: tabular-nums;
}
.macro__bar   { height: var(--sp-6); border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.macro__fill  { height: 100%; border-radius: var(--r-full); }
.macro__fill--protein { background: var(--macro-protein); }
.macro__fill--carbs   { background: var(--macro-carbs); }
.macro__fill--fat     { background: var(--macro-fat); }

/* =========================================================== FORMS ==== */

.field { margin-bottom: var(--sp-16); }
.field label {
  display: block; font-size: var(--fs-micro); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--tr-caps);
  color: var(--faint); margin-bottom: var(--sp-6);
}
/* Listed by type rather than as a bare `input` so checkboxes and radios keep
   their native size. Every type the app actually uses has to be here: email
   and password arrived with the sign-in screen and were full-width nowhere
   until they were added. */
.field input[type="text"], .field input[type="number"], .field input[type="date"],
.field input[type="email"], .field input[type="password"], .field input[type="search"],
.field select, .field textarea {
  width: 100%; min-height: var(--tap-min); padding: var(--sp-8) var(--sp-12);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font: inherit; font-size: var(--fs-title);
}
.field textarea { min-height: var(--sp-64); resize: vertical; font-size: var(--fs-body); font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--info); outline-offset: -1px;
}
.field__hint { font-size: var(--fs-small); color: var(--faint); margin-top: var(--sp-4); }

/* A masked box with an eye inside its right edge (v304), the invite code's.
   The button is the box's full height and a tap target's width. */
.reveal { position: relative; }
.reveal input { padding-right: var(--tap-min); }
.reveal__btn {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--tap-min);
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; color: var(--faint); cursor: pointer;
}
.reveal__btn:focus-visible { outline: 2px solid var(--info); outline-offset: -4px; border-radius: var(--r-sm); }
.reveal__ico {
  width: 1.25rem; height: 1.25rem;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* A password being chosen has rules, and the box says so the moment one is
   broken: the reason above it, a red edge, and one shake. The shake is what
   carries when the eye is on the keyboard rather than on the message, and it
   is short enough not to delay the next keystroke. */
.field__warn {
  font-size: var(--fs-small); color: var(--danger); margin-bottom: var(--sp-6);
}
.field__warn[hidden] { display: none; }
.field input.is-wrong {
  border-color: var(--danger);
  animation: shake 220ms var(--ease-out);
}
/* Wrong and focused at once. The complaint is a border and the focus ring is
   an outline, so without this the blue ring sits straight over the red edge
   and the one box being complained about is the one that looks fine.

   Only the colour and the width are taken: style and offset stay with the
   focus rule above, so the two rings sit in exactly the same place and a
   pixel of extra weight is the whole difference. It is still visibly the
   focused box — it is just not pretending to be a well one. */
.field input.is-wrong:focus {
  outline-color: var(--danger);
  outline-width: 3px;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(2px); }
}

/* The visible pill stays 40px so a wrapping row of filters keeps its rhythm;
   the tap target is extended to the 44px floor with a pseudo-element, which is
   exactly what --tap-min in tokens.css prescribes for this case. */
.chip::after {
  content: ''; position: absolute; left: 0; right: 0;
  top: 50%; transform: translateY(-50%); height: var(--tap-min);
}
.chip {
  position: relative;
  min-height: var(--sp-40); padding: 0 var(--sp-16); border-radius: var(--r-full);
  border: 1px solid var(--line-strong); background: var(--surface-2);
  font-size: var(--fs-meta); font-weight: var(--fw-medium); cursor: pointer;
  display: inline-flex; align-items: center; color: var(--ink);
}
.chip.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
/* The middle state of the three-way muscle chip: assisting rather than main.
   The border carries it and the fill does not, so "main" stays the only chip
   on the screen with a filled accent — the same distinction the body map makes
   between a worked muscle and one that only helps. */
.chip.is-soft {
  background: var(--surface-2); border-color: var(--accent-line); color: var(--accent);
}
/* How many exercises an option in the filter sheet leads to, and how many
   filters are on. Quieter than the label it counts, and a figure rather than a
   word so a row of them lines up. */
.chip__count {
  margin-left: var(--sp-6);
  font-variant-numeric: tabular-nums; color: var(--faint);
}
.chip.is-on .chip__count { color: inherit; opacity: 0.75; }
/* The way off, on a filter that is on. */
.chip__x { margin-left: var(--sp-6); font-size: 1.1em; line-height: 1; opacity: 0.75; }

/* ============================================================ MISC ==== */

.cue-list { margin: 0; padding-left: var(--sp-20); }
.cue-list li { margin-bottom: var(--sp-6); font-size: var(--fs-meta); color: var(--dim); }
.cue-list li::marker { color: var(--faint); }
.cue-list--warn li::marker { color: var(--warn); }

.empty { text-align: center; padding: var(--sp-48) var(--sp-20); color: var(--dim); }
/* Drawn, not typed. Sized to read as an illustration rather than a control,
   and tinted from the palette so it recedes behind the message. */
.empty__icon {
  width: var(--sp-40); height: var(--sp-40);
  margin: 0 auto var(--sp-16); display: block;
  fill: var(--line-strong);
}
.empty__title { font-weight: var(--fw-bold); font-size: var(--fs-title); color: var(--ink); margin-bottom: var(--sp-6); }
.empty p { font-size: var(--fs-meta); }

/* Severity is carried by one tone token, which tints the block and colours
   the title. There is deliberately no accent stripe down the left edge: the
   tint already says which kind of callout this is, and a coloured border
   saying it a second time is the same duplication the Nutrition header had.
   The title is the stronger cue anyway — a 13% tint is easy to miss, a
   coloured heading is not. */
.callout {
  --callout-tone: var(--info);
  padding: var(--sp-12) var(--sp-16); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--callout-tone) 13%, transparent);
  font-size: var(--fs-meta); margin-bottom: var(--sp-12);
}
.callout--warn   { --callout-tone: var(--warn); }
.callout--danger { --callout-tone: var(--danger); }
.callout--ok     { --callout-tone: var(--accent); }
.callout strong {
  display: block; margin-bottom: var(--sp-2);
  color: var(--callout-tone); font-weight: var(--fw-bold);
}

.divider { height: 1px; background: var(--line); margin: var(--sp-20) 0; border: 0; }

.searchbar {
  width: 100%; min-height: var(--tap-min); padding: var(--sp-8) var(--sp-16);
  margin-bottom: var(--sp-12);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-full);
  font: inherit; font-size: var(--fs-title);
}
.searchbar:focus { outline: 2px solid var(--info); outline-offset: -1px; }

.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-list li {
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-12) 0; border-bottom: 1px solid var(--line);
}
.sub-list li:last-child { border-bottom: 0; }
.sub-list__name { font-weight: var(--fw-medium); font-size: var(--fs-meta); overflow-wrap: break-word; }
.sub-list__why  { font-size: var(--fs-small); color: var(--faint); margin-top: var(--sp-2); }
.sub-list__body { flex: 1; min-width: 0; }

/* What changed, in the update window. A marker rather than a bare paragraph:
   these are read as a list of separate things, and without one the lines run
   together into a wall the moment two of them wrap. The marker is the accent
   because it is the only thing on this sheet that is not text, and it is
   absolutely positioned so a wrapped second line lines up under the first
   word rather than under the dot. */
.newslist { list-style: none; margin: 0; padding: 0; }
.newslist li {
  position: relative; padding: var(--sp-8) 0 var(--sp-8) var(--sp-20);
  font-size: var(--fs-meta); color: var(--ink);
}
.newslist li + li { border-top: 1px solid var(--line-soft); }
.newslist li::before {
  content: ''; position: absolute; left: var(--sp-6);
  /* Matched to the first line's optical centre, not the box's: the padding
     above is smaller than the line box, so centring on the box sits low. */
  top: calc(var(--sp-8) + 0.55em);
  width: var(--sp-6); height: var(--sp-6);
  border-radius: var(--r-full); background: var(--accent);
}

/* Reduced motion is handled in tokens.css by collapsing the duration tokens,
   which keeps the colour and opacity changes that carry meaning. A blanket
   `transition-duration: 0.01ms !important` here would override those tokens
   and make the setting mean "no feedback at all". */

/* ================================================ PROGRAMME EDITOR ==== */

/* One exercise inside a day. The name and the remove button sit on the top
   line and the three numbers that define the set go underneath, because at
   375px a single row of name plus sets plus reps plus rest leaves the name
   about four characters wide. */
.prog-ex { padding: var(--sp-12) 0; border-bottom: 1px solid var(--line-soft); }
.prog-ex:last-of-type { border-bottom: 0; }
.prog-ex__head { display: flex; align-items: flex-start; gap: var(--sp-8); }
/* The name is the button that opens the numbers (S3, v282). */
.prog-ex__info {
  flex: 1; min-width: 0; text-align: left; cursor: pointer;
  background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit;
}
.prog-ex__info .sub-list__name { display: flex; align-items: center; gap: var(--sp-4); }
.prog-ex__chev {
  width: var(--sp-16); height: var(--sp-16); flex: none;
  fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur-base) var(--ease-out);
}
.prog-ex.is-open .prog-ex__chev { transform: rotate(90deg); }
.prog-ex__nums { margin-top: var(--sp-8); }
.prog-ex__nums[hidden] { display: none; }

/* One number to a line: its name on the left, − value + on the right. */
.prog-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-12); min-height: var(--sp-48);
}
.prog-line + .prog-line { border-top: 1px solid var(--line-soft); }
.prog-line__label { color: var(--dim); font-size: var(--fs-meta); }
.prog-line__ctl { display: flex; align-items: center; gap: var(--sp-4); }
.prog-line__dash { color: var(--faint); font-size: var(--fs-small); padding: 0 var(--sp-4); }

.stepper { display: flex; align-items: center; gap: var(--sp-2); }
/* 32px round, with the 44px target made up by ::after. */
.stepper__btn {
  position: relative; flex: none;
  width: var(--sp-32); height: var(--sp-32); padding: 0;
  display: grid; place-items: center; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--ink); font: inherit; font-size: var(--fs-body); cursor: pointer;
}
.stepper__btn::after { content: ''; position: absolute; inset: -6px; }
.stepper input, .stepper__value {
  width: var(--sp-48); padding: var(--sp-6) 0; text-align: center;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--ink); font: inherit; font-size: var(--fs-body); font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}
.stepper input:focus { outline: 2px solid var(--info); outline-offset: -1px; }
.stepper input::placeholder, .stepper__value.is-inherited { color: var(--faint); }

/* Reorder controls. Square and glyph-only, so two of them plus a remove button
   plus the exercise name still fit on one line at 375px. 40px tall matches
   .btn--sm, the tap target this app already uses for dense list controls.
   Disabled at the ends of the list rather than hidden: a control that vanishes
   makes the row jump, and there is nowhere for the eye to go back to. */
.prog-move { display: flex; gap: var(--sp-4); flex: 0 0 auto; }
.prog-move .btn { min-width: var(--sp-40); padding: 0; }

/* Moving the whole plan. The buttons sit beside a live readout of where today
   lands, because "shift by one day" is ambiguous until you see the result. */
/* One row per day: tap the name to open it, use the arrows to reorder without
   opening anything. Reordering used to mean scrolling past every expanded day
   in between, which is why the arrows sit out here rather than inside. */
.daylist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-8); }
.daylist__row {
  display: flex; align-items: center; gap: var(--sp-8);
  /* A grid item defaults to min-width:auto, so this row refused to shrink below
     the intrinsic width of the day name and pushed its own chevron off the
     screen. Zero here lets the name ellipsis do its job. */
  min-width: 0;
  background: var(--surface-2); border-radius: var(--r-md);
  box-shadow: var(--ring); padding: var(--sp-12) var(--sp-16);
}
.daylist__hit {
  flex: 1; min-width: 0; text-align: left;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
}
.daylist__hit:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.daylist__hit:active { opacity: 0.6; }
.daylist__name {
  font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.daylist__meta { margin-top: var(--sp-2); font-size: var(--fs-meta); color: var(--dim); }
/* The arrows are a secondary control on a row whose primary action is opening
   it, so they stay narrow and out of the way of the name. */
.daylist__move { flex: none; }
.daylist__chev {
  flex: none; width: var(--sp-16); height: var(--sp-16);
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; color: var(--dim);
}

.prog-shift { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; }
.prog-shift__now {
  flex: 1; min-width: 12ch;
  font-size: var(--fs-small); color: var(--dim);
}

/* ========================================================== ACCOUNT ==== */

/* The sign-in screen. Its own layer rather than a seventh tab: there is no
   navigating away from it, and the tab bar underneath would offer five places
   to go that all refuse to open. */
.auth {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); color: var(--ink);
  overflow-y: auto;
  padding: var(--sp-40) var(--gutter) var(--sp-48);
  display: flex; flex-direction: column; justify-content: center;
}
/* The `hidden` attribute sets display:none through a user-agent rule, which any
   author `display` beats — so a flex layer stays on screen while the DOM
   insists it is hidden. `.view[hidden]` above exists for the same reason. */
.auth[hidden] { display: none; }
.auth__inner { width: 100%; max-width: 26rem; margin: 0 auto; }
.auth__mark {
  font-size: var(--fs-micro); text-transform: uppercase;
  letter-spacing: var(--tr-caps); color: var(--accent);
  font-weight: var(--fw-bold); margin-bottom: var(--sp-6);
}
.auth__title {
  font-size: var(--fs-display); letter-spacing: var(--tr-display);
  font-weight: var(--fw-bold); line-height: 1.02;
  /* Same descender guard as .screen-head__title: g, p and y are all in play. */
  padding-bottom: 0.22em; margin: 0 0 var(--sp-8) 0;
}
.auth__sub { color: var(--dim); font-size: var(--fs-meta); margin: 0 0 var(--sp-32); }
.auth__switch {
  display: flex; gap: var(--sp-6); margin-bottom: var(--sp-24);
}
.auth__switch .btn { flex: 1; }
.auth__quiet {
  display: block; width: 100%; margin-top: var(--sp-20);
  background: none; border: 0; padding: var(--sp-8);
  color: var(--faint); font: inherit; font-size: var(--fs-small);
  text-decoration: underline; cursor: pointer;
}
.auth__quiet:hover { color: var(--dim); }

/* ==================================================== WELCOME PAGE ==== */

/* Built on the gate's own shell, one layer above it: this replaces the whole
   app, sign-in screen included, because there is no point signing in to a
   browser tab you are about to be told to stop using.

   Not centred the way .auth is. This page is read top to bottom and is longer
   than a phone screen -- who invited you, then the form, then three steps --
   so it starts at the top and scrolls, and centring would put the beginning
   somewhere below the fold on a short screen. */
.welcome {
  position: fixed; inset: 0; z-index: 210;
  background: var(--bg); color: var(--ink);
  overflow-y: auto;
  padding: var(--sp-40) var(--gutter) var(--sp-48);
}
.welcome[hidden] { display: none; }

.welcome__head { margin-bottom: var(--sp-16); }
.welcome__avatar { margin-bottom: var(--sp-16); }
.welcome__kicker {
  color: var(--accent); font-size: var(--fs-small);
  font-weight: var(--fw-bold); letter-spacing: var(--tr-caps);
  text-transform: uppercase; margin-bottom: var(--sp-4);
}
.welcome__head h1 { font-size: var(--fs-display); line-height: 1.1; }
.welcome__lead {
  color: var(--dim); margin-bottom: var(--sp-24); line-height: 1.5;
}

/* The three steps. Numbered by the list itself rather than by text in each
   line, because these are followed in order on a device the reader is holding
   and losing your place is the whole failure mode. */
.steps { list-style: none; margin: var(--sp-8) 0 0; padding: 0; counter-reset: step; }
.steps li {
  position: relative; counter-increment: step;
  padding: 0 0 var(--sp-20) var(--sp-40);
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: var(--sp-24); height: var(--sp-24);
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-small); font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}
/* The rule joining one step to the next, so the column reads as a sequence
   rather than three unrelated notes. It stops at the last one, which has
   nothing to lead to. */
.steps li:not(:last-child)::after {
  content: ''; position: absolute;
  left: calc(var(--sp-12) - 0.5px); top: var(--sp-24); bottom: var(--sp-8);
  width: 1px; background: var(--line);
}
.steps strong { display: block; margin-bottom: var(--sp-2); }
.steps span { color: var(--dim); font-size: var(--fs-small); line-height: 1.45; }

/* The word between the form and the provider button, with a rule running out
   of it either way. The rules are the flex children that grow, so the word
   stays centred whatever the screen is. */
.auth__or {
  display: flex; align-items: center; gap: var(--sp-12);
  margin: var(--sp-16) 0;
  color: var(--faint); font-size: var(--fs-tiny); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--tr-caps);
}
.auth__or::before, .auth__or::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* One row per account or programme: a name, a note, and the controls. */
.pick { display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-12) 0;
        border-bottom: 1px solid var(--line-soft); }
.pick:last-child { border-bottom: 0; }
.pick__info { flex: 1; min-width: 0; }
.pick__name { font-weight: var(--fw-medium); font-size: var(--fs-meta); overflow-wrap: break-word; }
.pick__note { font-size: var(--fs-small); color: var(--faint); overflow-wrap: break-word; }
.pick__tag {
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--tr-caps);
  color: var(--accent); font-weight: var(--fw-bold);
}

/* Sync state, shown as a word rather than a spinner: it is almost always
   "just now" and a moving part would draw the eye to nothing. */
.syncline { display: flex; align-items: baseline; gap: var(--sp-8); flex-wrap: wrap; }
.syncline__state { font-size: var(--fs-meta); color: var(--dim); flex: 1; min-width: 10ch; }
.syncline__state--warn { color: var(--warn, var(--accent)); }

/* The recovery code, shown once. Monospaced and large enough to copy onto
   paper without squinting, because that is exactly what it is for. */
.code {
  font-family: var(--mono);
  font-size: var(--fs-lead);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  padding: var(--sp-16) var(--sp-12);
  margin: var(--sp-8) 0;
  overflow-wrap: anywhere;
}

/* ======================================================== INTRO ==== */

/* The splash sits above everything and is in the markup, not built by script,
   so the very first paint is already the right colour and nobody sees the app
   assemble itself behind it. js/intro.js draws into the svg and takes the
   whole thing off the screen when it is done.

   Above .auth and .toast, which both sit at 200. At 200 itself it lost to
   them on document order alone — the sign-in screen comes later in the markup
   — so anyone not signed in saw the login page instead of the intro. */
.intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  opacity: 1;
  /* A large surface leaving, so --dur-sheet. Reduced motion already shortens
     that token to 120ms and keeps the fade, which is the house rule. */
  transition: opacity var(--dur-sheet) var(--ease-out);
}
.intro svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro.is-done { opacity: 0; pointer-events: none; }

/* The bar under the wordmark. js/intro.js puts it at the logo's foot — the
   offset depends on how big the logo came out on this screen — and drives the
   fill; everything here is what it looks like, not when. */
.intro__bar {
  position: absolute;
  left: 50%;
  width: min(38vw, 168px);
  height: 3px;
  transform: translateX(-50%);
  border-radius: var(--r-full);
  background: var(--accent-soft);
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.intro__bar.is-in { opacity: 1; }
/* Scaled rather than resized: js/intro.js drives it frame by frame, and a
   transform is the one property that costs nothing to change every frame. */
.intro__bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-fill);
  transform: scaleX(0);
  transform-origin: left center;
}


/* ============================================================== HOME ==== */
/* The screen the app opens on. Everything here is a door to a screen that
   already existed; nothing here is where you end up. */

/* The avatar sits above the greeting rather than beside it, and closer to the
   top of the screen than anything else on it. The gear shares its line. */
/* The home screen only ever had 8 of its own, and with the top bar's 8 as well
   a fifth of its 75 is 15 — more than it has to give. It keeps two pixels so it
   is not flush against the safe area, and that is its floor: any higher is
   under the notch. */
.hello { padding: var(--sp-2) 0 var(--sp-20); }
.hello__top { display: flex; align-items: flex-start; justify-content: space-between; }
/* Pushed out past the gutter by the same 30% as the avatar on the other side,
   so the two sit symmetrically about the column rather than one of them
   hanging further out than the other. */
.hello__gear {
  margin-right: calc(-0.3 * var(--gutter));
  width: var(--tap-min); height: var(--tap-min);
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--dim);
}
.hello__gear:active { transform: scale(0.94); }
.hello__gearico {
  width: var(--sp-24); height: var(--sp-24);
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
/* ==========================================================================
   FRIENDS' CALENDAR
   ========================================================================== */

.calnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-8); margin-bottom: var(--sp-12);
}
.calnav__month { font-size: var(--fs-title); font-weight: 600; color: var(--ink); }

.calgrid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--sp-4);
}
.calgrid__head {
  text-align: center; font-size: var(--fs-micro); font-weight: 600;
  letter-spacing: 0.06em; color: var(--dim); padding-bottom: var(--sp-4);
}

.calcell {
  position: relative; aspect-ratio: 1; min-width: 0;
  background: var(--surface-2); border: 0; border-radius: var(--r-sm);
  padding: 0; font: inherit; color: inherit; cursor: pointer;
  display: grid; place-items: center; overflow: hidden;
}
.calcell.is-empty { background: none; cursor: default; }
.calcell.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.calcell:not(.is-empty):active { opacity: 0.6; }
/* The date sits behind the faces rather than beside them: a cell this size has
   room for one or the other, and the faces are what the screen is for. */
.calcell__num {
  position: absolute; top: var(--sp-2); left: var(--sp-4);
  font-size: var(--fs-micro); color: var(--dim);
}
.calcell:not(.is-empty) .calcell__num { color: var(--faint); }

/* The pile runs corner to corner — the longest line a square cell has — so the
   whole cluster is turned -45deg and every face turned back +45deg. Rotating
   only the container would lay everybody on their side.

   Sizes are picked so three faces plus a counter still fit: four 16px circles
   overlapping by 6 make a 46px line, and a line that long across the diagonal
   of a cell needs about 33px of width. */
.stack {
  display: flex; align-items: center;
  transform: rotate(-45deg);
}
.stack__face {
  width: var(--sp-16); height: var(--sp-16); flex: none;
  border-radius: var(--r-full);
  transform: rotate(45deg);
  object-fit: cover;
  /* A ring in the cell colour, so overlapping faces stay separate shapes
     instead of merging into one blob. */
  box-shadow: 0 0 0 1.5px var(--surface-2);
  display: grid; place-items: center;
  font-size: 0.5rem; font-weight: var(--fw-bold);
  background: var(--accent-soft); color: var(--accent);
}
.stack__face + .stack__face { margin-left: calc(-1 * var(--sp-6)); }
.stack__face--more { background: var(--line-strong); color: var(--ink); }

/* One person, at a size where you can actually tell who they are. */
.friendday { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-8) 0; }
.friendday + .friendday { border-top: 1px solid var(--line-soft); }
.friendday__words { min-width: 0; }
.friendday__name { font-weight: 600; color: var(--ink); }
.friendday__what { margin-top: var(--sp-2); font-size: var(--fs-meta); color: var(--dim); }

/* ==========================================================================
   AVATAR
   ==========================================================================

   Three sizes, one shape. `--photo` is added when there is a picture, and it
   only has to undo what the letter version needs: the tinted circle behind a
   single character would show as a ring around a photograph that already fills
   the frame. Everything else — the size, the radius, the ring — is shared, so a
   photo cannot end up a different shape from the initial it replaced. */
.avatar, .avatar-lg, .hello__avatar, .phead__avatar {
  border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: var(--fw-bold);
  box-shadow: var(--ring);
  flex: none;
}
.avatar--photo, .avatar-lg--photo, .hello__avatar--photo, .phead__avatar--photo {
  background: none;
  object-fit: cover;
}

.avatar    { width: var(--sp-32); height: var(--sp-32); font-size: var(--fs-meta); }
.avatar-lg { width: var(--sp-64); height: var(--sp-64); font-size: var(--fs-figure); }
.avatar-edit { display: grid; place-items: center; margin-bottom: var(--sp-12); }

/* Nine digits meant to be read off a screen while somebody else types them,
   so they get room and tabular figures — proportional ones make a column of
   numbers jitter as it is read aloud. */
.friendcode {
  display: flex; align-items: center; gap: var(--sp-12);
  background: var(--surface-2); border-radius: var(--r-md);
  padding: var(--sp-12) var(--sp-16); margin-bottom: var(--sp-8);
}
/* The words take the slack so the button keeps its size, the same bargain the
   friend rows make with their names. */
.friendcode__words { flex: 1; min-width: 0; }

/* ---- the invitation link ------------------------------------------------ */

/* The person in the invitation window. Centred, which nothing else in a sheet
   is: this is one face being introduced rather than a row in a list, and the
   only thing on the screen worth looking at before the two buttons under it. */
.invitecard { text-align: center; padding: var(--sp-8) 0 var(--sp-4); }
.invitecard .avatar-lg { margin: 0 auto var(--sp-12); }
.invitecard__name {
  font-size: var(--fs-title); font-weight: var(--fw-bold);
  color: var(--ink); margin-bottom: var(--sp-8);
  overflow-wrap: anywhere;
}
.invitecard__why {
  color: var(--dim); font-size: var(--fs-meta); line-height: 1.5;
}

.invitebox { margin-bottom: var(--sp-20); }
/* The code, on its own white card. It stays white in a black app on purpose:
   a scanner expects dark modules on a light field, and this is the one thing
   on the screen that a stranger's phone has to read on the first try.
   Centred and capped, so it is the size of something you hold up rather than
   something that fills a page. */
.invitebox__qr {
  display: flex; justify-content: center;
  margin-bottom: var(--sp-12);
}
.qr {
  width: 100%; max-width: 15rem; height: auto;
  border-radius: var(--r-md);
  /* The quiet zone is drawn inside the SVG, so the card needs no padding of
     its own -- but it does need to sit on something, or a white code on a
     near-black card has nothing to say where it ends. */
  box-shadow: var(--shadow-float);
}
.invitebox__row {
  display: flex; align-items: center; gap: var(--sp-8);
  background: var(--surface-2); border-radius: var(--r-md);
  padding: var(--sp-12); margin-bottom: var(--sp-8);
}
/* A URL is one long unbreakable word, so it is told where it may break and
   given a ceiling. Two lines is the most it ever needs and the most anybody
   reads before pressing Copy -- the address is not for reading, it is for
   confirming that a link exists and is the right one. */
.invitebox__url {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: var(--fs-small); color: var(--dim);
  overflow-wrap: anywhere; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* When it expires on the left, how to replace it on the right. Together
   because the second is the answer to the first. */
.invitebox__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-12);
  color: var(--faint); font-size: var(--fs-small);
}
.friendcode__label {
  font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--dim);
}
.friendcode__value {
  margin-top: var(--sp-4);
  font-size: var(--fs-lead); font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums; letter-spacing: 0.06em; color: var(--accent);
}

/* One person, one line. The name can be anything a person typed, so it takes
   the slack and the buttons keep their size. */
.friendrow {
  display: flex; align-items: center; gap: var(--sp-8);
  padding: var(--sp-8) 0; min-width: 0;
}
.friendrow + .friendrow { border-top: 1px solid var(--line-soft); }
/* The name, and under it whatever is true of them at this moment. The column
   takes the row's spare width so the name can still run out of room and
   ellipsize; the badge under it never competes for that width. */
.friendrow__words { flex: 1; min-width: 0; }
.friendrow__name {
  color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.friendrow__live { margin-top: var(--sp-4); }
.friendrow__acts { flex: none; display: flex; gap: var(--sp-6); }

/* ======================================================= PREFERENCES ==== */

/* A preference and the thing that changes it. Built like .friendrow rather
   than .detailrow because these rows are operated, not read: the control has
   to keep its size while the words give up theirs, which is the same bargain
   a friend's name makes with the buttons beside it.

   The wrap is what lets the theme row work without a second rule. Two chips
   and a label fit one line on a phone; three chips do not, so that row drops
   its controls underneath while the on/off rows stay on one line. */
.prefrow {
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-12) 0; flex-wrap: wrap;
}
.prefrow + .prefrow { border-top: 1px solid var(--line-soft); }

/* An on/off switch, the way iOS draws one (Settings A of the v271 rebrand).
   32px tall, so the 44px target comes from ::after; the knob is ::before and
   travels the track less itself and its two insets. */
.switch {
  position: relative; flex: none; padding: 0; border: 0;
  width: calc(var(--sp-48) + var(--sp-4)); height: var(--sp-32);
  border-radius: var(--r-full); background: var(--surface-2); box-shadow: var(--ring);
  cursor: pointer; transition: background-color var(--dur-base) var(--ease-out);
}
.switch::before {
  content: ''; position: absolute; top: var(--sp-2); left: var(--sp-2);
  width: calc(var(--sp-24) + var(--sp-4)); height: calc(var(--sp-24) + var(--sp-4));
  border-radius: 50%; background: var(--ink);
  transition: transform var(--dur-base) var(--ease-out);
}
.switch::after {
  content: ''; position: absolute; left: 0; right: 0;
  top: 50%; transform: translateY(-50%); height: var(--tap-min);
}
.switch.is-on { background: var(--accent-fill); }
.switch.is-on::before { transform: translateX(var(--sp-20)); }
.switch:disabled { opacity: 0.6; cursor: default; }
/* 12rem, not a percentage: below that the hint breaks into a column of two
   and three words, which reads worse than wrapping the control. */
.prefrow__words { flex: 1 1 12rem; min-width: 0; }
.prefrow__name { color: var(--ink); font-weight: 600; }
.prefrow__hint {
  margin-top: var(--sp-2); color: var(--dim); font-size: var(--fs-small);
}
/* The chips sit on their own line under the words when the row wraps. */
.prefrow .chip-row { flex: 1 0 100%; }
/* A menu where most rows have a chip. Same height and the same edge, so the
   two kinds of control read as the same row rather than as two designs. */
.prefrow select {
  flex: none; min-height: var(--tap-min);
  padding: 0 var(--sp-12);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: var(--fs-body); font-weight: var(--fw-medium);
}
.prefrow select:focus { outline: 2px solid var(--info); outline-offset: -1px; }

/* ==========================================================================
   PROFILE HEADER
   ==========================================================================

   A cover band, the avatar over its lower edge, then the name, what you train
   for, and two actions — centred, in that order.

   The whole header is not one button any more: with two actions under the name
   there is somewhere obvious to press, so the picture keeps the tap and the
   pencil says so.
   ========================================================================== */

.phead { text-align: center; margin-bottom: var(--sp-16); }

/* The band is an SVG so its outline can carry the bite around the avatar with
   a rounded junction either side. Rounding cannot be done with border-radius
   and a masked circle: a mask leaves the bottom edge meeting the circle at a
   point, and the reference fillets that junction the way it rounds the corners. */
.phead__band { position: relative; }
.phead__cover { display: block; width: 100%; height: auto; }
.phead__coverfill { fill: var(--surface-2); }

/* In the upper part of the band, clear of the bite in its lower edge. Its
   bottom is set inline from the same constants that place the avatar. */
.phead__coveradd {
  position: absolute; inset: 0 0 auto 0;
  background: none; border: 0; cursor: pointer;
  font-size: var(--fs-meta); color: var(--faint);
}
.phead__coveradd:active { color: var(--dim); }
/* Signed out the band carries two lines instead of one: what is true, and what
   to do about it. Stacked rather than run together, because the fact is not a
   button label. */
.phead__coverline { display: block; }
.phead__coverdo {
  display: block; margin-top: var(--sp-2);
  font-weight: 600; color: var(--accent);
}

/* Pulled up past half its own height, so rather more of it sits inside the
   band than below it — measured against the reference, which puts the avatar's
   centre above the band's lower edge rather than on it. */
.phead__face {
  /* Block-level and centred by auto margins, not inline-grid: an inline-level
     box sits on its line's baseline, and a negative margin-top there is partly
     eaten by the line box — the avatar moved 26px for a 48px pull.

     Its width and its pull are set inline from the same constants that cut the
     bite (see coverFaceStyle), both as percentages of this block's width, so
     the hole and the avatar scale together on any screen. */
  position: relative; display: grid; place-items: center;
  aspect-ratio: 1;
  margin-left: auto; margin-right: auto; margin-bottom: var(--sp-8);
  background: none; border: 0; padding: 0; cursor: pointer;
  border-radius: var(--r-full);
}
.phead__face:active { opacity: 0.7; }
.phead__avatar {
  /* Fills the wrapper, which is sized as a fraction of the band. No ring of its
     own: the gap around it is the bite in the band, so the separation is even
     over a photograph and there is nothing to keep in step with it. */
  width: 100%; height: 100%;
  font-size: var(--fs-figure);
  box-shadow: none;
}
.phead__pencil {
  position: absolute; right: -2px; bottom: -2px;
  width: var(--sp-24); height: var(--sp-24); border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--bg);
}
.phead__pencilico {
  width: var(--sp-12); height: var(--sp-12);
  fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
}

.phead__name {
  margin: 0; font-size: var(--fs-lead); font-weight: var(--fw-bold);
  letter-spacing: var(--tr-lead); color: var(--ink);
}
.phead__sub { margin-top: var(--sp-2); font-size: var(--fs-meta); color: var(--dim); }
/* Its own line rather than another clause on the subtitle: the subtitle is what
   you train for and how often, which is a sentence about training, and a place
   name appended to it reads as a third thing in a list of two. */
.phead__gym { margin-top: var(--sp-2); font-size: var(--fs-meta); color: var(--faint); }
/* Above the gym rather than below it, and with more air: a gym is a standing
   fact about somebody and this stops being true within the hour. */
.phead__live { margin-top: var(--sp-8); }

/* Two actions, equal width, the way the reference has them. They wrap on a
   very narrow screen rather than shrinking their labels to nothing. */
.phead__acts {
  display: flex; gap: var(--sp-8); flex-wrap: wrap;
  margin-top: var(--sp-12);
}
.phead__acts > .btn { flex: 1 1 40%; min-width: 0; justify-content: center; }

/* The figures. No boxes: this app draws a set of numbers as a display figure
   over ruled columns — the Today card has always done it that way, and four
   bordered cards were a shape borrowed from the reference rather than from
   here. Rules cost no ink, so the numbers stay the loudest thing present. */
.showcase { margin-bottom: var(--sp-16); }

.lead-figure { text-align: center; padding-bottom: var(--sp-12); }
.lead-figure__value {
  font-size: var(--fs-display); font-weight: var(--fw-bold);
  line-height: var(--lh-tight); letter-spacing: var(--tr-display);
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.lead-figure__label {
  margin-top: var(--sp-2);
  font-size: var(--fs-micro); letter-spacing: var(--tr-caps);
  text-transform: uppercase; color: var(--faint);
}
/* Your own profile shows every figure and marks the ones nobody else can see.
   Marked rather than removed, because the point is to tell you what you are
   withholding — a figure that vanished would say nothing at all.

   Marked with a measured colour and not with opacity: --dim on the page is
   7.27:1, while the same colour at 55% opacity computes to 2.77:1, which fails
   even the large-text threshold. Opacity is the easy way to say "less
   important" and the reliable way to break contrast. */
.lead-figure--hidden .lead-figure__value { color: var(--dim); }
.statstrip__cell--hidden .statstrip__value { color: var(--dim); }

/* ---- the segmented tab bar --------------------------------------------- */

.segbar {
  display: flex; gap: var(--sp-4); margin-bottom: var(--sp-16);
  padding: var(--sp-4);
  border: 1px solid var(--line-strong); border-radius: var(--r-full);
}
.segbar__tab {
  position: relative;
  flex: 1; min-width: 0; min-height: var(--sp-40);
  border: 0; border-radius: var(--r-full); background: none;
  font-size: var(--fs-meta); font-weight: var(--fw-medium); color: var(--dim);
  cursor: pointer;
}
/* The label changes hands the instant you tap; the pill takes its own time to
   get there. Same split as the bar at the bottom of the screen, and for the
   same reason — waiting for the slower half would leave the tab you pressed
   looking unpressed while it travelled. */
.segbar__tab.is-on { color: var(--ink); font-weight: 600; }

/* The pill, behind the label rather than a background on the button: a
   background cannot be stretched, and stretching is the whole point. Driven a
   frame at a time by the same four properties the bottom bar uses, and unset
   the rest of the time, so a tab that is simply on costs no transform at all.

   The origin is the trailing edge. A scale leaves its origin alone, so the side
   the pill came from stays exactly where it was while the other side is drawn
   out ahead of it. */
.segbar__tab.is-on::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--surface-2);
  transform-origin: var(--mark-origin, center);
  transform: translateX(var(--mark-x, 0px))
             scaleX(var(--mark-sx, 1))
             scaleY(var(--mark-sy, 1));
  /* The ends keep their shape while only the middle lengthens.

     A scale carries the radius with it, so `border-radius: var(--r-full)` under
     scaleX turned each cap into an ellipse and the pill stretched all over
     rather than in the body. Dividing the horizontal radius by the same factor
     the transform multiplies it by cancels that exactly, and multiplying by the
     vertical scale keeps the cap as round as the box is tall — so a cap stays a
     half circle through the squash as well as the stretch.

     A number, not var(--r-full): a radius larger than the box is clamped down
     before the transform is applied, so 999px would be clamped to half the
     width and then stretched anyway. 20px is half the 40px the tab stands at,
     which is the same stadium at rest. */
  border-radius: calc(var(--sp-20) * var(--mark-sy, 1) / var(--mark-sx, 1)) / 50%;
}

/* ---- the cover picker in the edit sheet -------------------------------- */

/* ---- somebody's picture, opened ---------------------------------------- */

/* On the body, over everything, and above the sheet it was opened from. */
.photolayer {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: var(--gutter);
  background: rgba(0, 0, 0, 0.88);
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-out);
  cursor: zoom-out;
}
.photolayer.is-open { opacity: 1; }
/* Round, because that is the shape it is worn in everywhere else and a square
   reveal would look like a different picture. Capped so a 256px avatar is not
   blown up past the point where it turns to porridge. */
.photolayer__img {
  width: min(78vw, 320px); height: min(78vw, 320px);
  border-radius: var(--r-full); object-fit: cover;
  transform: scale(0.92); transition: transform var(--dur-base) var(--ease-out);
}
.photolayer.is-open .photolayer__img { transform: scale(1); }

/* The circle is the control when there is a photo behind it. */
.avatar-tap {
  display: block; padding: 0; border: 0; background: none;
  border-radius: var(--r-full); cursor: zoom-in; flex: none;
}
.avatar-tap:active { opacity: 0.7; }

/* ---- placing a profile picture ----------------------------------------- */

/* Square, and the photo is absolutely placed inside it so its size and offset
   are set in pixels rather than negotiated by layout. `touch-action: none`
   because both axes belong to the drag here — without it the page takes the
   vertical one and the photo only moves sideways. */
.crop {
  position: relative; width: 100%; aspect-ratio: 1;
  overflow: hidden; border-radius: var(--r-lg);
  background: var(--sunken);
  touch-action: none; cursor: grab; user-select: none;
}
.crop:active { cursor: grabbing; }
.crop__img {
  position: absolute; left: 50%; top: 50%;
  max-width: none;          /* the app's images shrink to fit; this one must not */
  -webkit-user-drag: none; user-select: none; pointer-events: none;
}
/* The circle is a hole rather than a drawn ring: one enormous shadow spreading
   outward from it darkens everything else, and the square's own overflow trims
   it. Nothing is painted over the photo inside the circle, so what you see
   there is exactly what is kept. */
.crop__ring {
  position: absolute; inset: 0; border-radius: var(--r-full);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.62);
  outline: 2px solid var(--ink); outline-offset: -2px;
  pointer-events: none;
}
/* The cover's frame is its own outline, bite and all, so it is drawn rather
   than shadowed: the same dimming and the same edge as the ring above.
   The stroke stays 2px however the drawing is stretched. */
.crop__band { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crop__dim { fill: rgba(0, 0, 0, 0.62); }
.crop__edge {
  fill: none; stroke: var(--ink); stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

/* Rule of thirds, over the whole square rather than only the circle: the lines
   are for judging where a face sits, and a face is judged against the frame it
   is being moved inside. Faint enough to read a photo through, and pointer
   events pass straight through to the drag underneath. */
.crop__grid { position: absolute; inset: 0; pointer-events: none; }
.crop__grid::before, .crop__grid::after {
  content: ''; position: absolute; inset: 0;
  background-repeat: no-repeat;
}
.crop__grid::before {
  background-image: linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
                    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28));
  background-size: 100% 1px, 100% 1px;
  background-position: 0 33.333%, 0 66.667%;
}
.crop__grid::after {
  background-image: linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
                    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28));
  background-size: 1px 100%, 1px 100%;
  background-position: 33.333% 0, 66.667% 0;
}

.crop__tools {
  display: flex; justify-content: center; align-items: center; gap: var(--sp-4);
  margin: var(--sp-12) 0 var(--sp-8);
  padding: var(--sp-4); border-radius: var(--r-full);
  background: var(--surface-2); width: max-content; margin-inline: auto;
}
.crop__zoom, .crop__reset {
  min-height: var(--sp-32); border: 0; border-radius: var(--r-full);
  background: none; color: var(--ink); cursor: pointer;
  font-size: var(--fs-meta); font-weight: var(--fw-medium);
}
.crop__zoom { width: var(--sp-40); font-size: var(--fs-title); line-height: 1; }
.crop__reset { padding: 0 var(--sp-16); }
.crop__zoom:active, .crop__reset:active { background: var(--line-strong); }

.coveredit {
  aspect-ratio: 8 / 3; width: 100%;
  background: var(--surface-2); border-radius: var(--r-md);
  overflow: hidden; display: grid; place-items: center;
}
.coveredit__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coveredit__empty { font-size: var(--fs-meta); color: var(--faint); }

.hello__avatar {
  width: var(--sp-40); height: var(--sp-40); border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-title); font-weight: var(--fw-bold);
  box-shadow: var(--ring);
  /* Out past the gutter by 30% of it. It is a round mark rather than a block
     of text, so its edge reads as further in than it measures; pulling it out
     is what puts it on the same optical line as the greeting under it. */
  margin-left: calc(-0.3 * var(--gutter));
  /* The greeting sat 76px down; a fifth lower is 91. The extra 16 goes here,
     under the avatar, so the avatar keeps its place and everything below it
     moves together. */
  margin-bottom: calc(var(--sp-12) + var(--sp-16));
}
.hello__words { min-width: 0; }
/* Display size, but on one line beside the avatar rather than as a screen
   title on its own — so it is set here rather than reusing .screen-head. */
.hello__greet {
  font-size: var(--fs-lead); font-weight: var(--fw-display);
  letter-spacing: var(--tr-lead); line-height: var(--lh-tight);
  overflow-wrap: break-word;
}
.hello__sub { color: var(--dim); font-size: var(--fs-meta); margin-top: var(--sp-2); }

/* ---- the week ---------------------------------------------------------- */
/* Seven equal columns, so the row keeps its rhythm whether a date is one digit
   or two. Each cell is a fixed height for the same reason the tick has a slot
   of its own: the dates must sit on one baseline. */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--sp-6); }
.weekday {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-6);
  min-height: var(--tap-min); padding: var(--sp-8) 0;
  /* A stadium, not a rounded rectangle. The cell is taller than it is wide, so
     a full radius curves the ends and leaves the sides straight.

     The same charcoal and hairline as the cards since v278, at the user's
     request: the strip and the cards under it read as one material. */
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-full);
  box-shadow: var(--ring); cursor: pointer;
  color: var(--dim);
  /* The same line .btn carries, and for the same press. It also carries the
     lift below, which is why there is one transition here and not two: both
     are `transform`, so a second declaration would replace the first rather
     than add to it. A transition rather than keyframes, because these are
     tapped one after another and a transition retargets from wherever the
     cell has got to -- keyframes would snap back to the start each time. */
  transition: transform var(--dur-press) var(--ease-out);
}
.weekday__letter { font-size: var(--fs-small); font-weight: var(--fw-bold); }
/* The slot is always here; only its contents come and go. Without it the row
   of dates would step up and down as sessions are logged. */
.weekday__mark { display: grid; place-items: center; width: var(--sp-16); height: var(--sp-16); }

/* What happened on that day, between the letter and the date.
   Green tick: trained. Red cross: a scheduled session that did not happen.
   Hollow amber: scheduled and still ahead of you. A rest day carries nothing —
   an empty slot is the signal, and it is the only day that has none. */
.daymark {
  display: grid; place-items: center;
  width: var(--sp-16); height: var(--sp-16); border-radius: var(--r-full);
}
.daymark svg {
  width: 10px; height: 10px;
  fill: none; stroke: currentColor; stroke-width: 3.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.daymark--done   { background: var(--success); color: var(--on-accent); }
.daymark--missed { background: var(--danger);  color: var(--on-accent); }
/* Ahead of you: an outline, so it reads as a slot waiting to be filled rather
   than as a third outcome. */
.daymark--due { box-shadow: inset 0 0 0 2px var(--accent-line); }
.weekday__date { font-size: var(--fs-meta); font-weight: var(--fw-bold); color: var(--ink); }
.weekday.is-today { border-color: var(--accent-line); background: var(--accent-soft); }
.weekday.is-today .weekday__letter,
.weekday.is-today .weekday__date { color: var(--accent); }
/* A day you tapped that is not today. Outlined rather than tinted: amber on
   this strip means today, and a second amber cell would leave two answers to
   "which day is it". Never on today's cell — picking today clears the
   selection instead.

   The colour was asked for by name. Read --day-picked's own note before
   changing it: it reads at 12.55:1 on the light theme and 1.08:1 on the dark
   one, where the 2px weight below is what distinguishes the cell instead. The
   letter stays Ink so the cell has something that does change in both. */
.weekday.is-picked { border-color: var(--day-picked); }
.weekday.is-picked .weekday__letter { color: var(--ink); }
/* The one the card below is about, whichever day that is: today while nothing
   else is chosen, the chosen day otherwise. Weight rather than another colour,
   because the colour is already carrying which *kind* of day it is — amber for
   today, ink for a day you went looking at.

   Width only, and the box does not move: border-box means the extra pixel
   grows inward, so the pill keeps its outer size and the row keeps its
   rhythm. */
/* The chosen day stands out of the row.

   A percentage, so it is 8% of the cell's own height whatever that turns out
   to be, and `transform` so the other six do not move: the row keeps its grid
   and nothing reflows. It is deliberately small -- the border weight and the
   ink edge already say which day is chosen, and this is the movement that
   makes the change legible rather than a second way of saying it. */
.weekday.is-on { border-width: 2px; transform: translateY(-8%); }
.weekday:active { transform: scale(0.97); }
/* Both at once. `transform` is one property, so the press would otherwise
   drop the chosen day back into the row for as long as a finger is on it. */
.weekday.is-on:active { transform: translateY(-8%) scale(0.97); }

/* One stroke width across every icon on this screen, matching the tab bar.
   The colour is the one thing that differs, and only here: each card carries a
   tone so that four unrelated numbers side by side can be told apart without
   reading their labels. Amber is still the app's voice everywhere else. */
.minicard__ico, .minicard__go, .ex-card__chev {
  flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* The tone, and its 13% tint, chosen by one class on the card. Both fall back
   to amber, so a card with no tone still looks like it belongs. */
.tone--sky    { --tone: var(--tone-sky);    --tone-soft: var(--tone-sky-soft); }
.tone--coral  { --tone: var(--tone-coral);  --tone-soft: var(--tone-coral-soft); }
.tone--lime   { --tone: var(--tone-lime);   --tone-soft: var(--tone-lime-soft); }
.tone--violet { --tone: var(--tone-violet); --tone-soft: var(--tone-violet-soft); }

/* The icon sits on its own tinted chip. The tint is behind the glyph and
   nothing else — washing the whole card put --faint under the contrast floor
   at only five per cent. */
.minicard__ico {
  width: var(--sp-16); height: var(--sp-16);
  color: var(--tone, var(--accent));
  box-sizing: content-box; padding: var(--sp-6);
  border-radius: var(--r-sm);
  background: var(--tone-soft, var(--accent-soft));
}
.minicard__go { width: var(--sp-16); height: var(--sp-16); margin-left: auto; color: var(--faint); }

.statcard:active { transform: scale(0.98); }

/* ---- the statistics card ----------------------------------------------- */
.statcard {
  display: block; width: 100%; text-align: left;
  border: 0; cursor: pointer; color: var(--ink);
  margin-top: var(--sp-8);
  padding: var(--sp-16);
}
.statcard .card__head { align-items: center; }
.statcard .card__title { color: var(--ink); }
.statcard__more {
  display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto;
  color: var(--dim); font-size: var(--fs-meta);
}

/* ---- the list under it (v273): Calendar, Friends, Muscle Recovery -------
   One card, a row per place, a hairline between, the tone on the icon. */
.homelist { padding: var(--sp-4) var(--sp-16); }
.homelist__row {
  display: flex; align-items: center; gap: var(--sp-12); width: 100%;
  min-height: calc(var(--sp-48) + var(--sp-16)); padding: var(--sp-8) 0;
  background: none; border: 0; text-align: left; color: var(--ink); cursor: pointer;
}
.homelist__row + .homelist__row { border-top: 1px solid var(--line-soft); }
.homelist__row:active .homelist__title { color: var(--dim); }
.homelist__words { display: grid; gap: var(--sp-2); min-width: 0; }
.homelist__title { font-size: var(--fs-body); font-weight: var(--fw-bold); }
.homelist__sub { font-size: var(--fs-meta); color: var(--dim); }
.ringrow {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-8); margin-top: var(--sp-16);
}

/* What today is: the first card on the screen, and the only thing on it that
   is an instruction rather than a reading.

   Its button is the one amber *fill* on the home screen — the meaning
   --accent-fill carries, and what One Voice is spent on here. The today cell
   in the strip above is a tint and the tab bar's mark is a bar; neither is a
   surface, so none of the three competes with the others. */
.todaycard {
  display: block; width: 100%; text-align: left;
  border: 0; cursor: pointer; color: var(--ink);
  padding: var(--sp-16);
  margin-top: var(--sp-16);
  position: relative; overflow: hidden;
}

/* ---- the photograph ----------------------------------------------------
   A panel down the right-hand side, not a cutout floating on the card. The
   pictures were shot 16:9 in a dark gym and each one is cut to the part of
   that frame with the person in it — tools cropped them once, at 437x540, so
   nothing here has to nudge a figure into place at runtime.

   The padding is what keeps the words and the picture apart. Absolute
   positioning alone would let a long day name run underneath the panel, and
   `max-width` on the text would not hold the button, which sizes to its own
   label. Reserving the space on the card means nothing can reach into it. */
/* The photograph across the whole card, since v273 (the Home "mix" of
   12/11/2026). The words sit on a shade that runs from the left, so they read
   over any picture; the leaning rule that divided words from picture went
   with the panel, at the user's request. */
.todaycard--art {
  min-height: calc(var(--sp-64) * 4);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  padding-right: 25%;
}
.todaycard--art > :not(.todaycard__art) { position: relative; z-index: 1; }
/* A pixel inside the card on every edge, so the card's inset hairline is not
   painted over; one pixel less than its radius for the same reason. */
.todaycard__art {
  position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px);
  border-radius: calc(var(--r-md) - 1px);
  object-fit: cover; object-position: center 30%;
  pointer-events: none;
}
.todaycard--art::after {
  content: ''; position: absolute; inset: 1px; z-index: 0; pointer-events: none;
  border-radius: calc(var(--r-md) - 1px);
  background: linear-gradient(100deg,
      color-mix(in srgb, var(--sunken) 92%, transparent) 25%,
      color-mix(in srgb, var(--sunken) 55%, transparent) 60%,
      transparent 88%);
}

.todaycard__kicker {
  font-size: var(--fs-micro); font-weight: var(--fw-bold);
  letter-spacing: var(--tr-caps); text-transform: uppercase;
  color: var(--faint);
}
.todaycard__title {
  margin-top: var(--sp-4);
  font-size: var(--fs-lead); font-weight: var(--fw-bold);
  letter-spacing: var(--tr-lead);
  /* Day names run long — "Back, biceps & forearms" — and the card must grow
     rather than clip. Nothing below it depends on its height. */
  text-wrap: balance;
}
.todaycard__sub { margin-top: var(--sp-2); color: var(--dim); font-size: var(--fs-meta); }
/* Over the photograph, as in the gallery the user picked from: the kicker in
   the accent and the day name a step larger. */
.todaycard--art .todaycard__kicker { color: var(--accent); }
.todaycard--art .todaycard__title { font-size: var(--fs-figure); }

/* Looks like the button it is. Inline-flex so the caret sits on the text's
   own baseline box rather than on the card's. */
.todaycard__go {
  display: inline-flex; align-items: center; gap: var(--sp-4);
  margin-top: var(--sp-12);
  min-height: var(--tap-min); padding: 0 var(--sp-20);
  border-radius: var(--r-full);
  background: var(--accent-fill); color: var(--on-accent);
  font-size: var(--fs-body); font-weight: var(--fw-bold);
  letter-spacing: var(--tr-title);
}
.todaycard:active .todaycard__go { filter: brightness(0.94); }
/* Aimed at another day. The amber fill means "the thing to do now", and
   looking at Wednesday's plan is not that — so the button goes quiet and the
   one amber surface on the screen stays with the day you are actually on. */
.todaycard--other .todaycard__go {
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-strong);
}
.todaycard__caret {
  width: var(--sp-16); height: var(--sp-16); flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.ringcell { text-align: center; min-width: 0; }
.ringcell__label {
  color: var(--faint); font-size: var(--fs-tiny); font-weight: var(--fw-bold);
  margin-top: var(--sp-6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* A week dial (weekDial): the number in the middle of the same box rather than
   after it, which is what makes the two read as one object, and round it the
   bezel of seven days. The today dot sits just outside the bezel, past the
   box's edge, so the drawing may overflow it. */
.ring { position: relative; display: grid; place-items: center; }
.ring__dial { width: 100%; max-width: var(--sp-64); aspect-ratio: 1; display: block; overflow: visible; }
.ring__seg { fill: none; stroke: var(--tone, var(--accent-fill)); stroke-width: 5; }
.ring__seg.is-ahead { stroke: var(--ink); stroke-opacity: 0.1; stroke-dasharray: 1.5 3; }
.ring__today { fill: var(--ink); }
.ring__value {
  position: absolute;
  font-size: var(--fs-meta); font-weight: var(--fw-bold);
  letter-spacing: var(--tr-lead);
}

/* Room under the last card, the same distance off the bar the recovery strip
   used to sit at. A class, not an id: nothing that styles a screen may
   outrank the attribute that hides it.

   The column that went with it is gone. It existed so `margin-top: auto` on
   the recovery strip could push it to the bottom of the screen; recovery is
   an ordinary card under the statistics one now, and nothing else ever asked
   to fall. */
.view--home {
  padding-bottom: calc((var(--tabbar-clear) + var(--sp-12)) * 1.1);
}

/* The build, last on the settings screen. Quiet enough to ignore and findable
   when something is behaving like a version behind. */
.buildstamp {
  color: var(--faint); font-size: var(--fs-small);
  text-align: center; padding: var(--sp-24) 0 var(--sp-8);
  font-family: var(--mono);
}
/* The stamp doubles as the way into the update history. It stays as quiet as
   it was -- it is the last thing on the screen and should not start competing
   with the sections above it -- but it has to look pressable, so it takes the
   underline that every other quiet link in the app uses. */
.buildstamp--link {
  display: block; width: 100%;
  background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
.buildstamp--link:active { color: var(--dim); }

/* The line at the foot of the update window that names its gesture. Quiet:
   it is an offer, not the reason the window opened. */
.swipehint {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-6);
  width: 100%; margin-top: var(--sp-16); padding: var(--sp-12) 0;
  background: none; border: 0; cursor: pointer;
  color: var(--dim); font-size: var(--fs-small);
}
.swipehint:active { color: var(--ink); }
.swipehint__arrow { color: var(--accent); font-size: var(--fs-meta); }

/* One version's heading inside the history. The number is the anchor the eye
   comes back to when scrolling a list of them, so it is ink rather than dim
   while the notes under it stay quieter. */
.histhead {
  display: flex; align-items: center; gap: var(--sp-8);
  margin-top: var(--sp-24); padding-top: var(--sp-16);
  border-top: 1px solid var(--line);
}
/* The first one has the sheet's own title above it already. */
.sheet__body > .histhead:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.histhead__v {
  font-family: var(--mono); font-size: var(--fs-meta);
  font-weight: var(--fw-medium); color: var(--ink);
}

/* ==========================================================================
   MUSCLE RECOVERY
   ========================================================================== */

/* The swatch is filled from the same token the map paints with, so the key
   cannot drift from the colour it is explaining. */
.recolegend {
  display: flex; align-items: center; gap: var(--sp-8);
  margin-top: var(--sp-12);
  font-size: var(--fs-meta); color: var(--dim);
}
.recolegend__key {
  flex: none; width: var(--sp-12); height: var(--sp-12);
  border-radius: 999px; background: var(--anat-primary);
}

/* The line that stands in for a list when there is no list. Sits in the flow
   the way the figure above it does, so the screen keeps one edge. */
.recoempty {
  margin: var(--sp-12) 0 0;
  font-size: var(--fs-meta); color: var(--dim);
}

.recodetail {
  margin-top: var(--sp-12);
  padding-top: var(--sp-12);
  border-top: 1px solid var(--line-soft);
}
.recodetail__plain { margin: 0; color: var(--ink); }
.recodetail__latin {
  margin-top: var(--sp-4);
  font-size: var(--fs-meta); font-style: italic; color: var(--dim);
}
.recodetail__label {
  margin: var(--sp-12) 0 var(--sp-4);
  font-size: var(--fs-micro); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
}
.recodetail__list { margin: 0; padding-left: var(--sp-16); color: var(--dim); font-size: var(--fs-meta); }
.recodetail__list li { margin-bottom: var(--sp-4); }
.recodetail__ex { margin: 0 0 var(--sp-8); font-size: var(--fs-meta); color: var(--dim); }
.recodetail__ex strong { color: var(--ink); font-weight: 600; }

/* ==================================================== SHORT SCREENS ==== */

/* Must stay at the end of the file. A media query adds no specificity, so
   when this block sat next to .screen-head__title every override in it was
   overruled by the base rules declared further down — the title clamped to
   two lines and nothing else moved at all.

   The Coach+ header was composed at 812px tall. On a 568px iPhone SE it plus
   the anatomy figures filled the viewport, so the exercise list read as
   absent rather than as scrollable. */
@media (max-height: 700px) {
  .screen-head { padding-top: var(--sp-16); padding-bottom: var(--sp-16); }
  .screen-head__title { -webkit-line-clamp: 2; }
  .screen-head__sub { margin-top: var(--sp-8); }
  .screen-head__aside { margin-top: var(--sp-12); }
  .bodymap-wrap { padding: 0; }
  .statstrip { padding: var(--sp-12) 0; }
}

/* The bar keeps its glass but does not move when motion is reduced. */
@media (prefers-reduced-motion: reduce) {
  .tabbar.is-min { transform: none; }
}

/* ---- growing into place (v279) ---------------------------------------------
   Picked by the user from a preview on 15/11/2026. Bars, the BMI mark and the
   1RM line start from nothing and reach their value when a screen OPENS
   (growIn in app.js, called by go() and by the exercise sheet), one after
   another by --grow-at. The Home dials draw themselves only when the week's
   numbers changed since Home was last seen (drawDials). Transitions, not
   keyframes, and the resting rules are the finished picture: a frame that
   never comes leaves every number right. Reduced motion: none of it. */
.weekbars__bar { transform-origin: bottom; }
.vol-row__fill, .macro__fill { transform-origin: left; }
.sparkline__dot { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .grows:not(.is-grown) .weekbars__bar { transform: scaleY(0); }
  .grows:not(.is-grown) :is(.vol-row__fill, .macro__fill) { transform: scaleX(0); }
  /* The mark's place is an inline left:%; this holds it at the start. */
  .grows:not(.is-grown) .bmibar__mark { left: 0 !important; }
  .grows:not(.is-grown) .sparkline__line { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .grows:not(.is-grown) .sparkline__fill { opacity: 0; }
  .grows:not(.is-grown) .sparkline__dot { transform: scale(0); }
  .grows.is-grown :is(.weekbars__bar, .vol-row__fill, .macro__fill) {
    transition: transform var(--dur-grow) var(--ease-out) var(--grow-at, 0ms);
  }
  .grows.is-grown .bmibar__mark { transition: left var(--dur-grow) var(--ease-out) 100ms; }
  .grows.is-grown .sparkline__line {
    stroke-dasharray: 1; transition: stroke-dashoffset 800ms var(--ease-out);
  }
  .grows.is-grown .sparkline__fill { transition: opacity 500ms var(--ease-out) 400ms; }
  .grows.is-grown .sparkline__dot { transition: transform 260ms var(--ease-out) 760ms; }

  /* Every stroke of a dial runs from 0 to 1 (pathLength, set by drawDials). */
  .ringrow.draws:not(.is-drawn) .ring__seg:not(.is-ahead) {
    stroke-dasharray: 1; stroke-dashoffset: 1;
  }
  .ringrow.draws.is-drawn .ring__seg:not(.is-ahead) {
    stroke-dasharray: 1;
    transition: stroke-dashoffset 700ms var(--ease-out) var(--grow-at, 0ms);
  }
}

/* ---- arriving, and not arriving (v280) ---------------------------------------
   Picked by the user from a preview on 15/11/2026. Whatever waits says so and
   whatever arrives comes in gently; whatever does not arrive says why, calmly,
   with the way back. Every resting rule is the finished picture: the from-states
   sit under a class the script adds, and reduced motion shows things arrived. */

/* Skeleton rows shine in the background's three colours, by row. */
.friendrow:nth-child(3n+1) { --shine: color-mix(in srgb, var(--accent) 20%, transparent); }
.friendrow:nth-child(3n+2) { --shine: color-mix(in srgb, var(--tone-violet) 22%, transparent); }
.friendrow:nth-child(3n)   { --shine: color-mix(in srgb, var(--tone-sky) 22%, transparent); }

/* "Loading" in words: a light through the letters, three dots in turn. */
.wait__dots i { font-style: normal; }
/* A line that could not be brought up to date. */
.warnline i {
  display: inline-block; width: var(--sp-6); height: var(--sp-6);
  border-radius: var(--r-full); background: var(--warn);
  margin-right: var(--sp-6); vertical-align: 1px;
}

/* A list that did not come. */
.oops {
  display: grid; justify-items: center; gap: var(--sp-8);
  padding: var(--sp-16) var(--sp-8); text-align: center;
}
.oops__ico {
  width: var(--sp-32); height: var(--sp-32);
  fill: none; stroke: var(--warn); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.oops__title { font-weight: var(--fw-bold); }
.oops__why { font-size: var(--fs-meta); color: var(--dim); max-width: 32ch; }
.oops .btn { margin-top: var(--sp-4); }

/* The day photo that did not come: the card keeps its size over the colours. */
.todaycard__art--none {
  background:
    radial-gradient(80% 90% at 100% 0, color-mix(in srgb, var(--tone-violet) 22%, transparent), transparent 70%),
    radial-gradient(70% 80% at 85% 100%, color-mix(in srgb, var(--tone-sky) 22%, transparent), transparent 70%),
    radial-gradient(60% 70% at 55% 30%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
}

/* The cloud toasts carry their state as an icon beside the words. :is() keeps
   these below .toast[hidden], which must still win. */
:is(.toast--busy, .toast--saved, .toast--held) {
  display: flex; align-items: center; gap: var(--sp-12); text-align: left;
  /* left: 50% leaves a fixed box half the screen to shrink into; this lets
     it take what the words need, up to its max-width. */
  width: max-content;
}
.toast--saved { border-color: var(--accent-line); }
.toast__ico {
  width: var(--sp-24); height: var(--sp-24); flex: none;
  fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.toast--busy .toast__ico { stroke: var(--accent); }
.toast--saved .toast__ico { stroke: var(--success); }
.toast--held .toast__ico { stroke: var(--warn); }

@media (prefers-reduced-motion: no-preference) {
  .wait {
    background: linear-gradient(90deg, var(--dim) 0%, var(--dim) 35%, var(--ink) 50%,
                                var(--dim) 65%, var(--dim) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: textsweep 1.5s linear infinite;
  }
  .wait__dots i { animation: blink 1.2s infinite both; }
  .wait__dots i:nth-child(2) { animation-delay: 0.2s; }
  .wait__dots i:nth-child(3) { animation-delay: 0.4s; }

  .rises { animation: rise-in 380ms var(--ease-out) var(--rise-at, 0ms) backwards; }
  .oops { animation: rise-in 380ms var(--ease-out) backwards; }

  .todaycard__art.arrives:not(.is-in) { opacity: 0; filter: blur(16px); transform: scale(1.06); }
  .todaycard__art.arrives.is-in {
    transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1),
                filter 1100ms var(--ease-out), transform 1100ms var(--ease-out);
  }
  .todaycard__art--none { animation: appear 500ms var(--ease-out) backwards; }

  .ex-card__thumb.arrives > .movement { animation: arrive 420ms var(--ease-out) backwards; }

  .toast--busy .toast__ico { animation: turn 0.9s linear infinite; }
  .toast--saved .toast__ico path { stroke-dasharray: 1; animation: tick 420ms var(--ease-out) backwards; }
  .toast--held .toast__ico { animation: appear 300ms var(--ease-out) backwards; }
}
@keyframes textsweep { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } 76% { opacity: 1; } }
@keyframes appear { from { opacity: 0; } }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes tick { from { stroke-dashoffset: 1; } }

/* ---- v281 ---------------------------------------------------------------- */
/* `hidden` has to beat their own display, as with .view and .auth. Without
   these the screens and the bar stayed on the page under the sign-in screen,
   and on an iPhone with the keyboard up they showed through it and took taps. */
.views[hidden], .tabbar[hidden] { display: none !important; }
/* The way back from signing in to another profile, where a screen's back
   control sits. */
.auth__back {
  position: absolute; left: var(--gutter);
  top: calc(var(--safe-top) + var(--sp-8));
}

/* ---- How it is tuned (v283): two rows, the choices in a sheet --------------- */
.card.tunelist, .card.checklist { padding: var(--sp-4) 0; overflow: hidden; }
.tunerow, .checkrow {
  display: flex; align-items: center; gap: var(--sp-12);
  width: 100%; min-height: var(--sp-48); padding: 0 var(--sp-20);
  background: none; border: 0; margin: 0; cursor: pointer;
  color: var(--ink); font: inherit; font-size: var(--fs-body); text-align: left;
}
.tunerow + .tunerow, .checkrow + .checkrow { border-top: 1px solid var(--line-soft); }
.tunerow__name, .checkrow__name { flex: 1; min-width: 0; }
.tunerow__value { color: var(--dim); }
.tunerow__chev {
  width: var(--sp-16); height: var(--sp-16); flex: none;
  fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.checkrow__ico {
  width: var(--sp-24); height: var(--sp-24); flex: none;
  fill: none; stroke: var(--faint); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke var(--dur-base) var(--ease-out);
}
.checkrow.is-on .checkrow__ico { stroke: var(--accent); }
.checkrow:not(.is-on) .checkrow__name { color: var(--dim); }
.checkrow__tick {
  width: var(--sp-20); height: var(--sp-20); flex: none;
  fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(0.6);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.checkrow.is-on .checkrow__tick { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .checkrow__ico, .checkrow__tick { transition: none; }
}

/* Where each day photo sits in the card, set by the user on a slider on
   16/11/2026 (v286). The rest are at the default, centre 30%. A wide picture
   fills the card's height, so it moves sideways instead. */
.todaycard__art[src$="/rest.webp"]  { object-position: center 75%; }
.todaycard__art[src$="/back.webp"]  { object-position: 0% center; }
.todaycard__art[src$="/legs.webp"]  { object-position: center 20%; }
.todaycard__art[src$="/core.webp"]  { object-position: center 35%; }
.todaycard__art[src$="/mixed.webp"] { object-position: center 50%; }

/* ---- Report a friend (v287, P5) ------------------------------------------- */
.promise {
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-16); border-radius: var(--r-md);
  background: var(--success-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 30%, transparent);
}
.promise__ico {
  width: var(--sp-32); height: var(--sp-32); flex: none;
  fill: none; stroke: var(--success); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.promise__title { font-weight: var(--fw-bold); }
.promise__text { color: var(--dim); font-size: var(--fs-meta); }
.checkrow__name { display: grid; }
.checkrow__hint { color: var(--dim); font-size: var(--fs-meta); font-weight: normal; }
.report-send { background: var(--danger); border-color: var(--danger); color: var(--on-accent); font-weight: var(--fw-bold); }

/* ---- v288 ------------------------------------------------------------------ */
/* Nothing is selectable but what you type into (asked 16/11/2026): a long
   press on a word or a photo did nothing an app should do. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }

/* Settings rows: a name and one line under it. */
.tunerow__name { display: grid; padding: var(--sp-8) 0; }

/* Muscle Recovery as a timeline (R3). */
.recotl { list-style: none; margin: 0; padding: 0 0 0 var(--sp-24); position: relative; }
.recotl::before {
  content: ''; position: absolute; left: 7px; top: var(--sp-8); bottom: var(--sp-8);
  width: 2px; border-radius: 1px; background: var(--surface-2);
}
.recotl__step { position: relative; padding: var(--sp-4) 0 var(--sp-16); }
.recotl__step::before {
  content: ''; position: absolute; left: calc(-1 * var(--sp-24) + 1px); top: 7px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg);
}
.recotl__step.is-now::before { background: var(--success); }
.recotl__when {
  font-size: var(--fs-small); font-weight: var(--fw-bold); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: var(--sp-8);
}
.recotl__step.is-now .recotl__when { color: var(--success); }
.recotl__tiles { display: flex; flex-wrap: wrap; gap: var(--sp-6); }
.recotile {
  font: inherit; font-size: var(--fs-meta); color: var(--ink); cursor: pointer;
  background: var(--surface-2); border: 0; border-radius: var(--r-sm); padding: var(--sp-8) var(--sp-12);
}
.recotile.is-rest { background: var(--accent-soft); }
.recotile.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.recotile.is-picked { background: var(--accent); color: var(--on-accent); }
.recotile--more { color: var(--dim); }
.recotile:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.recotl .recodetail { margin-top: var(--sp-12); }

/* ---- v289 ------------------------------------------------------------------ */
/* Done today: what was finished, with a way back from a Finish by mistake. */
.donecard {
  background: linear-gradient(160deg, color-mix(in srgb, var(--success) 12%, transparent), color-mix(in srgb, var(--success) 3%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 28%, transparent);
  margin-top: var(--sp-16);
}
.donecard__title { display: flex; align-items: center; gap: var(--sp-8); font-weight: var(--fw-bold); font-size: var(--fs-title); }
.donecard__tick { width: var(--sp-24); height: var(--sp-24); flex: none; fill: none; stroke: var(--success);
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.donecard__wk { margin-top: var(--sp-12); display: flex; align-items: center; gap: var(--sp-4); }
.donecard__words { flex: 1; min-width: 0; display: grid; }
/* v294: three icons on every row, 40px targets. */
.donecard__icon {
  flex: none; display: grid; place-items: center; width: var(--sp-40); height: var(--sp-40);
  border: 0; border-radius: 999px; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink);
}
.donecard__icon svg { width: var(--sp-20); height: var(--sp-20); fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.donecard__icon--go { background: var(--accent); color: var(--on-accent); }
.donecard__icon--go svg { fill: currentColor; }
.donecard__icon--delete { color: var(--danger); }
.donecard__icon:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.donecard__icon:active { opacity: 0.6; }
.donecard__wk + .donecard__wk { padding-top: var(--sp-12); border-top: 1px solid color-mix(in srgb, var(--success) 18%, transparent); }
.donecard__name { font-weight: 600; }
.donecard__meta { color: var(--dim); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.donecard__delete { color: var(--danger); }

/* Your progress on the exercise page: the PR, then the heaviest set each time. */
.prline { display: flex; align-items: baseline; gap: var(--sp-8); flex-wrap: wrap; }
.prline__big { font-size: var(--fs-figure); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.prline__unit { color: var(--faint); font-weight: var(--fw-bold); }
.prline__tag { margin-left: auto; font-size: var(--fs-small); font-weight: var(--fw-bold); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); padding: 2px var(--sp-8); border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--accent-line); }
.prline__axis { display: flex; justify-content: space-between; color: var(--faint); font-size: var(--fs-small); margin-top: var(--sp-4); }

/* ---- v290: less to read ------------------------------------------------------ */
.infobtn {
  flex: none; display: grid; place-items: center; width: var(--sp-32); height: var(--sp-32);
  margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) 0 0; padding: 0; border: 0; border-radius: 999px;
  background: none; color: var(--accent); cursor: pointer;
}
.infobtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.infobtn:focus-visible { outline: 2px solid var(--info); outline-offset: 0; }
.infobtn:active { opacity: 0.6; }
.infotext { margin: 0 0 var(--sp-12); color: var(--dim); }
.infotext strong { color: var(--ink); font-weight: 600; }
.infotext__aside { color: var(--faint); font-size: var(--fs-small); }

/* The figure's key in two lines (T1). */
.mlines { display: grid; gap: var(--sp-6); margin-top: var(--sp-12); }
.mline { display: flex; align-items: baseline; gap: var(--sp-12); font-size: var(--fs-meta); }
.mline__key {
  flex: none; width: 5.5rem; display: inline-flex; align-items: center; gap: var(--sp-6);
  font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.mline__key i { width: var(--sp-8); height: var(--sp-8); border-radius: 50%; display: block; }
.mline__names { color: var(--ink); }
.mline__names--quiet { color: var(--dim); }

.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid--3 .stat { padding: var(--sp-12); text-align: center; }

.watchcard { margin-top: var(--sp-16);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 24%, transparent); }
.watchcard__title { color: var(--danger); font-weight: var(--fw-bold); margin-bottom: var(--sp-8); }
.watchcard .cue-list li { color: var(--ink); }

.weighdots { display: flex; gap: var(--sp-6); }
.weighdots i { flex: 1; max-width: 2rem; height: 6px; border-radius: 3px; background: var(--surface-2); }
.weighdots i.is-on { background: var(--accent); }

.footnote {
  display: flex; align-items: center; gap: var(--sp-12); width: 100%; margin-top: var(--sp-16);
  padding: var(--sp-12) var(--sp-16); border: 0; border-radius: var(--r-md); box-shadow: var(--ring);
  background: none; color: var(--dim); font: inherit; font-size: var(--fs-meta); text-align: left; cursor: pointer;
}
.footnote__ico { width: var(--sp-20); height: var(--sp-20); flex: none; fill: none; stroke: var(--faint);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.footnote__go { margin-left: auto; color: var(--accent); font-weight: 600; }
.footnote:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* ---- v295: a friend, built like You ------------------------------------------- */
.friendempty { text-align: center; color: var(--dim); font-size: var(--fs-meta); padding: var(--sp-20) var(--sp-16); }
.friendempty svg { display: block; margin: 0 auto var(--sp-8); width: var(--sp-32); height: var(--sp-32);
  fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.friendempty__title { color: var(--ink); font-weight: var(--fw-bold); font-size: var(--fs-body); margin-bottom: var(--sp-2); }
.friendreport { display: block; margin: var(--sp-24) auto 0; padding: var(--sp-8); background: none; border: 0;
  color: var(--faint); font: inherit; font-size: var(--fs-meta); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.friendreport:focus-visible { outline: 2px solid var(--info); border-radius: var(--r-sm); }

.card.routinelist { padding: 0 var(--sp-20); }
.routday + .routday { border-top: 1px solid var(--line-soft); }
.routday summary { display: flex; align-items: center; gap: var(--sp-12); min-height: var(--sp-48); cursor: pointer; list-style: none; }
.routday summary::-webkit-details-marker { display: none; }
.routday summary:focus-visible { outline: 2px solid var(--info); border-radius: var(--r-sm); }
.routday__name { flex: 1; font-weight: 600; }
.routday__count { color: var(--faint); font-size: var(--fs-meta); }
.routday__chev { width: var(--sp-16); height: var(--sp-16); flex: none; fill: none; stroke: var(--faint); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-base) var(--ease-out); }
.routday[open] .routday__chev { transform: rotate(90deg); }
.routday__list { padding: 0 0 var(--sp-12); color: var(--dim); font-size: var(--fs-meta); }
@media (prefers-reduced-motion: reduce) { .routday__chev { transition: none; } }
