@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Bold.ttf") format("truetype"); font-weight: 700 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/BarlowCondensed-Bold.ttf") format("truetype"); font-weight: 700 900; font-style: normal; font-display: swap; }

:root {
  --protocol-paper: #f4f2e8;
  --protocol-plate: #faf9f2;
  --protocol-ink: #111214;
  --protocol-muted: #62635f;
  --protocol-rule-soft: #a7a69f;
  --protocol-orange: #f15a29;
  --protocol-orange-hover: #f36d42;
  --protocol-orange-active: #d94b20;
  --protocol-on-orange: #111214;
  --protocol-selection: #f7a78d;
  --protocol-hover: rgb(17 18 20 / .06);
  --protocol-hover-quiet: rgb(17 18 20 / .04);
  --protocol-scrim: rgb(17 18 20 / .62);
  --protocol-pictogram-paper: #f4f2e8;
  --paper: var(--protocol-paper);
  --card: var(--protocol-plate);
  --ink: var(--protocol-ink);
  --ink-2: var(--protocol-muted);
  --muted: var(--protocol-muted);
  --line: var(--protocol-rule-soft);
  --orange: var(--protocol-orange);
  --on-orange: var(--protocol-on-orange);
  --pictogram-paper: var(--protocol-pictogram-paper);
  --danger: var(--protocol-ink);
  --font-interface: "Barlow", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --control-height: 48px;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
  font-family: var(--font-interface);
  font-synthesis: none;
}

:root[data-color-scheme="dark"] {
  --protocol-paper: #111214;
  --protocol-plate: #1d1e1b;
  --protocol-ink: #f4f2e8;
  --protocol-muted: #c2c0b8;
  --protocol-rule-soft: #85857d;
  --protocol-selection: #77361f;
  --protocol-hover: rgb(244 242 232 / .10);
  --protocol-hover-quiet: rgb(244 242 232 / .07);
  --protocol-scrim: rgb(0 0 0 / .78);
  --protocol-pictogram-paper: transparent;
  color-scheme: dark;
}

:root[data-color-scheme="dark"] :is(
  .schedule-method-visual img,
  .schedule-exercise-visual img,
  .runway-figure .exercise-pictogram,
  .runway-figure .exercise-pictogram.is-maximal,
  .story-panel img,
  .focus-exercise img,
  .circuit-prep-image .exercise-pictogram
) { filter: invert(1) grayscale(1) contrast(1.15); }

* { box-sizing: border-box; }
html { min-height: 100%; scroll-padding-block: 72px 170px; background: var(--paper); }
body { min-width: 0; min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); background: var(--paper); }
body, button, input, select, textarea { font-family: var(--font-interface); }
#app, #overlay, .shell, .workout-shell, main, section, header, footer, nav, div { min-inline-size: 0; }
button, input, select, textarea { font: inherit; }
button { max-inline-size: 100%; border: 0; cursor: pointer; }
button, a, summary { touch-action: manipulation; }
button:disabled { color: var(--muted); cursor: default; }
a { color: inherit; }
img, svg { max-inline-size: 100%; }
::selection { color: var(--ink); background: var(--protocol-selection); }
:where(a, button, input, select, textarea, summary, [tabindex]) { scroll-margin-block: 72px 170px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--protocol-orange); outline-offset: 2px; }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: -.025em; }
h1 { margin-bottom: 16px; font-size: clamp(2.5rem, 10vw, 5rem); line-height: .92; }
h2 { margin-bottom: 12px; font-size: clamp(2rem, 7vw, 3.25rem); line-height: .95; }
h3 { margin-bottom: 8px; }
p, li { line-height: 1.5; }

.skip-link { position: fixed; z-index: 100; inset: 8px auto auto 8px; display: inline-flex; min-height: 48px; align-items: center; padding: 10px 14px; color: var(--paper); background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.icon { display: inline-grid; width: 1.2em; height: 1.2em; flex: 0 0 auto; place-items: center; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.loading { display: grid; width: min(420px, calc(100% - 32px)); min-height: 100vh; min-height: 100dvh; margin: auto; align-content: center; gap: 12px; text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.loading-protocol { display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 2px; height: 16px; padding-top: 4px; border-top: 1px solid var(--ink); }
.loading-protocol i { background: var(--protocol-rule-soft); }
.loading-protocol i:first-child { background: var(--orange); animation: protocol-travel 1.4s steps(16, end) infinite; }

/* Shared protocol controls ------------------------------------------------ */
.primary, .secondary, .ghost, .danger, .icon-button, .schedule-expand, .instruction-button {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--ink);
  background: transparent;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}
.primary { color: var(--on-orange); background: var(--orange); border: 1px solid var(--ink); border-bottom-width: 4px; }
.primary:hover:not(:disabled) { background: var(--protocol-orange-hover); }
.primary:active:not(:disabled) { background: var(--protocol-orange-active); }
.secondary, .instruction-button { border: 1px solid var(--ink); }
.secondary:hover:not(:disabled), .instruction-button:hover:not(:disabled) { background: var(--protocol-hover); }
.secondary.active, .secondary[aria-pressed="true"] { border: 2px solid var(--orange); }
.ghost { padding-inline: 10px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ghost:hover:not(:disabled) { text-decoration-thickness: 2px; }
.danger, .secondary-danger { border: 2px solid var(--ink); }
.icon-button { width: 48px; height: 48px; padding: 12px; border: 1px solid var(--ink); }
.icon-button.next .icon { transform: rotate(180deg); }
.wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.actions > * { flex: 1 1 180px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 800; }
.error, .success, .planner-hint { padding: 12px 14px; color: var(--ink); background: transparent; border: 2px solid var(--ink); line-height: 1.4; }
.error::before { content: "! "; color: var(--orange); font-weight: 900; }
.success::before { content: "✓ "; font-weight: 900; }

.protocol-bar { --bar-active-travel-gap: var(--bar-travel-gap, 62px); display: grid; width: 100%; gap: 2px; }
.protocol-bar-meta { display: flex; min-height: 13px; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .62rem; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.protocol-bar-meta b { color: var(--ink); font-family: var(--font-display); font-size: .7rem; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.protocol-bar-track { display: grid; grid-template-columns: repeat(var(--bar-segments, 120), minmax(0, 1fr)); gap: 2px; width: 100%; height: 16px; padding-top: 4px; border-top: 1px solid var(--ink); }
.protocol-bar-track i { display: block; min-width: 0; background: var(--protocol-rule-soft); }
.protocol-bar-track i.is-complete { background: var(--ink); }
.protocol-bar-track i.is-current { background: var(--orange); }
.protocol-bar.is-indeterminate .is-travelling { animation: protocol-travel 1.4s steps(16, end) infinite; }
@keyframes protocol-travel { 0% { transform: translateX(0); } 100% { transform: translateX(calc(var(--bar-travel, 3100%) + var(--bar-active-travel-gap))); } }

/* Global route frame ------------------------------------------------------ */
.shell { width: min(1120px, 100%); margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 14px calc(48px + env(safe-area-inset-bottom)); }
.dashboard-shell, .calendar-shell { width: min(1280px, 100%); }
.topbar, .compact-head { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.brand, .compact-head strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 900; letter-spacing: -.015em; }
.compact-head > div { display: grid; gap: 1px; }
.compact-head span { color: var(--muted); font-size: .75rem; }
.compact-head > :first-child.icon-button { flex: 0 0 auto; }
.avatar { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; color: var(--paper); background: var(--ink); border: 0; font-weight: 900; }
.card { padding: 20px 0; background: transparent; border-block: 2px solid var(--ink); border-inline: 0; outline: 0; }
.lede { max-width: 65ch; color: var(--muted); }
.view-links { display: flex; justify-content: flex-end; gap: 8px; }
.view-links a { gap: 7px; }
.stat-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-block: 1px solid var(--ink); }
.stat-line > span { display: grid; min-height: 72px; align-content: center; padding: 10px 16px; color: var(--muted); }
.stat-line > span + span { border-left: 1px solid var(--ink); }
.stat-line b { color: var(--ink); font-family: var(--font-display); font-size: 1.75rem; font-variant-numeric: tabular-nums; }

/* Authentication, pairing, and enrollment ------------------------------- */
.auth { min-height: 100vh; min-height: 100dvh; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.auth-panel { display: grid; min-height: calc(100vh - 48px); min-height: calc(100dvh - 48px); place-items: center; }
.auth-card { display: grid; width: min(460px, 100%); gap: 18px; padding: 24px; background: var(--card); border-block: 2px solid var(--ink); }
.auth-card h1 { margin-bottom: 0; font-size: clamp(2.7rem, 12vw, 4.4rem); }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--ink); }
.tabs button { min-height: 48px; color: var(--muted); background: transparent; border-right: 1px solid var(--ink); font-weight: 700; }
.tabs button:last-child { border-right: 0; }
.tabs button.active { color: var(--ink); border-bottom: 4px solid var(--orange); }
.form { display: grid; gap: 16px; }
.form label, .program label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
input, textarea, select { width: 100%; min-height: 48px; padding: 10px 11px; color: var(--ink); background: transparent; border: 1px solid var(--ink); }
input:focus, textarea:focus, select:focus { border-color: var(--orange); }
.watch-pair-card { text-align: center; }
.watch-mark { display: grid; width: 64px; height: 64px; margin-inline: auto; place-items: center; border: 2px solid var(--ink); }
.watch-mark .icon { width: 32px; height: 32px; }
.pair-code { padding-block: 10px; border-block: 2px solid var(--ink); font-family: var(--font-display); font-size: clamp(3.4rem, 18vw, 6rem); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.onboarding { display: grid; gap: 24px; padding-top: clamp(32px, 9vw, 96px); }
.program { display: grid; gap: 22px; width: min(760px, 100%); }
.program h2 { margin: 0; }
.program-start small { color: var(--muted); font-weight: 500; line-height: 1.4; }

/* Dashboard and week planner -------------------------------------------- */
.dashboard-shell, .calendar-shell, .progress-shell { display: grid; gap: 16px; }
.today-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 14px; align-items: center; padding-block: 16px; border-block: 2px solid var(--ink); }
.today-icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--ink); }
.today-copy { display: grid; gap: 3px; }
.today-copy span { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.today-copy strong { font-size: 1.2rem; }
.today-card .primary { grid-column: 1 / -1; margin-top: 14px; }
.muted-card { color: var(--muted); }
.week-panel { border: 0; outline: 0; }
.week-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 2px solid var(--ink); }
.week-toolbar > div { display: grid; }
.week-toolbar > div b { font-family: var(--font-display); font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.week-toolbar > div span { color: var(--muted); font-size: .68rem; }
.week-panel > .protocol-bar { padding: 10px 0; border-bottom: 2px solid var(--ink); }
.planner-hint { margin: 10px; border-width: 1px; border-left-width: 4px; }
.planner-hint .icon { margin-right: 6px; }
.week-calendar { display: grid; grid-template-columns: 1fr; }
.week-slot { display: grid; grid-template-columns: 78px minmax(0, 1fr); min-height: 80px; border-bottom: 1px solid var(--line); }
.week-slot:last-child { border-bottom: 0; }
.slot-date { display: grid; align-content: center; padding: 12px; border-right: 1px solid var(--ink); }
.slot-date b { text-transform: uppercase; letter-spacing: .06em; }
.slot-date span { color: var(--muted); font-size: .7rem; }
.week-slot.today .slot-date { border-left: 5px solid var(--orange); padding-left: 7px; }
.schedule-card { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px; width: 100%; min-height: 78px; align-content: center; padding: 12px 14px; color: var(--ink); background: transparent; text-align: left; text-decoration: none; }
.schedule-card:hover { background: var(--protocol-hover-quiet); }
.schedule-card .schedule-grip { grid-row: 1 / 3; align-self: center; }
.schedule-card strong { line-height: 1.2; }
.schedule-card small { overflow: hidden; color: var(--muted); line-height: 1.25; }
.schedule-visuals { --schedule-pictogram-size: 36px; grid-column: 1 / -1; display: flex; min-width: 0; align-items: end; justify-content: space-between; gap: 8px; margin-top: 8px; }
.schedule-method-visual { display: grid; max-width: 100%; grid-template-columns: repeat(var(--method-panels, 1), var(--schedule-pictogram-size)); gap: 2px; overflow: hidden; }
.schedule-exercise-visual { display: flex; min-width: 0; justify-content: flex-end; gap: 2px; overflow: hidden; }
.schedule-method-visual img,
.schedule-exercise-visual img { display: block; width: var(--schedule-pictogram-size); height: var(--schedule-pictogram-size); flex: 0 0 var(--schedule-pictogram-size); padding: 2px; object-fit: contain; background: var(--pictogram-paper); }
.schedule-exercise-visual img.is-maximal { padding: 0; }
.schedule-card.status-completed strong::after { content: "  ✓"; }
.schedule-card.status-active, .schedule-card.status-paused { border-left: 4px solid var(--orange); padding-left: 10px; }
.schedule-card.selected { border-left: 4px solid var(--orange); padding-left: 10px; }
.empty-day { width: 100%; min-height: 72px; color: var(--muted); background: transparent; font-size: 1.4rem; }
.week-slot.can-drop .empty-day { color: var(--ink); border: 1px dashed var(--ink); }
.week-slot.drop-target { outline: 3px solid var(--orange); outline-offset: -3px; }
.schedule-future[hidden] { display: none; }
.schedule-expand { width: 100%; justify-content: space-between; border-top: 2px solid var(--ink); }
.schedule-expand .icon:last-child { transform: rotate(90deg); }

/* Month planner ---------------------------------------------------------- */
.month-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.month-toolbar > b { text-align: center; font-size: .78rem; }
.month-weekdays, .month-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-weekdays b { padding: 6px 2px; color: var(--muted); text-align: center; font-size: .68rem; text-transform: uppercase; }
.month-calendar { border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.month-day { min-height: 84px; padding: 5px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.month-day.outside { color: var(--muted); }
.month-day > time { display: block; width: fit-content; margin-bottom: 4px; font-size: .68rem; font-weight: 700; }
.month-day.today > time { color: var(--ink); border-bottom: 3px solid var(--orange); }
.month-day.can-drop { outline: 1px dashed var(--ink); outline-offset: -4px; }
.month-day.drop-target { outline: 3px solid var(--orange); outline-offset: -3px; }
.month-session, .month-place { display: grid; width: 100%; min-height: 48px; align-content: center; padding: 4px; color: var(--ink); background: transparent; border: 0; text-align: left; }
.month-session { border-left: 3px solid var(--ink); }
.month-session b { font-size: .65rem; }
.month-session > span:not(.schedule-visuals) { overflow: hidden; color: var(--muted); font-size: .62rem; line-height: 1.2; }
.month-session .schedule-visuals { --schedule-pictogram-size: 18px; display: grid; gap: 3px; margin-top: 4px; }
.month-session .schedule-exercise-visual { justify-content: flex-start; overflow: hidden; }
.month-session.status-completed::after { content: "✓"; justify-self: end; }
.month-session.status-active, .month-session.status-paused { border-left-color: var(--orange); }
.month-session.selected { outline: 2px solid var(--orange); }
.month-place { place-items: center; text-align: center; }

/* Lifetime progress ------------------------------------------------------ */
.motivation-card, .consistency-card { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-block: 2px solid var(--ink); }
.motivation-card > span { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border: 1px solid var(--ink); }
.motivation-card div, .consistency-card div { display: grid; gap: 2px; }
.motivation-card small, .consistency-card span { color: var(--muted); }
.progress-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ink); }
.progress-stats > div { display: grid; min-height: 94px; align-content: center; gap: 2px; padding: 12px 8px; text-align: center; }
.progress-stats > div + div { border-left: 1px solid var(--ink); }
.progress-stats b { font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.4rem); font-variant-numeric: tabular-nums; }
.progress-stats span { color: var(--muted); font-size: .67rem; }
.course-progress, .personal-bests, .history-chart, .course-history { padding: 16px; border: 1px solid var(--ink); }
.course-progress small { display: block; margin-top: 8px; color: var(--muted); }
.section-line { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.section-line span { color: var(--muted); font-size: .72rem; }
.best-row, .course-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.best-row:last-child, .course-row:last-child { border-bottom: 0; }
.best-row div { display: grid; }
.best-row span, .best-row small, .course-row span { color: var(--muted); font-size: .68rem; }
.best-row > b, .consistency-card > b { font-family: var(--font-display); font-size: 2rem; font-variant-numeric: tabular-nums; }
.best-row > small { color: var(--ink); font-weight: 800; }
.course-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.course-row span { text-transform: uppercase; }
.month-bars { display: grid; grid-template-columns: repeat(12, minmax(42px, 1fr)); gap: 6px; height: 190px; margin-top: 16px; overflow-x: auto; }
.progress-month { display: grid; grid-template-rows: 1fr auto auto; gap: 4px; text-align: center; }
.progress-month > span { display: flex; align-items: end; justify-content: center; border: 1px solid var(--line); }
.progress-month i { display: block; width: 55%; min-height: 0; background: var(--ink); }
.progress-month:last-child i { background: var(--orange); }
.progress-month b { font-size: .72rem; }
.progress-month small { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.progress-empty { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 28px 0; border-block: 2px solid var(--ink); }
.progress-empty > span { display: grid; width: 56px; height: 56px; place-items: center; border: 1px solid var(--ink); }
.progress-empty h1 { font-size: clamp(2.4rem, 8vw, 4.5rem); }

/* Workout shell and square pictogram navigator -------------------------- */
#app:has(.workout-shell) { background: var(--paper); }
.workout-shell { display: flex; width: min(1120px, 100%); min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom)); flex-direction: column; gap: 8px; }
.workout-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.workout-title { display: grid; gap: 2px; min-height: 48px; align-content: center; padding: 0 10px; color: var(--ink); background: transparent; border-left: 4px solid var(--orange); text-align: left; }
.workout-title span { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workout-title b { overflow: hidden; font-size: .95rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.watch-live { position: relative; display: grid; width: 48px; height: 48px; place-items: center; color: var(--ink); background: transparent; border: 1px solid var(--ink); }
.watch-live b { font-family: var(--font-display); font-size: 1.05rem; }
.watch-live > i { position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px; background: var(--muted); }
.watch-live.connected > i { background: var(--ink); }
.workout-runway { display: grid; grid-template-columns: repeat(var(--exercise-count), minmax(82px, 1fr)); min-width: calc(var(--exercise-count) * 82px); overflow-x: auto; scroll-snap-type: x proximity; }
.workout-runway[style*="--exercise-count:1"] { grid-template-columns: minmax(0, 148px); min-width: 0; justify-content: center; }
.workout-runway[style*="--exercise-count:1"] .runway-step { width: 100%; }
.workout-runway .runway-step { position: relative; display: grid; min-width: 82px; aspect-ratio: 1; margin-left: -2px; place-items: center; overflow: hidden; padding: 9px; color: var(--ink); background: transparent; border: 2px solid var(--ink); scroll-snap-align: start; }
.workout-runway .runway-step:first-child { margin-left: 0; }
.workout-runway .runway-step:hover { background: var(--protocol-hover-quiet); }
.workout-runway .runway-step.is-current { z-index: 1; border-color: var(--orange); outline: 0; }
.runway-figure { display: grid; width: 100%; height: 100%; place-items: center; }
.runway-figure .exercise-pictogram, .runway-figure .exercise-movement { display: block; width: 100%; height: 100%; object-fit: contain; }
.runway-figure .exercise-pictogram { padding: 0; background: transparent; filter: grayscale(1) contrast(1.2); }
.runway-figure .exercise-pictogram.is-maximal { filter: none; }
.pictogram-body { fill: currentColor; }
.runway-status { position: absolute; z-index: 2; top: 6px; left: 6px; display: grid; width: 24px; height: 24px; place-items: center; color: var(--ink); background: transparent; border: 0; }
.runway-status .timeline-state-glyph { width: 15px; height: 15px; fill: currentColor; }
.runway-step.is-current .runway-status { color: var(--orange); border-color: var(--orange); }
.workout-progress-bar { padding: 2px 0 6px; }
.workout-progress-bar .protocol-bar-meta { font-size: .62rem; }
.workout-progress-bar .protocol-bar-track { height: 14px; padding-top: 3px; }
.workout-main { width: 100%; min-height: 0; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; }
#swipe-zone { width: 100%; padding: 6px 0 12px; }

/* Method introduction ---------------------------------------------------- */
[data-protocol="plate"] { background: transparent; border: 0; outline: 0; }
.mode-intro { position: relative; display: grid; gap: 0; margin: 6px; }
.protocol-number { display: block; padding: 14px 18px 0; color: var(--ink); font-family: var(--font-display); font-size: clamp(3rem, 14vw, 6.2rem); line-height: .8; font-variant-numeric: tabular-nums; }
.mode-intro-guide { min-width: 0; padding: 16px 18px 20px; }
.protocol-kicker { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 2px solid var(--ink); color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.protocol-kicker span { display: flex; align-items: center; gap: 7px; }
.protocol-kicker b { color: var(--orange); font-family: var(--font-display); font-size: 2rem; }
.mode-brief { display: grid; gap: 12px; padding-top: 16px; }
.mode-brief-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 10px; }
.mode-brief-head > .icon { align-self: center; }
.mode-brief-head strong { font-family: var(--font-display); font-size: clamp(2.4rem, 9vw, 4.8rem); line-height: .88; text-transform: uppercase; }
.mode-brief-head > span:last-child { grid-column: 2; color: var(--muted); font-size: .72rem; }
.mode-brief > p { margin: 0; font-weight: 750; }
.mode-brief ol { display: grid; gap: 5px; margin: 0; padding-left: 22px; }
.automatic-cue { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-block: 1px solid var(--ink); font-size: .78rem; font-weight: 700; }
.method-storyboard { display: grid; grid-template-columns: repeat(var(--story-panels, 1), minmax(0, 1fr)); border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.story-panel { position: relative; display: grid; aspect-ratio: 1; place-items: center; padding: 7%; overflow: hidden; background: var(--pictogram-paper); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.story-panel img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) contrast(1.25); }
.story-panel b { position: absolute; right: 4px; bottom: 2px; padding-inline: 3px; color: var(--paper); background: var(--ink); font-family: var(--font-display); font-size: .8rem; }
.mode-session-plan { padding: 18px; border-top: 2px solid var(--ink); }
.mode-plan-head { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--ink); text-transform: uppercase; letter-spacing: .07em; }
.mode-session-plan ol { margin: 0; padding: 0; list-style: none; }
.mode-session-plan li { border-bottom: 1px solid var(--line); }
.mode-session-plan li > a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 24px; gap: 10px; min-height: 54px; align-items: center; padding: 8px 0; color: var(--ink); text-decoration: none; }
.mode-session-plan li > a:hover { color: var(--orange); }
.mode-session-plan li > a:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.mode-session-plan li > a > span:first-child { display: grid; width: 30px; height: 30px; place-items: center; color: var(--paper); background: var(--ink); font-family: var(--font-display); }
.mode-session-plan li .icon { justify-self: end; }
.mode-session-plan li div { display: grid; }
.mode-session-plan li small { color: var(--muted); }
.exercise-count { display: flex; width: 100%; min-height: 56px; margin-top: 14px; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; color: var(--ink); background: transparent; border: 0; border-top: 2px solid var(--ink); text-align: left; }
.exercise-count > span { color: var(--muted); }

/* Preparation and book-grounded guidance -------------------------------- */
.preparation-card { display: grid; margin: 6px; background: transparent; border: 0; outline: 0; }
.circuit-preparation { align-content: start; }
.circuit-preparation > .prep-heading { padding: 12px 0 10px; border-bottom: 2px solid var(--orange); }
.circuit-prep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); border-block: 2px solid var(--ink); }
.circuit-prep-station { position: relative; display: grid; min-width: 0; align-content: start; gap: 5px; padding: 8px; border-right: 2px solid var(--ink); }
.circuit-prep-station:last-child { border-right: 0; }
.circuit-prep-station > span { position: absolute; z-index: 1; top: 5px; left: 5px; display: grid; width: 22px; height: 22px; place-items: center; color: var(--paper); background: var(--ink); font-family: var(--font-display); }
.circuit-prep-image { display: grid; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; }
.circuit-prep-image img { display: block; width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) contrast(1.08); }
.circuit-prep-image .exercise-pictogram { padding: 4%; background: var(--pictogram-paper); }
.circuit-prep-station strong { overflow-wrap: anywhere; font-size: .72rem; line-height: 1.1; }
.circuit-quick-start { padding: 12px 0 0; border-top: 2px solid var(--ink); }
.circuit-quick-start > span { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.circuit-quick-start h2 { margin: 4px 0 8px; }
.circuit-quick-start ol { padding-left: 20px; }
.prep-visual { min-width: 0; border-bottom: 2px solid var(--ink); }
.prep-heading { padding: 14px 16px; border-bottom: 4px solid var(--orange); }
.prep-heading span { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.prep-heading h1 { margin: 4px 0 0; font-size: clamp(2.35rem, 9vw, 4.4rem); }
.prep-gallery { display: grid; background: var(--protocol-plate); }
.prep-gallery img { display: block; width: 100%; max-height: 680px; object-fit: contain; }
.prep-gallery img + img { border-top: 1px solid var(--ink); }
.prep-placeholder { display: grid; min-height: 220px; place-items: center; }
.prep-placeholder .icon { width: 52px; height: 52px; }
.prep-body { display: grid; align-content: start; gap: 14px; padding: 16px; }
.prep-meta { min-width: 0; }
.mode-visual-button { position: relative; display: grid; grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.3fr) 24px; width: 100%; min-height: 76px; align-items: stretch; gap: 8px; overflow: hidden; padding: 0 8px 0 0; color: var(--ink); background: transparent; border: 0; text-align: left; }
.mode-button-label { display: flex; align-items: center; gap: 7px; font-weight: 800; }
.mode-button-next { display: grid; align-items: center; }
.mode-visual-button .method-storyboard.is-compact { align-self: stretch; }
.mode-visual-button .method-storyboard.is-compact .story-panel { aspect-ratio: auto; padding: 5%; }
.mode-visual-button .method-storyboard.is-compact[style="--story-panels:1"] .story-panel img { width: auto; max-width: 112px; margin-inline: auto; }
.mode-visual-button .method-storyboard.is-compact .story-panel b { display: none; }
.mode-glyph { display: grid; width: 100%; min-height: 52px; place-items: center; color: var(--ink); }
.mode-glyph svg { width: 100%; height: auto; overflow: visible; }
.mode-glyph path, .mode-glyph ellipse { fill: none; stroke: currentColor; stroke-width: 2; }
.mode-glyph circle, .mode-glyph rect { fill: var(--protocol-rule-soft); stroke: currentColor; }
.mode-glyph .active circle, .mode-glyph .active rect { fill: var(--orange); }
.mode-glyph text { fill: currentColor; font-family: var(--font-display); font-size: 8px; text-anchor: middle; }
.today-cue { padding: 10px 12px; border-left: 5px solid var(--orange); }
.today-cue ul { margin: 6px 0 0; padding-left: 20px; }
.prep-instructions p, .prep-instructions li { line-height: 1.5; }
.prep-instructions ol { display: grid; gap: 5px; padding-left: 22px; }
.instruction-button { width: 100%; border: 0; border-top: 2px solid var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* Live instrument: one white vertical protocol --------------------------- */
.focus-stage { position: relative; overflow: hidden; margin: 6px; color: var(--ink); background: transparent; border: 0; outline: 0; }
.focus-stage.phase-paused::before { position: absolute; z-index: 4; inset: 0; border-block: 2px solid var(--ink); content: ""; pointer-events: none; }
.focus-stage.urgent::after { position: absolute; z-index: 4; top: 0; right: 0; left: 0; height: 4px; background: var(--orange); content: ""; pointer-events: none; }
.focus-top { position: relative; z-index: 2; display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 2px solid var(--ink); }
.focus-status { display: flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.focus-status i { width: 9px; height: 9px; background: var(--orange); }
.phase-rest .focus-status i { background: var(--ink); border: 2px solid var(--paper); outline: 1px solid var(--ink); }
.phase-paused .focus-status i { width: 12px; background: var(--ink); border-inline: 3px solid var(--paper); }
.focus-vitals { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; }
.focus-heart { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.focus-heart small { color: var(--muted); }
.mode-chip { display: inline-flex; min-height: 48px; align-items: center; gap: 6px; padding: 7px 0; color: var(--ink); background: transparent; border: 0; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.focus-mode-chip { min-width: 64px; max-width: 126px; padding: 3px 5px; text-decoration: none; }
.focus-mode-chip > .method-storyboard { width: min(calc(var(--story-panels, 1) * 34px), 102px); border: 0; }
.focus-mode-chip .story-panel { aspect-ratio: 1; padding: 2px; border: 1px solid var(--ink); }
.focus-mode-chip .story-panel b { display: none; }
.focus-mode-chip > .icon { flex: 0 0 auto; }
.focus-exercise { position: relative; z-index: 2; display: grid; grid-template-columns: 58px minmax(0, 1fr); min-height: 66px; align-items: center; gap: 10px; padding: 4px 12px; }
.focus-exercise > span { display: grid; width: 58px; height: 58px; place-items: center; }
.focus-exercise img, .focus-exercise svg { display: block; width: 100%; height: 100%; object-fit: contain; }
.focus-exercise img { padding: 4px; background: var(--pictogram-paper); }
.focus-exercise img.is-maximal { padding: 0; }
.focus-exercise strong { font-family: var(--font-display); font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1; }
.focus-core { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 180px; align-items: center; }
.focus-target, .focus-timer { position: relative; z-index: 2; display: grid; min-width: 0; min-height: 180px; align-content: center; gap: 7px; padding: 16px; }
.focus-target { border-right: 0; }
.focus-target small, .focus-timer span { color: var(--muted); font-size: .72rem; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.focus-target strong, .focus-timer strong { font-family: var(--font-display); font-size: clamp(4rem, 19vw, 7rem); line-height: .86; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.focus-target span { font-weight: 800; }
.focus-target em { margin-top: 2px; color: var(--muted); font-size: .75rem; font-style: normal; }
.focus-timer { container-type: inline-size; justify-items: end; overflow: hidden; text-align: right; }
.focus-timer strong { max-width: 100%; font-size: clamp(2.25rem, 12vw, 7rem); font-size: clamp(2.25rem, 28cqi, 7rem); white-space: nowrap; }
.focus-timer span { max-width: 100%; font-family: var(--font-display); font-size: clamp(.6rem, 5cqi, .72rem); font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.focus-guidance { position: relative; z-index: 2; display: grid; border-top: 2px solid var(--ink); }
.focus-cue, .focus-next { min-height: 76px; padding: 12px; color: var(--ink); background: transparent; text-align: left; }
.focus-cue { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 0; }
.focus-cue > span, .focus-next { display: grid; gap: 3px; }
.focus-cue small, .focus-next small { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.focus-cue strong, .focus-next strong { line-height: 1.3; }
.heart-rate-chart { position: absolute; z-index: 0; inset: 0; margin: 0; pointer-events: none; }
.heart-chart-head, .heart-zone-key, .heart-rate-chart svg text { display: none; }
.heart-rate-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .16; }
.heart-zone { fill: transparent; }
.heart-line { fill: none; stroke: var(--ink); stroke-width: 2; }
.heart-point { fill: var(--orange); stroke: var(--paper); stroke-width: 2; }

/* Mode timeline ---------------------------------------------------------- */
.mode-timeline { position: relative; z-index: 2; display: grid; gap: 6px; padding: 10px 12px; border-top: 2px solid var(--ink); }
.live-protocol-bar .protocol-bar-track { height: 18px; padding-top: 4px; }
.live-protocol-bar .protocol-bar-track i.is-rest.is-complete,
.live-protocol-bar .protocol-bar-track i.is-rest.is-current { background: var(--orange); }
.live-protocol-bar .protocol-bar-track i.is-boundary { margin-left: 2px; }
.timeline-legend { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .68rem; }
.timeline-legend span { display: flex; align-items: center; gap: 5px; }
.timeline-legend i { width: 9px; height: 9px; border: 1px solid var(--ink); }
.timeline-legend i.work { background: var(--ink); }
.timeline-legend i.rest { background: transparent; border-style: dashed; }
.timeline-legend b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.ladder-timeline { gap: 9px; }
.ladder-history { display: flex; min-height: 38px; align-items: center; gap: 5px; overflow-x: auto; }
.ladder-rung, .ladder-history > strong { display: grid; min-width: 32px; height: 32px; padding-inline: 6px; place-items: center; border: 1px solid var(--ink); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.ladder-rung.peak { color: var(--paper); background: var(--ink); border-bottom: 4px solid var(--orange); }
.ladder-history > strong { color: var(--ink); border: 2px solid var(--orange); }
.ladder-empty { color: var(--muted); font-size: .72rem; }
.ladder-arrow { display: inline-grid; margin-left: auto; place-items: center; }

/* Logging and stable workout controls ----------------------------------- */
.compact-logging { margin: 12px 6px 6px; padding: 16px 0; border-block: 2px solid var(--ink); }
.rep-entry { display: grid; grid-template-columns: 52px minmax(120px, 220px) 52px; justify-content: center; align-items: center; gap: 8px; }
.rep-entry > button, .multi-row button { width: 52px; height: 52px; color: var(--ink); background: transparent; border: 1px solid var(--ink); font-size: 1.5rem; font-weight: 800; }
.rep-entry label { position: relative; display: grid; }
.rep-entry input { height: 72px; padding: 4px 8px 22px; text-align: center; font-family: var(--font-display); font-size: 2.7rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.rep-entry label span { position: absolute; right: 0; bottom: 6px; left: 0; color: var(--muted); text-align: center; font-size: .66rem; text-transform: uppercase; }
.ladder-log { display: grid; gap: 12px; }
.ladder-total { display: flex; justify-content: center; align-items: baseline; gap: 6px; color: var(--muted); }
.ladder-total strong { color: var(--ink); font-size: 1.3rem; }
.multi-log { display: grid; gap: 0; }
.multi-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px 40px 48px; align-items: center; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.multi-row button { width: 48px; height: 48px; }
.multi-value { text-align: center; font-family: var(--font-display); font-size: 1.5rem; }
.circuit-log { display: grid; gap: 12px; text-align: center; }
.circuit-steps { display: flex; justify-content: center; gap: 4px; }
.circuit-steps span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--ink); font-size: .7rem; }
.circuit-steps span.current { color: var(--ink); border: 3px solid var(--orange); }
.effort-details { margin-top: 12px; }
.effort-details summary { display: flex; min-height: 48px; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.effort { display: grid; grid-template-columns: repeat(6, minmax(42px, 1fr)); gap: 4px; margin-top: 8px; }
.effort button { min-height: 48px; color: var(--ink); background: transparent; border: 1px solid var(--ink); font-weight: 800; }
.effort button.selected { color: var(--paper); background: var(--ink); border-bottom: 4px solid var(--orange); }
.session-controls { display: grid; gap: 6px; }
.session-controls .minor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); order: -1; gap: 6px; }
.session-controls .minor:has(> :only-child) { grid-template-columns: 1fr; }
.session-controls .minor button { width: 100%; border: 0; text-decoration: underline; text-underline-offset: 4px; }
.sticky-controls { position: sticky; z-index: 8; bottom: 0; padding: 8px 0 0; background: var(--paper); border-top: 2px solid var(--ink); }
.paused-control { border-style: double; }
.peak-button { border-color: var(--orange); }

/* Exercise guides, sheets, dialogs -------------------------------------- */
.sheet-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; align-items: end; justify-content: center; padding-top: 40px; background: var(--protocol-scrim); }
.sheet { width: min(760px, 100%); max-height: 92vh; overflow: auto; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); background: var(--card); border: 2px solid var(--ink); outline: 1px solid var(--paper); outline-offset: -6px; }
.sheet-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.sheet-head h2 { margin-bottom: 0; }
.sheet h3 { margin-top: 22px; }
.sheet ul, .sheet ol { padding-left: 22px; }
.guide-list { display: grid; gap: 24px; margin-top: 18px; }
.guide-article + .guide-article { padding-top: 24px; border-top: 2px solid var(--ink); }
.guide-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.guide-title span { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.guide-purpose { font-weight: 750; }
.guide-figure { margin: 12px 0 18px; border: 1px solid var(--ink); }
.guide-figure img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: var(--protocol-plate); }
.guide-figure figcaption { padding: 7px 10px; color: var(--muted); border-top: 1px solid var(--ink); font-size: .72rem; }
.guide-columns { display: grid; gap: 16px; }
.breathing { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; margin-top: 18px; padding: 12px 0; border-block: 1px solid var(--ink); }
.guide-prescription { margin: 16px 0 22px; padding: 12px 14px; border-left: 5px solid var(--orange); border-block: 1px solid var(--ink); }
.guide-prescription ul { margin-bottom: 0; }
.guide-browser { display: flex; flex-direction: column; }
.guide-browser-head { flex: 0 0 auto; }
#guide-swipe-zone { flex: 1 1 auto; min-height: 0; }
.guide-pager { position: sticky; z-index: 1; bottom: calc(-24px - env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; margin: 24px -16px calc(-24px - env(safe-area-inset-bottom)); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 2px solid var(--ink); }
.guide-pager button { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 6px; }
.guide-pager button:last-child { justify-self: stretch; }
.guide-pager > span { font-family: var(--font-display); letter-spacing: .06em; }
.exercise-list { display: grid; margin-top: 16px; border-top: 1px solid var(--ink); }
.exercise-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; min-height: 64px; align-items: center; padding: 8px 0; color: var(--ink); background: transparent; border-bottom: 1px solid var(--ink); text-align: left; }
.exercise-row .index { display: grid; width: 34px; height: 34px; place-items: center; color: var(--paper); background: var(--ink); font-family: var(--font-display); }
.exercise-row > span:nth-child(2) { display: grid; }
.exercise-row small { color: var(--muted); }
.watch-prompt .sheet { max-width: 440px; text-align: center; }
.watch-prompt-mark { display: grid; width: 64px; height: 64px; margin: 0 auto 16px; place-items: center; border: 2px solid var(--ink); }
.watch-waiting { margin: 18px 0; color: var(--muted); text-align: left; }
.watch-waiting .protocol-bar { width: 100%; }
@keyframes waiting { 50% { opacity: .25; } }
.settings-row { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ink); }
.settings-row small { display: block; color: var(--muted); font-weight: 400; }
.settings-control { cursor: default; }
.settings-control-input { display: flex; min-width: min(100%, 250px); align-items: center; justify-content: end; gap: 8px; }
.settings-control select { min-width: 0; height: 44px; padding: 0 34px 0 10px; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; font: inherit; font-weight: 700; }
.settings-control .icon-button { flex: 0 0 44px; }
.watch-device > span { display: grid; }
.watch-device small { color: var(--muted); }
.settings-danger { margin-top: 24px; padding-top: 4px; border-top: 2px solid var(--ink); }

/* Completion ------------------------------------------------------------- */
.complete { display: grid; width: min(760px, 100%); margin: auto; gap: 16px; padding: 36px 6px; text-align: center; }
.complete-mark { display: grid; width: 72px; height: 72px; margin-inline: auto; place-items: center; border: 2px solid var(--ink); }
.complete-mark .icon { width: 40px; height: 40px; }
.completion-cue { margin: 0; }
.protocol-results { text-align: left; }
.complete .exercise-list { text-align: left; }

/* Responsive layout ------------------------------------------------------ */
@media (min-width: 620px) {
  .shell { padding: calc(20px + env(safe-area-inset-top)) 24px calc(64px + env(safe-area-inset-bottom)); }
  .today-card { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .today-card .primary { grid-column: auto; margin-top: 0; }
  .focus-guidance { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .focus-cue { border-right: 0; border-bottom: 0; }
  .guide-columns { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .guide-browser-backdrop { align-items: center; padding-bottom: 40px; }
}

@media (max-width: 460px) {
  .settings-control { align-items: stretch; flex-direction: column; }
  .settings-control-input { width: 100%; }
  .settings-control select { flex: 1 1 auto; }
}

@media (min-width: 760px) {
  .week-calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .week-slot { display: block; min-height: 184px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
  .week-slot:nth-child(7n) { border-right: 0; }
  .slot-date { min-height: 50px; border-right: 0; border-bottom: 1px solid var(--line); }
  .schedule-card { min-height: 132px; grid-template-columns: 24px minmax(0, 1fr); padding: 12px 10px; }
  .schedule-card .schedule-visuals { --schedule-pictogram-size: 34px; display: grid; gap: 5px; }
  .schedule-card .schedule-exercise-visual { justify-content: flex-start; }
  .empty-day { min-height: 132px; }
  .mode-intro { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); }
  .protocol-number { position: absolute; z-index: -1; opacity: 0; }
  .mode-session-plan { border-top: 0; border-left: 2px solid var(--ink); }
  .preparation-card { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); align-items: stretch; }
  .prep-visual { border-right: 1px solid var(--ink); border-bottom: 0; }
  .prep-body { padding: 20px; }
}

@media (min-width:1000px) {
  .workout-shell { padding-inline: 18px; }
  .workout-runway { grid-template-columns: repeat(var(--exercise-count), minmax(82px, 174px)); justify-content: space-between; }
  .workout-runway .runway-step { width: 174px; max-width: 100%; }
  .live-state #swipe-zone:has(.compact-logging) { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; }
  .focus-target, .focus-timer { min-height: 205px; }
  .prep-gallery { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .prep-gallery img + img { border-top: 0; border-left: 1px solid var(--ink); }
}

@media (max-width: 619px) {
  .compact-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .compact-head > div:first-child:not(:only-child) { grid-column: 2; }
  .compact-head > .secondary { padding-inline: 10px; font-size: .75rem; }
  .progress-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-stats > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--ink); }
  .progress-stats > div:nth-child(4) { border-top: 1px solid var(--ink); }
  .month-day { min-height: 96px; }
  .month-day { padding: 3px; }
  .month-session > span:not(.schedule-visuals) { display: none; }
  .workout-shell { gap: 6px; }
  .workout-runway { grid-template-columns: repeat(var(--exercise-count), minmax(76px, 1fr)); min-width: calc(var(--exercise-count) * 76px); }
  .workout-runway[style*="--exercise-count:1"] { grid-template-columns: minmax(0, 132px); min-width: 0; }
  .workout-runway .runway-step { min-width: 76px; }
  .mode-button-label b { font-size: .78rem; }
  .mode-visual-button { grid-template-columns: minmax(92px, .6fr) minmax(150px, 1.4fr) 20px; min-height: 68px; }
  .focus-target strong, .focus-timer strong { font-size: clamp(3.6rem, 18vw, 5.5rem); }
  .session-controls .minor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .session-controls .minor button { padding-inline: 6px; font-size: .78rem; }
  .sheet-head { align-items: center; }
  .sheet-head .secondary { padding-inline: 10px; font-size: .76rem; }
}

@media (max-width: 390px) {
  .workout-title b { font-size: .86rem; }
  .workout-runway { grid-template-columns: repeat(var(--exercise-count), minmax(70px, 1fr)); min-width: calc(var(--exercise-count) * 70px); }
  .workout-runway[style*="--exercise-count:1"] { grid-template-columns: minmax(0, 124px); min-width: 0; }
  .workout-runway .runway-step { min-width: 70px; padding: 7px; }
  .runway-status { width: 21px; height: 21px; }
  .focus-core { min-height: 160px; }
  .focus-target, .focus-timer { min-height: 160px; padding: 12px; }
  .focus-target strong, .focus-timer strong { font-size: 3.7rem; }
  .mode-chip { gap: 5px; font-size: .9rem; }
  .mode-chip-label { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mode-chip > .icon:last-child { display: none; }
  .rep-entry { grid-template-columns: 48px minmax(112px, 1fr) 48px; }
  .rep-entry > button { width: 48px; }
}

@media (orientation: landscape) and (max-height: 540px) {
  .workout-shell { min-height: 100dvh; gap: 2px; padding: calc(4px + env(safe-area-inset-top)) 8px calc(4px + env(safe-area-inset-bottom)); }
  .workout-head { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; padding-bottom: 2px; }
  .workout-head .icon-button, .workout-head .watch-live { width: 44px; height: 44px; min-height: 44px; padding: 10px; }
  .workout-title { min-height: 44px; padding-inline: 8px; }
  .workout-runway .runway-step { height: 60px; max-height: 60px; aspect-ratio: auto; padding: 5px; }
  .workout-runway .runway-figure { width: 50px; height: 50px; }
  .workout-progress-bar { display: none; }
  #swipe-zone { padding-block: 2px 6px; }
  .focus-stage { margin: 2px; }
  .focus-top { min-height: 38px; padding: 3px 8px; }
  .focus-exercise { grid-template-columns: 40px minmax(0, 1fr); min-height: 44px; gap: 8px; padding: 2px 8px; }
  .focus-exercise > span { width: 40px; height: 40px; }
  .focus-core, .focus-target, .focus-timer { min-height: 86px; }
  .focus-target, .focus-timer { gap: 2px; padding: 6px 10px; }
  .focus-target strong, .focus-timer strong { font-size: 3rem; }
  .focus-guidance, .mode-timeline { display: none; }
  .session-controls, .session-controls .minor { gap: 2px; }
  .sticky-controls { padding-top: 4px; }
  .session-controls .minor button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .protocol-bar.is-indeterminate .is-travelling { transform: translateX(calc(15 * (100% + 2px))); }
}

@media (max-width: 540px) {
  .protocol-bar { --bar-active-travel-gap: var(--bar-travel-gap-mobile, var(--bar-travel-gap, 31px)); }
  .loading-protocol,
  .protocol-bar-track { gap: 1px; }
}
