/* The base (slice 11.1, Decisions/Styling.md, Product/Look and Feel.md): the faces, tokens,
   a reset, type, then element styles, in that order. No framework; no class is needed for
   an element to look right. Every colour in the app is a token declared here, with its
   dark value under prefers-color-scheme: dark. The per-feature rules follow, after the
   base. */

/* ---- Faces --------------------------------------------------------------------- */

/* One family, three widths (slice 11.7, Look and Feel "Direction"): Barlow for body,
   forms and nav; Barlow Semi Condensed for the dense tables; Barlow Condensed for the one
   figure on a screen. Self-hosted from wwwroot/fonts (SIL OFL 1.1, the licence beside
   them; the source is in Development Setup) in only the weights used, and swapped in
   over the system stack so nothing waits on a download. */
@font-face {
    font-family: "Barlow";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("fonts/Barlow-Regular.woff2") format("woff2");
}

@font-face {
    font-family: "Barlow";
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url("fonts/Barlow-SemiBold.woff2") format("woff2");
}

@font-face {
    font-family: "Barlow Semi Condensed";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("fonts/BarlowSemiCondensed-Regular.woff2") format("woff2");
}

@font-face {
    font-family: "Barlow Semi Condensed";
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url("fonts/BarlowSemiCondensed-SemiBold.woff2") format("woff2");
}

@font-face {
    font-family: "Barlow Condensed";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url("fonts/BarlowCondensed-Bold.woff2") format("woff2");
}

/* ---- Tokens -------------------------------------------------------------------- */

:root {
    color-scheme: light dark;

    /* The faces above, each over the same system stack (the fallback the page renders
       in until a face arrives). The figure face is the condensed bold, one size. */
    --btm-font-system: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --btm-font: "Barlow", var(--btm-font-system);
    --btm-font-table: "Barlow Semi Condensed", var(--btm-font-system);
    --btm-font-figures: "Barlow Condensed", var(--btm-font-system);
    --btm-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    /* Type scale: body 16 px, line height 1.5; tables 14 px in the semi-condensed face
       (13 in the system face before slice 11.7); the figure 40 px (Look and Feel). */
    --btm-text-xs: 0.75rem;
    --btm-text-sm: 0.875rem;
    --btm-text-table: 0.875rem;
    --btm-text-figure: 2.5rem;
    --btm-text-lg: 1.125rem;
    --btm-h1: 1.75rem;
    --btm-h2: 1.375rem;
    --btm-h3: 1.125rem;
    --btm-h4: 1rem;
    --btm-leading: 1.5;

    /* Spacing: a 4 px scale. */
    --btm-space-1: 0.25rem;
    --btm-space-2: 0.5rem;
    --btm-space-3: 0.75rem;
    --btm-space-4: 1rem;
    --btm-space-6: 1.5rem;
    --btm-space-8: 2rem;

    --btm-radius: 0.375rem;
    --btm-radius-sm: 0.25rem;

    /* Controls and tap targets are 44 px tall on a phone, 36 px at the desk. */
    --btm-control: 2.75rem;
    --btm-touch: 2.75rem;

    /* The page: full width with a 16 px gutter on a phone, a wide measure at the desk so
       the tables have room (80 rem since 2026-10-07; text boxes keep their own 28 rem). */
    --btm-measure: 80rem;
    --btm-gutter: 1rem;

    /* Colours, by the names in Look and Feel's Direction (2026-10-07; the values are the
       base's, unchanged). Chalk is the page, Ink the text, Iron secondary text and
       borders, Steel the accent (the chart blue the app already used, kept cool so it
       never competes with heat), Rust for destructive actions and a fall in a Change
       column. Warm colours mean muscle heat and nothing else: the heat scale below is the
       app's one warm moment. */
    --btm-bg: #ffffff;              /* Chalk */
    --btm-surface: #f3f5f7;         /* Chalk, a shade down: surfaces and quiet buttons */
    --btm-row-alt: #f6f8fa;         /* Chalk, a shade down: every second table row */
    --btm-text: #1a1a1a;            /* Ink */
    --btm-muted: #5c6670;           /* Iron: secondary text */
    --btm-border: #cfd6dd;          /* Iron, lightened: rules and borders */
    --btm-accent: #3b6ea5;          /* Steel */
    --btm-accent-strong: #2f5a88;   /* Steel, pressed */
    --btm-accent-ink: #ffffff;      /* Chalk on Steel */
    --btm-accent-soft: #dbe8fb;     /* Steel's tint: the current row */
    --btm-friend: #a8551c;          /* Burnt orange: the friend in head to head, beside the user's Steel (slice 22.2) */
    --btm-danger: #c62828;          /* Rust */
    --btm-danger-ink: #ffffff;      /* Chalk on Rust */
    --btm-success: #2e8b4a;         /* a save's status rule; not a heat colour */
    --btm-up: #23733b;              /* a rise in a Change column: success, darkened to read as text */
    --btm-down: var(--btm-danger);  /* a fall in a Change column */
    --btm-warning-bg: #fff7c2;      /* a refused set's row */
    --btm-series-2: #c05a1a;        /* the charts' second series */
    --btm-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
    --btm-backdrop: rgb(0 0 0 / 0.5);

    /* Paper: the printed sheet is black on white in both schemes (Product/Printable Sheets.md). */
    --btm-paper: #ffffff;
    --btm-ink: #000000;

    /* The heat map's five-step scale, cold to hot (Domain HeatScale), defined once here
       and used by heat-map.css for both the list and the body illustration. Each step
       has an ink that reads on it, so the state is never colour alone. */
    --btm-heat-0: #e6edf2;
    --btm-heat-1: #fbe7a6;
    --btm-heat-2: #f6ad63;
    --btm-heat-3: #cf4318;
    --btm-heat-4: #961212;
    --btm-heat-ink-0: #1a1a1a;
    --btm-heat-ink-1: #1a1a1a;
    --btm-heat-ink-2: #1a1a1a;
    --btm-heat-ink-3: #ffffff;
    --btm-heat-ink-4: #ffffff;

    /* The body illustration's neutral parts (slice 11.6): the silhouette the muscles sit
       on, the parts the map leaves uncoloured (hands, feet, neck, shins), and the
       artwork's detail lines. Light is the artwork's own greys; dark recedes toward the
       page so the heat colours, unchanged, still stand out. */
    --btm-body-outline: #e0e0e0;
    --btm-body-part: #bdbdbd;
    --btm-body-line: #000000;

    /* The 3D body (slice 20.6), in the colours of the spike the author approved: the
       skin where no muscle is (head, hands, shins, feet), and the ink of its outline and
       of the lines between muscles. */
    --btm-body-skin: #c3c9cf;
    --btm-body-ink: #1a1a1a;
}

@media (min-width: 601px) {
    :root {
        --btm-control: 2.25rem;
        --btm-touch: 2.25rem;
        --btm-gutter: 1.5rem;
        --btm-h1: 2rem;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --btm-bg: #121416;
        --btm-surface: #1d2126;
        --btm-row-alt: #191d21;
        --btm-text: #e6e8ea;
        --btm-muted: #9aa4ae;
        --btm-border: #3a4149;
        --btm-accent: #7aa7d9;
        --btm-accent-strong: #93bbe6;
        --btm-accent-ink: #0e1a28;
        --btm-accent-soft: #243b57;
        --btm-friend: #e0a05a;
        --btm-danger: #ef6b6b;
        --btm-danger-ink: #1a0808;
        --btm-success: #4cc46e;
        --btm-up: #4cc46e;
        --btm-warning-bg: #4a4200;
        --btm-series-2: #e8834a;
        --btm-shadow: 0 2px 8px rgb(0 0 0 / 0.6);
        --btm-backdrop: rgb(0 0 0 / 0.7);

        /* Steps 1 to 4 keep their colours, so hot is the same red on both schemes; only
           the cold step, a neutral, turns from a pale tint into a dark one so a fresh
           muscle no longer glows white on the dark page. */
        --btm-heat-0: #262e37;
        --btm-heat-ink-0: #e6e8ea;
        --btm-body-outline: #454d56;
        --btm-body-part: #5c646d;
        --btm-body-line: #0b0d0f;
        --btm-body-skin: #4a525b;
        --btm-body-ink: #05070a;
    }
}

/* Paper is light whatever the device prefers, so the base never leaks into print. */
@media print {
    :root {
        color-scheme: light;
        --btm-bg: var(--btm-paper);
        --btm-surface: var(--btm-paper);
        --btm-row-alt: var(--btm-paper);
        --btm-text: var(--btm-ink);
        --btm-muted: var(--btm-ink);
        --btm-border: var(--btm-ink);
    }
}

/* ---- Reset --------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
    margin: 0;
}

img, svg {
    max-width: 100%;
}

/* ---- Type ---------------------------------------------------------------------- */

body {
    font-family: var(--btm-font);
    font-size: 1rem;
    line-height: var(--btm-leading);
    color: var(--btm-text);
    background: var(--btm-bg);
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin: var(--btm-space-6) 0 var(--btm-space-3);
    overflow-wrap: anywhere;
}

h1 {
    font-size: var(--btm-h1);
    margin-top: 0;
}

h2 {
    font-size: var(--btm-h2);
}

h3 {
    font-size: var(--btm-h3);
}

h4 {
    font-size: var(--btm-h4);
}

/* The router moves focus to the heading on navigation; no ring on it. */
h1:focus {
    outline: none;
}

p, ul, ol, dl, figure, table, fieldset, details, pre {
    margin: 0 0 var(--btm-space-4);
}

ul, ol {
    padding-left: var(--btm-space-6);
}

li {
    margin: var(--btm-space-1) 0;
}

dt {
    font-weight: 600;
}

dd {
    margin: 0 0 var(--btm-space-2);
}

small {
    font-size: var(--btm-text-sm);
    color: var(--btm-muted);
}

strong {
    font-weight: 600;
}

/* The one figure on a screen (slice 11.7, Look and Feel "Direction"): the number read at
   arm's length, in the condensed bold at 40 px with tabular figures, used once per
   screen (the gym's volume so far) and nowhere else. Everything
   around it stays in body type. */
.figure {
    font-family: var(--btm-font-figures);
    font-size: var(--btm-text-figure);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

hr {
    border: 0;
    border-top: 1px solid var(--btm-border);
    margin: var(--btm-space-6) 0;
}

code, kbd {
    font-family: var(--btm-font-mono);
    font-size: 0.9em;
    background: var(--btm-surface);
    padding: 0.1em 0.3em;
    border-radius: var(--btm-radius-sm);
}

/* ---- Page ---------------------------------------------------------------------- */

main {
    max-width: var(--btm-measure);
    margin: 0 auto;
    padding: 0 var(--btm-gutter) var(--btm-space-8);
}

/* ---- Links and focus ----------------------------------------------------------- */

a {
    color: var(--btm-accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--btm-accent-strong);
}

:focus-visible {
    outline: 2px solid var(--btm-accent);
    outline-offset: 2px;
}

/* ---- Buttons ------------------------------------------------------------------- */

/* The default button is the primary action; .secondary is quieter; .danger is
   destructive. All three are the same size, so a touch target is never small. */
button, input[type=submit], input[type=button] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0 0.35em;
    min-height: var(--btm-control);
    padding: var(--btm-space-1) var(--btm-space-4);
    border: 1px solid var(--btm-accent);
    border-radius: var(--btm-radius);
    background: var(--btm-accent);
    color: var(--btm-accent-ink);
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    vertical-align: middle;
}

button:hover, input[type=submit]:hover, input[type=button]:hover {
    background: var(--btm-accent-strong);
    border-color: var(--btm-accent-strong);
}

button.secondary {
    background: var(--btm-surface);
    border-color: var(--btm-border);
    color: var(--btm-text);
}

button.secondary:hover {
    background: var(--btm-bg);
    border-color: var(--btm-muted);
}

button.danger {
    background: var(--btm-danger);
    border-color: var(--btm-danger);
    color: var(--btm-danger-ink);
}

button.danger:hover {
    filter: brightness(0.92);
}

/* A count inside a button (the gym's exercise list) takes the button's ink, not the
   muted grey. */
button small {
    color: inherit;
}

button:disabled, input[type=submit]:disabled, input[type=button]:disabled {
    opacity: 0.5;
    cursor: default;
    filter: none;
}

/* ---- Forms --------------------------------------------------------------------- */

label {
    font-weight: 500;
}

input:not([type=checkbox], [type=radio], [type=submit], [type=button], [type=hidden]),
select, textarea {
    min-height: var(--btm-control);
    max-width: 100%;
    padding: var(--btm-space-1) var(--btm-space-3);
    border: 1px solid var(--btm-border);
    border-radius: var(--btm-radius);
    background: var(--btm-bg);
    color: var(--btm-text);
    vertical-align: middle;
}

/* A text box takes the layout's width, up to a readable measure, so no field is sized
   by a character count (slice 11.2, Look and Feel). Numbers, dates and selects keep
   their own width, and the inline forms (the gym's entry, the by-date grid) set theirs. */
input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=search], input[type=url], input[type=tel] {
    width: 100%;
    max-width: 28rem;
}

input[type=number] {
    font-variant-numeric: tabular-nums;
}

textarea {
    width: 100%;
    min-height: calc(var(--btm-control) * 2);
    padding: var(--btm-space-2) var(--btm-space-3);
    vertical-align: top;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--btm-accent);
}

input:disabled, select:disabled, textarea:disabled {
    background: var(--btm-surface);
    opacity: 0.7;
}

input[type=checkbox], input[type=radio] {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0 var(--btm-space-1) 0 0;
    vertical-align: middle;
    accent-color: var(--btm-accent);
}

fieldset {
    min-width: 0;
    padding: var(--btm-space-3) var(--btm-space-4);
    border: 1px solid var(--btm-border);
    border-radius: var(--btm-radius);
}

/* A form reads top to bottom: a field is a paragraph with its label above, and the last
   paragraph in a box needs no gap before the box's edge. */
fieldset > p:last-child, fieldset > div:last-child {
    margin-bottom: 0;
}

legend {
    padding: 0 var(--btm-space-1);
    font-weight: 600;
}

/* Blazor's validation classes: a field's message under it, and ValidationSummary's list. */
.valid.modified:not([type=checkbox]) {
    border-color: var(--btm-success);
}

.invalid, [aria-invalid=true] {
    border-color: var(--btm-danger);
}

.validation-message {
    color: var(--btm-danger);
}

/* The one status pattern (slice 11.2, Look and Feel): what just happened or what went
   wrong, in the same place and style on every page. A plain .status is information,
   .success and .error say which, and the element carries role="status" or role="alert"
   to match. ValidationSummary's list is an error status too. */
.status, .validation-errors {
    margin: 0 0 var(--btm-space-4);
    padding: var(--btm-space-2) var(--btm-space-3);
    border-left: 4px solid var(--btm-muted);
    border-radius: 0 var(--btm-radius-sm) var(--btm-radius-sm) 0;
    background: var(--btm-surface);
}

.status.success {
    border-left-color: var(--btm-success);
}

.status.error, .validation-errors {
    border-left-color: var(--btm-danger);
}

.validation-errors {
    list-style: none;
}

.status > :last-child {
    margin-bottom: 0;
}

/* ---- Details and dialog -------------------------------------------------------- */

details {
    padding: 0 var(--btm-space-4);
    border: 1px solid var(--btm-border);
    border-radius: var(--btm-radius);
}

summary {
    display: flex;
    align-items: center;
    min-height: var(--btm-touch);
    margin: 0 calc(-1 * var(--btm-space-4));
    padding: 0 var(--btm-space-4);
    font-weight: 600;
    cursor: pointer;
}

details[open] summary {
    border-bottom: 1px solid var(--btm-border);
    margin-bottom: var(--btm-space-3);
}

dialog {
    max-width: min(28rem, calc(100vw - 2 * var(--btm-gutter)));
    padding: var(--btm-space-6);
    border: 1px solid var(--btm-border);
    border-radius: var(--btm-radius);
    background: var(--btm-bg);
    color: var(--btm-text);
    box-shadow: var(--btm-shadow);
}

dialog::backdrop {
    background: var(--btm-backdrop);
}

/* A confirmation (slice 11.3): the question as its heading, the action and Cancel in a
   row at the end. Open without script it sits in flow; confirm-dialog.js makes it modal. */
dialog h2 {
    margin-top: 0;
    font-size: var(--btm-h3);
}

dialog .actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--btm-space-2);
    margin: var(--btm-space-4) 0 0;
}

dialog .actions button {
    flex: 1 1 auto;
}

/* ---- Tables -------------------------------------------------------------------- */

/* Dense, after the stat tables in Look and Feel (slice 11.1, fitted to a phone in 11.4):
   small type, tight cells, tabular figures, nothing wrapping, numbers right-aligned (.num
   on the column's cells, the unit in its heading), zebra rows, and a header that stays
   put. The desk gets the same; density is the look, not a phone fallback. */
table {
    border-collapse: collapse;
    font-family: var(--btm-font-table);
    font-size: var(--btm-text-table);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

caption {
    text-align: left;
    font-weight: 600;
    padding: 0 0 var(--btm-space-1);
}

th, td {
    padding: var(--btm-space-1) var(--btm-space-2);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--btm-border);
}

thead th {
    position: sticky;
    top: 0;
    background: var(--btm-bg);
    border-bottom-width: 2px;
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background: var(--btm-row-alt);
}

th.num, td.num {
    text-align: right;
}

/* A line folded under a cell's own (a set's machine, an exercise's aliases, a friend's
   handle) is a line of its own, as wide as its text up to a readable width, then it
   wraps; a message in a cell wraps at a readable width too. A column never wraps. */
td small.fold {
    display: block;
    width: max-content;
    max-width: 16rem;
    white-space: normal;
}

td .validation-message, td .message {
    white-space: normal;
    min-width: 14rem;
}

/* The exercise list's Mine column (slice 11.9): a tick on the rows that are the user's
   own, blank on a shipped one, so yours read at a glance down a long list; and its Also
   called column, the other names an exercise goes by, muted and cut with an ellipsis
   at the width the folded line was allowed, the whole list in the cell's title. */
th.mine, td.mine {
    text-align: center;
}

td.also {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--btm-muted);
}

/* A Change cell (the volume table): a rise in green, a fall in red. The sign says the
   same, so nothing is told by colour alone; "the same" keeps the text colour. */
td.up {
    color: var(--btm-up);
}

td.down {
    color: var(--btm-down);
}

/* A table wider than the page scrolls sideways inside its .table-scroll box, never the
   page, the way Bootstrap's responsive tables do (the author, 2026-10-07; slice 11.4
   pinned the first column, which on a phone could be as wide as the box and hide the
   rest). tables.js marks the box .overflows while its table is wider than it; a table
   that fits keeps the page as its scroll container, which is what keeps its header
   put while the page scrolls. A row control's tap area overhangs the last row by a
   few pixels, and a scroll container would grow a vertical scrollbar for them, so the
   box pads its bottom by that much and clips anything else vertical. */
.table-scroll {
    margin: 0 0 var(--btm-space-4);
}

.table-scroll table {
    margin: 0;
}

.table-scroll.overflows {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: calc((var(--btm-touch) - 2rem) / 2);
}

/* A control column is one touch target wide, its control filling the cell: a tick box
   sits in a label, so the whole cell is the target. */
th.select, td.select {
    width: 2.75rem;
    min-width: 2.75rem;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
}

td.select, td.actions {
    padding-top: 0;
    padding-bottom: 0;
}

td.select label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    cursor: pointer;
}

td.select input[type=checkbox] {
    margin: 0;
}

/* Actions in a row (Edit, Delete, Copy, Print, the star): compact, so the row stays one
   line, and the tap area reaches the touch height a little beyond the button into the
   rows either side. */
table button, td.actions a {
    position: relative;
    min-height: 2rem;
    padding: 0 var(--btm-space-2);
    font-size: inherit;
}

td.actions a {
    display: inline-flex;
    align-items: center;
}

table button::before, td.actions a::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc((2rem - var(--btm-touch)) / 2);
    bottom: calc((2rem - var(--btm-touch)) / 2);
}

td.actions > * + * {
    margin-left: var(--btm-space-1);
}

/* ---- Figures ------------------------------------------------------------------- */

figcaption {
    font-size: var(--btm-text-sm);
    color: var(--btm-muted);
}

/* ---- Breadcrumbs --------------------------------------------------------------- */

/* On sub-pages (Product/Navigation.md), from the client project's Breadcrumbs: a
   wrapping row of touch-size links up, the page itself last and set in the text
   colour. Its marks match the nav bar's. */
nav.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0 0 var(--btm-space-2);
    padding: 0;
}

nav.breadcrumbs li {
    display: flex;
    align-items: center;
    margin: 0;
    min-height: var(--btm-touch);
}

nav.breadcrumbs li + li::before {
    content: "›";
    padding: 0 var(--btm-space-2);
    color: var(--btm-muted);
}

nav.breadcrumbs [aria-current=page] {
    color: var(--btm-text);
    font-weight: 600;
}

/* ---- Link rows ----------------------------------------------------------------- */

/* A page's own small row of links (slice 11.7, Look and Feel "Direction"): the views of
   a report (Day, Week, Month, Year), the pages beside this one (Volume over time, Enter
   past workouts), a sheet's days. Spaced, not joined with dots; each link a touch target;
   the current view in the text colour and weight, not underlined, as the breadcrumbs mark
   the page. A leading word ("Warm-ups:") is a plain span. */
nav.links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--btm-space-3);
    margin: 0 0 var(--btm-space-3);
    font-size: var(--btm-text-sm);
}

nav.links a, nav.links span {
    display: inline-flex;
    align-items: center;
    min-height: var(--btm-touch);
}

nav.links [aria-current=page] {
    color: var(--btm-text);
    font-weight: 600;
    text-decoration: none;
}

/* Read by screen readers, not shown. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media print {
    nav.breadcrumbs {
        display: none;
    }

    /* The sheet was laid out with the browser's default page margin; paper keeps it. */
    body {
        margin: var(--btm-space-2);
    }

    main {
        max-width: none;
        padding: 0;
    }
}

/* ================================================================================
   Per-feature rules, in the order the slices added them. The base above covers the
   element look; these set layout and the few classes the app owns.
   ================================================================================ */

/* The account pages' menu (Components/Account/Shared/ManageNavMenu, slice 11.2): a
   wrapping row of touch-size links under the heading, the current page marked the way
   the nav bar marks its section. */
nav.account-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--btm-space-1);
    list-style: none;
    margin: 0 0 var(--btm-space-4);
    padding: 0;
    border-bottom: 1px solid var(--btm-border);
}

/* ---- The sign-in pages (Look and Feel, "The sign-in pages") ---------------------------
   Log in and Register: one narrow column in the middle of the page, the mark over the
   heading, every button the column's full width. */
.sign-in {
    max-width: 24rem;
    margin: var(--btm-space-6) auto 0;
}

.sign-in > header {
    margin-bottom: var(--btm-space-6);
    text-align: center;
}

/* The ridge of bars, in the accent. */
.summit {
    display: block;
    width: 4.375rem;
    height: 2rem;
    margin: 0 auto var(--btm-space-3);
    fill: var(--btm-accent);
}

/* The heading in the figure face, as the gym screen's one figure is: the page's one
   bold moment. */
.sign-in > header h1 {
    margin: 0;
    font-family: var(--btm-font-figures);
    font-size: var(--btm-text-figure);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sign-in > header p {
    margin: var(--btm-space-2) 0 0;
    color: var(--btm-muted);
}

/* The form is the column itself, so its group needs no box of its own. */
.sign-in fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.sign-in legend {
    margin-bottom: var(--btm-space-3);
    padding: 0;
    color: var(--btm-muted);
    font-size: var(--btm-text-sm);
    font-weight: 400;
}

.sign-in input:not([type=checkbox]) {
    max-width: none;
}

.sign-in small {
    display: block;
    margin-top: var(--btm-space-2);
}

.sign-in .actions {
    display: grid;
    gap: var(--btm-space-2);
    margin: var(--btm-space-4) 0 0;
}

/* The other ways in, under a rule that carries their heading. */
.sign-in .providers {
    margin-top: var(--btm-space-6);
}

.sign-in .providers h2 {
    display: flex;
    align-items: center;
    gap: var(--btm-space-3);
    margin: 0 0 var(--btm-space-4);
    color: var(--btm-muted);
    font-size: var(--btm-text-sm);
    font-weight: 400;
}

.sign-in .providers h2::before, .sign-in .providers h2::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--btm-border);
}

.sign-in .providers p {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: var(--btm-space-2);
    margin: 0;
}

.sign-in nav.links {
    justify-content: center;
    margin-top: var(--btm-space-6);
}

/* A provider's mark beside its name, wherever a button offers that provider. */
button:has(> .provider-mark) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--btm-space-2);
}

.provider-mark {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
}

/* The services on Account, External logins: a boxed list, a row for each with its mark,
   its name over whether it is connected, and its one button at the end. */
ul.logins {
    max-width: 28rem;
    margin: 0 0 var(--btm-space-4);
    padding: 0;
    list-style: none;
    border: 1px solid var(--btm-border);
    border-radius: var(--btm-radius);
}

ul.logins li {
    display: flex;
    align-items: center;
    gap: var(--btm-space-3);
    margin: 0;
    padding: var(--btm-space-3) var(--btm-space-4);
}

ul.logins li + li {
    border-top: 1px solid var(--btm-border);
}

ul.logins .provider-mark {
    width: 1.5rem;
    height: 1.5rem;
}

ul.logins .service {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

ul.logins .service b {
    font-weight: 600;
}

ul.logins form {
    margin: 0;
}

/* Log out, under the account pages (slice 23.1). */
form.log-out {
    margin-top: var(--btm-space-6);
    padding-top: var(--btm-space-4);
    border-top: 1px solid var(--btm-border);
}

nav.account-nav li {
    margin: 0;
}

nav.account-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--btm-touch);
    padding: 0 var(--btm-space-2);
    color: var(--btm-text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

nav.account-nav a:hover {
    color: var(--btm-accent);
}

nav.account-nav a[aria-current=page] {
    color: var(--btm-accent);
    font-weight: 600;
    border-bottom-color: var(--btm-accent);
}

/* The routine editor (slice 4.2): days and planned exercises as boxes, targets side by side. */
fieldset.routine {
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

fieldset.day {
    margin: 0 0 1rem;
}

/* Each day a tab; the shown one joins the day's box below it. */
.day-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
}

.day-tabs [role=tablist] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.day-tabs [role=tab] {
    min-height: 2.5rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--btm-border);
    border-bottom: none;
    border-radius: var(--btm-radius-sm) var(--btm-radius-sm) 0 0;
    background: var(--btm-surface);
    color: var(--btm-text);
    font-weight: normal;
}

.day-tabs [role=tab][aria-selected=true] {
    background: var(--btm-bg);
    font-weight: 600;
}

.day-tabs [role=tab].problems {
    border-color: var(--btm-danger);
    color: var(--btm-danger);
}

fieldset.slot {
    margin: 0.75rem 0;
}

.targets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.targets input[type=number] {
    width: 6em;
}

/* A day's name and the reps text sit beside the numbers, so they keep a short width. */
.targets input:not([type=number]) {
    width: auto;
}

.options li button {
    margin-left: 0.25rem;
}

section.picker {
    border: 1px solid var(--btm-border);
    border-radius: var(--btm-radius);
    padding: 0 0.75rem 0.5rem;
    margin: 0.5rem 0;
}

/* The routine page (slice 14.2, Product/Routines.md "The routine page"): Edit and Print
   a sheet in a row like a page's own links, then one row per day under a rule, the
   exercise list beside the day's body at the desk and the body under it on a phone. */
form.routine-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--btm-space-4);
    margin: 0 0 var(--btm-space-4);
}

form.routine-actions a {
    display: inline-flex;
    align-items: center;
    min-height: var(--btm-touch);
}

p.routine-status {
    color: var(--btm-muted);
}

section.routine-day {
    border-top: 1px solid var(--btm-border);
    padding-top: var(--btm-space-3);
    margin-top: var(--btm-space-4);
}

.routine-day-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--btm-space-1) var(--btm-space-3);
}

.routine-day-head h2 {
    margin: 0;
}

.routine-day-hint {
    color: var(--btm-muted);
    font-size: var(--btm-text-sm);
}

.routine-day-next {
    color: var(--btm-accent);
    font-weight: 600;
    font-size: var(--btm-text-sm);
}

.routine-day-exercises {
    margin: var(--btm-space-3) 0;
    padding-left: var(--btm-space-6);
    font-variant-numeric: tabular-nums;
}

.routine-day-exercises li + li {
    margin-top: var(--btm-space-1);
}

.routine-day-exercises small, .routine-day-notes {
    color: var(--btm-muted);
}

.routine-day-notes {
    font-size: var(--btm-text-sm);
}

/* Move to on an exercise's line (slice 14.3): the editor's select, on its own line under
   the exercise, in the small size so the list still reads as a list. */
.routine-day-move {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--btm-space-2);
    margin-top: var(--btm-space-1);
    font-size: var(--btm-text-sm);
}

@media (min-width: 48rem) {
    .routine-day-body {
        display: grid;
        grid-template-columns: minmax(0, 36rem) auto;
        justify-content: start;
        gap: var(--btm-space-6);
        align-items: start;
    }
}

/* The gym screen (slice 5.2, laid out in 11.5; Product/Look and Feel.md): phone first.
   Done is the one large primary button; every other action is the quiet secondary one. */
section.gym button.primary {
    min-height: 3rem;
    min-width: 6rem;
    font-size: 1.1rem;
}

.next-days {
    padding-left: 0;
    list-style: none;
}

/* On a phone the start's buttons are as wide as the page (slice 21.3, Product/One Home
   Screen.md): Log body weight, Allow notifications, each day's Start and the ad hoc
   start. At the desk they keep their own width. */
@media (max-width: 600px) {
    section.gym.start button {
        width: 100%;
    }
}

/* The exercise list: one compact row per exercise, its name at the start and its state
   (the count done, "skipped") at the end, rows ruled apart, the current one marked by
   the accent and a bar on its left as well as its weight. */
ol.exercises {
    padding-left: 0;
    list-style: none;
    border-top: 1px solid var(--btm-border);
}

ol.exercises li {
    margin: 0;
}

ol.exercises button {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 0 var(--btm-space-2) 0 var(--btm-space-3);
    border: 0;
    border-bottom: 1px solid var(--btm-border);
    border-radius: 0;
    box-shadow: inset 3px 0 0 transparent;
    background: none;
    color: var(--btm-text);
    font-weight: 500;
    text-align: left;
}

ol.exercises button:hover {
    background: var(--btm-surface);
}

ol.exercises button small {
    flex: none;
    color: var(--btm-muted);
    font-variant-numeric: tabular-nums;
}

ol.exercises button.done, ol.exercises button.skipped {
    color: var(--btm-muted);
}

ol.exercises button[aria-current] {
    box-shadow: inset 3px 0 0 var(--btm-accent);
    background: var(--btm-accent-soft);
    color: var(--btm-text);
    font-weight: 600;
}

ol.exercises button[aria-current] small {
    color: var(--btm-accent);
}

/* The running total (slice 12.4): the workout's volume so far under the title, in
   tabular figures, and each exercise's subtotal in its row's state, before the count
   done, the two figures kept on one line however long the name. A resting row's
   countdown (slice 19.2) is a third figure before them, in the same small type. */
p.volume {
    font-variant-numeric: tabular-nums;
}

ol.exercises .state {
    flex: none;
    display: flex;
    gap: var(--btm-space-3);
    margin-left: var(--btm-space-2);
}

/* The current exercise opens under the list; its heading sits close to the row. */
section.current h2 {
    margin-top: var(--btm-space-3);
}

.last-time p, section.current > p {
    margin-bottom: var(--btm-space-2);
}

.last-time {
    font-variant-numeric: tabular-nums;
}

/* Today's sets: a numbered row each, the set in tabular figures, its state (sending,
   unsent, not saved) small at the end of the wording: visible, not shouting. Edit and
   Delete (slice 12.2) sit at the row's right end at the tables' compact size, their tap
   area reaching the touch height into the rows either side; the row being edited is
   marked like the current exercise. */
ol.sets {
    padding-left: 0;
    list-style: none;
    counter-reset: set;
}

ol.sets li {
    display: flex;
    align-items: center;
    gap: var(--btm-space-2);
    margin: 0;
    padding: var(--btm-space-1) 0;
    border-bottom: 1px solid var(--btm-border);
    font-variant-numeric: tabular-nums;
}

ol.sets li::before {
    counter-increment: set;
    content: counter(set) ".";
    min-width: 1.5em;
    color: var(--btm-muted);
    font-size: var(--btm-text-sm);
}

ol.sets .set {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--btm-space-2);
    min-width: 0;
}

ol.sets .state {
    margin-left: auto;
}

ol.sets .actions {
    flex: none;
    display: flex;
    gap: var(--btm-space-1);
}

ol.sets .actions button {
    position: relative;
    min-height: 2rem;
    margin: 0;
    padding: 0 var(--btm-space-2);
    font-size: var(--btm-text-sm);
}

ol.sets .actions button::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc((2rem - var(--btm-touch)) / 2);
    bottom: calc((2rem - var(--btm-touch)) / 2);
}

ol.sets li.editing {
    box-shadow: inset 3px 0 0 var(--btm-accent);
    background: var(--btm-accent-soft);
}

/* A set's note (slice 12.3) is a muted line of its own under the set, wrapping. */
ol.sets .note {
    flex: 1 1 100%;
    color: var(--btm-muted);
    white-space: normal;
    overflow-wrap: anywhere;
}

ol.sets .state.unsent, .unsent {
    color: var(--btm-danger);
}

/* The entry form: the boxes in a row with their labels above, Done after them; while a
   set is being edited (slice 12.2), Save and Cancel in its place. On a phone it is
   pinned to the bottom of the screen (below). The effective load of a bodyweight set is
   a line under Done. The note (slice 12.3) is a quiet Add a note at the end of the
   boxes' row until it is tapped, then a short box of its own on the row before Done. */
form.entry {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--btm-space-2) var(--btm-space-3);
    margin-bottom: var(--btm-space-4);
}

form.entry > span {
    display: block;
}

form.entry label {
    font-size: var(--btm-text-sm);
    white-space: nowrap;
}

form.entry input {
    width: 6em;
    font-size: var(--btm-text-lg);
}

form.entry .warm-up {
    display: flex;
    align-items: center;
    min-height: var(--btm-control);
}

form.entry .warm-up input {
    width: auto;
}

form.entry .effective-load, form.entry > p {
    flex: 1 1 100%;
    margin: 0;
}

form.entry .effective-load {
    font-size: var(--btm-text-sm);
    color: var(--btm-muted);
}

form.entry .add-note {
    flex: 0 0 auto;
    margin: 0;
}

form.entry .note {
    flex: 1 1 100%;
}

form.entry textarea {
    width: 100%;
    max-width: 28rem;
    min-height: var(--btm-control);
    font-size: var(--btm-text);
}

/* The rest timer (slice 12.6): one short line at the head of the entry form, the
   seconds left in tabular figures and Skip rest at the line's end at the rows' compact
   size, its tap area reaching the touch height; "Rest over." once it is up, until the
   next set. On a phone the line is the top of the pinned bar. */
form.entry .rest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--btm-space-2);
}

form.entry .rest button {
    position: relative;
    min-height: 2rem;
    margin: 0;
    padding: 0 var(--btm-space-2);
    font-size: var(--btm-text-sm);
}

form.entry .rest button::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc((2rem - var(--btm-touch)) / 2);
    bottom: calc((2rem - var(--btm-touch)) / 2);
}

p.finish {
    display: flex;
    flex-wrap: wrap;
    gap: var(--btm-space-2);
    margin-top: var(--btm-space-6);
}

p.machine button {
    margin-left: 0.5rem;
}

p.machine button:first-child {
    margin-left: 0;
}

ul.choices {
    padding-left: 0;
    list-style: none;
}

ul.choices button {
    margin: 0.15rem 0;
}

/* On a phone the entry form stays where the thumb is (Product/Gym Entry.md): pinned
   to the bottom of the screen while the exercise list and today's sets scroll above it,
   full width, the boxes sharing one row and Done the whole row under them. It sticks
   within the whole gym section, not the current exercise's own box, so the current
   section gives up its box (display: contents) and the form is in reach from the top of
   the page even when the exercise list fills the screen. The status line at the top
   sticks the same way, so what went wrong is never out of view. */
@media (max-width: 600px) {
    section.current {
        display: contents;
    }

    section.gym > .status {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    form.entry {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 0 calc(-1 * var(--btm-gutter)) var(--btm-space-4);
        padding: var(--btm-space-2) var(--btm-gutter) max(var(--btm-space-2), env(safe-area-inset-bottom));
        border-top: 1px solid var(--btm-border);
        background: var(--btm-bg);
    }

    form.entry > span {
        flex: 1 1 4.5em;
    }

    form.entry input {
        width: 100%;
    }

    form.entry .warm-up {
        flex: 0 0 auto;
    }

    form.entry .warm-up input {
        width: auto;
    }

    form.entry textarea {
        max-width: none;
    }

    form.entry button[type=submit] {
        flex: 1 1 100%;
    }

    form.entry:has(.cancel) button[type=submit] {
        flex: 2 1 55%;
    }

    form.entry .cancel {
        flex: 1 1 30%;
        min-height: 3rem;
    }

    /* A hold's Start and Stop (slice 18.3) sit beside Done, as Cancel sits beside Save. */
    form.entry:has(.start) button[type=submit] {
        flex: 2 1 55%;
    }

    form.entry .start {
        flex: 1 1 30%;
        min-height: 3rem;
    }
}

/* The charts (slices 7.2 to 7.4, on tokens since 11.1, checked on dark in 11.6): SVG
   drawn on the server. Axes and grid are the border grey, every label the text colour,
   so they read on either background. The volume chart's period in progress is hatched
   as well as paler, so "so far" shows without colour. */
svg.chart {
    display: block;
    width: 100%;
    max-width: 40rem;
    overflow: visible;
}

svg.chart .bar {
    fill: var(--btm-accent);
}

svg.chart .bar.current {
    fill: url(#chart-hatch);
    stroke: var(--btm-accent);
    stroke-width: 1;
}

svg.chart .hatch-ground {
    fill: var(--btm-accent-soft);
}

svg.chart .hatch {
    stroke: var(--btm-accent);
    stroke-width: 2;
}

svg.chart .axis, svg.chart .grid {
    stroke: var(--btm-border);
}

svg.chart .grid {
    stroke-dasharray: 4 4;
}

svg.chart text {
    font-size: 12px;
    fill: currentColor;
}

svg.chart .label {
    text-anchor: middle;
}

/* The per-exercise trend (slice 7.3): lines in SVG, each series told apart by more than
   its colour. The estimated best is a solid blue line with filled dots, the heaviest set
   a dashed orange one with rings, and volume, on its own chart, a solid blue line with
   squares. The legend's swatches carry the same marks. */
svg.chart.trend .line {
    fill: none;
    stroke-width: 2;
}

svg.chart.trend .best .line, svg.chart.trend .volume .line {
    stroke: var(--btm-accent);
}

svg.chart.trend .best .point, svg.chart.trend .volume .point {
    fill: var(--btm-accent);
}

svg.chart.trend .heaviest .line {
    stroke: var(--btm-series-2);
    stroke-dasharray: 6 4;
}

svg.chart.trend .heaviest .point {
    fill: var(--btm-series-2);
    stroke: var(--btm-series-2);
}

/* After the series rules, which it has to beat on fill. */
svg.chart.trend .point.ring {
    fill: var(--btm-bg);
    stroke-width: 2;
}

svg.chart.trend .label.start {
    text-anchor: start;
}

svg.chart.trend .label.end {
    text-anchor: end;
}

/* Body weight next to volume (slice 7.4): a line with a point per period. */
svg.chart .line {
    fill: none;
    stroke: var(--btm-accent);
    stroke-width: 2;
}

svg.chart .point {
    fill: var(--btm-accent);
}

/* Days logged as month grids laid out like `cal`, marked days filled. Days and dates are
   centred in their cells, as graphical calendars set them, so a marked day's number sits
   in the middle of its fill. Set in the table face with tabular figures (slice 11.7). */
.calendar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-bottom: 1rem;
    font-family: var(--btm-font-table);
}

.calendar table {
    margin: 0;
    font-size: var(--btm-text-sm);
}

.calendar caption {
    caption-side: top;
    text-align: center;
    padding: 0;
    color: inherit;
}

.calendar th, .calendar td {
    width: 2.2em;
    padding: 0.1em 0.2em;
    text-align: center;
    font-weight: normal;
    border: none;
}

.calendar thead th {
    position: static;
    background: none;
}

.calendar tbody tr:nth-child(even) {
    background: none;
}

.calendar td.marked {
    background: var(--btm-accent);
    color: var(--btm-accent-ink);
}

.calendar td.marked a {
    color: inherit;
}

/* Volume per muscle (slice 7.4): each group's row on the surface grey, like a heading,
   then its muscles indented under it (both on tokens, slice 11.6). The heat map's table
   (slice 11.8) is laid out the same way, with the heat step as the row's paint in place
   of the grey (heat-map.css). The group's name is at the one bold weight the table face
   ships, not the browser's heavier default. */
tr.group > * {
    background: var(--btm-surface);
}

tr.group th {
    text-align: left;
    font-weight: 600;
}

td.muscle {
    padding-left: 1.5rem;
}

/* Entering past workouts: the by-date grid (slice 9.5); its By exercise / By date switch
   is a link row like any other since slice 11.7. */
.history-day-when {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
}

.history-grid {
    width: 100%;
    font-family: inherit;
    font-size: inherit;
}

/* Weight and reps are short boxes; the note takes what is left (slice 11.2: width from
   the layout, not a size attribute). */
.history-grid td:nth-child(2), .history-grid td:nth-child(3) {
    width: 6em;
}

.history-grid input {
    width: 100%;
}

.history-grid th {
    position: static;
    text-align: left;
    padding: 0 0.25rem;
    border: none;
}

.history-grid td {
    padding: 0.125rem 0.25rem;
    vertical-align: top;
    border: none;
}

.history-grid tbody tr:nth-child(even) {
    background: none;
}

/* The exercise picker (Client/Exercises/ExerciseCombobox.razor): its list opens under the
   box, over what follows. */
.exercise-combobox {
    position: relative;
    display: inline-block;
}

.exercise-combobox [role=listbox] {
    display: block;
    position: absolute;
    z-index: 1;
    left: 0;
    min-width: 16rem;
    background: var(--btm-bg);
    border: 1px solid var(--btm-border);
    border-radius: var(--btm-radius);
    box-shadow: var(--btm-shadow);
}

.exercise-combobox [role=listbox][hidden] {
    display: none;
}

.exercise-combobox [role=option] {
    display: block;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.exercise-combobox [role=option][aria-selected=true] {
    background: var(--btm-accent-soft);
}

.history-grid tr.refused input {
    border-color: var(--btm-danger);
}

.history-grid tr.row-errors td {
    padding-bottom: 0.5rem;
}

/* On a phone the note and the exercise shrink to fit; the weight and reps stay short. */
@media (max-width: 600px) {
    .history-grid .exercise-combobox {
        display: block;
    }

    .history-grid td:nth-child(2), .history-grid td:nth-child(3) {
        width: 4.5em;
    }
}

/* The line-up on the Friends page (slice 20.11, Product/Comparing Friends.md "The
   line-up"): the user and every friend on one floor in one picture, drawn by
   body-3d-line-up.js. The stage's height is reserved here by the script's own rule (its
   scale, CSS pixels to a metre, is the width shared between the bodies, held between 70
   and 123; 2.424 metres of room over the floor and 62 px for the names under it), so the
   picture arrives without moving the page. Only with scripting on: with scripts off the
   figure is not shown at all, and where the picture cannot be drawn the script removes
   the figure, so the page is the list it always was. --line-up-count is the number of
   bodies, from the server. The names are placed by the script once it has drawn; until
   then they are hidden, the list under the line-up being the same people. */
.line-up {
    container-type: inline-size;
    margin: 0 0 1rem;
}

@media (scripting: none) {
    .line-up {
        display: none;
    }
}

.line-up-stage {
    position: relative;
    overflow: hidden;
    height: calc(2.424 * clamp(70px, 100cqi / (var(--line-up-count) * 0.95 + 0.2), 123px) + 62px);
    background: var(--btm-surface);
    border-radius: var(--btm-radius);
    /* A sideways drag anywhere on it is the script's (a body turned, or the row panned
       from the names' strip); pan-y leaves a vertical swipe to the browser. */
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

.line-up-stage a {
    -webkit-user-drag: none;
}

/* The floor: the band the names stand in. */
.line-up-stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62px;
    background: var(--btm-bg);
    border-top: 1px solid var(--btm-border);
    pointer-events: none;
}

/* A body is turned by dragging it sideways; pan-y leaves a vertical swipe to the
   browser, which scrolls the page. */
.line-up-stage canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

.line-up-people {
    list-style: none;
    margin: 0;
    padding: 0;
    visibility: hidden;
}

.line-up-stage:has(canvas) .line-up-people {
    visibility: visible;
}

.line-up-people li {
    position: absolute;
    z-index: 2;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.line-up-people .line-up-you {
    color: var(--btm-accent);
    font-weight: 600;
}

/* The top of the user's own head, across the whole row. */
.line-up-head {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    height: 0;
    border-top: 2px dashed var(--btm-accent);
    opacity: 0.8;
    pointer-events: none;
}

.line-up-head span {
    position: absolute;
    left: 4px;
    top: -1.15rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--btm-accent);
}

.line-up figcaption {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--btm-muted);
}

/* Head to head (slice 22.2, Product/Comparing Friends.md "Head to head"), after the
   prototype's Head to head tab: the user on the left in the accent colour and the friend
   on the right in --btm-friend, each name with its overall build under it, one sentence,
   and a bar for each muscle group. A bar's middle line is level; its fill grows from the
   middle toward whoever is ahead, a point of gap a point of width, so 50 or more fills
   that half. The figures sit either side of it. Slice 22.3 draws the bodies between the
   names and the sentence (below). */
.head-to-head {
    display: flex;
    flex-direction: column;
    gap: var(--btm-space-3);
    margin: 0 0 var(--btm-space-4);
}

.head-to-head-names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--btm-space-2);
    text-align: center;
    font-weight: 600;
}

.head-to-head-names p {
    margin: 0;
    overflow-wrap: anywhere;
}

.head-to-head-names small {
    display: block;
    font-weight: 400;
    color: var(--btm-muted);
    font-variant-numeric: tabular-nums;
}

.head-to-head .mine {
    color: var(--btm-accent);
}

.head-to-head .theirs {
    color: var(--btm-friend);
}

.head-to-head-say {
    margin: 0;
}

.head-to-head-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--btm-space-1);
}

.head-to-head-bars li {
    display: grid;
    grid-template-columns: 5.2rem 2rem minmax(0, 1fr) 2rem;
    align-items: center;
    gap: var(--btm-space-2);
    min-height: var(--btm-touch);
}

.head-to-head-bars .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--btm-text);
}

.head-to-head-bars .bar {
    position: relative;
    height: 0.9rem;
    background: var(--btm-bg);
    border: 1px solid var(--btm-border);
    border-radius: 2px;
}

.head-to-head-bars .bar::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -3px;
    bottom: -3px;
    width: 1px;
    background: var(--btm-muted);
}

.head-to-head-bars .bar i {
    position: absolute;
    top: 0;
    bottom: 0;
}

.head-to-head-bars .bar i.mine {
    right: 50%;
    background: var(--btm-accent);
}

.head-to-head-bars .bar i.theirs {
    left: 50%;
    background: var(--btm-friend);
}

/* Head to head's two bodies (slice 22.3), drawn by body-3d-line-up.js as the line-up is.
   The stage's height is reserved by the script's own rule: a scale of the width over 3 m,
   at most 130 px a metre, times the 2.424 m of room, and a 14 px floor. As the line-up's
   figure, it is not shown with scripts off and the script removes it where it cannot
   draw, so the page is the names, the sentence and the bars. The items only carry each
   body's data. Each head has its dashed line (the line-up's), the friend's in their
   colour and named on the right; the shorter one's name sits under its line. */
.head-to-head-picture {
    container-type: inline-size;
    margin: 0;
}

@media (scripting: none) {
    .head-to-head-picture {
        display: none;
    }
}

.head-to-head-stage {
    position: relative;
    overflow: hidden;
    height: calc(2.424 * min(100cqi / 3, 130px) + 14px);
    background: var(--btm-surface);
    border-radius: var(--btm-radius);
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

.head-to-head-stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14px;
    background: var(--btm-bg);
    border-top: 1px solid var(--btm-border);
    pointer-events: none;
}

.head-to-head-stage canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y pinch-zoom;
}

.head-to-head-people {
    display: none;
}

.line-up-head.theirs {
    border-top-color: var(--btm-friend);
}

.line-up-head.theirs span {
    left: auto;
    right: 4px;
    color: var(--btm-friend);
}

.line-up-head.under span {
    top: 2px;
}

.head-to-head-picture figcaption {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--btm-muted);
}

/* The colour switch: two buttons, the pressed one filled. */
.head-to-head-colours {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--btm-space-2);
    margin: var(--btm-space-2) 0 0;
}

.head-to-head-colours[hidden] {
    display: none;
}

.head-to-head-colours button[aria-pressed=true] {
    background: var(--btm-accent);
    border-color: var(--btm-accent);
    color: var(--btm-accent-ink);
}

/* With the picture, each group's row is a button that shows the group on both bodies;
   it keeps the row's grid, and is marked while it lasts. */
.head-to-head-bars li:has(> button) {
    display: block;
}

.head-to-head-bars li > button {
    display: grid;
    grid-template-columns: 5.2rem 2rem minmax(0, 1fr) 2rem;
    align-items: center;
    justify-content: stretch;
    gap: var(--btm-space-2);
    width: 100%;
    min-height: var(--btm-touch);
    padding: 0 var(--btm-space-1);
    background: transparent;
    border: 1px solid transparent;
    color: var(--btm-text);
    font-weight: inherit;
    text-align: left;
}

.head-to-head-bars li > button:hover {
    background: var(--btm-surface);
    border-color: var(--btm-border);
}

.head-to-head-bars li > button[aria-pressed=true] {
    background: var(--btm-surface);
    border-color: var(--btm-accent);
    outline: 1px solid var(--btm-accent);
}
