/* Colour tokens. The same values as the site's /site.css (Race Site Homepage),
   copied rather than imported so Training never depends on the homepage being
   deployed first. Muted and accent text are set per scheme so both pass 4.5:1. */
:root { color-scheme: light dark; --tabbar-h:3.4rem;
  /* The top bar's height above 720px: .4rem padding twice, a 2.75rem tap row
     and its 1px border. The bar holds it as a min-height and the More popover
     opens just under it, so the two cannot drift apart. */
  --topbar-h:calc(3.55rem + 1px);
  /* Accent and its tints. */
  --accent:#2f6fdb; --accent-text:#2f6fdb; --on-accent:#fff;
  --accent-soft:rgba(47,111,219,.18); --accent-tint:rgba(47,111,219,.10); --accent-faint:rgba(47,111,219,.07);
  /* Neutrals: mid-grey at a strength, so they read on either background. */
  --muted:#5f6368; --chrome:#f3f4f6;
  --line:rgba(128,128,128,.3); --line-soft:rgba(128,128,128,.2); --line-mid:rgba(128,128,128,.4); --line-strong:rgba(128,128,128,.5);
  --hover:rgba(128,128,128,.15); --tint:rgba(128,128,128,.08);
  --shadow:rgba(0,0,0,.3); --shadow-soft:rgba(0,0,0,.18);
  /* Meaning: problems, success, waiting (amber), and the WOD's orange. */
  --danger:#b3261e;
  --success:#1a7f37; --on-success:#fff; --success-text:#1a7f37;
  --warn:#b45309; --warn-text:#9a4a06; --warn-bg:#fff4e0; --warn-on-bg:#7a3e00;
  --wod:#9a5a0c; --wod-edge:#c8791b; --wod-bg:rgba(200,121,27,.08); --wod-bg-strong:rgba(200,121,27,.10);
  --wod-line:rgba(200,121,27,.25); --wod-line-soft:rgba(200,121,27,.18); }
/* Dark: only values change, never rules. Every colour above that would read
   wrongly on a dark screen has its own dark value here. */
@media (prefers-color-scheme: dark) { :root {
  --accent-text:#7aa5f5; --muted:#a0a4ab; --chrome:#181a20;
  --success:#1e5e32; --on-success:#e9f7ee; --success-text:#4cc26b;
  --warn:#d08a3c; --warn-text:#f0a050; --warn-bg:#33240f; --warn-on-bg:#f5c98a;
  --wod:#eda55a; --wod-edge:#eda55a; --wod-bg:rgba(237,165,90,.10); --wod-bg-strong:rgba(237,165,90,.13);
  --wod-line:rgba(237,165,90,.3); --wod-line-soft:rgba(237,165,90,.2); } }
* { box-sizing: border-box; }
body { font-family: system-ui,-apple-system,Segoe UI,Roboto,sans-serif; margin:0; line-height:1.45; background:Canvas; color:CanvasText; }
:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
a { color:var(--accent-text); text-underline-offset:.18em; }
.skip { position:absolute; left:-999px; top:.5rem; z-index:30; padding:.5rem .8rem; border-radius:.5rem; background:Canvas; color:inherit; }
.skip:focus { left:1rem; }
/* One bar: the way back to the rest of the site, the Training name, and
   Training's own four places plus More (layout_header). z-index: the sticky
   bar must stay above anything scrolling under it that makes its own stacking
   layer, such as a faded (opacity) button. */
.topbar { z-index:4; display:flex; align-items:center; gap:.4rem 1rem; min-height:var(--topbar-h); padding:.4rem 1rem; border-bottom:1px solid var(--line); position:sticky; top:0; background:Canvas; }
.sitehome { display:inline-flex; align-items:center; gap:.3rem; min-height:2.75rem; color:var(--muted); text-decoration:none; font-size:.9rem; }
.sitehome:hover { color:inherit; }
.topbar .brand { font-weight:700; }
.tabbar { display:flex; align-items:center; gap:.25rem; margin-left:auto; }
.tabbar > a, .tabbar .moretoggle { display:inline-flex; align-items:center; min-height:2.75rem; padding:0 .8rem; border-radius:.5rem;
  text-decoration:none; color:inherit; font-weight:600; cursor:pointer; }
.tabbar .moretoggle { border:0; background:none; }
.tabbar > a:hover, .tabbar .moretoggle:hover { background:var(--hover); }
.tabbar > a[aria-current], .tabbar .moretoggle.on { background:var(--accent-soft); color:var(--accent-text); }
.moretoggle::after { content:"\25BE"; margin-left:.35rem; font-size:.8em; }
/* "More" is an HTML popover (layout_header): the browser opens it, closes it
   on a tap elsewhere or Escape, and draws it above the page. Being on top of
   everything, it is placed against the screen rather than the button: under
   the sticky top bar, at its right-hand edge where More sits. Only an open
   one is a flex column, or this rule would override the browser's hiding. */
.morepanel { position:fixed; inset:auto; top:calc(var(--topbar-h) + .3rem); right:1rem; margin:0; min-width:12rem;
  padding:.35rem; border:1px solid var(--line); border-radius:.6rem; background:Canvas; color:inherit; box-shadow:0 6px 20px var(--shadow-soft); }
.morepanel:popover-open { display:flex; flex-direction:column; }
/* A browser without popovers (iOS before 17, Firefox before 125) ignores the
   attribute and would show the panel all the time. There it stays hidden
   until app.js opens it with .open, above the page as the old menu was. */
@supports not selector(:popover-open) {
  .morepanel { display:none; z-index:9; }
  .morepanel.open { display:flex; flex-direction:column; }
}
.morepanel a, .morepanel .navform button { display:flex; align-items:center; min-height:2.75rem; padding:0 .8rem; border-radius:.4rem;
  color:inherit; text-decoration:none; text-align:left; width:100%; }
.morepanel a:hover, .morepanel .navform button:hover { background:var(--hover); }
.morepanel a[aria-current] { color:var(--accent-text); font-weight:600; }
/* "Log out" is a POST form (see layout.php); its button reads as one of the links. */
.morepanel .navform { display:flex; margin:.2rem 0 0; padding-top:.2rem; border-top:1px solid var(--line); }
.morepanel .navform button { border:0; background:none; min-height:2.75rem; font-weight:400; }
/* The tabs at the top of a Races or Progress page (layout_tabs). */
.subtabs { display:flex; gap:.25rem; margin:.2rem 0 .4rem; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none; }
.subtabs a { flex:none; display:inline-flex; align-items:center; min-height:2.75rem; padding:0 .8rem; margin-bottom:-1px;
  color:var(--muted); text-decoration:none; font-weight:600; border-bottom:2px solid transparent; }
.subtabs a:hover { color:inherit; }
.subtabs a[aria-current] { color:inherit; border-bottom-color:var(--accent); }
/* On a phone the four places and More are a tab bar along the bottom, where a
   thumb reaches them; the top bar shrinks to the name and scrolls away. While
   a box has the keyboard up the bar steps aside, so it never rides up over the
   field being typed in. */
@media (max-width:720px) {
  .topbar { position:static; min-height:0; padding:.2rem 1rem; }
  .tabbar { position:fixed; left:0; right:0; bottom:0; z-index:8; margin:0; gap:0; display:grid; grid-template-columns:repeat(5, 1fr);
    padding:0 .25rem env(safe-area-inset-bottom); background:var(--chrome); border-top:1px solid var(--line); }
  .tabbar > a, .tabbar .moretoggle { justify-content:center; min-height:var(--tabbar-h); padding:0 .2rem; border-radius:0;
    font-size:.85rem; text-align:center; line-height:1.15; }
  .tabbar > a[aria-current], .tabbar .moretoggle.on { background:none; box-shadow:inset 0 3px 0 var(--accent); }
  .moretoggle::after { content:none; }
  .more { display:flex; }
  .tabbar .moretoggle { flex:1; }
  .morepanel { top:auto; bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .3rem); right:.5rem; }
  body.has-tabbar main { padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1.5rem); }
  body.has-tabbar .resttimer { bottom:calc(var(--tabbar-h) + 1px + env(safe-area-inset-bottom)); }
  body:has(input:focus, textarea:focus, select:focus) .tabbar { display:none; }
  body.has-tabbar:has(input:focus, textarea:focus, select:focus) .resttimer { bottom:0; }
}
main { max-width:820px; margin:0 auto; padding:1rem; }
h1 { font-size:1.5rem; line-height:1.2; } h2 { font-size:1.1rem; margin-top:1.5rem; }
.card { display:flex; flex-direction:column; gap:.6rem; max-width:24rem; }
label { display:flex; flex-direction:column; gap:.25rem; font-size:.9rem; }
input, select, button { font:inherit; padding:.6rem .7rem; border-radius:.5rem; border:1px solid var(--line-strong); background:Canvas; color:inherit; }
::placeholder { color:var(--muted); opacity:1; }
button { background:var(--accent); color:var(--on-accent); border-color:var(--accent); cursor:pointer; min-height:2.6rem; }
button.danger { background:var(--danger); border-color:var(--danger); }
button.small { padding:.35rem .6rem; min-height:auto; }
.flash { background:var(--success); color:var(--on-success); padding:.6rem .8rem; border-radius:.5rem; margin:.5rem 0; }
.error { background:var(--danger); color:var(--on-accent); padding:.6rem .8rem; border-radius:.5rem; margin:.5rem 0; }
.hint,.empty,.meta { color:var(--muted); font-size:.85rem; }
.folder { border:1px solid var(--line); border-radius:.6rem; padding:.8rem 1rem; margin:1rem 0; }
.files { list-style:none; padding:0; margin:.5rem 0; }
.files li { display:flex; align-items:center; gap:.5rem; padding:.5rem 0; border-bottom:1px solid var(--line-soft); flex-wrap:wrap; }
.files li a { font-weight:600; }
.upload { display:flex; gap:.5rem; flex-wrap:wrap; margin-top:.6rem; }
.users { width:100%; border-collapse:collapse; }
.users th,.users td { text-align:left; padding:.5rem; border-bottom:1px solid var(--line); vertical-align:top; }
.row-actions { display:flex; gap:.4rem; flex-wrap:wrap; }
form.inline { display:inline-flex; gap:.3rem; }
@media (max-width:560px){ .row-actions{flex-direction:column;} }
/* --- Phase 2: training-plan gym view --- */
.weeknav { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin:.4rem 0 1rem; }
.weeknav .wk { font-weight:700; font-size:1.05rem; }
.weeknav button[disabled] { opacity:.4; cursor:default; }
/* A session's date row is its heading (log.php): no title above it repeating
   the date, so the row is a touch bigger and its buttons a touch slimmer. */
.dayhead { margin:.1rem 0 .5rem; }
.dayhead .btn { padding:.25rem .7rem; }
.dayhead h1.wk { font-size:1.25rem; margin:0; }
.daycards { display:flex; flex-direction:column; gap:.6rem; }
.daycard { display:flex; flex-direction:column; gap:.15rem; padding:.85rem 1rem; border:1px solid var(--line); border-radius:.7rem; text-decoration:none; color:inherit; }
.daycard:hover { background:var(--tint); }
.daycard .d { font-size:1.15rem; font-weight:700; }
.daycard .ty { color:var(--accent-text); font-weight:600; font-size:.9rem; }
.daycard .hint { color:var(--muted); font-size:.8rem; margin-top:.2rem; }
.daycard.today { border-color:var(--accent); background:var(--accent-tint); }
.daycard .tag { font-size:.7rem; font-weight:700; color:var(--on-accent); background:var(--accent); border-radius:.3rem; padding:.05rem .3rem; margin-left:.4rem; vertical-align:middle; }
.sec { margin:1.1rem 0; }
.sec .seclbl { text-transform:uppercase; letter-spacing:.06em; font-size:.7rem; font-weight:700; color:var(--muted); margin-bottom:.4rem; }
.sec.wod .seclbl { color:var(--wod); }
.lines { list-style:none; padding:0; margin:0; }
.lines li { padding:.5rem 0; border-bottom:1px solid var(--line-soft); font-size:1rem; line-height:1.4; }
.sec.wod .lines { background:var(--wod-bg); border:1px solid var(--wod-line); border-radius:.6rem; padding:.2rem .8rem; }
.sec.wod .lines li { border-bottom:1px solid var(--wod-line-soft); }
/* A superset / circuit in the plan (layout_blocks): drawn as the log draws
   one, with the .ssgroup box, label and A1 / A2 badges further down. Here it
   is a list item, so it drops the plain line's rule and keeps the box's own
   padding and spacing. */
.lines li.grp { border-bottom:none; padding:.5rem .7rem .3rem; margin:1.3rem 0 .7rem; }
.grpitems { list-style:none; margin:0; padding:0; }
.grpitems li { padding:.45rem 0; border-bottom:1px solid var(--line-soft); font-size:1rem; line-height:1.4; }
.grpitems li:last-child { border-bottom:none; }
.daynav { display:flex; justify-content:space-between; gap:1rem; margin-top:1.4rem; }
.daynav a { color:var(--accent-text); text-decoration:none; font-weight:600; }
/* --- Phase 3: the week as a swipeable track on phones --- */
/* Wide screens keep the Phase 2 card list: the detail and the swipe furniture
   are simply not drawn, so a pane renders as the card it has always been. */
.daypane { min-width:0; }
.daydetail, .daydots, .swipehint { display:none; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (max-width:560px) {
  /* The track scrolls horizontally; it is never given a height, so it grows to
     its tallest pane and the page keeps the vertical scrolling. Constraining it
     would trap a second scrollbar inside the swipe area. */
  .daycards { flex-direction:row; align-items:flex-start; gap:0; overflow-x:auto;
              scroll-snap-type:x mandatory; overscroll-behavior-x:contain;
              -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .daycards::-webkit-scrollbar { display:none; }
  .daypane { flex:0 0 100%; scroll-snap-align:start; scroll-snap-stop:always; }
  /* The card degrades to the pane's heading. Without pointer-events:none a tap
     that ends a swipe navigates into session.php instead of settling the day. */
  .daypane > .daycard { pointer-events:none; border:0; border-radius:0; background:none; padding:.2rem 0 .4rem; }
  .daypane > .daycard .hint { display:none; }   /* the real exercises are right below */
  .daydetail { display:block; }
  .daydetail .sec:first-child { margin-top:.6rem; }
  .daydots { display:flex; justify-content:center; gap:.15rem; margin:-.2rem 0 0; }
  .daydots button { width:1.7rem; height:1.7rem; min-height:0; padding:0; border:0;
                    background:none; display:grid; place-items:center; cursor:pointer; }
  .daydots button::before { content:""; width:.55rem; height:.55rem; border-radius:50%;
                            background:var(--line-mid); transition:background .15s, transform .15s; }
  .daydots button.on::before { background:var(--accent); transform:scale(1.3); }
  .swipehint { display:block; text-align:center; margin:0 0 .5rem; }
}

/* --- Phase 3: race best times --- */
.race { border:1px solid var(--line); border-radius:.7rem; padding:.6rem 1rem 1rem; margin:1rem 0; }
.race h2 { margin:.3rem 0 .6rem; font-size:1.15rem; }
.tag { font-size:.7rem; font-weight:700; color:var(--on-accent); background:var(--accent); border-radius:.3rem; padding:.05rem .3rem; margin-left:.4rem; vertical-align:middle; }
.bests, .hist { list-style:none; padding:0; margin:0; }
.bests li, .hist li { display:flex; align-items:baseline; gap:.5rem; flex-wrap:wrap; padding:.5rem 0; border-bottom:1px solid var(--line-soft); }
.bests li:last-child, .hist li:last-child { border-bottom:none; }
.who { font-weight:600; }
/* Tabular figures so a column of times lines up digit for digit. */
.tm { font-variant-numeric:tabular-nums; font-size:1.15rem; font-weight:700; color:var(--accent-text); margin-left:auto; }
.hist .tm { font-size:1rem; }
.race details { margin-top:.6rem; }
.race summary { cursor:pointer; color:var(--muted); font-size:.85rem; padding:.3rem 0; }
.hist .hint { flex-basis:100%; }
.addbox { margin:1rem 0; }
.addbox summary { cursor:pointer; font-weight:600; padding:.4rem 0; }
.pick { border:1px solid var(--line-mid); border-radius:.5rem; padding:.5rem .7rem; margin:0; }
.pick legend { font-size:.9rem; padding:0 .3rem; }
.pick .cb { flex-direction:row; align-items:center; gap:.4rem; font-size:1rem; }
@media (max-width:560px) {
  /* The time stops being pushed to the right edge — at this width it reads
     better directly after the name than adrift across the row. */
  .tm { margin-left:0; }
}

/* Our races: entered races, and the "How did it go?" prompt after race day */
.prompt { border:1px solid var(--accent); border-radius:.6rem; padding:.7rem .9rem; margin:0 0 1rem; display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.prompt p { margin:0; flex:1 1 16rem; }
.racebox { border:1px solid var(--accent); border-radius:.6rem; padding:.7rem .9rem; margin:0 0 1rem; }
.racebox p { margin:0 0 .4rem; }
.racebox .racewhen, .racebox .hint { opacity:.8; }
a.btn { display:inline-block; background:var(--accent); color:var(--on-accent); border-radius:.5rem; padding:.45rem .8rem; text-decoration:none; }
.entries { list-style:none; padding:0; margin:0 0 1.2rem; }
.entries li { display:flex; flex-wrap:wrap; align-items:baseline; gap:.2rem .6rem; padding:.55rem 0; border-bottom:1px solid var(--line-soft); }
.entries .when { min-width:9rem; font-variant-numeric:tabular-nums; }
.entries .what { flex:1 1 12rem; font-weight:600; }
.entries .what a { color:inherit; }
.entries .calendar { flex:1 1 100%; }
/* History's session list (history.php): the date and set count on one line,
   then the exercises as a list; the whole entry is the link to the day. The
   nested list's items must not pick up .entries li's row layout and rule. */
.entries.sessions a { flex:1 1 100%; display:grid; grid-template-columns:1fr auto; gap:.1rem .6rem; color:inherit; text-decoration:none; }
.entries.sessions .when { font-weight:700; text-decoration:underline; text-underline-offset:.2em; }
.entries.sessions .meta { text-align:right; }
.entries .exlist { grid-column:1 / -1; margin:.15rem 0 0; padding-left:1.2rem; list-style:disc; }
.entries .exlist li { display:list-item; padding:.1rem 0; border:0; }

/* PB trend: one small line per entrant (server-drawn SVG). Faster is higher. */
.trend { margin:.3rem 0 .9rem; max-width:26rem; }
.trend figcaption { font-size:.85rem; font-weight:600; }
.trend svg { display:block; width:100%; height:auto; overflow:visible; }
.trend .grid { stroke:var(--line); stroke-width:1; vector-effect:non-scaling-stroke; }
.trend .tick { fill:currentColor; opacity:.6; font-size:10px; font-variant-numeric:tabular-nums; }
.trend .line { fill:none; stroke:var(--accent); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.trend .pt { fill:var(--accent); stroke:Canvas; stroke-width:2; }
.trend .pblbl { fill:currentColor; font-size:10px; font-weight:700; }
.trend .hit { fill:transparent; cursor:default; }
.trend .p:hover .pt { r:6; }
/* The pop-up for a tapped chart point (assets/chart.js), above the point and
   kept inside the chart's width; the ring marks which point it is. */
.trend { position:relative; }
.trend .ring { fill:none; stroke:var(--accent); stroke-width:2; }
.charttip { position:absolute; z-index:3; transform:translateX(-50%); padding:.35rem .6rem; border:1px solid var(--accent);
            border-radius:.5rem; background:Canvas; color:CanvasText; box-shadow:0 4px 14px var(--shadow);
            white-space:nowrap; line-height:1.3; pointer-events:none; }
.charttip strong { display:block; font-size:.95rem; font-variant-numeric:tabular-nums; }
.charttip span { display:block; color:var(--muted); font-size:.75rem; }
/* The range an exercise's charts show (exercise.php): 6 months by default. */
.ranges { display:flex; flex-wrap:wrap; gap:.35rem; margin:.8rem 0 .4rem; }
.ranges a { padding:.3rem .8rem; border-radius:999px; border:1px solid var(--line-strong); color:inherit; text-decoration:none; font-size:.9rem; }
.ranges a[aria-current] { background:var(--accent); border-color:var(--accent); color:var(--on-accent); font-weight:600; }
/* The folded sections on an exercise's page (exercise.php) — the records and
   the session list — closed by default; the summary line keeps the heading
   beside its open/close arrow. */
.fold { margin:1.2rem 0 .4rem; }
.fold summary { cursor:pointer; padding:.3rem 0; }
.fold summary h2 { display:inline; margin:0; }

/* --- Phase 4: training tracker --- */
/* Superset colours: first group red, then teal, purple, amber, cycling. The
   number badge means colour is never the only signal — red and amber are the
   pair that collapses under the commonest colour blindness. Mid-tone hues, so
   they hold contrast in both the light and dark themes the app follows. */
/* A superset is one outlined box in its colour, named "Superset A" on its top
   edge (Unlink all sits on the same edge at the right), and each member's name
   starts with an A1 / A2 badge: the box shows where the group starts and ends,
   the letter gives the order and is still in view mid-group. */
.ssgroup { --ss:#c62828; --ss-text:#c62828; position:relative; border:2px solid var(--ss); border-radius:.8rem;
           padding:.5rem .7rem .3rem; margin:1.4rem 0 .9rem; }
/* The colour comes from the group's position among the session's supersets,
   counted by CSS: the palette of four cycles, and a group moved or deleted
   recolours the rest with no class to keep in step. Position, never id:
   deleting the first group promotes the second to red, as FitNotes does. */
.ssgroup:nth-child(4n+2 of .ssgroup) { --ss:#0f766e; --ss-text:#0f766e; }
.ssgroup:nth-child(4n+3 of .ssgroup) { --ss:#8e44ad; --ss-text:#8e44ad; }
.ssgroup:nth-child(4n+4 of .ssgroup) { --ss:#b45309; --ss-text:#b45309; }
@media (prefers-color-scheme: dark) {
  .ssgroup { --ss-text:#f07a7a; } .ssgroup:nth-child(4n+2 of .ssgroup) { --ss-text:#4fc2b2; }
  .ssgroup:nth-child(4n+3 of .ssgroup) { --ss-text:#c99ae0; } .ssgroup:nth-child(4n+4 of .ssgroup) { --ss-text:#f0a050; }
}
.ssgroup .sslbl { position:absolute; top:-.7rem; left:.6rem; background:Canvas; padding:0 .4rem; line-height:1.3rem;
                  text-transform:uppercase; letter-spacing:.06em; font-size:.75rem; font-weight:800; color:var(--ss-text); }
.ssgroup > form.inline { position:absolute; top:-.75rem; right:.6rem; background:Canvas; padding:0 .3rem; margin:0; }
/* Unlink all is a quiet pill on the edge, like the 🔗 pills; ::before keeps a 44px tap area. */
.ssgroup > form.inline button { position:relative; border-radius:999px; font-size:.75rem; line-height:1.2; padding:.15rem .7rem;
                                min-height:auto; background:Canvas; color:var(--ss-text); border:1px solid var(--ss); }
.ssgroup > form.inline button::before { content:""; position:absolute; inset:-.7rem -.3rem; }
.ssbadge { display:inline-grid; place-items:center; min-width:2.1rem; height:1.6rem; padding:0 .35rem; margin-right:.45rem;
           border-radius:.35rem; background:var(--ss); color:var(--on-accent); font-size:.85rem; font-weight:800; vertical-align:.1em; }
.exc { border:1px solid var(--line); border-radius:.7rem; padding:.2rem .9rem .7rem; margin:.7rem 0; }
.ssgroup .exc { border:0; border-radius:0; padding:.1rem 0 .3rem; margin:0; }
/* Inside the plan's tinted WOD box the label's cut-out takes the same tint,
   so it does not show as a white patch on the border. */
.sec.wod .ssgroup .sslbl { background:linear-gradient(var(--wod-bg), var(--wod-bg)) Canvas; }
/* The 🔗 in the gap between two cards (log.php): a small pill on a thin
   dashed line, so it reads as part of the gap rather than another card
   control. The row is 44px tall and the pill's ::before stretches its tap area
   to match, so it is easy to hit on purpose while looking slim; the negative
   margin takes some of that height back out of the cards' own gap. A joint
   inside a superset takes that superset's colour (--ss) when linked. */
.joint { display:flex; align-items:center; justify-content:center; gap:.5rem; min-height:44px; margin:-.3rem 0; }
.joint::before, .joint::after { content:""; flex:1; border-top:1px dashed var(--line-strong); }
.joint .chain { position:relative; border-radius:999px; font-size:.75rem; line-height:1.2; padding:.2rem .7rem;
                min-height:auto; border:1px solid var(--accent); color:var(--accent-text); background:Canvas; }
.joint .chain::before { content:""; position:absolute; inset:-.7rem -.4rem; }
.joint .chain.on { border-color:var(--ss, var(--accent)); color:var(--ss, var(--accent)); }
.exc h2 { font-size:1.15rem; margin:.6rem 0 .4rem; }
.exccomment, .sessnote { font-size:.85rem; color:var(--muted); margin:.2rem 0 .5rem; }
.sets { list-style:none; padding:0; margin:0; }
.set { display:flex; align-items:baseline; justify-content:flex-end; gap:.35rem; padding:.45rem 0;
       border-bottom:1px solid var(--line-soft); font-variant-numeric:tabular-nums; }
.set:last-child { border-bottom:none; }
.set .n { font-size:1.3rem; font-weight:700; margin-left:.8rem; }
.set .u { color:var(--muted); font-size:.85rem; }
.set.notdone:not(.editable) { opacity:.45; }
/* The log page's sets are typed over in place (view_set_inputs). A set not yet
   done reads as planned — dashed, lighter — but never greyed out as disabled. */
.set.editable { align-items:center; }
.setin { display:flex; flex-direction:row; align-items:center; gap:.15rem; margin-left:.4rem; }
.setin input { width:3.4rem; font-size:1rem; font-weight:700; text-align:right; padding:.25rem .35rem; }
/* Native spin buttons would double up with the +/- buttons either side. */
.setin input::-webkit-outer-spin-button, .setin input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.setin input[type=number] { -moz-appearance:textfield; }
.setin .u { font-size:.7rem; }
.set.notdone .setin input { border-style:dashed; font-weight:400; }
.setin input.unsaved { border:1px solid var(--danger); }
/* Kept on the phone to send when there is signal (log.js's outbox): amber and
   dashed, apart from the red "refused" above. */
.setin input.queued { border:1px dashed var(--warn); }
/* log.js's red "not saved" banner, pinned to the top wherever the member has
   scrolled. */
#logproblem { position:sticky; top:0; z-index:50; }
/* The "changes waiting for signal" pill at the top of the log (log.js), calm
   rather than the red problem banner; green for its brief "All saved". It is
   pinned to the same top edge, so while both are showing the banner, a layer
   higher, covers it until the problem clears. */
#logoutbox { position:sticky; top:0; z-index:49; background:var(--warn-bg); color:var(--warn-on-bg); border:1px solid var(--warn);
  padding:.5rem .8rem; border-radius:.5rem; margin:.5rem 0; }
#logproblem > button, #logoutbox > button { margin-left:.5rem; }
#logoutbox.done { background:var(--success); color:var(--on-success); border-color:var(--success); }
/* The weight and reps boxes' +/- pair (view_set_inputs): a step in the box's
   own amount, saved through the same path as typing over the number. Flat
   siblings of the input (not wrapped in a further <label>) — see the comment
   in view_set_inputs(). Grid, not flex: a grid track never wraps onto a
   second line the way a flex item can, so the dec button, box, unit and inc
   button are guaranteed to stay one row, however little width is on offer. */
.setin.stepper { display:grid; grid-template-columns:repeat(4, auto); }
.stepbtn { padding:0; min-width:1.3rem; min-height:1.3rem; border-radius:.3rem;
           background:none; color:inherit; border:1px solid var(--line-strong); font-size:.8rem; line-height:1; }
.stepbtn:active { background:var(--hover); }
.set .trophy { margin-right:auto; font-size:1.1rem; }
/* The press-and-hold handle for reordering a card's sets (log.js shows it).
   Deliberately no touch-action: the page must keep scrolling under a finger on
   it, and log.js turns scrolling off only once a hold has become a drag. The
   [hidden] rule is needed because display:flex here would beat the attribute.
   It is out of the row's flow, so a row lays out exactly as it does without
   it (one line on a 375-390px phone): the 44px target starts in the card's
   left padding (.exc's .9rem, or .ssgroup's .7rem inside a superset), where
   the dots sit, and reaches over the row's empty left edge. The set's steppers and
   boxes sit above it, so a tap on the first - is never a hold. */
.set.editable { position:relative; }
.grip { position:absolute; left:-.9rem; top:0; bottom:0; width:2.75rem; min-width:44px; min-height:44px;
        display:flex; align-items:center; justify-content:flex-start; padding-left:.3rem; box-sizing:border-box;
        color:var(--muted); letter-spacing:-.25em; cursor:grab;
        user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
.ssgroup .grip { left:-.7rem; padding-left:.2rem; }
.grip[hidden] { display:none; }
.set.editable .setin { position:relative; z-index:1; }
/* The set being dragged: lifted off the list. */
.set.lifted { position:relative; z-index:2; transform:scale(1.02); background:Canvas;
              box-shadow:0 4px 14px var(--shadow); }
/* A reorder is on its way to the server; dim the list until it answers. */
.exc.saving .sets { opacity:.6; pointer-events:none; }
/* The note after a reorder, with its Undo button; styled like .flash. */
.setmoved { background:var(--success); color:var(--on-success); padding:.4rem .7rem; border-radius:.5rem; margin:.4rem 0;
            display:flex; align-items:center; gap:.6rem; font-size:.9rem; }
.setmoved button { background:none; color:inherit; border-color:currentColor; min-height:2rem; padding:.2rem .6rem; }
/* A move that was not saved says so in the error colour. */
.setmoved.bad { background:var(--danger); }
/* While a set is held, the others slide aside to show where it will drop. */
.sets.setdrag .set:not(.lifted) { transition:transform .15s ease; }
@media (prefers-reduced-motion: reduce) { .sets.setdrag .set:not(.lifted) { transition:none; } }
/* The calendar stays a grid at every width: the shape of the month is the point. */
.cal { display:grid; grid-template-columns:repeat(7, 1fr); gap:.2rem; margin:.5rem 0 1.2rem; }
.cal-head { text-align:center; font-size:.7rem; color:var(--muted); font-weight:700; padding:.2rem 0; }
.cal-day, .cal-pad { aspect-ratio:1; display:grid; place-items:center; border-radius:.4rem; font-size:.9rem; }
.cal-day { color:inherit; text-decoration:none; background:var(--tint); }
a.cal-day.trained { background:var(--accent); color:var(--on-accent); font-weight:700; }
.cal-day.today { outline:2px solid var(--accent); outline-offset:-2px; }

.lasttime { font-size:.85rem; color:var(--muted); margin:.2rem 0; }
.lasttime .lbl { text-transform:uppercase; letter-spacing:.06em; font-size:.7rem; font-weight:700; }
.nudge { font-size:.85rem; color:var(--accent-text); font-weight:600; margin:.2rem 0 .4rem; }
/* A lift the plan fill pushed (view_push_note): green while pushed, with a
   link-looking button to swap back; the note at the top lists them all. */
.nudge.done { color:var(--success-text); }
.linkbtn { background:none; border:0; color:var(--accent-text); padding:0 .2rem; min-height:auto; font-size:inherit; font-weight:600;
  text-decoration:underline; text-underline-offset:.18em; }
.pushsum { border:1px solid var(--accent); background:var(--accent-tint); border-radius:.6rem; padding:.55rem .7rem; font-size:.85rem; margin:.5rem 0; }
.pushsum ul { margin:.3rem 0 0; padding-left:1.1rem; }
.set .tick { margin-left:.4rem; min-width:1.8rem; min-height:1.8rem; border-radius:50%;
             background:none; color:inherit; border:1px solid var(--line-strong); font-size:.9rem; }
.set .tick.on { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
/* A tick or untick that could not be saved (log.js applyDropped): drawn back as saved, ringed red. */
.set.unsaved .tick { border:2px solid var(--danger); }
/* Scoped to .set, not button.small generally — exercises.php's "Delete" and
   the "remove exercise" button (log.php's <summary> section) keep their
   normal, larger size; only the per-set × shrinks. */
.set .danger { padding:.25rem .4rem; min-width:1.8rem; min-height:1.8rem; font-size:.85rem; }
/* A set's delete is out of the way while sets are being ticked: it shows only
   while the card's "Delete sets, comment, remove" drop-down is open, and then
   takes the tick's place, so the two are never side by side under a thumb. A
   browser without :has() keeps the old always-there button. */
.set .danger { display:none; }
.excform:has(.excmore[open]) .set .danger { display:inline-grid; place-items:center; }
.excform:has(.excmore[open]) .set .tick { display:none; }
@supports not selector(:has(*)) { .set .danger { display:inline-grid; place-items:center; } }
/* Units as column headings over the set rows: phone only (below). */
.sethead { display:none; }
.addset { display:flex; gap:.5rem; align-items:flex-end; flex-wrap:wrap; margin:.5rem 0 .2rem; }
.addset label { font-size:.75rem; }
.addset input { width:5.5rem; font-size:1.1rem; }
.excmore { margin-top:.4rem; }
.excmore summary { cursor:pointer; color:var(--muted); font-size:.85rem; padding:.3rem 0; }
/* The toggle that collapses an exercise card to its name (log.js). It ships
   hidden and log.js shows it, so it is never a dead control with JavaScript
   off. */
.mini { background:none; color:var(--muted); border:0; font-size:1.1rem; line-height:1; }
/* Collapsed: only the header is left — the name, and the ↑ ↓ that still move
   the card, which is what makes a long session quick to reorder. */
.exc.mini > *:not(.exchead) { display:none; }
.exc.mini .exchead { margin:0; }
/* A card's header: the name, then ↑ ↓ and the minimise toggle side by side at
   the top right. The name wraps rather than pushing the buttons off a phone. */
.exchead { display:flex; align-items:center; gap:.5rem; margin:.6rem 0 .4rem; }
.exchead h2 { flex:1; min-width:0; margin:0; }
.exctools { display:flex; align-items:center; gap:.3rem; flex-shrink:0; }
.exctools form { margin:0; }
.exctools .small { min-width:2.2rem; }
.exctools button[disabled] { opacity:.3; cursor:default; }
/* A card moved by its up/down button stays put under the finger while its
   neighbour jumps round it, so the card flashes to show it was the one moved. */
.exc.moved { animation:excmoved .7s ease-out; }
@keyframes excmoved { from { box-shadow:0 0 0 3px var(--accent); } to { box-shadow:0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .exc.moved { animation:none; } }
/* The timer sits above the thumb, out of the way of the tick buttons. */
.resttimer { position:fixed; left:0; right:0; bottom:0; display:flex; align-items:center; gap:.6rem;
             padding:.6rem 1rem; background:Canvas; border-top:3px solid var(--rt,var(--accent));
             box-shadow:0 -2px 12px var(--shadow-soft); z-index:5; }
/* display:flex above beats the hidden attribute, so without this an idle
   timer bar never went away — and a finished hold's sat over the rest's. */
.resttimer[hidden] { display:none; }
.resttimer .rt-left { font-size:1.6rem; font-weight:700; font-variant-numeric:tabular-nums; margin-right:auto; }
/* A hold sits above a rest's bar, and says which set it is timing. */
.holdtimer { z-index:6; }
.holdtimer .ht-what { font-weight:600; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* The end of a rest flashes the whole screen in the timer's colour (log.js):
   four flashes, two a second, under the three-a-second line for flashing
   content. Asking the phone for less motion gets one slow fade instead. */
.restflash { position:fixed; inset:0; pointer-events:none; z-index:20; opacity:0;
             background:var(--rt,var(--accent)); animation:restflash .5s ease-in-out 4; }
@keyframes restflash { 0%, 100% { opacity:0; } 50% { opacity:.85; } }
@media (prefers-reduced-motion: reduce) { .restflash { animation:restflash 1.6s ease-in-out 1; } }
.confetti { position:fixed; inset:0; pointer-events:none; z-index:10; }
@media (max-width:560px) {
  .addset input { width:4.6rem; }
  /* A set on a phone is one row of thumb-sized controls, used mid-set with
     tired hands: [- kg +] [- reps +] [tick]. Each box shares the width; the
     units move up into .sethead; the trophy becomes a badge on the tick; the
     delete only appears in place of the tick (above). 16px text in the boxes,
     or iOS zooms the page when one is tapped. */
  .set.editable { gap:.4rem; padding:.35rem 0 .35rem 1rem; }
  .set.editable .setin { flex:1 1 0; min-width:0; margin:0; }
  /* The boxes fill the row and sit above the grip, so on a phone the grip gets
     a 1rem gutter of its own, paid for by slimmer +/- buttons so the number
     boxes keep their width. It also reaches left across the page margin to
     the screen edge; the padding-left puts the dots mid-way across the card's
     left edge and the first button, so a press aimed at them has room either
     side. .sethead carries the same gutter to stay over its columns. */
  .grip { left:-1.9rem; width:3rem; padding-left:1.7rem; }
  .ssgroup .grip { left:-1.75rem; padding-left:1.7rem; }
  .setin input { width:100%; min-width:0; font-size:1rem; min-height:2.75rem; padding:.2rem; text-align:center; }
  .setin .u { display:none; }
  .setin.stepper { grid-template-columns:2.25rem minmax(0,1fr) 2.25rem; gap:.15rem; }
  .stepbtn { min-width:2.25rem; min-height:2.75rem; font-size:1.15rem; }
  .set .tick, .set .danger { flex:none; width:2.75rem; min-width:2.75rem; min-height:2.75rem; margin:0; padding:0; font-size:1rem; }
  .set [data-hold] { flex:none; min-height:2.75rem; }
  .set .trophy { position:absolute; right:-.3rem; top:-.05rem; z-index:2; font-size:.8rem; margin:0; pointer-events:none; }
  .sethead { display:flex; gap:.4rem; margin:.2rem 0 -.1rem; padding-left:1rem; font-size:.75rem; font-weight:700;
             text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
  .sethead span { flex:1 1 0; text-align:center; }
  .sethead .gap { flex:none; width:2.75rem; }
  .dayhead .btn { min-width:2.75rem; min-height:2.75rem; display:inline-grid; place-items:center; }
  /* The site-wide phone rule stacks .row-actions in a column; in a card's
     "Comment, remove" drop-down that put Save comment and Remove on two
     lines. Here they share one row under the full-width comment box, Remove
     at the right, away from Save. */
  .excmore .row-actions { flex-direction:row; flex-wrap:wrap; align-items:center; }
  .excmore .row-actions .danger { margin-left:auto; }
}
/* A WOD card: the text is the exercise, so give it room. */
.wodform textarea { width:100%; min-height:7rem; font:inherit; resize:vertical; }
.wodform input[name="seconds"] { max-width:8rem; }


/* --- Usability pass (docs/plans/2026-11-06-training-usability-design.md) --- */
/* A quieter button beside a main one: outlined in the accent, not filled. */
button.secondary, a.btn.secondary { background:none; color:var(--accent-text); border:1px solid var(--accent); }
a.btn.big { padding:.75rem 1.2rem; font-size:1.05rem; font-weight:700; }
/* Today with nothing logged: the next plan day to do, then the week's others. */
.nextup { border:1px solid var(--accent); border-radius:.7rem; padding:.7rem 1rem 1rem; margin:.4rem 0 1rem; }
.nextup .seclbl { text-transform:uppercase; letter-spacing:.06em; font-size:.75rem; font-weight:700; color:var(--muted); margin:0; }
.nextup h2 { margin:.2rem 0 .3rem; font-size:1.3rem; }
.nextup h2 .ty { color:var(--accent-text); font-size:1rem; font-weight:600; }
.nextup > .hint { margin:0 0 .8rem; }
.plandays { list-style:none; padding:0; margin:1rem 0 0; border-top:1px solid var(--line); }
.plandays li { display:flex; flex-wrap:wrap; align-items:center; gap:.2rem .7rem; min-height:2.75rem; border-bottom:1px solid var(--line-soft); }
.plandays li:last-child { border-bottom:none; }
.plandays .what { flex:1 1 10rem; font-weight:600; }
.plandays a { display:inline-flex; align-items:center; min-height:2.75rem; font-weight:600; }
.othersess { margin:0; flex-basis:100%; }
/* A day's "Log this session" on This week (phones; see layout_day_pane). */
.dayactions { margin:1rem 0 .4rem; }
.dayactions .hint { margin:0 0 .4rem; }
/* "Session deleted. [Undo]" (log_undo_banner). */
.flash.undo { display:flex; align-items:center; gap:.8rem; }
.flash.undo span { flex:1; }
.flash.undo button { background:none; color:inherit; border-color:currentColor; min-height:2.2rem; padding:.2rem .9rem; font-weight:700; }
/* Add an exercise, open under the last card; creating one is folded inside. */
.addex h2 { font-size:1.05rem; margin:1.4rem 0 .5rem; }
.newex { margin-top:.8rem; }
.newex summary { cursor:pointer; color:var(--muted); font-size:.9rem; padding:.4rem 0; }
.newex .card { margin-top:.5rem; }
/* Fill from the plan (plan-fill.php): lines needing a decision first and open,
   flagged in amber; a matched line folded to one row that opens on Change. */
.fillsum { margin:.2rem 0 .1rem; }
.fillline { display:flex; flex-direction:column; gap:.45rem; border:1px solid var(--line); border-radius:.6rem; padding:.55rem .85rem; margin:0; }
.fillline.needs { border-color:var(--warn); padding-bottom:.85rem; }
.fillline.needs h2 { margin:0; }
.fillline .flag { text-transform:uppercase; letter-spacing:.06em; font-size:.75rem; font-weight:700; color:var(--warn-text); }
details.fillline > summary { display:flex; align-items:center; gap:.55rem; min-height:2.6rem; cursor:pointer; list-style:none; }
details.fillline > summary::-webkit-details-marker { display:none; }
details.fillline .ok { color:var(--success-text); font-weight:800; }
details.fillline .what { flex:1; min-width:0; font-weight:600; }
details.fillline .what .hint { display:block; font-weight:400; }
/* Change looks like the site's secondary button (button.secondary), the height
   of the red ✕ beside it. It is a span: the whole <summary> is what opens. */
details.fillline .change { display:inline-flex; align-items:center; flex:none; min-height:2.6rem; padding:0 .8rem;
  border:1px solid var(--accent); border-radius:.5rem; color:var(--accent-text); font-weight:600; font-size:.9rem; }
details.fillline > summary:hover .change { background:var(--accent-tint); }
details.fillline[open] .change { visibility:hidden; }
details.fillline[open] { padding-bottom:.85rem; }
details.fillline[open] > :not(summary) { margin-top:.45rem; }
details.fillline > p { margin-bottom:0; }
/* The red ✕ beside Change (button.danger), a thumb-sized square; app.js shows
   it. A removed row is dashed and faded with its name crossed out, Change goes,
   and the ✕ becomes an Undo link. */
.fillrm { display:inline-grid; place-items:center; flex:none; width:2.6rem; padding:0; font-weight:700; }
.fillrm[hidden] { display:none; }
.fillrm.undo { width:auto; padding:0 .5rem; background:none; border-color:transparent; color:var(--accent-text); font-size:.9rem; }
details.fillline.removed { border-style:dashed; }
details.fillline.removed > summary { cursor:default; }
details.fillline.removed .ok, details.fillline.removed .change { visibility:hidden; }
details.fillline.removed .what, section.fillline.removed h2 { color:var(--muted); }
details.fillline.removed .nm, section.fillline.removed h2 { text-decoration:line-through; }
/* One look for every fold on a session (log.php: the card's "Delete sets,
   comment, remove", "Create a new exercise", "Move or delete this session",
   and Today's "Copy a past session"): a ▸ that turns as it opens. */
details.disc > summary { display:flex; align-items:center; gap:.45rem; min-height:2.75rem; padding:0; cursor:pointer;
  list-style:none; color:inherit; font-size:.92rem; font-weight:600; }
details.disc > summary::-webkit-details-marker { display:none; }
details.disc > summary::before { content:"\25B8"; color:var(--accent-text); font-size:.8rem; transition:transform .15s; }
details.disc[open] > summary::before { transform:rotate(90deg); }
@media (prefers-reduced-motion: reduce) { details.disc > summary::before { transition:none; } }
details.disc > summary small { color:var(--muted); font-weight:400; font-size:.85rem; }
/* The session note: open, one line, under Add an exercise. */
.sessnote h2 { font-size:1.05rem; margin:1.4rem 0 .5rem; }
.noterow { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.noterow input[type=text] { flex:1 1 12rem; min-width:0; }
.notestatus { margin-left:.5rem; }
.noterow .notestatus { flex-basis:100%; margin-left:0; }
