/* ==========================================================================
   Versus Coach – Training Planner
   Dark, sporty design system: very dark navy surfaces, a single lime→teal
   brand accent, blue-gray secondary text. No external font/asset
   dependencies (see --font).

   ---------------------------------------------------------------- RULES
   These are settled. Reach for an existing token before inventing a value;
   a new color should be a considered exception, not a convenience.

     Primary text .......... --ink            white-ish, for names/titles
     Secondary text ........ --ink-soft       blue-gray, for meta lines
     Tertiary text ......... --ink-faint      blue-gray, labels and hints
                                              only – it reads as disabled
                                              on anything that isn't
     Background ............ --bg             #080C16, the app's base
     Card .................. --surface        one step up from the base
     Raised/pressed ........ --surface-2      inputs, chips, press states
     Border ................ --border         subtle blue-gray hairline

     Accent ................ --accent         lime. ACTIONS AND SELECTION
                                              ONLY: buttons, the selected
                                              tab, the active nav item, a
                                              chosen day. Never a passive
                                              label, never decoration.
     Accent (gradient end) . --accent-2       teal. Only ever a gradient
                                              stop paired with --accent
                                              (primary button, tab
                                              underline) – never a flat
                                              fill or text color.

     People (avatars), one rule app-wide – see avatar() in
     js/components.js:
       you ................. --accent        green
       a coach ............. --avatar        gold
       an athlete .......... --avatar-athlete slate

     Status ................ --success / --warn / --danger, and --student
                             (blue) for signals that come from someone else
                             – an unread reply, a shared exercise. Not
                             interchangeable with --accent.

     Badges, one set app-wide (.badge.*), named for meaning, not color:
       .status ............. cyan --success. A lifecycle state the app
                             decided: "Finished". Cyan and not the lime
                             accent precisely because it isn't an action.
       .info ............... blue --student. Something arrived from another
                             person: "New reply", "Shared by Anna".
       .muted .............. grey. A neutral fact with no urgency:
                             "Upcoming", a category, a count.
       .coach .............. gold --avatar, matching a coach's avatar. The
                             only badge that names a person's role.
       .alert .............. red --danger. A state that blocks something:
                             "Full". Rare by design – if it isn't stopping
                             anything, it's .muted.
     There is deliberately no accent-colored badge: a badge is a label, and
     labels don't get the action color.

     Type .................. --text-h1 / -h2 / -h3 / -lg / -md / -sm / -xs /
                             -micro, plus --text-input (never below 16px).
                             Nine steps, and every piece of text is one of
                             them – see the TYPE SCALE block below.

     Radius ................ --radius-lg / -md / -sm
     Elevation ............. --shadow-card / --shadow-pop – on this near
                             black base these are faint WHITE glows; a
                             black shadow is invisible here.
   The app renders this whole system for itself at Profile -> Design system
   (js/views/styleguide.js): every swatch, size and component there is read
   from this file at runtime, so it can't drift out of date the way a
   written spec does.
   ========================================================================== */

:root {
  /* Sampled from the Versus Arena reference: the base isn't a neutral
     near-black but a very dark navy, and every surface above it keeps that
     blue cast. It's the single biggest reason that design reads cooler and
     more "product" than a flat black one. */
  /* ---------------------------------------------------------- TYPE SCALE
     Nine steps, and every piece of text in the app is one of them. Before
     this there were 23 different font sizes in the stylesheet – 12px, 12.5,
     13 and 13.5 all sitting next to each other doing the same job, because
     each was picked in isolation. Nothing moved by more than half a pixel
     when they were collapsed onto this scale; what changed is that the next
     screen has a size to reach for instead of a decision to make.

     A note on the top end: these are smaller than a desktop scale. The app
     is used on a 360px-wide phone, where a 28px heading eats a third of the
     first screen – every step here was tuned against real content on that
     width rather than against a ladder of ratios. */
  --text-micro: 10.5px;   /* uppercase eyebrows: section titles, captions */
  --text-xs: 11px;        /* badges */
  --text-sm: 12.5px;      /* meta lines, hints, secondary text */
  --text-md: 14px;        /* row titles, form labels, buttons */
  --text-lg: 15px;        /* card titles, emphasis inside a row */
  --text-h3: 18px;        /* sheet headers, card headings */
  --text-h2: 19px;        /* a person's name, the daily greeting */
  --text-h1: 22px;        /* screen title, the one number in a stat box */
  /* Anything the user types into. Never below 16px: iOS zooms the whole
     page in when a focused field is smaller than that, and the zoom doesn't
     come back out on its own. */
  --text-input: 16px;

  /* How wide the app shell is allowed to be.
     On a phone: the whole screen. The 430px column below is a DESKTOP
     affordance – a phone layout stretched across a monitor is unreadable –
     but it was applied at every width, so any phone whose CSS viewport is
     wider than 430px got the desktop treatment too: empty bands down both
     sides, with the shell's drop shadow drawing attention to them. That is
     not a rare device. A Pixel 8 Pro reports 448px, and on most Androids
     the user's own display-size setting moves the number: choosing a
     smaller display size makes the CSS viewport wider.
     Five things share this width – the shell, the bottom nav, sheets,
     toasts and the live bar – and they have to agree, so it lives here
     rather than being typed out five times. */
  --app-max: 100%;

  --bg: #080C16;
  --surface: #10141D;
  --surface-2: #191D26;
  --border: #232A38;
  /* Three steps of text, and only three. Primary and secondary are as
     specified; muted is not. #64748B, the value asked for, measures 4.1:1
     on this background and 3.5:1 on a card – under the 4.5:1 that normal
     text has to clear, and this step is worn by 13px and 11px text. #78828F
     is the nearest thing to it that clears 4.5 on BOTH (5.0 on the page,
     4.7 on a card): the same cool grey, one notch up, so the hierarchy is
     the one that was asked for and it is still readable at 11px.
     The old value was #626C7A, i.e. 3.7:1 – so this step gets quieter in
     role and brighter in fact at the same time. */
  --ink: #F5F7FA;
  --ink-soft: #94A3B8;
  --ink-faint: #78828F;

  --accent: #A3E635;       /* primary sporty accent (coach) */
  --accent-dark: #84CC16;  /* deeper variant, used for :active press states */
  --accent-soft: rgba(163, 230, 53, 0.16);
  /* The far end of the lime→teal brand gradient (the same pairing the logo
     uses). Only ever used as a gradient stop, never as a flat fill or text
     color, so it doesn't become a competing accent of its own. */
  --accent-2: #18BD8A;
  --on-accent: var(--bg); /* dark foreground used on top of the bright accent so text/icons stay legible */

  /* Roles the three colors play, kept deliberately separate so two accents
     don't compete: --accent (green) = actions and selection, --avatar
     (muted gold) = people, --ink-soft/--row-desc (blue-grays, further
     down) = secondary information. The gold is deliberately desaturated
     rather than a bright amber – it should read as an identity color, not
     as a second call to action. */
  --avatar: #C9A45C;           /* a coach */
  --avatar-soft: rgba(201, 164, 92, 0.16);
  --avatar-ink: #17120A;       /* dark text on the gold circle, in both themes */
  /* An athlete. Lightened from #55647D, which only reached 2.9:1 against
     the card while the coach's gold reached 7.4 and the "you" green 11.5 –
     a third of the presence of the other two is what made a roster of them
     read as disabled rather than as people. At 6.4 it sits just under the
     gold, so the three still rank you > coach > athlete. Dark initials on
     top, like the other two, so all three read as solid chips. */
  --avatar-athlete: #8E9FB8;
  --avatar-athlete-ink: #131922;
  /* Form placeholders. The browser default (#757575) is both a neutral
     gray in an otherwise blue-gray palette and dim enough to read as
     disabled; this sits at ~4.8:1 on a field – clearly legible guidance,
     still obviously lighter than a filled-in value. */
  --placeholder: #7C8798;

  --student: #4C8DFF;      /* secondary accent (student / replies) */
  --student-soft: rgba(76, 141, 255, 0.16);

  --success: #22D3EE;      /* distinct cyan for "finished" status, kept apart from the green accent */
  --success-soft: rgba(34, 211, 238, 0.16);

  --warn: #FFB648;
  --warn-soft: rgba(255, 182, 72, 0.16);

  --danger: #FF6B5B;
  --danger-soft: rgba(255, 107, 91, 0.16);

  /* A coach's own commitment – not a session, not a status, not a person.
     Violet because it's the one hue left that can't be mistaken for any of
     the five above at 4px, which is the size it usually appears at: a dot
     in a calendar cell. It never means anything else. */
  --personal: #A78BFA;
  --personal-soft: rgba(167, 139, 250, 0.16);

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;

  /* A black drop-shadow is invisible against --bg's near-black (#0A0A0A) –
     a very faint WHITE shadow instead reads as a soft light-blénk lifting
     the card's edge off the background, which is what actually shows up
     here. (The light theme below keeps a black shadow – that direction
     works normally against its light --bg.) */
  --shadow-card: 0px 4px 20px rgba(255, 255, 255, 0.03);
  /* Same reasoning as --shadow-card above, scaled up a bit (bigger blur/
     offset/opacity) since this one's for elements that need to read as
     further "lifted" – the whole phone shell (.app) and the toast pill,
     both of which otherwise sit flush against the equally-near-black page
     behind them. */
  --shadow-pop: 0px 8px 36px rgba(255, 255, 255, 0.05);

  /* No webfont anywhere in this app – the platform's own UI face (SF Pro on
     iOS, Roboto on Android, Segoe UI on Windows). ui-sans-serif is the CSS
     Fonts Level 4 generic and goes first because Safari honours it
     directly; system-ui covers everything else, and the named faces after
     it are fallbacks for browsers predating both. Verified in-browser that
     this stack and a plain "ui-sans-serif, system-ui, sans-serif" render
     identically. */
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --row-title: #e2e8f0;
  --row-desc: #64748b;
  --row-hover-bg: rgba(255, 255, 255, 0.04);
  --row-selected-bg: rgba(163, 230, 53, 0.1);
  --row-selected-text: #a3e635;

  --nav-bg: rgba(8, 12, 22, 0.88); /* the new --bg, kept translucent for the nav's backdrop blur */

  color-scheme: dark;
}

/* ---------- Light theme override – toggled from Profile > Preferences
   (js/theme.js sets data-theme="light"/"dark" on <html> from a localStorage
   preference; this is a device-level UI setting, not account data, so it's
   deliberately not synced through Store/Supabase). Every variable above is
   re-derived rather than just swapping bg/text: the bright lime --accent
   reads fine as a dark-surface fill but fails contrast as text or a
   white-on-accent button against a white page, and the four status colors
   (student/success/warn/danger) are similarly too light to use as text on
   white, so all five get deeper, text-safe shades here (their hue family is
   unchanged, just darker) while --on-accent flips from dark-on-bright to
   white-on-deep to match. ---------- */
:root[data-theme="light"] {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #ECEEF1;
  --border: #DFE2E7;
  --ink: #14171A;
  --ink-soft: #5B6472;
  /* Was #8A93A1, which measured 2.8:1 on this background – the worst
     contrast in either theme, and the same "muted" step as the dark side.
     4.8 on the page, 5.2 on a card. */
  --ink-faint: #616D80;

  --accent: #4D7C0F;
  --accent-dark: #3F6212;
  --accent-soft: rgba(77, 124, 15, 0.14);
  --accent-2: #0F8F68;  /* deeper teal, to stay visible against a white page */
  --on-accent: #FFFFFF;

  /* Deeper gold here so the circle still reads as a filled shape against a
     white page. The ink stays dark rather than flipping to white like
     --on-accent does: white initials on this gold only reach ~3.4:1, while
     the dark ink is ~5.5:1. */
  --avatar: #B08430;
  --avatar-soft: rgba(176, 132, 48, 0.14);
  --avatar-ink: #17120A;
  --avatar-athlete: #5A6980;
  --avatar-athlete-ink: #FFFFFF;
  --placeholder: #767E8B;

  --student: #1D4ED8;
  --student-soft: rgba(29, 78, 216, 0.12);

  --success: #0E7490;
  --success-soft: rgba(14, 116, 144, 0.12);

  --warn: #B45309;
  --warn-soft: rgba(180, 83, 9, 0.12);

  --danger: #B91C1C;
  --danger-soft: rgba(185, 28, 28, 0.12);

  --personal: #6D28D9;
  --personal-soft: rgba(109, 40, 217, 0.12);

  --shadow-card: 0 10px 24px -14px rgba(20, 23, 26, 0.18);
  --shadow-pop: 0 24px 48px -12px rgba(20, 23, 26, 0.22);

  --row-title: #1F2937;
  --row-desc: #5B6472;
  --row-hover-bg: rgba(15, 23, 42, 0.035);
  --row-selected-bg: rgba(77, 124, 15, 0.1);
  --row-selected-text: #3F6212;

  --nav-bg: rgba(255, 255, 255, 0.86);

  color-scheme: light;
}

/* From tablet width up, the app becomes a centred phone-shaped column
   instead of a very wide one. 600px is the boundary because everything
   below it is a phone held in portrait – including the wide ones – and
   nothing below it has room to spare. */
@media (min-width: 600px) {
  :root { --app-max: 430px; }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
/* Overflow (and scrollbar-gutter, below) is set on BODY, not HTML, and HTML
   is deliberately left with no overflow of its own. Per the CSS Overflow
   spec, when the root (html) element has no overflow of its own, the body
   element's overflow is *propagated up to the viewport* – i.e. the page
   keeps scrolling normally, exactly like a page with no special CSS at all.
   Setting these on HTML instead (as an earlier version of this file did)
   defeats that propagation: HTML then handles its own scrolling and BODY
   becomes an independent, separately-scrolling box – which breaks
   `position: sticky`/`fixed` elements' relationship to "the page" (they
   start relating to two different scroll containers) and, worse, means the
   scrollbar-gutter reservation below ends up reserved on the wrong element
   (HTML) while the real scrollbar appears on BODY instead, so it stops
   preventing the exact layout-narrowing shift it's meant to prevent. Keeping
   both rules on BODY (with HTML plain) avoids all of that.
   Always reserving the vertical scrollbar's gutter, even on screens short
   enough that they don't need to scroll, matters because: without it, a
   screen whose content is taller than the viewport (e.g. Profile, with its
   extra rows) is the only one that triggers a scrollbar; on desktop browsers
   that reserve real layout space for scrollbars, that narrows the available
   width just for that screen, nudging the centered .app frame a few pixels
   left compared to every other tab. Reserving the gutter unconditionally
   keeps the centering width identical across all tabs regardless of each
   screen's content height. */
body { overflow-x: hidden; overflow-y: scroll; scrollbar-gutter: stable; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
input, textarea, select {
  font-family: inherit;
  /* Must stay >= 16px: iOS Safari force-zooms the whole page in when a
     smaller-font input/textarea/select is focused, and – since this is a
     single-page app that never does a full navigation between tabs – that
     zoomed-in state can persist after the sheet/search closes and follow the
     user into whichever tab they open next, making it look like that other
     tab's layout is randomly shifted/narrowed. Keeping all form fields at
     16px+ prevents iOS from ever triggering that auto-zoom in the first place. */
  font-size: var(--text-input);
}
a { color: inherit; text-decoration: none; }

/* ---------- Phone shell (keeps a mobile look on desktop, full-bleed on real phones) --- */
.app {
  position: relative;
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-pop);
  overflow-x: hidden;
}
@media (min-width: 431px) {
  /* .app already centers itself via margin: 0 auto + max-width above; this
     media query intentionally does NOT put html/body in flex + justify-content,
     because that turns .app into a flex item with flex-basis: auto, which
     sizes it to its content's intrinsic width instead of the full 430px
     (causing an inconsistent, view-dependent width bug). Plain block-level
     centering is deterministic regardless of what's rendered inside. */
  .app { margin-top: 0; }
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
.screen.no-nav { padding-bottom: 24px; }
/* A screen with a floating button needs the list to be able to scroll clear
   of it. Without this the last card sits under the button even at the very
   bottom of the scroll, which is what makes a FAB read as belonging to that
   card instead of to the screen. 78px for the nav + 56px of button + two
   gaps. */
/* What the floating button reserves so the last row can always be scrolled
   out from under it: its own offset plus its height plus a margin. Recomputed
   when it shrank – a button that reserves more space than it occupies is a
   button that costs a row of content for nothing. */
.screen.has-fab { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: calc(18px + env(safe-area-inset-top)) 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.topbar h1 {
  font-size: var(--text-h1);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.topbar .sub { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 2px; }
/* .topbar is justify-content:space-between, which is right when it holds a
   title and a control – but with only a back button and a title block it
   shoves the title to the right edge. This makes the class the rest of the
   app already uses for "take the slack" work inside a topbar too, rather
   than adding a one-off rule per screen. */
.topbar > .grow { flex: 1; min-width: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
/* Says what kind of screen this is, next to the back arrow – on a detail
   screen the big name below belongs to the person, not to the chrome. */
.topbar-eyebrow {
  flex: 1; min-width: 0;
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* Removed from view but kept for screen readers. Used for the <h1> on the
   Sessions and Calendar tabs, where the visible title only repeated what
   the bottom nav (and, on Sessions, the Upcoming/Finished tabs) already
   say – a sighted user has that context, someone navigating by headings
   would otherwise have none. The topbar itself stays in place even when
   empty: its padding is what carries the safe-area inset at the top of the
   screen, and its sticky background is what content scrolls under. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  flex: none;
}
.icon-btn:active { transform: scale(0.94); }
/* ---------- Hit areas ----------
   Several controls are drawn smaller than a thumb needs. Where the drawing
   is right and only the target is wrong, the target is extended past the
   paint with a pseudo-element rather than by growing the control: nothing
   moves, nothing gets heavier, and a tap aimed a few pixels off still
   lands. 44px is the floor (iOS HIG; Material asks for 48dp, and the ones
   here clear that too where there was room).

   The extensions are deliberately smaller than half the gap to the next
   control, so no button can start swallowing its neighbour's taps. */
/* The avatar in the top bar. No box of its own – the avatar IS the shape,
   and a bordered button around a circle is two shapes for one control. */
.topbar-me { flex: none; background: none; border: 0; padding: 0; position: relative; }
.topbar-me::before { content: ""; position: absolute; inset: -4px; }
.topbar-me:active { opacity: 0.7; }

/* A control that belongs to a section heading rather than to the screen:
   the icon alone, in the heading's own colour, so it reads as part of the
   label rather than as a button parked next to it. */
.heading-action {
  flex: none; background: none; border: 0; padding: 0;
  /* --ink-soft, not the heading's own --ink-faint: the RULES block at the
     top of this file says faint reads as disabled on anything that isn't a
     label or a hint, and this is a button. One step up is still quiet. */
  color: var(--ink-soft); position: relative;
  display: flex; align-items: center;
}
.heading-action::before { content: ""; position: absolute; inset: -14px -14px; }
.heading-action:active { color: var(--ink); }

.icon-btn { position: relative; }
.icon-btn::before { content: ""; position: absolute; inset: -3px; }
/* The per-athlete chat button inside a roster row. Deliberately secondary:
   the row already navigates to the athlete, so this is the one extra
   affordance in it, not the row's headline.
   It was still a 36px filled square with a 12px radius, next to a 40px
   avatar – 90% of the avatar's size, in a tile of its own, so the row had
   two objects of almost equal weight and only one of them was the person
   the row is about. A glyph now, with nothing behind it: the chevron says
   where the row goes, and this is the one thing in the row you can do
   without going there.
   The box stays 36px for layout and the target reaches past it (below), so
   what shrank is the paint, not the thing you aim at. */
.row-chat-btn {
  width: 36px; height: 36px; position: relative; margin-right: 0;
  /* border: none, not border-color: transparent – .icon-btn sets a real 1px
     border, and merely hiding it leaves the box 1px of padding it does not
     use and a rule that reads as "there is a border here, invisibly". */
  background: none; border: none;
  /* One step above the chevron, which is --ink-faint: of the two glyphs at
     the end of the row, this is the one that does something. */
  color: var(--ink-soft);
}
.row-chat-btn:active { color: var(--accent); transform: none; }
.row-chat-btn.has-unread { color: var(--ink); }
/* 36 painted, 46 to a finger. The square used to carry that on its own. */
.row-chat-btn::before { content: ""; position: absolute; inset: -5px; }
/* Tucked in, now that there is no tile for it to sit on the corner of – on
   the bare glyph the old -2px put it out in the row's own space. */
.row-chat-dot {
  position: absolute; top: 1px; right: 3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--student); border: 2px solid var(--surface);
}
.icon-btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.back-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  margin-left: -8px;
  color: var(--ink);
}
.back-btn { position: relative; }
/* 36px painted, and the nearest thing to it is the screen edge on one side
   and a title on the other, so it can take the full 5px all round. */
.back-btn::before { content: ""; position: absolute; inset: -5px; }
.back-btn:active { background: var(--surface-2); }

/* ---------- Content ---------- */
.content { padding: 4px 20px 28px; flex: 1; }
.content.tight { padding-left: 0; padding-right: 0; }

.section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 22px 2px 10px;
}
.section-title:first-child { margin-top: 6px; }
/* A section title sitting directly on .screen misses the 20px that .content
   gives everything else, so it lands 2px from the edge while every heading
   around it lines up with the cards. Fixed once here rather than per
   heading: it had already been patched by hand on .sessions-heading, and
   the next one added (Recent) drifted exactly the same way, because that
   patch was attached to one class instead of to the situation. */
.screen > .section-title { margin-left: 20px; margin-right: 20px; }

/* ---------- Sub tabs (underline segmented control) ----------
   Was two full-width outlined pills, which took ~60px of vertical space and
   carried a lot of visual weight for what is just a filter. Now: labels on
   a hairline rule, with a 2px accent underline marking the selected one –
   the selected state is carried by weight/color/underline instead of a
   filled, bordered button. */
.pill-tabs {
  display: flex;
  margin: 2px 20px 14px;
  border-bottom: 1px solid var(--border);
}
/* The tabs sit directly under the "Sessions" heading, as its control – so
   no extra air between those two, and all the separation goes above the
   heading instead (.sessions-heading below). */
.sessions-heading + .pill-tabs { margin-top: 8px; }
/* The heading carried a create button for a while; it's a floating labelled
   button again (see .fab.fab-labelled), so this row is a plain heading. The
   flex layout stays – it costs nothing and keeps the rule ready if a second
   control ever belongs here. */

/* A count riding on a heading: "Upcoming 5", "Exercises 17".
   Unbracketed, so it needs its own separation from the word instead of
   borrowing a bracket's – and colour alone was not enough, because the digit
   inherited the heading's uppercase tracking and "UPCOMING 5" read as one
   label with an odd gap in it. It drops the tracking (a single digit has
   nothing to track against), takes a step in weight, and takes its space
   explicitly. Colour goes UP rather than down: the word is the label and the
   number is the value, and --ink-faint (what the uppercase headings wear) is
   already the last step that clears 4.5:1.
   No chip around it: a rounded box on these tabs means something you can
   press (see tests/box-audit.js and the RULES block above), and a count is
   not. */
.count {
  margin-left: 8px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.section-title .count { color: var(--ink-soft); font-weight: 600; }
/* On a screen title rather than a section label: the h1 is already --ink, so
   the number steps DOWN to sit beside it instead of shouting over it. */
.topbar h1 .count { color: var(--ink-soft); font-weight: 600; font-size: var(--text-lg); }

.sessions-heading {
  /* The 20px that lines this up with the cards now comes from
     .screen > .section-title, which covers every heading in this position
     rather than this one by name. */
  margin-top: 10px;
  /* The heading and its create button share one row. align-items:center on
     an uppercase 12.5px label next to a 36px button would leave the label
     looking dropped, so the button is what moves: a small negative margin
     keeps the row's height from growing around it. */
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* The seam. Everything above it is "what needs you today"; everything below
   is "what's booked". A rule would be one line too many on a screen that's
   already all cards and labels – 40px of nothing says it just as clearly,
   and the eye reads the gap as a change of subject.
   Only after the briefing: with nothing above it (a brand-new account, where
   the onboarding checklist stands in its place) this heading is the top of
   the screen and needs no run-up. The adjacent-sibling combinator is the
   whole rule – it was briefly lost to a comment inserted between it and its
   selector, which gave every heading the 40px. */
.briefing + .sessions-heading { margin-top: 40px; }
/* Each tab takes an equal share of the row with its label centred, so the
   underline marks a whole column rather than just a word – that's what
   makes it read as one control instead of two separate links. */
.pill-tabs button {
  flex: 1;
  padding: 9px 4px 11px;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}
.pill-tabs button.active { color: var(--ink); font-weight: 700; }
/* Drawn as a pseudo-element rather than a border-bottom so it can carry the
   lime-to-teal brand gradient and rounded ends; bottom: -1px lays it over
   the container's hairline. */
.pill-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}
/* Counts are plain "(n)" in the label's own line rather than filled badges –
   a filled pill on every tab competed with the underline for the job of
   saying which tab is selected. */
.pill-tabs .count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-faint);
}
.pill-tabs button.active .count { color: var(--ink-soft); }

/* ---------- Week strip (athlete's Sessions tab, see weekStripHtml) ----------
   The athlete's replacement for a month grid: one row covering the week
   they actually plan around. A dot marks days with a session in the list
   below, today is ringed, and a selected day filters the list. */
.week-strip {
  display: flex; align-items: center; gap: 2px;
  margin: 0 14px 10px;
}
.week-nav {
  flex: none; width: 28px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); background: transparent; border: none;
}
.week-nav:active { color: var(--ink-soft); }
.week-days { flex: 1; display: flex; }
.week-day {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0 5px;
  background: transparent; border: none; border-radius: 12px;
  color: var(--ink-soft);
}
.week-day-name { font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.04em; color: var(--ink-faint); }
.week-day-num { font-size: var(--text-md); font-weight: 700; font-variant-numeric: tabular-nums; }
/* Always laid out, so days with and without a session line up and the row
   doesn't jump as you move between weeks. */
.week-day-dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.week-day.has-sessions .week-day-dot { background: var(--accent); }
.week-day.is-today .week-day-num { color: var(--accent); }
.week-day.is-selected { background: var(--surface-2); }
.week-day.is-selected .week-day-num,
.week-day.is-selected .week-day-name { color: var(--ink); }
.week-reset {
  display: block; margin: -2px auto 10px;
  background: transparent; border: none;
  font-size: var(--text-sm); font-weight: 600; color: var(--accent);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.045);
}
/* Press feedback, scoped to cards that actually do something. It used to be
   on every .card, so a plain container – the trial banner, a non-clickable
   athlete row – dipped under your finger too and promised a tap that led
   nowhere. The transition only applies on release: pressing snaps in
   immediately (feedback should feel instant), letting go springs back.
   touch-action removes the tap delay, and the app clears the platform's own
   tap highlight globally (see html/body), so this is the only press signal
   there is. */
/* Not just button.card: an athlete row is a <div> carrying data-nav (see
   js/views/students.js), so the selector follows "does this navigate or do
   something" rather than the tag. */
button.card, .card[data-nav], .card[data-action] {
  transition: transform 140ms ease, background-color 140ms ease;
  touch-action: manipulation;
}
button.card:active, .card[data-nav]:active, .card[data-action]:active {
  transform: scale(0.985);
  transition-duration: 0s;
}
.card-list { padding: 0 20px; }

/* Compact 3-line layout (title+time / exercises+location / participants+
   coach) – was 4-5 rows with a lot of unused vertical space, including a
   per-card date that just repeated the day-group-label header above it.
   Tighter row gap and padding here (not on the shared .card rule, which
   other card types like .exercise-card / .student-row also use) so this
   still lets 3-4 sessions show on screen instead of ~2.5. */
/* ---------- The sessions list ----------
   A card per session cost 151px each once its border, its padding, the gap
   to the next card and the day label above it were counted – two and a half
   sessions between the heading and the fold, on the one screen whose whole
   job is "what's coming". The information is unchanged; the box around it
   is gone. A hairline does what the border did and the day label does the
   separating, which is what it was always for.

   Full-bleed with its own 20px of inner padding, so the text lines up with
   every other screen element while a press highlights the whole width – the
   difference between a list and a column of cards. */
.session-row {
  display: flex; flex-direction: column; gap: 3px;
  width: 100%; text-align: left; background: none;
  padding: 9px 20px 10px;
  border: 0; border-radius: 0;
}
/* No rule between two sessions on the same day. A hairline is a boundary,
   and at --border's weight it read as one: two sessions on a Wednesday
   looked like two sections rather than like a Wednesday. The day label is
   the only boundary this list has, and everything under it is one day – so
   the separating within a day is done with air.
   14px between the bands, which is more than twice the 6px inside a row
   between its two lines: enough that the pairs group, little enough that
   they stay one day. */
.session-row + .session-row { margin-top: 14px; }
/* ---------- The date rail (the Upcoming list) ----------
   Which day a session is on was a 10.5px grey label over each run – smaller
   and quieter than the place name inside the rows underneath it, so a list
   of five sessions read as one column with no days in it. The date is now a
   block down the left of the first session of each day: weekday over number,
   the same shape the Calendar tab uses, which is the thing that makes that
   screen scannable. The number is the biggest thing in the rail because a
   numeral is read at a glance where a word has to be read.
   38px wide: fits "Wed" and a two-digit number without wrapping, and leaves
   the titles a common left edge to line up on. */
.session-row.has-rail { flex-direction: row; align-items: flex-start; gap: 12px; }
.session-row.has-rail + .session-row.has-rail { margin-top: 10px; }
.srow-rail { flex: 0 0 38px; text-align: center; padding-top: 1px; }
/* The rest of the day keeps the space, so every title starts in the same
   column; hidden rather than absent. */
.srow-rail.is-ditto { visibility: hidden; }
.srow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rail-wd {
  display: block; font-size: var(--text-micro); font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint);
}
.rail-dn {
  display: block; font-size: var(--text-h3); font-weight: 800; color: var(--ink);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.rail-mo { display: block; font-size: var(--text-micro); font-weight: 700; color: var(--ink-faint); }
/* Today and tomorrow in the accent, on the Sessions tab: that list has no
   other way of saying which day is which. */
.srow-rail.is-soon .rail-wd, .srow-rail.is-soon .rail-dn { color: var(--accent); }
/* Not on the Calendar tab. The grid above it already rings today, so the
   same day was marked twice in two colours on one screen – and the accent
   means "you can press this" everywhere else in the app, which a date in a
   rail cannot. The list is in date order; what is nearest is at the top. */
.cal-agenda .srow-rail.is-soon .rail-wd { color: var(--ink-faint); }
.cal-agenda .srow-rail.is-soon .rail-dn { color: var(--ink); }
/* The day boundary, now that no label is doing it. Full-bleed minus the
   page's 20px, so it reads as a rule across the list rather than a border
   belonging to either row. */
.day-sep { height: 1px; background: var(--border); margin: 18px 20px 8px; }
.session-row:hover { background: var(--row-hover-bg); }
.session-row:active { background: var(--surface-2); }
.srow-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
/* One line, ellipsised. Two lines here would undo the density this row
   exists for, and the full name is one tap away.

   --ink, not --row-title. --row-title is #E2E8F0: a FOURTH grey, sitting
   between primary and secondary, that nothing in the design system declares
   – and it was what every session name on this screen wore. The biggest
   thing in the list was therefore dimmer than the body text around it,
   which is backwards. The token is still there for the tabs this review
   hasn't reached; on this screen a title is primary. */
.srow-title {
  flex: 1; min-width: 0;
  font-size: var(--text-lg); font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The start time, right-aligned so every row's time sits in one column and
   the eye can run down it. Tabular figures so 11:00 and 17:00 are the same
   width.
   Primary colour, like the title, but 500 against the title's 700: the two
   are a pair and the name is the half that leads. At 600 the time carried
   nearly the title's weight, and a row read as two headlines. */
.srow-time {
  flex: none; font-size: var(--text-sm); font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.srow-flags { display: flex; align-items: center; gap: 6px; flex: none; align-self: center; }
.srow-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 0; min-height: 20px;
}
/* Muted, a step below the secondary it used to wear. The venue is the
   third thing you read on a row, after the name and the time, and it is the
   one the eye is allowed to skip. */
.srow-place {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0;
  font-size: var(--text-xs); font-weight: 500; color: var(--ink-faint);
}
.srow-place svg { flex: none; }
/* The inner span is what truncates – an inline-flex box with an icon in it
   can't render an ellipsis on its own. */
.srow-place > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-who { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
/* Smaller than the app's default avatar: at 28px they outweighed the
   session's own name on the line above. 22px, and four of them plus the
   overflow circle come to 94px – which still leaves the venue more than
   half the row at 320px. */
.srow-who .avatar { width: 24px; height: 24px; font-size: 9px; }
/* The ring is the page colour, so it reads as the gap between two faces
   rather than as a border round each one.
   Two spacings, because the two kinds of avatar want different ones. A
   stack of photos overlaps properly – that is what makes a row of circles
   read as one group. A stack of initials can't: two capitals measure 22px
   inside a 24px circle, so anything past a couple of pixels covers the
   second letter and "WN" reads as "WI". See avatarStack() in
   js/components.js for where the class comes from. */
.srow-who .avatar-stack .avatar { border-width: 1.5px; border-color: var(--bg); margin-left: -2px; }
.srow-who .avatar-stack.is-photos .avatar,
.srow-who .avatar-stack.is-photos + .avatar-more { margin-left: -8px; }
.srow-who .avatar-stack .avatar:first-child,
.srow-who .avatar-stack.is-photos .avatar:first-child { margin-left: 0; }
/* The overflow circle is not a person and not an action: neutral fill, a
   thin border, the same size as a face. Green would make it read as
   something to press – the accent means actions, and this is a count. */
.srow-who .avatar-more {
  width: 24px; height: 24px; font-size: 10px;
  margin-left: -2px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-soft);
}
/* A session that's over, in a list of ones that aren't: the same row, one
   step back. */
.session-row.is-finished .srow-title { color: var(--ink-soft); }
.session-row.is-finished .srow-time { color: var(--ink-faint); }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -4px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2);
  color: var(--ink-soft); font-size: var(--text-xs); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-left: -8px; border: 2px solid var(--surface);
}

/* Avatar color carries one meaning app-wide (see avatar() in
   js/components.js for which class is applied when):
     default    – an athlete (slate)
     .is-coach  – a coach (gold)
     .is-me     – you, the signed-in user (accent green) */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: 800; flex: none;
  background: var(--avatar-athlete);
  color: var(--avatar-athlete-ink);
}
.avatar.is-coach { background: var(--avatar); color: var(--avatar-ink); }
.avatar.is-me { background: var(--accent); color: var(--on-accent); }
/* .lg is the identity avatar at the top of a person's screen – your own
   Profile and an athlete's page – and nowhere else. At 52px it was only
   10px shy of the three-line text block beside it, so the row read as a
   slightly tall list item rather than as the header of the screen. 64px
   matches the text block's height (65px with the name at h1), which is what
   makes the two halves read as one object instead of two. */
.avatar.lg { width: 64px; height: 64px; font-size: 22px; border-radius: 50%; }
.avatar.md { width: 40px; height: 40px; font-size: 14px; border-radius: 50%; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.avatar-edit-wrap { position: relative; flex: none; }
.avatar-edit-badge {
  position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
/* 22px is the size the badge should LOOK – a dot on the rim of a photo, not
   a button competing with it – but it was also the size it could be hit at,
   and it is the only way to change your profile picture. The pseudo-element
   takes the hit area to 44px without moving a pixel of the drawing. It has
   to stay behind the avatar's own stacking, hence no z-index: the wrap is
   position:relative and the badge comes after the avatar in source order,
   so the extension already sits above the circle and below nothing.
   -13 and not -11: `inset` on an absolutely positioned child resolves
   against the containing block's PADDING box, and the badge's 2px ring is a
   border, so the box being grown is 18px wide, not 22. -11 measured 39px
   across, which is the sort of four-pixel shortfall that only ever shows up
   in a measurement. */
.avatar-edit-badge::before { content: ""; position: absolute; inset: -13px; border-radius: 50%; }

.feedback-dot-row { display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.coach { background: var(--accent); }
.dot.student { background: var(--student); }
.dot.ring { box-shadow: 0 0 0 3px currentColor; opacity: 0.35; }

/* Small chat-icon badge shown on a session card when there are unread team
   chat messages – deliberately distinct from the feedback dot above, so you
   can tell at a glance which kind of new message is waiting. */
.card-chat-badge { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; flex: none; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-soft);
}
/* Directly under the month grid the generous padding above works against
   it: the empty state stops reading as "this month is empty" and starts
   looking like a second, unrelated section floating in the middle of the
   screen. Everywhere else an empty state IS the whole screen's content, so
   the roomier default stays. */
.cal-grid + .empty-state { padding-top: 28px; }
.empty-state .emoji-badge {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.empty-state h3 { color: var(--ink); font-size: var(--text-lg); margin: 0 0 6px; }
.empty-state p { font-size: var(--text-md); margin: 0; line-height: 1.5; }
/* Wraps and centres, so an empty state can offer two ways out (do the
   thing / go back to the wider list) without them colliding on a narrow
   screen. */
.empty-state-action { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 800;
  font-size: var(--text-lg);
  width: 100%;
}
/* The reference's primary button runs the same lime→teal gradient as the
   tab underline (sampled: #9FE538 → #20BE79, i.e. our --accent →
   --accent-2), which is what ties the CTA to the brand mark. */
.btn.primary {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--on-accent);
}
.btn.primary:active { background: linear-gradient(100deg, var(--accent-dark) 0%, var(--accent-2) 100%); }
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink-soft); }
.btn.outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--border); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
/* 36px painted. Same treatment as the floating button, which is the same
   size: the paint stays small and quiet, the target clears 44. */
.btn.sm { padding: 9px 14px; font-size: var(--text-md); border-radius: 11px; width: auto; position: relative; }
.btn.sm::before { content: ""; position: absolute; inset: -8px -2px; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
/* Sign out: the quietest thing on the Profile tab, and the only one that
   cannot be undone.
   It was .btn.outline.logout-btn – a full-width surface with a 1.5px border,
   the most button-shaped object on a screen made of unboxed rows. Drawn like
   that it competed with the settings above it for a press nobody opens the
   tab to make. Bare words in the same grey as a value, last on the screen,
   is the whole treatment: no fill, no border, no glyph.
   The 44px floor is on min-height rather than on padding so the target does
   not depend on the line box, and the red is on :active only – which is also
   why there is no :hover rule. A colour that means "this is destructive"
   arriving under a passing mouse pointer is the opposite of what it is for. */
.signout-btn {
  display: block; width: 100%; min-height: 44px;
  background: none; border: none; padding: 10px 20px;
  font-family: var(--font); font-size: var(--text-md); font-weight: 600;
  color: var(--ink-faint); text-align: center; cursor: pointer;
  border-radius: var(--radius-lg);
  margin-top: 26px;
  /* The affordance, and the reason the colour could go down a step rather
     than up. Alone in whitespace, bare text reads as a label – which is the
     same problem "Forgot your password?" has on the login screen, and there
     the app answers it with colour (.link-btn is accent at 700). That answer
     is not available here: lime is the app's go-ahead, and this is the one
     thing on the tab you cannot undo. An underline says "press me" without
     spending any colour at all, so the two halves of "quieter, and more
     obviously pressable" stop pulling against each other.
     Offset and thickness set explicitly: the browser default sits on the
     baseline and cuts the descender of the g. */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
/* --ink-faint, not --ink-soft: one step quieter than a row's value, which is
   right for something nobody opens this tab to do. The size did not move
   with it – at 14px it is already the smallest thing here that is not a
   label, and it has no box, no glyph and no weight left to give. */
.signout-btn:active { color: var(--danger); background: var(--danger-soft); }

.fab {
  position: fixed;
  /* Fixed to the viewport, but the app is a centred column on anything
     wide enough – so a plain "right: 20px" glued the button to the window's
     edge and left it floating 262px away from the app on a 1024px screen.
     This keeps it 20px inside the column's right edge at any width.
     Derived from --app-max rather than from a hard-coded 215px, so it
     follows the shell instead of having to be remembered separately: at
     --app-max 100% the two percentages cancel and it comes out as a plain
     20px inset, which is what a phone wants. */
  right: max(20px, calc(50% - var(--app-max) / 2 + 20px));
  /* Sits clear of the nav rather than just above it: 48px of background
     between the two, so they read as two things and not as one cluster in
     the corner. The nav is 52px tall, so this is roughly a nav's height of
     air – enough that the eye separates them at a glance. */
  bottom: calc(100px + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  /* Kept as a lift, not a glow: a floating button does need to read as
     raised off the page, but at the old 0.5 alpha the lime halo was the
     brightest thing on the screen. Roughly half the strength and a tighter
     blur keeps the elevation without the neon. */
  box-shadow: 0 6px 16px -8px rgba(163, 230, 53, 0.18);
  z-index: 25;
}
.fab:active { transform: scale(0.94); }
/* A floating button that says what it does. It claimed to be shaped like
   .btn.primary.sm and wasn't – it carried 12px/18px of padding against that
   button's 9px/14px and a 16px radius against its 11px, which made the one
   permanently-floating control on the screen the largest button in the app.
   Now it IS those metrics: same gradient, same weight, same size as the
   small primary button it borrows from. Auto width – the label sets it, and
   the button still ends 20px inside the column's right edge. */
.fab.fab-labelled {
  width: auto; height: auto;
  /* Trimmed from 9px/14px – about 13% off, and most of it horizontal, where
     the button reads as widest. Worth knowing what padding can do here: of
     the 148px it was, 98 was the words, 22 the icon and its gap, and 28 the
     padding. So this takes 4px off the width and 2 off the height; the
     label is what makes the button wide, not the box around it. */
  padding: 8px 12px;
  gap: 5px;
  border-radius: 11px;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  font-size: var(--text-md); font-weight: 800;
  white-space: nowrap;
}
/* Sized here rather than at each call site: four screens render this button
   and they were passing 19, 17 and 16 to Icon(). */
.fab.fab-labelled svg { width: 16px; height: 16px; }
/* Smaller to look at, not smaller to hit. At .btn.sm's metrics the button
   comes out 34px tall, and a thumb needs 44. This extends the touchable
   area past the paint on every side without changing what is drawn – the
   button reads as quiet and still catches a tap aimed slightly high. */
.fab.fab-labelled::before {
  content: ""; position: absolute; inset: -7px -5px;
  border-radius: 16px;
}
.fab.fab-labelled:active { background: linear-gradient(100deg, var(--accent-dark) 0%, var(--accent-2) 100%); }
.app-frame-anchor { position: absolute; inset: 0; pointer-events: none; }

/* ---------- Bottom nav ---------- */
/* `position: fixed`, not `sticky`, and this is deliberate – .app has
   `overflow-x: hidden` (needed to clip wide content at the phone-frame's
   edge), and per the CSS overflow spec, setting only one axis to a
   non-visible value forces the OTHER axis's computed value to `auto` too –
   so .app is unavoidably a scroll container from the browser's point of
   view, even though it never actually scrolls internally (its box has no
   fixed height, so it just grows to fit its content instead of clipping
   it). `position: sticky` computes its "stuck" offset relative to the
   nearest such scroll-container ancestor – which would be .app here, not
   the real viewport – so a sticky nav ends up just scrolling away with
   everything else instead of sticking (confirmed by testing: swapping this
   to sticky made the nav, and even the existing sticky .topbar, drift off
   during scroll instead of staying put). `fixed` doesn't have this problem:
   its containing block is the viewport regardless of any ancestor's
   overflow, only a transform/filter/perspective/will-change on an ancestor
   would change that, and .app has none of those. Centering is handled by
   `left: 0; right: 0; margin: 0 auto;` instead of the old `left: 50%;
   transform: translateX(-50%)` – both resolve against the same viewport
   width, so this is a cosmetic-only change; kept mainly because it's easier
   to reason about alongside `max-width`. What actually keeps this aligned
   with .app's centering (see the body/html comment above) is making sure
   the real scrollbar's gutter is reserved on the same element (body) that
   the browser propagates viewport scrolling to. */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  /* Slimmed down: the nav is orientation, not content, so it shouldn't own
     this much of a phone screen. Icons are a step smaller (20px, set in
     renderBottomNav) and the padding is tighter top and bottom. */
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  z-index: 30;
}
.bottom-nav button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 2px 3px;
  /* 41px painted inside a 52px bar. The extension reaches into the bar's
     own padding – space that already belongs to the tab visually – so all
     five items are 45px to a thumb without the bar growing. */
  /* Inactive items sat at --ink-faint, which was dim enough to read as
     disabled; --ink-soft keeps the active green clearly dominant while
     still leaving the other four legible. */
  color: var(--ink-soft);
  font-size: var(--text-micro);
  font-weight: 600;
  position: relative;
}
.bottom-nav button::before { content: ""; position: absolute; inset: -5px 0; }
.bottom-nav button.active { color: var(--accent); font-weight: 700; }
.bottom-nav button .nav-badge {
  position: absolute;
  top: 0; right: calc(50% - 18px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--student);
  border: 2px solid var(--bg);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em;
}
/* Scoped to the element, not to `.field input`, which is how it used to be
   written. A field inside a labelled .field wrapper got the app's look and
   a field anywhere else got the browser's: square corners, a grey box and a
   native inset bevel. That's what happened to the "invite someone by email"
   box, and nothing caught it, because an ugly control is still a correctly
   sized one – it doesn't overflow, clip or misalign, so every test passed.
   Owning the element means the next input added is right by default.
   Everything that is deliberately bare (the search bars, the duration box,
   the coach note under an exercise) sets its own border/background through
   a class, which outranks this. */
input[type=text],
input[type=email],
input[type=number],
input[type=search],
input[type=tel],
input[type=date],
input[type=time],
input[type=url],
input[type=password],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-input); /* see the note on --text-input */
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.4; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
/* The session's name is the first thing asked for and the thing every
   later screen shows – it gets a size step over the other fields so the
   form has an obvious starting point. (16px is the floor for any input:
   below that iOS zooms the page on focus.) */
#sf-title { font-size: var(--text-h3); font-weight: 600; }

/* A set of fields that answer one question together (date + start + end),
   grouped under a single section title instead of reading as three
   unrelated inputs. */
/* A value shown in a field's place that is not a control: the sign-in email
   on Profile -> Personal information. Deliberately NOT a disabled input –
   a greyed-out box with a border says "this could be switched on", which is
   a promise the screen cannot keep (changing a Supabase Auth address is a
   confirmation-mail flow, not a settings row). Plain text, with a .hint
   under it saying so.
   --text-input here is matched to the editable field above it, not because
   the 16px floor applies to a div: an email one step smaller than the name
   above it would read as the lesser fact, and it is the one you sign in
   with. */
.readonly-value {
  font-size: var(--text-input); color: var(--ink);
  padding: 2px 0; overflow-wrap: anywhere; line-height: 1.35;
}

.field-group { margin-bottom: 16px; }
.field-group > .field { margin-bottom: 10px; }
.field-group > .field:last-child,
.field-group > .field-row:last-child { margin-bottom: 0; }
.field-group .field-row .field { margin-bottom: 0; }

/* Location suggestions, built from the coach's own past venues (see
   wireLocationAutocomplete in js/views/sessions.js). */
.autocomplete-field { position: relative; }
.autocomplete-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
  margin-top: 4px; padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-pop);
  max-height: 210px; overflow-y: auto;
}
.autocomplete-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 10px;
  border-radius: 9px;
  font-size: var(--text-md); color: var(--ink); text-align: left;
}
.autocomplete-item svg { color: var(--ink-faint); flex: none; }
.autocomplete-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete-item:hover, .autocomplete-item:active { background: var(--row-hover-bg); }
/* Two fields side by side – dates, times – that stack when they can't both
   fit. A native date input has a wide minimum of its own (the browser draws
   yyyy-mm-dd inside it), so two of them on one 320px row pushed 70px past
   the sheet. flex-basis lets them sit together whenever there's room and
   drop to one per line when there isn't; min-width:0 is what lets a flex
   item shrink below that intrinsic width at all. */
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 150px; min-width: 0; }
.field-row .field input { width: 100%; min-width: 0; }
.hint { font-size: var(--text-sm); color: var(--ink-faint); margin-top: 5px; }

/* A single required checkbox with its label, e.g. the "I'm 18+" confirmation
   on the signup form (js/views/login.js) – deliberately plainer than the
   text/email/password fields above (no card background, no border) since
   it's one inline statement to agree to, not a data-entry field. */
.checkbox-field label {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: var(--text-md); line-height: 1.4; font-weight: 600;
  text-transform: none; letter-spacing: normal; margin-bottom: 0;
  color: var(--ink); cursor: pointer;
}
.checkbox-field input[type=checkbox] {
  flex: none; width: 19px; height: 19px; margin-top: 1px;
  accent-color: var(--accent); cursor: pointer;
}

.toggle-field-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toggle-field .hint { max-width: 46ch; }

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface);
}
.stepper-value { flex: 1; font-size: var(--text-input); color: var(--ink); font-weight: 600; }
.stepper-controls { display: flex; align-items: center; gap: 8px; flex: none; }
/* Two round buttons rather than two glyphs with a rule between them: the
   divider read as a separator, which made the pair look like one control
   split in half instead of "minus here, plus there". These also give a
   36px target each, where the bare icons were barely 20px. */
.stepper-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
}
.stepper-btn:active { background: var(--accent-soft); border-color: var(--accent); }
.stepper-btn:disabled { color: var(--ink-faint); background: transparent; cursor: default; }
.stepper-btn:disabled:active { background: transparent; border-color: var(--border); }

.password-field-wrap { position: relative; }
.password-field-wrap input[type=password],
.password-field-wrap input[type=text] { padding-right: 44px; }
.password-toggle-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.password-toggle-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }

.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 13px; border-radius: 20px; font-size: var(--text-md); font-weight: 700;
  background: var(--surface-2); color: var(--ink-soft); border: 1.5px solid transparent;
  display: flex; align-items: center; gap: 6px;
}
.chip.selected { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.chip.removable { padding-right: 8px; }

/* A row of chips that does not fit has to say so, and a scrollbar is not
   how a phone says it.
   The 20px gutter lives INSIDE the scroller now (padding, not margin), which
   moves two things: a chip is cut at the edge of the screen rather than 20px
   in, where the cut lined up with nothing and read as a layout that had not
   quite fitted; and the first and last chips still park 20px in when the row
   is scrolled to either end.
   The cut edge then fades, on whichever side actually has more behind it –
   see syncChipFades in js/components.js, which sets these two variables. A
   hard clip at an arbitrary point looks broken; the same clip under a
   gradient reads as "there is more this way", and at the end of the row the
   fade is 0 and the last chip is as crisp as the rest. */
.filter-chip-bar {
  --fade-start: 0px;
  --fade-end: 0px;
  display: flex; gap: 8px; margin: 4px 0 16px; overflow-x: auto;
  padding: 0 20px 2px; scrollbar-width: none;
  /* One gradient, two variables, rather than two masks composited – the
     compositing operators for that are still spelled differently in
     different browsers. */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0, #000 var(--fade-start),
    #000 calc(100% - var(--fade-end)), transparent 100%);
  mask-image: linear-gradient(to right,
    transparent 0, #000 var(--fade-start),
    #000 calc(100% - var(--fade-end)), transparent 100%);
  /* Momentum on iOS, and the row cannot be left resting between two chips. */
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-left: 20px;
}
.filter-chip-bar::-webkit-scrollbar { display: none; }
.filter-chip-bar .chip { flex: none; white-space: nowrap; cursor: pointer; scroll-snap-align: start; }

/* The "More settings" disclosure on a duplicated session. Quiet: what's
   behind it was already decided by the session being copied. */
.form-more-btn {
  display: flex; align-items: center; gap: 7px; width: 100%;
  margin-top: 16px; padding: 12px 0;
  color: var(--ink-soft); font-size: var(--text-md); font-weight: 600;
  border-top: 1px solid var(--border);
}
.form-more-btn svg { transition: transform 0.18s ease; flex: none; }
.form-more-btn.is-open svg { transform: rotate(180deg); }
/* Neither part wraps mid-phrase, and neither gets truncated: the summary is
   the only thing that says what's set while the section is closed, and
   ellipsis ate the word that carried it – "no limit · chat…" is worse than
   useless, it looks like an answer. So when the two don't fit on one line
   the summary drops to its own line instead, still right-aligned. Both were
   bare text nodes in one flex row before, free to break anywhere. */
.form-more-btn { flex-wrap: wrap; }
.form-more-label { flex: none; white-space: nowrap; }
.form-more-summary {
  margin-left: auto;
  font-size: var(--text-sm); font-weight: 500; color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- Session form: chosen exercises with a per-exercise duration ---------- */
/* No box around the rows. This list sits inside a form that is already
   inside a sheet, so a bordered container made it a card in a card in a
   card – the nesting the session page just shed. Rows with a hairline
   between them say the same thing and say it once. */
.ex-duration-list { display: flex; flex-direction: column; }
.ex-duration-row, .ex-add-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  touch-action: pan-y;
}
/* The name on the first line, the time on the second. */
.ex-row-top { display: flex; align-items: center; gap: 8px; }
.ex-row-top .plan-num { margin-left: -2px; }
/* Indented to the exercise name above it (handle 26 + gap 8 + number 22 +
   gap 8 = 64), not to the number column – the time belongs to the name, and
   starting it two columns left made the second line look like a row of its
   own that had slipped. Less the stepper's own 2px of optical inset. */
.ex-row-time { display: flex; align-items: center; gap: 10px; padding-left: 62px; }
.ex-row-time .stepper-btn { width: 34px; height: 34px; flex: none; }
.ex-duration-list > *:last-child { border-bottom: none; }
.ex-duration-row.dragging {
  position: relative; z-index: 5; background: var(--surface);
  /* Was a flat black shadow – reuses --shadow-pop instead so it "pops" off
     the other rows correctly in both themes (a black shadow barely showed
     in dark mode, same underlying issue as the session cards). */
  box-shadow: var(--shadow-pop);
}
.ex-add-row { width: 100%; flex-direction: row; align-items: center; justify-content: flex-start; border-bottom: none; padding-top: 14px; }
.ex-add-row .ex-add-row-label {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-md); font-weight: 600; color: var(--ink-soft);
}
.ex-add-row:hover { background: rgba(255, 255, 255, 0.03); }
.ex-add-row:hover .ex-add-row-label, .ex-add-row:active .ex-add-row-label { color: var(--ink); }
.ex-drag-handle {
  width: 26px; height: 34px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
  cursor: grab; touch-action: none;
}
.ex-drag-handle:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.ex-drag-handle:active, .ex-duration-row.dragging .ex-drag-handle { cursor: grabbing; }
/* Semibold, not bold: in a list of five rows where the name, the number and
   the unit were all heavy, nothing stood out and the block read as a solid
   slab. The name leads at 600, the duration follows at 500, the unit is
   secondary – same information, a third of the weight. */
/* Up to two lines: the duration control is a fixed width, so on a 360px
   screen a single line cut real exercise names ("Passing Technique in
   Pairs") after about 14 characters. Short names – the common case – still
   take one line, so the list doesn't grow for them. */
.ex-duration-row .ex-duration-title {
  flex: 1; min-width: 0; font-size: var(--text-md); font-weight: 600; color: var(--ink); line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* The box is the control: input and unit share one border, so "10 min"
   reads as a duration instead of a number with a label stuck to it. */
.ex-duration-input-wrap {
  display: flex; align-items: center; gap: 3px; flex: none;
  padding: 6px 10px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: text;
}
.ex-duration-input-wrap:focus-within { border-color: var(--accent); }
/* 16px like every other field, for the same iOS reason – and 30px wide,
   because three digits at 16px no longer fit the 26px the 14px version
   needed. */
/* Selector carries the wrap so it outranks the element-level input styling
   (`input[type="number"]` is more specific than a bare class): without it
   the field drew its own bordered box inside the wrap's box, which is the
   card-inside-card this list was rebuilt to get rid of. */
.ex-duration-input-wrap input.ex-duration-input {
  width: 30px; text-align: right; padding: 0; border: 0; background: none;
  border-radius: 0; box-shadow: none; min-height: 0; height: auto;
  color: var(--ink); font-weight: 500; font-size: var(--text-input);
  -moz-appearance: textfield; appearance: textfield;
}
/* The spinners doubled the control's width and were unusable at this size. */
.ex-duration-input::-webkit-outer-spin-button,
.ex-duration-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ex-duration-input:focus { outline: none; }
.ex-duration-unit { font-size: var(--text-sm); color: var(--ink-soft); font-weight: 500; }
.ex-duration-row .remove-btn {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.ex-duration-row .remove-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
/* The one summed number in the form, so it gets the weight – but in --ink,
   not the accent: the RULES block at the top of this file reserves lime for
   actions and selection, and a total is neither. Size and weight do the
   emphasis instead, which also survives the light theme unchanged. */
.ex-duration-total {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-sm); color: var(--ink-soft); font-weight: 500; margin-top: 8px; padding: 0 2px;
}
.ex-duration-total strong { color: var(--ink); font-size: var(--text-lg); font-weight: 800; letter-spacing: -0.01em; }
.ex-duration-empty-hint { font-size: var(--text-sm); color: var(--ink-faint); padding: 2px; }

/* ---------- Session form: chosen athletes / pending invites ---------- */
/* Unboxed, like the exercise list right above it. These two lists sit one
   under the other inside a sheet that is already a surface, and giving each
   of them its own bordered card was the "card inside card" the form was
   rebuilt to lose: the rows are separated by a hairline and nothing else,
   and the section title above does the work the border was doing. */
.participant-list { display: flex; flex-direction: column; }
.participant-list > *:last-child { border-bottom: none; }
.participant-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
}
/* A pending invite keeps its tint, but as a band across the row rather than
   a filled panel inside a panel – it still has to read as "not confirmed
   yet" at a glance. */
.participant-row.invited { background: var(--warn-soft); padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.participant-name {
  /* 600, matching .ex-duration-title – the two lists sit next to each other
     in the form and read as one family of rows. */
  flex: 1; min-width: 0; font-size: var(--text-md); font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.participant-row.invited .participant-name { color: var(--warn); }
/* The collapsed "invite by email" trigger: a quiet secondary route sitting
   under the athlete list, not a form field of its own. */
/* One step down from the 28px default, matching the session card's stack. */
.participant-row .avatar { width: 24px; height: 24px; font-size: 10px; }
.participant-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Under an invitation: where it stands. Quiet, so the name stays the row. */
.participant-sub { display: block; font-size: var(--text-sm); font-weight: 400; color: var(--ink-soft); }
.student-row.is-declined .name { color: var(--ink-soft); }
.participant-row .remove-btn {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.participant-row .remove-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }

/* ---------- Modal / sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  z-index: 90; display: flex; align-items: flex-end;
  animation: fadeIn 0.15s ease;
}
.sheet-backdrop.center { align-items: center; padding: 20px; }
.sheet {
  background: var(--bg);
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  max-height: 92vh;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  animation: slideUp 0.22s cubic-bezier(.32,.72,0,1);
  /* Deliberately no bottom padding: a sticky footer's bottom:0 resolves
     against the scrollport's padding box, so any padding here would park
     the footer that far above the sheet's edge and let the form scroll
     through the gap underneath it. The spacing lives on .sheet-body (and
     inside .sheet-footer) instead, which covers footer-less sheets too. */
  border-top: 1px solid var(--border);
}
.sheet-backdrop.center .sheet {
  border-radius: 22px;
  max-height: 86vh;
  border: 1px solid var(--border);
}
.sheet-handle { display: flex; justify-content: center; padding: 10px 0 2px; }
.sheet-handle span { width: 36px; height: 4px; border-radius: 3px; background: var(--border); }
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 20px 14px;
}
.sheet-header h2 { font-size: var(--text-h3); margin: 0; font-weight: 800; color: var(--ink); }
.sheet-body { padding: 0 20px calc(24px + env(safe-area-inset-bottom)); }

/* A labelled row in an action sheet (UI.actionSheet) – the answer to "what
   does this header icon do" is words, not a better glyph. */
.action-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: 14px; background: var(--surface-2); margin-bottom: 8px;
}
.action-row:active { background: var(--border); }
.action-row-icon { color: var(--ink-soft); display: flex; padding-top: 1px; flex: none; }
.action-row-label { display: block; font-size: var(--text-md); font-weight: 700; color: var(--ink); }
.action-row-desc { display: block; font-size: var(--text-sm); line-height: 1.4; color: var(--ink-soft); margin-top: 2px; }
.action-row.danger .action-row-icon, .action-row.danger .action-row-label { color: var(--danger); }
/* Sticky to the bottom of the sheet's own scroll area. The footer used to
   be the last block in a long scrolling form, so on the session form –
   name, date, time, location, exercises, athletes, cap, invite, chat – the
   only way to reach "Create session" was to scroll past all of it. Now
   it's on screen from the moment the sheet opens. Short sheets are
   unaffected: sticky does nothing when the content already fits. */
.sheet-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  /* Roomier than the 12px it had: the button was nearly flush with the
     hairline above it and with the bottom edge of the screen, which on a
     phone with a home indicator means it sits right on top of the system
     gesture area. 16px all round, plus the inset. */
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  display: flex; gap: 10px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
/* A footer with two actions of different weight (e.g. "New exercise" next to
   "Done"): the label keeps its own line. Wrapping a button's text is how a
   footer turns from two buttons into two paragraphs. */
.sheet-footer .btn { white-space: nowrap; }

/* Overlay-thin scrollbars. Phones hide theirs automatically, but on a
   desktop browser the sheet's scrollbar sat as a bright bar down the side
   of the form, competing with the content it belonged to. */
.sheet, body { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sheet::-webkit-scrollbar, body::-webkit-scrollbar { width: 8px; }
.sheet::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background: transparent; }
.sheet::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 4px;
  border: 2px solid transparent; background-clip: content-box;
}
.sheet::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: content-box; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-max); z-index: 200;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
  padding-top: calc(14px + env(safe-area-inset-top));
}
.toast {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 11px 18px;
  border-radius: 30px;
  font-size: var(--text-md);
  font-weight: 700;
  margin-top: 8px;
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center; gap: 8px;
  /* Longer messages (e.g. a raw database error) wrap into a multi-line
     pill instead of stretching edge-to-edge or overflowing; short ones are
     unaffected since they never approach this width. Clickable to dismiss
     early – .toast-root above has pointer-events:none so clicks reach the
     app underneath, this re-enables them just for the bubble itself. */
  max-width: calc(100% - 40px);
  pointer-events: auto;
  cursor: pointer;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { transform: translateY(-14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
/* Long/technical toasts (e.g. a raw error) don't auto-dismiss and carry a
   copy + close button, so the whole bubble isn't a click-to-dismiss target
   the way short ones are – only their own close button dismisses them, and
   the text itself can be selected/copied without the toast disappearing. */
.toast.toast-long { cursor: auto; align-items: flex-start; border-radius: 16px; }
/* min-width and overflow-wrap, because these messages carry things with no
   spaces in them – a file path, a table name, a URL. One unbreakable token
   is wider than the text column at 320px, and since a flex item won't
   shrink below its longest word by default, it pushed the close button off
   the edge instead of wrapping. */
.toast.toast-long span {
  flex: 1; min-width: 0; overflow-wrap: anywhere;
  font-weight: 600; line-height: 1.4; user-select: text; cursor: text;
}
.toast-copy, .toast-close {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; color: var(--ink-soft);
}
.toast-copy:hover, .toast-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }

/* ---------- Badges ---------- */
/* Three badges, named for what they mean rather than what color they are –
   the old set was .orange (actually lime), .green (actually cyan), .blue and
   .gray, which is how "Upcoming" ended up wearing the action color on one
   screen and grey on another. See the RULES block at the top of this file. */
.badge { font-size: var(--text-xs); font-weight: 800; padding: 3px 9px; border-radius: 20px; }
.badge.status { background: var(--success-soft); color: var(--success); }   /* lifecycle: Finished */
.badge.info { background: var(--student-soft); color: var(--student); }     /* from someone else: New reply, Shared by */
.badge.muted { background: var(--surface-2); color: var(--ink-soft); }      /* neutral fact: Upcoming, a category, a count */
.badge.coach { background: var(--avatar-soft); color: var(--avatar); }      /* the one person badge, same gold as a coach avatar */
.badge.alert { background: var(--danger-soft); color: var(--danger); }     /* a state that blocks something: Full */

/* ---------- Exercise bank ---------- */
/* ---------- Session detail: "who's coming" summary under the header ----------
   Deliberately not a card: it's a line of the header, one step above the
   join code and the sections, and a card here would read as a third block
   of content before the exercises even start. */
/* ---------- First-run checklist (js/onboarding.js) ----------
   Card, not a screen: a welcome page that has to be dismissed before you
   can see the app teaches nothing, because there's nothing to look at
   behind it yet. This sits where the day's work will eventually be, and
   leaves when the three steps are done. */
.onboard-card {
  margin: 4px 20px 6px; padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.onboard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.onboard-head h2 { margin: 0; font-size: var(--text-h3); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.onboard-skip { background: none; border: none; font-size: var(--text-sm); font-weight: 700; color: var(--ink-faint); padding: 2px 0; }
.onboard-skip:active { color: var(--ink-soft); }
.onboard-sub { margin: 4px 0 14px; font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.45; }
.onboard-steps { display: flex; flex-direction: column; gap: 8px; }
.onboard-step {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid transparent;
}
.onboard-step.is-actionable:active { border-color: var(--accent); }
.onboard-step .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onboard-step-label { font-size: var(--text-md); font-weight: 700; color: var(--ink); }
.onboard-step-hint { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 1px; line-height: 1.35; }
/* The number is the step's own marker, so it becomes the tick when done –
   one slot, one meaning, and the row visibly changes state in place. */
.onboard-num {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 800;
  background: var(--bg); color: var(--ink-soft); border: 1px solid var(--border);
}
.onboard-step.is-done { background: none; border-color: var(--border); }
.onboard-step.is-done .onboard-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.onboard-step.is-done .onboard-step-label { color: var(--ink-soft); }
.onboard-step.is-done .onboard-step-hint { display: none; }

/* ---------- Daily briefing on top of the Sessions tab ----------
   The section titles and the attention list carry their own 20px side
   margins because the list they sit in is a .content.tight (no padding of
   its own, so the cards inside can set their own). */
.topbar-greeting { font-size: var(--text-h2); font-weight: 800; letter-spacing: -0.02em; }
.content.tight .section-title { margin-left: 20px; margin-right: 20px; }
/* The briefing is a direct child of .screen, not of .content, so its
   headings never picked up the 20px the rest of the screen is set to and
   sat 18px further left than the cards, tabs and day labels under them –
   two left edges on one screen. */
.briefing .section-title { margin-left: 20px; margin-right: 20px; }
.briefing .section-title:first-child { margin-top: 4px; }
.briefing-empty {
  margin: 0 20px; padding: 13px 16px;
  border-radius: var(--radius-lg); border: 1px dashed var(--border);
  font-size: var(--text-md); color: var(--ink-soft);
}
/* An answer, not an empty state. The dashed box this replaces made "nothing
   today" look like the most important thing on the screen. */
.today-none {
  margin: 0 20px 4px; font-size: var(--text-md); color: var(--ink-faint);
}
/* An empty day is secondary information, so it takes less room than a full
   one. The heading and its single line are a tight pair – 5px, against the
   10 a heading gives a list of cards – and the block hands over to what IS
   coming sooner, at 16px rather than the 22 between ordinary sections. The
   pair still reads as a pair, because 5:16 is a wider ratio than the 10:22
   it replaces. Only when the day is empty: a day with rows keeps the
   ordinary rhythm. */
.briefing .section-title:has(+ .today-none) { margin-bottom: 5px; }
.today-none + .section-title { margin-top: 16px; }

.attn-list {
  margin: 0 20px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
/* An icon rather than a colored dot per row: four dots in four meanings is
   a legend the reader doesn't have. The count is the only bold thing. */
.attn-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  font-size: var(--text-md); color: var(--ink-soft); background: none;
}
.attn-list > *:last-child { border-bottom: none; }
.attn-row:active { background: var(--surface-2); }
.attn-row strong { color: var(--ink); font-weight: 800; }
.attn-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* The thing, then where to find it. One sentence carrying both ("2 athletes
   are waiting for feedback from 15 Sep") wrapped onto two lines anyway and
   buried its own subject halfway along the second one. */
.attn-head { color: var(--ink-soft); line-height: 1.3; }
.attn-sub {
  font-size: var(--text-sm); color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The icon carries the row's nature, in the colours the app already uses
   for these meanings (see the RULES block at the top of this file) rather
   than a scheme invented here:
     .is-problem  --warn      something is wrong or late and you can fix it
     .is-arrived  --student   it came from another person; blue, like the
                              "New reply" badge and an athlete's dot
   The tint is a wash of the same colour, so the row reads at a glance
   without a second full-strength colour competing with the text. */
.attn-icon {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.attn-icon.is-problem { color: var(--warn); background: var(--warn-soft); }
.attn-icon.is-arrived { color: var(--student); background: var(--student-soft); }


/* The duplicate form's opening line – an icon, and the new date in the
   body text weight so it reads as a value that was set, not as a warning. */
/* Block, not flex: as a flex container each phrase became its own line and
   the sentence broke into three. The icon rides along inline instead. */
.dup-hint { display: block; }
.dup-hint svg { vertical-align: -2px; margin-right: 5px; color: var(--ink-faint); }
.dup-hint strong { color: var(--ink); font-weight: 700; }

/* 10px of vertical padding rather than 6: this is a control, and at 36px
   tall it was under the 44 a thumb needs. Grown rather than extended,
   because it has room and nothing sits close enough to crowd. */
.detail-people {
  display: flex; align-items: center; gap: 9px;
  margin-top: 10px; padding: 10px 12px 10px 8px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
}
.detail-people:active { background: var(--surface-2); }
.detail-people .avatar-stack .avatar,
.detail-people .avatar-stack .avatar-more { width: 22px; height: 22px; font-size: 9.5px; }
.detail-people-label { font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }

/* ---------- Session detail: the join code ----------
   No card. It's a number to read out, and the six lime digits are already
   the loudest thing on the line – a box around them was the page saying the
   same thing twice. A rule above sets it apart from the header instead. */
.join-card { margin: 18px 0 4px; padding: 14px 0 0; border-top: 1px solid var(--border); }
.join-card-label {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint);
}
.join-card-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 1px; }
/* --ink, not the accent. The RULES block at the top of this file reserves
   lime for actions and selection and says "never a passive label" – and a
   code you read out to somebody is exactly that. It was the one place on
   this tab breaking the app's own rule, and it doesn't need the colour: at
   24px/800 with this much letter-spacing it is already the loudest thing in
   the block. The action next to it, Copy, keeps the accent. */
.join-card-code { font-size: 24px; font-weight: 800; letter-spacing: 0.14em; color: var(--ink); line-height: 1.25; }
.join-card-count {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-sm); color: var(--ink-soft); margin-top: 4px;
}
.join-card-count .badge { padding: 2px 7px; font-size: var(--text-micro); }

/* ---------- The plan list (session detail) ----------
   Rows on the page with a hairline between them, not a stack of cards.
   A session page is a document – what we're running, in what order, with
   whom – and a document is read down a column, not picked out of a pile of
   boxes. Cards are kept for things you go TO (an upcoming session in the
   list, an athlete on the Athletes tab); a line inside a plan is something
   you read past.
   This is the one screen that has it so far. */
/* No side margin: this list lives inside .content, which already sets the
   20px. Adding it here again pushed every row 18px right of its own
   heading – two left edges on one page, which is the thing the alignment
   audit exists to catch, and did. */
.plan-list { margin: 2px 0 0; }
.plan-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.plan-item:last-child { border-bottom: none; }
/* The row itself carries no padding – .plan-item owns the rhythm, so an
   exercise row and its coach note sit inside one band.
   Which left the row 20px tall as a target, inside a band that already
   measures 44: the 12px above and below LOOK like part of the row and
   weren't part of the button. The extension claims exactly that space, so
   the tappable row matches the row you can see. */
.plan-row {
  display: flex; align-items: baseline; gap: 12px;
  width: 100%; text-align: left; background: none; padding: 0;
  position: relative;
}
.plan-row::before { content: ""; position: absolute; inset: -12px 0; }
.plan-row:active .plan-title { color: var(--row-selected-text); }
/* The number is the spine of the list: fixed width and tabular figures, so
   01 through 12 line up and the titles all start in the same column. */
.plan-num {
  flex: none; min-width: 22px;
  font-size: var(--text-sm); font-weight: 800; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
}
.plan-title {
  flex: 1; min-width: 0; font-size: var(--text-lg); font-weight: 600; color: var(--ink);
  line-height: 1.35;
}
.plan-meta {
  flex: none; font-size: var(--text-sm); color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
/* The athlete rows share the list, so their press state comes from here
   rather than from .card. */
.plan-item.student-row { align-items: center; gap: 12px; }
/* An athlete's name on the session page is a row title like any other here,
   so it takes the same primary as the session names above it. Scoped to
   this page: the Athletes tab still uses --row-title until it is reviewed,
   and one screen reading in two different greys is worse than either. */
.plan-item.student-row .name { color: var(--ink); }
.plan-item.is-clickable:active { background: var(--row-selected-bg); }
/* The inline team chat, on the page rather than in a card – the bubbles are
   already boxes and a box around boxes is what this page had too much of. */
.team-chat { margin: 0; }

/* 13px rather than the shared card's 16: the Exercises tab still uses this
   card – only the session page's plan became rows. */
/* align-items:center, not stretch: with the description gone the text block
   is two short lines against a 72px picture, and top-aligning left it
   floating in the upper half of its own row. */
.exercise-card {
  display: flex; gap: 12px; align-items: center; padding: 11px 13px;
  width: calc(100% - 40px); margin: 0 20px 10px; text-align: left;
}

/* ---------- Coach note under an exercise ----------
   Indented to start where the exercise title starts – past the 01/02/03
   column – so it reads as a note ON that line rather than as another item
   in the list. Its own left rule keeps that true even when the note runs to
   several lines. */
.ex-note {
  margin: 6px 0 0 34px; padding: 0 0 0 12px;
  border-left: 2px solid var(--border);
}
/* What happened last time, above the empty box – the reason to read any of
   this is to plan the next ten minutes, and the empty box can't help with
   that. Quieter than the note itself: it's context, not the thing you came
   to write. */
.ex-note-last {
  display: flex; flex-direction: column; gap: 2px;
  font-size: var(--text-sm); color: var(--ink-soft); margin-bottom: 7px;
}
.ex-note-last-label {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--ink-faint);
}
/* Lifted above .plan-row's extended hit area, which reaches 12px down into
   the band and would otherwise own the note's top edge – a tap meant for
   the note would open the exercise instead. The note is typed into; it wins
   every pixel it draws. */
.ex-note-input {
  position: relative; z-index: 1;
  width: 100%; resize: none; overflow: hidden;
  background: none; border: none; padding: 2px 0;
  font-family: var(--font); font-size: var(--text-input); color: var(--ink);
  line-height: 1.45;
}
.ex-note-input::placeholder { color: var(--ink-faint); }
.ex-note-input:focus { outline: none; }
/* Focus lands on the rule, not on a box that appears out of nowhere: the
   field is borderless at rest so a session with five exercises isn't five
   empty boxes staring back. */
.ex-note:focus-within { border-left-color: var(--accent); }
/* Bigger, because it is now the thing that makes this list scannable rather
   than a decoration beside the text it used to compete with. 64 to 72, and
   the card is shorter anyway: the two lines of description that used to sit
   next to it are gone. */
.exercise-thumb {
  width: 72px; height: 72px; border-radius: 14px; flex: none;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--ink-faint); position: relative;
}
/* The glyph sits underneath and the picture covers it, so an image that
   fails to load can simply remove itself and leave the glyph showing. */
.exercise-thumb-glyph { display: flex; }
/* contain for an uploaded picture – it may well be a diagram, and cropping
   a diagram loses the half that was the point. */
.exercise-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  background: var(--surface-2);
}
/* cover for a video's own frame: a YouTube still is a 4:3 image with a 16:9
   video letterboxed inside it, so containing one in a square shows the
   black bars rather than the drill. */
.exercise-thumb img.is-frame { object-fit: cover; }
/* "There is footage behind this." On the picture, because that is what it
   is a fact about – as a badge it sat in the row with the categories and
   read as one of them. */
.exercise-thumb-play {
  position: absolute; right: 4px; bottom: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 11, 18, 0.72); color: #FFF;
}
.exercise-card-body { flex: 1; min-width: 0; }
/* Two lines, then ellipsis – a long drill name is the only thing left that
   can make one row taller than its neighbour, and two lines is the cap.
   --ink, not --row-title: that legacy fourth grey made the biggest thing in
   the row dimmer than the body text around it (see tests/colour-audit.js). */
.exercise-card-body h3 {
  margin: 0 0 3px; font-family: var(--font); font-size: var(--text-md); font-weight: 600; color: var(--ink);
  line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.exercise-card:hover { background: var(--row-hover-bg); }
.exercise-card:active { background: var(--row-selected-bg); }
.exercise-card:active h3 { color: var(--row-selected-text); }
/* What kind of thing it is – the categories, joined by a middle dot rather
   than wrapped in badges. A badge is a label with a box around it, and a
   screenful of boxes is what made this tab read as busier than the ones
   carrying more information. One line: a drill in four categories is a
   filing problem, not a layout one. */
.exercise-kind {
  margin: 0; font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Who it came from, when that is not you. Blue is already what this app
   uses for "this arrived from another person" (see the RULES block), and
   the colour is what separates it from the categories – no second box. */
.exercise-from {
  margin-left: 8px; color: var(--student); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; vertical-align: -2px;
}
.exercise-from svg { flex: none; }

/* A field, not a field wrapped around a field.
   This was 65px tall for one line of 16px text, and the padding was not the
   bar's: `input[type=text]` up in the form styles carries `padding: 12px
   14px`, and the reset here took away the border and the background but
   left that. So the input inside the bar was 43px – a form field's own
   height – sitting inside 20px more of the bar's padding, and shrinking the
   bar would only have squeezed the outer half of a doubled measurement.
   Padding to 0 on the inner field and the bar keeps its own: 50px now, for
   the same 16px of text, with the 32px button still clearing its row. The
   16px floor on the font stays untouched (see --text-input). */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 13px; padding: 7px 12px 7px 14px; margin: 4px 20px 12px;
  color: var(--ink-soft);
}
.search-bar input {
  border: none; background: none; flex: 1; min-width: 0;
  padding: 0; border-radius: 0; height: auto;
  /* Stretched to the bar's full inner height. Without this the field is 19px
     of text floating in a 48px box, and the 14px of padding above and below
     it is dead to a thumb – which is a worse field than the fat one it
     replaced. The bar's own padding is the rest of the target: clicking
     anywhere in it focuses the input (see js/components.js). */
  align-self: stretch;
  font-size: var(--text-input); color: var(--ink);
}
.search-bar input:focus { outline: none; }
.search-bar > svg { flex: none; }
/* ---------- Global search (js/views/search.js) ----------
   The field lives in the topbar next to the back arrow, so it drops the
   outer margins the in-page search bars carry. */
.search-topbar { gap: 8px; }
.search-bar-topbar { flex: 1; min-width: 0; margin: 0; padding: 8px 12px; border-radius: 12px; }
.search-row {
  display: flex; align-items: center; gap: 12px;
  width: calc(100% - 40px); margin: 0 20px 10px;
  text-align: left; padding: 11px 13px;
}
.search-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.search-row-title {
  font-size: var(--text-md); font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-row-sub {
  font-size: var(--text-sm); color: var(--ink-soft); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Sessions and exercises get a glyph where an athlete gets a face – the
   leading slot always says which of the three kinds a row is. */
.search-icon {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-soft);
}
.search-icon.is-past { color: var(--ink-faint); }
.search-count { color: var(--ink-faint); font-weight: 700; }

.search-bar-filter-btn {
  position: relative; flex: none; width: 32px; height: 32px; padding: 0;
  border-radius: 9px; border: none; background: var(--surface-2); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.search-bar-filter-btn.active { background: var(--accent-soft); color: var(--accent); }
.search-bar-filter-btn .filter-count-badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 20px; background: var(--accent); color: var(--on-accent);
  font-size: var(--text-micro); font-weight: 800; display: flex; align-items: center; justify-content: center;
}

/* Capped by HEIGHT, and the element hugs the picture instead of the column.
   This used to be `width: 100%` + `max-height: 60vh`, i.e. the media block
   was as tall as whatever the coach happened to upload. A phone photo or a
   video still is 9:16, and at 390px wide that came out 506px tall — 60% of
   the screen — which pushed the exercise's own NAME to y=667, 79% of the way
   down an 844px viewport, and made the sheet scroll so Edit/Share/Delete
   fell off the bottom. You opened a drill and saw a picture, then had to
   scroll to find out which drill it was.
   The cap is a height, not a ratio, so a landscape still (16:9 → 197px) is
   left exactly as it was: it was never the problem. Only the tall uploads
   are brought down.
   340px is deliberate rather than round: the sheet is bottom-anchored, so
   any media up to ~350px tall leaves the title at the same y — below that
   ceiling a shorter picture only shortens the sheet, it does not move the
   text up. So there is no reason to go smaller than the ceiling, and every
   reason not to go over it. min() keeps that true on a short phone too,
   where 340px would be half the screen.
   `width: auto` with the height cap, rather than `object-fit`, because this
   picture is often a diagram or a pitch layout: `cover` would crop 58% off
   a portrait upload, and `contain` at full width would letterbox the same
   upload into a 147px slip inside a grey box. Letting the element take the
   picture's own width shows all of it, at the tallest size that fits, with
   no bars. */
.exercise-detail-img {
  display: block; margin: 0 auto 16px;
  width: auto; max-width: 100%;
  height: auto; max-height: min(340px, 40vh);
  border-radius: var(--radius-lg); background: var(--surface-2);
}
/* The picture is the video: a wrapper so the play badge has something to be
   positioned against. Only ever wraps a YouTube still, which is always 16:9
   and always fills the column — an uploaded photo is not the footage, so it
   gets no wrapper and no badge — which is why this is a plain full-width
   block. It was `width: fit-content` for one draft, to shrink-wrap a picture
   narrower than the column, and that is a trap worth leaving a note about:
   a percentage width on a child resolves against a shrink-to-fit parent
   whose own width was computed from that child's INTRINSIC size, so
   `width: 100%` inside it rendered the image at its natural 16px. */
.exercise-detail-media {
  position: relative; display: block; margin-bottom: 16px;
  border-radius: var(--radius-lg);
}
.exercise-detail-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  /* Not the accent. Lime is for actions and selection, and a play badge over
     a still is a label for what the picture is – the whole picture is the
     target, so the badge is not the control either. White on a scrim reads
     as "video" everywhere, and the scrim is what keeps it legible over a
     frame that may be any colour at all. */
  background: rgba(0, 0, 0, 0.55); color: #fff;
  backdrop-filter: blur(2px);
  /* A dark scrim disappears into a dark frame, and half the stills a padel
     coach posts are shot on an indoor court at night. The hairline is what
     gives the badge an edge there; on a bright frame the scrim does the work
     and the hairline is invisible. */
  border: 1.5px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.exercise-detail-media:active .exercise-detail-play { background: rgba(0, 0, 0, 0.72); }
/* The image inside the wrapper keeps the same cap as a standalone one, but
   its auto margins have already been spent by the wrapper. */
.exercise-detail-media .exercise-detail-img { margin: 0; }

/* A YouTube still is the one picture here whose shape is known in advance:
   always 16:9, never portrait. So it can fill the column — which matters,
   because the fallback still is 320px wide against a 350px column and would
   otherwise sit 30px narrower than everything else on the page for no reason
   a reader could see. The height cap cannot bite on it either (350 wide is
   197 tall), so filling the width can never letterbox it, which is the only
   thing `width: auto` was protecting against. */
.exercise-detail-img.is-frame { width: 100%; }

.video-link-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 12px 14px; margin-top: 10px;
}
/* Two lines where there was one URL. The column has to be allowed to shrink
   (min-width: 0) or a long channel name pushes the chevron off the card. */
.video-link-text { flex: 1; min-width: 0; }
.video-link-title {
  font-size: var(--text-md); font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.video-link-sub {
  font-size: var(--text-sm); color: var(--ink-soft); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.video-link-card .yt-badge {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; color: var(--accent); flex: none;
}

.image-drop {
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.image-drop img { width: 100%; height: auto; max-height: 260px; object-fit: contain; border-radius: 12px; background: var(--surface-2); display: block; }
.image-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* With a picture in it, the box stops being a drop target and becomes a
   preview with controls: the dashed "put something here" border goes solid,
   and the invisible full-area file input is taken out of the way so the two
   buttons underneath can actually be pressed. */
.image-drop.has-image { border-style: solid; padding: 10px; }
.image-drop.has-image input[type=file] { display: none; }
/* Each button takes the width its own words need (min-width: max-content),
   and the row wraps rather than shrinking them – forcing the two to equal
   widths clipped "Remove" clean off the edge at 320px, inside the box's own
   overflow:hidden where it was invisible to the responsive audit. */
.image-drop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.image-drop-actions .btn { flex: 1 1 auto; min-width: max-content; cursor: pointer; white-space: nowrap; }
/* "Change image" is a <label> so it can open the file picker without script,
   which means .field label's uppercase field-heading styling lands on it.
   Undo that here: it's a button, and it should read like the other one. */
.image-drop-actions label.btn {
  display: inline-flex; margin-bottom: 0;
  text-transform: none; letter-spacing: 0; color: var(--ink);
  font-size: var(--text-md); font-weight: 800;
}

.share-coach-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
}
.share-coach-row:last-child { border-bottom: none; }
.share-coach-row .grow { flex: 1; }
.share-coach-row .name { font-weight: 700; font-size: var(--text-md); color: var(--ink); }
.share-coach-row .subtext { font-size: var(--text-sm); color: var(--ink-soft); }

.toggle {
  width: 46px; height: 27px; border-radius: 20px; background: var(--surface-2);
  position: relative; flex: none; border: 1.5px solid var(--border);
}
.toggle .knob {
  width: 21px; height: 21px; border-radius: 50%; background: #fff;
  position: absolute; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: left 0.15s ease;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on .knob { left: 21px; }

/* ---------- Students ---------- */
.student-row { display: flex; align-items: center; gap: 12px; }
/* ---------- The roster, unboxed ----------
   A card per athlete put a surface, a border and a 16px radius around each
   person, on a screen that is already a column of surfaces – and the tab
   next to it had just lost the same thing (the Sessions list, the Recent
   block). Eleven people were eleven boxes.
   Full-bleed with its own 20px of inner padding, like .session-row: the text
   lines up with everything else while a press lights the whole width of the
   screen, which is what makes a list read as a list rather than as a column
   of separate objects.
   Separated by air and not by rules. The Sessions tab settled that question
   already – a hairline is a boundary, and a boundary between every two rows
   of one flat list says there are eleven sections where there is one. What
   parts these rows is that each begins with a face. */
.roster-row {
  width: 100%; padding: 9px 20px 10px; cursor: pointer;
  border-radius: 0; background: none; border: none; box-shadow: none;
}
.roster-row + .roster-row { margin-top: 12px; }
.roster-row:hover { background: var(--row-hover-bg); }
.roster-row:active { background: var(--surface-2); }
/* An invitation is not a person yet: nothing to open, so nothing lights up
   under a thumb. */
.roster-row.is-pending { cursor: default; }
.roster-row.is-pending:hover, .roster-row.is-pending:active { background: none; }
.student-row .grow { flex: 1; min-width: 0; }
/* One line, then ellipsis: with an action button on the right there isn't
   room for a name to wrap, and a wrapped name made rows in the same list
   different heights. */
.student-row .name {
  /* --ink, not --row-title: that legacy fourth grey left the biggest thing
     in the row dimmer than the body text around it (tests/colour-audit.js). */
  font-family: var(--font); font-weight: 600; font-size: var(--text-md); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* One line here too, for the reason the name has one: a row with an action
   on the right has no room to wrap, and a wrapped line made rows in the same
   list different heights. The pending-invite rows are what showed it –
   'Invited to "Pre-season Fitness Test"' ran to two lines and made that one
   row 25px taller than the five above it. */
.student-row .subtext {
  font-size: var(--text-sm); color: var(--ink-soft); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* The one status line that is a job rather than a fact. Amber, the app's
   colour for something wrong or late (see the RULES block) – not the accent,
   which is for what you press and what you have chosen. The glyph is what
   keeps it from reading as just another date. */
.student-row .subtext.is-owed {
  color: var(--warn); font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.student-row .subtext.is-owed svg { flex: none; }
/* Press feedback only where the row actually leads somewhere – these rows
   are <div>s now (they can hold a "Give feedback" button, and a button
   can't contain a button), so the state has to be opted into. */
.student-row.is-clickable, .student-row[data-nav] { cursor: pointer; }
.student-row.is-clickable:hover, .student-row[data-nav]:hover { background: var(--row-hover-bg); }
.student-row.is-clickable:active, .student-row[data-nav]:active { background: var(--row-selected-bg); }
.student-row.is-clickable:active .name, .student-row[data-nav]:active .name { color: var(--row-selected-text); }
.student-row .chev { color: var(--ink-faint); }
/* The loop's state under the name: "Feedback given" and, once it comes,
   "Athlete replied" – the two halves that used to be two grey dots. */
.student-row .fb-subtext { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* The "when" at the end of a chat preview. Two places use it – the Sessions
   tab's chat row and the chat card on an athlete's page – and until the
   second one arrived it had no rule of its own at all: the only .row-time
   declaration in this file was scoped to .student-row, which is a row type
   whose markup stopped carrying the class. So the Sessions tab's timestamp
   had been inheriting whatever its parent happened to be, which is how a
   shared class ends up meaning two different things on two screens.
   --ink-faint, not the legacy --row-desc it used to name: same move as the
   session rows, the search rows and the settings labels. */
.row-time { font-size: var(--text-sm); color: var(--ink-faint); flex: none; white-space: nowrap; }

/* The chat card on an athlete's page (and on an athlete's own Profile).
   Two things it had been getting away with rather than declaring:
   the text block never actually grew – there is no unscoped .grow in this
   file, so the class it carried did nothing and the block sized to its
   content, which puts the timestamp beside a short message instead of at
   the end of the row – and the preview was clamped by slicing the string at
   46 characters, a number that is right at one width and wrong at every
   other. At 320px it wrapped and pushed the stat boxes 31px down the page.
   One line, ellipsised, in whatever space the card actually has. */
.chat-preview-card .grow { flex: 1; min-width: 0; }
/* Both lines, not just the preview. With a timestamp in the corner the
   text column is 99px at 320px, and "Chat with Axel" wraps in 99px – so
   the card was 81px tall with a message and 74px without one, which is a
   card whose height depends on whether anyone has spoken. The rule is on
   every child rather than on .subtext so a third line added later cannot
   reintroduce it. */
.chat-preview-card .grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The button gets its own line under the name (the row is a flex container
   with wrap on for exactly this): side by side, a 150px button left about
   70px for the name, which truncated "Liam Carlson" to "Liam …". Full width
   is also a much bigger target for the one action the screen is asking for. */
.student-row.has-fb-action { flex-wrap: wrap; }
.row-fb-btn { flex: 1 0 100%; justify-content: center; }

/* .stat-grid and .stat-box are gone: three numbers above a list that said
   two of them in words, and the third was a fact about the past. See the
   note in render() in js/views/students.js. */


/* ---------- Structured feedback ----------
   Two lists and a note. The chips are the message's summary, so they're
   rendered above the note in the thread – the same order they were written
   in, and the order a reader wants them. */
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-compose-body { padding-top: 4px; }
.fb-compose-body .section-title:first-child { margin-top: 6px; }
.fb-said {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.fb-said-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--success);
}
/* Amber for what to work on, cyan for what worked – the app's existing
   meanings, so a coach doesn't have to learn a second colour language for
   this one screen. Never red: "focus next time" is coaching, not a fault. */
.fb-said.is-focus .fb-said-label { color: var(--warn); }
.fb-said > span:not(.fb-said-label) {
  padding: 3px 9px; border-radius: 999px;
  background: var(--success-soft); color: var(--success);
  font-size: var(--text-xs); font-weight: 700;
}
.fb-said.is-focus > span:not(.fb-said-label) { background: var(--warn-soft); color: var(--warn); }
.fb-note-text { margin-top: 2px; }

/* ---------- Live session mode (js/views/live.js) ----------
   Used one-handed, on a court, at arm's length. Everything here is bigger
   and higher-contrast than the rest of the app on purpose: this is the only
   screen read while standing up and moving. */
.live-start {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.live-screen { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.live-topbar { align-items: flex-start; }
.live-eyebrow {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}
.live-title { font-size: var(--text-h2) !important; margin-top: 3px !important; }

.live-current { text-align: center; padding: 8px 0 4px; }
.live-step {
  font-size: var(--text-sm); font-weight: 800; letter-spacing: 0.12em;
  color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.live-name { margin: 4px 0 0; font-size: var(--text-h1); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
/* The one number the coach looks up to check. Tabular figures so it doesn't
   twitch as the seconds change – a clock that jitters reads as broken. */
.live-clock {
  margin-top: 10px;
  font-size: 56px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
/* Amber past the planned time, not red: running long is a coaching
   decision, not an error. Dimmed while paused, so a stopped clock can't be
   mistaken for a running one at a glance. */
.live-clock.is-over { color: var(--warn); }
.live-clock.is-paused { color: var(--ink-soft); }
.live-progress {
  height: 6px; border-radius: 3px; background: var(--surface-2);
  margin: 14px 20px 0; overflow: hidden;
}
.live-progress i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 1s linear;
}
.live-planned { margin-top: 8px; font-size: var(--text-sm); color: var(--ink-soft); }
.live-instructions { margin-top: 22px; text-align: left; }
.live-instructions p { margin: 0; font-size: var(--text-md); line-height: 1.6; color: var(--ink-soft); }
.live-last { margin: 22px 0 0; font-size: var(--text-sm); color: var(--ink-faint); }

.live-list {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.live-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.live-list > *:last-child { border-bottom: none; }
.live-row-num { font-size: var(--text-sm); font-weight: 800; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.live-row-name {
  font-size: var(--text-md); font-weight: 600; color: var(--ink); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-row-min { flex: none; font-size: var(--text-sm); color: var(--ink-soft); }

.live-athletes { display: flex; flex-direction: column; gap: 8px; }
.live-athlete {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 14px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
}
.live-athlete:active { background: var(--surface-2); }
.live-athlete-name { font-size: var(--text-md); font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-athlete-add { flex: none; display: flex; align-items: center; gap: 4px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }

/* Pinned: on a court you don't scroll to find Next. */
.live-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  width: 100%; max-width: var(--app-max); margin: 0 auto;
  display: flex; gap: 10px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  background: var(--nav-bg); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 25;
}
.live-bar-btn { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; }

/* Coach note on the running drill. Quiet: the clock and Next are what the
   screen is for, and this is the margin next to them. */
.live-note { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.live-note-last, .live-note-btn {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--surface-2); font-size: var(--text-md); color: var(--ink);
}
.live-note-btn:active { background: var(--surface); }
.live-note-label {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--ink-faint);
}
.live-note-add, .live-note-add-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft);
}
.live-note-add { margin-top: 16px; padding: 8px 0; background: none; }

/* Quick-note sheet */
.note-list { display: flex; flex-direction: column; gap: 6px; }
.note-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--surface-2); font-size: var(--text-md); color: var(--ink);
}
.note-row .grow { min-width: 0; }
.note-row .remove-btn {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.note-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* A chip's own delete button. Same 26px circle as everywhere else a row can
   be removed, so "the little x on the right takes it away" stays one idea. */
.chip.removable .remove-btn {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); background: none;
}
.chip.removable .remove-btn:hover { background: rgba(0, 0, 0, 0.14); color: var(--ink); }

/* ---------- Preset lists (Profile -> Quick words) ----------
   One row per list: the coach's heading, what kind it is, and a glimpse of
   the words themselves. The glimpse is the point – a heading alone ("Serve
   & return") doesn't tell you whether the list still has the words you
   wanted, and opening every list to find out is the thing this avoids. */
.screen-note {
  margin: 0 20px 14px; font-size: var(--text-sm); color: var(--ink-soft); max-width: 52ch;
}
.preset-list { margin: 0 20px; display: flex; flex-direction: column; gap: 10px; }
/* The chevron lines up with the heading, not with the middle of the row:
   a row is one to three lines tall depending on how many words are in the
   list, and a centred chevron drifts to a different place in every row. */
.preset-row {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
}
.preset-row > .icon { flex: none; margin-top: 4px; }
.preset-row:active { background: var(--surface-2); }
.preset-row .grow { flex: 1; min-width: 0; }
.preset-row-title { font-size: var(--text-lg); font-weight: 700; color: var(--ink); }
.preset-row-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 5px;
  font-size: var(--text-sm); color: var(--ink-soft);
}
.preset-row-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.preset-row-more { font-size: var(--text-sm); color: var(--ink-faint); align-self: center; }
.chip.sm { padding: 5px 10px; font-size: var(--text-sm); font-weight: 600; }

/* Word input and its Add button. The button hugs its label so the field
   keeps the width – you type here far more often than you aim at Add. */
.pl-add-row { display: flex; gap: 8px; margin-top: 10px; }
.pl-add-row input { flex: 1; min-width: 0; }
.pl-add-row .btn { flex: none; width: auto; white-space: nowrap; }

/* ---------- Recent / history rows ----------
   A finished session in two lines, and – like the upcoming rows above it –
   no box. It was a bordered panel while the list above it was a column of
   cards, which made it the lighter of the two; once those became hairline
   rows, the border here was the heaviest thing on the screen and the
   hierarchy read backwards. Weight comes from type and colour instead:
   what's ahead stays the bigger half of the Sessions screen, which is the
   whole reason the Finished tab could go away. Shared with the History
   screen so the two can't drift apart.

   No rules between the rows either. A hairline under every item made this
   the one table on a screen of airy lists – it read as a second Sessions
   list rather than as the quiet footnote it is. Space separates them now,
   and less of it than Upcoming gets (26px between rows here against 33px
   there), which is the same trick the type is already playing: Recent is
   smaller, dimmer and tighter than the thing above it, in that order. */
.recent-list { display: flex; flex-direction: column; }
.recent-row {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left;
  padding: 7px 20px 8px; background: none;
}
.recent-row + .recent-row { margin-top: 11px; }
.recent-row:hover { background: var(--row-hover-bg); }
.recent-row:active { background: var(--surface-2); }
.recent-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
/* The date leads and never wraps: it's what you scan a history list by. */
.recent-date {
  flex: none; font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.recent-sep { flex: none; color: var(--ink-faint); }
.recent-title {
  min-width: 0; font-size: var(--text-md); font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The second line is the only reason these rows exist – it carries the one
   thing that might still need doing. Its colour is the whole signal:
   amber = you owe something, blue = someone wrote to you, cyan = done,
   grey = nothing to report. Same meanings as everywhere else in the app. */
.recent-status {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-faint);
}
.recent-status svg { flex: none; }
.recent-status.is-warn { color: var(--warn); }
.recent-status.is-info { color: var(--student); }
.recent-status.is-done { color: var(--success); }
.recent-heading { margin-top: 30px; }

/* ---------- Next session (finished session page) ----------
   The one block on this page with a rule above it: everything before it is
   a record of what happened, and this is the only part that looks forward.
   Still on the page, not in a card – same as the plan above it. */
.next-heading { margin-top: 34px; }
/* No side margin: this sits inside .content, which already carries the
   screen's 20px gutter. Adding another 20px here put the whole block 20px
   right of the heading above it - the same mistake .plan-list made. */
.next-block { margin: 0; padding-top: 2px; }
.next-intro { margin: 0 0 10px; font-size: var(--text-sm); color: var(--ink-soft); }
.next-line {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-lg); font-weight: 600; color: var(--ink);
  padding: 3px 0;
}
.next-line svg { flex: none; }
.next-line.is-good svg { color: var(--success); }
.next-line.is-focus svg { color: var(--warn); }
/* How many athletes it was said about. A focus mentioned four times is a
   different thing from one mentioned once, and that difference is the only
   evidence behind the headline below. */
.next-count {
  font-size: var(--text-sm); font-weight: 700; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.next-focus-label {
  margin-top: 18px;
  font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint);
}
/* The headline. Uppercase and large because it is the answer the whole
   block exists to give – everything above it is the working. */
.next-focus {
  margin-top: 4px;
  font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
  text-transform: uppercase; color: var(--ink); line-height: 1.15;
}
.next-block .plan-list { margin-top: 2px; }
.next-cta { margin-top: 18px; }

/* ---------- This month (History) ----------
   Three numbers on one row. No cards: a border around each would make them
   look tappable, and they aren't – they're a read. The numbers carry it,
   which is the whole point of putting them at 30px against a 12px label. */
.stat-row { display: flex; gap: 10px; margin: 0 20px 18px; }
.stat-tile { flex: 1; min-width: 0; }
.stat-value {
  display: flex; align-items: baseline; gap: 1px;
  font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
/* The unit rides with the number at half its weight, so "18h" reads as one
   value rather than as a number next to a letter. */
.stat-unit { font-size: 17px; font-weight: 700; color: var(--ink-soft); }
/* Wraps rather than truncates. "Athlete sessions" doesn't fit a third of a
   320px screen on one line, and "Athlete sessio…" is a label that has
   stopped doing its job – two lines cost nothing here, since the tiles are
   top-aligned and only the labels differ in height. */
.stat-label {
  margin-top: 3px; font-size: var(--text-sm); color: var(--ink-soft);
  line-height: 1.25;
}
/* A 16px-tall link at the end of a list is a hard thing to hit. The
   padding gives it a row's height and the negative margin keeps it looking
   exactly where it was.
   The 10px on top is what the divider above this used to do. With the rules
   gone it sat 26px below the last row – exactly the gap between two rows –
   and read as a third one. 36px puts it outside the list without drawing
   anything. */
.recent-more {
  display: flex; align-items: center; gap: 4px;
  margin: 10px 20px 0; padding: 14px 0;
  background: none; color: var(--ink-soft);
  font-size: var(--text-md); font-weight: 600;
}
.recent-more:active { color: var(--ink); }

/* ---------- Athlete profile: the relationship summary ----------
   Label left, value right, one line each – a spec sheet, not cards. The
   whole point is that it can be read in a glance without scrolling. */
.rel-list {
  /* No top margin of its own any more: a .section-title sits above it and
     brings the app's own 22px. 14px on top of that made the list drift away
     from the heading that names it. */
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.rel-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 14px; border-bottom: 1px solid var(--border); background: none;
}
.rel-list > *:last-child { border-bottom: none; }
.rel-row.is-nav:active { background: var(--surface-2); }
.rel-label { font-size: var(--text-sm); color: var(--ink-faint); font-weight: 600; flex: none; }
.rel-value {
  flex: 1; min-width: 0;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink);
}
/* The clamp lives on the words, not on the row that holds them: a flex
   container's own text node is not a block, so text-overflow has nothing to
   put an ellipsis on. */
.rel-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The one action under the status list. Full width and the primary
   treatment — the same lime-to-green gradient as "New session" on the start
   page, which makes the pair read as one idea: New session is the general
   action, this is the action for THIS athlete.
   Filled for both of its labels, not just for "Book a session". Only one of
   them is ever on screen, so whichever is showing IS the page's action; if
   Book were filled and Write feedback outlined, the page would be drawing
   the job it owes an athlete more quietly than the nudge nobody is blocked
   by. And there is no competition for it — an athlete's page has neither a
   floating button nor a bottom nav, so this is the only filled thing on it.
   12px of air above so it reads as an answer to the list rather than as a
   fifth row of it. */
.rel-action {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
/* One class per tone, set by relRow() in js/views/students.js. Two of the
   four are coloured, and only two: a state the coach has to do something
   about, and a state that is settled. An absence is grey and a fact is ink,
   because "no upcoming session" and "22 Sep · Pre-season" are not statuses
   and colouring them would leave the one that matters nothing to stand out
   against. The accent is in none of them – lime is for actions and
   selection (see the RULES block at the top of this file) and a status is
   neither. */
.rel-value.is-fact { color: var(--ink); }
.rel-value.is-muted { color: var(--ink-faint); font-weight: 500; }
.rel-value.is-good { color: var(--success); }
.rel-value.is-warn { color: var(--warn); }
/* The glyph sits with its words rather than at the right edge, so the value
   reads as one thing. justify-content, not text-align, because the span is
   a flex row once it holds an icon – and the whole value still has to end
   flush right against the chevron. */
.rel-value { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.rel-value svg { flex: none; }

/* ---------- Session cards inside an athlete profile ----------
   An overview row, not a full session card: title + status, one date/time
   line, and (only once the session is over) a feedback strip. The card
   navigates to the session; the strip opens the feedback thread. */
.session-mini { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 0; overflow: hidden; }
.session-mini .row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.session-mini h3 {
  margin: 0; flex: 1; min-width: 0; font-size: var(--text-lg); font-weight: 700; color: var(--ink); line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* .badge is still used inside this card – "New reply" on the feedback strip
   comes from someone else, which is what a badge is for here. The session's
   own status is not that: see .mini-status below. */
.session-mini .badge { flex: none; margin-top: 1px; }
/* The same size AND the same weight as the date line under the title,
   because they belong to one register: when it happened, and whether it has.
   The weight is the part that was wrong. This said 12.5px/600 while the date
   said 12.5px/400 — so the status was two weight steps heavier than the line
   it was supposed to match, and it was still the second-heaviest thing on
   the card after the title. Measured against the card behind it: the title
   is 15px/700 at 17.2:1, the date 12.5px/400 at 7.2:1, this 12.5px/400 at
   4.7:1. Quieter than the date by colour alone, which is the right
   difference — the date is a fact you read, this is a label. */
.session-mini .mini-status {
  flex: none; margin-top: 2px; white-space: nowrap;
  font-size: var(--text-sm); font-weight: 400; color: var(--ink-faint);
}
.session-mini .datetime { display: flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--ink-soft); padding-bottom: 12px; }
.session-mini .datetime svg { color: var(--ink-faint); flex: none; }

/* ---------- Sizes that used to be typed into the markup ----------
   Twenty-four font-sizes lived in style="" attributes across the views, and
   six of them were not on the type scale at all: 23px for a session title,
   20px for the join code, 14.5 for half the picker rows, 16 for a sheet
   header, 13, 12. Each was picked in isolation, in a file nobody opens when
   they are adjusting type, which is exactly how 23px and 22px end up on two
   screens of the same app.
   Every rule below replaced one of those attributes and lands on the scale.
   Nothing moved by more than a pixel and a half; what changed is that the
   sizes are now all in one file, where a change to the scale reaches them. */

/* The session page's head: the title, then when, then where. */
/* One step above the section headings under it (--text-h3 against
   --text-md) so the page has a first level again, and four steps below the
   22px poster it used to be. The when and the where keep the list's own
   register – see .detail-meta – so the head still reads as a row from the
   list, with its name allowed to lead. */
.detail-title { margin: 2px 0 5px; font-size: var(--text-h3); font-weight: 800; color: var(--ink); }
/* Its own class rather than a bare .datetime rule: .datetime is also the
   date line on an athlete's session cards, which is a quieter register and
   is pinned by a test that compares it to the status word beside it. */
/* When and where, in the register a row in the list gives them: the time in
   primary ink at 500, the place a step quieter and a step smaller. The head
   used to be 14px primary on both lines, which made the when and the where
   compete with the name instead of belonging to it. */
.detail-meta {
  font-size: var(--text-sm); font-weight: 500; color: var(--ink);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.detail-meta svg { color: var(--ink-faint); flex: none; }
.detail-place {
  font-size: var(--text-sm); font-weight: 500; color: var(--ink-faint);
  margin-top: 5px;
}
/* The link inherits the line's grey rather than the primary ink it wears on
   its own: here it is the quietest line in the head, not a heading. */
.detail-place .map-link { color: inherit; gap: 5px; }

/* A note beside a section heading ("45 min total", "3 still to write").
   Inside .section-title, so it has to undo the uppercasing and tracking it
   would otherwise inherit – that is what the inline style was mostly for. */
.section-note {
  font-size: var(--text-sm); font-weight: 600;
  text-transform: none; letter-spacing: normal;
}

/* The join code, big and spaced out because it is read aloud and typed in
   by someone else. --text-h2 rather than the 20px it was: on the scale, and
   still comfortably above the 16px floor an input needs. */
.join-code-input {
  letter-spacing: 0.25em; font-size: var(--text-h2); font-weight: 800; text-align: center;
}

/* The second line under a sheet's title – whose feedback this is, which
   session it belongs to. */
.sheet-header .sub { font-size: var(--text-sm); color: var(--ink-soft); }
/* A screen title that is a second-level heading, not the screen's own name
   ("Archived athletes" behind a back button). */
.topbar-h2 { font-size: var(--text-h2); }

/* A label-and-example pair in a picker row or a list card: the date formats
   in Preferences, the theme options, the chat preview on an athlete's page. */
.row-label { font-size: var(--text-md); font-weight: 700; color: var(--ink); }
.row-sub { font-size: var(--text-sm); color: var(--ink-soft); }

/* The exercise sheet's own body text, and the hint inside an empty image
   drop zone. */
.ex-description { font-size: var(--text-md); line-height: 1.55; white-space: pre-wrap; }
.image-drop-hint { margin-top: 6px; font-size: var(--text-sm); }

/* A feedback card's head: the session it is about, and who ran it. */
.fbcard-title {
  margin: 0; font-size: var(--text-lg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fbcard-sub { font-size: var(--text-sm); color: var(--ink-soft); }

/* ---------- The session page's own sections ----------
   No cards. What separates one section from the next is the same pair the
   lists use for a change of day: a heading that is bigger and brighter than
   the rows it heads, and a hairline straight across the screen.

   The old heading was --text-sm uppercase in --ink-faint – smaller and
   quieter than every row beneath it – with 24px of air above against the
   20px between two rows inside a section. Six sections built that way read
   as one undifferentiated column, which is what made this page feel busy
   while holding nothing a coach didn't ask for. */
.detail-rule {
  height: 1px; background: var(--border);
  /* .content carries 20px of side padding; the rule goes through it, so the
     break reads as the page's and not as some row's border. */
  margin: 30px -20px 0;
}
/* ...except the first one, which follows the head block rather than a list. */
.detail-rule:first-of-type { margin-top: 22px; }
.detail-section {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 14px 0 4px;
  font-size: var(--text-md); font-weight: 800; color: var(--ink);
}
.detail-section-note { font-size: var(--text-sm); font-weight: 600; color: var(--ink-faint); }

/* What an empty section offers instead of a sentence about being empty. */
.detail-add {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 0; background: none; border: 0; text-align: left;
  font-size: var(--text-md); font-weight: 700; color: var(--accent);
}
.detail-add-plus {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.detail-add:active { opacity: 0.7; }

/* A row that opens something elsewhere – the team chat. Flat, like
   everything else on this page; the icon tile is the only surface. */
.detail-open {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 0; background: none; border: 0; text-align: left;
}
.detail-open-icon {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--surface-2); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.detail-open-text {
  flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-open-text b { color: var(--ink); font-weight: 700; }
.detail-open:active { opacity: 0.7; }

/* The join code, after the athletes it is for. It used to be a card above
   the plan with the biggest type on the screen, for something used once per
   session by somebody else. */
.join-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0 2px; font-size: var(--text-sm); color: var(--ink-soft);
}
.join-row-main { display: inline-flex; align-items: center; gap: 7px; }
.join-row-main svg { color: var(--ink-faint); }
.join-row-main b {
  color: var(--ink); font-weight: 800; font-size: var(--text-md);
  letter-spacing: 0.1em; font-variant-numeric: tabular-nums;
}
.join-row-meta { color: var(--ink-faint); }
.join-row-copy {
  margin-left: auto;
  /* 44px to the thumb: the Copy button is the only thing on this row anyone
     presses, and a 35px target is the one it would be pressed with. */
  min-height: 44px; padding-top: 0; padding-bottom: 0;
}

/* ---------- Getting there ----------
   The place on a session, as a way of getting there: the link hands the
   address to the phone's map app with directions already asked for.
   Underlined in the body colour rather than in the accent – the accent is
   for what the app itself does, and this leaves the app – with the arrow
   saying the same thing a second way, since an underline on a screen with
   no other links in prose reads as emphasis.
   The vertical padding is cancelled by an equal negative margin: a 44px
   touch target without a 44px line. */
.map-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: inherit; text-decoration: none;
  /* 15, not 14: the line is 12.5px text now (it was 16), and 14 left the
     target a pixel short of 44. */
  padding: 15px 0; margin: -15px 0;
}
.map-link svg { color: var(--ink-faint); flex: none; }
/* The arrow carries the whole signal, in the colour that means "this does
   something" everywhere else in the app. The underline it replaces said
   "link" in a page with no other links in prose – which is exactly why it
   read as emphasis on the one line that is pure fact. An arrow leaving the
   line, in the accent, says the same thing without dressing the address up
   as a heading. The pin stays grey: it labels the line, it isn't the
   control. */
.map-link svg:last-child { color: var(--accent); }
.map-link:active { opacity: 0.6; }
.map-link:active svg:last-child { color: var(--accent-dark); }

/* Full-bleed footer of the card (hence the card's 0 bottom padding and the
   negative side margins): a hairline separates it, so it reads as its own
   tap target rather than as a third line of text. */
.fb-strip {
  display: flex; align-items: center; gap: 14px;
  margin: 0 -14px; padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: none; text-align: left; width: calc(100% + 28px);
}
.fb-strip:active { background: var(--surface-2); }
.fb-stat { display: flex; align-items: center; gap: 5px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-faint); }
.fb-stat svg { flex: none; }
.fb-stat.is-on { color: var(--ink-soft); }
.fb-stat.is-on svg { color: var(--success); }

/* The folded session chat on a finished session: one line saying how much
   was said and what the last of it was, in place of an open composer. */
.chat-summary { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; }
.chat-summary:active { background: var(--surface-2); }
.chat-summary-icon {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-soft);
}
.chat-summary .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-summary-count { font-size: var(--text-md); font-weight: 600; color: var(--ink); }
.chat-summary-last {
  font-size: var(--text-sm); color: var(--ink-soft); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Feedback thread ---------- */
/* Inside the athlete's feedback card: the reply step, shaped like the
   thing you'd tap rather than like a note about your own inaction. The
   whole card already opens the thread – this says where it leads. */
.fb-reply-prompt {
  align-self: flex-start; margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: var(--text-sm); font-weight: 700; color: var(--ink);
}
.fb-reply-prompt svg { color: var(--accent); flex: none; }
.feedback-thread { display: flex; flex-direction: column; gap: 10px; }
.fmsg { max-width: 84%; padding: 11px 14px; border-radius: 16px; font-size: var(--text-md); line-height: 1.45; }
.fmsg .fmeta { font-size: var(--text-xs); font-weight: 700; margin-bottom: 3px; opacity: 0.85; }
/* There is no .coach / .student pair any more. Two of the three threads
   used to pick a side from the author's role, which put a coach's own
   messages on the left of their own screen. A bubble's side is about who is
   reading, so the only two classes are .me and .other, below. */
.fmsg .fts { font-size: var(--text-micro); opacity: 0.6; margin-top: 4px; display: block; }
/* Mine right, everyone else's left – in every thread in the app, whoever is
   holding the phone. Team chat can have more than two people in it, so
   there was never a role that could have answered this anyway. */
.fmsg.me { align-self: flex-end; background: var(--student-soft); color: var(--ink); border-bottom-right-radius: 5px; }
.fmsg.other { align-self: flex-start; background: var(--accent-soft); color: var(--ink); border-bottom-left-radius: 5px; }
.fmsg.me .fmeta { color: var(--student); }
.fmsg.other .fmeta { color: var(--accent); }
/* A message from whoever spoke last, with no name over it. Pulled closer to
   the one above and squared off on the joining corner, so a run reads as
   one turn rather than as separate arrivals – which is the point of
   dropping the repeated name in the first place. */
.fmsg.is-run { margin-top: -6px; }
.fmsg.me.is-run { border-top-right-radius: 6px; }
.fmsg.other.is-run { border-top-left-radius: 6px; }

.feedback-compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
/* --text-input, not --text-md. This is the box a coach and an athlete type
   every message into, and at 14px iOS Safari zoomed the whole page in on
   focus and never zoomed back out – the exact thing the note on
   --text-input says must never happen. */
.feedback-compose textarea {
  flex: 1; border-radius: 16px; border: 1.5px solid var(--border); padding: 11px 14px;
  font-size: var(--text-input); min-height: 44px; max-height: 120px; background: var(--surface); color: var(--ink);
}
.feedback-compose textarea:focus { outline: none; border-color: var(--accent); }
.send-btn {
  width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.send-btn:disabled { opacity: 0.4; }

.no-feedback-hint {
  text-align: center; color: var(--ink-faint); font-size: var(--text-sm); padding: 18px 10px;
}

/* ---------- Login ---------- */
/* Background photo (assets/login-bg.jpg) with a dark scrim gradient layered
   on top so the form stays legible over busy image regions regardless of
   which color theme is active – the login screen intentionally always uses
   light text here rather than following --ink/--ink-soft, the same way a
   photo-hero section on a marketing site would. bundle.js base64-inlines
   this image into the single-file demo build since that build can't
   reference an external asset file. */
.login-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  padding: calc(48px + env(safe-area-inset-top)) 26px 30px;
  background:
    linear-gradient(180deg, rgba(6,10,8,0.45) 0%, rgba(6,10,8,0.72) 55%, rgba(6,10,8,0.92) 100%),
    url('../assets/login-bg.jpg') center / cover no-repeat;
}
.login-logo {
  width: 68px; height: 68px; border-radius: 20px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: var(--on-accent); margin-bottom: 22px;
  box-shadow: 0 12px 26px -12px rgba(163, 230, 53, 0.25);
}
/* Versus Coach wordmark (assets/logo-wordmark.png) shown at the top of the
   login/password-recovery/complete-invite screens, in place of a generic
   icon badge – its own gradient already reads clearly over the dark scrim
   above the background photo, in both color themes. */
.login-logo-img { display: block; width: 208px; max-width: 62%; height: auto; margin: 0 0 22px; filter: drop-shadow(0 10px 22px rgba(0,0,0,0.45)); }
.login-screen h1 { font-size: 27px; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 6px; color: #FFFFFF; text-shadow: 0 2px 12px rgba(0,0,0,0.35); }
.login-screen .tagline { color: rgba(255,255,255,0.82); font-size: var(--text-md); margin: 0 0 30px; line-height: 1.5; text-shadow: 0 1px 8px rgba(0,0,0,0.3); }
.login-screen .field label { color: rgba(255,255,255,0.78); }
.login-screen .hint { color: rgba(255,255,255,0.7); }
.login-screen .link-btn { color: var(--accent); }
.login-screen .checkbox-field label { color: rgba(255,255,255,0.82); }
/* The public pages, from the one screen a visitor without an account can
   reach. Quiet, in a row, 44px to the thumb – they are an answer to "what
   is this?", not a call to action competing with the sign-in button. */
.login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; margin: 18px 0 0; }
.login-links a {
  color: rgba(255,255,255,0.7); font-size: var(--text-sm); font-weight: 600;
  text-decoration: none; padding: 12px 0;
}
.login-links a:hover { color: #fff; text-decoration: underline; }
/* Non-active role-switch buttons get light/translucent styling only on the
   photo-background login screen (js/views/login.js) – profile.js also
   reuses .role-switch for its own (non-photo) coach/athlete toggle, so that
   usage must keep the normal --ink-soft/--border theme colors below. */
.login-screen .role-switch button:not(.active) {
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.28);
}
.role-switch { display: flex; gap: 10px; margin-bottom: 22px; }
.role-switch button {
  flex: 1;
  padding: 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--ink-soft);
  background: transparent;
  border: 1.5px solid var(--border);
}
/* Same "selected, not focused" treatment as .pill-tabs above – this toggle
   (Log in/Sign up on the login screen, coach/athlete preview in Profile)
   used to carry the identical lime halo. */
.role-switch button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.demo-account-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--surface); border-radius: 16px; margin-bottom: 10px; border: 1.5px solid var(--border);
}
.demo-account-row .grow { flex: 1; }
.demo-account-row .name { font-weight: 800; font-size: var(--text-md); color: var(--ink); }
.demo-account-row .role { font-size: var(--text-sm); color: var(--ink-soft); }
.divider-text {
  display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: var(--text-sm);
  font-weight: 700; margin: 22px 0 16px; text-transform: uppercase; letter-spacing: 0.04em;
}
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Trial-end / coach paywall gating screens (js/views/trialGate.js) ---------- */
.gate-options { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.gate-option-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  text-align: left; padding: 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1.5px solid var(--border);
}
.gate-option-card:active { background: var(--surface-2); }
.gate-option-card .ic {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.gate-option-card .ic.tint-student { background: var(--student-soft); color: var(--student); }
.gate-option-card .ic.tint-success { background: var(--success-soft); color: var(--success); }
.gate-option-title { font-size: var(--text-lg); font-weight: 700; color: var(--ink); }
.gate-option-sub { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.45; }

.paywall-price-card {
  margin-top: 10px; padding: 20px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1.5px solid var(--border); text-align: center;
}
.paywall-price { font-size: 34px; font-weight: 800; color: var(--ink); }
.paywall-price span { font-size: var(--text-md); font-weight: 600; color: var(--ink-soft); }
.paywall-features { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.paywall-features div { display: flex; align-items: center; gap: 8px; font-size: var(--text-md); color: var(--ink-soft); }
.paywall-features svg { color: var(--accent); flex: none; }

/* ---------- Profile ---------- */
/* min-width: 0 on the text block, or a long name refuses to shrink below
   its intrinsic width and pushes the whole header past the screen edge –
   which is exactly what "Liam Alexander Fitzgerald-Kowalczyk" did at 320px
   (70px of overflow). The name wraps; the email breaks anywhere, since
   there's nothing to hyphenate in an address. */
/* The bottom padding is the point of this rule. Two sections on this screen
   sit 22px apart (the card's 12px bottom margin collapses into the next
   title's 22px top margin), and the identity block was separated from the
   first of them by 20px of its own padding plus that same 22px – 42px, or
   1.9 section gaps. Near enough to one that the block read as the first
   section of the screen rather than as its header.
   44px here takes it to 66px, which is three gaps: past the point where the
   eye can mistake it for the same interval. On an athlete's page a card
   follows immediately instead of an uppercase eyebrow, so the same rule
   gives 44px there – less, but from one number rather than two.
   (It was 34/56, i.e. 2.5 gaps, which was already a header rather than a
   section. The last ten came from the ask for "8-16px more breathing room",
   and the screen could afford them: turning the topbar's 22px title into an
   eyebrow gave back more than that from above.) */
.profile-header { display: flex; align-items: center; gap: 14px; padding: 6px 2px 44px; }
/* Styled by what it is, not by "any div in here". This was `> div` twice
   over: first it matched the avatar's wrapper on the Profile screen and left
   a ~180px hole between the photo and the name, and after that was patched
   with an exemption it still matched the bare .avatar on an athlete's page,
   where there is no wrapper – stretching a 52px circle into a 166x52 lozenge,
   because border-radius:50% on a non-square box is an oval. Naming the text
   block ends the whack-a-mole: nothing else in this row can be stretched by
   accident, whatever markup a future screen uses.
   The min-width:0 is what lets a long name or email wrap instead of pushing
   the row wider. */
.profile-header .profile-header-text { min-width: 0; flex: 1; }
.profile-header .name { overflow-wrap: break-word; }
.profile-header .email { overflow-wrap: anywhere; }
/* --text-h1 and 800, i.e. the same setting as a screen title in the topbar –
   because on both screens that use this block the person IS the subject of
   the screen, which is already why the athlete page writes the name in an
   <h1> and puts "Athlete" in the bar as an eyebrow. It was h2/900: one step
   down in size and one up in weight, which next to a 64px avatar read as
   small and shouty at the same time. Dropping to 800 with the topbar's
   tighter tracking is what keeps 22px from looking heavier than 19px did. */
.profile-header .name { font-size: var(--text-h1); font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.02em; }
/* One step down the scale – h1 to h2, 22px to 19px – on a header that sits
   above a page rather than being one. It is still the <h1>: the person is
   still the subject of the screen, they are just not the only thing on it.
   A step rather than a percentage, so the name stays a value the type scale
   defines and not a number somebody typed. */
.profile-header.compact .name { font-size: var(--text-h2); }
/* 2px, because the name grew and the email did not: at h2 the two lines sat
   comfortably, at h1 the email was tucked under the descenders. */
.profile-header .email { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 2px; }
.trial-banner { padding: 16px; }
.trial-banner-top { display: flex; align-items: center; gap: 12px; }
.trial-banner-top .ic {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.trial-banner-top .ic.tint-success { background: var(--success-soft); color: var(--success); }
.trial-banner-title { font-size: var(--text-md); font-weight: 700; color: var(--ink); }
.trial-banner-sub { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 2px; }
.settings-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border);
  /* Half these rows are <button>s and half are <div>s, and a button centres
     its text by default – which is why "Theme" and "Date format" sat in the
     middle of the row while "Push notifications" and "Athletes" sat at the
     left. Set once here rather than as an inline style each row has to
     remember. */
  text-align: left;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .ic {
  width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--ink-soft); flex: none;
}
.settings-row .ic.tint-accent { background: var(--accent-soft); color: var(--accent); }
.settings-row .ic.tint-student { background: var(--student-soft); color: var(--student); }
.settings-row .ic.tint-success { background: var(--success-soft); color: var(--success); }
.settings-row .ic.tint-warn { background: var(--warn-soft); color: var(--warn); }
.settings-row .ic.tint-danger { background: var(--danger-soft); color: var(--danger); }
/* --ink, not --row-title. Same legacy fourth grey that the session rows, the
   search rows and the athlete rows were each moved off as their tab came up
   for review: #E2E8F0 in dark and #1F2937 in light, neither of which is one
   of the three the palette actually defines. Here it was on the label of
   every settings row – "Theme", "Date format", "Push notifications" – which
   is to say on most of the words on this screen. */
.settings-row .lbl { flex: 1; font-family: var(--font); font-weight: 600; font-size: var(--text-md); color: var(--ink); }
/* Was an inline margin-right:6px repeated on every row's value, and missing
   from the two that weren't buttons – so "11" sat six pixels further right
   than "Monday" did. */
.settings-row .val { color: var(--ink-soft); margin-right: 6px; }
.settings-row:hover { background: var(--row-hover-bg); }
.settings-row:active { background: var(--row-selected-bg); }
.settings-row:active .lbl { color: var(--row-selected-text); }

/* A group of settings rows with a heading over it and no box around it.
   (Rows inside a bottom sheet keep the card treatment above: there the box
   IS the sheet, and the hairlines are what separate a handful of choices.)
   The negative margin takes the rows out of .content's 20px gutter and the
   padding puts it back inside them, so the text keeps the app's column while
   a press lights the full width of the screen – the same full-bleed row the
   Sessions and Athletes tabs use, without making the whole screen .tight and
   dragging the About card and the Log out button out to the edges with it.
   No hairline between rows. A rule is a boundary, and a boundary between
   every two rows of a two-row group says there are two groups where there is
   one; what parts these rows is that each begins with an icon tile. */
.settings-list { margin-left: -20px; margin-right: -20px; }
/* 11px, not 13. Eleven rows at 60px were 53% of the tallest screen in the
   app, so this is where the height actually was – and a settings row is not
   the Calendar's grid, where the pitch IS the touch target and a pixel out
   of it is a pixel out of the day you are aiming at. Nothing shares this
   band: 56px painted, 56px to a thumb, still twelve above the floor. */
.settings-list .settings-row { width: 100%; padding: 11px 20px; border-bottom: none; }
/* The gap between one group and the next heading, and between that heading
   and its own rows – both taken in, by the same proportion, so the heading
   goes on belonging to the list below it.
   That ratio is the whole reason the second rule exists. Trimming only the
   top took the optical gaps from 44/32 to 36/30, i.e. from 1.38 down to
   1.20, and a heading that sits nearly as close to the group above as to
   its own is a heading you have to think about. Taking 4px off the bottom
   as well lands at 36/26 – 1.38 again, the same relationship as before,
   88px shorter.
   The negative margin is how: a heading cannot be selected by what follows
   it, so the list reaches up and eats 4px of the heading's own margin. Both
   rules are scoped to .settings-list, which exists only on this screen. */
.settings-list + .section-title { margin-top: 16px; }
.section-title + .settings-list { margin-top: -4px; }
/* A row that goes nowhere has no chevron, so without this its value runs 22px
   further right than every other value on the screen and the right-hand
   column goes ragged at exactly one row. 16px of glyph + the row's own 12px
   flex gap + the 6px every value already carries = 34, kept in one place so
   it can't drift from the chevron it is standing in for. (28 looked right
   and measured 6px out: the flex gap is easy to forget because nothing in
   the markup mentions it.) */
.settings-list .settings-row.no-chevron .val { margin-right: 34px; }
/* The tile is what parts one row from the next now that the hairlines are
   gone, so it has to stay visible – and taking the card away moved it onto a
   different backdrop in each theme, in opposite directions. Measured against
   its own background: dark went 1.09:1 on the card to 1.16:1 on the page,
   which is better, while light went 1.16:1 to 1.066:1, which is close enough
   to invisible that the anchor this list is built on quietly stopped being
   one. A hairline restores it in both (1.19:1 light, 1.36:1 dark) without
   touching the fill or the 34px box, since everything here is border-box.
   Every tile in a settings list is this one neutral tile – Athletes and
   Exercises gave up their blue and green – so there is no tinted case to
   exempt here. tests/profile-tab.js asserts that, which is what keeps this
   rule from silently applying to a tint it was never designed for. (The
   tinted .settings-row still exists inside a sheet: "Remove photo" is red,
   where red is doing real work.) */
.settings-list .settings-row .ic { border: 1px solid var(--border); }
/* The label's column. .lbl keeps flex:1 for the hand-written rows inside
   sheets; in a settings list the column is what grows, and .lbl sits inside
   it at its natural height so a second line can follow. */
.settings-list .settings-row .lbl-col { flex: 1; min-width: 0; }
.settings-list .settings-row .lbl-col .lbl { flex: none; }
/* One line, ellipsised. An unclamped second line is what made a pending
   invite row 25px taller than the ones around it on the Athletes tab, and a
   settings row is the same shape of mistake: this text explains the row, so
   it must not be able to reshape it. */
.settings-row .sub {
  font-size: var(--text-sm); color: var(--ink-soft); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Style guide (js/views/styleguide.js) ----------
   Documentation UI: deliberately plain, so nothing here competes with the
   components it's showing. */
.sg-note { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.5; margin: 0 0 12px; }
.sg-sub { font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin: 14px 0 6px; }
.sg-list {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.sg-list > * { border-bottom: 1px solid var(--border); padding: 12px 14px; }
.sg-list > *:last-child { border-bottom: none; }
.sg-type-sample { color: var(--ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-type-meta { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.sg-type-meta span { font-size: var(--text-sm); color: var(--ink-faint); }
.sg-color-row { display: flex; align-items: center; gap: 12px; }
.sg-color-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sg-swatch { width: 34px; height: 34px; border-radius: 9px; flex: none; border: 1px solid var(--border); }
.sg-color-name { font-size: var(--text-md); font-weight: 600; color: var(--ink); }
.sg-color-desc { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.35; }
.sg-color-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.sg-color-meta span { font-size: var(--text-xs); font-weight: 800; }
.sg-pass { color: var(--success); }
.sg-ok { color: var(--warn); }
.sg-low { color: var(--ink-faint); }
.sg-demo { margin-bottom: 16px; }
.sg-demo-label {
  font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
}
.sg-demo-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-faint); }
.sg-row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
/* The real bottom nav is fixed to the viewport; this shows it in place. */
.sg-nav-demo { position: relative; height: 74px; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.sg-nav-demo .bottom-nav { position: absolute; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-sm); color: var(--ink-soft); }

/* ---------- Misc ---------- */
.spacer { flex: 1; }
.center-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mt-auto { margin-top: auto; }
.link-btn { color: var(--accent); font-weight: 700; font-size: var(--text-md); background: none; border: none; padding: 0; cursor: pointer; }
.text-soft { color: var(--ink-soft); }
/* The email field and its send button share one border, the way the
   duration box shares one with its unit – two controls that do one job
   reading as one control. The envelope names what belongs in the box; the
   button is the action, and it lives inside rather than beside, which also
   buys back the ~100px a labelled "Invite" button was taking from the
   address. */
.invite-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 13px; padding: 5px 5px 5px 12px;
  color: var(--ink-faint);
}
.invite-field:focus-within { border-color: var(--accent); }
.invite-field-icon { flex: none; display: flex; align-items: center; }
/* Bare inside the shared box: the border, background and radius belong to
   the wrapper, so the input draws nothing of its own. */
.invite-field input {
  flex: 1; min-width: 0;
  border: none; background: none; border-radius: 0; padding: 0;
  font-size: var(--text-input); color: var(--ink);
}
.invite-field input:focus { outline: none; }
/* 34px, not the 44px of the chat send button: this one sits inside a field
   rather than beside one, and 44 would leave no room to breathe. */
.invite-send {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.12s ease;
}
.invite-send:disabled { opacity: 0.35; }
.pending-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--warn-soft); color: var(--warn); font-size: var(--text-sm); font-weight: 700;
  padding: 5px 10px; border-radius: 20px;
}
.selected-people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.person-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border-radius: 20px; padding: 5px 6px 5px 5px; font-size: var(--text-sm); font-weight: 700;
  color: var(--ink);
}
.person-chip button { color: var(--ink-faint); width: 18px; height: 18px; display:flex; align-items:center; justify-content:center; }
/* A group heading inside a picker sheet. Same shape as .section-title but
   scoped, because a picker's body has its own padding. */
.picker-group {
  font-size: var(--text-micro); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 14px 0 2px; padding: 0 4px;
}
.picker-group:first-child { margin-top: 2px; }

.picker-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 4px;
}
/* min-width: 0 or a long name refuses to shrink and pushes the row out of
   the sheet – 40px of overflow at 320px with a real double-barrelled name. */
.picker-row .grow { flex: 1; min-width: 0; color: var(--ink); }
.picker-title, .picker-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-title { font-weight: 700; font-size: var(--text-md); }
.picker-sub { font-size: var(--text-sm); color: var(--ink-soft); }
.picker-row .check {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--on-accent); flex: none;
}
.picker-row.selected .check { background: var(--accent); border-color: var(--accent); }
.picker-row.has-count { background: var(--surface-2); border-radius: 12px; }
.picker-row .count-badge {
  flex: none; font-size: var(--text-xs); font-weight: 800; color: var(--accent);
  background: var(--accent-soft); padding: 3px 9px; border-radius: 20px;
}
.picker-row .add-btn {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.picker-row .add-btn:active { transform: scale(0.92); }
.exercise-pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.exercise-pick-row:last-child { border-bottom: none; }

/* ---------- Calendar tab (month grid + agenda) ---------- */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 16px 6px;
}
/* The month arrows were 40px filled chips with a border – the weight came
   from the chrome, not the size, so they're plain glyphs here instead.
   They were then painted at 44x44, which is what set the header's height:
   the month-and-year block beside them is 38px, so six pixels of the row
   existed only to hold two arrows at the touch floor. They paint at 36 and
   reach 46 through the extension below – the same trade every other icon
   button on this tab already makes. */
.cal-header .icon-btn {
  width: 36px; height: 36px;
  background: transparent; border-color: transparent;
  color: var(--ink-soft);
  position: relative;
}
.cal-header .icon-btn::before { content: ""; position: absolute; inset: -7px -5px; }
.cal-header .icon-btn:active { color: var(--ink); transform: none; }
/* Title centred, "Today" centred under it when there is one.
   Beside the title is where it does not fit: on a 320px phone
   "September 2026" leaves 24px of spare room on each side and the pill is
   58px wide, so either the pill lands on top of the title or the title has
   to shrink to make room. Under it, the title keeps its size at every width
   and the pill keeps its own line.
   The cost is that the grid moves down while the pill exists. That is a
   fair trade here because of WHEN it appears: only on the step off this
   month and back onto it, and that step redraws every date and every dot on
   the screen anyway. Paging on from there – October to November to
   December – does not move anything, which is the case that repeats. */
.cal-header-title-block {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  flex: 1; min-width: 0;
}
/* Stepped down from 21/13: the month is a label for the grid, and at the
   old size it carried nearly as much weight as the grid itself. */
/* "September 2026" on one line, in the primary text colour.
   It was "SEPTEMBER" in tracked-out 900-weight caps over a separate "2026",
   in the accent – a wordmark where a label was needed. Three things were
   wrong with it and they came off one at a time: the colour (a month name
   is a passive label, which the RULES block at the top of this file names
   as exactly what the accent is never for), then the two lines (the month
   and the year are one fact and read as one), then the caps and the
   tracking, which were what made it look like a logo rather than a heading.
   The grid under it is the thing the coach is meant to look at. */
.cal-header-month {
  max-width: 100%; text-align: center;
  font-size: var(--text-h3); font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
  line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Only shown when the coach has paged away from this month, so it must be
   able to appear and disappear without moving anything: it sits in the
   spare room to the right of the centred title rather than in the flow.
   The title reserves room for it (padding-right below) so a long month
   cannot run underneath it. */
.cal-today-btn {
  position: relative; flex: none;
  font-size: var(--text-xs); font-weight: 800; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 20px; padding: 3px 10px;
}
/* 20px painted; the extension is what makes it a real target, and it grows
   downwards more than upwards so it does not steal the title's own band. */
.cal-today-btn::before { content: ""; position: absolute; inset: -11px -12px -15px; }
/* One step down the scale: these are seven single letters that never change
   and that you stop reading after the first week. At --text-sm they were the
   same size as the meta lines in the agenda below. */
.cal-weekday-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 0 16px; margin-bottom: 4px;
}
.cal-weekday-row span {
  text-align: center; font-size: var(--text-xs); font-weight: 700;
  color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em;
}
/* The row gap is the one number here that is not free: in a tiled grid the
   pitch IS the touch target, so every pixel taken out of it comes off the
   day you are trying to tap. 6px holds a 34px cell at a 40px pitch, which
   is what keeps a day at 44px to a finger once the extension below is
   counted. Everything else in this block was cut instead. */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px; padding: 0 16px 4px;
}
/* Fixed 40px circles centred in their column, rather than aspect-ratio:1
   cells that grew to the full column width (~50px on a phone). The month
   holds very little information, so it shouldn't cost ~340px of height to
   show it: this takes the row pitch from ~56px to ~44px, about 22% less,
   without turning the day highlight into an ellipse. */
/* Three states, three separate signals, so they can co-exist:
     dots under the number = this day has sessions (one dot each, max 3)
     ring around the number = today
     filled circle          = the selected day
   They used to share the background: a day with sessions was tinted, a
   selected day was filled, and today was a ring – so a filled day read as
   "selected" whether it was or not, and selecting today did nothing
   visible at all (the old rule was .selected:not(.today)). */
.cal-day {
  /* Not a fixed 40px. `1fr` is `minmax(auto, 1fr)`, so a fixed-width child
     puts a floor under its column: seven 40px cells plus the gaps came to
     316px inside a 288px content box on a 320px phone, and the last column
     ran 28px off the right edge. Nothing caught it – the overflow is
     clipped rather than scrolled, so responsive-audit's "no horizontal
     scroll" check saw a clean screen. The columns can collapse now
     (minmax(0, 1fr) above) and the cell takes what it is given, up to 40. */
  width: 100%; max-width: 40px; justify-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: transparent;
  /* The paint is 40x34 and the target is the whole column: a month grid is
     six rows of the same control, so what it costs in height it costs five
     more times. The extension is what lets the circle shrink without the
     day getting harder to hit – 50x44 to a finger. */
  position: relative;
  /* A <button> carries the UA's 1px of padding, which a <div> does not.
     Every day became a button (see js/views/calendar.js), so that 1px top
     and bottom appeared on all thirty of them and put 2px back on every row
     of the grid – ten pixels of the height that had just been taken out,
     from a change that had nothing to do with layout. */
  padding: 0;
}
.cal-day::before { content: ""; position: absolute; inset: -5px; }
.cal-day.empty { visibility: hidden; }
/* 28px, down from 34, at one step down the scale. The circle is a highlight
   for a two-digit number, and it was sized as though it were a button: 34px
   of circle around 14px of type, six rows deep. */
.cal-day-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft);
}
.cal-day.has-sessions .cal-day-num { color: var(--ink); }
.cal-day.has-sessions:active { filter: brightness(0.9); }
/* Today is a state the app worked out, not a day the coach chose – so it
   takes the status colour, exactly like "Now" on the Sessions tab, and not
   the accent. It wore the accent, which is also what the SELECTED day
   wears: the one state you can change and the one state you cannot were
   the same colour, and on the day you opened the tab they were the same
   circle. Two states, two colours. */
.cal-day.today .cal-day-num { box-shadow: 0 0 0 2px var(--success) inset; color: var(--success); }
.cal-day.selected .cal-day-num { background: var(--accent); color: var(--on-accent); box-shadow: none; }
/* Today *and* selected: the fill says selected, and an offset ring outside
   it (with a gap in the page color) still says today. */
.cal-day.selected.today .cal-day-num { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--success); }
/* Every day is pressable now, so the ones with nothing on them need to say
   that they are still a day and not a control begging to be used: no hover
   tint, and the number keeps the muted step that --ink is reserved from. */
.cal-day:not(.has-sessions):not(.has-activities):active .cal-day-num { opacity: 0.6; }
.cal-day.has-activities .cal-day-num { color: var(--ink); }
/* Always present, even with no dots, so every row lines up on the same
   baseline whether or not that week has sessions. */
.cal-day-dots { display: flex; align-items: center; gap: 3px; height: 4px; }
/* How many, not what kind. The dots were lime for an upcoming session and
   grey for a day whose sessions were over – but the accent means an action
   or a selection in this app (see the RULES block at the top of this file),
   and a dot under a date is neither; it is a passive label, which that rule
   names as the thing the accent is never for. The grey/lime split was also
   restating the grid's own geometry, since a day with nothing upcoming on it
   is by definition a day left of the ring around today.
   So the count is the signal and the colour is spent once, on the only
   distinction counting cannot make. */
.cal-day-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-soft); }
/* A coach's own commitment, in violet – the one colour on this grid that
   means anything, because it is the one thing a dot cannot say by counting:
   a day with only violet dots has no training on it at all. */
.cal-day-dots i.personal { background: var(--personal); }

/* ---------- How much is in this month ----------
   Under the grid, above the list: the dots say which days, this says how
   many. Same two colours, so the line is also the legend the grid never
   had – and a day with only violet in it is a month with no training on
   that day, which is the one thing counting cannot show. */
.cal-month-summary {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 14px 20px 0; margin: 0;
  font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft);
}
.cal-month-summary span { display: inline-flex; align-items: center; gap: 7px; }
.cal-sum-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); flex: none; }
.cal-sum-dot.personal { background: var(--personal); }

/* ---------- Calendar tab agenda list (selected day's sessions) ----------
   Two classes, not one, and both margins rather than just the top. This
   said `margin-top: 24px` on `.cal-agenda-label` alone, which never applied:
   .day-group-label's own `margin` shorthand sits further down the file at
   the same specificity, so the calendar's labels have always rendered at
   that rule's 22/7. Tightening the Sessions tab's label would have silently
   moved this tab with it, and this tab is not part of that review – so the
   22/7 it actually had is written down here, where it wins. */
.day-group-label.cal-agenda-label { margin-top: 22px; margin-bottom: 7px; }
/* The day + "show whole month" on one line, so the escape hatch sits with
   the thing it undoes rather than floating centred above the list. */
.cal-agenda-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 0 20px; margin: 18px 0 8px;
}
.cal-agenda-head .cal-agenda-label { flex: 1; min-width: 0; }
/* The day you picked, echoing the one accent-filled circle in the grid
   above. It is a selection, which is what the accent is for (see the RULES
   block at the top of this file) – and it is the reason this heading is not
   the same --ink-soft micro label the whole-month list uses for its days.
   The screen has to show which number up there this list came from, or the
   grid and the list read as two things that happen to share a screen. */
.cal-selected-day {
  flex: 1; min-width: 0;
  font-size: var(--text-md); font-weight: 800; color: var(--accent);
  letter-spacing: 0.04em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The way back. An action, but the quiet one: this row is about the day,
   not about undoing it, and two accent-coloured things in one line made the
   escape hatch louder than the thing it escapes from. */
.cal-clear-day {
  flex: none; margin: 0; background: transparent; border: none;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft);
  position: relative;
}
.cal-clear-day::before { content: ""; position: absolute; inset: -13px -8px; }
.cal-clear-day:active { color: var(--ink); }
/* An empty day is an answer, so it is written like one – the same quiet
   line the Sessions tab uses, not a hint or an error. */
.cal-day-none {
  margin: 0 20px; font-size: var(--text-md); color: var(--ink-soft);
}
/* ---------- Earlier this month ----------
   The half of the list a coach can no longer act on. It used to be the same
   card, the same size and the same weight as what is still to come, so a
   month three quarters gone gave three quarters of its list to the past.
   Three things separate it, in this order – the same order the Sessions
   tab's Recent block uses, because it is the same job:

     no card ..... what is ahead is a row you can act on and so it keeps its
                   surface; what is behind sits flat on the background.
     less air .... 22px between rows against the 10px margin plus the card's
                   own padding above, so the block is visibly tighter.
     less type ... the title drops a weight; the colours are already a step
                   down via .is-finished, which the rows carry anyway.

   What it does NOT change is the row's shape. A different arrangement –
   date first, time on the right – would read as a different KIND of thing
   rather than as the same thing, older, which is the one idea here. */
.cal-past .session-row { padding-top: 3px; padding-bottom: 3px; }
.cal-past .session-row + .session-row { margin-top: 6px; }
.cal-past .srow-title { font-weight: 600; }
.cal-past .day-sep { margin-top: 10px; margin-bottom: 4px; }
/* The section heading sits closer to the block it heads than the gap above
   it, so "Earlier this month" belongs downwards. */
.cal-agenda .section-title + .cal-past { margin-top: -2px; }

/* ---------- The coach's own time ----------
   A personal activity borrows the session row wholesale – same shape, same
   type, same spacing – and is marked by a violet edge down it and the words
   "Own time" where a session names its place. It used to be marked by a 7px
   violet dot after the title: the only difference between "I'm coaching"
   and "I'm at the dentist" was the smallest thing on the row, and it was
   carried by colour alone, which says nothing to a reader who can't tell
   violet from grey. The edge is read in peripheral vision while scrolling;
   the words answer it for everyone else. The row's own shape is unchanged –
   two shapes in one day's list would read as two kinds of list.
   The edge replaces padding rather than adding to it (17 + 3 = the 20px
   every other row starts at), so nothing shifts sideways. */
.session-row.is-personal { border-left: 3px solid var(--personal); padding-left: 17px; }
.session-row.is-personal .srow-time { color: var(--personal); }
.session-row.is-personal .srow-place { color: var(--personal); opacity: 0.9; }
/* With a date rail the edge belongs to the row's body, not to the left of
   the date – the date column is the list's, not the activity's. It eats the
   12px gap (12 = 3 + 9) so the titles stay in the one column. */
.session-row.has-rail.is-personal { border-left: 0; padding-left: 20px; }
.session-row.has-rail.is-personal .srow-body {
  border-left: 3px solid var(--personal); padding-left: 9px; margin-left: -12px;
}
/* Not on the Calendar tab, where the edge ran down a list that is already a
   column of date rails and hairlines – one vertical line too many. The
   violet time and the words "Own time" still say whose time it is, and they
   say it in the row rather than beside it. */
.cal-agenda .session-row.is-personal { border-left: 0; padding-left: 20px; }
.cal-agenda .session-row.has-rail.is-personal .srow-body {
  border-left: 0; padding-left: 0; margin-left: 0;
}
.dot.personal { background: var(--personal); }

/* The clash heads-up, shown live in both forms while the date/time is being
   set. Amber, not red: nothing is blocked and nothing is wrong – the coach
   may well want both things on the same evening and just needs to know. */
.clash-note {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 14px 0 0; padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--text-sm); font-weight: 600; line-height: 1.45;
}
.clash-note svg { flex: none; margin-top: 1px; }

/* Day-group header ("SUN · JUL 26" – see formatDateLong in
   js/components.js). Deliberately quiet, but not faint: it's what you scan
   for when scrolling a long list, so it sits at --ink-soft rather than
   --ink-faint. Its uppercase, letter-spaced, bold treatment is what keeps
   it distinct from the body text it now shares a color with. */
.day-group-label {
  font-family: var(--font);
  font-size: var(--text-micro);
  font-weight: 700;
  color: var(--ink-soft);
  /* It IS the separator, so it carries the space rather than a gap between
     cards. The air above it used to be 32px – within a pixel of the 33px
     between two sessions on the SAME day, which meant the top of a day
     boundary announced nothing the ordinary row gap wasn't already saying.
     The label was doing all the work and the space above it was doing none,
     at 60px a boundary on a screen you scroll with a thumb.
     23 above and 13 below: a 48px boundary that is still clearly the bigger
     break (33px in-group), still weighted downwards so the label belongs to
     the group it heads, and 12px shorter every time the day changes. */
  margin: 13px 20px 4px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
/* Except at the very top of the list, where there's no previous group to
   separate from and the extra space just pushes the first card down. */
.content > .day-group-label:first-child { margin-top: 8px; }

/* ---------- Invitations (athlete Sessions tab, and the #respond page) ----------
   A card because it's something to act on, and the two buttons are the only
   accent on it: an answer is an action, the session details are not. */
.invitations { margin: 24px 20px 0; }
.invitations .section-title { margin-left: 0; margin-right: 0; }
/* The same 40px seam the briefing gets: what waits on you, then what's booked. */
.invitations + .sessions-heading { margin-top: 40px; }
.invite-card { padding: 16px; margin-bottom: 12px; }
.invite-title { font-size: var(--text-lg); font-weight: 700; color: var(--ink); }
.invite-when { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 3px; }
.invite-from { font-size: var(--text-sm); color: var(--ink-faint); margin-top: 3px; }
.invite-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.invite-actions .btn { flex: 1 1 auto; min-width: max-content; min-height: 44px; }
.respond-screen .content { max-width: 440px; margin: 0 auto; padding-top: 32px; }
.respond-brand { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 18px; }
.respond-screen h1 { font-size: var(--text-h1); font-weight: 800; margin: 0 0 16px; color: var(--ink); }
.respond-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.respond-actions .btn { width: 100%; min-height: 48px; }
.respond-error { color: var(--danger); font-size: var(--text-sm); }
.respond-foot { margin-top: 24px; font-size: var(--text-sm); }
.respond-foot a { color: var(--ink-soft); }

/* ---------- Profile → Coaches ---------- */
.connect-card { border-top: none; margin-top: 20px; padding-top: 0; }
.connect-card:first-child { margin-top: 4px; }
.connect-card .hint { margin-top: 8px; }
/* Resetting the code is the quiet option under the card, not an action on
   the level of Share: plain soft text, but still a full 44px to press. */
.connect-reset { background: none; border: none; padding: 0; min-height: 44px; cursor: pointer;
  font-size: var(--text-sm); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.connect-add { display: flex; gap: 8px; align-items: center; }
.connect-add input { flex: 1; min-width: 0; font-size: var(--text-input); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 10px 12px; border-radius: var(--radius-md, 12px); border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); }
.connect-add .btn { min-height: 44px; flex: none; }
.connect-add input::placeholder { text-transform: none; letter-spacing: 0; }
.coach-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.coach-row-actions { display: flex; gap: 6px; flex: none; }
.coach-row-actions .btn { min-height: 44px; }
.coach-row .icon-btn { width: 44px; height: 44px; flex: none; }
