/* Overachiever Coach — M4 mobile-first app shell.
   Visual identity = overachiever.eu tokens with inverted colors (site light → coach dark).
   Inter, 8/6px radii, monochrome athletic UI. Primary CTA = white on black (site black on white). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

:root {
  /* Inverted OA site palette (global.css :root, white↔black / light↔dark) */
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #0a0a0a;
  --surface-2: #171717;
  --surface-3: #262626;
  --line: #262626;
  --line-2: #404040;
  --text: #f5f5f5;
  --text-2: #d4d4d4;
  --muted: #a3a3a3;
  --muted-2: #737373;
  --ink: #f5f5f5;
  --ink-2: #d4d4d4;
  --black: #000000;
  --white: #ffffff;
  --accent: #ffffff;       /* site accent is black; inverted primary CTA */
  --accent-ink: #000000;
  --accent-soft: #262626;
  --protein: #f5f5f5;
  --carb: #a3a3a3;
  --fat: #737373;
  --ok: #f5f5f5;          /* strictly mono: status = greys, not hues */
  --warn: #a3a3a3;
  --danger: #f5f5f5;
  --destructive: #f87171;  /* ONLY destructive actions (delete / forget / sign out everywhere) */
  --follicular: #d4d4d4;
  --luteal: #737373;
  --radius: 8px;
  --radius-sm: 6px;
  --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --tint: 255 255 255;
  color-scheme: dark;
}
/* UX-03 light theme (web/theme.js sets data-theme and the accent variables) */
:root[data-theme="light"] {
  --bg: #ffffff; --bg-2: #fafafa; --surface: #ffffff; --surface-2: #f4f4f5; --surface-3: #e4e4e7;
  --line: #e4e4e7; --line-2: #d4d4d8; --text: #0a0a0a; --text-2: #27272a; --muted: #52525b; --muted-2: #71717a;
  --ink: #0a0a0a; --ink-2: #27272a; --accent-soft: #e4e4e7; --protein: #0a0a0a; --carb: #52525b; --fat: #a1a1aa;
  --ok: #0a0a0a; --warn: #52525b; --danger: #0a0a0a; --destructive: #b91c1c; --follicular: #27272a; --luteal: #a1a1aa;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.08); --tint: 0 0 0; color-scheme: light;
}
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); padding: 0; cursor: pointer; position: relative; overflow: hidden; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch.custom { display: none; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
p.warn { color: var(--warn); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--text); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- boot / login ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0; position: relative;
}
.mark img { display: block; height: 36px; width: auto; }
.mark.tile {
  width: 56px; height: 56px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text);
  font: 700 18px/1 var(--font-display); letter-spacing: -.04em;
}
/* Overachiever logo from overachiever.eu, recoloured with currentColor via a mask (mono in both themes). */
.logo-word { --h: 28px; display: block; height: var(--h); width: calc(var(--h) * 4.689); flex: none; color: var(--text); background: currentColor;
  -webkit-mask: url(/brand/wordmark.svg) no-repeat center / contain; mask: url(/brand/wordmark.svg) no-repeat center / contain; }
.logo-word.lg { --h: 36px; }
.login {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(32px + var(--safe-t)) 24px calc(32px + var(--safe-b)); max-width: 440px; margin: 0 auto;
}
.login h1 { font: 700 32px/1.1 var(--font-display); letter-spacing: -.02em; margin: 24px 0 8px; }
.login p.lede { color: var(--text-2); margin: 0 0 28px; }
.login .fine { color: var(--muted); font-size: 13px; margin-top: 20px; }
.login .err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 10px 0 0; }

/* ---------- shell ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(84px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20; padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent;
  display: flex; align-items: center; gap: 10px;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font: 750 22px/1.1 var(--font-display); letter-spacing: -.02em; margin: 0; flex: 1; min-width: 0; }
.topbar .sub { display: block; font: 500 12px/1.3 var(--font); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.datenav { display: flex; align-items: center; gap: 2px; }
.iconbtn {
  width: var(--tap); height: var(--tap); border-radius: var(--radius); border: 0; background: transparent;
  display: grid; place-items: center; color: var(--text-2);
}
.iconbtn:active { background: var(--surface-2); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn[disabled] { opacity: .3; }
.chip-today {
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
}
main { padding: 4px 16px 24px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + var(--safe-b));
}
.tabbar-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab {
  border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center;
  gap: 3px; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 6px 0; min-height: 50px;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] svg { color: var(--accent); }
.tab .dot { position: absolute; margin-left: 18px; margin-top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tab-wrap { position: relative; display: flex; justify-content: center; }
.fab {
  justify-self: center; width: 52px; height: 52px; border-radius: 12px; border: 0; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow);
  transform: translateY(-6px);
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: translateY(-5px) scale(.97); }

/* ---------- cards / sections ---------- */
.section { margin-top: 22px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.section-h h2 { margin: 0; font: 700 13px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.section-h .meta { font-size: 13px; color: var(--muted); }
.linkbtn { border: 0; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; padding: 6px 2px; }
.linkbtn.accent { color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 10px; }
.pad { padding: 16px; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 16px; text-align: center; }

/* macro hero */
.hero { padding: 18px 16px 16px; display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); }
.ring .val { stroke: var(--accent); transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring.over .val { stroke: var(--warn); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font: 800 30px/1 var(--font-display); letter-spacing: -.03em; }
.ring-label span { font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: .02em; }
.macro-list { display: grid; gap: 12px; }
.macro-row .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.macro-row .top b { font-weight: 650; }
.macro-row .top span { color: var(--muted); }
.bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar .band { position: absolute; top: 0; bottom: 0; background: rgb(var(--tint) / .06); border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.fill.p { background: var(--protein); } .fill.c { background: var(--carb); } .fill.f { background: var(--fat); }
.hero-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--muted); }
.hero-foot b { color: var(--text); font-weight: 650; }

/* list rows */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; }
.row + .row { border-top: 1px solid var(--line); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .detail { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row .end { text-align: right; font-size: 14px; }
.row .end small { display: block; color: var(--muted); font-size: 12px; }
.row.done .title { color: var(--muted); }
.meal-h { padding: 10px 16px 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.meal-h + .row { border-top: 0; }
.meal + .meal { border-top: 1px solid var(--line); }

.check {
  width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); background: transparent;
  display: grid; place-items: center; color: transparent; transition: all .15s;
}
.check svg { width: 16px; height: 16px; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check.skip { border-style: dashed; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.pill.accent { background: rgb(var(--tint) / .1); color: var(--accent); border-color: rgb(var(--tint) / .28); }
.pill.warn { background: transparent; color: var(--warn); border-color: var(--line-2); border-style: dashed; }
.pill.danger { background: var(--surface-3); color: var(--danger); border-color: var(--line-2); font-weight: 600; }
.pill.ok { background: var(--surface-2); color: var(--ok); border-color: var(--line-2); }

/* training */
.session-h { padding: 16px 16px 12px; }
.session-h .kicker { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.session-h h3 { margin: 4px 0 8px; font: 700 19px/1.2 var(--font-display); letter-spacing: -.01em; }
.rx { display: flex; gap: 8px; flex-wrap: wrap; }
.rx .stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13px; color: var(--text-2); }
.rx .stat b { color: var(--text); font-size: 15px; font-weight: 700; margin-right: 3px; }
.ex { border-top: 1px solid var(--line); padding: 12px 16px; }
.ex-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ex-h .name { font-weight: 650; }
.sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.set {
  border: 1px solid var(--line-2); background: var(--bg-2); border-radius: var(--radius-sm); padding: 6px 9px; font-size: 13px;
  line-height: 1.2; text-align: left; color: var(--text);
}
.set small { display: block; color: var(--muted); font-size: 11px; }
.set.ghost { border-style: dashed; color: var(--muted); background: transparent; }
.adjusted { font-size: 12px; color: var(--muted); padding: 0 16px 14px; }

/* proposals */
.proposal { border-color: rgb(var(--tint) / .28); background: linear-gradient(180deg, rgb(var(--tint) / .04), transparent 60%), var(--surface); }
.proposal.terminal { border-color: var(--line); background: var(--surface); }
.prop-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.prop-h h3 { margin: 0; font: 700 17px/1.25 var(--font-display); }
.prop-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.proposal.terminal .prop-kicker { color: var(--muted); }
.prop-why { color: var(--text-2); font-size: 14px; margin: 8px 0 0; }
.diff { margin: 12px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.diff li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: 14px; background: var(--bg-2); }
.diff li + li { border-top: 1px solid var(--line); }
.diff .f { color: var(--muted); }
.diff .v s { color: var(--muted); margin-right: 6px; }
.diff .v b { font-weight: 700; }
.prop-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.prop-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 14px; }
.stale { margin-top: 10px; font-size: 13px; color: var(--warn); }

/* buttons & forms */
.btn {
  min-height: 48px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 650; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--text); }   /* mono; red only on a final destructive confirm (.btn.destructive) */
.btn.destructive { color: var(--destructive); border-color: var(--destructive); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; border-radius: var(--radius-sm); padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--bg-2);
  padding: 12px 14px; font-size: 16px; outline: none; appearance: none; -webkit-appearance: none;
}
.input:focus { border-color: var(--text-2); }
.input-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.input-row.three { grid-template-columns: repeat(3, 1fr); }
.input-row.four { grid-template-columns: repeat(4, 1fr); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1 0 auto; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: 14px;
}
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: 6px; }
.stepper button { border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface-2); font-size: 22px; font-weight: 600; }
.stepper .input { text-align: center; font-weight: 700; font-size: 18px; }

/* option cards (vibe) */
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: var(--radius); padding: 12px 14px; }
.opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; margin-top: 2px; }
.opt[aria-checked="true"] { border-color: var(--text-2); background: var(--surface-2); }
.opt[aria-checked="true"] .radio { border-color: var(--accent); background: radial-gradient(var(--accent) 0 45%, transparent 50%); }
.opt b { display: block; font-weight: 650; }
.opt small { color: var(--muted); font-size: 13px; }
.toggle-row { display: flex; gap: 14px; align-items: flex-start; }
.toggle-row .txt { flex: 1; }
.toggle-row .txt small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; border-radius: 99px; border: 0; background: var(--line-2); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--text); transition: transform .18s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--accent-ink); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* coach chat */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 150px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 12px; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--text); color: var(--bg); border-bottom-right-radius: 6px; }
.msg.coach { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.err { align-self: flex-start; color: var(--danger); background: transparent; border: 1px dashed var(--line-2); }
.msg .tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.msg .tools span { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 7px; }
.chat .proposal { align-self: stretch; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(68px + var(--safe-b)); z-index: 25; padding: 8px 12px 10px;
  background: linear-gradient(180deg, transparent, var(--bg) 26%);
}
.composer-inner { max-width: 560px; margin: 0 auto; }
.suggest { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button { flex: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 8px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-row textarea { flex: 1; resize: none; max-height: 120px; min-height: 48px; border-radius: 999px; padding: 12px 16px; line-height: 1.35; }
.send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.send svg { width: 22px; height: 22px; }
.send[disabled] { background: var(--line-2); color: var(--muted); }
.voice-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); display: grid; place-items: center; flex: none; }
.voice-btn svg { width: 22px; height: 22px; }
.voice-btn[aria-pressed="true"], .voice-btn.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px rgb(var(--tint) / .12); }
.voice-btn[disabled] { opacity: .4; }
.voice-meta { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; font-size: 12px; color: var(--muted); }
.voice-meta .pill { font-size: 11px; }
.msg.voice-tag::before { content: "Voice"; display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.chat-intro { text-align: center; color: var(--muted); padding: 30px 12px 10px; font-size: 14px; }
.chat-intro b { display: block; color: var(--text); font: 700 20px/1.2 var(--font-display); margin: 12px 0 6px; }

/* bottom sheet */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg-2); border-top: 1px solid var(--line-2); border-radius: 12px 12px 0 0;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  max-width: 560px; margin: 0 auto;
}
.sheet.open { transform: translateY(0); }
.scrim.open { opacity: 1; }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 8px auto 2px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 6px 20px; }
.sheet-h h2 { margin: 0; font: 700 19px/1.2 var(--font-display); }
.sheet-body { overflow-y: auto; padding: 8px 20px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet-tabs { display: flex; gap: 6px; padding: 0 20px 10px; }
.food-pick { max-height: 40dvh; overflow-y: auto; margin: 0 -4px 12px; }
.food-pick .row { cursor: pointer; border-radius: var(--radius); padding: 10px 12px; }
.food-pick .row + .row { border-top: 0; }
.food-pick .row[aria-selected="true"] { background: var(--surface-2); outline: 1px solid var(--line-2); }
.preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 16px; text-align: center; }
.preview div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 4px; }
.preview b { display: block; font-size: 18px; font-weight: 750; }
.preview small { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line-2); background: transparent; color: var(--text-2); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

/* toast */
#toast {
  position: fixed; left: 50%; top: calc(10px + var(--safe-t)); transform: translate(-50%, -16px); z-index: 60;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .22s; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--text); color: var(--bg); font-weight: 600; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 40%, var(--surface) 80%); background-size: 300% 100%; animation: sk 1.4s infinite; border-radius: var(--radius); border: 1px solid var(--line); }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; }
.foot a { color: var(--muted); }

@media (min-width: 600px) {
  main { padding: 8px 20px 32px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- magic-link login extras ---------- */
.login details.adv {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.login details.adv summary {
  cursor: pointer;
  color: var(--text-2);
  font-weight: 600;
  list-style: none;
}
.login details.adv summary::-webkit-details-marker { display: none; }
.login details.adv summary::before { content: "▸ "; }
.login details.adv[open] summary::before { content: "▾ "; }
.login a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- exercises (CR1) */
.tabbar-inner { grid-template-columns: repeat(6, 1fr); }
.tab span { font-size: 10.5px; }
.xsearch { position: relative; margin-top: 8px; }
.xsearch .input { padding-right: 48px; }
.xsearch .xclear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.xchips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.xchips::-webkit-scrollbar { display: none; }
.xchip { flex: none; min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.xchip small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.xchip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.xchip[aria-pressed="true"] small { color: var(--bg); opacity: .7; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--accent); vertical-align: 2px; }
.bodymap-wrap { display: flex; justify-content: center; margin: 6px 0 4px; }
.bodymap { width: 100%; max-width: 340px; height: auto; }
.bodymap .bm-outline { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; }
.bodymap .bm-muscle { fill: var(--bg-2); stroke: var(--line-2); stroke-width: .8; }
.bodymap .bm-primary { fill: var(--accent); stroke: var(--accent); stroke-width: .8; }
.bodymap .bm-secondary { fill: var(--accent); fill-opacity: .4; stroke: var(--accent); stroke-opacity: .6; stroke-width: .8; }
.bodymap .bm-selected { stroke: var(--text); stroke-width: 2; }
.bodymap-wrap.edit .bodymap [data-action="bm-muscle"] { cursor: pointer; }
.bm-legend { display: flex; justify-content: center; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.bm-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 5px; vertical-align: -1px; }
.bm-key.secondary { opacity: .45; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; font-size: 13px; }
.tags > b { color: var(--text-2); margin-right: 2px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
button.tag.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.tag.secondary { border-color: var(--accent); color: var(--accent); }
.xdesc { white-space: pre-wrap; color: var(--text-2); }
.xh { font: 700 16px/1.2 var(--font-display); margin: 16px 0 6px; }
.xsteps { padding-left: 20px; margin: 0 0 12px; color: var(--text-2); line-height: 1.5; }
.xsteps li + li { margin-top: 6px; }

/* ---- CR2 Plan: schedule, routines, week strip ---- */
.plan-seg { margin: 10px 0 4px; }
.plan-seg button { flex: 1; }
.small { font-size: 13px; }
.wstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wday { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font: inherit; cursor: pointer; min-height: 64px; }
.wday .wd { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wday b { font-size: 16px; color: var(--text); }
.wday .wn { font-size: 13px; line-height: 1.1; min-height: 15px; }
.wday.today { border-color: var(--text); }
.wday.rest .wn { color: var(--muted-2); }
.wday.done { background: var(--surface-3); }
.wday.done::after { content: "✓"; position: absolute; top: 3px; right: 6px; font-size: 11px; color: var(--ok); }
.wday .tagdot { position: absolute; top: 5px; left: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.ricon { display: inline-block; width: 1.4em; text-align: center; margin-right: 4px; }
.rchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rchip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 8px; border-radius: 999px; background: var(--surface-3); font-size: 14px; }
.rchip .x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 6px; cursor: pointer; min-width: 28px; min-height: 28px; }
.iconbtn.sm { width: 34px; height: 34px; font-size: 16px; }
.iconbtn.sm + .iconbtn.sm { margin-left: 2px; }
.badge.accent { background: var(--text); color: var(--bg); }
.icongrp { margin-top: 8px; }
.iconrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.iconpick { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 20px; cursor: pointer; }
.iconpick[aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
details.field summary { cursor: pointer; color: var(--text-2); padding: 6px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row.slot .grip { color: var(--muted-2); cursor: grab; padding-right: 8px; user-select: none; }
.row.slot.dragging { opacity: .5; }
.row.wkrow .title { font-size: 15px; }
.planned .row .main[role="button"] { cursor: pointer; }

/* ---------------------------------------------------------------- CR3 guided workout */
body.wk-open { overflow: hidden; }
.wk { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; }
.wk-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 12px 8px; border-bottom: 1px solid var(--line); }
.wk-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.wk-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-title .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.wk-body { flex: 1; overflow-y: auto; padding: 12px 12px calc(110px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.wk-ex { padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); }
.wk-ex.current { border-color: var(--line-2); box-shadow: inset 3px 0 0 var(--accent); }
.wk-ex.complete { opacity: .72; }
.wk-exh { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.wk-exh h3 { margin: 0 0 2px; font-size: 16px; }
.wk-exname { all: unset; cursor: pointer; font: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.wk-exname:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.wk-last, .wk-why { margin: 0; font-size: 12.5px; color: var(--muted); }
.wk-why { color: var(--text-2); }
.wk-steps { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 12px; }
.wk-steps .chip, .wk-rest .chip { min-height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; }
.wk-sets { margin-top: 6px; }
.wk-set { display: grid; grid-template-columns: 36px 1fr 44px; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.wk-set.wu .wk-n { color: var(--warn); }
.wk-set.wu .wk-in { color: var(--text-2); }
.wk-set.done .wk-in { color: var(--muted); }
.wk-n { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-cells { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wk-x { color: var(--muted); }
.wk-in { width: 100%; min-width: 0; max-width: 110px; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 600 17px/1 var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.wk-in::placeholder { color: var(--muted-2); font-weight: 500; }
.wk-add-load { height: 40px; padding: 0 10px; border-radius: 8px; border: 1px dashed var(--line-2); background: none; color: var(--muted); font-weight: 600; }
.wk-play { height: 40px; min-width: 48px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-play.on { background: var(--accent); color: var(--accent-ink); }
.wk-note { margin: 8px 0 0; font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
.wk-exf { margin-top: 6px; }
.wk-rest { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px calc(10px + var(--safe-b)); background: var(--surface-2); border-top: 1px solid var(--line-2); }
.wk-rest-t { display: flex; flex-direction: column; align-items: flex-start; margin-right: auto; border: 0; background: none; color: var(--text); padding: 0 4px; }
.wk-rest-t .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wk-rest-t b { font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.wk-rest.ready { background: var(--accent); color: var(--accent-ink); }
.wk-rest.ready .wk-rest-t, .wk-rest.ready .lbl { color: var(--accent-ink); }
.wk-rest.paused b { opacity: .6; }
body.wk-flash .wk-rest, body.wk-flash .wk-resume { animation: wkflash .6s ease 1; }
@keyframes wkflash { 0%, 100% { filter: none; } 50% { filter: invert(1); } }
.wk-resume { position: fixed; left: 10px; right: 10px; bottom: calc(76px + var(--safe-b)); z-index: 29; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; text-align: left; }
.wk-resume b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-resume .muted { font-variant-numeric: tabular-nums; }
.wk-resume .go { font-weight: 700; }
.dotlive { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgb(var(--tint) / .2); }
.wk-open { margin: 0 0 6px; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.wk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.wk-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.wk-stats span { font-size: 11.5px; color: var(--muted); }
.wk-map { max-width: 260px; margin: 12px auto 0; }
.wk-h { font-size: 14px; margin: 14px 0 6px; }
/* ACH-01 post-workout achievements: monochrome, quiet */
.wk-ach { border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 14px; padding: 4px 14px 10px; margin-bottom: 12px; }
.wk-ach ul { list-style: none; margin: 0; padding: 0; }
.wk-ach li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line, rgba(127,127,127,.18)); }
.wk-ach li:first-child { border-top: 0; }
.wk-ach-ic { width: 22px; text-align: center; font-size: 15px; line-height: 20px; }
.wk-ach b { display: block; font-size: 14px; }
.wk-ach span:not(.wk-ach-ic) { font-size: 13px; opacity: .72; }
.wk-ach-more summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 8px 0 2px; border-top: 1px solid var(--line, rgba(127,127,127,.18)); }
.wk-ach-more li:first-child { border-top: 1px solid var(--line, rgba(127,127,127,.18)); }
.wk-prog { margin: 0; padding-left: 18px; font-size: 14px; }
.wk-settings .row { gap: 10px; }
.wk-settings select.input.sm { min-height: 36px; padding: 0 8px; font-size: 14px; max-width: 150px; }
.danger-text { color: var(--danger) !important; }

/* ---- CR4: history, records, body weight ---- */
.wk-pr { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 999px;
  background: var(--warn); color: var(--bg); vertical-align: middle; margin-left: 6px; }
.wk-set .wk-pr { margin: 0 4px 0 0; }
.hs-cal { padding: 10px 12px; }
.hs-cal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hs-cal-h b { flex: 1; }
.hs-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.hs-wd { font-size: 11px; color: var(--muted-2); padding: 2px 0; }
.hs-d { display: flex; align-items: center; justify-content: center; height: 34px; border-radius: 50%; font-size: 14px; color: var(--muted); border: 0; background: none; font: inherit; }
.hs-d.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.hs-d.today { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.hs-ex { margin-top: 14px; }
.hs-exn { font-weight: 700; font-size: 16px; padding: 0; }
.hs-sets { list-style: none; margin: 6px 0 0; padding: 0; }
.hs-sets li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hs-sets li.wu { color: var(--muted); }
.hs-n { width: 22px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.hs-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.hs-line { stroke: var(--text); stroke-width: 2; }
.hs-line2 { stroke: var(--muted-2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.hs-goal { stroke: var(--ok); stroke-width: 1.2; stroke-dasharray: 2 3; }
.hs-dot { fill: var(--text); }
.hs-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); }
.hs-legend { font-size: 12px; display: flex; gap: 6px; align-items: center; }
.hs-legend i { display: inline-block; width: 14px; height: 2px; margin-left: 8px; }
.hs-legend i.k1 { background: var(--text); margin-left: 0; }
.hs-legend i.k2 { background: var(--muted-2); }
.hs-legend i.k3 { background: var(--ok); }
.hs-undo { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--surface-3); color: var(--text); border-radius: 999px; padding: 10px 16px; display: flex; gap: 14px; align-items: center;
  transition: opacity .2s, transform .2s; z-index: 60; }
.hs-undo.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bw-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bw-now { font-size: 28px; }
.body-card .good { color: var(--ok); }
.body-card .bad { color: var(--danger); }
.xhist { margin-top: 10px; }

/* CR5: routine progression settings + next-session preview (PRG-01/14) */
.field.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.field.check input { width: 20px; height: 20px; margin: 0; }
.pv-why { color: var(--fg, inherit); }

/* CR6 sync status (SYN-03) + devices (ACC-02) */
.tb-right { display: flex; align-items: center; gap: 6px; }
.syncdot { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 4px 6px; border-radius: 999px; cursor: pointer; }
.syncdot i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.syncdot.syncing i { background: var(--warn); animation: oa-pulse 1.2s infinite; }
.syncdot.offline i { background: var(--muted-2); }
.syncdot.error i, .syncdot.signed-out i { background: var(--danger); }
.syncdot.synced span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.syncdot.inline { padding: 0; }
@keyframes oa-pulse { 50% { opacity: .35; } }
.devlist { list-style: none; margin: 0; padding: 0; }
.devlist .dev { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.devlist .dev small { display: block; color: var(--muted); }
.devlist .pill { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--line); }
.dev-act { display: flex; gap: 10px; align-items: center; }
.linkbtn.danger { color: var(--text-2); text-decoration: underline; }

/* CR7 coach for training */
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.opt-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.coach-train .card, .proposal { margin-top: 12px; }
.proposal h3, .coach-consent h3 { margin: 0 0 8px; }
.proposal.stale, .change.stale { opacity: .55; }
.changes { list-style: none; padding: 0; margin: 10px 0 0; }
.change { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.change input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; }
.change .title { font-weight: 600; }
.evidence { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.evidence b { color: var(--text-2); font-weight: 500; }
.small.warn, p.warn { color: var(--warn); }
.plan-slots { padding-left: 20px; margin: 8px 0; }
.plan-slots li { margin: 6px 0; }
.week-preview { margin: 10px 0; border-top: 1px solid var(--line, #e5e5e5); padding-top: 8px; }
.week-preview summary { font-weight: 600; cursor: pointer; margin-bottom: 6px; }
.pv-day { display: grid; grid-template-columns: 44px 1fr; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid var(--line, #eee); }
.pv-day.rest { color: var(--muted, #777); }
.pv-label { font-weight: 600; }
.pv-routine .plan-slots { margin: 4px 0; }
.pv-routine .num { color: var(--muted, #666); }
.refine { display: flex; gap: 8px; margin-top: 12px; }
.refine .input { flex: 1; }
.managed-badge { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.managed-badge b { margin-right: 4px; }
.wk-voice { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.wk-voice .input { flex: 1; }
.wk-voice-undo { display: flex; gap: 8px; align-items: center; justify-content: space-between; border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px; margin: 6px 0; font-size: 14px; }

/* ---------------------------------------------------------------- CR8 advanced sets, supersets, equipment */
.wk-set.child { margin-left: 22px; opacity: .95; }
.wk-set.child .wk-n { font-size: 12px; }
.wk-set.extra .wk-n { color: var(--accent, var(--text)); }
.wk-set { position: relative; grid-template-columns: 36px minmax(0, 1fr) auto 44px; touch-action: pan-y; transition: transform .12s ease; }
.wk-tags { display: flex; align-items: center; gap: 4px; }
.wk-tags:empty { display: none; }
.wk-set > .check { grid-column: 4; }
.wk-set .wk-stp { min-width: 26px; padding: 0; }
.wk-n small { font-size: 10px; margin-left: 1px; opacity: .8; }
.wk-stp { min-width: 30px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; font-size: 18px; }
.wk-in.sm { width: 64px; }
.wk-eff { border-radius: 999px; padding: 4px 9px; font-size: 12px; border: 0; color: #fff; background: #737373; }
.wk-eff.lvl0, .eff.lvl0 { background: #d4d4d4; color: #000; } .wk-eff.lvl1, .eff.lvl1 { background: #a3a3a3; color: #000; }
.wk-eff.lvl2, .eff.lvl2 { background: #737373; } .wk-eff.lvl3, .eff.lvl3 { background: #525252; }
.wk-eff.lvl4, .eff.lvl4 { background: #404040; } .wk-eff.lvl5, .eff.lvl5 { background: #262626; }
.wk-eff.lvlx { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.eff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.eff { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 6px; color: #fff; display: flex; flex-direction: column; gap: 2px; }
.eff small { opacity: .9; }
.wk-plates { grid-column: 2 / -1; font-size: 12px; color: var(--muted); margin-top: -4px; }
.wk-plates.warn, .small.warn, .detail.warn { color: var(--danger); }
.wk-ex.grouped { border-left: 3px solid var(--accent, var(--text)); }
.wk-media { border: 0; background: transparent; padding: 0; width: 56px; flex: 0 0 auto; cursor: pointer; }
.wk-media.big { width: 120px; }
.wk-media svg { width: 100%; height: auto; }
/* Oct 17: exercise movement illustrations (greys only, light plate in both themes) */
.illu { margin: 0 0 12px; }
.illu img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: contain; filter: grayscale(1); background: #f7f7f7; border-radius: 12px; }
.illu.sm img { max-height: 120px; }
.illu figcaption { display: flex; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.illu figcaption span { flex: 1; text-align: center; }
.illu-ph { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 18px; text-align: center; margin-bottom: 12px; }
.wk-illu { padding: 0 0 4px; cursor: pointer; }
.pv-day { align-items: flex-start; }
.pv-thumb { flex: 0 0 120px; width: 120px; margin-left: 10px; }
.pv-thumb .illu { margin: 0; }
.wk-media-tile { width: 48px; height: 48px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; }
.wk-exh { gap: 10px; }
.wk-cue, .wk-pin { font-size: 13px; margin: 4px 0 0; }
.wk-pin { color: var(--accent, var(--text)); }
.wk-pinned { position: sticky; top: 0; z-index: 2; padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.wk-pager { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; }
.wk.layout-compact .wk-ex { padding: 8px 10px; }
.wk.layout-compact .wk-last, .wk.layout-compact .wk-why, .wk.layout-compact .wk-steps { display: none; }
.wk.layout-compact .wk-set { padding: 2px 0; min-height: 0; }
.wk.layout-compact .wk-in { height: 30px; }
.slot.grouped { border-left: 3px solid var(--accent, var(--text)); }
.iconbtn.on { color: var(--accent, var(--text)); }
.rt-row { touch-action: pan-y; transition: transform .12s ease; }
.toast.undo { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; z-index: 60; }
.bodymap-wrap.sm { max-width: 220px; margin: 0 auto; }
.bodymap-wrap.clickable path[data-m] { cursor: pointer; }
.explorer { margin: 6px 0 10px; }
.muscle-preview summary { cursor: pointer; font-weight: 600; margin: 12px 0 6px; }

/* CR9a: missed planned days (HIS-06), history tools, import/export sheets */
.hs-d.missed { border: 1.5px dashed var(--accent); color: var(--text); cursor: pointer; }
.hs-tools { margin: 0 0 10px; justify-content: flex-end; }
.io-card .row-btns label.btn { cursor: pointer; }
.io-list { margin: 6px 0 10px; padding-left: 18px; }
.io-list li { margin: 2px 0; }
.io-h { font-size: 15px; margin: 14px 0 4px; }
.io-skip summary { cursor: pointer; color: var(--muted); margin: 6px 0; }
.bodymap .bm-level { fill: var(--accent); stroke: var(--accent); stroke-width: .6; }

/* CR10 stats */
.st-tiles { grid-template-columns: repeat(4, 1fr); }
.st-list { list-style: none; margin: 8px 0; padding: 0; }
.st-list li { display: grid; grid-template-columns: 9em 1fr 3em; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; }
.st-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--w), transparent var(--w)); opacity: .85; }
.st-pvd { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-pvd th, .st-pvd td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); }
.st-pvd tr.good td { color: var(--accent); }
.st-heat-wrap { overflow-x: auto; }
.st-heat { display: flex; gap: 2px; }
.st-col { display: flex; flex-direction: column; gap: 2px; }
.st-cell { width: 11px; height: 11px; border-radius: 2px; border: 0; padding: 0; background: rgba(127,127,127,.18); }
.st-cell.none { background: transparent; }
.st-cell.l1 { background: var(--accent); opacity: .35; } .st-cell.l2 { background: var(--accent); opacity: .55; }
.st-cell.l3 { background: var(--accent); opacity: .75; } .st-cell.l4 { background: var(--accent); opacity: 1; }
.st-cell:not([disabled]) { cursor: pointer; }
.st-home { display: flex; justify-content: space-between; align-items: baseline; }
.st-home b { font-size: 22px; }
.st-e1rm b { font-size: 22px; }
.st-compare { position: relative; margin: 10px 0; border-radius: 12px; overflow: hidden; background: #000; }
.st-compare img { display: block; width: 100%; height: auto; }
.st-after { position: absolute; inset: 0; }
.st-after img { width: 100%; height: 100%; object-fit: cover; }
.st-compare input[type=range] { position: absolute; left: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); }
@media (max-width: 420px) { .st-tiles { grid-template-columns: repeat(2, 1fr); } }

/* CR11 media + notifications + debrief */
.md-strip { margin: 6px 0 4px; }
.md-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.md-item { position: relative; margin: 0; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.md-item img, .md-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.md-del { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; background: rgba(0,0,0,.55); border-radius: 50%; }
.md-add.busy { opacity: .5; pointer-events: none; }
.md-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0; }
.md-bar span { display: block; height: 100%; background: var(--accent, #c8ff3d); }
.nt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line, rgb(var(--tint) / .06)); }
.nt-row:last-of-type { border-bottom: 0; }
.db-score { display: flex; align-items: baseline; gap: 4px; font-size: 14px; }
.db-score b { font-size: 40px; line-height: 1; }
.db-h { font-size: 14px; margin: 14px 0 4px; }
.db-l { margin: 0; padding-left: 18px; }

/* CR12 ACC-03 pairing */
.pair-code { font: 600 32px/1.2 ui-monospace, monospace; letter-spacing: .12em; text-align: center; margin: 12px 0; }
.pair-qr { display: flex; justify-content: center; margin: 0 0 8px; }
.pair-qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; }

/* CR12 UX-02 settings search + sub-pages; UX-06 reduce motion; UX-05 sheets vs keyboard / notch */
.set-search { position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--bg); }
.setgroup-h { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 6px; }
.setpage { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; background: var(--bg-2); }
.setpage > summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; list-style: none; min-height: 48px; }
.setpage > summary::-webkit-details-marker { display: none; }
.setpage > summary .sp-t { font-weight: 600; flex: 1; }
.setpage > summary .sp-chev { transition: transform .2s; }
.setpage[open] > summary .sp-chev { transform: rotate(90deg); }
.setpage > :not(summary) { margin: 0 12px 12px; }
.rm *, .rm *::before, .rm *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
.sheet { bottom: var(--kb, 0px); max-height: calc(100dvh - var(--kb, 0px) - max(env(safe-area-inset-top), 12px) - 8px); padding-bottom: env(safe-area-inset-bottom); }
.upd-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; display: flex; gap: 10px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 10px 8px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }

/* CR12 I18N-01: RTL mirroring. Flex rows mirror by themselves under dir=rtl; these are the physical
   offsets that don't. Kept in one block so the RTL snapshot test covers them together. */
[dir=rtl] .row .end, [dir=rtl] .kv dd { text-align: left; }
[dir=rtl] .opt, [dir=rtl] .st-pvd th, [dir=rtl] .st-pvd td { text-align: right; }
[dir=rtl] .switch::after { left: auto; right: 3px; }
[dir=rtl] .switch[aria-checked="true"]::after { transform: translateX(-20px); }
[dir=rtl] .xsearch .input { padding-right: 14px; padding-left: 48px; }
[dir=rtl] .xsearch .xclear { right: auto; left: 4px; }
[dir=rtl] .wday.done::after { right: auto; left: 6px; }
[dir=rtl] .wday .tagdot { left: auto; right: 6px; }
[dir=rtl] .ricon, [dir=rtl] .bm-key, [dir=rtl] .managed-badge b, [dir=rtl] .rx .stat b, [dir=rtl] .diff .v s { margin-right: 0; margin-left: 4px; }
[dir=rtl] .wk-set.child { margin-left: 0; margin-right: 22px; }
[dir=rtl] .wk-rest-t { margin-right: 0; margin-left: auto; }
[dir=rtl] .xsteps, [dir=rtl] .wk-open, [dir=rtl] .wk-prog, [dir=rtl] .plan-slots, [dir=rtl] .io-list, [dir=rtl] .db-l { padding-left: 0; padding-right: 18px; }
[dir=rtl] .row.slot .grip { padding-right: 0; padding-left: 8px; }
[dir=rtl] .md-del { right: auto; left: 2px; }
[dir=rtl] .setpage > summary .sp-chev { transform: scaleX(-1); }
[dir=rtl] .setpage[open] > summary .sp-chev { transform: rotate(90deg); }
[dir=rtl] .tab .dot { margin-left: 0; margin-right: 18px; }

/* P2 batch 1 */
.wk-name { all: unset; font-weight: 700; cursor: text; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px dashed transparent; }
.wk-name:hover, .wk-name:focus-visible { border-bottom-color: currentColor; }
.wk-diff { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.xm-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.xm-spark { grid-column: 1 / -1; width: 100%; height: 20px; stroke: var(--accent, #7cf); stroke-width: 1.5; }
.xa-id { font-size: .85em; user-select: all; }
kbd { font: inherit; font-size: .85em; padding: 1px 6px; border: 1px solid currentColor; border-radius: 4px; opacity: .85; }

/* P2 batch 2: programmes, phases, intervals, alternatives */
.pgstrip { display: flex; gap: 4px; flex-wrap: wrap; }
.pgw { min-width: 28px; text-align: center; padding: 4px 0; border-radius: 6px; background: var(--surface-2); font-size: 12px; }
.pgw.deload { background: var(--surface-3); }
.pgw.rest { opacity: .55; }
.pgw.now { outline: 2px solid var(--text); font-weight: 700; }
.wk-phase { margin: 18px 4px 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wk-prog { margin: 6px 12px 0; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.wk-set.check-item .wk-cells { padding-left: 4px; }
.check-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.alt-res { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.grp-row { margin-top: 8px; }
.input.num.sm { width: 56px; display: inline-block; padding: 4px 6px; }
.wk-rest.interval b { font-variant-numeric: tabular-nums; }

/* P2-3 insights: fatigue bands (STA-07), detraining status (STA-08), histograms (STA-10/12) */
.bodymap .bm-band-fresh, .bm-key.bm-band-fresh { fill: rgb(var(--tint)); background: rgb(var(--tint)); fill-opacity: .35; }
.bodymap .bm-band-normal, .bm-key.bm-band-normal { fill: rgb(var(--tint)); background: rgb(var(--tint)); fill-opacity: .6; }
.bodymap .bm-band-high, .bm-key.bm-band-high { fill: rgb(var(--tint)); background: rgb(var(--tint)); fill-opacity: .8; }
.bodymap .bm-band-very-high, .bm-key.bm-band-very-high { fill: rgb(var(--tint)); background: rgb(var(--tint)); fill-opacity: .95; }
.bodymap .bm-st-trained, .bm-key.bm-st-trained { fill: rgb(var(--tint)); background: rgb(var(--tint)); opacity: .3; }
.bodymap .bm-st-slipping, .bm-key.bm-st-slipping { fill: rgb(var(--tint)); background: rgb(var(--tint)); opacity: .6; }
.bodymap .bm-st-detraining, .bm-key.bm-st-detraining { fill: rgb(var(--tint)); background: rgb(var(--tint)); }
/* UX-B12: legend keys are boxes (no fill-opacity), so give each level its own grey — readable in light and dark. */
.bm-key.bm-band-fresh { background: rgb(var(--tint) / .2); fill-opacity: 1; border: 1px solid rgb(var(--tint) / .45); }
.bm-key.bm-band-normal { background: rgb(var(--tint) / .45); }
.bm-key.bm-band-high { background: rgb(var(--tint) / .7); }
.bm-key.bm-band-very-high { background: rgb(var(--tint)); }
.bm-key.bm-st-trained { opacity: 1; background: rgb(var(--tint) / .2); border: 1px solid rgb(var(--tint) / .45); }
.bm-key.bm-st-slipping { opacity: 1; background: rgb(var(--tint) / .55); }
.bm-key.bm-st-detraining { opacity: 1; background: rgb(var(--tint)); }
.st-empty h2 { font-size: 18px; }
.st-ins-tabs { flex-wrap: wrap; margin-bottom: 10px; }
.st-spark { color: var(--accent); vertical-align: middle; margin: 0 8px; }
.st-hist { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-bottom: 16px; }
.st-hist > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.st-hist span { display: block; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.st-hist i { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 10px; font-style: normal; color: var(--muted); }
.st-detrain details summary { display: flex; justify-content: space-between; cursor: pointer; }
.st-detrain details ul { list-style: none; padding: 4px 0 4px 10px; margin: 0; }
.st-detrain details li { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.st-weak { background: var(--bg-2); border-radius: 8px; padding: 8px 10px; }
.wk-share-canvas { display: none; }

/* P2 batch 4: membership cards (CHK-01/02), guest banner (ACC-06) */
.gymcard { background: #fff; color: #000; border-radius: 16px; padding: 20px 16px; text-align: center; }
.gymcard .code-svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; }
.gymcard .code-svg.bars { height: 140px; }
.gymcard-v { font: 600 18px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; margin: 14px 0 4px; word-break: break-all; color: #000; }
.gymcard + .fine, .gymcard .fine { color: #555; }
.gym-home { display: block; width: 100%; text-align: left; margin-top: 12px; border: 1px solid var(--line, #333); cursor: pointer; color: inherit; }
.linkish { background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.guest-banner { border: 1px solid var(--accent, #c6f432); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }

/* Sign in with Apple (HIG web button): Apple logo + "Sign in with Apple", system font, 44px+ tall
   (matches .btn 48px), same radius/width as the magic-link button. White on our dark theme,
   black on the light theme, per Apple's black/white styles. */
.btn.apple-signin {
  margin-top: 10px; background: #fff; color: #000; border: 1px solid #fff; text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500; font-size: 17px; letter-spacing: -0.01em; gap: 6px; min-height: 48px;
}
.btn.apple-signin .apple-logo { flex: none; margin-top: -2px; }
:root[data-theme="light"] .btn.apple-signin { background: #000; color: #fff; border-color: #000; }
.btn.apple-signin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sign in with Google (Google Identity branding): standard "G" logo, "Sign in with Google",
   Roboto Medium (system fallback), 48px like our buttons. Dark theme = Google dark
   (#131314 / #8E918F stroke / #E3E3E3 text); light theme = Google light (#FFF / #747775 / #1F1F1F). */
.btn.google-signin {
  margin-top: 10px; background: #131314; color: #E3E3E3; border: 1px solid #8E918F; text-decoration: none;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 500; font-size: 14px; letter-spacing: .25px; gap: 10px; min-height: 48px; padding: 0 12px;
}
.btn.google-signin .google-logo { flex: none; }
:root[data-theme="light"] .btn.google-signin { background: #FFFFFF; color: #1F1F1F; border-color: #747775; }
.btn.google-signin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- light-mode logo (white SVG → ink) */

/* ---------------------------------------------------------------- UX pass: focus, tap targets, motion */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-today { min-height: 36px; }
.empty { line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------------------------------------------------------------- desktop layout (>=1024px) */
.side-brand { display: none; }
@media (min-width: 1024px) {
  .shell { max-width: none; margin: 0; padding: 0 0 32px 248px; }
  .topbar { padding: 20px 40px 14px; }
  .topbar h1 { font-size: 28px; }
  main { padding: 8px 40px 40px; max-width: 1180px; }
  .tabbar {
    top: 0; bottom: 0; right: auto; width: 248px; padding: 24px 16px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--bg-2); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tabbar-inner { max-width: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  .side-brand { display: block; padding: 4px 12px 20px; order: -2; }
  .side-brand .logo-word { --h: 26px; }
  .tab-wrap { justify-content: stretch; }
  .tab {
    flex-direction: row; justify-content: flex-start; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
    border-radius: var(--radius); font-size: 15px; letter-spacing: 0;
  }
  .tab span { font-size: 15px; }
  .tab:hover { background: var(--surface-2); color: var(--text); }
  .tab[aria-current="page"] { background: var(--surface-2); }
  .tab .dot { position: static; margin: 0 0 0 auto; }
  .fab { order: -1; width: 100%; height: 44px; border-radius: var(--radius); margin: 0 0 16px; justify-self: stretch; }
  .fab::after { content: "Log"; font-weight: 600; margin-left: 8px; }
  .fab { display: flex; align-items: center; justify-content: center; }
  .composer { left: 248px; bottom: 0; padding: 12px 40px 20px; }
  .composer-inner { max-width: 740px; margin: 0; }
  .sheet { max-width: 720px; }
  main.v-coach { max-width: 820px; padding-bottom: 180px; }
  main.v-today, main.v-plan {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start;
  }
  main.v-today > *, main.v-plan > * { min-width: 0; }
  main.v-today > .section:first-child, main.v-plan > .section:first-child, main.v-today > .guest-banner { grid-column: 1 / -1; }
  main.v-settings { max-width: 760px; }
  .sheet { bottom: auto; top: 50%; left: 50%; right: auto; width: min(720px, calc(100vw - 64px));
    transform: translate(-50%, -46%); opacity: 0; border-radius: 12px; border: 1px solid var(--line-2); max-height: 86dvh; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
  #toast { left: calc(50% + 124px); }
}
@media (min-width: 1440px) {
  main.v-today { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- v2 sign-in */
.login-sso { display: flex; flex-direction: column; gap: 10px; }
.login-sso:empty + .or { display: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0 6px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login details.other { margin-top: 18px; }
.login details.other > summary { min-height: var(--tap); display: flex; align-items: center; color: var(--text-2); font-weight: 600; }
.other-body { padding-left: 12px; border-left: 1px solid var(--line); }

/* ---------------------------------------------------------------- v2 Today */
.nextup-card { display: grid; gap: 4px; }
.nextup-card .kicker { font: 600 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nextup-card h3 { margin: 2px 0 0; font: 750 22px/1.2 var(--font-display); letter-spacing: -.01em; }
.nextup-card p { margin: 0 0 10px; }
.nextup-card .btn { justify-self: start; min-height: var(--tap); padding: 0 18px; }
.macros-compact { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.mc-kcal { display: grid; }
.mc-kcal b { font: 750 28px/1 var(--font-display); }
.mc-kcal span { color: var(--muted); font-size: 13px; }
.mc-kcal small { color: var(--text-2); font-size: 12px; margin-top: 4px; }
.mc-bars { display: grid; gap: 8px; min-width: 0; }
.mm-t { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.mm-t b { color: var(--text); font-size: 13px; } .mm-t small { color: var(--muted); font-weight: 500; }
.mm-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 3px; }
.mm-bar i { display: block; height: 100%; background: var(--text); border-radius: inherit; }
details.fold > summary { list-style: none; cursor: pointer; min-height: var(--tap); }
details.fold > summary::-webkit-details-marker { display: none; }
.fold-chev { margin-left: 8px; color: var(--muted); transition: transform .15s; display: inline-block; }
details.fold[open] .fold-chev { transform: rotate(90deg); }
details.fold > summary .meta { margin-left: auto; }
.card.empty { display: grid; gap: 10px; justify-items: center; text-align: center; }
.card.empty p { margin: 0; }
@media (min-width: 1024px) {
  main.v-today > .nextup, main.v-today > .nextup + .section { grid-column: 1 / -1; }
}
@media (min-width: 1440px) {
  main.v-today > .nextup { grid-column: 1 / 3; }
  main.v-today > .nextup + .section { grid-column: 3 / 4; }
}

/* ---------------------------------------------------------------- tablet icon rail (768–1023px) */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .shell { max-width: none; margin: 0; padding: 0 0 32px 88px; }
  main { padding: 8px 32px 40px; max-width: 760px; }
  .topbar { padding: 16px 32px 12px; }
  .tabbar { top: 0; bottom: 0; right: auto; width: 88px; padding: 16px 8px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--bg-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar-inner { max-width: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
  .fab { order: -1; width: 56px; height: 56px; margin: 0 auto 14px; }
  .tab { min-height: 60px; border-radius: var(--radius); width: 72px; margin: 0 auto; }
  .tab:hover, .tab[aria-current="page"] { background: var(--surface-2); }
  .tab .dot { margin-left: 22px; }
  .composer { left: 88px; bottom: 0; padding: 10px 32px 18px; }
  .composer-inner { max-width: 760px; margin: 0; }
  main.v-coach { padding-bottom: 170px; }
  .sheet { left: 88px; }
}

/* ---------------------------------------------------------------- v2 onboarding */
.login.onb { justify-content: flex-start; max-width: 560px; }
.onb-top { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); margin-bottom: 8px; }
.onb-dots { display: flex; gap: 6px; } .onb-dots i { width: 28px; height: 4px; border-radius: 99px; background: var(--surface-3); }
.onb-dots i.on { background: var(--text); }
.choice-list { display: grid; gap: 10px; }
.choice { text-align: left; display: grid; gap: 2px; min-height: 64px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); }
.choice small { color: var(--muted); font-size: 13px; }
.choice[aria-checked="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.day-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.choice.sm { text-align: center; justify-items: center; min-height: 72px; }
.choice.sm b { font: 750 24px/1 var(--font-display); }
.onb-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.onb-nav .btn { min-width: 120px; min-height: 48px; }

/* ---------------------------------------------------------------- v2 paywall */
.paywall { display: grid; gap: 16px; margin-top: 14px; }
.pw-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .pw-plans { grid-template-columns: 1fr; } }
.pw-plan { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; align-content: start; background: var(--surface); }
.pw-plan.featured { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.pw-plan p { margin: 0 0 6px; }
.pw-name { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pw-price b { font: 750 30px/1 var(--font-display); } .pw-price span { color: var(--muted); margin-left: 4px; }
.pw-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pw-table th, .pw-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.pw-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; }
.pw-table tbody th { text-align: left; font-weight: 500; }
.pw-table td { text-align: center; width: 26%; }
.pw-table .yes { font-weight: 700; } .pw-table .no { color: var(--muted-2); } .pw-table .txt { font-size: 12px; color: var(--text-2); }
.pw-demo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.pw-demo small { display: block; color: var(--muted); font-size: 12px; }

/* strictly mono (Giovanni, 2026-10-13): links, focus rings and form controls never pick up a hue */
a { color: inherit; }
:focus-visible { outline-color: var(--text); }
input[type=checkbox], input[type=radio], input[type=range], progress { accent-color: var(--text); }

/* logo placements: mobile header + clear space (≥ half the logo height) */
.top-brand { display: none; }
@media (max-width: 767.98px) { .top-brand { display: block; margin: 0 0 10px; } .top-brand .logo-word { --h: 20px; } }
.mark .logo-word.lg { margin-bottom: 8px; }
.paywall .logo-word { --h: 22px; margin-bottom: 4px; }
@media (min-width: 768px) and (max-width: 1023.98px) { .side-brand { display: block; order: -2; padding: 0 0 14px; } .side-brand .logo-word { --h: 12px; margin: 0 auto; } }
.topbar { flex-wrap: wrap; } .top-brand { flex-basis: 100%; }
.onb-brand { margin-bottom: 20px; }

/* FOOD-1 Food tab (mono) */
.tabbar-inner { grid-template-columns: repeat(7, 1fr); }
@media (max-width: 420px) { .tab span { font-size: 10px; } .tab svg { width: 21px; height: 21px; } }
.fd-date { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 4px; }
.fd-date b { min-width: 120px; text-align: center; font-weight: 700; }
.fd-sum { display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center; }
.fd-macros { display: flex; justify-content: space-around; gap: 8px; }
.fd-ring { position: relative; display: inline-grid; place-items: center; }
.fd-ring .track { stroke: var(--surface-3); }
.fd-ring .val { stroke: var(--text); transition: stroke-dashoffset .5s; }
.fd-ring.over .val { stroke: var(--muted); }
.fd-ring-l { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.fd-ring-l b { font-weight: 800; font-size: 13px; line-height: 1; }
.fd-ring-l span { font-size: 9px; color: var(--muted); margin-top: 2px; }
.fd-ring.big .fd-ring-l b { font-size: 24px; }
.fd-ring.big .fd-ring-l span { font-size: 11px; }
.fd-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pill { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--text); }
.pill.sm { font-size: 10px; padding: 0 6px; vertical-align: middle; }
.fd-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.fd-quick .btn { min-height: 40px; padding: 0 6px; font-size: 14px; }
.fd-more { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 10px 0 4px; color: var(--muted); font-size: 14px; }
.fd-repeat { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fd-water { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fd-water .bar, .fd-mi .bar { flex: 1 1 100%; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.fd-water .fill, .fd-mi .fill { height: 100%; background: var(--text); }
.fd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fd-chips .chip { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 8px 12px; font-weight: 600; }
.fd-micros { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.fd-mi { display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; font-size: 13px; }
.fd-mi small { color: var(--muted); }
.fd-ex { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fd-ex b { display: block; font-size: 22px; font-weight: 800; }
.fd-ex span { font-size: 12px; color: var(--muted); }
.fd-amt, .fd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.fd-grid label { font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.fd-attr { text-align: center; margin: 18px 0 8px; color: var(--muted-2); }
#fd-res { max-height: 55vh; overflow: auto; }

/* PLAN-GEN: generate-plan sheet (black/white/greys only) */
.pg .pg-f { margin: 14px 0; }
.pg .pg-l { font: 600 13px/1.3 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.pg .seg { flex-wrap: wrap; margin-bottom: 6px; }
.pg .pg-n { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.pg .pg-n .input { width: 96px; }
.pg .pg-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 6px; }
.pg .fine { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.pg .pg-ex { list-style: none; margin: 0; padding: 0; }
.pg .pg-ex li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pg .pg-ex li:first-child { border-top: 0; }
.onb .onb-gen { margin-top: 12px; }
/* WRK-LOG: sets the coach logged (history detail + chat confirmation card); greys only */
.hs-sets li { flex-wrap: wrap; }
.hs-coach { font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.hs-src { flex-basis: 100%; margin: 0 0 0 28px; font-size: 13px; color: var(--muted); font-style: italic; }
.hs-src::before, .hs-src::after { content: "\201C"; }
.hs-src::after { content: "\201D"; }
.logcard { margin: 6px 0 12px; }
.logcard .hs-sets li { border-bottom: 0; padding: 3px 0; }
/* FOOD-UNDO / FOOD-SRC */
.fd-del { color: var(--destructive, #b91c1c); }
.fd-src { margin-top: 3px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.fd-src .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.logcard.choice .opt-grid { margin: 10px 0 0; }
.hs-exh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* UX-B11: generator's rarely-changed inputs, and the onboarding step that embeds it */
.pg-more { margin: 8px 0 14px; }
.pg-more > summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--muted); }
.onb .pg { text-align: start; }
.fd-adj { margin: 8px 0 0; }

/* Oct 17: one mic in the workout — a button, a hint, no text field */
.wk-voice { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0 6px; }
.wk-mic { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2, #1a1a1a); color: var(--text, #fff); display: grid; place-items: center; cursor: pointer; }
.wk-mic svg { width: 28px; height: 28px; }
.wk-mic.hot { background: var(--text, #fff); color: var(--bg, #000); box-shadow: 0 0 0 6px rgba(128, 128, 128, 0.3); }
.wk-mic:disabled { opacity: 0.5; }
.wk-mic-hint { margin: 0; text-align: center; color: var(--muted); font-size: 13px; max-width: 320px; }
.wk-voice-say { margin: 6px 0 0; text-align: center; font-size: 14px; }

/* 16+ age check (before onboarding): mono like the rest of the flow */
.login.age .age-q { margin: 6px 0 10px; font-weight: 600; color: var(--text); }
.login.age .age-yn { grid-template-columns: 1fr 1fr; }
.login.age .age-yn .choice.sm { min-height: 52px; align-content: center; }
.login.age .age-yn .choice.sm b { font: 650 17px/1.2 var(--font-body, inherit); }
.login.age .age-nav { display: block; margin-top: 8px; }
