:root {
  --bg: #14181C;
  --surface: #1E2429;
  --surface-raised: #262E35;
  --border: #2A3138;
  --text: #E8EDF0;
  --text-muted: #6B7680;
  --accent: #FF8A3D;
  --accent-dim: #4A3222;
  --success: #3DDC97;
  --success-dim: #1E3D30;

  --font-display: "Red Hat Display", system-ui, -apple-system, sans-serif;  /* AoA: ExtraBold for names and numbers */
  --font-body: "Red Hat Display", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* AoA (the default for accounts that never picked a theme), from the
   Settle Plate concept: Ink, Chalk, Signal red and Steel. The red is lifted a
   touch (#E5484D) so it reads as text on ink; buttons on it use chalk text.
   Chalk is the light version, with the red darkened for the light ground. */
[data-theme="dialed"] {
  --bg: #121417; --surface: #1B1E22; --surface-raised: #24282D; --border: #30353B;
  --text: #F2F1EC; --text-muted: #8A9098; --accent: #E5484D; --accent-dim: #3A1618;
  --success: #3DDC97; --success-dim: #143326;
}
[data-theme="chalk"] {
  --bg: #F2F1EC; --surface: #FFFFFF; --surface-raised: #E6E6E2; --border: #D6D6D1;
  --text: #121417; --text-muted: #555A61; --accent: #C0262B; --accent-dim: #F7DADA;
  --success: #17804F; --success-dim: #D8F1E4;
}
[data-theme="chalk"] .rest-overlay { background: rgba(242, 241, 236, 0.97); }
[data-theme="dialed"] .btn-primary, [data-theme="dialed"] .wod-btn.primary,
[data-theme="chalk"] .btn-primary, [data-theme="chalk"] .wod-btn.primary { color: #FFFFFF; }

/* Brand: ring and wave in the text color, the target dot in the accent. */
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand-mark { flex: none; }
.brand-mark .donut { stroke: var(--accent); }
.brand-word { flex: none; width: auto; display: block; }
.brand-word .ring { stroke: var(--accent); }
.brand-word .tagline { fill: var(--accent); }
.brand.with-tagline { gap: 14px; }
.brand-tag { margin-top: 8px; color: var(--text-muted); font-size: 0.9rem; }

/* Color themes (Settings -> Theme). "ember" is the :root default above.
   Each only swaps the color tokens; the text on accent-colored buttons stays
   dark, which reads on every accent here. */
[data-theme="ocean"] {
  --bg: #111821; --surface: #19222E; --surface-raised: #212C3A; --border: #2A3646;
  --text: #E6EEF6; --text-muted: #7E8C9C; --accent: #5AAEFF; --accent-dim: #1D3452;
  --success: #3DDC97; --success-dim: #1E3D30;
}
[data-theme="forest"] {
  --bg: #111914; --surface: #18221C; --surface-raised: #202C25; --border: #2A382F;
  --text: #E6F0EA; --text-muted: #7D8C83; --accent: #5ACF8E; --accent-dim: #1C3B2B;
  --success: #8FD6FF; --success-dim: #1C3344;
}
[data-theme="berry"] {
  --bg: #171219; --surface: #201A24; --surface-raised: #29212F; --border: #372C3E;
  --text: #F1E8F3; --text-muted: #8F8094; --accent: #F07CCB; --accent-dim: #43223A;
  --success: #3DDC97; --success-dim: #1E3D30;
}
[data-theme="daylight"] {
  --bg: #F4F5F7; --surface: #FFFFFF; --surface-raised: #ECEFF3; --border: #D5DAE1;
  --text: #161A1F; --text-muted: #5B6672; --accent: #D9601A; --accent-dim: #FBE2D1;
  --success: #17804F; --success-dim: #D8F1E4;
}
[data-theme="daylight"] .rest-overlay { background: rgba(244, 245, 247, 0.97); }
[data-theme="crimson"] {
  --bg: #0B0A0B; --surface: #171214; --surface-raised: #221A1D; --border: #36262B;
  --text: #F3ECEC; --text-muted: #93838A; --accent: #E5383B; --accent-dim: #3F1517;
  --success: #3DDC97; --success-dim: #143326; --danger: #FF7A59;
}
[data-theme="contrast"] {
  --bg: #000000; --surface: #0E0E0E; --surface-raised: #1B1B1B; --border: #6A6A6A;
  --text: #FFFFFF; --text-muted: #D0D0D0; --accent: #FFD400; --accent-dim: #3A3100;
  --success: #6CFFB0; --success-dim: #0F3322;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
/* Behind the status bar (the iPhone app and the home-screen web app draw the page
   under it): a strip of page color, so content doesn't scroll under the time and
   battery. Under the pinned bars (20+) and overlays; nothing on a plain browser. */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px);
  background: var(--bg); z-index: 15; pointer-events: none;
}

.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.label {
  font-family: var(--font-display);
  font-stretch: condensed;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.heading {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

a { color: inherit; }

/* ---------- Setup screen ---------- */

.setup {
  padding: 28px 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.setup-title {
  font-size: 1.9rem;
  margin: 8px 0 0;
}

.setup-sub {
  color: var(--text-muted);
  margin: 4px 0 0;
  font-size: 0.95rem;
}

.field-group { display: flex; flex-direction: column; gap: 10px; }

.tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-row.thirds { grid-template-columns: repeat(3, 1fr); }

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: left;
  color: var(--text);
  font-family: var(--font-display);
  font-stretch: condensed;
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tile input { display: none; }

.tile .tile-equip {
  display: block;
  font-family: var(--font-body);
  font-stretch: normal;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: none;
  letter-spacing: normal;
}

.tile.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.equip-tile:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ---------- Settings ---------- */

.settings-section { padding: 6px 20px 10px; scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 60px); }
.settings-section[hidden] { display: none; }
/* Settings search + section menu (settings.html): a sideways-scrolling row of
   section buttons on a phone (once it scrolls away, the .settings-jump bubble at the
   top drops the same list down); a sidebar left of the page on a wide screen. */
.settings-search { padding: 4px 20px 6px; }
.settings-search input { width: 100%; -webkit-appearance: none; appearance: none; }
.settings-nav {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 20px 12px;
}
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav-link {
  flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.8rem; text-decoration: none; white-space: nowrap;
}
.settings-nav-link.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.settings-nav-link[hidden] { display: none; }
/* Below the status bar (it's under it in the app and the home-screen web app). */
.settings-jump {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%);
  z-index: 40; display: flex; flex-direction: column; align-items: center; animation: jump-in 0.18s ease;
}
.settings-jump[hidden] { display: none; }
@keyframes jump-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.settings-jump-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--text);
  font-family: var(--font-body); font-size: 0.85rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); cursor: pointer;
}
.settings-jump-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.settings-jump-list {
  margin-top: 8px; width: min(260px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; padding: 6px;
  display: flex; flex-direction: column; background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.settings-jump-list[hidden] { display: none; }
.settings-jump-link { padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 0.92rem; }
.settings-jump-link.active { background: var(--accent-dim); color: var(--accent); }
.settings-jump-link[hidden] { display: none; }
@media (min-width: 1100px) {
  .settings-nav {
    position: fixed; top: 96px; right: calc(50% + 260px); width: 200px; max-height: calc(100vh - 140px);
    flex-direction: column; overflow-y: auto; padding: 0; background: none; border: none;
  }
  .settings-nav-link { border: none; background: none; border-radius: 8px; padding: 7px 12px; color: var(--text-muted); font-size: 0.9rem; }
  .settings-nav-link:hover { color: var(--text); background: var(--surface); }
  .settings-nav-link.active { background: var(--accent-dim); color: var(--accent); }
  .settings-section { scroll-margin-top: 16px; }
}
.settings-section .heading { font-size: 1.2rem; margin-bottom: 10px; }

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;  /* the text never runs into the button beside it */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.settings-row-info { display: flex; flex-direction: column; gap: 2px; }
.settings-row-title { font-family: var(--font-display); font-stretch: condensed; font-size: 1.05rem; }
.settings-row-sub { color: var(--text-muted); font-size: 0.8rem; }
.settings-row-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.settings-row-actions a, .settings-row-actions button {
  background: none; border: none; color: var(--accent);
  font-family: var(--font-display); font-stretch: condensed;
  text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.03em;
  text-decoration: none; padding: 4px;
}
.settings-row-actions .danger { color: var(--text-muted); }

.add-link {
  display: block;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-stretch: condensed;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.error-banner {
  margin: 12px 20px 0;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text);
}

.form-page { padding: 20px 20px 100px; display: flex; flex-direction: column; gap: 22px; flex: 1; }

/* One-question-at-a-time wizard. JS (initWizards in base.html) owns
   show/hide via inline display -- CSS here is cosmetic only, so there's no
   specificity fight between "paginate" (onboarding) and "show all relevant,
   hide conditional ones the user doesn't need" (editing in Settings). Both
   modes share these same .wizard-step sections. .form-page/.wizard-step's
   flex:1 lets the active question actually fill the space between the
   top bar and the nav controls, instead of floating min-height-tall in an
   otherwise mostly-empty page. */
.wizard-step { display: none; flex-direction: column; gap: 22px; }
.wizard-step.active { animation: wizard-in 0.18s ease; }
form[data-wizard] .wizard-step.active { flex: 1; justify-content: center; }
@keyframes wizard-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wizard-question {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
}

/* Back is a quiet link above a full-width, primary-styled Next -- matches
   the weight of the real submit button it hands off to on the last step,
   rather than two equally-weighted boxes competing for attention. */
.wizard-topnav { display: none; align-items: center; justify-content: space-between; }
form[data-wizard] .wizard-topnav { display: flex; }
.wizard-back {
  background: none;
  border: none;
  padding: 8px 2px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-stretch: condensed;
  font-size: 0.95rem;
}
.wizard-back:disabled { opacity: 0.3; }
.wizard-progress { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; }
button.wizard-next { display: none; }
form[data-wizard] button.wizard-next { display: block; }
.form-page select {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 36px 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
}
.checkbox-line { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.9rem; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.stepper-value .unit {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 2px;
}

/* Compact variant -- a grid of these (e.g. one per movement pattern) reads
   as a set of interactive cards, not a form of stacked label/input rows. */
.stepper.compact { padding: 8px 10px; border-radius: 12px; }
.stepper.compact .stepper-btn { width: 32px; height: 32px; font-size: 1.1rem; border-radius: 8px; }
.stepper.compact .stepper-value { font-size: 1.15rem; }

.pattern-weight-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Every dropdown in the app's own look (otherwise iOS draws gray system pills): theme
   colors, the app font and one chevron. Page rules only size them; they set
   background-color, not background, so the chevron stays. */
select {
  -webkit-appearance: none; appearance: none;
  background-color: var(--surface); color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238A9098' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 34px 10px 14px; font-family: var(--font-body); font-size: 1rem; line-height: 1.3;
}
select:focus { outline: none; border-color: var(--accent); }

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  resize: none;
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #1A1006;
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.btn-primary:active { opacity: 0.85; }

/* ---------- Execution screen ---------- */

.workout-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.progress-track {
  display: flex;
  gap: 6px;
  padding: 18px 20px 0;
}

.progress-segment {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-raised);
}

.progress-segment.done { background: var(--success); }
.progress-segment.current { background: var(--accent); }

.exercise-list {
  padding: 14px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exercise-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.exercise-row.current { color: var(--text); font-weight: 600; }
.exercise-row.done { color: var(--success); }

.focus-card {
  margin: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 22px;
  flex: 1;
}

.focus-setlabel { margin-bottom: 6px; }

.focus-name {
  font-size: 1.7rem;
  line-height: 1.15;
  margin: 0 0 14px;
}

.focus-target {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.focus-target .unit { font-size: 1rem; color: var(--text-muted); font-family: var(--font-body); }

.focus-notes {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.input-row { display: flex; gap: 12px; margin-top: 22px; }

.input-block { flex: 1; }

.input-block .label { display: block; margin-bottom: 8px; }

.effort-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }

.effort-btn {
  padding: 12px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-stretch: condensed;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.effort-btn.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.wod-effort .effort-btn { cursor: pointer; }
.wod-effort .effort-btn:has(input:checked) { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.wod-swap { margin-top: 10px; }
.wod-swap > summary { list-style: none; display: inline-flex; cursor: pointer; }
.wod-swap > summary::-webkit-details-marker { display: none; }
.wod-swap-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wod-swap-list .chip { width: auto; }
.round-counter { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.round-counter-head { display: flex; justify-content: space-between; align-items: center; }
.round-counter-body { display: grid; grid-template-columns: 1fr 64px; gap: 8px; }
.round-counter-body[hidden] { display: none; }
.round-plus { min-height: 150px; border-radius: 18px; border: 2px solid var(--accent); background: var(--accent-dim); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.round-plus:active { transform: scale(0.98); background: var(--accent); }
.round-count { font-size: 4rem; font-weight: 800; line-height: 1; }
.round-plus-label { font-size: 1.1rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.round-plus:active .round-plus-label { color: var(--text); }
.round-minus { border-radius: 18px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--text-muted);
  font-size: 1.8rem; cursor: pointer; touch-action: manipulation; }

.action-bar {
  position: sticky;
  bottom: 0;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}

.rest-overlay[hidden] { display: none; }
.rest-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 50;
}

.rest-ring-wrap { position: relative; width: 200px; height: 200px; }

.rest-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 3rem;
  color: var(--text);
}

.rest-label { color: var(--text-muted); }

.skip-rest {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-display);
  font-stretch: condensed;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  padding: 10px;
}

.complete-card {
  margin: 40px 20px;
  text-align: center;
}

.complete-card .heading { font-size: 1.8rem; }

/* ---------- History ---------- */

.history-list { padding: 8px 20px 40px; display: flex; flex-direction: column; gap: 10px; }

.history-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-date { font-family: var(--font-mono); }

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 4px;
}

.top-bar a.label { text-decoration: none; }
/* The workout's top line and controls in full text color: muted gray up there read
   as faded, as if the page weren't scrolled all the way up. */
.workout-shell > .top-bar .label { color: var(--text); }

/* ---- Barbell plates: shared colors (bumper-plate convention) ----
   Used by the plate-count cards in location settings and the "load the
   bar" diagram on the workout screen. --plate-ink is the label color that
   stays readable on that plate. */
.plate-55 { --plate: #D64545; --plate-ink: #FFF; }
.plate-45 { --plate: #3D7BD9; --plate-ink: #FFF; }
.plate-35 { --plate: #E3B53B; --plate-ink: #1A1406; }
.plate-25 { --plate: #3FA66B; --plate-ink: #FFF; }
.plate-10 { --plate: #E8EDF0; --plate-ink: #14181C; }
.plate-5 { --plate: #A7B0B8; --plate-ink: #14181C; }
.plate-2_5 { --plate: #7B8791; --plate-ink: #14181C; }
.plate-other { --plate: #8C6BD6; --plate-ink: #FFF; }

.plate-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--plate);
  flex-shrink: 0;
}

/* Location settings: one counter card per plate size */
.plate-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.plate-count-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plate-count-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.plate-count-card .stepper.compact { background: var(--surface-raised); padding: 6px 8px; }
.plate-count-card .stepper.compact .stepper-btn { background: var(--surface); }
.plate-count-summary { margin-top: -8px; line-height: 1.4; }

/* Workout screen: the weight number doubles as a "how do I load this" tap target */
.weight-tap {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  text-decoration: underline dotted var(--accent-dim);
  text-underline-offset: 6px;
}
.weight-tap .unit { font-size: 1rem; color: var(--text-muted); font-family: var(--font-body); }

.plate-open-btn {
  margin-top: 8px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--accent);
  font-family: var(--font-display);
  font-stretch: condensed;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
}
.plate-open-btn:active { background: var(--accent-dim); }

/* Bottom sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 14, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(16px + env(safe-area-inset-bottom));
  animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 14px;
}
.sheet-close {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  font-family: var(--font-display);
  font-stretch: condensed;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 1rem;
}

/* "Load the bar" contents */
.plate-loader { min-height: 120px; }
.plate-loader-title {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  color: var(--accent);
  margin: 4px 0 6px;
}
.plate-loader-title .unit { font-size: 1rem; color: var(--text-muted); font-family: var(--font-body); }
.plate-loader-note { color: var(--text-muted); font-size: 0.9rem; line-height: 1.45; margin: 6px 0 16px; }
.plate-loader-warn {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 6px 0 10px;
}
.plate-diagram { display: block; width: 100%; height: auto; max-height: 190px; margin: 10px 0 14px; }
.plate-diagram .bar-sleeve,
.plate-diagram .bar-collar { fill: #9AA5AE; }
.plate-diagram .bar-shaft { fill: #6B7680; }
.plate-diagram .plate-rect { fill: var(--plate); stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.75; }
.plate-diagram .plate-text {
  fill: var(--plate-ink);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}
.plate-loader-sub { margin-bottom: 8px; }
.plate-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.plate-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 1rem;
}
.plate-chip-count { color: var(--text-muted); font-size: 0.85rem; }
.plate-math { color: var(--text-muted); font-size: 0.85rem; margin-top: 12px; }
.plate-edit-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
}

/* ---- Home: pre-filled "today" rows, each opens only if you tap Change ---- */
.pick-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.pick + .pick { border-top: 1px solid var(--border); }
.pick summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px;
  cursor: pointer;
}
.pick summary::-webkit-details-marker { display: none; }
.pick-label {
  width: 60px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pick-value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-change { color: var(--accent); font-size: 0.85rem; flex-shrink: 0; }
.pick[open] .pick-change { color: var(--text-muted); }
.pick-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.pick-body .settings-row-sub a { color: var(--accent); }

.resume-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--text);
  text-decoration: none;
}
.resume-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }

.btn-primary:disabled { opacity: 0.4; }

/* ---- Workout: what the engine changed for today ---- */
.adjustments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 20px 0;
}
.adjustments .label { width: 100%; }
.adjustment-chip {
  display: inline-block;
  max-width: 100%;
  line-height: 1.35;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
}

.flash {
  margin: 12px 20px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--success-dim);
  border: 1px solid var(--success);
  font-size: 0.9rem;
}

/* ---- Swap ---- */
.focus-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.swap-btn {
  flex-shrink: 0;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.swap-title { font-size: 1.5rem; margin: 4px 0 14px; }
.sheet-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
}
.sheet-option:active { border-color: var(--accent); }
.sheet-option-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.sheet-option-sub { color: var(--text-muted); font-size: 0.85rem; line-height: 1.35; }

.body-form { display: flex; flex-direction: column; gap: 10px; }

/* ---- Training style tiles (home picker, settings, onboarding) ---- */
.style-options { display: grid; grid-template-columns: 1fr; gap: 8px; }
.style-tile { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px; }
.style-tile-label { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.style-tile .tile-equip { margin-top: 0; }
@media (min-width: 520px) { .style-options { grid-template-columns: 1fr 1fr; } }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tile.chip { padding: 8px 12px; font-size: 0.85rem; border-radius: 999px; }

/* ---- Timed sets and circuits ---- */
.timer-btn {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timer-btn.running { background: var(--accent); color: #1A1006; }
.next-up { margin-top: 10px; color: var(--text-muted); font-size: 0.85rem; }

/* ---- Focus areas ---- */
.care-note {
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ---- AI coach ---- */
.coach-open-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 12px 20px 0;
  width: calc(100% - 40px);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
/* The coach's sitrep at the top of the workout (app/sitrep.py). */
.sitrep {
  margin: 12px 20px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  background: var(--surface);
}
.sitrep summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.sitrep summary::-webkit-details-marker { display: none; }
.sitrep summary::after { content: "▾"; margin-left: auto; color: var(--text-muted); font-size: 0.8rem; }
.sitrep[open] summary::after { content: "▴"; }
.sitrep-lines { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 12px 0 0; }
.sitrep-lines dt { padding-top: 2px; }
.sitrep-lines dd { margin: 0; display: grid; gap: 4px; }
.sitrep-lines p { margin: 0; font-size: 0.9rem; line-height: 1.4; }
.sitrep-go {
  margin-top: 12px; width: 100%; padding: 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--text);
  font-family: var(--font-display); font-weight: 700;
}
.coach-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.coach-open-sub { width: 100%; font-family: var(--font-body); font-weight: 400; font-size: 0.8rem; color: var(--text-muted); }

.coach-sheet { display: flex; flex-direction: column; height: 85vh; max-height: 85vh; }
.coach-head { display: flex; align-items: center; justify-content: space-between; }
.coach-head .heading { margin: 0; font-size: 1.4rem; }
.coach-close { background: none; border: none; color: var(--text-muted); font-size: 0.9rem; padding: 6px; }
.coach-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}
.chat-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
}
.chat-bubble.coach { align-self: flex-start; background: var(--surface-raised); border-bottom-left-radius: 4px; }
.chat-bubble.user { align-self: flex-end; background: var(--accent-dim); border: 1px solid var(--accent); border-bottom-right-radius: 4px; }
.chat-bubble.failed { opacity: 0.6; }
.chat-error { font-size: 0.85rem; color: var(--accent); padding: 4px 2px; }
.coach-form { display: flex; flex-direction: column; gap: 8px; }
.coach-form textarea { width: 100%; }
.coach-send { padding: 12px; font-size: 1rem; }
.coach-thinking { display: none; font-size: 0.85rem; color: var(--text-muted); }
.coach-thinking.htmx-request { display: block; }
.more-adjustments { display: flex; flex-wrap: wrap; gap: 6px; }
.more-adjustments[open] { width: 100%; }
.more-adjustments summary { list-style: none; cursor: pointer; color: var(--accent); }
.more-adjustments summary::-webkit-details-marker { display: none; }
.more-adjustments[open] summary { display: none; }

/* ---- Stats: summary + history ---- */
.summary-head { padding: 12px 20px 0; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px 20px; }
@media (min-width: 520px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.history-section .stat-tiles { padding: 8px 0 0; }
.stat-tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-value { font-family: var(--font-body); font-weight: 600; font-size: 1.6rem; color: var(--text); }
.stat-unit { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }
.summary-list { padding: 0 20px; }
.summary-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.summary-name { font-family: var(--font-display); font-weight: 700; margin-bottom: 4px; }
.summary-sets { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.text-danger-btn { background: none; border: none; color: var(--text-muted); font-size: 0.85rem; text-decoration: underline; }
.end-btn {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 6px 12px;
}
.history-section { padding: 10px 20px 6px; }
.history-link { text-decoration: none; }
.in-progress { color: var(--accent); }

/* Weekly volume: single-series column chart. Bars <=24px, 4px rounded top,
   square at the hairline baseline; per-bar tooltip on hover/focus. */
.week-chart {
  display: grid; grid-template-columns: repeat(8, 1fr); align-items: end;
  height: 150px; margin-top: 10px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border); position: relative;
}
.week-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
.week-bar { width: min(24px, 70%); min-height: 2px; background: var(--text-muted); opacity: 0.55; border-radius: 4px 4px 0 0; }
.week-bar.current { background: var(--accent); opacity: 1; }
.week-label { position: absolute; bottom: -20px; font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }
.week-value { font-size: 0.75rem; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.week-col:hover::after, .week-col:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--surface-raised); border: 1px solid var(--border); color: var(--text);
  font-size: 0.75rem; padding: 6px 8px; border-radius: 8px; white-space: nowrap; z-index: 5;
}
.week-col:first-child:hover::after, .week-col:first-child:focus::after { left: 0; transform: none; }
.week-col:last-child:hover::after, .week-col:last-child:focus::after { left: auto; right: 0; transform: none; }
.week-col:hover .week-bar { opacity: 1; }

/* ---- Pick-next, PRs, check-in, records ---- */
.list-hint { padding: 8px 20px 0; font-size: 0.75rem; color: var(--text-muted); }
.exercise-row.pickable { cursor: pointer; }
.exercise-row.pickable:hover, .exercise-row.pickable:focus { color: var(--text); outline: none; }
.row-right { display: inline-flex; align-items: center; gap: 10px; }
.add-set-btn {
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-raised); color: var(--accent); font-size: 0.75rem;
}
.focus-setlabel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-tip { margin-top: 8px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; border-left: 2px solid var(--accent-dim); padding-left: 10px; }
.effort-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.effort-hint { font-size: 0.68rem; text-transform: none; letter-spacing: 0; opacity: 0.8; }
.feedback-card {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  background: var(--surface-raised); border: 1px solid var(--border); font-size: 0.9rem; line-height: 1.4;
}
.feedback-card.in-overlay { max-width: 320px; margin: 0; text-align: left; }
.feedback-action {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent-dim); color: var(--accent); font-weight: 700; font-size: 0.85rem;
}
.rest-off { background: none; border: none; color: var(--text-muted); font-size: 0.8rem; text-decoration: underline; }
.pr-banner {
  margin: 12px 20px 0; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-dim); border: 1px solid var(--accent); font-weight: 600;
}
.complete-card .pr-banner { margin: 12px 0; }
.pr-badge { font-size: 0.65rem; font-weight: 700; color: #1A1006; background: var(--accent); border-radius: 4px; padding: 1px 4px; }
.checkin { margin: 4px 20px 8px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.checkin-q { font-size: 1.2rem; }
.checkin-options { display: flex; flex-wrap: wrap; gap: 8px; }
.checkin-btn { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); font-size: 0.9rem; }
.checkin-btn:active { border-color: var(--accent); }
.checkin-note summary { color: var(--accent); font-size: 0.85rem; cursor: pointer; }
.checkin-note textarea { width: 100%; margin-top: 8px; }
.checkin-done { margin: 4px 20px 8px; font-size: 0.9rem; color: var(--text-muted); }
.record-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.record-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.record-cols > div { display: flex; flex-direction: column; gap: 2px; }
.record-value { font-weight: 600; }
.record-date { font-size: 0.72rem; color: var(--text-muted); }

/* ---- WODs ---- */
.wod-card {
  margin: 12px 20px 0; padding: 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--accent);
  display: flex; flex-direction: column; gap: 10px;
}
.wod-head { display: flex; flex-direction: column; gap: 2px; }
.wod-name { margin: 0; font-size: 1.6rem; }
.wod-header { font-weight: 600; }
.wod-lines { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 0.95rem; }
.wod-about summary { color: var(--accent); font-size: 0.85rem; cursor: pointer; }
.wod-about p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.45; margin: 6px 0 0; }
.wod-timer { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wod-timer[hidden], .wod-timer-off[hidden], .wod-settings[hidden] { display: none; }
.wod-clock { font-size: 3.2rem; font-weight: 600; color: var(--accent); line-height: 1; }
.wod-clock-sub { font-size: 0.85rem; color: var(--text-muted); min-height: 1.2em; }
.wod-timer-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.wod-btn {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-raised); color: var(--text); font-size: 0.85rem; font-weight: 600;
}
.wod-btn.primary { background: var(--accent); border-color: var(--accent); color: #1A1006; }
.wod-settings { display: flex; flex-direction: column; gap: 8px; width: 100%; font-size: 0.85rem; color: var(--text-muted); }
.wod-settings input[type=number] { width: 80px; margin-left: 6px; background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
.wod-timer-off { font-size: 0.85rem; color: var(--text-muted); }
.link-btn { background: none; border: none; color: var(--accent); text-decoration: underline; font-size: inherit; padding: 0; }
.wod-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.wod-mode form { display: inline; }
.wod-done { border-top: 1px solid var(--border); padding-top: 10px; }
.wod-result-form { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 12px; }
.wod-result-form input[type=text], .wod-result-form input[type=number] {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  padding: 12px 14px; font-size: 1.1rem; width: 100%;
}
.wod-result-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wod-summary { margin: 8px 20px 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--accent); }
.wod-summary-score { font-size: 2rem; font-weight: 600; margin-top: 2px; }
.wod-summary .pr-banner { margin: 10px 0 0; }
.history-score { font-family: var(--font-body); font-weight: 400; font-size: 0.85rem; color: var(--accent); }
.wod-library { padding: 12px 20px 40px; display: flex; flex-direction: column; gap: 10px; }
.wod-lib-card { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.wod-lib-head { display: flex; flex-direction: column; gap: 2px; }
.wod-lib-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.wod-best { font-size: 0.85rem; }

/* ---- Supersets ---- */
.ss-tag { font-size: 0.62rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--accent); color: var(--accent); vertical-align: 1px; }
.sheet-group-label { font-size: 0.8rem; color: var(--text-muted); margin: 4px 0 8px; }
.sheet-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* ---- Accounts ---- */
.auth-form input[type=password], .body-form input[type=password] {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  padding: 12px 14px; font-size: 1rem;
}
.auth-form { gap: 12px; }
.account-details { margin-top: 8px; }
.account-details summary { color: var(--accent); font-size: 0.85rem; cursor: pointer; }
.account-details form { margin-top: 8px; }

/* ---- Onboarding v2: styles, body, gym, import ---- */
.style-like { display: flex; align-items: stretch; gap: 8px; padding: 0; }
.style-like-main { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; cursor: pointer; }
.fav-toggle {
  display: flex; align-items: center; padding: 0 12px; cursor: pointer; font-size: 0.78rem;
  color: var(--text-muted); border-left: 1px solid var(--border);
}
.fav-toggle span::before { content: "☆ "; font-size: 1rem; }
.fav-toggle:has(input:checked) { color: var(--accent); }
.fav-toggle:has(input:checked) span::before { content: "★ "; }
.style-like:not(.selected) .fav-toggle { opacity: 0.5; }
.style-divider { margin: 8px 0 2px; }
.body-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.body-tile { text-align: center; padding: 11px 8px; font-size: 0.88rem; }
.body-tile.wide { display: block; margin-top: 8px; }
.chip-input { display: flex; flex-direction: column; gap: 8px; }
.chip-input-row { display: flex; gap: 8px; }
.chip-input-row input[type=text] { flex: 1; min-width: 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list:empty { display: none; }
.chip-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px;
  background: var(--accent-dim); border: 1px solid var(--accent); font-size: 0.85rem;
}
.chip-item button { background: none; border: none; color: var(--text); font-size: 1rem; line-height: 1; padding: 0 4px; cursor: pointer; }
.import-how { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.import-how p { margin: 6px 0 8px; line-height: 1.45; }
.import-how[hidden], .import-upload[hidden] { display: none; }
.import-upload { display: flex; flex-direction: column; gap: 10px; }
.btn-secondary-link { text-align: center; color: var(--accent); font-size: 0.9rem; text-decoration: none; padding: 8px; }

/* Number boxes in forms match the text boxes (were unstyled browser defaults). */
.form-page input[type=number] {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  padding: 12px 10px; font-family: var(--font-body); font-size: 1rem; min-width: 0; width: 100%;
}
.form-page .tile-row.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }


/* ---- Workout screen v2 ---- */
.workout-clock-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;  /* pins below the status bar */
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 20px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.workout-clock { font-size: 1.35rem; font-weight: 600; color: var(--accent); }
.clock-switches { display: flex; gap: 6px; }
.switch {
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.75rem;
}
.switch::before { content: "Off · "; color: var(--text-muted); }
.switch.on { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.switch.on::before { content: "On · "; color: inherit; }

.logged-toast {
  margin: 12px 20px 0; padding: 10px 14px; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--success-dim); border: 1px solid var(--success); font-weight: 600; font-size: 0.9rem;
  animation: toast-in 0.35s ease-out;
}
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Runs and sprints: distance (with a unit picker) and time on the card. */
.dt-target { font-weight: 700; font-size: 1.05rem; margin: 2px 0 10px; color: var(--text); }
.dt-log { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 4px; }
.dt-field { display: flex; flex-direction: column; gap: 6px; }
.dt-label { font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.dt-inputs { display: flex; gap: 10px; align-items: stretch; }
.dt-num { flex: 1; min-width: 0; font-size: 1.9rem; font-weight: 700; padding: 10px 14px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.dt-unit { flex: none; width: 8.5em; font-size: 1rem; padding: 0 28px 0 10px; background-position: right 10px center; border-radius: 12px; background-color: var(--surface-raised); color: var(--text); border: 1px solid var(--border); }
.dt-watch { flex: none; width: 6.5em; border-radius: 12px; font-weight: 700; background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); }
.dt-watch.running { background: var(--accent); color: #fff; border-color: var(--accent); }

/* After a run done for time: how far did it go? (optional) */
.distance-card {
  margin: 8px 20px 0; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-raised); border: 1px solid var(--border); animation: toast-in 0.35s ease-out;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.distance-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.distance-form label { font-weight: 600; }
.distance-row { display: flex; align-items: center; gap: 10px; }
.distance-row input { width: 6.5em; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.distance-unit { flex: 1; }
.distance-save { width: auto; padding-inline: 18px; }
.distance-saved { font-weight: 600; font-variant-numeric: tabular-nums; }
#execution-panel.just-logged:not(.same-card) .focus-card { animation: card-next 0.4s ease-out; }
#execution-panel.just-logged.same-card .focus-card { animation: card-logged 0.7s ease-out; }
@keyframes card-logged {
  0% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
  30% { box-shadow: 0 0 0 3px var(--success), 0 0 28px var(--success-dim); transform: scale(1.015); }
  100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #execution-panel.just-logged:not(.same-card) .focus-card { animation: none; }
  #execution-panel.just-logged.same-card .focus-card { animation: card-logged-glow 0.7s ease-out; }
  @keyframes card-logged-glow { 30% { box-shadow: 0 0 0 3px var(--success); } }
}
@keyframes card-next { from { transform: translateX(24px); opacity: 0.3; } to { transform: none; opacity: 1; } }

.feedback-card.above { margin: 12px 20px 0; }
.feedback-about { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.feedback-action.quiet { background: none; border-color: var(--border); color: var(--text-muted); font-weight: 400; }

.menu-btn {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--text);
}
.set-actions { display: inline-flex; gap: 6px; }
/* Room between "+ set / Log all" and the name row's info and menu buttons below them. */
.focus-setlabel-row + .focus-name-row { margin-top: 10px; }

.stepper-input {
  width: 100%; min-width: 0; text-align: center; background: transparent; border: none; color: var(--text);
  font-size: inherit; -moz-appearance: textfield; appearance: textfield; padding: 0;
}
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.warmups { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.warmup-row { display: flex; flex-wrap: wrap; gap: 6px; }
.warmup-btn {
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-raised); color: var(--text); font-family: var(--font-mono); font-size: 0.85rem;
}
.warmup-btn.quiet { font-family: var(--font-body); color: var(--text-muted); background: none; }
.timer-note { margin-top: 6px; }
.effort-question { margin-top: 18px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }
.effort-question + .effort-row { margin-top: 8px; }

.plate-diagram .plate-text.small { font-size: 6px; }

.checkin-btn { cursor: pointer; }
.checkin-btn input { display: none; }
.checkin-btn:has(input:checked), .checkin-btn.selected { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.checkin textarea { width: 100%; }
.set-edit { display: inline-block; margin: 0 8px 6px 0; }
.set-edit summary {
  list-style: none; cursor: pointer; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.85rem;
}
.set-edit summary::-webkit-details-marker { display: none; }
.set-edit[open] summary { border-color: var(--accent); color: var(--text); }
.set-edit-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; font-size: 0.85rem; color: var(--text-muted); }
.set-edit-form input { width: 80px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 6px 8px; margin-left: 4px; }
.pattern-weight-card .reps-for { margin-top: 4px; }

/* ---- PT test prep ---- */
.pt-page { gap: 18px; }
.pt-card { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.pt-rows { display: flex; flex-direction: column; }
.pt-row { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pt-row:last-child { border-bottom: none; }
.pt-row-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pt-row-sub { display: flex; flex-direction: column; font-size: 0.75rem; color: var(--text-muted); }
.pt-row-sub strong { color: var(--text); font-weight: 600; }
.pt-row-sub strong.pt-fail { color: var(--accent); }
.pt-score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-score { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pt-score-num { font-size: 2.4rem; line-height: 1; color: var(--text); }
.pt-sex { grid-template-columns: 1fr 1fr; }
.pt-event { font-size: 0.9rem; }
.pt-points { font-size: 0.7rem; color: var(--text-muted); margin-left: 4px; }
.pt-values { text-align: right; white-space: nowrap; }
.pt-badge { font-family: var(--font-body); font-size: 0.7rem; padding: 2px 7px; border-radius: 999px; margin-left: 4px; }
.pt-badge.ok { background: var(--success-dim); color: var(--success); }
.pt-badge.warn { background: var(--accent-dim); color: var(--accent); }
.pt-fineprint a { color: var(--accent); }
.pt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-card label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-muted); }
.pt-card label.tile, .pt-card label.checkbox-line { flex-direction: row; }
.pt-card input[type=text], .pt-card input[type=number], .pt-card input[type=date] {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  padding: 10px 12px; font-size: 1rem; width: 100%; min-width: 0;
}
/* Dropdowns in a card match the card's text boxes. */
.pt-card select { background-color: var(--surface-raised); border-radius: 10px; }
.pt-history { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

/* ---- Theme picker ---- */
.theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-tile { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; }
.theme-swatch {
  width: 100%; height: 34px; border-radius: 10px; border: 2px solid; display: flex; align-items: center;
  justify-content: flex-end; padding-right: 8px;
}
.theme-swatch span { width: 16px; height: 16px; border-radius: 50%; }

/* several links on the right of a top bar */
.top-links { display: inline-flex; gap: 14px; }

/* ---- Tab bar: Home / History / Settings on every page ---- */
body.has-tabs .shell { padding-bottom: calc(68px + max(0px, env(safe-area-inset-bottom) - 18px)); }
.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  /* Labels sit just above the home indicator, like a native tab bar, not a
     full safe-area height above it. */
  padding: 6px 0 max(6px, env(safe-area-inset-bottom) - 18px);
}
/* The iPhone app: its web view can report less (or no) bottom inset than the
   home-screen web app, so it gets a fixed floor of room above the home bar. */
body.ios-app.has-tabs .shell { padding-bottom: calc(68px + max(20px, env(safe-area-inset-bottom) - 8px)); }
body.ios-app .tab-bar { padding-bottom: max(26px, env(safe-area-inset-bottom) - 8px); }
.tab-bar .tab {
  flex: 0 1 160px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-muted); text-decoration: none; font-size: 0.7rem; padding: 4px 0; min-height: 44px;
}
.tab-bar .tab.active { color: var(--accent); }
/* A tab tap answers at once (base.html): a thin bar along the top while the
   next page loads. It waits a beat, so a fast load never shows it. */
.nav-progress {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 3px; z-index: 1000;
  background: var(--accent); transform-origin: left; transform: scaleX(0); opacity: 0; pointer-events: none;
}
body.navigating .nav-progress { animation: nav-progress 2.5s cubic-bezier(0.1, 0.7, 0.3, 1) 0.12s forwards; }
@keyframes nav-progress { from { transform: scaleX(0); opacity: 1; } to { transform: scaleX(0.85); opacity: 1; } }
/* Page to page (iOS 18.2+, Chrome): the tab bar stays put and the page under
   it swaps with a quick fade instead of a blink. */
@view-transition { navigation: auto; }
.tab-bar { view-transition-name: tab-bar; }
::view-transition-old(tab-bar) { display: none; }
::view-transition-new(tab-bar) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.15s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---- Buttons: anything tappable looks tappable ----
   Primary = filled (.btn-primary). Secondary = outlined in the accent color.
   Compact = the same, smaller, for actions inside a row. Quiet = outlined in
   the border color (navigation). Danger = outlined red. */
:root { --danger: #E5534B; }
.btn-secondary, .add-link, .btn-secondary-link, .settings-row-actions a, .settings-row-actions button,
.account-details > summary, .pick-change, .link-btn, .plate-edit-link, .rest-off, .wizard-back,
.text-danger-btn, .skip-rest, .top-bar a.label, .top-links a.label {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 14px; border-radius: 10px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; font-stretch: normal;
  text-transform: none; letter-spacing: normal; text-decoration: none;
  cursor: pointer; white-space: nowrap; line-height: 1.2;
  transition: background 0.12s ease;
}
.btn-secondary:active, .add-link:active, .btn-secondary-link:active, .settings-row-actions a:active,
.settings-row-actions button:active, .account-details > summary:active, .pick-change:active, .link-btn:active,
.plate-edit-link:active, .rest-off:active, .wizard-back:active, .skip-rest:active { background: var(--accent-dim); }
/* full-width secondary actions ("+ Add location", "See your history") */
.add-link, .btn-secondary-link {
  display: flex; width: 100%; min-height: 46px; font-size: 0.95rem; white-space: normal; text-align: center;
  margin: 8px 0 20px; box-sizing: border-box;
}
/* navigation in the top bars: quieter, but still a button */
.top-bar a.label, .top-links a.label {
  min-height: 32px; padding: 5px 12px; font-size: 0.75rem; font-weight: 600;
  border-color: var(--border); background: var(--surface); color: var(--text);
}
/* disclosure toggles ("Change my password") read as buttons, not text */
.account-details > summary { list-style: none; display: inline-flex; margin-top: 4px; }
.account-details > summary::-webkit-details-marker { display: none; }
.account-details[open] > summary { border-color: var(--border); color: var(--text-muted); }
/* "Change" on the home rows */
.pick-change { min-height: 30px; padding: 4px 12px; font-size: 0.8rem; }
.pick[open] .pick-change { border-color: var(--border); color: var(--text-muted); }
.link-btn, .rest-off { min-height: 30px; padding: 4px 12px; font-size: 0.8rem; }
.rest-off, .wizard-back { border-color: var(--border); color: var(--text); }
.wizard-back:disabled { opacity: 0.3; }
.skip-rest { min-height: 44px; padding: 10px 22px; font-size: 0.95rem; }
/* destructive */
.text-danger-btn, .settings-row-actions .danger { border-color: var(--danger); color: var(--danger); }
.text-danger-btn:active, .settings-row-actions .danger:active { background: rgba(229, 83, 75, 0.12); }
/* links inside sentences: visibly links */
.settings-row-sub a:not([class]), .setup-sub a:not([class]), p a:not([class]) { color: var(--accent); text-decoration: underline; }
.pick-value.empty { color: var(--text-muted); font-family: var(--font-body); font-size: 0.95rem; }

/* "This costs the owner money" notice on AI features (AI_COST_NOTICE) */
.ai-cost {
  display: block; margin-top: 6px; padding: 6px 10px; border-radius: 8px;
  background: rgba(229, 83, 75, 0.12); border: 1px solid rgba(229, 83, 75, 0.35);
  color: var(--text); font-size: 0.75rem; line-height: 1.35; text-align: left; font-weight: 500;
}
.coach-open-btn .ai-cost { flex-basis: 100%; }

/* ---- Checkboxes are on/off switches everywhere ---- */
.checkbox-line { color: var(--text); line-height: 1.35; cursor: pointer; }
.checkbox-line input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; margin: 0; cursor: pointer;
  width: 44px; height: 26px; border-radius: 999px; position: relative;
  background: var(--surface-raised); border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.checkbox-line input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-muted); transition: transform 0.15s ease, background 0.15s ease;
}
.checkbox-line input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.checkbox-line input[type="checkbox"]:checked::after { transform: translateX(18px); background: #fff; }
.checkbox-line input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a switch with a title and details, as a card (the AI build option) */
.toggle-card {
  flex-direction: row-reverse; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 14px 16px; margin: 4px 0 8px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.toggle-card:has(input:checked) { border-color: var(--accent); }
.toggle-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.toggle-card-title { font-weight: 600; font-size: 1rem; }

/* native controls (scrollbars, date pickers) match the theme */
:root { color-scheme: dark; }
[data-theme="daylight"] { color-scheme: light; }

/* ---- Records: search, filters, trends, charts ---- */
.records-tools { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.records-search {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px; font-size: 1rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.records-search:focus { outline: none; border-color: var(--accent); }
.records-areas { flex-wrap: wrap; gap: 6px; }
.records-areas .chip { flex-shrink: 0; }
.records-sort { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); }
.records-sort select {
  background-color: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 30px 7px 10px; background-position: right 10px center; font-size: 0.85rem;
}
.record-link { display: block; text-decoration: none; color: inherit; }
.record-link:active { background: var(--surface); }
.record-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.record-trend .sparkline { width: 90px; height: 28px; display: block; }
.sparkline path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sparkline circle { fill: var(--accent); }
.records-featured { margin: 4px 0 18px; }
.featured-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
@media (min-width: 440px) { .featured-grid { grid-template-columns: 1fr 1fr; } }
.featured-card {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: inherit;
}
.featured-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.featured-name { font-weight: 600; }
.featured-change { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.featured-change.up { color: var(--success); }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--text-muted); font-size: 10px; font-family: var(--font-body); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart-dot.best { fill: var(--success); }
.chart-bar { fill: var(--accent); opacity: 0.85; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); margin-top: -8px;
  background: var(--surface-raised); border: 1px solid var(--border); color: var(--text);
  font-size: 0.75rem; padding: 5px 8px; border-radius: 8px; white-space: nowrap;
}
.chart-card { padding: 14px; margin: 12px 0; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; }
.range-chips { margin-top: 14px; }
.range-chips .chip { text-decoration: none; min-width: 56px; text-align: center; }
.record-session { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.record-detail .stat-tiles { margin-top: 4px; }

.form-result { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; font-size: 0.85rem; }
.form-result.ok { background: var(--success-dim); color: var(--success); }
.form-result.bad { background: rgba(229, 83, 75, 0.12); color: var(--danger); border: 1px solid rgba(229, 83, 75, 0.35); }

/* ---- The set's numbers: big, and adjusted in place ---- */
.adjust-row { display: flex; align-items: flex-start; justify-content: center; gap: 2px; margin: 12px -6px 8px; }
.adjust-field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.adjust-controls { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; }
.adjust-row input.adjust-num {
  width: 100%; min-width: 0; max-width: 96px; padding: 2px 0; box-sizing: border-box;
  background: transparent; border: none; border-bottom: 2px solid var(--border); border-radius: 0;
  color: var(--accent); font-family: var(--font-mono); font-size: 2rem; font-weight: 600; text-align: center; letter-spacing: -0.03em;
}
.adjust-row input.adjust-num:focus { outline: none; border-bottom-color: var(--accent); background: var(--accent-dim); border-radius: 8px 8px 0 0; }
.adjust-row input.adjust-num::placeholder { color: var(--text-muted); opacity: 0.45; }
.adjust-btn {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); font-size: 1.25rem; line-height: 1;
}
.adjust-btn:active { background: var(--accent-dim); border-color: var(--accent); }
.adjust-unit { font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.adjust-field.optional .adjust-unit { font-style: italic; }
.adjust-x { color: var(--accent); font-size: 1.3rem; padding-top: 12px; flex-shrink: 0; }
.adjust-row + .plate-open-btn { align-self: center; margin: 0 auto 6px; display: flex; }
.btn-primary.busy { opacity: 0.75; font-size: 0.95rem; }

/* ---- Reviewing a finished movement ---- */
.exercise-row.reviewable { cursor: pointer; }
.exercise-row.reviewable > span:first-child::after { content: " ›"; color: var(--text-muted); }
.review-back { margin: 4px 0 10px; }
.review-card { gap: 10px; }
.review-set { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.review-set-what { font-size: 0.9rem; }
.review-efforts .effort-btn { padding: 8px 4px; font-size: 0.85rem; }
.adjust-row input.adjust-num.long { font-size: 1.55rem; }
.adjust-field + .adjust-x + .adjust-field { flex-grow: 1.25; }

.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 20px 0; }
.list-tools .list-hint { padding: 0; }
.list-tool-btn { min-height: 32px; padding: 5px 12px; font-size: 0.8rem; flex-shrink: 0; }
.superset-picks { margin: 10px 0 14px; }

/* ---- ⓘ how-to on the movement card ---- */
/* The (i) and the menu sit on the exercise name's first line (1.7rem x 1.15
   = ~31px tall), centered on it, however many lines the name wraps to. */
.info-btn {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 5px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1.5px solid var(--text-muted); background: transparent; color: var(--text-muted);
  font: italic 700 0.75rem Georgia, serif; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.focus-name-row .menu-btn { width: 32px; height: 32px; margin-top: 0; border-radius: 10px; }
.focus-name-row .menu-btn svg { width: 18px; height: 18px; }
.info-btn.open, .info-btn:active { border-color: var(--accent); color: var(--accent); }
.focus-name-row { display: flex; align-items: flex-start; gap: 8px; }
.focus-name-row .focus-name { flex: 1; min-width: 0; }
/* The (i) panel opens smoothly: a 0fr -> 1fr grid row animates its height
   (no fixed max-height to guess), with a fade and a small slide. */
.move-info {
  display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(-4px); margin: 0;
  transition: grid-template-rows 0.28s ease, opacity 0.22s ease, transform 0.28s ease, margin 0.28s ease;
}
.move-info.open { grid-template-rows: 1fr; opacity: 1; transform: none; margin: 4px 0 8px; }
.move-info-clip { overflow: hidden; min-height: 0; }
.move-info-box {
  padding: 12px 14px; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--border);
  font-size: 0.88rem; line-height: 1.45; display: flex; flex-direction: column; gap: 8px;
}
.move-info-box p { margin: 0; }
.move-info-box .btn-secondary { align-self: flex-start; }
.info-btn { transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.info-btn.open { background: var(--accent-dim); }
@media (prefers-reduced-motion: reduce) {
  .move-info, .info-btn { transition: none; }
}

.rec-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: middle;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  background: var(--accent); color: #1A1006;
}
.rec-badge[hidden] { display: none; }

/* ---- Onboarding intro: what's coming ---- */
.intro-steps { list-style: none; counter-reset: step; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.intro-steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: baseline; }
.intro-steps li::before {
  content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-dim); color: var(--accent); font-weight: 700; font-size: 0.85rem; align-self: start;
}
.intro-steps strong { font-weight: 600; }
.intro-steps span { font-size: 0.85rem; color: var(--text-muted); }
.setup.onboarding-intro { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 120px); box-sizing: border-box; }

/* ---- Build a Superset: picking in the list ---- */
.ss-check { display: none; }
.ss-picking .ss-check {
  display: inline-block; width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; border-radius: 5px;
  border: 2px solid var(--text-muted); box-sizing: border-box;
}
.ss-picking .exercise-row.ss-selected .ss-check { background: var(--accent); border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--surface); }
.ss-picking .exercise-row.ss-eligible { cursor: pointer; }
.ss-picking .exercise-row:not(.ss-eligible) { opacity: 0.4; }
.ss-picking .exercise-row.ss-selected { color: var(--accent); }
.ss-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 20px 4px; }
.ss-bar[hidden] { display: none; }

/* Coach: a message on its way shows straight away, marked as sending. */
.chat-bubble.user.pending { opacity: 0.75; }
.chat-bubble.user.pending::after { content: "Sending…"; display: block; margin-top: 4px; font-size: 0.7rem; opacity: 0.8; }
.chat-bubble.user.failed::after { content: "Didn't send. Your text is back in the box; tap Send to try again."; display: block; margin-top: 4px; font-size: 0.7rem; }

/* ---- How much a limitation limits you (1-5) ---- */
.sev-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0; }
.sev-row { background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; padding: 12px;
           display: flex; flex-direction: column; gap: 8px; }
.sev-row[hidden] { display: none; }
.sev-name { font-weight: 600; font-size: 0.95rem; }
.sev-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sev-lvl { display: grid; place-items: center; padding: 9px 0; border-radius: 10px; cursor: pointer;
           font: 700 1.05rem var(--font-mono); background: var(--surface-raised); border: 1px solid var(--border); color: var(--text); }
.sev-lvl input { position: absolute; opacity: 0; pointer-events: none; }
.sev-lvl.on { background: var(--accent); border-color: var(--accent); color: #1A1006; }
.sev-lvl:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sev-ends { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted); }
.sev-meaning { font-weight: 600; font-size: 0.9rem; }
.sev-changes { display: flex; flex-direction: column; gap: 5px; font-size: 0.84rem; border-top: 1px solid var(--border); padding-top: 8px; }
.sev-change { display: grid; grid-template-columns: 62px 1fr; gap: 8px; }
.sev-change b { font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; padding-top: 2px; }
.sev-change.out b { color: var(--danger); } .sev-change.light b { color: #F2C14E; } .sev-change.in b { color: var(--success); }

/* the 3-2-1 before a timed set */
.adjust-row input.adjust-num.get-set { color: var(--text); }

/* the answered check-in, folded to one line */
.checkin[hidden], .checkin-compact[hidden] { display: none; }
.checkin-compact {
  margin: 4px 20px 8px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.checkin-compact-text { font-size: 0.9rem; min-width: 0; }
.checkin-compact-text strong { color: var(--success); margin-right: 6px; }
.checkin-compact-note { color: var(--text-muted); }
.checkin-edit { min-height: 32px; padding: 4px 12px; font-size: 0.8rem; flex-shrink: 0; }
.checkin-compact.just-saved { animation: checkin-fold 0.6s ease-out; }
@keyframes checkin-fold { from { transform: scaleY(1.6); opacity: 0.4; border-color: var(--success); } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .checkin-compact.just-saved { animation: none; } }
.ok-text { color: var(--success); }

/* ---- Sign in with Google / Apple / Facebook ---- */
.signin-providers { display: flex; flex-direction: column; gap: 8px; }
.signin-btn {
  display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; border: 1px solid var(--border);
}
.signin-google { background: #ffffff; color: #1f1f1f; }
.signin-apple { background: #000000; color: #ffffff; border-color: #3a3a3a; }
.signin-facebook { background: #1877F2; color: #ffffff; border-color: #1877F2; }
.signin-or { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.78rem; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.danger-summary { border-color: var(--danger) !important; color: var(--danger) !important; }
.legal section { display: flex; flex-direction: column; gap: 8px; }
.legal h2 { font-size: 1.05rem; margin: 0; }
.legal p { margin: 0; line-height: 1.55; color: var(--text); max-width: 62ch; }

/* ---- App usage (admin) ---- */
.deploy-banner { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; margin-top: 6px; font-size: 0.9rem; }
.deploy-banner.ok { background: var(--success-dim); color: var(--success); }
.deploy-banner.wait { background: rgba(229, 83, 75, 0.12); border: 1px solid rgba(229, 83, 75, 0.4); color: var(--text); }
.deploy-banner.wait strong { color: var(--danger); }
.usage-table-wrap { overflow-x: auto; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.usage-table th { text-align: left; font-weight: 600; font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding: 6px 6px 8px; }
.usage-table td { padding: 9px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.usage-table td.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* the test copy of the app says so on every page */
.staging-banner {
  position: sticky; top: 0; z-index: 45; text-align: center; padding: 4px 8px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; background: repeating-linear-gradient(45deg, #F2C14E 0 12px, #E0A92E 12px 24px); color: #1A1006;
}
.staging-banner a { color: inherit; text-decoration: underline; }

/* ---- PT mode (pt_home.html) ---- */
.saved-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--success-dim); color: var(--success); font-size: 0.85rem; }
.pt-hero { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.pt-days { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.pt-days small { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.pt-week-now { margin-top: 8px; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.pt-ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.pt-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pt-ring-track { fill: none; stroke: var(--surface-raised); stroke-width: 9; }
.pt-ring-fill { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; }
.pt-ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pt-ring-num b { font-size: 1.5rem; }
.pt-ring-empty { max-width: 130px; text-align: right; }
.pt-ev { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pt-ev:last-of-type { border-bottom: none; }
.pt-ev.focus .pt-ev-name { color: var(--accent); }
.pt-ev-name { font-size: 0.9rem; font-weight: 600; }
.pt-ev-val { font-size: 0.9rem; white-space: nowrap; }
.pt-ev-val b.pt-fail { color: var(--accent); }
.pt-ev-bar { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 3px; background: var(--surface-raised); }
.pt-ev-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.pt-ev-bar span { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-muted); }
.pt-ev-next { grid-column: 1 / -1; }
.pt-weekhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pt-list, .pt-days-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pt-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.pt-list li:last-child { border-bottom: none; }
.pt-start { display: flex; flex-direction: column; gap: 8px; }
.pt-start select { background-color: var(--surface-raised); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 9px 30px 9px 10px; background-position: right 10px center; font-size: 0.9rem; }
.pt-weeks { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.pt-wk { text-align: center; font: 600 0.72rem var(--font-mono); padding: 7px 0; border-radius: 6px; background: var(--surface-raised); color: var(--text-muted); border: 1px solid transparent; }
.pt-wk.done { background: var(--accent-dim); color: var(--accent); }
.pt-wk.now { background: var(--accent); color: var(--bg); }
.pt-wk.mock:not(.now), .pt-wk.test:not(.now) { border-color: var(--accent); }
.pt-phases { display: grid; grid-template-columns: 1fr 2fr 1fr 3fr 1fr 3fr 1fr; gap: 3px; font-size: 0.62rem; color: var(--text-muted); text-align: center; }
.pt-legend { display: flex; gap: 14px; }
.pt-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pt-legend .l-done::before { background: var(--accent-dim); }
.pt-legend .l-now::before { background: var(--accent); }
.pt-legend .l-mock::before { border: 1px solid var(--accent); }
.pt-days-list li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; padding: 6px 0; font-size: 0.88rem; }
.pt-days-list li.done { opacity: 0.6; }
.pt-days-list li.next b { color: var(--accent); }
.pt-check { color: var(--accent); font-weight: 700; }
.pt-pass-line { stroke: var(--danger, #E5534B); stroke-dasharray: 4 4; }
.pt-goal-line { stroke: var(--success); stroke-dasharray: 4 4; }
.chart-label { fill: var(--text); font-size: 10px; }
.pt-log summary { list-style: none; cursor: pointer; text-align: center; }
.pt-log summary::-webkit-details-marker { display: none; }
.pt-log form { margin-top: 10px; }
.pt-tag { font: 700 0.62rem var(--font-body); letter-spacing: 0.06em; padding: 2px 6px; border-radius: 6px; background: var(--accent-dim); color: var(--accent); vertical-align: 2px; }
.history-filter { margin: 4px 0 10px; }
.pt-standards-link { text-align: center; }
.pt-std { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.pt-std th, .pt-std td { text-align: left; padding: 8px 6px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.pt-std thead th { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.pt-std tbody th { font-weight: 600; }
.pt-std tr:last-child th, .pt-std tr:last-child td { border-bottom: none; }
.pt-std td { white-space: nowrap; }
.pt-std tr.yours th { color: var(--accent); }
.pt-std { table-layout: fixed; }
.pt-std th:first-child { width: 44%; }

/* Style picker: a style's variants (small chips + the chosen one's blurb), shown once it's liked */
.style-variants { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.style-like:not(.selected) .style-variants { display: none; }
.style-variant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.style-variant { padding: 6px 11px; border-radius: 999px; font-size: 0.8rem; color: var(--text-muted);
  background: var(--surface-raised); border: 1px solid var(--border); cursor: pointer; }
.style-variant input { position: absolute; opacity: 0; pointer-events: none; }
.style-variant.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.style-variant:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Typed fields: the theme's accent on focus, not the browser's blue */
textarea:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="search"]:focus { outline: none; border-color: var(--accent); }
.feedback-kinds { grid-template-columns: repeat(3, 1fr); }
.feedback-kinds .style-tile { text-align: center; padding: 10px 8px; }
.feedback-kinds .style-tile-label { font-size: 0.85rem; }
.feedback-item { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.feedback-msg { white-space: pre-wrap; font-size: 0.9rem; }
/* "How much do you weigh?": typed, any value (182.4) */
.weigh-in { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
label.weigh-in input[type="number"] { width: 7ch; flex: none; -moz-appearance: textfield; appearance: textfield; text-align: center; font: 700 2.4rem var(--font-mono); padding: 10px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
label.weigh-in input[type="number"]:focus { outline: none; border-color: var(--accent); }
label.weigh-in input::-webkit-outer-spin-button, label.weigh-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.weigh-in .unit { color: var(--text-muted); font-size: 1rem; }
.birth-row { display: grid; grid-template-columns: 3fr 2fr; gap: 8px; }
.birth-row select { background-color: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 36px 12px 14px; font-size: 1rem; font-family: var(--font-body); }
.birth-row select:focus { outline: none; border-color: var(--accent); }
.pt-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-dim); color: var(--text); font-size: 0.85rem; line-height: 1.45; }
.pt-note a, .pt-note strong { color: var(--accent); }

/* ---- Home: This Week strip, Today's Workout preview ---- */
.week-strip { display: flex; flex-direction: column; gap: 10px; }
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.wday-name { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.wday-mark { height: 1.1em; font-weight: 700; color: var(--accent); line-height: 1.1; }
.wday-label { font-size: 0.66rem; color: var(--text); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wday.done { background: var(--accent-dim); }
.wday.today { border-color: var(--accent); }
.wday.today .wday-name { color: var(--accent); }
.wday.planned .wday-label, .wday.rest .wday-label, .wday.off .wday-label { color: var(--text-muted); }
.wday.planned { border-style: dashed; }
button.wday { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.wday:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The open day: filled and raised a little, so it's clear which day the panel below shows. */
.wday[aria-pressed="true"] { background: var(--accent-dim); border: 2px solid var(--accent); padding: 7px 1px; transform: translateY(-2px); }
.wday[aria-pressed="true"] .wday-name, .wday[aria-pressed="true"] .wday-label { color: var(--text); font-weight: 700; }
.wday-panel { min-height: 1.2em; }
.wday-hint { margin: 0; text-align: center; }
.wday-detail { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--accent); }
.wday-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wday-detail-sub { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.wday-detail p { margin: 0; }
.wday-close { background: none; border: none; color: var(--text-muted); font-size: 1rem; padding: 4px 6px; cursor: pointer; }
.wday-open { font: inherit; font-size: 0.85rem; color: var(--accent); font-size: 0.85rem; text-decoration: none; align-self: flex-start; background: none; border: none; padding: 2px 0; cursor: pointer; }
.week-behind { display: flex; flex-direction: column; gap: 6px; }
.week-behind-n { color: var(--text-muted); font-size: 0.75rem; margin-left: 4px; }
.preview-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.deload-tag { margin: 8px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--accent-dim); border: 1px solid var(--accent);
  font-size: 0.85rem; color: var(--text); }
.deload-tag strong { color: var(--accent); }
.deload-tag.next { background: transparent; border-style: dashed; }
.preview-wod { font-weight: 700; }
.preview-flash { font-size: 0.8rem; color: var(--success); }
.preview-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.preview-list li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name actions" "amount actions";
  column-gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.preview-list li:last-child { border-bottom: none; }
.preview-name { grid-area: name; font-size: 0.92rem; }
.preview-amount { grid-area: amount; font-size: 0.78rem; color: var(--text-muted); }
.preview-actions { grid-area: actions; display: flex; gap: 6px; }
.preview-btn { background: var(--surface-raised); color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 9px; font-size: 0.75rem; cursor: pointer; }
.preview-btn:active { color: var(--accent); border-color: var(--accent); }
.preview-note { font-size: 0.75rem; }
.wod-link { text-align: center; color: var(--accent); font-size: 0.9rem; text-decoration: none; padding: 2px 0 6px; }

/* Finish screen: the last set's toast and tip clear themselves out of the way. */
.fade-away { animation: fade-away 0.6s ease 4s forwards; overflow: hidden; }
@keyframes fade-away { to { opacity: 0; max-height: 0; margin: 0; padding: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .fade-away { animation-duration: 0.01s; } }
.fade-away { max-height: 400px; }
.more-btn { margin-top: 6px; }
.week-plan summary { list-style: none; cursor: pointer; text-align: center; }
.week-plan summary::-webkit-details-marker { display: none; }
.week-plan[open] summary { margin-bottom: 10px; }
.week-plan:not([open]) .week-plan-btn::after { content: " ›"; }
.did-it { margin: -4px 0 6px; }
.did-it .btn-secondary-link { width: 100%; font-size: 0.85rem; padding: 4px; }
.brand-top { padding: 28px 20px 0; }
.did-it .btn-secondary-link { border: none; background: none; box-shadow: none; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.preview-wodcard { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-raised); }
.preview-wodlines { margin: 2px 0 0; padding-left: 18px; font-size: 0.9rem; display: flex; flex-direction: column; gap: 2px; }
.preview-wod-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
/* Home's header: the logo, small, above "Ready when you are." */
.home-brand { margin-bottom: 10px; }
.home-brand .brand { gap: 9px; }
.preview-suggest { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; border: 1px dashed var(--accent); margin-top: 4px; }
.preview-btn.primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); font-weight: 600; }
.app-version { text-align: center; color: var(--text-muted); font-size: 0.75rem; padding: 8px 20px 24px; margin: 0; }

/* ---- Groups and leaderboards ---- */
.group-list { display: flex; flex-direction: column; gap: 8px; }
.group-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.group-card-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.board-tabs { margin-bottom: 4px; }
.board-tabs a { text-decoration: none; }
.board-metrics { gap: 14px; margin: 2px 0 6px; }
.board-metric { font-size: 0.82rem; color: var(--text-muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.board-metric.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.board-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.board-row:last-child { border-bottom: none; }
.board-row.me { background: var(--accent-dim); border-radius: 10px; }
.board-rank { color: var(--text-muted); font-weight: 700; text-align: center; }
.board-row:nth-child(1) .board-rank { color: var(--accent); }
.board-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-you { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.board-value { font-weight: 700; white-space: nowrap; }
.board-wod { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.board-wod:last-child { border-bottom: none; }
.board-wod-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.board-lane { margin-top: 4px; }
.invite-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.invite-row input { min-width: 0; }
.join-code { font-size: 1.05rem; letter-spacing: 0.12em; color: var(--text); }
.member-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.member-actions { display: flex; gap: 12px; }
.member-actions form { margin: 0; }
.link-btn.danger, .btn-secondary-link.danger { color: var(--danger, #E5534B); }

/* ---- New-user tour (static/tour.js) ---- */
.tour-spot { position: fixed; z-index: 900; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.62);
  border: 2px solid var(--accent); pointer-events: none; transition: all 0.2s ease; }
.tour-tip { position: fixed; z-index: 901; width: min(340px, calc(100vw - 24px)); padding: 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  display: flex; flex-direction: column; gap: 8px; }
.tour-count { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.tour-title { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.tour-text { margin: 0; font-size: 0.92rem; line-height: 1.45; color: var(--text); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tour-skip { margin-right: auto; background: none; border: none; color: var(--text-muted); font-size: 0.85rem; padding: 8px 0; cursor: pointer; }
.tour-back, .tour-next { border-radius: 10px; padding: 9px 16px; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.tour-back { background: none; border: 1px solid var(--border); color: var(--text); }
.tour-next { background: var(--accent); border: 1px solid var(--accent); color: #FFFFFF; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* ---------- AoA AI: Offline | AI switch and AI Home (docs/AI_EXPERIENCE.md) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-brand:has(.exp-switch-wrap) { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exp-switch-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.exp-switch { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.exp-switch button { min-height: 32px; padding: 0 14px; border: none; border-radius: 999px; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.exp-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.exp-switch button[aria-pressed="true"]:last-child { background: var(--accent); color: #FFFFFF; }
.exp-cue { font-size: 0.72rem; color: var(--text-muted); }
.ai-today { display: flex; flex-direction: column; gap: 12px; }
.coach-note-row { display: flex; gap: 10px; align-items: flex-start; }
.coach-avatar { flex: none; width: 30px; height: 30px; border-radius: 999px; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center; color: var(--text); }
.coach-avatar .brand-mark { display: block; }
.coach-note { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface);
  border: 1px solid var(--border); font-size: 1rem; line-height: 1.45; animation: note-in 0.25s ease-out; }
@keyframes note-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 999px; background: var(--text-muted); animation: typing 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.home-log { display: flex; flex-direction: column; gap: 8px; max-height: none; padding: 0; overflow: visible; }
.home-log:empty { display: none; }
.ai-replies { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-reply { min-height: 36px; padding: 0 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.ai-reply:active { border-color: var(--accent); }
.ai-say { display: flex; gap: 8px; align-items: center; padding: 5px 5px 5px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); }
.ai-say:focus-within { border-color: var(--accent); }
.ai-say input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--text); font: inherit; font-size: 0.95rem; outline: none; padding: 0; min-height: 0; }
.ai-send { flex: none; width: 38px; height: 38px; border-radius: 999px; border: none; background: var(--accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ai-reply:disabled, .ai-send:disabled { opacity: 0.5; }
.ai-setup { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.ai-setup > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.ai-setup > summary::-webkit-details-marker { display: none; }
.ai-setup .pick-list { border: none; border-top: 1px solid var(--border); border-radius: 0 0 14px 14px; }
.exp-options { display: flex; flex-direction: column; gap: 10px; }
.exp-option { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.exp-option .style-tile-label { font-size: 1.1rem; }
.exp-option ul { margin: 2px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 0.88rem; line-height: 1.45; }

/* ---------- Moved to a new address (base.html) ---------- */
.moved-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--accent-dim);
  border-bottom: 1px solid var(--accent); color: var(--text); }
.moved-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; font-size: 0.85rem; line-height: 1.35; }
.moved-text strong { font-size: 0.95rem; }
.moved-btn { flex: none; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #FFFFFF; font-weight: 700;
  font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.moved-close { flex: none; align-self: flex-start; width: 32px; height: 32px; border: none; background: transparent; color: var(--text-muted);
  font-size: 1rem; cursor: pointer; }
.moved-banner form { flex: none; margin: 0; }
button.moved-btn { border: none; cursor: pointer; font-family: inherit; }
.moved-banner.arrived { background: var(--success-dim); border-bottom-color: var(--success); }
.moved-banner .moved-phone, .moved-banner .moved-desktop { display: none; }
.moved-banner.is-phone .moved-phone, .moved-banner.is-desktop .moved-desktop { display: block; }

/* ---------- AoA Pro (pro.html, upgrade prompts) ---------- */
.pro-badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; background: var(--accent); color: #FFFFFF; vertical-align: middle; }
.coach-open-btn.locked { text-decoration: none; opacity: 0.92; }
.pro-upsell { text-decoration: none; color: inherit; }
.pro-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.pro-list li { display: flex; flex-direction: column; gap: 2px; }
.pro-list li span:not(.pro-soon) { color: var(--text-muted); font-size: 0.9rem; }
.pro-soon { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.pro-plans { display: grid; gap: 12px; }
@media (min-width: 640px) { .pro-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pro-plan { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.pro-plan.best { border-color: var(--accent); }
.pro-plan-name { font-weight: 700; }
.pro-plan-price { font-size: 1.8rem; font-weight: 700; }
.pro-plan-price small { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.pro-plan button { margin-top: 6px; }
.btn-link-primary { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: #FFFFFF; font-weight: 700; text-decoration: none; }

/* ---- "Add an exercise": the catalog sheet ---- */
.add-exercise-btn { width: 100%; margin: 10px 0 4px; padding: 12px; border-radius: 12px; border: 1px dashed var(--border);
  background: transparent; color: var(--accent); font-weight: 700; font-size: 0.95rem; }
.add-exercise-btn:active { border-color: var(--accent); }
.catalog-sheet { display: flex; flex-direction: column; gap: 10px; height: 88vh; }
.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.catalog-head .swap-title { margin: 0; }
.catalog-search { width: 100%; font-size: 1.05rem; padding: 12px 14px; border-radius: 12px; }
.catalog-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.catalog-chips::-webkit-scrollbar { display: none; }
.catalog-chip { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-raised);
  color: var(--text); font-size: 0.85rem; font-weight: 600; }
.catalog-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.catalog-allgear { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); }
.catalog-allgear input { width: auto; }
.catalog-pick { flex: none; }
.catalog-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.catalog-list li[hidden] { display: none; }
.catalog-item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 11px 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); }
.catalog-item:active { border-color: var(--accent); }
.catalog-name { font-weight: 700; }
.catalog-meta { font-size: 0.8rem; color: var(--text-muted); }
.catalog-why { color: var(--accent); }
.catalog-today { font-size: 0.72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; margin-left: 4px; }
.coffee-btn { align-self: flex-start; text-decoration: none; }

/* ---- coach memory (docs/COACH_MEMORY.md) ---- */
.coach-reply {
  margin: 4px 20px 8px; padding: 12px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); display: flex; flex-direction: column; gap: 8px;
}
.coach-reply p { margin: 0; line-height: 1.45; }
.coach-saved { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0;
  font-size: 0.84rem; color: var(--text-muted); }
.coach-saved button { flex-shrink: 0; }
.coach-upsell { margin: 0 20px 8px; }
.memory-item.expired .settings-row-title { color: var(--text-muted); }
.memory-item { flex-wrap: wrap; }
.memory-edit { flex-basis: 100%; }
.memory-edit[open] form { margin-top: 8px; }
.memory-edit summary { cursor: pointer; list-style: none; }
.coach-checkback { margin: 0 0 12px; padding: 12px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.coach-checkback .checkback-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.coach-checkback form { margin: 0; }
.coach-saved span { min-width: 0; }
.coach-saved button.btn-secondary-link, .memory-edit > summary.btn-secondary-link {
  width: auto; flex: none; min-height: 32px; padding: 4px 12px; font-size: 0.8rem;
}
.memory-edit > summary.btn-secondary-link { margin-top: 6px; }
.memory-edit > summary::-webkit-details-marker { display: none; }
.memory-page select, .goal-page select, .food-page select {
  background-color: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  padding: 12px 36px 12px 14px; font-family: var(--font-body); font-size: 1rem; width: 100%;
}
.memory-page select:focus, .goal-page select:focus, .food-page select:focus { outline: none; border-color: var(--accent); }
.memory-page label.settings-row-sub { display: flex; flex-direction: column; gap: 6px; }
.memory-page .memory-edit > summary.btn-secondary-link { display: inline-flex; width: fit-content; }
.memory-page .memory-item { padding-bottom: 10px; }

/* Goal programs (goal.html, partials/goal_card.html) */
.goal-card { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.goal-card-title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.goal-card-by { font-weight: 500; color: var(--text-muted); font-size: 0.9rem; }
.goal-card-review { font-size: 0.92rem; line-height: 1.45; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
.goal-bar { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--surface-raised); overflow: visible; }
.goal-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.goal-bar-time { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text-muted); }
.goal-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.goal-numbers div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.goal-numbers strong { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.goal-chart { margin: 0; padding: 8px; border-radius: 12px; background: var(--surface); }
.goal-chart svg { display: block; width: 100%; height: auto; }
.goal-chart-target { stroke: var(--text-muted); stroke-dasharray: 4 4; stroke-width: 1; }
.goal-chart-label { fill: var(--text-muted); font-size: 10px; }
.goal-chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.goal-chart-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.goal-timeline { display: flex; gap: 3px; list-style: none; margin: 0; padding: 0; }
.goal-week { flex: 1; height: 14px; border-radius: 3px; background: var(--surface-raised); }
.goal-week.build { background: var(--accent-dim); }
.goal-week.peak { background: var(--accent); opacity: 0.7; }
.goal-week.deload { background: var(--surface-raised); }
.goal-week.test { background: var(--success); }
.goal-week.now { outline: 2px solid var(--text); outline-offset: 1px; }
.goal-review { padding: 10px 0; border-top: 1px solid var(--border); }
.goal-review p { margin: 4px 0 0; line-height: 1.45; }
.goal-kinds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border: 0; padding: 0; margin: 0; }
.goal-kinds legend { margin-bottom: 6px; }
.goal-kind { padding: 12px 10px; font-size: 0.9rem; }
.goal-kind:has(input:checked) { border-color: var(--accent); }
.goal-form label { display: flex; flex-direction: column; gap: 4px; }
.goal-form [hidden] { display: none; }
.goal-note { margin: 0; }
.inline-form { flex-direction: row; display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.inline-form button { width: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Following (docs/FOLLOWING.md) ---- */
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.feed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.feed-name { font-weight: 700; color: var(--text); text-decoration: none; }
.feed-title { font-size: 1.05rem; }
.feed-sets { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.feed-prs { margin: 2px 0 0; font-size: 0.85rem; }
.feed-cheer { margin: 6px 0 0; }
.cheer-btn { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.cheer-btn.cheered { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }
.new-dot, .tab-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.new-dot { margin-right: 6px; vertical-align: middle; }
.tab-bar .tab { position: relative; }
.tab-dot { position: absolute; top: 4px; left: calc(50% + 8px); }
.person-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.person-actions form { margin: 0; }

/* ---- Food (docs/NUTRITION.md) ---- */
.food-card { gap: 8px; }
.food-card-link { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.food-row { display: grid; grid-template-columns: 4.8rem 1fr auto; align-items: center; gap: 10px; }
.food-row-name { font-size: 0.85rem; color: var(--text-muted); }
.food-row-num { font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.food-fill-kcal, .food-fill-carbs, .food-fill-fat { background: var(--text-muted); }
.food-quick { display: flex; gap: 8px; }
.food-quick input { flex: 1; min-width: 0; }
.food-logged { margin: 0; font-size: 0.88rem; color: var(--success); }
.food-days { display: flex; justify-content: space-between; align-items: center; }
.food-days .btn-secondary-link { font-size: 1.4rem; padding: 0 12px; text-decoration: none; }
.food-say-row { display: flex; gap: 8px; flex-wrap: wrap; }
.food-say-row select { flex: 1; min-width: 10rem; }
.food-meal { display: flex; flex-direction: column; gap: 8px; }
.food-meal-head { display: flex; justify-content: space-between; align-items: baseline; }
.food-item summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; padding: 4px 0; }
.food-item summary::-webkit-details-marker { display: none; }
.food-edit { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.food-edit-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.food-edit-nums label { display: flex; flex-direction: column; gap: 2px; font-size: 0.72rem; color: var(--text-muted); }
.food-edit-nums input { min-width: 0; }
.food-edit-actions { display: flex; gap: 14px; align-items: center; }
.food-log-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 4px; }
.food-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.food-chips form { margin: 0; }
.food-ideas { display: flex; flex-direction: column; gap: 10px; }
.food-idea-how { margin: 2px 0; font-size: 0.9rem; line-height: 1.45; }
.food-week { display: flex; flex-direction: column; gap: 4px; }
.food-week-plot { position: relative; height: 80px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.food-week-bar { display: block; border-radius: 4px 4px 0 0; background: var(--text-muted); min-height: 2px; }
.food-week-bar.met { background: var(--accent); }
.food-week-target { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--text-muted); opacity: 0.6; }
.food-week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; font-size: 0.72rem; color: var(--text-muted); }
.food-why { margin: 8px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; line-height: 1.45; }
.food-plan-day { display: flex; flex-direction: column; gap: 6px; }
.food-plan-meal { display: grid; grid-template-columns: 5rem 1fr auto; gap: 8px; align-items: baseline; font-size: 0.9rem; }
.food-day-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 1.3rem; }
.food-page textarea { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 12px 14px; font: inherit; resize: vertical; }
.goal-page input[type=number]:not(.weigh-in input), .food-page input[type=number] {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text);
  padding: 12px 14px; font-family: var(--font-body); font-size: 1rem; width: 100%; min-width: 0;
}
.goal-page input[type=number]:focus, .food-page input[type=number]:focus { outline: none; border-color: var(--accent); }
.about-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.about-q { font-weight: 600; }
.about-row .weigh-in { justify-content: flex-end; }
.about-row .stepper { flex: none; }
.units-pick .goal-kind { padding-block: 10px; }
.goal-form .about-row label.weigh-in { flex-direction: row; align-items: center; gap: 8px; }
.about-row label.weigh-in input[type="number"] { font-size: 1.5rem; width: 6ch; padding: 8px; }
.about-row .stepper-display { font-size: 1.5rem; }
.food-cam { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; width: auto; flex: none; }
.food-quick .food-cam { padding-inline: 12px; }
.scan-room { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; }
.scan-room .food-cam.disabled { opacity: 0.5; cursor: default; }
.scan-room-go[hidden] { display: none; }
.scan-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.scan-thumbs:empty { display: none; }
.scan-thumb { width: 52px; height: 52px; border-radius: 8px; border: 1px solid var(--border); background: center / cover no-repeat; cursor: pointer; padding: 0; }
.equip-tile.scan-maybe { outline: 2px dashed var(--accent); outline-offset: -2px; }
.scan-maybe-mark { display: block; font-size: 0.7rem; color: var(--accent); margin-top: 2px; }

/* ---- Group workouts (docs/GROUP_WORKOUTS.md) ---- */
.gw-title { margin: 4px 0 2px; }
.gw-wod { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); }
.gw-post > summary { list-style: none; display: inline-flex; cursor: pointer; margin-top: 8px; }
.gw-post > summary::-webkit-details-marker { display: none; }
.gw-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.gw-form .tile-row .chip { width: auto; }
.gw-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 0.85rem; color: var(--text-muted); }
.gw-row input[type=number] { width: 5.5em; }
.gw-move { display: grid; grid-template-columns: 4.5em 4.8em 1fr; gap: 6px; }
.gw-move > * { min-width: 0; width: 100%; box-sizing: border-box; }
.gw-form select { max-width: 100%; }
.gw-gen { display: flex; flex-direction: column; gap: 10px; }
.gw-gen[hidden] { display: none; }
.gw-generated { display: flex; flex-direction: column; gap: 6px; }
.gw-move input[type=text] { grid-column: 1 / -1; }
.gw-past { margin-top: 14px; }
.gw-past > summary { cursor: pointer; }
.home-gw { display: flex; flex-direction: column; gap: 6px; }
.home-gw form { margin: 0; }

/* Home's goal card when it loads after the page (a weekly review being written): keep its space. */
.card-slot { min-height: 96px; }
/* Today's Workout while it's built: about a workout's height, so Start doesn't jump down when it lands. */
.preview-card.building { min-height: 300px; }
