/* Setlist. Dark-first palette; light palette for system light or explicit choice. */
:root {
  color-scheme: dark;
  --page: #0A0C11; --bg: #0F1117; --panel: #161922; --card: #1C202B; --line: #2A2F3E;
  --ink: #EEF0F7; --mute: #8D94A9; --faint: #7A8196; --on: #0B0D12;
  --push: #FF8A3D; --pull: #22C7B8; --legs: #9B8CFF; --upper: #4DA8FF; --legsb: #FF5FA2; --arms: #F5C542; --rest: #5B6277;
  --up: #3DDC84; --flat: #FFC145; --down: #FF5A6E;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #E4E7EF; --bg: #F2F3F8; --panel: #FFFFFF; --card: #F7F8FB; --line: #DADEE8;
    --ink: #141722; --mute: #5A6177; --faint: #767C90; --on: #FFFFFF;
    --push: #D65F14; --pull: #0A8C81; --legs: #6553DD; --upper: #1C73C7; --legsb: #C92C71; --arms: #9A7300; --rest: #7C8296;
    --up: #138A4B; --flat: #9A6C00; --down: #D42C45;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #E4E7EF; --bg: #F2F3F8; --panel: #FFFFFF; --card: #F7F8FB; --line: #DADEE8;
  --ink: #141722; --mute: #5A6177; --faint: #767C90; --on: #FFFFFF;
  --push: #D65F14; --pull: #0A8C81; --legs: #6553DD; --upper: #1C73C7; --legsb: #C92C71; --arms: #9A7300; --rest: #7C8296;
  --up: #138A4B; --flat: #9A6C00; --down: #D42C45;
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow-wrap: anywhere; background: var(--page); color: var(--ink); font-family: var(--body); font-size: 0.9375rem; line-height: 1.45; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--upper); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
body { display: block; }
#app { --c: var(--push); height: 100%; height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 600px) { #app { border-inline: 1px solid var(--line); } }
.bar { display: flex; align-items: center; gap: 8px; padding: calc(12px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 16px 8px; background: var(--bg); }
.bar-t { flex: 1; min-width: 0; }
.bar-t h1 { font-family: var(--display); font-weight: 700; font-size: 1.6875rem; letter-spacing: .01em; margin: 0; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t small { display: flex; align-items: center; gap: 4px; color: var(--mute); font-size: 0.75rem; margin-bottom: 2px; flex-wrap: wrap; }
.bar-r { display: flex; gap: 6px; align-items: center; }
#screen > * { flex-shrink: 0; }
#screen { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 20px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; outline: none; }
.tabs { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--panel); border-top: 1px solid var(--line); padding: 5px 4px calc(6px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }
.tabs a { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; font-size: 0.75rem; min-width: 0; font-weight: 500; color: var(--mute); border-radius: 12px; }
.tabs a svg { width: 23px; height: 23px; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] svg { color: var(--c); }
.tabs .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--up); visibility: hidden; }
.tabs a.live .dot { visibility: visible; }

.iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); flex: none; text-decoration: none; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.sm { width: 30px; height: 30px; border-radius: 9px; }
.iconbtn.sm svg { width: 16px; height: 16px; }
.chipbtn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 5px 10px 5px 7px; font-size: 0.7812rem; font-weight: 700; }
.chipbtn svg { width: 17px; height: 17px; color: var(--c); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--mute); font-size: 0.75rem; display: inline-flex; align-items: center; gap: 3px; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn svg { width: 13px; height: 13px; }
.wz-hero .linkbtn { min-height: 44px; margin-top: 2px; }
.linkbtn.center { align-self: center; padding: 8px; }
.linkbtn.danger, .li.danger b { color: var(--down); }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: color-mix(in srgb, var(--k, var(--mute)) 16%, transparent); color: color-mix(in srgb, var(--k, var(--mute)) 72%, var(--ink)); vertical-align: 1px; }
.pill svg { width: 12px; height: 12px; }
.lbl { font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 4px 2px 0; }
.lbl.in { margin: 10px 12px 2px; }
.fine { font-size: 0.75rem; color: var(--mute); margin: 0; }
.grow { flex: 1; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin: 0; padding: 0; }
.box.pad { padding: 10px 12px; }
.box.pad0 { padding-bottom: 6px; }
.empty { text-align: center; padding: 28px 12px; color: var(--mute); }
.empty b { display: block; color: var(--ink); font-size: 0.9375rem; margin-bottom: 4px; }
.empty p { margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rrow > span, .rrow > label { font-size: 0.7812rem; color: var(--mute); }
.pals { display: flex; flex-wrap: wrap; gap: 4px; }
.palsw { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; min-height: 44px; padding: 4px; background: none; border: 0; color: var(--mute); font: inherit; font-size: 0.75rem; cursor: pointer; }
.palsw i { position: relative; display: block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--line-ctl); }
.palsw i b { position: absolute; top: 0; right: 0; width: 50%; height: 100%; }
.palsw[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.palsw[aria-pressed="true"] i { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--c); }
.rrow input[type="color"] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--line-ctl); border-radius: 10px; background: var(--card); cursor: pointer; }

.btn { width: 100%; border: 0; border-radius: 14px; padding: 13px; font-weight: 700; font-size: 0.9375rem; background: var(--c); color: var(--on); display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; text-align: center; }
.btn svg { width: 18px; height: 18px; }
.btn small { font-weight: 500; opacity: .85; }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--down); }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; font-size: 0.75rem; font-weight: 700; color: var(--mute); white-space: nowrap; }
.mini.go { color: var(--up); border-color: var(--up); }
.mini[aria-pressed="true"] { --k: var(--down); background: color-mix(in srgb, var(--k) 16%, transparent); border-color: var(--k); color: var(--k); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 2px; flex: none; }
.seg button { background: none; border: 0; padding: 5px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; color: var(--mute); min-width: 32px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg.sm button { padding: 3px 8px; font-size: 0.75rem; min-width: 26px; }
.inp { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; color: var(--ink); resize: vertical; }
.inp.sm { width: 96px; padding: 6px 9px; text-align: right; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 0.75rem; color: var(--mute); font-weight: 500; }

/* ---------- today ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.days a { --k: var(--rest); text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0 5px; display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative; min-width: 0; }
.days b { font-family: var(--display); font-size: 1.0625rem; line-height: 1; }
.days span { font-size: 0.75rem; font-weight: 700; letter-spacing: .03em; color: var(--k); text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.days a[aria-current="date"] { background: var(--k); border-color: var(--k); color: var(--on); }
.days a[aria-current="date"] span { color: var(--on); }
.days a.is-today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.days a.is-done::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--up); }

.hero { background: var(--c); color: var(--on); border-radius: 18px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -30px; top: -40px; width: 150px; height: 150px; border-radius: 50%; border: 22px solid color-mix(in srgb, var(--on) 12%, transparent); pointer-events: none; }
.hero h2 { font-family: var(--display); font-size: 2.625rem; font-weight: 700; line-height: .9; margin: 0; letter-spacing: .01em; text-transform: uppercase; }
.hero p { margin: 0; font-size: 0.7812rem; opacity: .93; }
.hero .meta { grid-column: 1 / -1; display: flex; gap: 14px; margin-top: 8px; font-size: 0.75rem; flex-wrap: wrap; }
.hero .meta b { font-family: var(--display); font-size: 1.25rem; display: block; line-height: 1; }

.box.ready { padding: 10px 12px; display: grid; gap: 8px; }
.warn { --k: var(--flat); display: flex; gap: 8px; align-items: flex-start; font-size: 0.7812rem; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--k) 14%, transparent); }
.warn b { color: var(--k); white-space: nowrap; }
.banner, .resume, .donecard { --k: var(--flat); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--k) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--k) 45%, transparent); text-decoration: none; }
.banner > span:first-child, .resume > span:first-child, .donecard > span { flex: 1; min-width: 0; }
.banner b, .resume b, .donecard b { display: block; font-size: 0.8438rem; }
.banner small, .resume small, .donecard small { display: block; color: var(--mute); font-size: 0.75rem; }
.bcol { display: flex; flex-direction: column; gap: 5px; }
.donecard > svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--up); color: var(--on); flex: none; }
.resume { --k: var(--up); }

.sug li { list-style: none; border-top: 1px solid var(--line); }
.sug li:first-child { border-top: 0; }
.sug button.head { width: 100%; background: none; border: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 10px 12px; }
.sug .name { font-weight: 700; font-size: 0.8438rem; }
.sug .last { font-size: 0.75rem; color: var(--mute); }
.sug .to { grid-row: 1 / 3; grid-column: 2; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.sug .to .num { font-size: 1.3125rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.sug .to .num small { font-family: var(--body); font-size: 0.75rem; color: var(--mute); font-weight: 500; margin-left: 2px; }
.sug .why { font-size: 0.7812rem; color: var(--mute); padding: 0 12px 10px; margin: 0; }
.sug .why a { color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; }
.sug .why a svg { width: 13px; height: 13px; }
.rir { color: var(--ink); }
.grp { font-style: normal; font-family: var(--display); font-size: 0.75rem; font-weight: 700; background: var(--upper); color: var(--on); border-radius: 5px; padding: 0 5px; margin-right: 6px; vertical-align: 1px; }
.cta { position: sticky; bottom: -20px; margin-top: auto; padding: 8px 0 20px; margin-bottom: -20px; background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------- lists & sheets ---------- */
.list { display: flex; flex-direction: column; }
.list.scroll { max-height: 48vh; overflow-y: auto; }
.li { --k: var(--mute); display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); padding: 11px 12px; text-align: left; text-decoration: none; }
.li:first-child { border-top: 0; }
.li > span { flex: 1; min-width: 0; }
.li b { display: block; font-size: 0.875rem; }
.li small { display: block; color: var(--mute); font-size: 0.75rem; }
.li > svg { width: 18px; height: 18px; color: var(--mute); flex: none; }
.li[aria-pressed="true"] b { color: var(--up); }
.sw { --k: var(--mute); width: 11px; height: 11px; border-radius: 50%; background: var(--k); flex: none; display: inline-block; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { background: var(--panel); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); display: grid; gap: 12px; animation: rise .2s ease; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto; }
.sh-title { font-family: var(--display); font-size: 1.5rem; margin: 0; line-height: 1.05; text-wrap: balance; }
.sh-body { margin: -6px 0 0; color: var(--mute); font-size: 0.8125rem; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
#toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 12px; font-size: 0.8125rem; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 0 0 2px color-mix(in srgb, var(--k) 70%, transparent); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- workout ---------- */
.sbar { display: flex; gap: 8px; align-items: center; }
.sbar .num { font-size: 1rem; }
.prog { height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; flex: 1; }
.prog i { display: block; height: 100%; background: var(--c); border-radius: 9px; transition: width .3s; }
.exc { padding: 10px 12px 12px; display: grid; gap: 8px; }
.exc header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.exc :is(h2, h3) { margin: 0; font-size: 0.9062rem; }
.exc :is(h2, h3) a { text-decoration: none; }
.exc header p { margin: 1px 0 0; font-size: 0.75rem; color: var(--mute); }
.hdr-r { display: flex; align-items: center; gap: 6px; flex: none; max-width: 100%; min-width: 0; }
.exc header { flex-wrap: wrap; }
.exc header > div { min-width: 0; }
.hdr-r .whybtn { min-width: 0; }
.hdr-r .whybtn .pill { white-space: normal; overflow-wrap: anywhere; text-align: start; }
.whyd { font-size: 0.75rem; color: var(--mute); margin-top: -4px; }
.whyd summary { cursor: pointer; width: max-content; }
.whyd p { margin: 4px 0 0; }
.helper { margin: -2px 0 0; font-size: 0.75rem; color: var(--mute); }
.helper b { color: var(--ink); }
.sets { display: grid; gap: 5px; }
.set-unit { grid-column: 2 / 4; justify-self: start; min-height: 36px; padding: 4px 10px; margin-bottom: 4px; }
.set { display: grid; grid-template-columns: 22px 1fr 1fr 42px; gap: 6px; align-items: center; }
.set .i { font-family: var(--display); font-size: 0.9375rem; color: var(--mute); text-align: center; }
.set.warm .i { color: var(--flat); }
.set.warm .step { opacity: .8; border-style: dashed; }
.step { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; height: 40px; }
.step button { background: none; border: 0; height: 100%; font-size: 1.125rem; color: var(--mute); }
.step input { width: 100%; min-width: 0; border: 0; background: none; text-align: center; font-family: var(--display); font-size: 1.25rem; font-weight: 600; color: var(--ink); padding: 0; -moz-appearance: textfield; appearance: textfield; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step input::placeholder, .inp::placeholder { color: var(--faint); }
.check { height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--faint); padding: 0; }
.check svg { width: 18px; height: 18px; }
.set.done .check, .check[aria-pressed="true"] { background: var(--up); border-color: var(--up); color: var(--on); }
.set.done .step { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.set.edit { grid-template-columns: 22px 1fr 1fr 42px; }
.set.edit .inp { text-align: center; font-family: var(--display); font-size: 1.125rem; padding: 6px; }
.enote { margin: 0; font-size: 0.7812rem; color: var(--mute); border-left: 3px solid var(--line); padding-left: 8px; white-space: pre-wrap; }
.exf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notesbox { padding: 4px 12px 12px; display: grid; gap: 8px; }

#timer { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--ink); color: var(--bg); }
#timer.over { background: var(--up); color: #07130c; }
#timer .num { font-size: 1.625rem; font-weight: 700; min-width: 58px; }
#timer .t { flex: 1; font-size: 0.75rem; line-height: 1.25; min-width: 0; }
#timer .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#timer button { background: color-mix(in srgb, currentColor 16%, transparent); border: 0; color: inherit; border-radius: 9px; padding: 7px 10px; font-size: 0.7812rem; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.kpi b { font-family: var(--display); font-size: 1.5625rem; display: block; line-height: 1.05; }
.kpi b small { font-size: 0.9375rem; color: var(--mute); }
.kpi span { font-size: 0.75rem; color: var(--mute); }
.prbox { padding: 4px 12px 10px; }
.prbox p:not(.lbl) { margin: 4px 0 0; font-size: 0.8125rem; color: var(--flat); font-weight: 700; }
.nt { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 0.8125rem; padding: 8px 12px; border-top: 1px solid var(--line); }
.nt b { text-align: right; }
.t-load { color: var(--up); } .t-hold, .t-log { color: var(--flat); }

/* ---------- history ---------- */
.cal { padding: 10px 12px; display: grid; gap: 6px; }
.cap { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75rem; color: var(--mute); flex-wrap: wrap; }
.cap b { color: var(--ink); font-size: 0.8125rem; }
.cal .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .g > * { aspect-ratio: 1; border-radius: 7px; background: var(--card); display: grid; place-items: center; font-size: 0.75rem; color: var(--faint); text-decoration: none; }
.cal .g .on { background: var(--k); color: var(--on); font-weight: 700; }
.cal .g .now { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal .g .fut { opacity: .4; }
.cal .g .h { background: none; font-weight: 700; color: var(--mute); aspect-ratio: auto; }
.hist li { list-style: none; border-top: 1px solid var(--line); }
.hist li:first-child { border-top: 0; }
.hist a { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; text-decoration: none; }
.hist .dt { text-align: center; line-height: 1; }
.hist .dt b { font-family: var(--display); font-size: 1.375rem; display: block; }
.hist .dt span { font-size: 0.75rem; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.hist .mid { min-width: 0; }
.hist .w { font-size: 0.8438rem; font-weight: 700; }
.hist .s { font-size: 0.75rem; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stbl { border-collapse: collapse; font-size: 0.8125rem; width: auto; }
.stbl td { padding: 2px 8px 2px 0; }
.stbl td:first-child { color: var(--mute); font-family: var(--display); width: 22px; }
.stbl .num { font-size: 1.0625rem; }
.stbl tr.skip { color: var(--faint); text-decoration: line-through; }
.stbl tr.warm td { color: var(--flat); }
.meta-l { margin: 0; font-size: 0.7812rem; color: var(--mute); }

/* ---------- charts ---------- */
.chartsvg { width: 100%; height: auto; display: block; }
.chartsvg text { font-family: var(--body); }
.spark { width: 64px; height: 28px; flex: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- tap targets (≥40px) ---------- */
.mini { min-height: 40px; }
.iconbtn.sm { width: 38px; height: 38px; }
.seg button { min-height: 34px; }
.seg.sm button { min-height: 34px; min-width: 34px; }
.step { grid-template-columns: 36px 1fr 36px; height: 42px; }
.check { height: 42px; }
.chipbtn { min-height: 40px; }
.linkbtn { min-height: 32px; }
.bar-t small .linkbtn { min-height: 28px; padding: 4px 6px 4px 0; }
#timer button { min-height: 40px; }
.whyd summary { padding: 6px 0; }

/* ---------- insights ---------- */
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tally div { --k: var(--up); border-radius: 12px; padding: 8px 10px; background: color-mix(in srgb, var(--k) 14%, transparent); }
.tally b { font-family: var(--display); font-size: 1.75rem; line-height: 1; color: color-mix(in srgb, var(--k) 80%, var(--ink)); display: block; }
.tally span { font-size: 0.75rem; }
.mus li { list-style: none; border-top: 1px solid var(--line); }
.mus li:first-child { border-top: 0; }
.mus li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; align-items: center; text-decoration: none; }
.mus .t { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.8438rem; flex-wrap: wrap; }
.mus .d { font-size: 0.75rem; color: var(--mute); grid-column: 1; }
.mus .spark { grid-row: 1 / 3; grid-column: 2; }
.focus li { list-style: none; border-top: 1px solid var(--line); }
.focus li:first-child { border-top: 0; }
.focus li > a, .focus li > div { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 12px; font-size: 0.7812rem; color: var(--mute); text-decoration: none; }
.focus .ic { --k: var(--upper); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--k) 16%, transparent); color: color-mix(in srgb, var(--k) 80%, var(--ink)); font-family: var(--display); font-weight: 700; font-size: 0.9375rem; }
.focus b { display: block; font-size: 0.8125rem; color: var(--ink); margin-bottom: 1px; }
.chart { padding: 10px 12px; display: grid; gap: 6px; }
.chart .seg { justify-self: start; }
.vol { padding: 10px 12px; display: grid; gap: 6px; }
.vrow { display: grid; grid-template-columns: 82px 1fr 40px; gap: 8px; align-items: center; font-size: 0.75rem; }
.vtrack { position: relative; height: 12px; border-radius: 6px; background: var(--card); overflow: hidden; }
.vtrack .band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--up) 14%, transparent); }
.vtrack i { position: absolute; left: 0; border-radius: 4px; }
.vtrack i.plan { top: 1px; bottom: 1px; border: 1.5px dashed var(--faint); border-radius: 5px; }
.vtrack i.done { top: 3px; bottom: 3px; background: var(--upper); }
.vrow .num { font-size: 0.9375rem; text-align: right; }
.vrow .num small { color: var(--mute); font-size: 0.75rem; }
.stat { padding: 10px 12px; display: grid; gap: 2px; text-decoration: none; }
.stat .lbl { margin: 0; }
.stat b { font-size: 1.75rem; line-height: 1.05; }
.stat b small { font-size: 0.875rem; color: var(--mute); font-family: var(--body); }
.tblwrap { overflow-x: auto; }
.xtbl { width: 100%; border-collapse: collapse; font-size: 0.7812rem; }
.xtbl th { text-align: left; font-size: 0.75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 8px 10px 4px; font-weight: 700; }
.xtbl td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.xtbl td a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.xtbl .num { font-size: 1rem; }
.addrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.addrow .btn { width: auto; padding: 10px 16px; }
.cform { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .mini[aria-pressed="true"] { --k: var(--c); }
.hist.small li { padding: 0; }
.rowi { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.rowi small { display: block; color: var(--mute); font-size: 0.75rem; }
.rowi .big { font-size: 1.375rem; min-width: 52px; }

/* ---------- levels ---------- */
.lvlhero { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; color: var(--on); background: linear-gradient(120deg, var(--push), var(--legsb) 55%, var(--legs)); }
.lvlhero small { display: block; font-size: 0.75rem; opacity: .9; margin: 1px 0 6px; }
.lvtitle { font-family: var(--display); font-size: 1.5rem; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.lvbadge { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; align-content: center; background: color-mix(in srgb, var(--on) 16%, transparent); border: 2px solid color-mix(in srgb, var(--on) 45%, transparent); flex: none; }
.lvbadge span { font-size: 0.75rem; font-weight: 700; letter-spacing: .12em; line-height: 1; }
.lvbadge b { font-family: var(--display); font-size: 1.75rem; line-height: 1; }
.lvbadge.sm { width: 46px; height: 46px; border-radius: 13px; color: var(--on); background: var(--push); border: 0; }
.lvbadge.sm b { font-size: 1.375rem; }
.lvbadge.xs { width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--push) 18%, transparent); border: 0; color: color-mix(in srgb, var(--push) 75%, var(--ink)); }
.lvbadge.xs b { font-size: 1.125rem; }
.xpbar { display: block; height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--k) 22%, transparent); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 8px; background: var(--k); transition: width .4s ease; }
.lvlhero .xpbar { --k: var(--on); }
.legend { font-size: 0.75rem; color: var(--mute); display: inline-flex; align-items: center; gap: 5px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.diagram { padding: 8px 6px 4px; }
.bodysvg { width: 100%; height: auto; display: block; max-height: 56vh; }
.bodysvg .sil > * { fill: var(--card); stroke: var(--line); stroke-width: 1; }
.bodysvg .mz { stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: 1; cursor: pointer; transition: fill-opacity .2s; }
.bodysvg .mz.on { stroke: var(--ink); stroke-width: 2.5; }
.bodysvg .dlbl { font-size: 0.75rem; font-weight: 700; letter-spacing: .14em; fill: var(--mute); font-family: var(--body); }
.mcard { padding: 12px; display: grid; gap: 8px; }
.mcard header { display: flex; align-items: center; gap: 10px; }
.mcard h3 { margin: 0; font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.mcard header small { color: var(--mute); font-size: 0.75rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 2px 0 0; }
.facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.facts dd { margin: 1px 0 0; font-size: 0.8125rem; }
.facts dd a { font-weight: 700; text-decoration: none; }
.xplist { list-style: none; margin: 0; padding: 0; display: grid; }
.xplist li, .xplist li > a { display: flex; gap: 10px; align-items: center; font-size: 0.7812rem; text-decoration: none; padding: 6px 0; }
.xplist li + li { border-top: 1px solid var(--line); }
.xplist li > a { width: 100%; padding: 0; }
.xplist span:first-child { color: var(--mute); width: 46px; flex: none; }
.xplist b { color: color-mix(in srgb, var(--up) 80%, var(--ink)); font-family: var(--display); font-size: 1rem; }
.xplist.pad { padding: 4px 12px; }
.lvlist li { list-style: none; border-top: 1px solid var(--line); }
.lvlist li:first-child { border-top: 0; }
.lvlist button { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 12px; text-align: left; }
.lvlist button[aria-pressed="true"] { background: color-mix(in srgb, var(--push) 8%, transparent); }
.rowt { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rowt b { font-size: 0.8438rem; }
.rowt small { color: var(--mute); font-size: 0.75rem; }
.xpgain { display: flex; flex-wrap: wrap; gap: 6px; }
.bar-t h1:focus { outline: none; }

.eta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75rem; color: var(--mute); margin-top: -4px; }
.eta b { color: var(--ink); font-size: 1rem; }

/* ---------- tour ---------- */
.tour { display: grid; gap: 10px; text-align: center; justify-items: center; padding-top: 4px; }
.tour .sh-title { font-size: 1.75rem; }
.tour .sh-body { margin: 0; max-width: 34ch; font-size: 0.875rem; }
.tour .row2 { width: 100%; }
.tour-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.tour-ic svg { width: 34px; height: 34px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--c); width: 20px; border-radius: 6px; }
.newlist { text-align: left; margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 0.875rem; }
/* ---------- more ---------- */
.help p:not(.lbl) { margin: 4px 0 0; font-size: 0.8125rem; color: var(--mute); }
.center-t { text-align: center; }
.stack { display: grid; gap: 8px; }
.filebtn { position: relative; overflow: hidden; cursor: pointer; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.toggle input { width: 22px; height: 22px; accent-color: var(--up); flex: none; margin-top: 1px; }
.toggle b { display: block; font-size: 0.875rem; }
.toggle small { display: block; color: var(--mute); font-size: 0.75rem; }
.toggle.sm b { display: inline; }
.pday { --k: var(--mute); padding: 10px 12px; display: grid; gap: 8px; border-left: 4px solid var(--k); }
.pday header { display: flex; align-items: center; gap: 8px; }
.pday .dlab { font-family: var(--display); font-weight: 700; font-size: 1.125rem; width: 38px; color: color-mix(in srgb, var(--k) 80%, var(--ink)); }
.pday .inp.name { font-weight: 700; }
.sw.big { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; }
.pslot { display: grid; gap: 6px; padding: 8px 0; border-top: 1px dashed var(--line); }
.pnums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pnums label { display: grid; gap: 2px; font-size: 0.75rem; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.pnums .inp { padding: 7px 6px; text-align: center; }
.pbtns { display: flex; gap: 6px; justify-content: flex-end; }
.vsum .chips { margin-top: 6px; }
.impsess { display: grid; gap: 8px; }
.impsess header { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.impent { display: grid; gap: 4px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.7812rem; }
select.inp { appearance: auto; }

/* == Agent B == */
.nextplan { padding: 10px 12px; display: grid; gap: 6px; border-left: 4px solid var(--k); }
.nextplan header { display: flex; align-items: center; gap: 10px; }
.nextplan header small { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.nextplan header b { font-family: var(--display); font-size: 1.375rem; line-height: 1.05; color: color-mix(in srgb, var(--k) 80%, var(--ink)); }
.nextplan .mini.go { text-decoration: none; }
.nextplan > .fine { margin: 0; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; }
.plist li + li { border-top: 1px solid var(--line); }
.plist a { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; text-decoration: none; font-size: 0.7812rem; }
.plist .nm { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .tg { font-size: 0.8125rem; white-space: nowrap; }
.vol .cap { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vleg { display: flex; align-items: center; gap: 5px; margin: 0; }
.vk { display: inline-block; width: 14px; height: 8px; border-radius: 3px; }
.vk-d { background: var(--upper); }
.vk-p { border: 1.5px dashed var(--faint); }
.vk-b { background: color-mix(in srgb, var(--up) 30%, transparent); }
.bodysvg .mlv { font-family: var(--display); font-size: 0.9375rem; font-weight: 700; fill: #fff; stroke: rgba(0,0,0,.55); stroke-width: 3px; paint-order: stroke; pointer-events: none; }
.nextxp { padding: 10px 12px; display: grid; gap: 6px; border-left: 4px solid var(--k); }
.nextxp header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.nextxp header small { flex-basis: 100%; font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.nextxp header b { font-family: var(--display); font-size: 1.25rem; line-height: 1.1; color: color-mix(in srgb, var(--k) 80%, var(--ink)); }
.nextxp .fine { margin: 0; }
.xpchips { display: flex; flex-wrap: wrap; gap: 5px; }
.xpchip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 9px; font-size: 0.75rem; color: var(--ink); min-height: 30px; }
.xpchip b { color: color-mix(in srgb, var(--up) 80%, var(--ink)); }
.xpchip.lvup { border-color: var(--arms); background: color-mix(in srgb, var(--arms) 14%, transparent); }
.xpchip.lvup span { font-weight: 700; color: color-mix(in srgb, var(--arms) 80%, var(--ink)); }
.lvlist button { padding: 6px 12px; }
.lvlist .rowt { margin-bottom: 3px; }
.rowt .rust { color: color-mix(in srgb, var(--flat) 80%, var(--ink)); font-weight: 600; font-size: 0.75rem; margin-left: 4px; }
.rowt .wk { font-style: normal; color: color-mix(in srgb, var(--up) 80%, var(--ink)); font-weight: 700; }

/* == Agent A == */
/* workout: the set to do now, why-toggle chip, folded finished exercises */
.set.next .i { color: var(--c); font-weight: 700; }
.set.next .step { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.set.next .check { border-color: var(--c); }
.exc { scroll-margin-top: 8px; }
.whybtn { display: inline-flex; align-items: center; gap: 3px; background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--mute); }
.whybtn i { font-style: normal; font-size: 0.75rem; font-weight: 700; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; opacity: .8; }
.whybtn[aria-expanded="true"] i { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.whyp { margin: -4px 0 0; font-size: 0.75rem; color: var(--mute); }
.exc.fold { padding: 0; }
.foldbtn { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; text-align: left; padding: 9px 12px; color: var(--ink); min-height: 48px; }
.foldbtn .ok { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--up); color: var(--on); display: grid; place-items: center; }
.foldbtn .ok svg { width: 15px; height: 15px; }
.foldbtn b { display: block; font-size: 0.8438rem; }
.foldbtn small { display: block; font-size: 0.75rem; color: var(--mute); }
.foldbtn > svg { width: 16px; height: 16px; color: var(--faint); transform: rotate(90deg); flex: none; }
.foldbtn .grow { flex: 1; min-width: 0; }
.foldup svg { transform: rotate(-90deg); }
/* swipe a card left to skip the exercise */
#screen { overflow-x: hidden; }
.exc:not(.fold):not(.cardioc) { touch-action: pan-y pinch-zoom; transition: transform .2s var(--fx-out, ease-out); }
.exc.swiping { transition: none; position: relative; }
.swipe-lbl { position: absolute; top: 50%; left: calc(100% + 14px); transform: translateY(-50%); font-weight: 700; font-size: 0.875rem; color: var(--mute); white-space: nowrap; }
.exc.swipe-go .swipe-lbl { color: var(--flat); }
.exc.swipe-go { box-shadow: 0 0 0 2px var(--flat); }
.exc.skipped { opacity: .7; }
.exc.skipped .foldbtn .ok { background: var(--line); color: var(--mute); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .exc:not(.fold):not(.cardioc) { transition: none; } }
/* summary: concrete next-time targets */
.nt .num { font-family: var(--display); font-size: 1.0625rem; white-space: nowrap; }
.nt .num small { font-family: var(--body); font-size: 0.75rem; color: var(--mute); font-weight: 500; }
.nt { align-items: center; }
a.prbox, a.prbox * { text-decoration: none; }
a.prbox { color: inherit; }
a.prbox { display: block; }
/* == Agent B == */
.cal .g > * { aspect-ratio: auto; height: 30px; }
.cal .g .h { height: auto; }
.hist .s b { color: var(--ink); font-weight: 600; }
.hxp { font-family: var(--display); font-size: 0.9375rem; font-weight: 700; line-height: 1; text-align: right; color: color-mix(in srgb, var(--k) 80%, var(--ink)); min-width: 34px; }
.hxp small { display: block; font-size: 0.75rem; letter-spacing: .1em; color: var(--mute); }
.xpstrip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px; text-decoration: none; font-size: 0.75rem; color: var(--mute); }
.xpstrip b { font-family: var(--display); font-size: 1.125rem; color: color-mix(in srgb, var(--up) 80%, var(--ink)); }
.exc .badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.exc .sline { margin: 0; font-size: 1.0625rem; font-family: var(--display); letter-spacing: .01em; }
.exc.hx > .fine { margin: -4px 0 0; }
.lvup-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 9px 12px; border-radius: 14px; background: color-mix(in srgb, var(--arms) 16%, var(--panel)); border: 1.5px solid var(--arms); font-size: 0.7812rem; animation: lvpop .5s ease-out; }
.lvup-banner b { font-family: var(--display); font-size: 1.125rem; color: color-mix(in srgb, var(--arms) 85%, var(--ink)); }
@keyframes lvpop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lvup-banner { animation: none; } }
.nexttgt { padding: 10px 12px; display: grid; gap: 4px; border-left: 4px solid var(--up); }
.nexttgt small { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.nexttgt b.num { font-size: 1.25rem; }
.nexttgt .fine { margin: 0; }
.xtbl .dl { display: block; font-size: 0.75rem; font-weight: 700; color: color-mix(in srgb, var(--k) 80%, var(--ink)); }
/* == Agent A == */
/* timer: the "Next: …" line may take two lines on narrow phones rather than lose the load */
#timer .t b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* == Agent C == */
/* Swatches take the colour set on them or their row (the base rule reset it to grey). */
.li > .sw, .pday .sw.big, .pday2 .sw.big { --k: inherit; }
.sw.big[aria-pressed="true"] { border-color: var(--ink); }
/* More menu: coloured icon tiles, one-line rows */
.mrow { padding: 9px 12px; gap: 12px; }
.mrow small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow small .due { color: var(--down); font-weight: 700; }
.mic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--k) 18%, transparent); color: var(--k); }
.mic svg { width: 20px; height: 20px; }
.help summary { cursor: pointer; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: ' ▾'; }
.help[open] summary::after { content: ' ▴'; }
/* Get set up */
.setup { display: grid; gap: 4px; border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.setup .lbl { margin: 0; }
.sstep { display: flex; align-items: center; gap: 10px; padding: 7px 2px; text-decoration: none; font-weight: 600; font-size: 0.875rem; }
.sstep > span { flex: 1; }
.sstep > svg { width: 16px; height: 16px; color: var(--mute); }
.sstep i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 0.75rem; font-weight: 700; border: 2px solid var(--up); color: var(--up); flex: none; }
.sstep i svg { width: 14px; height: 14px; }
.sstep.done { color: var(--mute); text-decoration: line-through; }
.sstep.done i { background: var(--up); color: var(--on); }
/* Programme editor: collapsible days, one line per exercise */
.pday2 { --k: var(--mute); border-left: 4px solid var(--k); overflow: hidden; }
.pdh { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 10px 12px; text-align: left; }
.pdh .dlab { font-family: var(--display); font-weight: 700; font-size: 1.125rem; width: 36px; color: var(--k); flex: none; }
.pdh .grow { flex: 1; min-width: 0; }
.pdh .grow b { display: block; font-size: 0.9375rem; }
.pdh .grow small { display: block; color: var(--mute); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdh > svg { width: 18px; height: 18px; color: var(--mute); transition: transform .15s; flex: none; }
.pdh[aria-expanded="true"] > svg { transform: rotate(90deg); }
.pdb { display: grid; gap: 8px; padding: 0 12px 12px; }
.pdn { display: flex; gap: 8px; align-items: center; }
.pdn .inp { font-weight: 700; }
.pslots { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pslots li + li { border-top: 1px solid var(--line); }
.pslot2 { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; background: var(--card); border: 0; padding: 8px 10px; text-align: left; font-size: 0.875rem; }
.pslot2 .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pslot2 .num { font-size: 1.0625rem; color: var(--k); flex: none; }
.grp { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 0.75rem; font-weight: 700; background: var(--k); color: var(--on); flex: none; }
.grp.n { background: none; color: var(--mute); border: 1px solid var(--line); }
.addx { justify-self: start; display: inline-flex; align-items: center; gap: 4px; color: var(--k); border-color: color-mix(in srgb, var(--k) 50%, var(--line)); }
.addx svg { width: 14px; height: 14px; }
/* Slot sheet */
.pss { display: grid; gap: 10px; }
.pss .sh-title { margin: 0; }
.pss .rrow > span { font-size: 0.875rem; color: var(--ink); }
.stepper { display: inline-flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.stepper button { width: 46px; height: 42px; border: 0; background: none; font-size: 1.375rem; font-weight: 700; color: var(--c); }
.stepper b { min-width: 34px; text-align: center; font-size: 1.375rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row3 .btn { padding: 11px 6px; font-size: 0.8438rem; }
.danger-t { color: var(--down) !important; }
/* Exercise picker */
.picklist { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.picklist li + li { border-top: 1px solid var(--line); }
.picklist button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; }
.picklist button b { display: block; font-size: 0.875rem; }
.picklist button small { color: var(--mute); font-size: 0.75rem; }
.picklist button[aria-current="true"] b { color: var(--up); }
/* Import review */
.impnames { display: grid; gap: 10px; }
.impname { display: grid; gap: 4px; padding-left: 10px; border-left: 3px solid var(--up); }
.impname.new { border-left-color: var(--flat); }
.impname .rowt small { color: var(--mute); margin-left: 6px; font-size: 0.75rem; }
.impsessl { overflow: hidden; }
.impsess2 { padding: 8px 12px; border-left: 4px solid var(--k); display: grid; gap: 2px; }
.impsess2 + .impsess2 { border-top: 1px solid var(--line); }
.impsess2 .rrow { align-items: flex-start; }
.impsess2 .toggle span b { font-size: 0.8438rem; }
.impsess2 .toggle span small { display: block; color: var(--mute); font-size: 0.75rem; }
.impsess2 .chips { flex-wrap: nowrap; }
.impsess2 summary { font-size: 0.75rem; color: var(--mute); cursor: pointer; padding: 4px 0 2px 34px; }
.impents { margin: 4px 0 4px 34px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.8125rem; }
.impents small { display: block; color: var(--mute); }
.impents small.painn { color: var(--down); }
.impsess2 .enote { margin-left: 34px; }
.rawtxt { white-space: pre-wrap; font-size: 0.75rem; max-height: 40vh; overflow: auto; margin: 6px 0 0; color: var(--mute); }

/* == Lead: about == */
.about { display: grid; gap: 6px; }
.about p:not(.lbl) { margin: 0; font-size: 0.7812rem; color: var(--mute); }
.about b { color: var(--ink); }
.about .links a { color: var(--ink); font-weight: 700; }

/* == Lead: setup wizard == */
.wz-hero { text-align: center; display: grid; justify-items: center; gap: 4px; padding: 0 0 2px; }
.wz-hero img { border-radius: 12px; }
.wz-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.wz-hero .wz-trust { color: var(--ink); font-weight: 600; }
.wz-hero h2, .wz-q { font-family: var(--display); font-size: 1.875rem; line-height: 1.05; margin: 0; text-wrap: balance; }
.wz-hero p { margin: 0; color: var(--mute); max-width: 34ch; }
.wz-choices .li { padding-block: 14px; }
.wz-top { display: flex; justify-content: space-between; align-items: center; }
.wz-top .dots i.done { background: color-mix(in srgb, var(--c) 50%, var(--line)); }
.wz-opts { display: grid; gap: 8px; }
.wz-opts.multi { grid-template-columns: 1fr 1fr; }
.wz-opts button { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 52px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 700; font-size: 0.9375rem; text-align: left; }
.wz-opts button svg { width: 18px; height: 18px; flex: none; }
.wz-opts button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--panel)); color: var(--ink); }
.wz-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.wz-days button { display: grid; justify-items: center; gap: 2px; padding: 10px 0; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); min-width: 0; }
.wz-days b { font-family: var(--display); font-size: 1.25rem; line-height: 1; }
.wz-days span { font-size: 0.75rem; color: var(--mute); }
.wz-days button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--on); }
.wz-days button[aria-pressed="true"] span { color: var(--on); }
.wz-day { --k: var(--mute); padding: 10px 12px; border-left: 4px solid var(--k); }
.wz-day header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.wz-day header b { font-family: var(--display); font-size: 1.125rem; color: color-mix(in srgb, var(--k) 80%, var(--ink)); width: 38px; }
.wz-day header span { font-weight: 700; }
.wz-day ul { margin: 0; padding: 0; display: grid; gap: 3px; }
.wz-day li { list-style: none; display: flex; justify-content: space-between; gap: 8px; font-size: 0.8125rem; }
.wz-day li em { font-style: normal; color: var(--mute); font-family: var(--display); font-size: 0.9375rem; white-space: nowrap; }

/* == Agent A2 == */
.wz-day header small { margin-left: auto; color: var(--mute); font-size: 0.75rem; white-space: nowrap; }
.wz-gaps { margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.wz-gaps li { list-style: none; font-size: 0.7812rem; color: var(--mute); }
.wz-gaps b { color: var(--ink); }
.wz-warn { flex-direction: column; gap: 2px; }
.wz-warn b { white-space: normal; }
.wz-vol .chips + .fine, .wz-vol .fine + .fine, .wz-vol .wz-gaps + .fine { margin-top: 8px; }

/* == Lead: feedback / iOS == */
.fb-type { justify-self: start; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 0.875rem; }

/* == Agent B2 == */
.impfacts { margin: 0; padding: 0 0 0 16px; display: grid; gap: 4px; font-size: 0.7812rem; color: var(--mute); }
.impfacts b { color: var(--ink); }
.impbusy { display: grid; gap: 8px; }
.impbusy small { color: var(--mute); font-size: 0.75rem; overflow-wrap: anywhere; }
.impbar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.impbar i { display: block; height: 100%; background: var(--up); transition: width .15s; }
.impseg { justify-self: start; flex-wrap: wrap; }
.impg { list-style: none; margin: 0; padding: 0; }
.impg li + li { border-top: 1px solid var(--line); }
.impg button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: none; border: 0; border-left: 3px solid var(--up); padding: 9px 12px; min-height: 48px; color: inherit; }
.impg button.new { border-left-color: var(--flat); }
.impg button.skip { border-left-color: var(--line); opacity: .7; }
.impg .t { min-width: 0; }
.impg .t b { display: block; font-size: 0.875rem; overflow-wrap: anywhere; }
.impg .t small { color: var(--mute); font-size: 0.75rem; }
.impg .to { flex: none; max-width: 45%; text-align: right; font-size: 0.7812rem; font-weight: 600; color: var(--mute); }
.impg button.ok .to { color: var(--up); }
.impnone { padding: 12px; }
.impbulk .btn { font-size: 0.8125rem; }
.impyears { gap: 6px; }
.impents small.to { display: inline; color: var(--mute); margin-left: 6px; }

/* == UI/UX pass (ui-ux-pro-max checklist): contrast, touch targets, pressed feedback == */
:root { --rest: #858CA1; --faint: #8A91A6; --press: 110ms; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --push: #C2540F; --pull: #08776E; --legs: #5B4AD6; --upper: #1A68B3; --legsb: #B8285F; --up: #0F7A42; --down: #C0283F; --flat: #8A6100; --rest: #6B7186; --faint: #666D82; --line-ctl: #80869A; }
}
:root[data-theme="light"] { --push: #C2540F; --pull: #08776E; --legs: #5B4AD6; --upper: #1A68B3; --legsb: #B8285F; --up: #0F7A42; --down: #C0283F; --flat: #8A6100; --rest: #6B7186; --faint: #666D82; --line-ctl: #80869A; }
:root[data-theme="dark"] { --rest: #858CA1; --faint: #8A91A6; --line-ctl: #6B7288; }
/* Edges of things you type into or tick: 3:1 against the card (WCAG 1.4.11). */
:root { --line-ctl: #6B7288; }
.step, .check, .inp, .mini { border-color: var(--line-ctl); }

/* Pressed feedback on everything tappable, without moving layout */
button, a, summary, .li, label.filebtn { transition: background-color var(--press) ease-out, opacity var(--press) ease-out, filter var(--press) ease-out; }
:is(button, a, summary, label.filebtn):active:not(:disabled) { opacity: .72; }
:is(.li, .mus li a, .hist a, .focus li > a, .sug .head, .lvlist button):active { opacity: 1; background: color-mix(in srgb, var(--ink) 8%, transparent); }
:is(.btn, .check, .days a, .wz-opts button, .wz-days button):active:not(:disabled) { opacity: 1; filter: brightness(.9); }
@media (prefers-reduced-motion: reduce) { button, a, summary, .li { transition: none; } }

/* Touch targets: 44px minimum */
.mini, .chipbtn, #timer button { min-height: 44px; }
.iconbtn, .iconbtn.sm { width: 44px; height: 44px; }
.seg { padding: 2px; }
.seg button, .seg.sm button { min-height: 40px; min-width: 40px; }
.step { height: 44px; grid-template-columns: 40px 1fr 40px; }
.step input { height: 100%; }
.check { height: 44px; }
.sw.big { width: 44px; height: 44px; }
.cal .g > a, .cal .g > span:not(.h) { aspect-ratio: auto; min-height: 44px; }
.cal .g > * { color: var(--mute); }
.cal .g .on { color: var(--on); }
summary { padding-block: 12px; }
.mus li a, .focus li > a, .hist a { min-height: 44px; }
/* Small inline links keep their look but get a bigger hit area */
.bar-t small .linkbtn, .exc h2 a, .exc h3 a, .rowi a, .xtbl td a, .facts dd a, .sug .why a { position: relative; }
:is(.bar-t small .linkbtn, .exc h2 a, .exc h3 a, .rowi a, .xtbl td a, .facts dd a, .sug .why a)::after { content: ""; position: absolute; inset: -12px -6px; }
.linkbtn.center, .linkbtn.danger { min-height: 44px; }
.lvlist button, .nextxp button { min-height: 44px; }

/* Icons that replaced glyphs */
.focus .ic svg { width: 17px; height: 17px; }
.whyq { display: inline-grid; margin-left: 4px; color: var(--mute); vertical-align: middle; }
.whyq svg { width: 16px; height: 16px; }
.prbox p svg, .lvup-banner b svg { width: 16px; height: 16px; vertical-align: -2px; margin-right: 6px; color: var(--flat); }

.whybtn i { border: 0; width: auto; height: auto; opacity: 1; }
.whybtn[aria-expanded="true"] i { background: none; color: var(--ink); }
.whybtn { position: relative; }
.whybtn::after { content: ""; position: absolute; inset: -6px -4px; }
.step { height: 46px; }
.set { grid-template-columns: 22px 1fr 1fr 44px; }
.seg button, .seg.sm button { min-height: 44px; min-width: 44px; }
#screen .box li > a, #screen .box > a { min-height: 44px; }
.lvstar svg { width: 16px; height: 16px; color: var(--flat); }
/* light mode near-misses: accent text on tinted chips and small dates */
.cal .g > span:not(.h), .cal .g > a:not(.on) { color: color-mix(in srgb, var(--mute) 70%, var(--ink)); }
.chips .mini[aria-pressed="true"], .mini[data-act="p-add"] { color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.pdacts { display: flex; gap: 8px; flex-wrap: wrap; }
.inp:not(textarea) { min-height: 44px; }
summary { min-height: 44px; display: flex; align-items: center; }
[data-act="toggle-seed"], [data-act="setup-hide"] { position: relative; }
:is([data-act="toggle-seed"], [data-act="setup-hide"])::after { content: ""; position: absolute; inset: -8px -10px; }
.cal .g .on { font-weight: 700; font-size: 0.875rem; }

/* == Daily targets == */
.dailycard { padding: 10px 12px; display: grid; gap: 8px; }
.dtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.dtile { --k: var(--up); display: grid; gap: 3px; text-align: left; min-height: 64px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.dt-l { font-size: 0.75rem; color: var(--mute); font-weight: 700; }
.dtile b { font-size: 1.25rem; line-height: 1; }
.dtile b small { font-family: var(--body); font-size: 0.75rem; color: var(--mute); font-weight: 500; }
.dt-bar { display: block; height: 6px; border-radius: 6px; background: color-mix(in srgb, var(--k) 20%, transparent); overflow: hidden; }
.dt-bar i { display: block; height: 100%; background: var(--k); border-radius: 6px; }
.tipq { background: none; border: 0; padding: 0 2px; color: var(--mute); display: inline-grid; vertical-align: middle; position: relative; } .tipq svg { width: 16px; height: 16px; } .tipq::after { content: ""; position: absolute; inset: -12px; }

/* == Builder A == */
/* programme targets (%, RPE, AMRAP) under the exercise name */
.snote { display: block; font-size: 0.75rem; font-weight: 700; color: var(--c); margin: 1px 0 0; }
.sug .snote { grid-column: 1; }
/* short session: exercises left out today */
.sug li.skip .name, .sug li.skip .last { opacity: .6; }
.lenfine { margin: 0; }
.ready .rrow .seg button { padding-left: 8px; padding-right: 8px; }
/* reps-left row label */
.rirlbl { display: inline-flex; align-items: center; gap: 2px; font-size: 0.75rem; font-weight: 700; color: var(--mute); }
/* press-and-hold steppers: no text selection or callout menu while holding */
.step button { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* all sets ticked: Finish sticks to the bottom, in thumb reach */
.finbar { position: sticky; bottom: -20px; z-index: 3; margin: 0 -14px -20px; padding: 10px 14px calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.finbar .btn { width: 100%; box-shadow: 0 6px 18px color-mix(in srgb, var(--up) 30%, transparent); }
.finbar .btn svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }

/* == Builder C: accessibility, type scale, insights/levels/daily == */
/* Font sizes are in rem, so the browser/OS text size setting scales the whole app. */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* Gold hero in light mode: white text needs a darker gold for 4.5:1 (was 4.4:1). */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --arms: #876500; } }
:root[data-theme="light"] { --arms: #876500; }
/* Bottom nav: icons grow a little with text size; when six labels can't fit, the labels
   go visually hidden (still read by screen readers) instead of overlapping. */
.tabs { container-type: inline-size; container-name: tabs; }
.tabs[hidden] { display: none; }
.tabs a { overflow: hidden; }
.tabs a svg { width: 1.45rem; height: 1.45rem; }
.tabs a span { max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
@container tabs (max-width: 21rem) {
  .tabs a { padding: .55rem 0; }
  .tabs a span { font-size: .62rem; }
}
@container tabs (max-width: 15rem) {
  .tabs a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Week strip: chips keep their full day name at large text; the strip scrolls sideways instead of cutting to "F…". */
.days { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.days::-webkit-scrollbar { display: none; }
/* Large and extra large text: smaller day names so the whole week fits without a hidden sideways scroll. */
html[data-text="xl"] .days span { font-size: .6rem; letter-spacing: 0; }
html[data-text="large"] .days span { font-size: .66rem; letter-spacing: 0; }
html:is([data-text="large"], [data-text="xl"]) .days a { padding-inline: 1px; }
.days a { padding-inline: 4px; }
.days span { overflow: visible; text-overflow: clip; }
/* Header, sheet titles and timer stay on screen at 200% text */
.bar-t h1 { white-space: normal; overflow-wrap: anywhere; }
#timer { flex-wrap: wrap; }
#toast { max-width: min(92vw, 30rem); text-align: center; }
/* Weekly sets: a tick marks muscles that reached the range, so it isn't told by colour alone */
.vrow { grid-template-columns: minmax(5.2rem, auto) 1fr minmax(3.4rem, auto); }
.vrow .num { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 2px; white-space: nowrap; }
.vok { display: inline-grid; place-items: center; color: color-mix(in srgb, var(--up) 85%, var(--ink)); }
.vok svg { width: .8rem; height: .8rem; }
.vleg .vok { margin-left: 4px; }
.cap b .tipq, .kpi .tipq, .facts dt .tipq, .fine .tipq { vertical-align: -3px; }
.kpi-btn { display: grid; justify-items: start; gap: 2px; text-align: left; color: var(--ink); cursor: pointer; }
.kpi-btn b svg { width: 1.3rem; height: 1.3rem; color: var(--c); }
/* Daily targets */
.dtile.hit { border-color: color-mix(in srgb, var(--k) 55%, var(--line)); }
.dt-l { display: inline-flex; align-items: center; gap: 3px; }
.dt-l svg { width: .85rem; height: .85rem; color: color-mix(in srgb, var(--up) 85%, var(--ink)); }
.dtiles { grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); }
#daily-undo { justify-self: center; }
/* Large text reflow: rows wrap instead of pushing controls off screen (checked at 200% text, 375px) */
.rrow { flex-wrap: wrap; }
.seg { flex-wrap: wrap; max-width: 100%; }
.sug button.head { grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
.sug .to { min-width: 0; max-width: 55vw; }
.sug .to .num { white-space: normal; text-align: right; }
.sug .to .pill { white-space: normal; text-align: right; }
.nextplan header { flex-wrap: wrap; }
.plist a { grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto; }
.plist .tg { white-space: normal; text-align: right; }
.addrow { display: flex; flex-wrap: wrap; }
.addrow .field { flex: 1 1 7rem; min-width: 0; }
.addrow .btn { flex: 1 0 auto; }
.row2 > *, .field { min-width: 0; }
.inp { min-width: 0; max-width: 100%; }
.vleg { flex-wrap: wrap; }
.vol { container-type: inline-size; }
@container (max-width: 18rem) {
  .vrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .vrow .vtrack { grid-column: 1 / -1; grid-row: 2; }
}
.hero p { opacity: 1; } /* full-strength text keeps 4.5:1 on every day colour */
.vleg > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.mcard h2 { margin: 0; font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.exc.hx h2 { margin: 0; font-size: 0.9062rem; }
.exc.hx h2 a { text-decoration: none; position: relative; }

/* == Builder B: import, paste split, setup, settings == */
.cardiohint { margin: 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--upper) 12%, var(--card)); }
.cardiohint a { color: inherit; font-weight: 600; }
.newmeta { display: block; color: color-mix(in srgb, var(--flat) 75%, var(--ink)); font-size: 0.75rem; text-align: left; }
button.newmeta { justify-self: start; text-decoration: none; min-height: 32px; }
button.newmeta u { text-underline-offset: 2px; }
.impg .t small.newmeta { color: color-mix(in srgb, var(--flat) 75%, var(--ink)); }
.notadded { margin: 6px 0 0; padding-left: 1.1em; font-size: 0.8125rem; }
.notadded li { overflow-wrap: anywhere; }
.metas { display: grid; gap: 8px; }
.metas .lbl { margin: 6px 0 0; }
.tour .dots i.done { background: color-mix(in srgb, var(--c) 50%, var(--line)); }
.tourskip { justify-self: center; }
.wz-prefs .rrow > span, .impopts .rrow > span { font-size: 0.875rem; }
.impres { margin-top: 8px; }
.pslot2 .grow small { display: block; color: var(--mute); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; }
.impent .rowt { flex-wrap: wrap; }
.impent .grp { font-style: normal; font-weight: 700; color: var(--c); }

/* History: browse any month */
.calnav { display: flex; align-items: center; gap: 8px; }
.calnav select { flex: 1; min-width: 0; min-height: 44px; }
.calnav .iconbtn { width: 44px; height: 44px; }
.calnav .iconbtn:disabled { opacity: .35; }
.calnav .flip svg { transform: scaleX(-1); }
.cal .g > .pad { background: none; }

/* Toast with an Undo button: taps reach it */
#toast.act { pointer-events: auto; display: flex; align-items: center; gap: 10px; }
.tundo { flex: none; white-space: nowrap; background: none; border: 0; color: var(--bg); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; min-height: 36px; }

/* First-workout hints */
.coach { padding: 12px 14px; border-left: 4px solid var(--c, var(--push)); display: grid; gap: 4px; }
.coach p { margin: 0; color: var(--mute); font-size: 0.875rem; }
.coach .linkbtn { justify-self: start; }

/* Starting weight picker for a new lift */
.startw { margin: 4px 0 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--upper) 12%, var(--card)); display: grid; gap: 8px; }
.startw p { margin: 0; font-size: 0.875rem; }
.startw .seg button { flex: 1; }

/* Cardio card in a workout, early wins */
.cardioc .rowi { display: flex; align-items: center; gap: 10px; }
.cardioc small { display: block; color: var(--mute); }
.win svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; color: var(--up); }

/* Link styled as a small button (banners) */
a.mini { text-decoration: none; display: inline-grid; place-items: center; color: var(--ink); }

/* Progress: Insights | Levels switch */
.subnav { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.subnav a { flex: 1; text-align: center; padding: 10px; border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--mute); min-height: 44px; }
.subnav a[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.emptyact { display: grid; gap: 8px; }

/* Strength standards */
.std p { margin: 0 0 6px; }
.stdbar { position: relative; height: 10px; border-radius: 6px; margin: 10px 0 4px; background: linear-gradient(90deg, var(--legs), var(--up), var(--push)); opacity: .9; }
.stdbar i { position: absolute; top: -2px; width: 2px; height: 14px; background: var(--bg); }
.stdbar b { position: absolute; top: -5px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); }
.stdlbl { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--mute); margin-bottom: 6px; }

/* Measurements and photos */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--card); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph span { position: absolute; left: 6px; bottom: 6px; font-size: 0.6875rem; font-weight: 700; background: rgb(0 0 0 / .55); color: #fff; padding: 2px 6px; border-radius: 6px; }
.phfull { width: 100%; border-radius: 12px; display: block; margin-bottom: 10px; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; }
.mini.filebtn { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.mini.filebtn svg { width: 14px; height: 14px; }

/* Monthly recap */
.recap { padding: 12px 14px; display: grid; gap: 10px; }
.rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.875rem; }
.rlist li { display: flex; gap: 8px; align-items: center; }
.rlist svg { width: 18px; height: 18px; color: var(--up); flex: none; }

/* Setup: one main action, the rest folded away */
.wz-main { width: 100%; }
.wz-main small { font-weight: 500; opacity: .85; }
.wz-more summary { padding: 14px; font-weight: 700; cursor: pointer; min-height: 44px; }
.wz-more .wz-choices { border-top: 1px solid var(--line); }
.wz-why { margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.tpl { display: grid; gap: 8px; }
.tpl p { margin: 0; }
.tdays { display: flex; flex-wrap: wrap; gap: 6px; }
.tdays span { font-size: 0.75rem; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--k) 16%, var(--card)); }

/* Help */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { padding: 14px; font-weight: 700; cursor: pointer; min-height: 44px; }
.faq p { margin: 0; padding: 0 14px 14px; color: var(--mute); }

/* Day colour picker: any colour, with its hex code */
.colprev { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--k); color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .45); margin-bottom: 6px; }
.colprev span { font-family: ui-monospace, monospace; font-weight: 700; }
.colrow { display: flex; gap: 10px; align-items: end; }
.colrow input[type=color] { width: 64px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: none; flex: none; }
.colrow .grow { flex: 1; }
.inp.bad { border-color: var(--down); }

/* "Other ways to start" shows it opens */
.wz-more summary { list-style: none; display: flex; justify-content: space-between; align-items: center; }
.wz-more summary::-webkit-details-marker { display: none; }
.wz-more summary::after { content: ""; width: 9px; height: 9px; border-right: 2.5px solid var(--mute); border-bottom: 2.5px solid var(--mute); transform: rotate(45deg); margin: -4px 6px 0 0; transition: transform .2s; }
.wz-more[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }

/* ---------- Tablets and desktop ---------- */
/* The bar lays out however many tabs there are (five since Levels moved under Progress). */
.tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* Portrait tablets: a wider column with more breathing room. */
@media (min-width: 700px) {
  #app { max-width: 760px; }
  .bar { padding-inline: 24px; }
  #screen { padding: 8px 24px 28px; gap: 14px; }
  .finbar { margin-inline: -24px; padding-inline: 24px; }
  .sheet { max-width: 640px; }
  .photos { grid-template-columns: repeat(4, 1fr); }
  .sug .to { max-width: 360px; }
}

/* Landscape tablets, laptops and desktops: navigation becomes a side rail and pop-ups centred dialogs. */
@media (min-width: 1000px) and (min-height: 520px) {
  #app { max-width: 1080px; display: grid; grid-template-columns: 216px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "nav bar" "nav screen" "nav timer"; border-inline: 1px solid var(--line); }
  .bar { grid-area: bar; padding: 22px 36px 10px; }
  #screen { grid-area: screen; padding: 8px 36px 36px; }
  #screen > * { max-width: 780px; }
  .finbar { margin-inline: -36px; padding-inline: 36px; }
  #timer { grid-area: timer; padding-inline: 36px; }
  .tabs { grid-area: nav; container-type: normal; display: flex; flex-direction: column; gap: 4px; border-top: 0; border-right: 1px solid var(--line); padding: 22px 12px; }
  .tabs::before { content: "we go gim"; font-family: var(--display); font-weight: 700; font-size: 1.5rem; padding: 0 14px 14px; color: var(--ink); }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; font-size: 0.9375rem; overflow: visible; }
  .tabs a[aria-current="page"] { background: color-mix(in srgb, var(--c) 16%, transparent); }
  .tabs a span { position: static; width: auto; height: auto; clip-path: none; }
  .tabs .dot { margin-left: auto; }
  .scrim { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; max-height: 86vh; }
  #toast { left: calc(50% + 108px); bottom: 28px; }
}

/* Mouse and trackpad: show what can be clicked. */
@media (hover: hover) and (pointer: fine) {
  button, summary, label.filebtn, [data-act] { cursor: pointer; }
  .btn:hover, .mini:hover, .li:hover, .tabs a:hover, .iconbtn:hover, .subnav a:hover { filter: brightness(1.1); }
  .tabs a:hover { color: var(--ink); }
}

/* Anatomical muscle map */
.bodysvg { max-height: 62vh; }
.bodysvg .sil > * { fill: color-mix(in srgb, var(--card) 80%, var(--ink) 6%); stroke: var(--line); stroke-width: 1; }
.bodysvg .mz { stroke: color-mix(in srgb, var(--bg) 70%, transparent); stroke-width: 1.2; stroke-linejoin: round; }
.bodysvg .mz:hover { filter: brightness(1.15); }
.bodysvg .fib path { fill: none; stroke: color-mix(in srgb, var(--bg) 55%, transparent); stroke-width: 1; stroke-linecap: round; pointer-events: none; }
.bodyseg { display: flex; margin: 6px auto 2px; width: max-content; }
.bodysvg .sil .hair { fill: color-mix(in srgb, var(--ink) 22%, var(--card)); stroke: none; }

/* Welcome: experience asked as a full question, answers that wrap on small phones */
.wz-explbl { margin: 0; }
.wz-expseg { display: flex; flex-wrap: wrap; }
.wz-expseg button { flex: 1 1 30%; min-height: 44px; white-space: normal; line-height: 1.2; }

/* ---- medical mode: 3D muscle atlas ---- */
.atlas-open { display: flex; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.atlas-open svg { width: 18px; height: 18px; }
.atlas { display: grid; gap: 10px; }
.atlas-stage { position: relative; height: min(64vh, 560px); border-radius: 18px; overflow: hidden; touch-action: none;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--card) 70%, var(--push) 8%), var(--bg) 75%); border: 1px solid var(--line); }
.atlas-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.atlas-canvas:active { cursor: grabbing; }
.atlas-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--mute); padding: 16px; text-align: center; }
.atlas-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.atlas-bones { display: inline-flex; gap: 6px; align-items: center; font-size: 0.85rem; color: var(--mute); }
.atlas-how { margin: 0; }
.atlas-q { width: 100%; }
.atlas-results { list-style: none; margin: 0; padding: 4px; }
.atlas-results .li small { color: var(--mute); }
.atlas-head { display: flex; gap: 10px; align-items: flex-start; }
.atlas-head h2 { margin: 0; font-size: 1.15rem; }
.atlas-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
.atlas-key i:first-child { margin-left: 0; }
.atlas-info .chips { margin: 4px 0 8px; }
@media (min-width: 900px) {
  .atlas { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: start; }
  .atlas-stage { grid-row: span 6; height: min(78vh, 760px); }
}

/* ---- text size setting ---- */
html[data-text="large"] { font-size: 112.5%; }
html[data-text="xl"] { font-size: 125%; }

/* ---- weekly streak ---- */
.streak { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; padding: 10px 14px; margin: 8px 0; border-radius: 14px;
  background: color-mix(in srgb, var(--push) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--push) 35%, var(--line)); color: var(--text); text-decoration: none; }
.streak b { font-size: 0.95rem; }
.streak span { font-size: 0.8rem; color: var(--mute); }
.keepgoing { text-align: center; }

/* ---- daily habit loop: quests, rest day, badges ---- */
.streak .shield { font-size: 0.8rem; color: var(--text); }
.quests ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.quests li { display: flex; gap: 10px; align-items: center; }
.quests li i { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 0.8rem; font-weight: 800; }
.quests li.done i { background: var(--up); border-color: var(--up); color: var(--on); }
.quests li.done span { color: var(--mute); text-decoration: line-through; }
.quests.alldone { border-color: color-mix(in srgb, var(--up) 50%, var(--line)); }
.restcard { border-color: color-mix(in srgb, var(--rest) 45%, var(--line)); }
.gamewin .big { font-size: 1.25rem; font-weight: 800; margin: 0; }
.badgewin .bi { font-size: 1.6rem; }
.badges { list-style: none; margin: 0 0 12px; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badges li { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: var(--card); opacity: 0.5; }
.badges li.got { opacity: 1; background: color-mix(in srgb, var(--push) 10%, var(--card)); }
.badges .bi { font-size: 1.4rem; }
.badges .bt { display: grid; }
.badges small { color: var(--mute); font-size: 0.72rem; }



/* ==========================================================================================
   Motion and feedback (js/fx.js adds the fx-* classes). Transform and opacity only, short, and
   switched off by "reduce motion" through the global rule near the top of this file.
   ========================================================================================== */
:root { --fx-spring: cubic-bezier(.3, 1.5, .5, 1); --fx-out: cubic-bezier(.2, .8, .2, 1); }

/* Press: everything tappable gives a little under the finger */
button, a, summary, .li, label.filebtn { transition: background-color var(--press) ease-out, opacity var(--press) ease-out, filter var(--press) ease-out, color .2s ease, transform .18s var(--fx-out); }
:is(button, summary, label.filebtn, .tabs a, a.btn, a.iconbtn, a.mini, a.chipbtn):active:not(:disabled) { transform: scale(.96); transition-duration: var(--press), var(--press), var(--press), .2s, 60ms; }
:is(.li, .hist a, a.prbox, .foldbtn, .streak, .kpi-btn, .mus li a, .focus li > a, .lvlist button, .sug .head, .days a, .btn):active:not(:disabled) { transform: scale(.985); }
.tabs a svg { transition: color .2s ease; }

/* Screens slide in (direction follows the tab order), a little staggered */
@keyframes fx-in { from { opacity: 0; transform: translate(var(--fx-dx, 0px), var(--fx-dy, 8px)); } }
#screen > .fx-in:not(.lvup-banner) { animation: fx-in .28s var(--fx-out) backwards; }
#screen > .fx-in:nth-child(2) { animation-delay: 30ms; }
#screen > .fx-in:nth-child(3) { animation-delay: 60ms; }
#screen > .fx-in:nth-child(4) { animation-delay: 85ms; }
#screen > .fx-in:nth-child(5) { animation-delay: 110ms; }
#screen > .fx-in:nth-child(6) { animation-delay: 130ms; }
#screen > .fx-in:nth-child(n+7) { animation-delay: 150ms; }
/* Bars fill up and numbers rise into place on arrival */
@keyframes fx-grow { from { transform: scaleX(0); } }
.fx-in .xpbar i, .fx-in .impbar i, .fx-in .prog i { transform-origin: left center; animation: fx-grow .8s .18s var(--fx-out) backwards; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(40%); } }
.fx-in .kpi b, .fx-in .lvbadge b, .fx-in .hero .meta b { animation: fx-rise .45s var(--fx-out) backwards; }
.fx-in .kpi:nth-child(2) b { animation-delay: 70ms; }
.fx-in .kpi:nth-child(3) b { animation-delay: 140ms; }
.fx-in .hero h2 { animation: fx-pop .5s .05s var(--fx-spring) backwards; }

/* Sheets: spring up with a fading backdrop; slide away when closed; no replay when one swaps for another */
@keyframes fx-sheet-in { from { transform: translateY(60%); opacity: .4; } }
@keyframes fx-sheet-out { to { transform: translateY(50%); opacity: 0; } }
@keyframes fx-fade-out { to { opacity: 0; } }
.scrim { animation: fade .2s ease-out; }
.sheet { animation: fx-sheet-in .32s cubic-bezier(.2, .9, .25, 1); }
.scrim.fx-swap, .scrim.fx-swap .sheet { animation: none; }
.fx-ghost { position: fixed; inset: 0; background: rgb(0 0 0 / .5); z-index: 49; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; animation: fx-fade-out .24s ease-in forwards; }
.fx-ghost .sheet { animation: fx-sheet-out .24s cubic-bezier(.4, 0, 1, 1) forwards; }
@keyframes fx-dialog-in { from { transform: scale(.95); opacity: 0; } }
@keyframes fx-dialog-out { to { transform: scale(.96); opacity: 0; } }
@media (min-width: 1000px) and (min-height: 520px) {
  .sheet { animation-name: fx-dialog-in; animation-duration: .22s; }
  .fx-ghost { align-items: center; padding: 24px; }
  .fx-ghost .sheet { animation-name: fx-dialog-out; animation-duration: .18s; }
}

/* Toasts pop in and sink away */
#toast { transform: translate(-50%, 16px) scale(.94); transition: opacity .18s ease-out, transform .34s var(--fx-spring); }
#toast.on { transform: translate(-50%, 0) scale(1); }

/* Toggles and choices pop when switched on */
@keyframes fx-pop { 0% { transform: scale(.9); } 55% { transform: scale(1.07); } 100% { transform: none; } }
.fx-pop:not(.check) { animation: fx-pop .34s var(--fx-spring); }

/* Ticking a set: the check springs in with a ring, the row glows green, the bar grows */
@keyframes fx-check { 0% { transform: scale(.3) rotate(-15deg); opacity: .3; } 60% { transform: scale(1.25) rotate(4deg); opacity: 1; } 100% { transform: none; } }
@keyframes fx-ring-out { from { opacity: .9; transform: scale(.92); } to { opacity: 0; transform: scale(1.4); } }
@keyframes fx-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.check { position: relative; }
.check.fx-pop svg { animation: fx-check .42s var(--fx-spring); }
.check.fx-pop::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--up); pointer-events: none; opacity: 0; animation: fx-ring-out .5s ease-out; }
.set.fx-done { position: relative; isolation: isolate; }
.set.fx-done::before { content: ""; position: absolute; inset: -3px -5px; z-index: -1; border-radius: 12px; background: color-mix(in srgb, var(--up) 22%, transparent); pointer-events: none; opacity: 0; animation: fx-flash .7s ease-out; }
.prog { position: relative; }
@keyframes fx-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.prog.fx-full::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .6), transparent); transform: translateX(-100%); animation: fx-sweep 1s .3s ease-out; pointer-events: none; }
/* An exercise finished: the card gives a small cheer */
@keyframes fx-cheer { 0% { transform: none; } 35% { transform: scale(1.02); } 100% { transform: none; } }
.exc.fx-cheer { position: relative; animation: fx-cheer .6s var(--fx-spring); }
.exc.fx-cheer::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 2px var(--up), 0 0 22px color-mix(in srgb, var(--up) 45%, transparent); pointer-events: none; opacity: 0; animation: fx-flash .8s ease-out; }
.exc.fx-cheer .foldbtn .ok { animation: fx-check .5s .05s var(--fx-spring) backwards; }

/* −/+ steppers: the value bumps */
@keyframes fx-bump { 0% { transform: scale(1.2); } 100% { transform: none; } }
.fx-bump { animation: fx-bump .26s var(--fx-spring); }

/* Rest timer: a bar drains along the bottom, the count pulses in the last 5 seconds, and it flashes at zero */
#timer { position: relative; overflow: hidden; }
.fx-tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c, var(--push)); transform-origin: left center; pointer-events: none; transition: opacity .2s; }
#timer.fx-soon .fx-tbar { background: var(--flat); }
#timer.over .fx-tbar { opacity: 0; }
@keyframes fx-tick { 0%, 100% { transform: none; } 20% { transform: scale(1.12); } }
#timer .num { display: inline-block; }
#timer.fx-soon .num { animation: fx-tick 1s ease-in-out infinite; }
@keyframes fx-blink { 0%, 50%, 100% { opacity: 0; } 18%, 68% { opacity: .5; } }
#timer.fx-ring::before { content: ""; position: absolute; inset: 0; background: #fff; pointer-events: none; opacity: 0; animation: fx-blink 1.2s ease-out; }
#timer.fx-ring .num { animation: fx-pop .5s var(--fx-spring); }

/* Tab bar: the icon of a newly chosen tab hops */
@keyframes fx-hop { 0% { transform: none; } 40% { transform: translateY(-4px) scale(1.14); } 70% { transform: translateY(1px) scale(.97); } 100% { transform: none; } }
.tabs a svg.fx-hop { animation: fx-hop .45s var(--fx-out); }

/* Personal bests and level-ups: a small burst of confetti, removed after a second */
.fx-burst { position: fixed; width: 0; height: 0; z-index: 70; pointer-events: none; }
.fx-burst i { position: absolute; left: -3px; top: -5px; width: 6px; height: 10px; border-radius: 2px; background: var(--k); opacity: 0; animation: fx-fly .9s cubic-bezier(.15, .7, .3, 1) forwards; }
.fx-burst i.dot { width: 7px; height: 7px; border-radius: 50%; }
@keyframes fx-fly {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.4); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(var(--r)) scale(1); }
}
.prbox p svg { display: inline-block; }
.fx-in .prbox p svg, .fx-in .lvup-banner b svg { animation: fx-check .6s .35s var(--fx-spring) backwards; }

/* Week streak chip: a shine passes over it once, and a wrapped flame (.flame) wiggles */
.streak { position: relative; overflow: hidden; }
.streak::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--push) 22%, transparent) 50%, transparent 70%); transform: translateX(-100%); animation: fx-sweep 1.4s .5s ease-out; pointer-events: none; }
@keyframes fx-wiggle { 0%, 100% { transform: none; } 20% { transform: rotate(-14deg) scale(1.15); } 45% { transform: rotate(10deg) scale(1.1); } 70% { transform: rotate(-5deg); } }
.streak .flame, .streak svg { display: inline-block; transform-origin: 50% 90%; animation: fx-wiggle .9s .4s ease-in-out; }

/* 3D atlas loading: a shimmer sweeps the placeholder (give an error message the class "fail" to stop it) */
.atlas-msg { overflow: hidden; }
.atlas-msg:not(.fail)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--ink) 7%, transparent) 50%, transparent 80%); transform: translateX(-100%); animation: fx-sweep 1.5s ease-in-out infinite; pointer-events: none; }
.atlas-msg:not(.fail) { animation: fx-breathe 1.8s ease-in-out infinite; }
@keyframes fx-breathe { 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
  .fx-burst, .fx-ghost { display: none; }
  :is(button, summary, label.filebtn, .li, a):active { transform: none !important; }
}


/* Muscle map, fine regions (js/anatomy.js REGIONS): thin gaps between muscles of one group,
   the selected group outlined, the tapped region outlined more strongly, a lift under the finger. */
.bodysvg .mz { stroke: color-mix(in srgb, var(--bg) 78%, transparent); stroke-width: 0.9; stroke-linejoin: round; transition: filter .15s; -webkit-tap-highlight-color: transparent; }
.bodysvg .mz:hover, .bodysvg .mz:active { filter: brightness(1.22); }
.bodysvg .mg.on .mz { stroke: color-mix(in srgb, var(--ink) 55%, transparent); stroke-width: 1.1; }
.bodysvg .mg.on .mz.hit { stroke: var(--ink); stroke-width: 2.4; filter: brightness(1.15); }
.mregion { margin: 0; }
.mregion a { font-weight: 700; white-space: nowrap; }

/* week strip: whole day names, shortened with an ellipsis when long */
.days .dn { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callist { display: grid; gap: 8px; }

/* 3D atlas turn-speed slider */
.atlas-sens { display: inline-flex; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--mute); }
.atlas-sens input { width: 120px; accent-color: var(--push); }

/* ---- narrow phones (320–400 px) and large text: set rows, programme day, badges ---- */
/* Set rows: the weight and reps boxes stay wide enough for "27.5" (at least ~56 px). Smaller −/+ first;
   on the narrowest rows the −/+ pair moves under its number. */
.sets { container-type: inline-size; }
@container (max-width: 379px) {
  .set, .set.edit { grid-template-columns: 16px 1fr 1fr 40px; gap: 4px; }
  .step { grid-template-columns: 30px minmax(0, 1fr) 30px; }
}
@container (max-width: 319px) {
  .set:not(.edit) { align-items: stretch; }
  .step { grid-template-columns: 1fr 1fr; grid-template-areas: "in in" "m p"; height: auto; }
  .step > input { grid-area: in; height: 40px; }
  .step > button { height: 36px; border-top: 1px solid var(--line); }
  .step > button:first-child { grid-area: m; }
  .step > button:last-child { grid-area: p; border-left: 1px solid var(--line); }
  .set:not(.edit) .check { height: auto; min-height: 44px; }
}
/* Programme: the "Move to another day" icon keeps icon size and the label wraps inside its button. */
.mini svg { width: 16px; height: 16px; flex: none; }
.pdacts .mini { display: inline-flex; align-items: center; gap: 4px; white-space: normal; text-align: left; max-width: 100%; }
.pslot2 { flex-wrap: wrap; }
.pslot2 .grow { white-space: normal; overflow-wrap: break-word; flex: 1 1 7.5rem; }
.pslot2 .num { margin-left: auto; white-space: normal; text-align: right; }
/* Session detail: the comparison badge drops under the exercise name instead of sticking out. */
.exc.hx header { flex-wrap: wrap; }
.exc.hx header > div:first-child { flex: 1 1 10rem; min-width: 0; }
.exc .badges { max-width: 100%; }
.exc .badges .pill { white-space: normal; }
/* Unselected segment options: comfortably above 4.5:1 in both themes (dark: about 6.5:1 on the card colour). */
.seg button:not([aria-pressed="true"]) { color: color-mix(in srgb, var(--mute) 80%, var(--ink)); }

/* ---- Learn the app ---- */
.learncard .lm, .learnlist li { display: flex; gap: 12px; align-items: flex-start; }
.learncard .lm { margin: 10px 0 12px; }
.learncard .lm i, .learnlist li > i { font-style: normal; font-size: 1.4rem; line-height: 1; flex: none; width: 1.6em; text-align: center; }
.learncard .lm span, .learnlist li > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.learncard small, .learnlist small { color: var(--mute); }
.learncard .linkbtn { display: block; margin: 8px auto 0; }
.learnbar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; margin-top: 6px; }
.learnbar i { display: block; height: 100%; border-radius: inherit; background: var(--up); transition: width .5s ease; }
.learnlist { list-style: none; padding: 0; }
.learnlist li { padding: 12px 14px; border-bottom: 1px solid var(--line, color-mix(in srgb, var(--ink) 10%, transparent)); align-items: center; }
.learnlist li:last-child { border-bottom: 0; }
.learnlist li.done > i { color: var(--up); font-weight: 700; }
.learnlist li.done b { color: var(--mute); }
.learnlist .mini { flex: none; }
.learn-spot { outline: 3px solid var(--up); outline-offset: 3px; border-radius: 10px; animation: learnPulse 1.1s ease-in-out 3; }
@keyframes learnPulse { 50% { outline-offset: 7px; outline-color: color-mix(in srgb, var(--up) 45%, transparent); } }
@media (prefers-reduced-motion: reduce) { .learn-spot { animation: none; } .learnbar i { transition: none; } }
.tour-ic.big { font-size: 3rem; }

/* ---- Workout: plate helper patched in place, toasts clear of the rest timer ---- */
/* The helper's wrapper adds no box of its own, so the card spacing is unchanged. */
.hlpw { display: contents; }
/* While the rest timer shows, toasts sit above it so they never cover +30s or Skip (--timer-h is set by the workout screen). */
body:has(#timer:not([hidden])) #toast { bottom: calc(86px + var(--timer-h, 64px) + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }
@media (min-width: 1000px) and (min-height: 520px) {
  body:has(#timer:not([hidden])) #toast { bottom: calc(28px + var(--timer-h, 64px)); }
}

/* Programme: drag a day by its handle; My templates */
.pdays { display: grid; gap: 12px; }
.pdrow { display: flex; align-items: stretch; }
.pdrow .pdh { flex: 1; min-width: 0; }
.dragh { flex: none; width: 48px; display: grid; place-items: center; background: none; border: 0; border-left: 1px solid var(--line); color: var(--mute); touch-action: none; cursor: grab; }
.dragh svg { width: 20px; height: 20px; }
.dragh:focus-visible { outline: 2px solid var(--k); outline-offset: -3px; }
.dragmode { user-select: none; -webkit-user-select: none; }
.dragmode .pday2 { transition: transform .15s ease; }
.dragmode .pday2.dragging { transition: none; position: relative; z-index: 5; box-shadow: 0 10px 28px rgb(0 0 0 / .35); cursor: grabbing; }
.dragmode .pday2.dragging .dragh { color: var(--k); cursor: grabbing; }
@media (prefers-reduced-motion: reduce) { .dragmode .pday2 { transition: none; } }
.mytpl { display: grid; gap: 10px; }
.mytpl p { margin: 0; }
.mytpl .li .grow { flex: 1; min-width: 0; }
.mytpl .li .grow b, .mytpl .li .grow small { display: block; }
.mytpl .li .grow small { color: var(--mute); font-size: 0.75rem; }
.mytpl .li:first-child { border-top: 0; }
