/**
 * @implements §7.11, §8.2, §3, §14, §15, S17, S23, S24, S33, A14, Appendix G
 * Purpose: the app's own styles over shared/tokens.css and shared/status.css (the cockpit's, cited, never
 *   edited, A14): the layered dark ground (R2, 05/10/2026: ground, raised content surface, cards a step up;
 *   depth level "lift", Nicolas 05/10/2026: cards and tiles float on a soft drop shadow, buttons lift),
 *   the app-bar (56 px Black, top above 480 px, bottom below, S24), the athlete-route sub-row (44 px, S33),
 *   the pane (1440 px max, centred, coach side), cards with headers, big-number tiles, segmented controls,
 *   underline tabs, tables with 44 px hairline rows, tonal buttons and fields at 44 px, the toast's three
 *   states, is-busy, the two-step confirm, the states (empty, error, "Not yours.", the oracle gate line),
 *   the layout utilities the screens share, and the athlete side's shell (the 480 px phone layout at
 *   every width, the glyph tabs, the sticky sync-badge, is-pending and is-refused). Each athlete screen's
 *   own rules live in screens/athlete-*.css.
 * Inputs: the classes and attributes app.js and the screen files put on the DOM (listed below).
 * Outputs: styles only; the @font-face rules read /shared/fonts/. No rule depends on a style attribute
 *   (Appendix G: style-src 'self'); a width set from data goes through a custom property (GRIT.ui.setVar).
 */
/*
 * Brand rails (brand book §7.3.2, amended for the app by Nicolas's R2 ruling of 05/10/2026 and his depth
 * ruling "lift" of the same day, which supersedes the book's flat-depth rules for the app): colours and
 * fonts unchanged; corners 6 px on cards and panels, 4 px on buttons, fields and chips (the book's 2 px
 * rule is amended for the app); no pills; one Gunmetal fill per screen (.btn--fill, the primary action
 * only), every other button a soft tonal fill a shade lighter than what it sits on, no outline; Archivo
 * with an explicit weight on every rule (the variable file defaults to 600), tabular figures on every
 * number; links underline on hover; color-scheme dark. Status inks come from status.css
 * (html[data-status="a"][data-ground="dark"]).
 *
 * Depth, level "lift" (Nicolas, 05/10/2026; the only depth rules, every one through a token below):
 *   1. Tone first: each layer is a step lighter than the one under it (the surfaces list below); the
 *      ground is darker than before (#141618) so the pane and its cards stand off it.
 *   2. A card, a panel and a tile on the pane float: --ap-shadow (a 1 px top highlight inside, a soft
 *      8/24 drop and a tight 2/6 contact shadow) and a faint 5 % white edge (--ap-edge) instead of the
 *      hairline. A tile inside a card is flat (tone only), so only one level casts a shadow.
 *   3. Buttons lift: every tonal .btn (and .icon-btn) carries the 1 px top highlight (--ap-lift-btn);
 *      the one Gunmetal .btn--fill casts its own drop (--ap-lift-fill). Quiet and disabled buttons stay
 *      flat. Fields sink (--ap-inset), never lift.
 *   4. Everything else (the pane, the bar, rows, tabs, the segmented control's parts) stays flat: tone
 *      and 1 px hairlines. The toast and a dropped picker list keep their own overlay shadow.
 *
 * The surfaces, from the bottom up (tokens below; never a raw hex in a screen):
 *   --ap-ground   the page ground around the pane (darker than Iron)
 *   --ap-surface  the raised content surface: main#main is one 6 px panel of it (full bleed on a phone)
 *   --ap-card     a card or a tile, a step up from the surface (and lifted, depth rule 2)
 *   --ap-card-2   a step up from a card (a tile inside a card, a picker list dropped over a row)
 *   --ap-tonal    the tonal fill of a secondary button or a selected segment: translucent white, so it is
 *                 always a shade lighter than whatever it sits on
 *   --ap-under    what the current element sits on (main sets the surface, .card / .tile / .panel set
 *                 their own): sticky heads and rows paint it so nothing shows through
 *
 * The classes the screen builders share (reuse these before inventing; add a screen-scoped class
 * only when nothing here fits, and prefix it with the component name):
 *
 *   Layout     .stack (vertical flow, 16 px gaps), .stack-sm (8 px), .stack-lg (24 px, between cards)
 *              .row (horizontal, centred, 12 px gaps, wraps), .row-tight (8 px), .row-end (pushed right),
 *              .spacer (takes the free space in a .row), .grow (flex 1, min-width 0)
 *              .grid-2 (two columns from 1024 px, one below: the overview's card grid)
 *              .grid-auto (as many 280 px columns as fit), .full (width 100 %)
 *              .w-var (width from the --w custom property: GRIT.ui.setVar(el, 'w', '42%'))
 *              .sticky (sticks under the bar and the sub-row: week head, session head, S33)
 *              .scroll-x (a table or a grid wider than its box scrolls inside it, never the page: the
 *              program editor under 1024 px, R3)
 *   Text       .micro (kicker: 600, 11 px, uppercase, tracked), .muted (Ash), .num (tabular figures),
 *              .right, .nowrap, .ellipsis, .small (12 px), .strong (600), .display (Archivo Black, uppercase)
 *              .meta-line (Ash 13 px; join parts with GRIT.ui.metaLine, middle dots)
 *   Surfaces   .card (a lifted 6 px card, 24 px padding, faint edge), .panel (the same box for an inline
 *              panel without a header: close-wave, a picker), .surface (a block painted like the pane, for
 *              a group that sits on a card)
 *   Card head  .card-head: the card's first child, a hairline divider under it, edge to edge:
 *                h2 (the title) [.count (an inline number or short tag)] [.card-desc (one Ash line under
 *                the title)] [one control with .row-end (it sits at the right of the title line)]
 *              .card-body (the content under the head), .kv (dl: dt Ash, dd value), .facts (kv pairs in a row)
 *   Tiles      .tiles (a grid of tiles, as many 200 px columns as fit; .tiles--fit stretches the tiles
 *              across the row when there are fewer than fit) > .tile > .tile-label (Ash, above),
 *              .tile-value (the large tabular figure; a <small> inside for the unit; .tile-value--sm for a
 *              date or a few words, which would not fit at the figure's size; .ink-red / .ink-amber /
 *              .ink-green colour it), .tile-sub (an Ash line
 *              under it). A .tile in a .card steps up to --ap-card-2 and is flat (depth rule 2).
 *   Segmented  .seg (one grouped control: filters, week pickers) > button | a | .seg-label (a static
 *              leading part, e.g. "Week") | .seg-step (a prev / next arrow part, the glyph larger; a
 *              span with aria-disabled="true" holds the place of an arrow that goes nowhere); the chosen
 *              part carries aria-pressed="true", aria-current or aria-selected="true" (or .is-current).
 *              Scrolls sideways inside itself when it outgrows the row.
 *   Tabs       .utabs > a | button (underline tabs over a hairline; aria-current="page" or aria-selected="true")
 *   Tables     .tbl (44 px rows, hairline rules, sticky header, right-aligned tabular numbers), th.num /
 *              td.num (right, tabular), tr.is-current (the keyboard row), tr.is-removed (struck through,
 *              Ash), .tbl--grid (the editing grids: cells hold .cell inputs edge to edge), .row-link (a
 *              whole row that opens)
 *   Controls   .btn (the secondary button: a tonal fill with the lift's top highlight, no outline, 44 px;
 *              .btn--tonal says it out loud), .btn--fill (THE one Gunmetal fill per screen, its own drop
 *              shadow), .btn--quiet (no fill and no lift until hover), .link
 *              (a 44 px text link), .icon-btn (44 x 44 tonal square), .sq (a yes/no square in a 44 px
 *              hit; aria-pressed or aria-checked="true" fills it), .pick-option (one match row of an
 *              inline picker list; .is-current marks the highlighted one)
 *   Fields     .field (label above input), .in (input, select or textarea, 44 px, a 4 px inset box),
 *              .cell (an input inside a grid cell, 44 px, no box until focus), [aria-invalid="true"]
 *              (a refused value: red edge until Escape or a good commit)
 *   States     .is-busy (dims and pulses; set by GRIT.app.write), .empty (the empty line), .state (a
 *              whole-pane state: "Not yours.", error, offline), .gate-line (the oracle gate's Ash line),
 *              .is-pending (an athlete control whose queued write waits: a Gunmetal underline, nothing
 *              dims, it stays editable; set by GRIT.app.log), .is-refused (the queue stopped at its write:
 *              the red edge, as [aria-invalid])
 *   Bands      .badge with s-white / s-green / s-green-light / s-amber / s-red-light / s-red (status.css
 *              colours them; the size is set here), .bdot (an 8 px band dot), .ink-red / .ink-amber /
 *              .ink-green (the dark-ground status inks for a count or a flag)
 *   Chrome     nav.bar > .bar-in (.lockup-link, .tabs > a.tab[aria-current], .bar-right), .subbar,
 *              #toast.toast (.pending / .confirmed / .refused; .ic, .msg, .u, .t), .two-step (.ask,
 *              .yn > .btn.yes / .btn.no), .page-head (.page-head-text > h1 + .meta, input.find)
 *   Athlete    body.side-athlete: the pane and the bar centre at 480 px at every width (§14: the athlete
 *              routes are the phone layout everywhere); a.tab.tab--glyph (.tab-glyph-wrap > svg.tab-glyph,
 *              .tab-label; .is-offline puts the Ash dot on the Settings glyph); .sync-badge (sticky at the
 *              top of the pane, a 24 px strip of micro text with a 44 px tap target:
 *              .sync-badge--synced / --waiting / --syncing / --needs / --refused, .sync-badge--open while
 *              its list shows; .sync-badge-row > .sync-badge-toggle (.sync-dot, .sync-badge-text);
 *              ul.sync-badge-list[data-role="queue"] > li.sync-badge-line (.sync-badge-what,
 *              .sync-badge-reason, .btn Retry; .sync-badge-line--refused in red, .sync-badge-line--held
 *              in Ash for another account's writes), a.sync-badge-signin);
 *              body.has-sync-sticky adds the strip's 24 px and its hairline to --ap-chrome-h, so a
 *              .sticky week head sticks under it
 *   Retired    .needs-desktop (R3: the program editor renders at every width; the rule stays harmless)
 */

@font-face{font-family:"Archivo";src:url("/shared/fonts/Archivo-var.woff2") format("woff2");font-weight:100 900;font-stretch:62% 125%;font-style:normal;font-display:block}
@font-face{font-family:"Archivo Black";src:url("/shared/fonts/ArchivoBlack.woff2") format("woff2");font-weight:400;font-style:normal;font-display:block}

:root{
  color-scheme:dark;
  /* the layers (R2, depth "lift"): ground < surface (Iron) < card < card-2; all derived from Iron and Black */
  --ap-ground:#141618;
  --ap-surface:var(--grit-iron);
  --ap-card:#30353A;
  --ap-card-2:#3B4045;
  --ap-under:var(--ap-surface);
  --ap-page:var(--ap-surface);     /* kept: the pane's colour under its older name */
  --ap-ink:var(--grit-white);
  --ap-ink-2:var(--grit-ash);
  --ap-hair:rgba(255,255,255,.075);  /* the 1 px edge between flat layers */
  --ap-edge:rgba(255,255,255,.05);   /* the faint edge of a lifted card, panel or tile (depth rule 2) */
  --ap-rule:rgba(178,180,178,.16);   /* a row's hairline */
  --ap-rule-strong:rgba(178,180,178,.34); /* a table head's rule, a box's edge */
  --ap-tonal:rgba(255,255,255,.075);
  --ap-tonal-hover:rgba(255,255,255,.12);
  --ap-tonal-on:rgba(255,255,255,.15);
  --ap-inset:rgba(0,0,0,.2);         /* a field sinks where a button lifts */
  --ap-row-hover:rgba(255,255,255,.035);
  --ap-row-current:rgba(255,255,255,.06);
  /* depth "lift": a card's float (rule 2), a tonal button's top highlight and the Gunmetal fill's drop (rule 3) */
  --ap-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 8px 24px rgba(0,0,0,.38),0 2px 6px rgba(0,0,0,.25);
  --ap-lift-btn:inset 0 1px 0 rgba(255,255,255,.06);
  --ap-lift-fill:0 4px 14px rgba(0,0,0,.4);
  --ap-bar:var(--grit-black);
  --ap-fill:var(--grit-gunmetal);
  --ap-refused:#D03B3B;            /* the toast's refused fill, cited from the cockpit (spec §3), never a band */
  --ap-red-ink:#E87070;            /* the dark-ground status inks (spec §0), as status.css defines them */
  --ap-amber-ink:#E0A526;
  --ap-green-ink:#4FB88A;
  --ap-radius:4px;                 /* buttons, fields, chips (R2) */
  --ap-radius-card:6px;            /* cards, panels, the pane, the toast (R2) */
  --ap-font:Archivo,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --ap-display:"Archivo Black",Archivo,"Arial Black",sans-serif;
  --ap-row:44px;                   /* every row and every target (S33) */
  --ap-bar-h:56px;                 /* the app-bar (S24) */
  --ap-sub-h:44px;                 /* the athlete-route sub-row (S33) */
  --ap-sync-h:24px;                /* the sync-badge strip: one line of micro text (ruling 2, 05/10/2026) */
  --ap-sync-reach:20px;            /* its invisible tap extension below the strip: 24 + 20 = the 44 px target */
  --ap-chrome-h:var(--ap-bar-h);   /* what sticks above the pane; grows with the sub-row */
  --ap-gutter:16px;
  --ap-pad:32px;                   /* the pane's padding */
  --ap-card-pad:24px;              /* a card's padding (R2) */
  --ap-pane-max:1440px;
  --ap-body:14px;
  --ap-table:13px;
  --ap-micro:11px;
}
body.has-subbar{--ap-chrome-h:calc(var(--ap-bar-h) + var(--ap-sub-h))}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--ap-ground)}
body{margin:0;min-height:100vh;background:var(--ap-ground);color:var(--ap-ink);font-family:var(--ap-font);font-weight:400;font-size:var(--ap-body);line-height:1.45;font-stretch:100%;-webkit-font-smoothing:antialiased}
img,svg{display:block;max-width:100%}
p,ul,ol,h1,h2,h3,h4,dl,dd,figure{margin:0}
ul,ol{padding:0;list-style:none}
h1,h2,h3{font-family:var(--ap-display);font-weight:400;text-transform:uppercase;letter-spacing:0}
h1{font-size:34px;line-height:1.05}
h2{font-size:21px;line-height:1.15}
h3{font-size:15px;line-height:1.2}
table{border-collapse:collapse;border-spacing:0}
[hidden]{display:none!important}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:focus-visible{outline:2px solid var(--ap-ink);outline-offset:2px}

/* every interactive element is at least 44 px tall (S33, brand book §7.3.2) */
a,button,select,input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),textarea{min-height:var(--ap-row)}
a{color:inherit;text-decoration:none;display:inline-flex;align-items:center}
a:hover{text-decoration:underline;text-underline-offset:.25em}
button{font:inherit;font-weight:500;color:inherit;background:none;border:0;padding:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
input,select,textarea{font:inherit;color:inherit}
input[type="checkbox"],input[type="radio"]{width:20px;height:20px;margin:12px;accent-color:var(--ap-fill)}

/* ---------- the app-bar (§3, S24): kept as the top bar (R2, no side rail) ---------- */
nav.bar{position:sticky;top:0;z-index:30;background:var(--ap-bar);color:var(--ap-ink-2);border-bottom:1px solid var(--ap-hair)}
.bar-in{display:flex;align-items:center;gap:28px;height:var(--ap-bar-h);max-width:var(--ap-pane-max);margin:0 auto;padding:0 var(--ap-gutter)}
.lockup-link{flex:none;min-height:var(--ap-row)}
.lockup{width:88px;height:auto}
.tabs{display:flex;align-items:stretch;gap:22px;height:100%;min-width:0;overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
a.tab{display:inline-flex;align-items:center;min-height:var(--ap-row);height:100%;font-weight:600;font-size:var(--ap-micro);letter-spacing:.12em;text-transform:uppercase;color:var(--ap-ink-2);border-bottom:2px solid transparent;padding-top:2px;white-space:nowrap}
a.tab:hover{color:var(--ap-ink);text-decoration:none;border-bottom-color:var(--ap-rule-strong)}
a.tab[aria-current="page"]{color:var(--ap-ink);border-bottom-color:var(--ap-ink);text-decoration:none}
.tab--athlete{max-width:240px;overflow:hidden;text-overflow:ellipsis;letter-spacing:.06em}
.bar-right{margin-left:auto;display:flex;align-items:center;gap:20px;height:100%}
.subbar{background:var(--ap-bar);border-top:1px solid var(--ap-hair)}
.subbar-in{display:flex;align-items:stretch;gap:22px;height:var(--ap-sub-h);max-width:var(--ap-pane-max);margin:0 auto;padding:0 var(--ap-gutter)}

/* ---------- the pane: the raised content surface (R2) ---------- */
main{display:block;width:calc(100% - 2 * var(--ap-gutter));max-width:var(--ap-pane-max);margin:16px auto 96px;padding:28px var(--ap-pad) var(--ap-pad);min-width:0;background:var(--ap-surface);border:1px solid var(--ap-hair);border-radius:var(--ap-radius-card);--ap-under:var(--ap-surface)}
main:focus{outline:0}
main[aria-busy="true"]>*{opacity:.6}
/* a component a link points at (#max-tiles-card: GRIT.app.navigate scrolls it into view) lands below the chrome */
main [data-component]{scroll-margin-top:calc(var(--ap-chrome-h) + 16px)}

/* ---------- page-head (§3) ---------- */
.page-head{display:flex;align-items:flex-end;gap:24px;flex-wrap:wrap;padding-bottom:20px;border-bottom:1px solid var(--ap-hair);margin-bottom:24px}
.page-head-text{display:flex;flex-direction:column;gap:8px;min-width:0}
.page-head .meta{color:var(--ap-ink-2);font-size:13px}
.page-head .find{margin-left:auto;width:260px;max-width:100%}

/* ---------- layout utilities ---------- */
.stack{display:flex;flex-direction:column;gap:16px}
.stack-sm{display:flex;flex-direction:column;gap:8px}
.stack-lg{display:flex;flex-direction:column;gap:24px}
.row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.row-tight{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.row-end{margin-left:auto}
.spacer{flex:1}
.grow{flex:1;min-width:0}
.grid-2{display:grid;grid-template-columns:minmax(0,1fr);gap:24px}
.grid-auto{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:24px}
.full{width:100%}
.w-var{width:var(--w,auto)}
.sticky{position:sticky;top:var(--ap-chrome-h);z-index:5;background:var(--ap-under)}
.scroll-x{overflow-x:auto;max-width:100%;min-width:0;overscroll-behavior-x:contain}
.needs-desktop{color:var(--ap-ink-2);font-size:13px;padding:10px 0}

/* ---------- text ---------- */
.micro{font-weight:600;font-size:var(--ap-micro);letter-spacing:.12em;text-transform:uppercase;line-height:1.3;color:var(--ap-ink-2)}
.muted{color:var(--ap-ink-2)}
.num{font-variant-numeric:tabular-nums}
.right{text-align:right}
.nowrap{white-space:nowrap}
.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.small{font-size:12px}
.strong{font-weight:600}
.display{font-family:var(--ap-display);font-weight:400;text-transform:uppercase;letter-spacing:0}
.meta-line{color:var(--ap-ink-2);font-size:13px;font-variant-numeric:tabular-nums}
.ink-red{color:var(--ap-red-ink)}
.ink-amber{color:var(--ap-amber-ink)}
.ink-green{color:var(--ap-green-ink)}

/* ---------- surfaces: cards, panels (R2; lifted, depth rule 2) ---------- */
.card,.panel{background:var(--ap-card);border:1px solid var(--ap-edge);border-radius:var(--ap-radius-card);box-shadow:var(--ap-shadow);padding:var(--ap-card-pad);min-width:0;--ap-under:var(--ap-card)}
/* a card that opens with its head: the head's divider runs edge to edge */
.card:has(> .card-head:first-child){padding-top:0}
.surface{background:var(--ap-surface);border-radius:var(--ap-radius-card);--ap-under:var(--ap-surface)}
.card-head{display:flex;flex-wrap:wrap;align-items:center;column-gap:10px;row-gap:2px;min-height:64px;margin:0 calc(-1 * var(--ap-card-pad)) 16px;padding:10px var(--ap-card-pad);border-bottom:1px solid var(--ap-hair)}
.card-head h2{font-family:var(--ap-font);font-weight:600;font-size:12px;letter-spacing:.11em;text-transform:uppercase;color:var(--ap-ink);line-height:1.3}
.card-head .count{font-weight:400;font-size:13px;color:var(--ap-ink-2);font-variant-numeric:tabular-nums}
.card-head .card-desc{order:2;flex:0 0 100%;min-width:0;font-weight:400;font-size:13px;line-height:1.4;color:var(--ap-ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-head > .row-end{order:1}
/* a head outside a card (a section on the pane) keeps the same line without the edge-to-edge bleed */
:not(.card) > .card-head{margin:0 0 12px;padding:10px 0}
.card-body{display:flex;flex-direction:column;gap:8px;min-width:0}
.kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:0 24px;font-size:13px;align-items:center}
.kv dt{color:var(--ap-ink-2);font-weight:500;min-height:var(--ap-row);display:flex;align-items:center}
.kv dd{font-variant-numeric:tabular-nums;min-height:var(--ap-row);display:flex;align-items:center;gap:10px;min-width:0}
.facts{display:flex;flex-wrap:wrap;gap:0 32px}

/* ---------- big-number tiles (R2; lifted on the pane, flat in a card: depth rule 2) ---------- */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}
.tiles--fit{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.tile{display:flex;flex-direction:column;gap:6px;min-width:0;background:var(--ap-card);border:1px solid var(--ap-edge);border-radius:var(--ap-radius-card);box-shadow:var(--ap-shadow);padding:20px var(--ap-card-pad);--ap-under:var(--ap-card)}
.card .tile{background:var(--ap-card-2);border-color:var(--ap-hair);box-shadow:none;--ap-under:var(--ap-card-2)}
.tile-label{font-weight:500;font-size:13px;line-height:1.3;color:var(--ap-ink-2)}
.tile-value{font-weight:600;font-size:32px;line-height:1.1;letter-spacing:-.01em;color:var(--ap-ink);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile-value--sm{font-size:24px;line-height:1.25}
.tile-value.ink-red{color:var(--ap-red-ink)}
.tile-value.ink-amber{color:var(--ap-amber-ink)}
.tile-value.ink-green{color:var(--ap-green-ink)}
.tile-value small{font-weight:500;font-size:15px;letter-spacing:0;color:var(--ap-ink-2);margin-left:4px}
.tile-sub{font-weight:400;font-size:12px;line-height:1.4;color:var(--ap-ink-2)}

/* ---------- segmented controls (R2: filters, week pickers) ---------- */
.seg{display:inline-flex;align-items:stretch;max-width:100%;overflow-x:auto;scrollbar-width:none;border:1px solid var(--ap-hair);border-radius:var(--ap-radius);background:var(--ap-inset);flex:none}
.seg::-webkit-scrollbar{display:none}
.seg > a,.seg > button,.seg > .seg-label,.seg > .seg-step{display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:var(--ap-row);padding:0 14px;border:0;border-left:1px solid var(--ap-hair);border-radius:0;background:transparent;color:var(--ap-ink-2);font-weight:600;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;text-decoration:none;font-variant-numeric:tabular-nums}
.seg > :first-child{border-left:0}
.seg > .seg-label{color:var(--ap-ink);cursor:default}
/* a prev / next arrow: the glyph reads at body size; an arrow that goes nowhere keeps its place, dimmed */
.seg > .seg-step{min-width:var(--ap-row);padding:0 12px;font-size:18px;font-weight:500;letter-spacing:0;line-height:1}
.seg > .seg-step[aria-disabled="true"]{opacity:.35;cursor:default}
.seg > .seg-step[aria-disabled="true"]:hover{background:transparent;color:var(--ap-ink-2)}
.seg > a:hover,.seg > button:hover{background:var(--ap-tonal);color:var(--ap-ink);text-decoration:none}
.seg > [aria-pressed="true"],.seg > [aria-current]:not([aria-current="false"]),.seg > [aria-selected="true"],.seg > .is-current{background:var(--ap-tonal-on);color:var(--ap-ink)}

/* ---------- underline tabs (R2) ---------- */
.utabs{display:flex;align-items:stretch;gap:24px;border-bottom:1px solid var(--ap-hair);overflow-x:auto;scrollbar-width:none}
.utabs::-webkit-scrollbar{display:none}
.utabs > a,.utabs > button{display:inline-flex;align-items:center;flex:none;min-height:var(--ap-row);padding:0 2px;margin-bottom:-1px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--ap-ink-2);font-weight:600;font-size:var(--ap-micro);letter-spacing:.12em;text-transform:uppercase;white-space:nowrap;text-decoration:none}
.utabs > a:hover,.utabs > button:hover{color:var(--ap-ink);text-decoration:none}
.utabs > [aria-current="page"],.utabs > [aria-selected="true"]{color:var(--ap-ink);border-bottom-color:var(--ap-ink)}

/* ---------- tables (44 px hairline rows, S33) ---------- */
.tbl{width:100%;font-size:var(--ap-table);line-height:1.3}
.tbl th{text-align:left;font-weight:600;font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ap-ink-2);height:var(--ap-row);padding:0 12px 0 0;border-bottom:1px solid var(--ap-rule-strong);white-space:nowrap;position:sticky;top:var(--ap-chrome-h);background:var(--ap-under);z-index:2;vertical-align:middle}
.tbl td{height:var(--ap-row);padding:0 12px 0 0;border-bottom:1px solid var(--ap-rule);vertical-align:middle;white-space:nowrap}
.tbl th:last-child,.tbl td:last-child{padding-right:0}
.tbl th.num,.tbl td.num{text-align:right;font-variant-numeric:tabular-nums}
.tbl th.right,.tbl td.right{text-align:right}
.tbl tbody tr:hover td{background:var(--ap-row-hover)}
.tbl tr.is-current td{background:var(--ap-row-current);box-shadow:none}
.tbl tr.is-current td:first-child{box-shadow:inset 2px 0 0 var(--ap-ink)}
.tbl tr.is-removed td{color:var(--ap-ink-2);text-decoration:line-through}
/* the last row of a list in a card ends on the card's edge, not on a rule */
.card .tbl:not(.tbl--grid) tbody tr:last-child td{border-bottom:0}
.tbl .row-link{cursor:pointer}
.tbl th[data-action]{cursor:pointer}
.tbl th[data-action]:hover{color:var(--ap-ink);text-decoration:underline;text-underline-offset:.3em}
/* a .scroll-x box is its own scrollport: the header's offset under the chrome would push it down over the
   first row there, so inside the box it sits at the box's top (one rule for every screen) */
.scroll-x .tbl th{top:0}
/* the oracle gate line keeps its sentence case when it stands in a column head */
.tbl th .gate-line{text-transform:none;letter-spacing:0;font-weight:400;font-size:12px}
/* the roster's phone layout (S23: one stacked cell per athlete under 480 px): keep the Done button and the
   sessions step off the row's hairline; scoped to /coach so the program editor's own stacked cells keep their
   measured height */
main[data-screen="coach"] .tbl td > .stack-sm{padding:8px 0}
/* the overview's two-line cells (exposure's "never" over the gate line, a slot's gate over its last set) keep
   off the hairlines the same way */
main[data-screen="athlete"] .tbl td > .stack-sm{padding:8px 0}
/* slot-wave-grid: a dormant slot keeps its row (spec §10: twelve rows S1 to D3) but reads compact and Ash, one
   spanning cell "S2 · dormant", so the active slots carry the card; the row stays 44 px (S33) */
.slot-wave-grid-dormant td{color:var(--ap-ink-2);font-size:12px;font-weight:400}
/* the program editor's gated e1RM cell: the gate line wraps to short lines (11 px) inside the 44 px row,
   so a logged session's table does not outgrow the pane at 1280 px */
.tbl td.program-editor-gate{white-space:normal}
.program-editor-gate .gate-line{display:inline-block;min-width:9em;max-width:9.5em;font-size:11px;line-height:1.2}
.tbl--grid td{padding:0;border-right:1px solid var(--ap-rule)}
.tbl--grid td:last-child{border-right:0}
.tbl--grid th{padding:0 8px}
/* info-tip: an info icon in a column head with a tooltip of short lines (the program editor's Intensity head). The icon
   hangs off a zero-size anchor right after the label, into the head's right padding, so it takes no layout width and
   never widens the column; the tooltip is fixed at the icon (a .scroll-x box would clip an absolute one;
   coach-program.js sets --tip-x and --tip-y when the icon is entered) and shows on hover and on keyboard focus of the icon. */
.info-tip-anchor{position:relative;display:inline-block;width:0;height:0}
.info-tip{position:absolute;left:1px;bottom:-1px;width:9px;height:9px;min-width:0;min-height:0;padding:0;border:0;background:none;color:var(--ap-ink-2);cursor:help;line-height:0}
.info-tip svg{display:block;width:9px;height:9px}
.info-tip::before{content:"";position:absolute;inset:-10px -4px}
.info-tip:hover,.info-tip:focus-visible{color:var(--ap-ink)}
.info-tip-body{display:none;position:fixed;left:min(var(--tip-x,0px),calc(100vw - 380px));top:var(--tip-y,0px);z-index:40;width:max-content;max-width:360px;padding:8px 12px;background:var(--ap-card-2);border:1px solid var(--ap-hair);border-radius:var(--ap-radius-card);box-shadow:0 4px 16px rgba(0,0,0,.3);color:var(--ap-ink);font-size:12px;font-weight:400;letter-spacing:0;text-transform:none;text-align:left;white-space:nowrap}
.info-tip-line{display:block;line-height:1.7}
.info-tip:hover + .info-tip-body,.info-tip:focus-visible + .info-tip-body,.info-tip-body:hover{display:block}

/* ---------- buttons (R2: tonal secondaries, one Gunmetal primary; they lift, depth rule 3) ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:var(--ap-row);padding:0 16px;border:0;border-radius:var(--ap-radius);font-weight:600;font-size:11.5px;letter-spacing:.1em;text-transform:uppercase;background:var(--ap-tonal);color:var(--ap-ink);box-shadow:var(--ap-lift-btn);white-space:nowrap;text-decoration:none}
.btn:hover{background:var(--ap-tonal-hover);text-decoration:none}
.btn--tonal{background:var(--ap-tonal)}
.btn--fill{background:var(--ap-fill);color:var(--grit-white);box-shadow:var(--ap-lift-fill)}   /* the one Gunmetal fill per screen */
.btn--fill:hover{background:var(--ap-fill);box-shadow:inset 0 0 0 100px rgba(255,255,255,.08),var(--ap-lift-fill)}
.btn--quiet{background:transparent;box-shadow:none;padding:0 10px}
.btn--quiet:hover{background:var(--ap-tonal)}
.btn[disabled],.btn[aria-disabled="true"]{opacity:.45;cursor:default;box-shadow:none}
.btn[disabled]:hover,.btn[aria-disabled="true"]:hover{background:var(--ap-tonal);box-shadow:none}
.btn--quiet[disabled]:hover,.btn--quiet[aria-disabled="true"]:hover{background:transparent}
.link{font-weight:600;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--ap-ink);min-height:var(--ap-row)}
.icon-btn{width:var(--ap-row);height:var(--ap-row);border:0;border-radius:var(--ap-radius);background:var(--ap-tonal);box-shadow:var(--ap-lift-btn);flex:none}
.icon-btn:hover{background:var(--ap-tonal-hover)}
.icon-btn svg{width:14px;height:14px}
/* one match in an inline exercise-picker list: a 44 px list row, sentence case, like a .tbl row */
.pick-option{display:flex;align-items:center;justify-content:flex-start;width:100%;min-height:var(--ap-row);padding:0 12px;border:0;border-bottom:1px solid var(--ap-rule);border-radius:0;background:transparent;color:var(--ap-ink);font-weight:400;font-size:var(--ap-table);text-align:left;text-transform:none;letter-spacing:normal}
.pick-option:last-child{border-bottom:0}
/* the training max form's picker list drops over the row under it, so the form's fields keep their line */
.tm-add .exercise-picker{position:relative}
.tm-add .exercise-picker-list{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:6;background:var(--ap-card-2);border:1px solid var(--ap-hair);border-radius:var(--ap-radius-card);box-shadow:0 4px 16px rgba(0,0,0,.3);overflow:hidden;--ap-under:var(--ap-card-2)}
.pick-option:hover,.pick-option.is-current{background:var(--ap-tonal)}
.pick-option.is-current{box-shadow:inset 2px 0 0 var(--ap-ink)}
.sq{display:inline-flex;align-items:center;justify-content:center;min-width:var(--ap-row);min-height:var(--ap-row)}
.sq::before{content:"";width:20px;height:20px;border:1px solid var(--ap-rule-strong);border-radius:var(--ap-radius);background:var(--ap-inset)}
.sq[aria-pressed="true"]::before,.sq[aria-checked="true"]::before{background:var(--ap-ink);border-color:var(--ap-ink)}

/* ---------- fields (R2: a 4 px inset box) ---------- */
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field label{font-weight:600;font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ap-ink-2)}
.in{border:1px solid var(--ap-hair);border-radius:var(--ap-radius);background:var(--ap-inset);color:var(--ap-ink);font-weight:400;font-size:var(--ap-body);padding:0 12px;min-height:var(--ap-row);width:100%}
.in:hover{border-color:var(--ap-rule-strong)}
.in:focus{outline:0;border-color:var(--ap-fill);box-shadow:0 0 0 1px var(--ap-fill)}
.in::placeholder{color:var(--ap-ink-2);opacity:.75}
.in.num{text-align:right;font-variant-numeric:tabular-nums}
select.in{appearance:none;padding-right:12px}
select.in option{background:var(--ap-card);color:var(--ap-ink)}
textarea.in{min-height:96px;resize:vertical;line-height:1.45;padding:10px 12px}
.cell{display:block;width:100%;height:var(--ap-row);min-height:var(--ap-row);border:0;border-radius:0;background:transparent;color:var(--ap-ink);font-weight:400;font-size:var(--ap-table);padding:0 8px;font-variant-numeric:tabular-nums}
.cell:hover{background:var(--ap-row-hover)}
.cell:focus{outline:0;background:var(--ap-inset);box-shadow:inset 0 -2px 0 var(--ap-fill)}
[aria-invalid="true"]{border-color:var(--ap-red-ink);box-shadow:inset 0 -2px 0 var(--ap-red-ink)}
.in[aria-invalid="true"]:focus{box-shadow:0 0 0 1px var(--ap-red-ink)}

/* ---------- states ---------- */
@keyframes ap-pulse{0%,100%{opacity:.35}50%{opacity:.85}}
.is-busy{animation:ap-pulse .8s ease-in-out infinite;pointer-events:none}
.empty{color:var(--ap-ink-2);font-size:var(--ap-body);padding:10px 0}
.state{padding:48px 0}
.state-line{font-size:16px;font-weight:500;color:var(--ap-ink-2)}
.gate-line{color:var(--ap-ink-2);font-size:13px;font-weight:400}

/* ---------- bands (the size; status.css owns the colours, A14) ---------- */
.badge{display:inline-flex;align-items:baseline;justify-content:flex-end;gap:2px;min-width:44px;height:28px;padding:0 7px;border-radius:var(--ap-radius);font-weight:700;font-size:15px;line-height:28px;font-variant-numeric:tabular-nums;border:1px solid transparent}
.badge small{font-weight:500;font-size:11px;letter-spacing:0}
.bdot{display:inline-block;width:8px;height:8px;border-radius:2px;flex:none;background:var(--ap-rule-strong)}

/* ---------- the toast (§3: one at a time, three states) ---------- */
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:40;display:flex;align-items:center;gap:16px;max-width:min(92vw,720px);min-height:52px;padding:4px 8px 4px 16px;background:var(--grit-black);color:var(--grit-white);border:1px solid var(--ap-rule-strong);border-radius:var(--ap-radius-card);box-shadow:0 4px 16px rgba(0,0,0,.35);font-size:13px;font-weight:500}
.toast .msg{min-width:0}
.toast .ic{display:inline-flex;align-items:center;justify-content:center;flex:none;width:18px;height:18px;border:1px solid currentColor;border-radius:var(--ap-radius)}
.toast .ic svg{width:10px;height:10px}
.toast .ic-stroke{stroke:currentColor;stroke-width:1.6;fill:none}
.toast .u{font-weight:600;font-size:11px;letter-spacing:.12em;text-transform:uppercase;min-height:var(--ap-row);padding:0 14px;border-radius:var(--ap-radius);background:var(--ap-tonal-on)}
.toast .u:hover{background:rgba(255,255,255,.22)}
.toast .t{color:var(--ap-ink-2);font-size:11px;min-width:2ch;text-align:right;padding-right:8px}
.toast.pending{border-color:var(--ap-fill);color:var(--ap-ink-2)}
.toast.pending .ic{width:10px;height:10px;border:0;border-radius:2px;background:var(--ap-fill);animation:ap-pulse .8s ease-in-out infinite}
.toast.refused{background:var(--ap-refused);border-color:var(--ap-refused);color:var(--grit-white);font-weight:600}
@media (prefers-reduced-motion:reduce){.is-busy,.toast.pending .ic{animation:none;opacity:.5}}

/* ---------- the two-step confirm (§15, inline) ---------- */
.two-step{display:inline-flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:13px}
.two-step .ask{font-weight:600}
.two-step .yn{display:inline-flex;gap:8px}
.two-step .btn{padding:0 14px}

/* ---------- the athlete side (§3 app-bar and sync-badge, §14, S17, S24) ---------- */
/* the athlete routes are the phone layout at every width, centred at 480 px above the breakpoint (§14) */
body.side-athlete main{max-width:480px}
body.side-athlete .bar-in{max-width:480px;gap:0}
body.side-athlete .lockup-link{display:none}
body.side-athlete .tabs{flex:1;justify-content:space-between;gap:4px}
/* a tab: the 20 px glyph over the micro label, the 2 px White underline when current (the a.tab rules) */
a.tab--glyph{flex:1 1 0;min-width:0;flex-direction:column;justify-content:center;gap:4px;padding-top:2px;font-size:10px;letter-spacing:.06em}
.tab-label{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.tab-glyph-wrap{position:relative;display:block;width:20px;height:20px;flex:none}
.tab-glyph{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tab-glyph circle{fill:var(--ap-bar)}
/* is-offline (§3 app-bar States): an Ash dot on the Settings glyph while writes wait; the badge carries the count */
a.tab.is-offline .tab-glyph-wrap::after{content:"";position:absolute;top:-3px;right:-5px;width:8px;height:8px;border-radius:2px;background:var(--ap-ink-2);border:1.5px solid var(--ap-bar)}
/* the sticky sync-badge at the top of the pane, edge to edge of it (ruling 2, 05/10/2026: as small as
   readable): a 24 px strip of micro text sticks under the bar. Its tap target stays 44 px tall: the toggle's
   invisible ::after reaches 20 px below the strip, over the badge's own bottom margin while the page is at
   rest; once the page scrolls, a sticky head (z-index 5) sits above the closed badge (z-index 4), so the
   extension never covers a head's controls. Open, the badge rises over the heads (its list hangs over them). */
.sync-badge{position:sticky;top:var(--ap-bar-h);z-index:4;margin:-12px calc(-1 * var(--ap-pad)) var(--ap-sync-reach);padding:0 var(--ap-pad);background:var(--ap-under);border-bottom:1px solid var(--ap-hair)}
.sync-badge--open{z-index:6}
body.has-sync-sticky{--ap-chrome-h:calc(var(--ap-bar-h) + var(--ap-sync-h) + 1px)}   /* the strip and its hairline */
.sync-badge-row{display:flex;align-items:center;gap:12px;min-height:var(--ap-sync-h)}
.sync-badge-toggle{position:relative;display:flex;flex:1 1 auto;align-items:center;gap:8px;min-width:0;min-height:var(--ap-sync-h);padding:0;border:0;background:transparent;font-weight:600;font-size:var(--ap-micro);letter-spacing:.12em;text-transform:uppercase;line-height:1;color:var(--ap-ink-2);text-align:left}
button.sync-badge-toggle::after{content:"";position:absolute;left:0;right:0;top:0;bottom:calc(-1 * var(--ap-sync-reach))}   /* 24 + 20 = the 44 px target */
button.sync-badge-toggle:hover .sync-badge-text{text-decoration:underline;text-underline-offset:.25em}
.sync-badge-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-dot{display:inline-block;flex:none;width:6px;height:6px;border-radius:1px;background:var(--ap-ink-2)}
.sync-badge--synced .sync-dot{background:var(--ap-green-ink)}
.sync-badge--syncing .sync-dot{background:var(--ap-fill);animation:ap-pulse .8s ease-in-out infinite}
.sync-badge--needs .sync-dot{background:var(--ap-amber-ink)}
.sync-badge--needs .sync-badge-text{color:var(--ap-amber-ink)}
.sync-badge--refused .sync-dot{background:var(--ap-red-ink)}
.sync-badge--refused .sync-badge-text{color:var(--ap-red-ink)}
/* the queue list under the badge: a panel hung from the 44 px row (out of the flow, so opening it never moves
   the page or the sticky heads' offset), closed by a tap on the badge; it scrolls inside itself */
.sync-badge-list{position:absolute;left:0;right:0;top:100%;max-height:min(50vh,320px);overflow-y:auto;overscroll-behavior:contain;padding:0 var(--ap-pad) 4px;background:var(--ap-under);border-bottom:1px solid var(--ap-hair)}
.sync-badge-list[hidden]{display:none}
.sync-badge-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 12px;min-height:var(--ap-row);padding:6px 0;border-top:1px solid var(--ap-rule);font-size:13px;color:var(--ap-ink)}
.sync-badge-what{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.sync-badge-line--refused{color:var(--ap-red-ink)}
.sync-badge-line--held{color:var(--ap-ink-2)}
.sync-badge-reason{flex:1 1 100%;order:2;font-size:12px}
.sync-badge-line .btn{margin-left:auto;order:1}
.sync-badge-signin{color:var(--ap-amber-ink);font-weight:600;text-decoration:underline;text-underline-offset:.25em}
/* an athlete control whose queued write waits (S17: no busy state; it stays editable), and one the queue
   stopped at (the red edge of [aria-invalid], also on a button) */
.is-pending{border-color:var(--ap-fill)}
.is-pending:not(:focus){box-shadow:inset 0 -2px 0 var(--ap-fill)}
.is-refused{border-color:var(--ap-red-ink);box-shadow:inset 0 -2px 0 var(--ap-red-ink)}
@media (prefers-reduced-motion:reduce){.sync-badge--syncing .sync-dot{animation:none;opacity:.5}}

/* ---------- the sign-in page (spec §2 /login, S28): no pane, the ground only ---------- */
main.login{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:auto;max-width:360px;margin:0 auto;padding:32px var(--ap-gutter);text-align:center;background:transparent;border:0;border-radius:0}
.login .lockup{width:150px}
.login .btn{width:100%}
.login .privacy{color:var(--ap-ink-2);font-size:12px;line-height:1.5}
/* the link on its own line under the sentence: its 44 px target no longer opens a gap inside the paragraph */
.login .privacy a{display:flex;width:max-content;margin:0 auto;min-height:var(--ap-row);text-decoration:underline;text-underline-offset:.25em;justify-content:center}

/* ---------- widths ---------- */
@media (min-width:1024px){
  .grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* a tablet: the pane keeps its panel, less padding */
@media (max-width:1023.98px){
  :root{--ap-pad:24px}
}
/* the phone (S24): the bar at the bottom, the pane full bleed, one column, the toast above the bar */
@media (max-width:479.98px){
  :root{--ap-chrome-h:0px;--ap-card-pad:16px;--ap-pad:var(--ap-gutter)}
  body.has-subbar{--ap-chrome-h:0px}
  nav.bar{position:fixed;top:auto;bottom:0;left:0;right:0;border-bottom:0;border-top:1px solid var(--ap-hair);display:flex;flex-direction:column-reverse}
  .bar-in{gap:0;padding:0 8px;width:100%;margin:0}   /* a column flex item with auto margins would shrink to its content */
  .lockup-link{display:none}
  .tabs{flex:1;justify-content:space-between;gap:4px}
  a.tab{font-size:10px;letter-spacing:.06em}
  .bar-right{gap:8px}
  body{background:var(--ap-surface)}
  main{width:100%;margin:0;border:0;border-radius:0;padding:16px var(--ap-gutter) calc(var(--ap-bar-h) + var(--ap-sub-h) + 24px)}
  h1{font-size:28px}
  .page-head{padding-bottom:16px;margin-bottom:16px}
  .page-head .find{width:100%;margin-left:0}
  .tiles{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}   /* two tiles side by side on a phone */
  .tile{padding:16px}
  .tile-value{font-size:26px}
  .tile-value--sm{font-size:18px}
  .toast{left:var(--ap-gutter);right:var(--ap-gutter);transform:none;max-width:none;bottom:calc(var(--ap-bar-h) + 12px)}
  body.has-subbar .toast{bottom:calc(var(--ap-bar-h) + var(--ap-sub-h) + 12px)}
  /* the athlete side: the badge sticks at the top of the screen (the bar is at the bottom); the bar keeps
     clear of an iPhone's home indicator */
  .sync-badge{top:0;margin-top:-16px}
  body.has-sync-sticky{--ap-chrome-h:calc(var(--ap-sync-h) + 1px)}
  body.side-athlete nav.bar{padding-bottom:env(safe-area-inset-bottom,0px)}
  /* the bar is taller by that inset, so the toast and the pane's end clear it too */
  body.side-athlete .toast{bottom:calc(var(--ap-bar-h) + env(safe-area-inset-bottom,0px) + 12px)}
  body.side-athlete.has-subbar .toast{bottom:calc(var(--ap-bar-h) + env(safe-area-inset-bottom,0px) + var(--ap-sub-h) + 12px)}
  body.side-athlete main{padding-bottom:calc(var(--ap-bar-h) + env(safe-area-inset-bottom,0px) + var(--ap-sub-h) + 24px)}
}
