/* OHT — one stylesheet, no framework.
   Phone-first: everything stacks in one column, then widens into a grid at 720px / 1100px. */

:root {
  --bg: #0d1017;
  --panel: #151a23;
  --panel-2: #1b2029;
  --line: #262d3a;
  --ink: #e7ecf3;
  --ink-2: #9aa5b6;
  /* The faint grey, light enough to read 4.6:1 on everything it sits on (OHT-217; was #6b7688). */
  --ink-3: #7d899b;

  /* The accent behind white text - buttons, toggles, the bars - deeper than the bright blue, so
     white on it reads 4.6:1 (OHT-217; was #5b9dff, 2.7:1). Light mode's is deep enough already. */
  --accent: #3373d1;
  /* Two more from the accent (OHT-212): the accent as text and lines on a surface - the bright blue
     here, a deeper one in light mode (OHT-217) - and text on the accent. A theme whose accent is too
     bright to read on its own panels (fluoro green on white) or too pale under white text sets
     its own. */
  --accent-ink: #5b9dff;
  --on-accent: #fff;
  --fat: #f2a65a;
  --muscle: #4fc48b;
  --bone: #8f9bb3;
  --carb: #7c8cf8;
  --protein: #4fc48b;
  --warn: #f2705a;
  --check: #4fc48b;
  /* The meaning colours as text (OHT-217): the colours above in the dark look, deeper in the light
     one, where green, orange and red on white read 2 to 2.4:1. Only text takes them - charts,
     bars, pills and borders keep the colours above. And the red behind white text (Delete),
     deeper in both looks: white on the warning red reads 2.9:1, on this 4.6:1. */
  --muscle-ink: var(--muscle);
  --fat-ink: var(--fat);
  --warn-ink: var(--warn);
  --warn-fill: #c94b37;

  /* Body regions. Colour tells exercises apart at a glance; a glyph carries the same
     distinction so it survives colour blindness and greyscale. */
  --region-chest: #e0645f;
  --region-back: #4a90d9;
  --region-arms: #a06fd8;
  --region-legs: #45b97c;
  --region-shoulders: #e39a3c;
  --region-core: #3fb3b3;
  --region-other: #8f9bb3;

  --radius: 14px;
  --gap: 14px;
  --pad: 18px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --panel-2: #f0f3f8;
    --line: #dfe4ed;
    --ink: #131722;
    --ink-2: #5b6577;
    --ink-3: #656e7f;
    --accent: #2b6fd6;
    /* Blue as text and lines, deep enough to read 4.6:1 on white and on the accent's own pale tints
       (OHT-217; it was the accent, 3.3:1 on them). Buttons keep the accent behind white text. */
    --accent-ink: #2159ad;
    --bone: #7d879b;
    --check: #1f9a5a;
    --muscle-ink: #037e50;
    --fat-ink: #a05e02;
    --warn-ink: #b23523;
  }
}

* { box-sizing: border-box; }

/* An author `display` rule outranks the UA stylesheet's `[hidden] { display: none }`, so
   .gate's `display: grid` would keep it on screen even when hidden. Restore the intent. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

body { padding-bottom: env(safe-area-inset-bottom); }

code { font-family: var(--mono); font-size: .9em; }

/* ---------------------------------------------------------------- sign-in */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate__card {
  width: min(360px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 14px;
}

.gate__title { margin: 0; font-size: 30px; letter-spacing: .14em; }
/* The logo is the title (OHT-201): "OHT" is its alt, in these letters if it cannot load. */
.gate__title img { display: block; }
.gate__sub { margin: -8px 0 6px; color: var(--ink-2); font-size: 13px; }
/* The sign-up page's "Sign in" link, in the app's colour rather than the browser's. */
.gate__sub a { color: var(--accent-ink); }
.gate__error { margin: 0; color: var(--warn-ink); font-size: 13px; }

/* "Forgot password?" and the way back from it (OHT-114): quiet, under the button that matters.
   "Create an account" too (OHT-157), a link rather than a button, so not underlined either. */
.gate__link {
  justify-self: center;
  margin: -4px 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.gate__note { margin: 0; color: var(--ink-2); font-size: 13px; }
/* Open sign-up (OHT-157): room for Cloudflare's check, and what starting over deletes. */
.gate__check { min-height: 65px; }
.gate__danger {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line));
  border-radius: 10px;
  font-size: 13px;
}
.gate__danger strong { color: var(--warn-ink); }
.gate__step { display: grid; gap: 14px; }

/* Backup and restore live on the gate (OHT-62). The moment you actually want a restore is the
   moment the app will not load, so the one screen that always renders is where they belong. */
.gate__mode {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 35%, var(--line));
}
.gate__mode--restore {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}

.gate__panel { width: min(460px, 100%); }
.gate__heading { margin: 0; font-size: 19px; }
.gate__actions { display: flex; gap: 10px; }
.gate__actions .btn { flex: 1 1 auto; }

.gate__results { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.gate__results .is-bad { color: var(--warn-ink); }

/* Capped so that twenty snapshots still leave the buttons below them on screen. */
.gate__list {
  display: grid;
  gap: 8px;
  max-height: min(46dvh, 380px);
  overflow-y: auto;
  margin: 0 -4px;
  padding: 2px 4px;
}

.bk {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "db when" "db meta";
  gap: 1px 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.bk:hover { border-color: var(--accent-ink); }

/* Which database, said in colour and in words - the two are never the same database, and
   picking the wrong one is the mistake with no undo worth having. */
.bk__db {
  grid-area: db;
  align-self: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.bk__db--training { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-ink); }
.bk__db--security { background: color-mix(in srgb, var(--muscle) 22%, transparent); color: var(--muscle-ink); }
.bk__when { grid-area: when; font-size: 14px; }
.bk__meta { grid-area: meta; color: var(--ink-2); font-size: 12px; }

/* ---------------------------------------------------------- disclaimer (OHT-41) */

/* Above everything, including the gate, and opaque rather than translucent: a legal notice you
   read through the dashboard is one you were shown but not really told. */
.disclaimer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg);
}

/* Basic or Advanced, on a brand-new account (OHT-127). Two cards side by side where there
   is room and stacked on a phone, because a comparison you have to scroll between is not a
   comparison. */
.vm { width: min(760px, 100%); }
.vm__title { margin: 0 0 6px; font-size: 20px; }
.vm__intro { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.vm__cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .vm__cards { grid-template-columns: 1fr 1fr; } }
.vm__card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad);
}
.vm__name { margin: 0; font-size: 17px; }
.vm__lead { margin: 0; color: var(--ink-2); font-size: 13px; }
.vm__points { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.vm__points li { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
/* Pinned to the bottom so the two buttons line up however long the lists are. */
.vm__pick { margin-top: auto; }
.vm__foot { margin: 16px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.55; }

.disclaimer__card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: grid;
  gap: 14px;
}

.disclaimer__title { margin: 0; font-size: 22px; }
.disclaimer__lead { margin: 0; color: var(--ink); font-size: 15px; }

.disclaimer__points { margin: 0; display: grid; gap: 12px; }
.disclaimer__points dt {
  font-weight: 650;
  font-size: 14px;
  margin-bottom: 2px;
}
.disclaimer__points dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.disclaimer__meta { margin: 0; color: var(--ink-3); font-size: 12px; }
.disclaimer__error { margin: 0; color: var(--warn-ink); font-size: 13px; }
.disclaimer__actions { display: flex; gap: 10px; }
.disclaimer__actions .btn { flex: 1 1 auto; }

.field { display: grid; gap: 6px; }
/* A locked field. The point is that it reads as inert at a glance without the value getting
   harder to read - the panel exists to show those numbers. So: a flatter surface, a dashed
   edge, and a small tag on the label. The emoji padlock that was here first was the only
   glyph of its kind in the app and looked pasted on. */
/* Locked, a box you type in stays filled and a picker stays a ghost button: the dashes say which
   are fixed. */
.field--locked input, .field--locked .pick {
  border-style: dashed;
  cursor: not-allowed;
}
.field--locked input:disabled, .field--locked .pick:disabled { opacity: 1; color: var(--ink-2); }
.field--locked .field__label { color: var(--ink-3); }
.field__lock {
  margin-left: 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--ink-3);
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.plan-lock {
  margin: 12px 0 0; padding: 9px 11px 9px 13px; border-radius: 8px; font-size: 12px;
  color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line);
  /* A quiet accent edge does the work the padlock emoji was doing, in the app's own idiom. */
  border-left: 3px solid color-mix(in srgb, var(--ink-3) 45%, var(--line));
}
/* The same box, but carrying a way out rather than only an explanation. */
.plan-lock--action {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.field__label { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
/* A unit's symbol as it is written where a label is set in capitals - kJ is not KJ (OHT-270). The
   energy row's labels are nothing but symbols. */
.unit-symbol, .food__energyrow .field__label { text-transform: none; }

/* Every text-ish input, listed by type so a checkbox or a radio is not caught by it. A type that
   is missing here gets the browser's own control instead, sitting next to styled ones at a
   different height and a different colour - which is what happened to the email box on the
   sign-in card the day it was added, and to the date on the weigh-in and soreness pages until
   OHT-229. Adding an input type means adding it here. */
input[type=password], input[type=text], input[type=number], input[type=email],
input[type=tel], input[type=url], input[type=search], input[type=date] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}
/* A date in that box (OHT-229): iOS draws its own grey pill and centres the date unless told not
   to, and the calendar mark and the picker take the look's dark or light, not the device's - OHT's
   own look here, a theme's in themes.css. */
input[type=date] { -webkit-appearance: none; appearance: none; color-scheme: dark; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
@media (prefers-color-scheme: light) { input[type=date] { color-scheme: light; } }
input:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 11px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
/* Destructive, and clickable. The button is only ever red when pressing it will shorten a
   block you are already running, so the colour is the warning, not decoration. */
.btn--danger { background: var(--warn-fill); color: #fff; }
.btn--ghost {
  background: transparent; color: var(--ink-2); border-color: var(--line); padding: 7px 12px;
  font-size: 13px;
}
.btn:hover { filter: brightness(1.08); }

/* ---------------------------------------------------------------- chrome */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* The logo stands for the name (OHT-201): 32px, under the 34 of the bar's buttons and narrower
   than the 36 the letters took, so the bar is no taller and a phone's no tighter. */
.topbar__logo { display: block; flex: none; }
.topbar__date { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 10px; flex: none; }
/* The security chip carries two forms, security.js. Wide screens show its words. */
#security-alert .chip__short { display: none; }

/* On a phone the bar holds a logo, a date, a phase chip, the messages bell, Settings and Sign
   out. Weigh-in moved into the Body composition panel on 2026-09-13 to make room for the bell.
   The chip is the one that can go - the mesocycle panel says the same thing a screen below. */
@media (max-width: 520px) {
  #topbar-phase { display: none; }
  /* Editing adds two more buttons; the date is the least useful thing in that moment. */
  body.is-layout-editing .topbar__date { display: none; }
  /* A lit security chip keeps its number and drops its words, and the date gives way while it
     is lit. Measured 2026-09-13 at 360 wide: the bar had 12px to spare, the words took 154,
     and the bar overflowed by 39 with the logo crushed to nothing. */
  #security-alert .chip__long { display: none; }
  #security-alert .chip__short { display: inline; }
  .topbar:has(#security-alert:not([hidden])) .topbar__date { display: none; }
  /* While the layout is being edited the chip steps aside too: Reset and Done need the room.
     Measured 2026-09-13, lit and editing at 360 wide: the chip sat on top of the logo. */
  body.is-layout-editing #security-alert { display: none; }
}

.chip {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip--accent { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 40%, var(--line)); }
/* The security alert. A button, so it needs the reset a chip does not normally carry. */
.chip--warn {
  color: var(--warn-ink);
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
  background: color-mix(in srgb, var(--warn) 10%, var(--panel-2));
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: none;
  cursor: pointer;
}
.chip--warn:hover { background: color-mix(in srgb, var(--warn) 18%, var(--panel-2)); }
.chip--warn { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.chip--muscle { color: var(--muscle-ink); border-color: color-mix(in srgb, var(--muscle) 40%, var(--line)); }

/* --- OHT-40: the settings menu ---------------------------------------------------------
   The detail chips were built into the topbar first and measured at 375px: the bar overflowed
   by 34px with the date already crushed to zero width and the phase chip already hidden. There
   was no concession left to make, so the layout editor became Settings and took them in. */
/* NOT position:relative. Anchoring the menu to the button hangs it 3px off the left edge at
   375px - the button is not at the edge of the bar, Weigh-in is to its right, so a 272px panel
   right-aligned to it starts at -3. The topbar is position:sticky and therefore already a
   containing block, so the menu anchors to the BAR and lines up with its padding instead. */
.settings { position: static; }

.settings__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 16px;
  z-index: 20;
  width: min(272px, calc(100vw - 32px));
  padding: 8px;
  display: grid;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgb(0 0 0 / .38);
}

.settings__item {
  appearance: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  /* One of them is an anchor (OHT-80), which arrives underlined and the wrong colour. */
  text-decoration: none;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}
.settings__item:hover { background: var(--panel-2); }
.settings__item:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }

.settings__label { font-size: 13px; font-weight: 600; }
.settings__sub { font-size: 11px; color: var(--ink-2); line-height: 1.4; }

.settings__group {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line);
}
.settings__heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
/* The chips are the ones from the 3-dot menu, not a second kind of chip: same component, same
   .is-on. A settings menu is not the place to introduce a new way of showing "this one". */
.settings__chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- OHT-60: a panel that ends with two actions ------------------------------------------
   Most panels end with one full-width button. Diet, Weekly volume and the session panel (Log and
   Skip this session, OHT-249) end with two, so they share a row 50/50 and only the primary is filled. `margin-top: auto` does for this row what
   `.panel > .btn:last-child` does for the single button: pins it to the bottom, so a panel
   stretched to match its neighbour lines its actions up with the one beside it. */
.panel__actions { display: flex; gap: 8px; margin-top: auto; }
/* Half a phone is narrow for "Plan ahead for Sun, 25 Oct": a label too long for its half wraps onto a
   second line, where a button's would push the row - and the page - past the screen (OHT-249-F1). */
.panel__actions .btn { flex: 1; white-space: normal; }

/* --- OHT-60: meal breakdown ------------------------------------------------------------- */
.meals__day { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.meals__daynum { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.meals__dayunit { color: var(--ink-2); font-size: 13px; }
.meals__daymacros { margin-left: auto; color: var(--ink-2); font-size: 12px; }

.meals__slider { display: grid; gap: 10px; margin-bottom: 20px; }
.meals__count { display: flex; align-items: baseline; gap: 8px; }
.meals__countnum { font-size: 26px; font-weight: 700; color: var(--accent-ink); min-width: 1.2em; }
.meals__countunit { color: var(--ink-2); font-size: 13px; }

/* A native range input, restyled rather than rebuilt: the thumb, the keyboard support and the
   drag behaviour are all free and all correct, which a div-and-pointer-events version is not. */
.meals__range {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0;
}
.meals__range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
}
.meals__range::-moz-range-track {
  height: 6px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
}
.meals__range::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; margin-top: -10px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 1px 6px rgb(0 0 0 / .35);
}
.meals__range::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 1px 6px rgb(0 0 0 / .35);
}
.meals__range:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }

/* The notches are also the tap targets. Browsers disagree about whether they draw datalist
   ticks at all, so these are what actually guarantees the stops are visible - and on a phone
   they are an easier hit than the thumb. */
.meals__notches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.meals__notch {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 0; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2);
}
.meals__notch:hover { color: var(--ink); }
.meals__notch.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.meals__notch:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

.meals__table { display: grid; gap: 2px; }
.meals__row {
  display: grid; grid-template-columns: 1fr 64px repeat(4, minmax(40px, auto));
  gap: 8px; align-items: baseline;
  padding: 8px 2px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.meals__row > span:not(.meals__label) { text-align: right; }
.meals__row--head {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  border-bottom-color: var(--line);
}
/* Meal and Size hold text that starts at the left, so their headings do too. Each row is its own
   grid, which is why the size column is a fixed 64px and not auto: auto sized the heading's
   column to the word SIZE and the rows' to the size's box, and the two stopped lining up. */
.meals__row--head > span:nth-child(-n + 2) { text-align: left; }
.meals__label { color: var(--ink-2); font-size: 13px; }
/* The name, editable in place. Sized like the label it replaced and dressed as a field only on
   focus, so the table still reads as a table until you reach for it. Scoped through .meals__row
   because input[type=text] is an attribute selector and outranks a bare class. min-width:0
   because a grid column will not shrink an input below its size attribute without it. */
.meals__row .meals__name {
  font: inherit; font-size: 13px; color: var(--ink);
  width: 100%; min-width: 0; padding: 4px 6px; margin: -4px -6px;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
}
.meals__row .meals__name:hover { border-color: var(--line); }
.meals__row .meals__name:focus {
  background: var(--panel-2); border-color: var(--accent-ink); outline: none;
}
.meals__row .meals__name::placeholder { color: var(--ink-3); }
.meals__kcal { font-weight: 700; }
/* How big the meal is next to a plain one (OHT-61). A field that looks like one, unlike the
   name: four fixed choices are not something you would find by accident. */
.meals__size {
  font: inherit; font-size: 13px; color: var(--ink); padding: 3px 4px; width: 100%;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
}

/* --- OHT-60: the food log ---------------------------------------------------------------- */
/* ‹ the day on show › above its total (OHT-61). */
.food__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.food__navday { font-weight: 600; text-align: center; }
.food__nav .btn { min-width: 44px; font-size: 20px; line-height: 1; }
.food__day { display: grid; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

.food__meal { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.food__meal--stray { opacity: .85; }
.food__mealhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.food__mealname { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.food__none { margin: 0; color: var(--ink-3); font-size: 12px; }

/* The day's food against its plan (OHT-168): eaten, target and left for calories and each macro,
   a bar under each. The same block on the dashboard and the food log, drawn by one function. */
.panel__eaten { display: grid; gap: 6px; padding-top: 4px; }
.ledger {
  display: grid; grid-template-columns: 1fr repeat(3, minmax(52px, auto)); gap: 4px 12px;
  align-items: baseline; font-variant-numeric: tabular-nums;
}
.ledger__head {
  color: var(--ink-2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  text-align: right;
}
.ledger__name { font-size: 14px; font-weight: 600; }
.ledger__unit { margin-left: 5px; color: var(--ink-2); font-size: 12px; font-weight: 400; }
.ledger__num { font-size: 14px; text-align: right; }
.ledger__num.is-kcal { font-weight: 700; }
/* Each macro's share of the calories: of what was eaten, then as planned - which the diet phase
   moves (OHT-285). On one line, so the two never part. */
.ledger__share {
  margin-left: 5px; color: var(--ink-2); font-size: 12px; font-weight: 400; white-space: nowrap;
}
.ledger__left.is-over { color: var(--warn-ink); }
/* Two classes, because .food__bar, further down, is the meal rows' 60px. */
.ledger .ledger__bar { grid-column: 1 / -1; width: 100%; height: 5px; margin-bottom: 4px; }

/* How much of the day is an estimate (OHT-214): under the table, across it. */
.ledger__note { grid-column: 1 / -1; margin: 2px 0 0; color: var(--ink-2); font-size: 12px; }

.food__meta {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.food__meta.is-over { color: var(--warn-ink); }
.food__bar { width: 60px; height: 5px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.food__fill { display: block; height: 100%; background: var(--accent); }
.food__meta.is-over .food__fill { background: var(--warn); }

/* A food's row (OHT-172): its Edit and Delete lie under it, shown by swiping it to the left. The
   slide takes sideways moves only (pan-y), so a swipe up or down still scrolls the page. */
.food__entry { position: relative; overflow: hidden; }
.food__slide {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 7px 0;
  background: var(--panel); touch-action: pan-y pinch-zoom; transition: transform .2s ease;
}
.food__slide.is-swiping { transition: none; user-select: none; -webkit-user-select: none; }
/* Rounded like every other button, and set in from the row's top and bottom so the rounding shows;
   a little apart, and a little way off the food they slide in beside (OHT-175). The swipe travels
   the whole of .food__actions, so its left padding is the room left between them. */
.food__actions {
  position: absolute; inset: 0 0 0 auto; display: flex; gap: 6px; padding: 5px 0 5px 12px;
}
.food__act {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  width: 66px; border: 0; border-radius: 9px; color: #fff;
}
.food__act--edit { background: var(--accent); color: var(--on-accent); }
.food__act--del { background: var(--warn-fill); }
.food__act:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }  /* the row clips outside it */
/* Under the day's meals: what a row does that nothing on it shows (OHT-172). */
.food__swipehint { margin: 14px 0 0; color: var(--ink-3); font-size: 13px; text-align: center; }
.food__what { display: grid; gap: 1px; min-width: 0; flex: 1; }
.food__name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The maker, under the food and quieter than it: it identifies the thing, it is not the thing. */
.food__brand {
  font-size: 11px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* "your estimate" where a logged amount would be (OHT-214): a guess, not a maker. */
.food__estimate { font-style: italic; }
.food__qty { color: var(--ink-3); font-size: 11px; }
.food__nums { display: grid; gap: 1px; text-align: right; font-variant-numeric: tabular-nums; }
.food__kcal { font-weight: 600; font-size: 13px; }
.food__macros { color: var(--ink-3); font-size: 11px; }
/* The grip a food is dragged by to another place in its meal (OHT-169). touch-action: none makes it
   the one part of a row that drags rather than scrolls, so a phone still scrolls from anywhere else.
   A food alone in its meal keeps the grip's room, not the grip. */
.food__grip {
  appearance: none; cursor: grab; font: inherit; font-size: 18px; line-height: 1;
  width: 24px; height: 40px; flex: none; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-3);
  touch-action: none;
}
.food__grip:hover, .food__grip:focus-visible { color: var(--accent-ink); }
.food__grip:focus-visible { outline-offset: -2px; }  /* inside the row, which clips at its edge */
.food__grip:disabled { visibility: hidden; }
/* The food being dragged lifts off the page, and the others step aside for it. */
.food__meal.is-sorting { user-select: none; -webkit-user-select: none; }
.food__meal.is-sorting .food__entry { transition: transform .15s ease; }
.food__meal.is-sorting .food__entry.is-dragging {
  position: relative; z-index: 2; transition: none; cursor: grabbing;
  background: var(--panel); border-radius: 10px; box-shadow: 0 6px 18px rgb(0 0 0 / 18%);
}
.food__addto { justify-self: start; margin-top: 2px; }
/* The way into the breakdown popup, under the day it divides (OHT-140). */
.food__breakdown { justify-self: start; margin-top: 4px; }
/* Adding to a meal and saving it to add again (OHT-61, item 3), side by side under it. */
.food__mealactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.food__mealactions .food__addto { margin-top: 0; }
.food__saveform { display: grid; gap: 8px; margin-top: 2px; }
/* A recipe's delete, beside it in Recipes (OHT-292). Quiet until pointed at, like the log's own
   remove control, and the confirm is the real guard. */
.food__saveddel {
  appearance: none; cursor: pointer; font: inherit; font-size: 16px; line-height: 1;
  width: 28px; height: 28px; flex: none;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ink-3);
}
.food__saveddel:hover { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }


.food__form { display: grid; gap: 10px; padding-top: 16px; }
.food__formhead { display: flex; align-items: center; gap: 10px; }
.food__mealpick {
  font: inherit; font-size: 13px; padding: 6px 10px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
}
.food__qtyrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* A counted food's serve is one, and holds (OHT-166). */
.food__qtyrow input[readonly] { background: var(--panel-2); border-color: transparent; }

/* Adding food is a sheet now (OHT-134). It was padded to sit at the foot of the log. */
#food-add-body .food__form { padding-top: 8px; }
.food__status { margin: 0; font-size: 13px; color: var(--accent-ink); }

/* The add sheet's lists (OHT-292): All, My Foods, Meals and Recipes, under the Food box while it is
   empty. A row is thumb-sized: its name opens How much you had, and the + beside it adds at once.
   Two classes to the ribbon's rules: .segmented's own come later in this file. */
.segmented.segmented--four { grid-template-columns: repeat(4, 1fr); }
.segmented.food__ribbon span { padding: 9px 2px; font-size: 12.5px; }
.food__tabs { display: grid; gap: 8px; }
/* While they show, the label form under them steps aside - its Add beside a tick list's would be two
   Adds - and typing a name brings it back. */
#food-tabs:not([hidden]) ~ * { display: none !important; }
.food__tablist {
  display: grid; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
.food__listnone { padding: 12px; }
.food__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
  border-top: 1px solid var(--line);
}
.food__row:first-child,
.food__letter + .food__row { border-top: 0; }
.food__rowmain {
  display: grid; gap: 2px; min-width: 0; min-height: 48px; padding: 9px 12px; text-align: left;
  font: inherit; color: var(--ink); background: none; border: 0; cursor: pointer;
}
.food__rowmain:hover,
.food__rowmain:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.food__rowname { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.food__rowmeta { font-size: 12px; color: var(--ink-2); }
.food__rowitems {
  font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.food__row.is-added .food__rowmeta { color: var(--accent-ink); font-weight: 600; }
.food__row.is-refused .food__rowmeta { color: var(--warn-ink); }
.food__plus {
  appearance: none; display: grid; place-items: center; width: 40px; height: 40px; margin-right: 8px;
  font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--accent-ink); background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 45%, var(--line)); border-radius: 50%;
}
.food__plus:disabled { opacity: .5; cursor: default; }
.food__letter {
  margin: 0; padding: 5px 12px; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  color: var(--ink-3); background: var(--panel); border-top: 1px solid var(--line);
}
.food__letter:first-child { border-top: 0; }
.food__ticks { display: grid; gap: 8px; padding: 10px 12px 12px; }
.food__tickhead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.food__tickname { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.food__tick {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  min-height: 44px; border-top: 1px solid var(--line); cursor: pointer;
}
.food__tick input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.food__ticksum { margin: 0; font-size: 13px; font-weight: 600; }

/* Foods logged before, offered as the name is typed. Rows are thumb-sized, not cursor-sized:
   this gets used standing in a kitchen with one hand. */
.food__suggest {
  display: grid; margin-top: -4px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
.food__suggestion {
  display: grid; gap: 2px; min-height: 44px; padding: 9px 12px; text-align: left;
  font: inherit; color: var(--ink); background: none; cursor: pointer;
  border: 0; border-top: 1px solid var(--line);
}
.food__suggestion:first-child { border-top: 0; }
.food__suggestion:hover,
.food__suggestion:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none;
}
.food__suggestname { font-size: 14px; font-weight: 600; }
.food__suggestmeta { font-size: 12px; color: var(--ink-2); }

/* "Log ... as an estimate", last in the list: something to do, not a food to pick (OHT-214). */
.food__suggestion--estimate .food__suggestname { color: var(--accent-ink); }
/* What the list knows about a food (OHT-208), beside its name: a green circle with a tick once an
   admin has checked it, a barcode in a green frame once it has a code. They follow the name's last
   word; on a logged row, whose name is cut to one line, they sit beside it and are never cut. */
.food__marks { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; vertical-align: middle; }
.food__entry .food__nameline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.food__entry .food__nameline > :first-child { min-width: 0; }
.food__entry .food__marks { flex: none; margin-left: 0; }
.food__mark { display: block; line-height: 0; color: var(--check); }
.food__mark--checked svg { display: block; width: 16px; height: 16px; }
.food__marktick {
  fill: none; stroke: var(--panel); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.food__mark--barcode {
  padding: 1.5px 3px; border: 1.5px solid var(--check); border-radius: 4px; color: var(--ink);
}
.food__mark--barcode .food__bcglyph { width: 14px; height: 10px; }

/* Energy in kcal or kJ, a pair (OHT-171); the three macros under it. */
.food__energyrow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.food__macrorow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.food__formnote { color: var(--ink-3); font-size: 11px; margin-top: -4px; }

/* Adding from the shared food list (OHT-150). A food picked from it shows its label rather than
   asking for it - the label is fixed - and "how much" is the one box left. */
.food__picked {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
.food__pickedname { font-size: 15px; font-weight: 600; }
.food__pickedmeta { font-size: 12px; color: var(--ink-2); }
.food__label { margin: 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.food__labelhead {
  margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2);
}
.food__amount { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.food__amountunit { min-width: 2ch; padding-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.food__makes {
  margin: -4px 0 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.food__makes:empty { display: none; }

/* Scan a barcode (OHT-134): the button at the start of the Food row, or of a picked food
   (2026-09-28), and the panel it opens above the form. The button stands as tall as the box. */
.food__namerow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: end; }
.food__namerow .food__scanbtn { min-height: 44px; }
.food__scan { display: grid; gap: 8px; min-width: 0; }
.food__scanvideo {
  width: 100%; max-height: 40vh; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 10px; background: #000;
}
.food__scanstatus { margin: 0; font-size: 13px; color: var(--ink-2); }
.food__scanstatus:empty { display: none; }
.food__scantyped { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.food__scancancel { justify-self: start; }
/* A code that has been read (OHT-149): a tick, the bars themselves and the number under them,
   all small enough to sit inside the form rather than announce itself. */
.food__barcode {
  margin: 0; font-size: 13px; color: var(--accent-ink);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.food__bctick { color: var(--muscle-ink); font-size: 15px; font-weight: 700; line-height: 1; }
.food__bcdrawn { display: grid; justify-items: center; gap: 1px; }
/* preserveAspectRatio is none on the element, so the modules stretch to exactly this box. */
.food__bcbars { display: block; width: 88px; height: 22px; color: var(--ink); }
.food__bcnum {
  font-size: 10px; letter-spacing: 0.06em; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.food__bcnote { flex: 1 1 140px; min-width: 0; }
/* The Scan control is the symbol itself now, so it is sized as an icon, not as a label. */
.food__scanbtn--icon { padding: 8px 12px; line-height: 0; }
.food__bcglyph { display: block; width: 26px; height: 16px; }
.field--tight { gap: 3px; }

/* The Plans sheet (OHT-66). A price list that says what it pays for: each plan a block with its
   price on the right, and the costs as a definition list, because each one is a name and a line. */
.plans__beta {
  margin: 0; padding: 10px 12px; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--accent-ink); color: var(--ink);
}
.plans__lede { margin: 0; color: var(--ink-2); line-height: 1.5; }
.plans__plan { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.plans__head {
  margin: 0; display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 4px 12px; font-size: 15px;
}
.plans__price { font-weight: 500; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.plans__list { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.plans__coach summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; padding: 2px 0; }
.plans__coach[open] summary { margin-bottom: 12px; }
.plans__money { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.plans__heading { margin: 0; font-size: 15px; }
.plans__costs { margin: 0; display: grid; gap: 4px; }
.plans__costs dt { font-weight: 600; color: var(--ink); font-size: 13px; margin-top: 6px; }
.plans__costs dd { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }

/* What PRO would be, folded under the Pro plan. A plain read: just a list that says the shape. */
.pro__list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 14px; }
.pro__item { display: grid; gap: 3px; padding-left: 12px; border-left: 2px solid var(--line); }
.pro__name { font-weight: 600; color: var(--ink); }
.pro__what { color: var(--ink-2); font-size: 13px; line-height: 1.45; }

.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 20px 18px 32px;
  color: var(--ink-3);
  font-size: 12px;
}
.loading { padding: 60px 0; text-align: center; color: var(--ink-2); }

/* ---------------------------------------------------------------- layout */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  padding: var(--gap);
  max-width: 1240px;
  margin: 0 auto;
  /* Two panels sharing a row match heights, so a pair never reads as one box being
     cut short. The panel is a flex column, so its content still sits at the top and
     only the trailing space grows. */
  align-items: stretch;
}

/* Two columns from tablet up. A large panel takes the whole row; two small panels share one,
   and a small panel left on its own is given span-2 by the layout code. */
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-1 { grid-column: span 1; }
  .span-2 { grid-column: span 2; }
}

@media (min-width: 1100px) {
  :root { --gap: 16px; }
}

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel__title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.panel__note { font-size: 11px; color: var(--ink-3); }
/* A panel stretched to match its neighbour grows at the bottom, so its call to action has to
   be pinned there. Without this the taller panel's button floats mid-box and the pair no
   longer lines up - which is the same complaint the equal heights were meant to fix. */
.panel > .btn:last-child { margin-top: auto; }

.hero { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hero__value { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.hero__unit { font-size: 15px; color: var(--ink-2); font-weight: 600; }
/* Eaten / target (OHT-270) in a panel as narrow as half of 720 px (OHT-269): the number smaller as
   the panel narrows, so it keeps to one line, and the phase chip under it at the right when the two
   do not fit side by side. 12cqi holds a five-figure kJ day at 360 px wide. */
.panel__head--fit { flex-wrap: wrap; container-type: inline-size; }
.panel__head--fit .hero__value { font-size: min(40px, 12cqi); }
.panel__head--fit > .chip { margin-left: auto; }
.hero__delta { font-size: 13px; font-weight: 600; margin-left: auto; }
.up { color: var(--fat-ink); }
.down { color: var(--muscle-ink); }
.flat { color: var(--ink-3); }

/* key/value rows */
.rows { display: grid; gap: 9px; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.row__key { color: var(--ink-2); }
.row__val { font-variant-numeric: tabular-nums; font-weight: 600; }
.row__val small { font-weight: 500; color: var(--ink-3); font-size: 11px; margin-left: 4px; }


.legend { display: grid; gap: 8px; }
.legend__item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend__name { color: var(--ink-2); }
.legend__val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend__pct { color: var(--ink-3); font-size: 11px; min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* progress */
.progress { display: grid; gap: 7px; }
.progress__track { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.progress__fill { height: 100%; background: var(--accent); border-radius: 999px; }
.progress__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }

/* week pips */
.weeks { display: flex; gap: 5px; flex-wrap: wrap; }
.week {
  flex: 1 1 22px;
  min-width: 22px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 0;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--ink-3);
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.week--done { color: var(--ink-2); }
.week--now { background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); color: var(--ink); border-color: var(--accent-ink); }
.week--deload { background: color-mix(in srgb, var(--fat) 18%, var(--panel-2)); color: var(--fat-ink); }

/* session list */
.session { display: grid; gap: 8px; }
.slot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 10px;
  border: 1px solid transparent;
}
/* A dashboard row is the way to its exercise on the workout log (OHT-279), so it is a button - in the
   row's own look, not a button's. */
button.slot { appearance: none; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.slot:hover { border-color: var(--line); }
button.slot:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.slot__order {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  font-variant-numeric: tabular-nums; min-width: 18px;
}
.slot__body { min-width: 0; }
.slot__muscle { font-weight: 600; font-size: 14px; }
.slot__sets { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Met, in the same green the gym screen uses, so the two screens agree at a glance. */
.slot__sets.is-done { color: var(--muscle-ink); }
/* Same three states as the gym screen, and the same blue for the same reason: a skipped row
   is short on purpose. Named on both selectors so it beats green whichever order they end up
   in - a row can be fully logged and then skipped, and the skip is the later fact. */
.slot__sets.is-skipped,
.slot__sets.is-done.is-skipped { color: var(--accent-ink); }
.slot__sets small { font-weight: 500; color: var(--ink-3); font-size: 11px; margin-left: 3px; }

.empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--ink-3);
  background: var(--panel-2);
  border-radius: 10px;
  font-size: 14px;
}
.empty strong { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }

/* volume table */
.vol { display: grid; gap: 7px; }
/* Three columns, and a fourth ONLY when the chevrons are there to fill it - BASIC does not
   draw them, and a track reserved for a cell that is never rendered leaves every row ending
   68px short of the panel edge. The width lives with the thing that needs it. */
.vol__row { display: grid; grid-template-columns: minmax(84px, 148px) 1fr 26px; align-items: center; gap: 9px; font-size: 13px; }
.vol--focus .vol__row { grid-template-columns: minmax(84px, 148px) 1fr 26px 68px; }

/* Focus stepper: two hit targets stacked into one row's height. Small on purpose - the
   chevrons are what you read, these are just how you move them. Used in the planner. */
.focus { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; }
.focus__btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink-2); border-radius: 4px; cursor: pointer;
  font-size: 7px; line-height: 1; padding: 0; height: 13px; width: 20px;
  display: flex; align-items: center; justify-content: center;
}
.focus__btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.focus__btn:disabled { opacity: .3; cursor: not-allowed; }

/* The cap, as focus. Unlit rungs stay visible so the headroom is legible. */
.chev { display: inline-flex; align-items: baseline; gap: 2px; min-width: 68px; justify-content: flex-end; }
.chev__m { font-style: normal; font-size: 17px; font-weight: 700; line-height: 1; color: var(--line); }
.chev__m.is-on { color: var(--accent-ink); }
.chev__m--star { font-size: 12px; margin-left: 3px; }


/* On a phone the bar has nowhere to go - it collapsed to about 20px, which reads as nothing.
   Drop it and give the width to the name and the chevrons. */
@media (max-width: 560px) {
  .vol__row { grid-template-columns: 1fr 26px; }
  .vol--focus .vol__row { grid-template-columns: 1fr 26px 68px; }
  .vol__track { display: none; }
}
.vol__name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vol__track { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.vol__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.vol__num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.vol__num small { color: var(--ink-3); font-weight: 500; }

/* chart */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__axis { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.chart__line { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__avg { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart__area { fill: color-mix(in srgb, var(--accent-ink) 14%, transparent); }
.chart__dot { fill: var(--accent-ink); }

/* Body composition over time (OHT-190): muscle and fat, each line, its dots and its own scale in
   its colour, and the switch between % and kilos or pounds above. The box holds the height while
   the chart is measured and drawn into it. */
.bodychart { display: grid; gap: 6px; }
.bodychart__unit { justify-self: end; width: 96px; }
.bodychart__unit span { padding: 5px 6px; font-size: 12px; }
.bodychart__plot { height: 200px; min-width: 0; }
.bodychart__plot .chart { height: 200px; }
.trendchart__plot .chart { height: 240px; }
.chart__line--muscle { stroke: var(--muscle); }
.chart__line--fat { stroke: var(--fat); }
.chart__dot--muscle, .chart__axis--muscle { fill: var(--muscle); }
.chart__dot--fat, .chart__axis--fat { fill: var(--fat); }
.bodychart__none { margin: 0; font-size: 13px; color: var(--ink-3); }

/* The range above each weigh-in chart (OHT-194): 1W | 1M | 1Y | All, beside % | kg on Body
   composition. Both small, like the % | kg one was meant to be - .segmented span comes later in
   this file and, at the same weight, beat .bodychart__unit span, so these carry one class more. */
.chart__switches { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.segmented.chartrange { grid-template-columns: repeat(4, 1fr); width: 168px; }
/* Daily | Weekly beside it (OHT-198). */
.segmented.chartevery { width: 124px; }
.chart__switches .segmented span { padding: 5px 6px; font-size: 12px; }
.chart__none {
  margin: 0; min-height: 120px; height: 100%; display: grid; place-items: center;
  font-size: 13px; color: var(--ink-3); text-align: center;
}

/* The readout (OHT-196): a line up through the weigh-in picked, its points ringed, and a label
   beside the line. The label is the page's, not the drawing's, so it reads the same size however
   far the chart is scaled; it takes no pointer, so the chart under it keeps the mouse. */
.chart__hold { position: relative; }
.chart__hold .chart { -webkit-tap-highlight-color: transparent; }
@media (hover: hover) and (pointer: fine) { .chart__hold .chart { cursor: crosshair; } }
.chart__guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart__ring { fill: none; stroke: var(--accent-ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart__ring--muscle { stroke: var(--muscle); }
.chart__ring--fat { stroke: var(--fat); }
.chart__tip {
  position: absolute; top: 6px; z-index: 2; pointer-events: none;
  display: grid; gap: 2px; padding: 6px 9px; white-space: nowrap;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18); font-size: 12px;
}
.chart__tipdate { color: var(--ink-3); font-size: 11px; }
.chart__tipline { display: flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart__tipkey { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chart__tipkey--muscle { background: var(--muscle); }
.chart__tipkey--fat { background: var(--fat); }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --------------------------------------------------------- the goal date */
/*
   Three strips of chips instead of a native date input: the date is on the page rather than
   behind a calendar you have to open, and it reads the same on every phone. Each strip scrolls
   on its own and snaps, so a flick lands on chips rather than between them.
*/
/*
   Six chips at a time, centred (OHT-122). Six rather than as many as fit, so the three strips
   are the same width as each other and the block reads as one control instead of three ragged
   ones. The width is computed from the chip rather than typed, so changing the chip changes the
   strip with it.
*/
.datechips {
  display: grid; gap: 12px; text-align: center;
  --chip-w: 54px;                /* holds JAN and 2026 at this font size */
  --chip-gap: 6px;
  --chips-shown: 6;
}

.datechips__read {
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.datechips__part { display: grid; gap: 6px; justify-items: center; }

/* Grid items keep min-width: auto, so the widest thing in them that cannot shrink sizes the track.
   At 390px that was the date strips - six chips, 354px, where the card leaves 324 - and it pushed
   the whole goal page 16px past the edge of the phone: a page that scrolls sideways, on the screen
   the tutorial now opens for every new person (OHT-132). Zero at each grid level lets the strips
   narrow to the card and scroll inside it, which is what they were built to do. */
#goal-body > *, .datechips > *, .datechips__part > * { min-width: 0; }

/* The strip and its two arrows, as one centred unit. */
.datechips__slider { display: flex; align-items: center; gap: 6px; max-width: 100%; }

.datechips__row {
  display: flex; gap: var(--chip-gap);
  /* Mandatory, not proximity: six is an even number, so anything that parks the strip off the
     chip grid shows half a chip at each edge. Mandatory lands it on a chip every time. */
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  /* Vertical only. Horizontal padding is four pixels the grid arithmetic would have to carry,
     and it is what made the arrows drift a chip out of line over several presses. */
  padding: 2px 0;
  scrollbar-width: none;
  width: calc(var(--chips-shown) * var(--chip-w)
              + (var(--chips-shown) - 1) * var(--chip-gap));
  max-width: 100%;
}

/* Snap is suspended for the length of a gesture - see the comment in goal.js. */
.datechips__row.is-sliding { scroll-snap-type: none; }
.datechips__row::-webkit-scrollbar { display: none; }

.datechips__chip {
  /* start, not center: centring one chip in a six-wide strip halves the two at the edges. */
  scroll-snap-align: start;
  flex: none;
  width: var(--chip-w);
  min-width: var(--chip-w);
  padding-inline: 0;             /* the width is the target now, not the padding */
  font-variant-numeric: tabular-nums;
}

/*
   The arrows exist because a mouse cannot flick. Hidden by default and shown only where there
   is a real pointer: a finger already moves the strip, and on a phone these would cost the
   width of a chip at each end.
*/
.datechips__nav { display: none; }

@media (hover: hover) and (pointer: fine) {
  /* A mouse can drag the strip like a finger, so say so. */
  .datechips__row { cursor: grab; }
  .datechips__row:active { cursor: grabbing; }

  .datechips__nav {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none; width: 28px; height: 28px; padding: 0;
    font-size: 18px; line-height: 1; cursor: pointer;
    color: var(--ink-2); background: var(--panel-2);
    border: 1px solid var(--line); border-radius: 999px;
  }
  .datechips__nav:hover {
    color: var(--accent-ink);
    border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line));
  }
}

/* --------------------------------------------------- dashboard layout edit */

.grid.is-editing .panel { border-style: dashed; }

.lay-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 0;
  padding: 9px var(--pad);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.lay-name { font-size: 12px; font-weight: 600; }
/* The width read-out is also the control that changes it. */
.lay-size {
  margin-left: 8px; font: inherit; font-weight: 600; font-size: 10px;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
  cursor: pointer; padding: 3px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.lay-size.is-wide {
  color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line));
}
.lay-size:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* Shown / Hidden, the same shape as the width toggle beside it: the read-out IS the control. */
.lay-show {
  margin-left: 6px; font: inherit; font-weight: 600; font-size: 10px;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
  cursor: pointer; padding: 3px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.lay-show.is-off {
  color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
}
.lay-show:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* A panel that will not be on the dashboard once you leave this mode (OHT-126).
   Greyish with a grey dotted border, which is what was asked for and is also the right
   signal: dotted reads as provisional, and it cannot be confused with the solid border
   every real panel has. Only ever visible in the layout editor - outside it the panel is
   not rendered at all, so there is nothing here to fight with. */
/* `.grid.is-editing .panel` already dashes EVERY panel while the editor is open, and at a
   higher specificity than a bare .panel.is-hidden - so this has to say where it is. Dotted
   against everything else's dashed, in the grey the dimming below uses. */
.grid.is-editing .panel.is-hidden {
  border-style: dotted;
  border-color: var(--ink-3);
  background: var(--panel-2);
}
/* The bar stays legible, because it holds the way back. Everything below it dims. */
.panel.is-hidden > :not(.lay-bar) { opacity: .42; filter: grayscale(1); }
.panel.is-hidden .lay-name { color: var(--ink-3); }

.lay-controls { display: flex; gap: 4px; }
.lay-btn {
  width: 30px; height: 30px; line-height: 1;
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--panel); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 7px;
}
.lay-btn:hover:not(:disabled) { border-color: var(--accent-ink); color: var(--accent-ink); }
.lay-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ------------------------------------------------------------- regions */

.region-icon { display: block; flex: none; }

.region-badge { display: inline-flex; align-items: center; gap: 5px; }
.region-badge__label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
}

/* A coloured edge on the leading side of a card or row. */
.region-edge { position: relative; }
.region-edge::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 3px 0 0 3px;
  background: var(--region, var(--region-other));
}

.region--chest { --region: var(--region-chest); }
.region--back { --region: var(--region-back); }
.region--arms { --region: var(--region-arms); }
.region--legs { --region: var(--region-legs); }
.region--shoulders { --region: var(--region-shoulders); }
.region--core { --region: var(--region-core); }
.region--other { --region: var(--region-other); }

/* A small colour key, so the palette is learnable rather than guessed at. */
.region-key { display: flex; flex-wrap: wrap; gap: 7px 14px; padding: 2px 0; }
.region-key .region-badge__label { color: var(--ink-2); }

/* Every place a glyph sits beside a label. */
.entry__title,
.slot__muscle,
.vol__name,
.sore-sig__name,
.sore-row__name { display: flex; align-items: center; gap: 7px; min-width: 0; }

.vol__name, .sore-sig__name { overflow: hidden; }
.vol__name > :last-child,
.sore-sig__name > :nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The card edge sits inside the padding, so pull the content clear of it. */
.entry.region-edge { padding-left: calc(var(--pad) + 6px); }
.slot.region-edge { padding-left: 18px; }

/* --------------------------------------------------------- training log
   Used standing in a gym, one-handed. Big targets, no hover-only affordances. */

.sess { max-width: 760px; margin: 0 auto; padding: var(--gap); display: grid; gap: var(--gap); }

/* The header, the day's totals and the rest timer, frozen as one block - pinned from the first
   pixel of scroll (the themes' since OHT-218, every look's since OHT-223). Sticky alone leaves it
   in flow until it reaches the top, riding up the page's gap first; so its box starts at the top
   of the page and its padding gives the gap back, and what it holds sits where it always did and
   never moves. The tint and the blur moved up here off .sess__head: the GAPS between the three
   panels belong to this box now, and a transparent gap would let a card scroll through the
   middle of it. The internal gap is tighter than the page gap on purpose - every pixel in here
   is a pixel of exercise you cannot see.

   Under it, a 3px strip of the page (OHT-220): a card in the place the next exercise glides to
   has the card above it ending at the box's edge - a trimmed one a pixel past it, and a phone's
   sub-pixel steps move both by up to half a pixel more - and a line of it showed there. Solid,
   where the box is not: the page's own colour, so at rest it is the gap it lies over. */
.sess__top {
  position: sticky; top: 0; z-index: 5;
  display: grid; gap: 8px;
  margin-top: calc(-1 * var(--gap)); padding-top: var(--gap);
  padding-bottom: 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 3px 0 var(--bg);
}

/* The place on the log the next exercise glides to when one is finished (OHT-220): where the first
   one sits when the page opens, just under the box - session.js measures it into --sess-snap
   whenever the box changes height, and glides the next one still to do into it. The only move the
   log makes on its own (OHT-234): a swipe stays where it is let go. Only while the log is open -
   the page's scroller is the dashboard's too. */
html:has(#session-view:not([hidden])) { scroll-padding-top: var(--sess-snap, 0px); }

.sess__head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  padding-top: max(12px, env(safe-area-inset-top));
}
.sess__title { display: grid; gap: 2px; min-width: 0; }
.sess__date { font-weight: 700; font-size: 15px; }
.sess__meta { font-size: 12px; color: var(--ink-3); }
/* + add exercise, opposite ← Dashboard (OHT-252), the auto margin taking what room the header has. A
   phone's has none: the title gives way, wrapping its second line - a .btn never wraps, so never shrinks. */
.sess__add { margin-left: auto; }
.sess__part { white-space: nowrap; }   /* so the squeezed line wraps at a dot */

.sess__progress {
  display: grid; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px var(--pad);
}
.sess__stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.sess__stats strong { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 15px; }

.sess__body { display: grid; gap: var(--gap); }

.sess__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0 max(24px, env(safe-area-inset-bottom));
}

.sess.saving { opacity: .6; pointer-events: none; }

.entry {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad);
  display: grid; gap: 12px;
}
/* Not being done, by decision. Built exactly like the finished card below - thick on three
   sides, nothing on the left, because that edge already carries the muscle colour - but in
   the accent instead of green. The count inside it has been blue for skipped all along; this
   makes the edge say the same thing, so the card reads at arm's length instead of only once
   you look at the numbers. Still muted, because it is settled without being an achievement. */
.entry--skipped {
  border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line));
  border-width: 3px 3px 3px 0;
  background: color-mix(in srgb, var(--panel) 85%, var(--bg));
}
.entry--skipped .entry__muscle { color: var(--ink-3); }

/* Finished. Thick on three sides and nothing on the left: that edge already carries the
   muscle colour, and a done-border painted over it would put two different facts in the
   same place. */
.entry--done {
  border-color: color-mix(in srgb, var(--muscle) 45%, var(--line));
  border-width: 3px 3px 3px 0;
}

.entry__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.entry__muscle { font-weight: 700; font-size: 16px; }
.entry__slot { font-size: 11px; color: var(--ink-3); margin-left: 8px; }
/* The count is the card's state at a glance, and there are three of them:

     grey     nothing has happened here yet
     green    finished
     BLUE     skipped - decided against, not forgotten

   Blue rather than amber, which is what this was. Amber is the colour of something needing
   attention, and a skipped exercise needs none: a short count is normally the app telling you
   the day is unfinished, and this is you telling the app it is finished anyway. Blue is the
   accent every deliberate choice on this screen already uses. It wins over green even on a
   card whose sets were all logged before it was skipped - afterwards, "I decided against
   this" is the fact that matters. Colour is never alone: a skipped card is also dashed and a
   finished one has a thick border, so none of this depends on seeing hue. */
.entry__count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.entry__count.is-done { color: var(--muscle-ink); }
.entry--skipped .entry__count,
.entry--skipped .entry__count.is-done { color: var(--accent-ink); }
.entry__count small { font-weight: 500; font-size: 11px; color: var(--ink-3); margin-left: 4px; }

.ex-select {
  font: inherit; font-size: 14px; width: 100%;
  padding: 11px 12px; min-height: 44px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px;
}
.ex-select:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
/* A choice is a button that opens its list in the app's own popup - the workout log's since
   OHT-235, every other since OHT-250 (ui.js pickField) - and it looks like the button it is: a
   ghost button, as ← Dashboard and + add exercise are, outlined where a box you type in is filled,
   its value in the middle. No chevron: a chevron says dropdown (2026-10-21). An iPhone zooms the
   page in to a field under 16px as it is tapped; a button is not a field. */
button.ex-select, button.pick {
  background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer;
}

.entry__last {
  font-size: 12px; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  padding: 9px 11px; background: var(--panel-2); border-radius: 8px;
}
.entry__last-label { color: var(--ink-3); }
.entry__last--none { color: var(--ink-3); font-style: italic; }

.set-list { display: grid; gap: 6px; }
.set-row {
  display: grid; grid-template-columns: 22px 1fr auto 34px;
  align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 8px;
  background: var(--panel-2); font-size: 14px;
}
.set-row--warmup { opacity: .6; }
.set-row__n { font-size: 11px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.set-row__load { font-weight: 600; font-variant-numeric: tabular-nums; }
.set-row__x { color: var(--ink-3); margin: 0 6px; }
.set-row__rir { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.icon-btn {
  width: 30px; height: 30px; line-height: 1;
  font-size: 17px; font-family: inherit;
  border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-3); cursor: pointer;
}
.icon-btn:hover { color: var(--warn-ink); border-color: var(--warn); }

/* what to load next */
.next {
  display: grid; gap: 9px;
  padding: 11px 12px; border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid transparent;
}
.next--caution { border-color: color-mix(in srgb, var(--fat) 40%, var(--line)); }

.next__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.next__from { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.next__reason { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
/* The picker on a lift that carries you is in BELT kilos while everything behind it is
   totals. This line carries that change of units, so it has to read as a statement of fact
   rather than as another suggestion - quieter than the reason above it, and never a chip. */
.next__unit {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
}
.next__unit strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.next__ladder { display: flex; gap: 6px; flex-wrap: wrap; }
.rung {
  display: grid; gap: 1px; justify-items: center;
  min-width: 52px; padding: 7px 8px;
  font: inherit; cursor: pointer;
  background: var(--panel); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 9px;
}
.rung__kg { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rung__sub { font-size: 9px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rung.is-current { border-color: var(--ink-3); color: var(--ink); }
.rung.is-picked { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rung.is-picked .rung__sub { color: color-mix(in srgb, var(--on-accent) 75%, transparent); }
.rung.is-out {
  opacity: .4; cursor: not-allowed; text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.rung:not(:disabled):hover { border-color: var(--accent-ink); }
/* The recommended weight, while it is not the one you are on - today's last set, or the same set last
   time (OHT-290): its border flashes until you tap it, "so its easier to see which I should choose".
   Movement off, it holds the accent border. */
@keyframes rung-flash {
  50% {
    border-color: var(--accent-ink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink) 35%, transparent);
  }
}
.rung.is-change { animation: rung-flash 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .rung.is-change {
    animation: none; border-color: var(--accent-ink);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-ink) 35%, transparent);
  }
}

/* The one number you can act on now. Bigger than the reason under it, because the panel is
   read at a glance between sets and the glance has to land on the right line. */
.next__target {
  font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.next__target strong { font-size: 15px; color: var(--accent-ink); font-weight: 700; }
.next__target small { font-size: 11px; color: var(--ink-3); }
/* Deliberately quiet, and deliberately not the accent: there is no number here to look at. */
.next__none { font-size: 13px; color: var(--ink-3); font-style: italic; }

/* Estimated past the range a rep-max formula holds over, so it came off the endurance curve
   instead. The tilde in the text is what actually says so - this only leans it, for readers
   who take the shape of a number in before they read it. Never colour alone. */
.next__from.is-rough, .rung__sub.is-rough { font-style: italic; }
.next__from.is-rough { cursor: help; }

.next__goal {
  font-size: 12px; font-weight: 600; color: var(--fat-ink);
  font-variant-numeric: tabular-nums;
}
.next__goal small { font-weight: 500; color: var(--ink-3); }

.add-set { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
/* A bodyweight lift needs one more box: your weight, then what you added to it. */
.add-set--bw { grid-template-columns: 1fr 1fr 1fr 1fr auto; }
@media (max-width: 560px) {
  .add-set--bw { grid-template-columns: 1fr 1fr; }
  .add-set--bw button { grid-column: 1 / -1; padding: 12px; }
}

/* The pair that belongs together, marked so the wrong one does not get filled in: bodyweight
   accented as the day's figure, added kg dashed as the optional half. Colour alone would not
   do it - the border style survives a glance and a colourblind eye. */
.mini-field--bw .mini-field__label { color: var(--accent-ink); }
.mini-field--bw input {
  border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-2));
}
.add-set--bw input.is-added { border-style: dashed; }
@media (max-width: 420px) {
  .add-set { grid-template-columns: 1fr 1fr 1fr; }
  .add-set button { grid-column: 1 / -1; padding: 12px; }
}
/* Done for reps alone (OHT-278): reps and RIR left, and the button. */
.add-set--reps { grid-template-columns: 1fr 1fr auto; }
@media (max-width: 420px) { .add-set--reps { grid-template-columns: 1fr 1fr; } }
/* Warm-up sets before a muscle's first exercise (OHT-272): tapped off as they are done, never saved. */
.warmup { margin-top: 10px; }
.warmup__head {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2);
}
.warmup__head small { font-weight: 400; letter-spacing: 0; text-transform: none; }
.warmup__sets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.warmup__set {
  appearance: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
  padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.warmup__set[aria-pressed="true"] { border-color: var(--accent-ink); color: var(--accent-ink); }
.warmup__set[aria-pressed="true"]::before { content: '✓ '; }
.warmup__set:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }

.mini-field { display: grid; gap: 4px; min-width: 0; }
.mini-field__label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
}
.mini-field input {
  padding: 10px; min-height: 44px; font-size: 16px; font-weight: 600;
  text-align: center; font-variant-numeric: tabular-nums;
}
/* Reps OR RIR left (OHT-273): a pill on the gap before the box, level with the middle of the boxes.
   Reps sits just left of RIR left in every layout above, so the gap is always the one between them. */
.mini-field--or { position: relative; }
.mini-field__or {
  position: absolute; left: -4px; bottom: 22px; z-index: 1; transform: translate(-50%, 50%);
  padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2);
  font-size: 11px; font-weight: 600; line-height: 1.4;
}

/* ------------------------------------------------------------- planner */

.plan-form, .plan-summary, .plan-block, .plan-list {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad);
}
.plan-preview { display: grid; gap: var(--gap); }
.plan-block { display: grid; gap: 12px; }
.plan-block .panel__title { display: flex; align-items: center; gap: 10px; }

.plan-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px;
}
.plan-stat { display: grid; gap: 2px; }
.plan-stat__k {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
}
.plan-stat__v { font-size: 15px; font-weight: 700; }
.plan-stat__sub { font-size: 11px; color: var(--ink-3); }

.plan-warn {
  margin-top: 14px; padding: 11px 13px; border-radius: 9px; font-size: 13px;
  background: color-mix(in srgb, var(--fat) 14%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--fat) 40%, var(--line));
}
.plan-warn strong { color: var(--fat-ink); }
/* The same box, but for a warning you can act on rather than one you should merely notice. */
.plan-warn--danger {
  margin-top: 14px;
  background: color-mix(in srgb, var(--warn) 14%, var(--panel-2));
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
}
.plan-warn--danger strong { color: var(--warn-ink); }
/* The same warning, sitting directly under the control that resolves it. */
.plan-warn--inline { margin-top: 10px; }

/* the ramp: one bar per week, deload in a different colour */
.ramp { display: flex; align-items: flex-end; gap: 4px; height: 130px; }
.ramp__col {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 4px; height: 100%;
}
.ramp__n { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ramp__bar {
  width: 100%; border-radius: 5px 5px 0 0; background: var(--accent); min-height: 4px;
}
.ramp__bar--deload { background: var(--fat); }
.ramp__w { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.ramp-table { border-collapse: collapse; font-size: 12px; width: 100%; min-width: 460px; }
.ramp-table th, .ramp-table td {
  padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ramp-table thead th { color: var(--ink-3); font-weight: 600; font-size: 11px; }
.ramp-table th[scope=row] { text-align: left; color: var(--ink-2); font-weight: 500; }
.ramp-table .is-deload { background: color-mix(in srgb, var(--fat) 12%, transparent); }
/* The cap column is the editor: chevrons, not a number. Give it room and pin it right. */
.ramp-table .is-cap { color: var(--ink-3); padding-left: 14px; }
/* The stepper column. Roomier than the dashboard's was: this is the screen where the levels
   actually get decided, and the rows are tall enough to afford it. */
.ramp-table td:first-child { padding: 3px 6px 3px 0; width: 30px; }
.ramp-table .focus__btn { height: 15px; width: 26px; font-size: 8px; }
.ramp-table .focus { gap: 3px; }
.ramp-table .is-total td:first-child { border-top: 1px solid var(--line); }
.ramp-table .chev { min-width: 72px; }
/* Week 1 (OHT-200): typed, so a box - small, and quiet until it holds a number. */
.ramp-table td.is-start { padding: 3px 6px; }
.ramp-table .start__box {
  width: 3.2em; height: 26px; padding: 0 4px; border-radius: 6px;
  font-size: 13px; text-align: center; font-variant-numeric: tabular-nums;
}
.ramp-table .start__box::placeholder { color: var(--ink-3); }
.ramp-table .start__box:disabled { opacity: .6; }

.plan-hint { color: var(--ink-3); font-size: 12px; line-height: 1.5; margin: 0; }

/* A muscle the split has no exercises for. Listed, because "not this block" is a decision
   worth seeing, but muted so it never reads as part of the week's work. */
.is-unprogrammed { opacity: .55; }
.is-unprogrammed .vol__num, .ramp-table .is-unprogrammed td { color: var(--ink-3); }
.ramp-table .is-total th, .ramp-table .is-total td {
  font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line);
}

/* which weekdays are training days */
.pattern { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pattern__day {
  display: grid; gap: 3px; justify-items: center;
  padding: 9px 2px; border-radius: 9px; background: var(--panel-2);
  border: 1px solid transparent;
}
.pattern__day.is-train {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-2));
  border-color: color-mix(in srgb, var(--accent-ink) 35%, var(--line));
}
.pattern__wd { font-size: 10px; color: var(--ink-3); }
.pattern__dot { font-size: 13px; color: var(--accent-ink); line-height: 1; }
.pattern__day.is-rest .pattern__dot { color: var(--ink-3); }

/* the list of existing cycles */
.plan-list { display: grid; gap: 10px; }
.plan-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 13px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid transparent;
}
.plan-row.is-active { border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line)); }
.plan-row__main { display: grid; gap: 2px; min-width: 0; }
.plan-row__name { font-weight: 700; font-size: 14px; }
.plan-row__phase {
  font-weight: 500; font-size: 11px; color: var(--ink-3); margin-left: 8px;
  text-transform: uppercase; letter-spacing: .06em;
}
.plan-row__dates { font-size: 12px; color: var(--ink-2); }
.plan-row__cut { color: var(--warn-ink); }
.plan-row__usage { font-size: 11px; color: var(--ink-3); }
.plan-row__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-actions { display: flex; gap: 8px; }

.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------- weigh-in sheet */

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; }

/* ------------------------------------------------------------------ the tutorial (OHT-88)

   One control lit, everything else dimmed and inert. The dimming is the RING's own 9999px
   shadow rather than a scrim with a hole cut in it: the hole is then the control itself, always
   exactly its size, with no second element to keep in step. The scrim below is for the steps
   that point at nothing in particular.

   z-index 80: above the sheets it teaches (50), below the disclaimer (100), which is blocking
   and must never be covered by anything. */
#tutorial { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
#tutorial-scrim { position: fixed; inset: 0; background: color-mix(in srgb, #020617 55%, transparent); }
#tutorial-ring {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px color-mix(in srgb, #020617 55%, transparent);
  outline: 3px solid var(--accent-ink);
  animation: tutorial-pulse 1.7s ease-in-out infinite;
  transition: top .14s ease, left .14s ease, width .14s ease, height .14s ease;
}
@keyframes tutorial-pulse {
  0%, 100% { outline-width: 3px; outline-offset: 0; }
  50%      { outline-width: 6px; outline-offset: 3px; }
}
#tutorial-arrow {
  position: fixed; width: 0; height: 0;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
}
#tutorial-arrow[data-dir="up"] { border-bottom: 10px solid var(--accent-ink); }
#tutorial-arrow[data-dir="down"] { border-top: 10px solid var(--accent-ink); }
#tutorial-card {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; display: grid; gap: 8px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, .45);
  pointer-events: auto;
}
#tutorial-card[data-centred="true"] { top: 50%; transform: translate(-50%, -50%); }
.tutorial__progress { font-size: 11px; font-weight: 600; color: var(--accent-ink); letter-spacing: .04em; }
.tutorial__title { font-size: 15px; }
.tutorial__body { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.tutorial__acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.tutorial__acts .btn--ghost:first-child { margin-right: auto; }

/* Inert is one rule, not a rewrite: none on the app, auto on the one control being taught.
   The sheets are siblings of #app, so they are named too. */
body.tutorial-on #app,
body.tutorial-on .sheet { pointer-events: none; }
body.tutorial-on .tutorial-live { pointer-events: auto; }
/* A picker in the lit control opens its list in the app's own popup (OHT-250), and that popup is
   part of the control being taught: over the tutorial, under the disclaimer (100), and taking taps
   (OHT-269). With the rest of the page inert, only the control being taught can open one. */
body.tutorial-on .choice { z-index: 90; pointer-events: auto; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }

.sheet__panel {
  position: relative;
  margin: auto auto 0;
  width: 100%;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  animation: sheet-in .18s ease-out;
}

@keyframes sheet-in { from { transform: translateY(14px); opacity: .6; } }

@media (min-width: 640px) {
  .sheet__panel {
    margin: auto;
    width: min(560px, calc(100% - 32px));
    border-radius: var(--radius);
    max-height: 88dvh;
  }
}

/* The add-food sheet is a page on a phone (2026-09-28): the whole screen, nothing dimmed behind
   it, and the back arrow top left where every page keeps it. From 640 px it is a popup like the
   rest, with Close. The back gesture closes it either way - popstate shuts an open sheet first. */
@media (min-width: 640px) {
  .sheet__back { display: none; }
}
@media (max-width: 639.98px) {
  #food-add-sheet .sheet__scrim, #food-add-sheet .sheet__close { display: none; }
  #food-add-sheet .sheet__panel {
    margin: 0; height: 100%; max-height: none; border: 0; border-radius: 0;
    animation: page-in .18s ease-out;
  }
  #food-add-sheet .sheet__head { justify-content: flex-start; }
  #food-add-sheet .sheet__title {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}
/* A slide, not a fade: with nothing dimmed behind the page, a fade shows the food log through it. */
@keyframes page-in { from { transform: translateX(24px); } }

.sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px var(--pad); border-bottom: 1px solid var(--line);
}
.sheet__title { margin: 0; font-size: 17px; }

.sheet__body { padding: var(--pad); overflow-y: auto; display: grid; gap: 16px; }

.sheet__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--pad);
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet__hint, .page__hint { font-size: 12px; color: var(--ink-3); }
.sheet__error, .page__error { margin: 0; color: var(--warn-ink); font-size: 13px; }

/* A question with more than two answers (OHT-154): the sheet above, one full-width button per
   answer with a line under each saying what it does. Over the other sheets, because it can be
   asked from inside one. */
.choice { z-index: 60; }
.choice__text { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.choice__options { display: grid; gap: 10px; }
.choice__btn {
  display: grid; gap: 3px; justify-items: start; text-align: left;
  width: 100%; min-height: 52px; white-space: normal;
  background: var(--panel-2); color: var(--ink); border-color: var(--line);
}
.choice__btn.btn--danger { background: var(--warn-fill); color: #fff; border-color: transparent; }
.choice__btn.btn--ghost {
  min-height: 44px; justify-items: center; background: transparent; color: var(--ink-2);
  grid-column: 1 / -1;   /* the whole row, when the answers sit two to one (OHT-235) */
}
.choice__hint { font-size: 12.5px; font-weight: 400; opacity: .85; }

/* Which way today's moves go, under the gym screen's list (OHT-154). */
.sess__scope button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink);
  text-decoration: underline; cursor: pointer;
}

/* --- screens that used to be popups and are now pages ------------------------------------ */
/*
   Goal & targets, Soreness, Exercises and Food are pages, reached the way the planner is, and
   they carry .page__ class names to say so. Meal breakdown went the other way and is a popup
   over the food log again (OHT-140), so it wears .sheet__ names. They spent one release as
   .sheet__ inside a .sess, overridden back out of looking like a dialog; the names are their
   own now, which is why there is no longer an override here to read.

   A page body is a card sitting on the page - the same treatment .sess__progress gets - and a
   page footer ends the page rather than being pinned to the bottom of a floating panel.
*/
.page { display: grid; gap: var(--gap); min-width: 0; }

.page__body {
  padding: var(--pad); display: grid; gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.page__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0 max(24px, env(safe-area-inset-bottom));
}

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field--wide, .field--lead { grid-column: 1 / -1; }

/* OHT-185. Protein on a slider, which replaced OHT-99's two goal chips: tenths of a gram per kilo
   from 0.8 to 3.0, the goals drawn along it as bands, and the box beside the label for an exact
   number. The names, bands and notches are laid over the slider's RUN - its width less one thumb,
   inset half a thumb each side - because that is where the thumb's centre travels, so a value's
   percentage (goal.js along()) lands under the thumb. --thumb is the one number both sides share. */
.protein { --thumb: 22px; display: grid; gap: 4px; }
/* The label, then the box, then kg or lb (OHT-189) - the switch turns the rate per kilo or per pound. */
.protein__head { display: flex; align-items: center; gap: 8px; }
.protein__head .field__label { margin-right: auto; min-width: 0; }
/* The box only - a bare `input` here would catch the switch's hidden radios and push past the screen. */
.protein__head > input { width: 92px; flex: none; text-align: right; }
.protein__head .unit-switch { width: 92px; }
.protein__names, .protein__rail, .protein__under { margin-inline: calc(var(--thumb) / 2); }
.protein__names { position: relative; height: 15px; margin-top: 8px; }
.protein__track { position: relative; height: 30px; }
.protein__rail {
  position: absolute; left: 0; right: 0; top: 12px; height: 6px;
  border-radius: 3px; background: var(--line);
}
.protein__band, .protein__name { --band: var(--accent); --band-ink: var(--accent-ink); }
.protein__band--muscle, .protein__name--muscle { --band: var(--muscle); --band-ink: var(--muscle-ink); }
.protein__band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--band) 35%, var(--line)); }
.protein__band.is-on { background: var(--band); }
.protein__name {
  position: absolute; bottom: 0; font-size: 11px; line-height: 1; white-space: nowrap;
  color: var(--ink-3);
}
.protein__name--fitness { padding-right: 5px; }
.protein__name--muscle { padding-left: 5px; }
.protein__name.is-on { color: var(--band-ink); font-weight: 600; }
.protein__under { position: relative; height: 24px; }
.protein__tick {
  position: absolute; top: 0; width: 1px; height: 5px; transform: translateX(-50%);
  background: color-mix(in srgb, var(--ink-3) 60%, transparent);
}
.protein__tick.is-major { height: 9px; background: var(--ink-3); }
.protein__num {
  position: absolute; top: 12px; transform: translateX(-50%); font-size: 11px; line-height: 1;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
/* The slider's own track is see-through and the full height, so a press anywhere on the strip
   moves it; the rail and bands under it are what shows. */
.protein__slider {
  -webkit-appearance: none; appearance: none; position: absolute; inset: 0;
  width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; cursor: pointer;
}
.protein__slider::-webkit-slider-runnable-track { height: 30px; background: transparent; }
.protein__slider::-moz-range-track { height: 30px; background: transparent; }
.protein__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
  width: var(--thumb); height: var(--thumb); margin-top: calc((30px - var(--thumb)) / 2);
  border-radius: 50%; background: var(--accent); border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent);
}
.protein__slider::-moz-range-thumb {
  box-sizing: border-box; width: var(--thumb); height: var(--thumb);
  border-radius: 50%; background: var(--accent); border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent);
}
.protein__slider:focus-visible { outline: none; }
.protein__slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink) 50%, transparent); }
.protein__slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink) 50%, transparent); }
.protein__slider.is-unset::-webkit-slider-thumb { background: var(--ink-3); box-shadow: 0 0 0 1px var(--ink-3); }
.protein__slider.is-unset::-moz-range-thumb { background: var(--ink-3); box-shadow: 0 0 0 1px var(--ink-3); }
.protein .sore-help { margin-top: 2px; }

/* OHT-185. The goal page's numbers a row per kind: the three phases, the three fats beneath them,
   Activity on its own, the rep range together. A row of three has a heading so each box names
   only its phase; a label that still wraps at 360 px leaves the boxes level (align-items: end). */
.fields__set { grid-column: 1 / -1; min-width: 0; border: 0; margin: 0; padding: 0; }
.fields__set > legend { padding: 0; margin-bottom: 8px; }
.fields__row { grid-column: 1 / -1; display: grid; gap: 12px; align-items: end; }
.fields__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields__row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* OHT-268: what a row of Goals means, the width of the form under it. */
.fields__help { grid-column: 1 / -1; margin-top: -4px; }
.field { border: 0; padding: 0; margin: 0; }
.field__label em { font-style: normal; color: var(--ink-3); text-transform: none; }

/* The one number that changes every week gets the big input. */
.field--lead input { font-size: 26px; font-weight: 700; padding: 12px; }

input[type=date] { min-height: 44px; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; text-align: center; padding: 10px 6px; font-size: 13px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink-2); cursor: pointer;
}
.segmented input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* Two choices: the unit switches beside height and protein (OHT-189). */
.segmented--two { grid-template-columns: repeat(2, 1fr); }

/* The phase plan's lengths (OHT-106): as many choices as a length has, up to eight, in one row. */
.segmented--fit { grid-template-columns: repeat(auto-fit, minmax(1.75rem, 1fr)); }
.plan-settings { display: grid; gap: 14px; margin-block: 4px 12px; }
.plan-setting .sore-help { margin-block: 6px 0; }
.goal-plan {
  display: grid; gap: 8px; margin-block: 4px 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad);
}
.goal-plan .row__key { white-space: nowrap; }
/* The dates and how long they last wrap as two pieces: on a phone the length drops under the
   dates, and on a narrow one the dates break at the dash. */
.goal-plan .row__val {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline;
  column-gap: 4px; text-align: right;
}
.goal-plan .row__val small { margin-left: 0; white-space: nowrap; }
.row--now .row__key { color: var(--accent-ink); font-weight: 600; }
.row--now .row__key em {
  font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; margin-left: 6px;
}
/* A unit switch beside the box it changes (OHT-189), as tall as the box: height's cm or ft & in,
   and bodyweight's kg or lb beside protein. Each choice fills its half, the word centred in it. */
.unit-switch { flex: none; align-self: stretch; }
.unit-switch label { display: grid; }
.unit-switch span { display: grid; place-items: center; padding: 0 6px; font-size: 12px; }
/* kcal or kJ beside Activity (OHT-270): in a column of its own, so as tall as the box by rule. */
.energy-unit .unit-switch { min-height: 44px; }

/* Height: its box or boxes, then the switch. The switch's column has a blank line where the boxes
   have their labels, so the switch is as tall as the boxes and level with them. */
.height__inputs { display: flex; gap: 10px; }
.height__inputs > .field { flex: 1 1 0; min-width: 0; }
.height__switch { flex: none; display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.height__switch .unit-switch { width: 120px; }

.preview {
  background: var(--panel-2); border-radius: 10px; padding: 14px;
  display: grid; gap: 9px;
}
.preview__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.preview__cal { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.preview__cal small { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.preview__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 9px; }
/* Protein and fat using the whole target, on Edit goal & targets (OHT-170). */
.goal__nocarbs { color: var(--warn-ink); }
.preview__cell { display: grid; gap: 2px; }
.preview__k { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.preview__v { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.preview--invalid { opacity: .45; }

.btn--sm { padding: 7px 12px; font-size: 13px; }

.saving { opacity: .6; pointer-events: none; }

/* ------------------------------------------------------------- soreness */

/* OHT-110. Every other panel puts its button on the bottom edge: the panel is a flex column and
   `.panel > .btn:last-child` gets margin-top auto. Log soreness is one level down, inside this
   wrapper, where that rule cannot reach it, so it sat wherever the readings happened to end and no
   two panels in a row lined up. The wrapper takes the height the panel gives it and does the same
   push itself. Flex rather than grid for that one reason; as a single column it lays out the same. */
.sore-panel { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.sore-panel > .btn:last-child { margin-top: auto; }
.sore-signal { display: grid; gap: 5px; }

.sore-sig {
  display: grid; grid-template-columns: 1fr auto auto auto;
  align-items: center; gap: 8px; font-size: 13px;
  padding: 5px 7px; border-radius: 7px;
}
.sore-sig.is-today { background: var(--panel-2); }
.sore-sig__name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sore-sig__today {
  font-size: 9px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent-ink); margin-left: 7px;
}
.sore-sig__level { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }
.sore-sig__age {
  font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  min-width: 34px; text-align: right;
}
.sore-sig .chip { font-size: 9px; padding: 3px 7px; }

/* The logging sheet.

   Fourteen muscles at a 40px row was about 780px of list alone, so the sheet always opened
   scrolled and you could not see what you had already recorded. Three changes get it under
   one screen: the list runs in two columns once there is room, the rows are tighter, and the
   sheet itself is wider than the others. */
.sore-help { margin: 0; font-size: 12px; color: var(--ink-3); }
.sore-list { display: grid; gap: 2px 22px; }
.sore-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 2px 0;
}
.sore-row__name { font-size: 13px; min-width: 0; }

.sore-scale { display: flex; gap: 5px; }
.sore-pip {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  background: var(--panel-2); color: var(--ink-3);
  border: 1px solid var(--line);
  /* The legend's keys are spans, not buttons, and a span does not centre its text the way a
     button does. Centring here rather than on the button keeps the two identical. */
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex: none;
}
.sore-pip.is-on { color: #fff; border-color: transparent; }
.sore-pip--0.is-on { background: var(--muscle); }
.sore-pip--1.is-on { background: #b8b23f; }
.sore-pip--2.is-on { background: var(--fat); }
.sore-pip--3.is-on { background: var(--warn); }
.sore-pip:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* the legend: the same pips, coloured as if selected, so the key and the control match */
.sore-legend { display: grid; gap: 6px; }
.sore-legend__row { display: flex; gap: 9px; align-items: center; }
.sore-legend__text { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.sore-legend__text strong { color: var(--ink); }
.sore-pip.is-key { cursor: default; color: #fff; border-color: transparent; }
.sore-pip--1.is-key { background: #b8b23f; }
.sore-pip--2.is-key { background: var(--fat); }
.sore-pip--3.is-key { background: var(--warn); }

/* Everything below is about fitting fourteen muscles, a legend and a date picker on one
   screen without a scrollbar, on a laptop as well as a desktop. */
#soreness-view .page__body { gap: 11px; }
/* The date sits on its label's row rather than under it - a two-line field for one control */
#soreness-view .page__body > .field {
  grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px;
}
.sore-pip.is-key { width: 28px; height: 28px; font-size: 12px; }

/* Two columns of muscles once there is room. The width used to be set here too, on a
   #soreness-sheet .sheet__panel that stopped existing when this became a page. */
@media (min-width: 700px) {
  .sore-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .sore-pip { width: 32px; height: 34px; }
}

/* The week's prescribed effort, shown beside the set count in the gym screen. */
.rir-target { color: var(--ink-2); }
.rir-target strong { color: var(--fat-ink); }

/* "you are off the suggested plan" markers in the Goal panel */
.row__val .is-off { color: var(--fat-ink); font-weight: 500; }

/* The exercise picker and its history button share a row; the picker takes what is left. */
.entry__pick { display: flex; gap: 8px; align-items: stretch; }
.entry__pick .ex-select { flex: 1 1 auto; min-width: 0; }
.entry__history { flex: none; }

/* one logged session in the history sheet */
.hist {
  display: grid; gap: 7px; padding: 11px 0;
  border-top: 1px solid var(--line);
}
.hist:first-of-type { border-top: 0; }
.hist__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hist__date { font-weight: 700; font-size: 14px; }
.hist__where { font-size: 12px; color: var(--ink-3); }
/* Phase, diet and the ratio share one wrapping line; the sets go under it, one to a line (OHT-293). */
.hist__row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hist__sets { display: grid; justify-items: start; gap: 4px; }
.hist__bw { color: var(--ink-3); font-weight: 500; }
.hist__set {
  font-size: 13px; padding: 3px 8px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.hist__set small { color: var(--ink-3); }
.hist__set--warmup { opacity: .65; }
/* The session's heaviest set as a share of your bodyweight, when it was more than once (OHT-291). */
.hist__ratio {
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: 7px; color: var(--accent-ink); background: var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, var(--line));
}
.hist__ratio small { color: var(--ink-3); font-weight: 500; }

/* the exercise list editor */
.ex-groups { display: grid; gap: 6px; }
.ex-group { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ex-group__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--panel-2); color: var(--ink); border: 0; text-align: left;
}
.ex-group.is-open .ex-group__head { border-bottom: 1px solid var(--line); }
.ex-group__name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ex-group__count { font-size: 12px; color: var(--ink-3); font-weight: 500; flex: none; }
.ex-group__body { display: grid; gap: 8px; padding: 10px 10px 12px; }

/* An exercise is a card (OHT-186): the grip it is dragged by, its name and its one button across
   the top, and under the name what it counts - in words - with a line saying what that does. */
.ex-card {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 7px 8px; align-items: center;
  padding: 8px 10px 9px 2px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line);
}
.ex-card__body { grid-column: 2 / -1; display: grid; gap: 7px; justify-items: start; min-width: 0; }
.ex-card__name {
  font: inherit; font-size: 13px; min-width: 0;
  padding: 7px 9px; border-radius: 7px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
}
.ex-card__name:disabled { color: var(--ink-2); }
.ex-card__name:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.ex-card__act { padding: 6px 10px; font-size: 12px; }
/* One line (OHT-188): the set count, whether it is shared (an admin's tick or a member's word),
   then Bodyweight and its two choices - wrapping only where the screen is too narrow for them. */
.ex-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  font-size: 11px; color: var(--ink-3); white-space: nowrap;
}
/* global (OHT-180): shared with every account - the word beside the set count */
.ex-card__mark { font-size: 9px; padding: 2px 6px; }
/* a tick or a choice: a label, so the whole pill is the hit target */
.ex-card__flag {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 5px 10px 5px 8px; border-radius: 999px; min-height: 30px; box-sizing: border-box;
  background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap;
}
.ex-card__flag input { margin: 0; }
.ex-card__flag.is-on { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line)); }
/* Which way the weight you enter goes: two named choices side by side, the chosen one coloured. */
.ex-card__sign { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ex-card__flag--load.is-on { color: var(--muscle-ink); border-color: color-mix(in srgb, var(--muscle) 45%, var(--line)); }
.ex-card__flag--assist.is-on { color: var(--fat-ink); border-color: color-mix(in srgb, var(--fat) 45%, var(--line)); }
.ex-card__note { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
/* What it is loaded on (OHT-256): the word, the picker - a ghost button, as every picker is - and
   Weights. One line, wrapping where a phone is too narrow, as the meta line does. */
.ex-card__equip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; width: 100%; }
.ex-card__equip-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.ex-card__equip-pick {
  flex: 1 1 140px; min-width: 0; min-height: 32px; padding: 5px 10px;
  font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ex-card__weights { padding: 6px 10px; font-size: 12px; }
/* One implement's stack (OHT-256): its fields, then the weights they make - drawn as the log's
   rungs are, so what is set here is what is offered there, a tap striking one out. */
.equip__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.equip__steps--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.equip__preview { display: grid; gap: 8px; }
.equip__count { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.equip__tip { margin: 0; font-size: 12px; color: var(--ink-3); }
.equip__weights { display: flex; flex-wrap: wrap; gap: 6px; }
.equip__weights .rung { min-width: 48px; }
/* Struck out here is undone here, so it stays a thing to tap - the log's is not. */
.equip__weights .rung.is-out { cursor: pointer; }
.equip__shared {
  display: grid; gap: 10px; justify-items: start; padding: 10px 12px; border-radius: 9px;
  background: color-mix(in srgb, var(--warn) 10%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
}
.equip__shared p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--warn-ink); }
/* Its way off carries the exercise's name, and a name can be long: a button does not wrap, so this
   one would push the whole sheet past the phone's edge. */
.equip__shared .btn { white-space: normal; }
/* The grip: the only part of a card that drags, so a swipe anywhere else still scrolls the page. */
.ex-card__grip {
  grid-row: 1 / span 2; align-self: stretch; display: grid; place-items: center; min-height: 36px;
  padding: 0; border: 0; border-radius: 7px; background: none; color: var(--ink-3);
  cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
}
.ex-card__grip:hover:not(:disabled) { color: var(--ink); background: var(--panel-2); }
.ex-card__grip:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; color: var(--ink); }
.ex-card__grip:disabled { cursor: default; opacity: .35; }
.ex-card__grip--none { cursor: default; }
/* Being dragged: lifted above the others, which slide aside to show where it will land. */
.ex-card.is-dragging { position: relative; z-index: 2; box-shadow: 0 8px 22px rgb(0 0 0 / .22); }
.ex-card.is-dragging .ex-card__grip { cursor: grabbing; color: var(--accent-ink); }
.is-sorting { -webkit-user-select: none; user-select: none; }
.is-sorting .ex-card:not(.is-dragging) { transition: transform .15s ease; }
@media (prefers-reduced-motion: reduce) {
  .is-sorting .ex-card:not(.is-dragging) { transition: none; }
}
/* A retired exercise stays visible - it is the only way back - but reads as switched off. */
.ex-card--retired { background: transparent; border-style: dashed; }
.ex-card--retired .ex-card__name { color: var(--ink-3); text-decoration: line-through; }
.ex-card--retired .ex-card__meta { opacity: .7; }

/* Read out, never drawn: what a move did, for a screen reader. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ex-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 4px; }
.ex-add input {
  font: inherit; font-size: 13px; min-width: 0;
  padding: 7px 9px; border-radius: 7px;
  background: var(--panel); color: var(--ink); border: 1px dashed var(--line);
}
/* 16px on a phone (OHT-277), as the note field is (OHT-233): an iPhone zooms the page in to a field
   under 16px as it is tapped, and typing a new exercise's name ran the page off the screen's edge.
   The rename field too, the screen's other place to type. With a mouse both stay as they are. */
@media (pointer: coarse) {
  .ex-add input, .ex-card__name { font-size: 16px; }
}

/* the diet phase control, which lives in Edit goal & targets */
.diet-phase { display: grid; gap: 7px; }
.diet-phase .sore-help { margin-top: 1px; }

/* the week / day picker on the session panel */
.daypick { display: grid; gap: 7px; }
/* One row, filled edge to edge. grid-auto-flow: column with 1fr columns divides the whole
   width between however many chips there are, so a 4-week block and a 12-week block both
   reach both edges instead of trailing off after the first inch. minmax(0, 1fr) rather than
   1fr, so a narrow phone shrinks the chips instead of overflowing the panel. */
.daypick__weeks, .daypick__days {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
}
.daypick__week, .daypick__day {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
}
/* No fixed widths: the grid above hands each chip its share of the row. */
.daypick__week { height: 26px; }
.daypick__day { height: 30px; padding: 0 4px; }
.daypick__week:disabled { opacity: .35; cursor: default; }
/* Where you are now, whether or not it is what you are looking at. */
.daypick__week.is-now, .daypick__day.is-today { border-color: var(--accent-ink); color: var(--accent-ink); }
/* What you are looking at. */
.daypick__week.is-on, .daypick__day.is-on {
  background: var(--accent); color: var(--on-accent); border-color: transparent;
}
/* A day already behind you reads quieter until you pick it. */
.daypick__day.is-past:not(.is-on) { opacity: .72; }
/* Sets it asked for and never got. A dot rather than a colour, because a short day can also
   be the selected one, and those are two different facts that both have to fit. Full opacity
   so the is-past fade cannot swallow the one mark worth noticing. */
.daypick__week.is-short, .daypick__day.is-short { position: relative; opacity: 1; }
.daypick__week.is-short::after, .daypick__day.is-short::after {
  content: ''; position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 0 1.5px var(--panel-2);
}
.daypick__week.is-on.is-short::after, .daypick__day.is-on.is-short::after {
  box-shadow: 0 0 0 1.5px var(--accent-ink);
}
.daypick__week:focus-visible, .daypick__day:focus-visible {
  outline: 2px solid var(--accent-ink); outline-offset: 2px;
}
.panel__back { align-self: flex-start; padding: 6px 10px; font-size: 12px; }

/* The journal (OHT-133): a day with sets logged carries a dot in the colour a finished slot
   uses - the opposite fact to .is-short's warning dot, in the same place. */
.daypick__day.is-logged { position: relative; opacity: 1; }
.daypick__day.is-logged::after {
  content: ''; position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muscle); box-shadow: 0 0 0 1.5px var(--panel-2);
}
.daypick__day.is-on.is-logged::after { box-shadow: 0 0 0 1.5px var(--accent-ink); }
.journal__choose { display: grid; gap: 10px; }
.journal__ask { margin: 0; font-weight: 600; color: var(--ink); }
.journal__hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.journal__problem { margin: 0; font-size: 13px; color: var(--warn-ink); }
.journal__choose .daypick__day { height: 40px; }
.journal__change { align-self: center; padding: 6px 10px; font-size: 12px; }

/* exercise notes on the gym screen */
.entry__more { flex: none; padding: 7px 11px; font-size: 15px; line-height: 1; }
.notes { display: grid; gap: 5px; margin-top: 2px; }
/* A note, then its Remove while the 3-dot is open, then its tack - last, so it keeps its place with
   Remove there or not (asked 2026-10-13, after OHT-227). Spaced by margins, not a gap: the column
   Remove leaves empty is then no width at all. The New field's row is its label, the field and a
   hint. */
.note { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.note > :not(:first-child) { margin-left: 7px; }
.note--draft { grid-template-columns: auto minmax(0, 1fr) auto; }
.note__body {
  font: inherit; font-size: 13px; min-width: 0;
  padding: 6px 9px; border-radius: 7px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
}
.note__body:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
/* 16px on a phone (OHT-233): an iPhone zooms in to a field under 16px as it is tapped, and the note
   being typed could end up off the screen. Locked notes too, so the text keeps its size as the 3-dot
   unlocks them. The New field's hint stays as it was, so it still fits beside Enter to save - the
   zoom goes by the field's own size, not its hint's. */
@media (pointer: coarse) {
  .note__body { font-size: 16px; }
  .note__body::placeholder { font-size: 13px; }
}
/* The 3-dot opens on an empty New field, and it glows, slowly, until you tap into it or write in it
   (OHT-275) - so where a note goes is plain the moment the menu opens: "not the pin, but the notes
   field". Movement off, it holds the accent border. */
@keyframes field-glow {
  50% {
    border-color: var(--accent-ink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink) 30%, transparent);
  }
}
.note--draft .note__body:placeholder-shown:not(:focus) { animation: field-glow 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .note--draft .note__body:placeholder-shown:not(:focus) { animation: none; border-color: var(--accent-ink); }
}
/* A note's tack (OHT-227) says which kind of note it is, and is the control that turns one into
   the other, with the 3-dot open or shut. OHT's own drawing (session.js): pinned, red plastic and a
   silver point, in every look; a day note's, a sketch in the look's ink - white in a dark look; in a
   light one the dark ink, as white would vanish into the panel. */
.note__tack {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer;
}
.note__tack:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.tack { display: block; }
.tack__sketch { fill: none; stroke: currentColor; stroke-width: 1.5; }
.tack__plastic { fill: #e3342f; stroke: #8e1b17; stroke-width: 1; }
.tack__point { fill: #c9cfd6; stroke: #5f6770; stroke-width: .8; }
.tack__glint { fill: none; stroke: #fff; stroke-opacity: .6; stroke-width: 1; }
/* The New field's label is still a word, in a dashed pill: it is not a tack. */
.note__pin {
  font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer; white-space: nowrap;
  padding: 5px 9px; border-radius: 999px;
  background: var(--panel-2); color: var(--ink-3); border: 1px solid var(--line);
}
.note__pin--new { cursor: default; border-style: dashed; }
/* With the 3-dot shut a note is readable, not editable - its tack still pins and unpins it. */
.note__body[readonly] { background: var(--panel-2); border-color: transparent; }
.note__body[readonly]:focus-visible { outline: none; }
/* A pinned note is the standing setup, so it reads as the stronger of the two. */
.note--pinned .note__body { border-color: color-mix(in srgb, var(--accent-ink) 30%, var(--line)); }
.note--draft .note__body { border-style: dashed; }
.note__del { padding: 5px 9px; font-size: 11px; }
.note__hint { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.set-row__bw { display: block; font-size: 10px; color: var(--ink-3); font-weight: 500; }

/* On a bodyweight movement, what the kg box actually means. */
.add-set__bw {
  grid-column: 1 / -1;
  margin: 2px 0 0; font-size: 11px; color: var(--ink-3);
}

/* --- OHT-33: a suggestion and a decision look different ---------------------
   Grey is the app talking. It goes solid on the first keystroke in that box, so the number
   in front of you always says whether it came from you or from your own history. Hitting
   Add Set with it still grey commits it - grey is a real value, not a placeholder. */
.mini-field input.is-suggested { color: var(--ink-3); font-style: italic; }

/* --- OHT-39: a finished exercise folds to its two header rows --------------- */
.entry__fold {
  flex: none; margin-left: 10px;
  padding: 2px 9px; font-size: 15px; font-weight: 700; line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.entry__count { margin-left: auto; }
.entry--shut { gap: 8px; }

/* --- OHT-38: what the 3-dot button opens ----------------------------------- */
.entry__menu { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip--action {
  cursor: pointer; appearance: none; font: inherit; font-size: 12px;
  background: var(--panel-2); color: var(--ink-2);
}
.chip--action:hover { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line)); }
.chip--action.is-on { color: var(--accent-ink); border-color: var(--accent-ink); }
/* Marked, not shouted: it sits in a menu you open on purpose, and the confirm is the real
   guard. Colour alone would fail in greyscale, so the word "Delete" does the work. */
/* A locked picker is still the label for what you are lifting, so it reads as an open one does -
   dimming it to the usual disabled grey would make the exercise name the hardest thing on the card. */
.ex-select.is-locked { opacity: 1; color: var(--ink-2); cursor: not-allowed; border-style: dashed; }

.chip--danger { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.chip--danger:hover {
  color: var(--warn-ink); border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}

/* The rest timer: label, five minute chips, and the countdown when one is running - all on
   one line. It rides in the sticky block at the top of the screen, because you rest from an
   exercise while looking at something else and it has to survive scrolling away from the card
   that started it. Everything on the row is sized
   to stay on the row: the whole point is one tap without hunting. */
.rest {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.rest__label { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.rest__presets { display: flex; gap: 4px; flex: none; }
.rest__preset {
  min-width: 26px; padding: 4px 0; text-align: center;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.rest__clock {
  font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--accent-ink); white-space: nowrap;
}
.rest__track {
  flex: 1 1 auto; height: 6px; min-width: 24px;
  background: var(--panel-2); border-radius: 999px; overflow: hidden;
}
.rest__fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s linear; }
.rest__btn { flex: none; padding: 4px 7px; font-size: 11px; }
.rest__label {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600;
  padding: 2px 9px; margin: -2px -1px; border-radius: 7px;
  border: 1px solid transparent; background: var(--accent); color: var(--on-accent);
}
.rest__label:hover { border-color: var(--accent-ink); }
.rest__label:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
/* The word is a filled button that pulses, for good (OHT-276), so it reads as the way in to the big
   countdown and not a label for the minutes beside it: "so ppl know to use it instead of just the
   numbers next to it". Filled, and a little quicker, since a pulse in the text alone was hard to see:
   "make timer a fully coloured button rather than just the text flashing". The fill fades to a pale
   tint and back, so nothing on the row moves. Movement off, it holds the fill. */
@keyframes fill-pulse {
  50% { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); color: var(--accent-ink); }
}
.rest__label { animation: fill-pulse 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .rest__label { animation: none; }
}

.rest.is-running { border-color: color-mix(in srgb, var(--accent-ink) 40%, var(--line)); }
.rest.is-up { border-color: var(--muscle); }
.rest.is-up .rest__clock { color: var(--muscle-ink); }
.rest.is-up .rest__fill { background: var(--muscle); }

/* --- OHT-53: the last five seconds, and the moment it lands -----------------
   Two states, and they have to be tellable apart from across a gym: the run-in BLINKS once
   a second, in step with the beep, and zero POPS. Colour carries both on its own, so the
   animations can be turned off for a reader who does not want movement without the cue
   disappearing with them. */
@keyframes rest-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .18; } }
@keyframes rest-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.rest.is-final { border-color: var(--warn); }
.rest.is-final .rest__clock { color: var(--warn-ink); animation: rest-blink 1s steps(1, end) infinite; }
.rest.is-final .rest__fill { background: var(--warn); }

/* The big face, over the exercises but not instead of them: they stay visible round the
   edge, so opening this is not the same as losing your place. */
.restbig__scrim {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(3px);
}
.restbig {
  position: relative;
  width: 75vw; max-width: 560px;
  height: 75vh; max-height: 620px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 20px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 18px 60px rgb(0 0 0 / .35);
}
.restbig__close {
  position: absolute; top: 10px; right: 10px;
  appearance: none; cursor: pointer; font: inherit; font-size: 15px; line-height: 1;
  width: 34px; height: 34px; border-radius: 50%;
  color: var(--ink-3); background: var(--panel-2); border: 1px solid var(--line);
}
.restbig__close:hover { color: var(--ink); border-color: var(--ink-3); }
.restbig__clock {
  font-size: clamp(56px, 18vw, 132px); font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--accent-ink);
}
.restbig__track {
  width: 100%; height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--panel-2);
}
.restbig__fill {
  height: 100%; border-radius: 999px; background: var(--accent);
  transition: width .25s linear;
}
.restbig__presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.restbig__presets .chip { min-width: 42px; padding: 8px 0; text-align: center; font-size: 14px; }
.restbig__acts { display: flex; gap: 10px; }
.restbig__hint { margin: 0; font-size: 12px; color: var(--ink-3); }

.restbig.is-final .restbig__clock { color: var(--warn-ink); animation: rest-blink 1s steps(1, end) infinite; }
.restbig.is-final .restbig__fill { background: var(--warn); }
.restbig.is-up .restbig__clock { color: var(--muscle-ink); animation: rest-pop .55s ease-out 4; }
.restbig.is-up .restbig__fill { background: var(--muscle); }

/* --- OHT-299: the rest on every other page ------------------------------------
   "If I start a timer on the exercise page, it needs to show and persist on other pages, unless
   its finished".

   A bar at the foot of the screen. It sits over the page but under the topbar's menu (10) and
   any popup (50), so it never covers a choice or a Save. The log has its own row, and the bar is
   the last thing in #app, so the log being the page is what hides it.

   The room for it goes under the app's footer, the version, which is the last line on every
   page. It was first put under each page's own content, which left the footer behind the bar when
   scrolled to the end. The log gets none, since the bar is not on it. Its last five seconds and
   its end look like the big face's. Its edge shows it is running, whatever the theme. */
.restpill {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 9; max-width: 520px; margin: 0 auto; min-height: 48px;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  appearance: none; cursor: pointer; font: inherit; color: var(--ink); text-align: left;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, var(--line));
  border-radius: 999px; box-shadow: 0 6px 18px rgb(0 0 0 / .28);
}
#session-view:not([hidden]) ~ .restpill { display: none; }
#app:has(> .restpill:not([hidden])):not(:has(> #session-view:not([hidden]))) > .footer {
  padding-bottom: calc(32px + 72px + env(safe-area-inset-bottom));
}
.restpill__label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.restpill__clock {
  font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-ink);
}
.restpill__track {
  flex: 1 1 auto; height: 6px; min-width: 40px;
  background: var(--panel-2); border-radius: 999px; overflow: hidden;
}
.restpill__fill {
  display: block; height: 100%; background: var(--accent); border-radius: 999px;
  transition: width .25s linear;
}
.restpill__go { font-size: 22px; line-height: 1; color: var(--ink-3); }
.restpill.is-final { border-color: var(--warn); }
.restpill.is-final .restpill__clock { color: var(--warn-ink); animation: rest-blink 1s steps(1, end) infinite; }
.restpill.is-final .restpill__fill { background: var(--warn); }
.restpill.is-up { border-color: var(--muscle); }
.restpill.is-up .restpill__clock { color: var(--muscle-ink); animation: rest-pop .55s ease-out 4; }
.restpill.is-up .restpill__fill { background: var(--muscle); }

/* Movement off, cue kept: the colours above are separate declarations and survive this. */
@media (prefers-reduced-motion: reduce) {
  .rest.is-final .rest__clock,
  .restbig.is-final .restbig__clock,
  .restbig.is-up .restbig__clock,
  .restpill.is-final .restpill__clock,
  .restpill.is-up .restpill__clock { animation: none; }
}

/* --- OHT-11: the training week, as seven buttons ---------------------------
   The row reads from the day the block starts, because that is the order you train it in.
   The marker above each column is the week's first day - it moves the start date rather than
   being a second setting that could disagree with it. */
.dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow__col { display: grid; gap: 3px; justify-items: stretch; min-width: 0; }
.dow__first {
  appearance: none; cursor: pointer; font: inherit;
  padding: 1px 0; font-size: 10px; font-weight: 700; line-height: 1.4;
  color: var(--ink-3); background: transparent;
  border: 1px solid transparent; border-radius: 5px;
}
.dow__first:hover:not(:disabled) { color: var(--ink-2); border-color: var(--line); }
.dow__first.is-on { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line)); }
.dow__day {
  appearance: none; cursor: pointer; font: inherit;
  padding: 9px 0; font-size: 12px; font-weight: 700;
  color: var(--ink-3); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px;
}
.dow__day:hover:not(:disabled) { color: var(--ink-2); border-color: var(--ink-3); }
.dow__day.is-on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.dow__day:disabled, .dow__first:disabled { cursor: default; opacity: .55; }
.dow__hint { margin: 6px 0 0; font-size: 11px; color: var(--ink-3); }

/* --- OHT-28-F1: moving a card, from its own menu ---------------------------
   The same four controls the dashboard uses to rearrange its panels, so the gesture is one
   gesture across the app rather than two things that do the same job differently. */
.entry__move { margin-left: auto; }

/* --- OHT-36: joints, next to the muscles and visibly not among them --------
   The separation is the point. A sore muscle is the training working and a sore joint is the
   training going wrong, so the two readings must not be scanned as one list. */
.sore-joints {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sore-joints__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sore-joints__body { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
.sore-joints__note { font-size: 11px; color: var(--ink-3); }
.sore-joints .sore-help { margin-top: 4px; }
/* Joints the exercise you just finished actually loads, listed first and labelled. Everything
   else stays on the list: a knee that hurts after a pressing day is exactly the reading you
   would not want filtered out. */
.sore-row--lead .sore-row__name { color: var(--ink); font-weight: 600; }
.sore-row__tag {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 600; color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, var(--line));
}

/* ------------------------------------------------------ sign-in attempts (OHT-63) */
/* Full-screen like the disclaimer, because the tables are wide and this is read, not
   glanced at. The tables scroll horizontally on a phone rather than wrapping an address
   onto two lines - a broken IP is worse than a scrollbar. */

.sec {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  /* minmax(0, 1fr), not the implicit auto track: an auto track sizes to its CONTENT, so the
     wide tables inside push the card past the viewport and the whole overlay scrolls sideways
     with the right-hand columns cut off. Pinned to the container, the card stays the width of
     the screen and the tables scroll inside themselves, which is the intent. */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg);
}

.sec__card {
  min-width: 0;
  width: min(880px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  /* And again here, for the same reason as .sec above: the card's own implicit track would
     size to the widest table's max-content - 539px inside a 335px card on a phone - and the
     tables would spill out of the card instead of scrolling inside it. */
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sec__title { margin: 0; font-size: 20px; }
.sec__lead { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.sec__sub {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sec__note { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.sec__error { margin: 0; color: var(--warn-ink); font-size: 13px; }

.sec__empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13px;
}
.sec__empty strong { color: var(--ink); font-size: 13.5px; }

.sec__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.sec__table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 12px 6px 0;
}
.sec__table td { padding: 7px 12px 7px 0; border-top: 1px solid var(--line); }
.sec__table code { font-size: 12.5px; color: var(--ink); }

.sec__row--warn td { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.sec__read { color: var(--ink-3); font-size: 12px; }

/* Where an address is (OHT-79), under the address itself rather than in a column of its own. */
.sec__where { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
/* Answered from the shape of the address, not from the country file - so it must not read as a
   place. Italic and dimmer is the whole distinction. */
.sec__where--local { color: var(--ink-3); font-style: italic; }

.sec__state { font-weight: 600; }
.sec__state--perm { color: var(--warn-ink); }
.sec__state--timed { color: var(--accent-ink); }

.sec__out { font-size: 12.5px; }
.sec__out--fail { color: var(--ink-2); }
.sec__out--ok { color: var(--accent-ink); }
.sec__out--blocked { color: var(--warn-ink); }

/* A fingerprint, not a password. Monospaced and dimmed so it never reads as something
   anyone could type back in. */
.sec__hash code { color: var(--ink-2); letter-spacing: .02em; }
.sec__hash small { color: var(--ink-3); font-size: 11px; }

/* ------------------------------------------------------- messages (OHT-81) */

/* The bell. Its own element rather than a .btn: it is an icon with a count on its corner, and
   the count has to sit there without pushing anything around it. The height of the ghost
   buttons beside it, so the bar does not grow. */
.bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.bell:hover { color: var(--ink); }
.bell:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.bell__icon { width: 20px; height: 20px; }
.bell__count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--warn-fill);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.msgs { display: grid; gap: 12px; }
.msgs__heading {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.msg {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.msg--new { border-color: color-mix(in srgb, var(--accent-ink) 55%, var(--line)); }
.msg--removed { opacity: .6; }
.msg__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.msg__title { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.msg__date { flex: none; font-size: 12px; color: var(--ink-3); }
/* pre-line and never markup: line breaks are the only formatting a message gets. messages.js. */
.msg__body {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--ink-2);
  line-height: 1.5;
}
.msg__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
}
.msg__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------- admin portal (OHT-78) */

.sheet__tools { display: flex; gap: 8px; }

.admin__list { display: grid; gap: 8px; }
.admin__item {
  appearance: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
}
.admin__item:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent-ink) 50%, var(--line)); }
.admin__item:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.admin__item:disabled { cursor: not-allowed; opacity: .5; }
.admin__label { font-size: 14px; font-weight: 600; }
.admin__sub { font-size: 12px; color: var(--ink-2); line-height: 1.4; }

.admin__form { display: grid; gap: 12px; }
.admin__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* The same values as the inputs rule near the top of this file, which does not cover a textarea. */
.admin__text {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  width: 100%;
  resize: vertical;
}
.admin__text:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }

.admin__made {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent-ink) 55%, var(--line));
  border-radius: 10px;
}
.admin__link { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
/* A reset code (OHT-181): read out on a call, so big, and spaced like the six digits it is. */
.admin__code { font-size: 24px; letter-spacing: .12em; font-variant-numeric: tabular-nums; max-width: 12ch; }
.admin__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin__card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.admin__meta { font-size: 12px; color: var(--ink-3); }

/* Admin > Foods (OHT-151). An unchecked food is edged in the accent: it is waiting on you. */
.foodadmin--waiting { border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line)); }
.foodadmin__what { display: grid; gap: 2px; min-width: 0; }
.foodadmin__tick { display: flex; align-items: center; gap: 6px; flex: none; font-size: 13px; }
.foodadmin__tick input { width: 18px; height: 18px; accent-color: var(--accent); }
.foodadmin__label { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.foodadmin__filter {
  font: inherit; font-size: 14px; width: 100%; padding: 10px 12px; min-height: 44px;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 9px;
}
/* Finding a food on a phone (OHT-241). A sheet is as tall as what is in it and stands on the
   bottom of the screen, so as the filter narrowed the list the sheet sank behind the keyboard,
   and took the food it had found with it. While something is typed the list keeps a screen of
   room below: the sheet stays at its full height, and the filter can rise to the top of it with
   what it found straight under it (admin.js). Its rows keep their own height in that room. */
.foodadmin--finding { min-height: 92dvh; align-content: start; }
.admin__people { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.admin__person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.admin__email { min-width: 0; overflow-wrap: anywhere; }
/* Two-step and, on a member's card, themes (OHT-236): one above the other at the right, so the
   address keeps its width - side by side they took enough of it to break the address in two. */
.admin__chips { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.admin__warn { margin: 0; color: var(--warn-ink); font-size: 13px; }

/* The promote report's file lists (OHT-131). Long, and skimmed more often than read, so they
   fold - but the ones that are the point of the screen are opened by the markup. */
.admin__files { margin: 2px 0; font-size: 13px; }
.admin__files summary { cursor: pointer; color: var(--ink-2); padding: 2px 0; }
.admin__files ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-3); }
.admin__files li { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }

/* What a move brings, one line per ticket (OHT-135). Read rather than skimmed, so it does not
   fold, and it is in the body's own ink where the file lists under it are a step quieter. */
.admin__changes { display: grid; gap: 6px; }
.admin__changes-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.admin__changes ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.4;
}
.admin__ref { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink-2); }

/* ------------------------------------------------------- two-step sign-in (OHT-105) */

/* The one-time offer after sign-in, lined up with the panels under it. */
.nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: calc(100% - 2 * var(--gap));
  max-width: calc(1240px - 2 * var(--gap));
  margin: var(--gap) auto 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 55%, var(--line));
  border-radius: 10px;
}
.nudge__text {
  display: grid;
  gap: 3px;
  flex: 1 1 260px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}
.nudge__text strong { font-size: 14px; color: var(--ink); }
.nudge__actions { display: flex; gap: 8px; }

.twostep__lead { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.twostep__step {
  margin: 0;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.twostep__card, .twostep__reason {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.twostep__reason { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.twostep__done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--accent-ink) 55%, var(--line));
  border-radius: 10px;
}

/* White whatever the theme: a QR code has to be dark on light to scan. Its quiet zone is inside
   the SVG. */
.twostep__qr { justify-self: center; padding: 6px; line-height: 0; background: #fff; border-radius: 10px; }
.twostep__qr img { display: block; width: min(220px, 62vw); height: auto; aspect-ratio: 1; }

.twostep__add { text-decoration: none; }   /* a link dressed as a button: an otpauth: link */
.twostep__secret { display: grid; gap: 6px; }
.twostep__key {
  display: block;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: .06em;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  /* One tap selects all of it, for the phone that cannot scan its own screen. */
  -webkit-user-select: all;
  user-select: all;
}
.twostep__code {
  max-width: 14ch;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: .18em;
}
.twostep__codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 12px 14px;
  list-style-position: inside;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.twostep__codes li::marker { font-size: 12px; color: var(--ink-3); }
/* The joint-prompt switch (OHT-121), under the joint list it is about. */
.sore-pref {
  margin-top: 14px; padding: 12px 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
.sore-pref__tick { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.sore-pref__tick input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
/* Greyed while it does nothing: the 1-minute timer with warm-ups off (OHT-283). */
.sore-pref__tick:has(input:disabled) { opacity: .5; cursor: default; }
.sore-pref .sore-help { margin: 6px 0 0; }

.twostep__tick { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.twostep__tick input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* ------------------------------------------------------------------ splits (OHT-24)

   The grid is muscles down and weekdays across. At phone width seven columns of checkboxes do
   not fit beside a name, so each muscle is a card: name and exercise count on one line, the
   week as seven taps on the next. */

.page__notice {
  margin: 10px 16px 0; padding: 9px 11px 9px 13px; border-radius: 8px; font-size: 13px;
  color: var(--ink); background: color-mix(in srgb, var(--warn) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  border-left: 3px solid var(--warn);
}
/* The same box for something that went right. A fork is news, not a failure. */
.page__notice.is-notice {
  color: var(--ink-2); background: var(--panel-2); border-color: var(--line);
  border-left-color: color-mix(in srgb, var(--accent-ink) 60%, var(--line));
}

.split-card {
  padding: 12px 14px; margin-top: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.split-card__open {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 0; text-align: left; background: none; border: 0; cursor: pointer; color: inherit;
}
.split-card__name { font-size: 16px; font-weight: 600; color: var(--ink); }
.split-card__meta { font-size: 12px; color: var(--ink-2); }
.split-card__used { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
.split-card__acts { display: flex; gap: 8px; margin-top: 10px; }
.split-add { margin-top: 14px; }

.split-head { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; }
.split-head .field--wide { grid-column: 1 / -1; }

/* The count read off the grid. It is a statement about what is marked, so it is loud enough to
   notice and quiet enough not to look like an error. */
.split-summary {
  margin: 14px 0 0; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--accent-ink) 30%, var(--line));
}
.split-summary.is-empty {
  color: var(--ink-3); font-weight: 400;
  background: var(--panel-2); border-color: var(--line);
}

.split-grid { margin-top: 10px; }
.split-row {
  padding: 10px 12px; margin-top: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
/* A muscle this split does not train. Still on screen, because putting it back is one tap. */
.split-row--rest { opacity: .62; }
.split-row__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.split-row__muscle { font-size: 14px; font-weight: 600; }
.split-row__ex { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); }
.split-row__ex input { width: 4.5ch; padding: 4px 6px; text-align: center; font-size: 14px; }

.split-row__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 9px; }
.split-day {
  padding: 9px 0; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--ink-2); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px;
  /* 44px of touch target on a phone without making the row that tall. */
  min-height: 34px;
}
.split-day.is-on {
  color: var(--on-accent); background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}
.split-day:disabled { cursor: default; opacity: .6; }

.split-save { margin: 16px 0 8px; }
.split-save .btn { width: 100%; }

/* The exercises planned for each day's slots (OHT-269): one day at a time, picked in the row of
   days above them, each muscle that day trains with a picker for every exercise it gets - side by
   side where the page is wide enough. */
.split-plan { margin-top: 18px; }
.split-plan__title { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.split-plan__days { margin-top: 10px; }
.split-plan__days span { padding-inline: 2px; }
.split-plan__muscle {
  padding: 10px 12px; margin-top: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.split-plan__name { font-size: 14px; font-weight: 600; }
.split-plan__slots {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px;
  margin-top: 8px;
}
.split-plan__none { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------- achievements (OHT-219) */

/* Each group's colour - the ring round a medal, the tint inside it, the edge of the line on the
   workout log. Never the colour of text, so no look needs its own shade of them: the number in a
   medal and the words on the line are the ink. */
:root { --ach-training: #4a8fe8; --ach-records: #e3a52a; --ach-body: #2fb3a6; --ach-food: #3fae6a; }
.ach--training { --ach: var(--ach-training); }
.ach--records { --ach: var(--ach-records); }
.ach--body { --ach: var(--ach-body); }
.ach--food { --ach: var(--ach-food); }

.ach-group__title {
  margin: 14px 2px 8px; font-size: 12px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-3);
}
.panel__head + .ach-group .ach-group__title { margin-top: 4px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px 6px; }
.ach { display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; text-align: center; }
/* The ring is how far it is to the next step: --far of it in the group's colour, the rest the line's. */
.ach__medal {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: conic-gradient(var(--ach) var(--far), var(--line) 0);
}
.ach__in {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: color-mix(in srgb, var(--ach) 24%, var(--panel));
  color: var(--ink); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.ach.is-todo .ach__in { background: var(--panel-2); color: var(--ink-2); }
.ach__name { font-size: 12px; font-weight: 600; line-height: 1.2; }
.ach__note { font-size: 11.5px; line-height: 1.25; color: var(--ink-2); }

/* The line on the workout log: over the page at its foot, under any sheet (50), and never in the
   way of a tap - what is under it still takes one. */
.ach-line {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30; display: grid; gap: 6px; max-width: 520px; margin: 0 auto; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.ach-line.is-on { opacity: 1; visibility: visible; transform: none; }
.ach-line__one {
  margin: 0; padding: 11px 14px; border-radius: 12px; font-size: 14px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--ach);
  box-shadow: 0 6px 18px rgb(0 0 0 / .28);
}
@media (prefers-reduced-motion: reduce) { .ach-line { transform: none; transition: none; } }
