:root {
  --bg: #0e1113;
  --surface: #161b1e;
  --surface-2: #1d2428;
  --line: #2a3338;
  --ink: #eef3f1;
  --ink-2: #a9b5b1;
  --ink-3: #6f7c78;
  --accent: #b6f24a;
  --accent-ink: #0e1113;
  --accent-soft: rgba(182, 242, 74, 0.12);
  --warn: #f2b84a;
  --bad: #f26b4a;
  --info: #5cc8f2;
  /* Effort ramp: 1 easy (cool) to 5 max (hot) */
  --r1: #4ad6c3;
  --r2: #7fdc6a;
  --r3: #d8e04a;
  --r4: #f2a64a;
  --r5: #f2614a;
  --radius: 16px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 'Barlow', system-ui, sans-serif;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: 0.3; cursor: default; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.01em; }

#app { max-width: 720px; margin: 0 auto; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(14, 17, 19, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.home { color: var(--ink-2); text-decoration: none; font-size: 28px; line-height: 1; padding: 0 4px; }
.brand { font: 800 26px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; flex: 1; }
.brand em { font-style: normal; color: var(--accent); }
.phase-chip {
  font: 700 13px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent);
}
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.sync[data-status="pending"] { background: var(--warn); }
.sync[data-status="offline"] { background: var(--ink-3); }

main { padding: 16px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
.loading { color: var(--ink-3); padding: 40px 0; text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.eyebrow { display: block; font: 700 12px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 10px; }

/* ── Day bar & summary ── */
.daybar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.daynav { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); font-size: 22px; }
.daytitle { text-align: center; }
.daytitle strong { display: block; font: 800 28px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; }
.daytitle span { color: var(--ink-3); font-size: 13px; }

.summary { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); margin-bottom: 12px; }
.ring {
  --p: 0;
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--surface-2) 0);
  display: grid; place-items: center; position: relative;
}
.ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font: 700 15px/1 'Barlow Condensed', sans-serif; color: var(--ink-2); }
.ring b { font-size: 22px; color: var(--ink); }
.summary-text strong { display: block; font-size: 16px; }
.summary-text span { color: var(--ink-3); font-size: 13px; }

.note { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.note-phase { border-color: var(--accent); background: var(--accent-soft); }
.note-pain { border-color: var(--warn); }

.pain-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius); margin-bottom: 8px; }
.pain-row div { flex: 1; }
.pain-row strong { display: block; font-size: 15px; }
.pain-row span { color: var(--ink-3); font-size: 13px; }

.switch { flex: none; width: 50px; height: 30px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-3); transition: transform .2s, background .2s; }
.switch.on { background: var(--accent-soft); border-color: var(--accent); }
.switch.on i { transform: translateX(20px); background: var(--accent); }
.pain-row .switch.on { background: rgba(242, 184, 74, .15); border-color: var(--warn); }
.pain-row .switch.on i { background: var(--warn); }

/* ── Groups & boxes ── */
.group { margin-top: 24px; }
.group-head { margin-bottom: 10px; }
.group-head h2 { font-size: 22px; font-weight: 800; text-transform: uppercase; }
.group-blurb { color: var(--ink-3); font-size: 13px; }
.boxes { display: grid; gap: 10px; }
@media (min-width: 640px) { .boxes { grid-template-columns: 1fr 1fr; } }

.box {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; background: var(--surface); border-radius: var(--radius);
  border: 1px solid transparent; transition: border-color .2s, background .2s;
}
.box.primary { border-color: var(--line); }
.box.state-done { border-color: rgba(182, 242, 74, .45); }
.box.state-partial { border-color: rgba(242, 184, 74, .45); }
.box.state-skip { opacity: .6; }
.box header { display: flex; align-items: flex-start; gap: 10px; }
.box-icon { font-size: 22px; line-height: 1.2; }
.box-title { flex: 1; min-width: 0; }
.box-title h3 { font-size: 19px; font-weight: 700; text-transform: uppercase; line-height: 1.1; }
.box-level { color: var(--ink-2); font-size: 13.5px; }
.time { flex: none; font: 700 12px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--surface-2); padding: 5px 8px; border-radius: 99px; }

.target-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.target { font: 800 40px/0.9 'Barlow Condensed', sans-serif; letter-spacing: -0.01em; }
.target small { font: 600 13px 'Barlow', sans-serif; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.target-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.why { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.why-up { color: var(--accent); }
.why-level { color: var(--accent-ink); background: var(--accent); }
.why-down { color: var(--warn); }
.ladder { display: flex; gap: 3px; }
.ladder i { width: 12px; height: 4px; border-radius: 2px; background: var(--surface-2); }
.ladder i.past { background: rgba(182, 242, 74, .45); }
.ladder i.cur { background: var(--accent); }

.cue-toggle { align-self: flex-start; color: var(--ink-3); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.cue { font-size: 14px; color: var(--ink-2); background: var(--surface-2); padding: 10px 12px; border-radius: 10px; }

.results, .actual { display: flex; gap: 8px; }
.actual { align-items: flex-end; }
.actual label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.actual input, .bench-form input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 16px;
}
.actual input:focus, .bench-form input:focus, .daynote:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; white-space: nowrap; }
.results .btn { flex: 1; }
.results.choice .btn { padding: 10px 6px; }
.group.optional .group-head h2 { color: var(--ink-2); }
.group.optional .box { background: transparent; border: 1px dashed var(--line); }
.group.optional .box.state-done { border-style: solid; border-color: rgba(182, 242, 74, .45); }
.btn.done.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.partial.on { background: var(--warn); color: var(--accent-ink); border-color: var(--warn); }
.btn.ghost.on { background: var(--line); }
.btn.danger { color: var(--bad); border-color: rgba(242, 107, 74, .5); }

.rating-q { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.rating-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rate { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.rate b { font: 800 20px/1 'Barlow Condensed', sans-serif; }
.rate small { font-size: 10.5px; color: var(--ink-3); }
.rate.on small { color: inherit; }
.rate.r1.on { background: var(--r1); } .rate.r2.on { background: var(--r2); }
.rate.r3.on { background: var(--r3); } .rate.r4.on { background: var(--r4); } .rate.r5.on { background: var(--r5); }
.rate.on { color: var(--accent-ink); border-color: transparent; }

.next { font-size: 13.5px; color: var(--ink-2); padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.next b { color: var(--ink); }
.next span { float: right; font-weight: 600; }
.next-up span, .next-level span { color: var(--accent); }
.next-down span { color: var(--warn); }

.adjust { align-self: flex-end; margin-top: -4px; font-size: 12px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

.daynote { width: 100%; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); resize: vertical; font-size: 15px; }

/* ── Sheet ── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 560px; margin: 0 auto; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet h3 { font-size: 24px; text-transform: uppercase; }
.adj-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adj-row > span { color: var(--ink-2); font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { min-width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 18px; padding: 0 10px; }
.stepper.wide button { font-size: 13px; }
.stepper b { min-width: 60px; text-align: center; font: 700 20px 'Barlow Condensed', sans-serif; }
.stepper.wide b { font-size: 15px; max-width: 150px; line-height: 1.2; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Tab bar ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(14, 17, 19, .95); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-radius: 12px; }
.tab span { font-size: 20px; filter: grayscale(1); opacity: .6; }
.tab.on { color: var(--accent); }
.tab.on span { filter: none; opacity: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 600; font-size: 14px;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Progress ── */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card p + p, .card p + ul, .card ul + p { margin-top: 10px; }
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goal h2 { font-size: 30px; text-transform: uppercase; line-height: 1; margin-bottom: 4px; }
.goal-num b { font: 800 40px/1 'Barlow Condensed', sans-serif; color: var(--accent); }
.bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); margin: 14px 0 10px; overflow: visible; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); min-width: 4px; }
.bar em { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--ink-3); }
.bar.thin { height: 6px; margin: 6px 0 0; }
.bench-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.bench-form label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); }
.bench-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bench { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 4px 5px 10px; border-radius: 99px; background: var(--surface-2); font: 700 17px 'Barlow Condensed', sans-serif; }
.bench small { font: 500 11px 'Barlow', sans-serif; color: var(--ink-3); }
.bench button { color: var(--ink-3); padding: 0 6px; font-size: 15px; }

.phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.phase { padding: 10px 6px; border-radius: 12px; background: var(--surface-2); text-align: center; color: var(--ink-3); border: 1px solid transparent; }
.phase b { display: block; font: 800 22px/1 'Barlow Condensed', sans-serif; }
.phase span { display: block; font-weight: 600; font-size: 13px; }
.phase small { font-size: 11px; }
.phase.past { color: var(--ink-2); }
.phase.cur { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
.phase.cur b { color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 10px; text-align: center; }
.stat b { display: block; font: 800 32px/1 'Barlow Condensed', sans-serif; }
.stat span { font-size: 12px; color: var(--ink-3); }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal { display: block; aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); }
.cal.l1 { background: rgba(182, 242, 74, .25); }
.cal.l2 { background: rgba(182, 242, 74, .5); }
.cal.l3 { background: rgba(182, 242, 74, .75); }
.cal.l4 { background: var(--accent); }
.cal.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal.pain { box-shadow: inset 0 0 0 2px var(--warn); }
.cal-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--ink-3); }
.cal-legend .cal { width: 12px; height: 12px; }
.cal-legend span:first-child { margin-right: 4px; }
.cal-legend span:last-child { margin-left: 4px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chip { flex: none; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: 'Barlow', sans-serif; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent-soft); }
.chart .lvl-line { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.chart .lvl-text { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.chart .hit { fill: transparent; }
.dot { stroke: var(--surface); stroke-width: 2; }
.dot.none { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.5; }
.dot.skip { fill: var(--ink-3); }
.dot.r1, .dot-key.r1 { fill: var(--r1); background: var(--r1); }
.dot.r2, .dot-key.r2 { fill: var(--r2); background: var(--r2); }
.dot.r3, .dot-key.r3 { fill: var(--r3); background: var(--r3); }
.dot.r4, .dot-key.r4 { fill: var(--r4); background: var(--r4); }
.dot.r5, .dot-key.r5 { fill: var(--r5); background: var(--r5); }
.tip { position: absolute; top: -8px; transform: translateY(-100%); pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 10px; font-size: 12.5px; display: flex; flex-direction: column; min-width: 160px; z-index: 5; }
.tip[hidden] { display: none; }
.chart-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.chart-key > span:first-child { width: 100%; }
.key { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.dot-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.chart-empty { padding: 20px 0; }

.ladders { display: grid; gap: 14px; }
.ladder-row .lr-name { font-weight: 600; }
.ladder-row .lr-level { display: block; color: var(--ink-3); font-size: 13px; }

/* ── Plan tab ── */
.rules { list-style: none; display: grid; gap: 6px; }
.rules li { font-size: 14px; color: var(--ink-2); }
.rk { display: inline-block; min-width: 118px; padding: 2px 8px; border-radius: 6px; color: var(--accent-ink); margin-right: 6px; }
.rk.r1 { background: var(--r1); } .rk.r2 { background: var(--r2); } .rk.r3 { background: var(--r3); }
.rk.r4 { background: var(--r4); } .rk.r5 { background: var(--r5); }
.toggles { display: grid; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row small { display: block; color: var(--ink-3); font-size: 12px; }
.safety { border: 1px solid rgba(242, 184, 74, .4); }

/* ── Did more / fewer ── */
.did { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.stepper.small button { min-width: 34px; height: 34px; font-size: 16px; }
.stepper.small b { min-width: 44px; font-size: 18px; }
.stepper b.more { color: var(--accent); }
.stepper b.less { color: var(--warn); }

/* ── Pace ── */
.pace-head { margin-bottom: 10px; }
.pace-head h2 { font-size: 30px; text-transform: uppercase; line-height: 1; margin-bottom: 4px; }
.pace-ahead { color: var(--accent); }
.pace-behind { color: var(--warn); }
.chart .plan-line { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .proj-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1 4; stroke-linecap: round; opacity: .8; }
.chart .today-line { stroke: var(--line); stroke-width: 1; }
.dot.now { fill: var(--accent); }
.line-key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--accent); }
.line-key.plan { border-top: 2px dashed var(--ink-3); }
.line-key.proj { border-top: 2px dotted var(--accent); }
.pace-eta { margin-top: 10px; }
.pace-badge { margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); vertical-align: 2px; }
.pace-badge.ahead, .pace-badge.top { color: var(--accent); }
.pace-badge.behind { color: var(--warn); }
.note-bench { border-color: var(--info); }

/* ── Exercise figures ── */
.fig { display: block; width: 100%; max-width: 300px; margin: 0 auto; background: var(--surface-2); border-radius: 12px; }
.fig .body { stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.fig .far { opacity: .4; }
.fig .neck { stroke-width: 3; }
.fig .head { fill: var(--surface-2); stroke: var(--ink); stroke-width: 3; }
.fig .ground { stroke: var(--line); stroke-width: 2; }
.fig .prop { stroke: var(--ink-3); stroke-width: 2; fill: none; stroke-linecap: round; }
.fig .prop.wall { stroke-width: 3.5; }
.fig .prop.solid { fill: var(--line); stroke: none; }
.fig .prop-fill { fill: var(--ink-3); }
.fig .db { fill: var(--accent); }
.fig .strap { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 3 2; }
.howto { display: grid; gap: 10px; }
.howto .cue { margin: 0; }

.sheet .fig { max-width: 220px; }

/* ── Sets ── */
.setrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.setlabel { font-size: 13px; color: var(--ink-2); margin-right: 4px; }
.setchip {
  width: 44px; height: 44px; border-radius: 12px; border: 1.5px dashed var(--ink-3);
  font: 700 18px 'Barlow Condensed', sans-serif; color: var(--ink-2); background: transparent;
}
.setchip.on { background: var(--accent); border: 1.5px solid var(--accent); color: var(--accent-ink); }
.setcount { margin-left: auto; font: 700 15px 'Barlow Condensed', sans-serif; color: var(--ink-3); }
.setrow.compact .setchip { width: 38px; height: 38px; font-size: 16px; }
.box.state-progress { border-color: var(--accent); border-style: dashed; }

.active-sets {
  position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 5;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}
.active-sets .eyebrow { margin-bottom: 0; color: var(--accent); }
.active-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.active-name { text-align: left; font-weight: 600; font-size: 14px; min-width: 0; }
.active-name small { display: block; color: var(--ink-3); font-weight: 500; font-size: 12px; }
.active-row .setrow { flex-wrap: nowrap; }
.active-row .setcount { display: none; }

.box-foot { display: flex; justify-content: space-between; margin-top: -4px; }
.box-foot .adjust { margin-top: 0; align-self: auto; }

/* ── Ladder sheet ── */
.sheet.tall { max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-x { font-size: 28px; line-height: 1; color: var(--ink-2); padding: 0 6px; }
.steps { list-style: none; display: grid; gap: 12px; }
.step { background: var(--surface-2); border-radius: 14px; padding: 12px; display: grid; gap: 10px; border: 1px solid transparent; }
.step .fig { max-width: 240px; background: var(--bg); }
.step .cue { background: transparent; padding: 0; }
.step-head { display: flex; gap: 10px; align-items: flex-start; }
.step-head strong { display: block; font-size: 15px; }
.step-range, .step-status { display: block; font-size: 13px; color: var(--ink-3); }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 15px 'Barlow Condensed', sans-serif; background: var(--line); color: var(--ink-2); }
.step-done .step-num { background: var(--accent-soft); color: var(--accent); }
.step-current { border-color: var(--accent); }
.step-current .step-num { background: var(--accent); color: var(--accent-ink); }
.step-current .step-status { color: var(--accent); }
.step-skipped { opacity: .55; }
.step-goal { font-weight: 600; padding: 4px 2px; }
.sessions { list-style: none; display: grid; gap: 6px; font-size: 13px; }
.sessions li { display: grid; grid-template-columns: 52px 1fr; gap: 2px 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.sessions li span:nth-child(2) { color: var(--ink-2); }
.sessions li span:nth-child(3) { grid-column: 2; color: var(--ink-3); }
.ladder-row { display: block; width: 100%; text-align: left; }

.sync-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
a.btn { display: inline-block; text-decoration: none; color: var(--ink); margin-top: 10px; }

/* ── Completed boxes collapse to one line ── */
.box.compact { padding: 0; gap: 0; }
.group.optional .box.compact { border-style: solid; }
.compact-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; }
.compact-check {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px;
}
.box.compact.state-partial .compact-check { background: var(--warn); }
.box.compact.state-skip { opacity: 1; }
.box.compact.state-skip .compact-check { background: var(--line); color: var(--ink-2); }
.compact-main { flex: 1; min-width: 0; }
.compact-main b { display: block; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.compact-main small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-next { color: var(--ink-2); }
.compact-edit { flex: none; font-size: 12px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.group-count { margin-left: 10px; font: 600 13px 'Barlow', sans-serif; text-transform: none; color: var(--accent); vertical-align: 3px; }
.box-foot .collapse { color: var(--ink-2); }
