:root {
  color-scheme: light;
  --canvas: #edf3f1;
  --canvas-deep: #e2ebe8;
  --paper: #fbfcfc;
  --ink: #172c33;
  --ink-soft: #3f565d;
  --muted: #697b80;
  --line: rgba(23, 44, 51, .16);
  --line-strong: rgba(23, 44, 51, .3);
  --motion: #087b6f;
  --motion-dark: #056159;
  --motion-soft: #d9ebe7;
  --blue: #356b93;
  --blue-soft: #deebf3;
  --amber: #94631d;
  --amber-soft: #f4ead7;
  --stop: #a33e46;
  --stop-dark: #7f2f36;
  --stop-soft: #f5e3e4;
  --focus: #075fbb;
  --r-sm: 7px;
  --r-md: 12px;
  --r-lg: 20px;
  --display: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  --body: Verdana, Geneva, sans-serif;
  font: 16px/1.5 var(--body);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
:root.large-text { font-size: 18px; }
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--canvas); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--motion-dark); }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.visually-hidden { position: fixed; width: 1px; height: 1px; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; }
.skip-link { position: fixed; z-index: 999; top: 12px; left: 12px; transform: translateY(-160%); padding: 12px 16px; border-radius: var(--r-sm); background: var(--ink); color: white; text-decoration: none; }
.skip-link:focus { transform: none; }

.app-shell { display: grid; grid-template-columns: 274px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 22px; height: 100vh; padding: 28px 20px 20px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 42px; height: 42px; flex: 0 0 42px; fill: none; stroke: var(--motion); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.brand > div { display: grid; gap: 1px; }
.brand span { font: 650 1.42rem/1 var(--display); letter-spacing: -.025em; }
.brand small { color: var(--muted); font-size: .62rem; }
.privacy-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-soft); font-size: .64rem; }
.privacy-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--motion); }
.nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-soft); cursor: pointer; text-align: left; transition: background-color 150ms cubic-bezier(.23,1,.32,1), transform 120ms cubic-bezier(.23,1,.32,1); }
.nav-item:hover { background: var(--canvas-deep); }
.nav-item:active { transform: scale(.98); }
.nav-item.is-active { background: var(--motion-soft); color: var(--motion-dark); font-weight: 700; }
.nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.builder-link { position: relative; display: grid; gap: 2px; min-height: 56px; padding: 12px 38px 12px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.builder-link span { font-size: .69rem; font-weight: 700; }
.builder-link small { color: var(--muted); font-size: .59rem; }
.builder-link b { position: absolute; right: 12px; top: 17px; color: var(--motion); }
.builder-link:hover { background: var(--canvas-deep); }
.urgent-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; margin-top: auto; padding: 12px; border: 1px solid rgba(163,62,70,.28); border-radius: var(--r-md); background: var(--stop-soft); color: var(--stop-dark); cursor: pointer; text-align: left; }
.urgent-button span { display: grid; gap: 2px; }
.urgent-button strong { font-size: .69rem; }
.urgent-button small { font-size: .59rem; }
.urgent-button b { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid currentColor; border-radius: 50%; font: 700 1rem/1 var(--display); }
.urgent-button:hover { background: #efd6d9; }
.sidebar-note { margin: -12px 2px 0; color: var(--muted); font-size: .59rem; line-height: 1.55; }

.main { min-width: 0; }
.view { width: min(1160px, 100%); margin: 0 auto; padding: 48px clamp(24px,5vw,72px) 72px; }
.view.is-visible { animation: enter 180ms cubic-bezier(.23,1,.32,1); }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mobile-header { display: none; }
.page-heading { max-width: 780px; margin-bottom: 36px; }
.page-heading.narrow { max-width: 700px; }
.page-heading.plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; max-width: none; }
#plan-owner { overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 8px; color: var(--motion-dark); font: 700 .68rem/1.3 var(--display); letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; color: var(--ink); font-family: var(--display); text-wrap: balance; }
h1 { margin-bottom: 12px; font-size: clamp(2.15rem,5vw,3.65rem); font-weight: 620; line-height: 1.02; letter-spacing: -.04em; }
h2 { margin-bottom: 12px; font-size: 1.42rem; font-weight: 630; line-height: 1.18; letter-spacing: -.02em; }
h3 { margin-bottom: 8px; font-size: 1rem; }
p { text-wrap: pretty; }
.page-heading > p:last-child, .page-heading > div > p:last-child { max-width: 700px; margin: 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.75; }
.state-panel, .empty-state { display: grid; justify-items: center; max-width: 540px; margin: 12vh auto 0; text-align: center; }
.state-panel h1 { margin-top: 20px; font-size: 2rem; }
.state-panel p, .empty-state p { color: var(--ink-soft); font-size: .75rem; }
.loader { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--motion); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.setup-panel { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-strong); background: var(--paper); }
.setup-panel > div { padding: 34px; }
.setup-main { border-right: 1px solid var(--line); }
.step-number { display: block; margin-bottom: 42px; color: var(--motion); font: 700 .7rem/1 var(--display); letter-spacing: .1em; }
.setup-panel p { max-width: 540px; color: var(--ink-soft); font-size: .72rem; line-height: 1.7; }
.setup-main .primary-button { margin-top: 24px; }
.setup-main .text-button { margin-top: 8px; }
.setup-limits ul { margin: 24px 0 0; padding: 0; list-style: none; }
.setup-limits li { padding: 12px 0 12px 26px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .68rem; line-height: 1.5; }
.setup-limits li::before { content: "✓"; margin-left: -26px; margin-right: 12px; color: var(--motion); font-weight: 700; }

.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: -12px 0 28px; padding: 12px 16px; border: 1px solid rgba(8,123,111,.25); background: var(--motion-soft); }
.demo-banner > div { display: grid; gap: 2px; }
.demo-banner strong { font-size: .69rem; }
.demo-banner span { color: var(--ink-soft); font-size: .61rem; }
.integrity-badge { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 999px; }
.integrity-badge svg { width: 20px; height: 20px; fill: none; stroke: var(--motion); stroke-width: 1.8; }
.integrity-badge span { display: grid; gap: 1px; }
.integrity-badge strong { font-size: .62rem; }
.integrity-badge small { color: var(--muted); font-size: .54rem; }
.plan-status { margin-bottom: 28px; padding: 14px 16px; border-left: 4px solid var(--motion); background: var(--motion-soft); font-size: .69rem; line-height: 1.6; }
.plan-status.warning { border-color: var(--amber); background: var(--amber-soft); color: #62400f; }
.plan-status.stop { border-color: var(--stop); background: var(--stop-soft); color: var(--stop-dark); }
.plan-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-strong); background: var(--paper); }
.next-session, .plan-contact { padding: 30px; }
.next-session { border-right: 1px solid var(--line); }
.next-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.next-top > span { padding: 5px 9px; border-radius: 999px; background: var(--blue-soft); color: #244c68; font-size: .58rem; font-weight: 700; }
.next-session > p:not(.eyebrow,.microcopy) { max-width: 600px; color: var(--ink-soft); font-size: .73rem; line-height: 1.7; }
.session-meta { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 26px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.session-meta span { display: flex; align-items: baseline; gap: 5px; color: var(--muted); font-size: .6rem; }
.session-meta b { color: var(--ink); font: 700 1rem/1 var(--display); font-variant-numeric: tabular-nums; }
.microcopy { margin: 10px 0 0; color: var(--muted); font-size: .59rem; line-height: 1.5; }
.plan-contact dl { margin: 18px 0 24px; }
.plan-contact dl div { display: grid; grid-template-columns: 86px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.plan-contact dt { color: var(--muted); font-size: .54rem; text-transform: uppercase; letter-spacing: .06em; }
.plan-contact dd { margin: 0; font-size: .63rem; line-height: 1.45; }
.plan-contact .secondary-button { width: 100%; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > span { color: var(--muted); font-size: .58rem; }
.exercise-list-section { margin-top: 42px; }
.exercise-list { border-top: 1px solid var(--line-strong); }
.exercise-row { display: grid; grid-template-columns: 48px minmax(0,1fr) minmax(160px,.45fr); gap: 20px; align-items: center; min-height: 104px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.exercise-order { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--motion-dark); font: 700 .72rem/1 var(--display); }
.exercise-copy { display: grid; gap: 4px; }
.exercise-copy strong { font: 650 .88rem/1.3 var(--display); }
.exercise-copy span { color: var(--ink-soft); font-size: .64rem; line-height: 1.5; }
.exercise-copy small { color: var(--muted); font-size: .57rem; }
.exercise-video-tag { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .6rem; }
.exercise-video-tag i { width: 32px; height: 22px; border: 1px solid var(--line-strong); background: var(--canvas-deep); }
.reminder-strip { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-top: 38px; padding: 24px 28px; background: var(--ink); color: white; }
.reminder-strip .eyebrow { color: #8ed2ca; }
.reminder-strip h2 { color: white; }
.reminder-strip p:last-child { max-width: 650px; margin-bottom: 0; color: #cfdbde; font-size: .66rem; }
.reminder-strip .secondary-button { flex: 0 0 auto; border-color: white; background: white; }

.metric-band { display: grid; grid-template-columns: minmax(220px,.75fr) minmax(0,1.25fr); gap: 42px; align-items: end; padding: 0 0 32px; border-bottom: 1px solid var(--line-strong); }
.metric-lead { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 12px; }
.metric-lead span { grid-column: 1/-1; color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .07em; }
.metric-lead strong { font: 620 3.8rem/.95 var(--display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.metric-lead small { max-width: 120px; color: var(--muted); font-size: .58rem; line-height: 1.4; }
.metric-band dl { display: grid; grid-template-columns: repeat(4,1fr); margin: 0; }
.metric-band dl div { padding: 0 18px; border-left: 1px solid var(--line); }
.metric-band dt { color: var(--muted); font-size: .57rem; text-transform: uppercase; letter-spacing: .05em; }
.metric-band dd { margin: 6px 0 0; font: 650 1.8rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pain-chart { margin: 38px 0 46px; padding: 26px; border: 1px solid var(--line); background: var(--paper); }
.legend { display: flex; gap: 16px; color: var(--ink-soft); font-size: .59rem; }
.legend span::before { content: ""; display: inline-block; width: 18px; margin-right: 6px; border-top: 2px solid; vertical-align: middle; }
.legend .before::before { border-color: var(--blue); }
.legend .after::before { border-color: var(--motion); border-top-style: dashed; }
#pain-chart { min-height: 250px; overflow-x: auto; }
#pain-chart svg { width: 100%; min-width: 540px; height: 250px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--muted); font: 9px var(--body); }
.chart-path { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chart-path.before { stroke: var(--blue); }
.chart-path.after { stroke: var(--motion); stroke-dasharray: 7 4; }
.chart-dot.before { fill: var(--blue); }
.chart-dot.after { fill: var(--motion); }
.pain-chart figcaption { color: var(--muted); font-size: .58rem; line-height: 1.55; }
.session-history { border-top: 1px solid var(--line-strong); }
.history-row { display: grid; grid-template-columns: 130px minmax(0,1fr) auto; gap: 20px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.history-date { display: grid; gap: 2px; }
.history-date strong { font: 650 .78rem/1.3 var(--display); }
.history-date time { color: var(--muted); font-size: .56rem; }
.history-details { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-soft); font-size: .62rem; }
.history-status { padding: 6px 9px; border-radius: 999px; background: var(--motion-soft); color: var(--motion-dark); font-size: .55rem; font-weight: 700; }
.history-status.partial { background: var(--amber-soft); color: #6a4614; }
.history-status.stopped { background: var(--stop-soft); color: var(--stop-dark); }

.data-grid { display: grid; grid-template-columns: repeat(2,1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-strong); background: var(--paper); }
.data-grid section { min-height: 270px; padding: 30px; }
.data-grid section:nth-child(odd) { border-right: 1px solid var(--line); }
.data-grid section:nth-child(n+3) { border-top: 1px solid var(--line); }
.data-grid p:not(.eyebrow) { color: var(--ink-soft); font-size: .68rem; line-height: 1.65; }
.button-stack { display: grid; justify-items: start; gap: 10px; margin-top: 22px; }
.button-stack input { position: fixed; width: 1px; height: 1px; clip-path: inset(50%); }
.sensitive-note { padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); }
.settings-band { display: grid; grid-template-columns: repeat(2,1fr); border-bottom: 1px solid var(--line-strong); }
.settings-band > label, .settings-band > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 86px; padding: 20px 30px; }
.settings-band > label { border-right: 1px solid var(--line); cursor: pointer; }
.settings-band span { display: grid; gap: 3px; }
.settings-band strong { font-size: .7rem; }
.settings-band small { color: var(--muted); font-size: .58rem; }
.settings-band input { position: relative; width: 48px; height: 28px; appearance: none; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--canvas-deep); cursor: pointer; }
.settings-band input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform 150ms cubic-bezier(.23,1,.32,1); }
.settings-band input:checked { border-color: var(--motion); background: var(--motion-soft); }
.settings-band input:checked::after { transform: translateX(20px); background: var(--motion); }
.diagnostics { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(280px,.9fr); gap: 30px; margin-top: 36px; padding: 28px; border: 1px solid var(--line); background: var(--paper); }
.diagnostics > div:first-child p:last-child { margin: 0; color: var(--ink-soft); font-size: .67rem; }
.diagnostics dl { margin: 0; }
.diagnostics dl div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.diagnostics dt { color: var(--muted); font-size: .55rem; text-transform: uppercase; }
.diagnostics dd { margin: 0; font-size: .62rem; }
.diagnostic-actions { grid-column: 1/-1; display: flex; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 32px; padding: 28px; background: var(--stop-soft); }
.danger-zone p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: .65rem; }

.stop-card { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 34px; background: var(--ink); color: white; }
.stop-card > div:first-child { max-width: 720px; }
.stop-card > div:first-child > span { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 22px; border: 3px solid #ffabb0; border-radius: 50%; color: #ffabb0; font: 700 .75rem/1 var(--display); }
.stop-card h2 { color: white; font-size: 1.8rem; }
.stop-card p { color: #d2dde0; font-size: .7rem; line-height: 1.7; }
.stop-actions { display: grid; gap: 10px; flex: 0 0 230px; }
.emergency-link { display: grid; place-items: center; min-height: 48px; border: 1px solid #ffabb0; border-radius: var(--r-sm); color: white; text-decoration: none; font-size: .7rem; font-weight: 700; }
.limits-grid { display: grid; grid-template-columns: repeat(2,1fr); margin-top: 36px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.limits-grid section { padding: 26px; }
.limits-grid section:nth-child(odd) { border-right: 1px solid var(--line); }
.limits-grid section:nth-child(n+3) { border-top: 1px solid var(--line); }
.limits-grid span { display: block; margin-bottom: 20px; color: var(--motion); font: 700 .62rem/1 var(--display); }
.limits-grid p { color: var(--ink-soft); font-size: .66rem; line-height: 1.65; }
.help-facts { margin-top: 36px; padding: 30px; border: 1px solid var(--line); background: var(--paper); }
.help-facts dl { margin: 20px 0 0; }
.help-facts dl div { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.help-facts dt { color: var(--muted); font-size: .57rem; text-transform: uppercase; }
.help-facts dd { margin: 0; font-size: .64rem; }
.version-line { margin-top: 28px; color: var(--muted); font-size: .56rem; text-align: center; }

.primary-button, .secondary-button, .light-button, .danger-button, .file-button, .text-button, .quiet-button { min-height: 44px; border-radius: var(--r-sm); cursor: pointer; font-weight: 700; transition: background-color 140ms cubic-bezier(.23,1,.32,1), transform 110ms cubic-bezier(.23,1,.32,1); }
.primary-button:active, .secondary-button:active, .light-button:active, .danger-button:active, .file-button:active, .text-button:active, .quiet-button:active { transform: scale(.98); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 11px 16px; border: 1px solid var(--motion); background: var(--motion); color: white; text-decoration: none; }
.primary-button:hover { border-color: var(--motion-dark); background: var(--motion-dark); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; }
.primary-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.secondary-button, .light-button, .file-button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 15px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); text-decoration: none; }
.secondary-button:hover, .file-button:hover { border-color: var(--motion); background: var(--motion-soft); }
.light-button { border-color: white; }
.danger-button { padding: 10px 15px; border: 1px solid var(--stop); background: var(--stop); color: white; }
.danger-button:hover { background: var(--stop-dark); }
.text-button, .quiet-button { padding: 8px 12px; border: 0; background: transparent; color: var(--motion-dark); }
.text-button:hover, .quiet-button:hover { background: rgba(8,123,111,.08); }
.quiet-button { min-height: 36px; color: var(--ink-soft); font-size: .62rem; }
.danger-text { min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--stop-dark); cursor: pointer; font-size: .68rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.modal { width: min(600px,calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--paper); color: var(--ink); }
.modal::backdrop { background: rgba(10,28,34,.72); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in 180ms cubic-bezier(.23,1,.32,1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-body { position: relative; padding: clamp(24px,5vw,42px); }
.modal h1 { font-size: clamp(2rem,7vw,3rem); }
.modal p { color: var(--ink-soft); font-size: .7rem; line-height: 1.65; }
.modal-close { position: absolute; z-index: 2; top: 16px; right: 16px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--canvas-deep); cursor: pointer; font-size: 1.4rem; }
.welcome-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 28px; border-radius: 50%; background: var(--motion-soft); }
.welcome-mark svg { width: 34px; height: 34px; fill: none; stroke: var(--motion); stroke-width: 2.5; stroke-linecap: round; }
.consent-list { display: grid; gap: 10px; margin: 24px 0; }
.consent-list label, .session-checks label { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); background: var(--canvas); cursor: pointer; }
.consent-list input, .session-checks input { width: 20px; height: 20px; margin: 0; accent-color: var(--motion); }
.consent-list span { display: grid; gap: 2px; }
.consent-list strong { font-size: .67rem; }
.consent-list small { color: var(--muted); font-size: .57rem; line-height: 1.45; }
.welcome-modal .primary-button { width: 100%; }
.welcome-urgent { display: block; min-height: 44px; margin: 8px auto 0; border: 0; background: transparent; color: var(--stop-dark); cursor: pointer; font-size: .64rem; font-weight: 700; text-decoration: underline; }

.session-modal { width: min(880px,calc(100vw - 24px)); }
.session-shell { position: relative; padding: clamp(20px,4vw,36px); }
.session-shell > header { display: flex; justify-content: space-between; gap: 20px; padding-right: 56px; }
.session-shell > header h1 { margin-bottom: 20px; font-size: clamp(1.8rem,5vw,2.7rem); }
.session-progress { height: 4px; margin: 0 -36px 28px; background: var(--canvas-deep); }
.session-progress i { display: block; width: 12%; height: 100%; background: var(--motion); transition: transform 180ms cubic-bezier(.23,1,.32,1), width 180ms cubic-bezier(.23,1,.32,1); }
.session-progress .progress-consent { width: 12%; }
.session-progress .progress-precheck { width: 28%; }
.session-progress .progress-exercise { width: 58%; }
.session-progress .progress-postcheck { width: 84%; }
.session-progress .progress-blocked, .session-progress .progress-complete { width: 100%; }
.session-shell section > p { max-width: 680px; }
.session-checks { display: grid; gap: 10px; margin: 24px 0; }
.session-checks label { align-items: start; }
.session-checks span { font-size: .67rem; line-height: 1.5; }
.session-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.session-actions.stacked { display: grid; justify-content: stretch; max-width: 420px; }
.pain-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 24px; margin: 22px 0; padding: 22px; border: 1px solid var(--line); background: var(--canvas); }
.pain-field label { display: grid; gap: 3px; }
.pain-field label strong { font: 650 .88rem/1.3 var(--display); }
.pain-field label span { color: var(--muted); font-size: .58rem; }
.pain-field output { color: var(--motion-dark); font: 700 .82rem/1.4 var(--display); }
.pain-field input { grid-column: 1/-1; width: 100%; height: 34px; accent-color: var(--motion); cursor: pointer; }
.pain-field > div { grid-column: 1/-1; display: flex; justify-content: space-between; color: var(--muted); font-size: .55rem; }
.alarm-field { margin: 22px 0; padding: 18px; border: 1px solid var(--line-strong); }
.alarm-field legend { max-width: 680px; padding: 0 6px; font: 650 .76rem/1.5 var(--display); }
.alarm-field label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: 18px; font-size: .66rem; }
.alarm-field input { width: 18px; height: 18px; accent-color: var(--motion); }
.rule-note { padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--amber-soft); }
.blocked-mark, .result-mark { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 24px; border: 3px solid var(--stop); border-radius: 50%; color: var(--stop); font: 700 1.5rem/1 var(--display); }
.blocked-instruction, .result-escalation { margin: 20px 0; padding: 16px; border-left: 4px solid var(--stop); background: var(--stop-soft); color: var(--stop-dark); font-size: .68rem; line-height: 1.6; }
.result-mark { border-color: var(--motion); color: var(--motion); }
.result-mark.is-stop { border-color: var(--stop); color: var(--stop); }
.exercise-session-head { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .6rem; }
.video-frame { position: relative; margin: 20px 0; border: 1px solid var(--line-strong); background: #0d1d22; aspect-ratio: 16/9; }
.video-frame video { width: 100%; height: 100%; object-fit: contain; }
.video-error { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 28px; background: var(--ink); color: white; text-align: center; }
.video-error span { max-width: 480px; color: #cfdbde; font-size: .65rem; line-height: 1.6; }
.instruction-list { margin: 18px 0; padding-left: 1.6em; color: var(--ink-soft); font-size: .7rem; line-height: 1.65; }
.instruction-list li + li { margin-top: 6px; }
.exercise-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.8fr); gap: 10px; }
.exercise-actions .danger-text { grid-column: 1/-1; justify-self: start; }
.skip-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--line); background: var(--canvas); }
.skip-panel label { display: block; margin-bottom: 7px; font-size: .63rem; font-weight: 700; }
.skip-panel select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); }
.skip-panel > div { display: flex; gap: 8px; margin-top: 10px; }
.urgent-options { display: grid; gap: 10px; margin: 24px 0; }
.urgent-options a { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 72px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--canvas); color: var(--ink); text-decoration: none; }
.urgent-options a.emergency { border-color: rgba(163,62,70,.32); background: var(--stop-soft); }
.urgent-options span { display: grid; gap: 2px; }
.urgent-options strong { font-size: .68rem; }
.urgent-options small { color: var(--muted); font-size: .57rem; }
.urgent-options b { color: var(--stop-dark); font: 700 1.4rem/1 var(--display); }
.full { width: 100%; }
.confirm-modal { width: min(470px,calc(100vw - 32px)); }
.confirm-modal h1 { font-size: 1.8rem; }
.confirm-modal label { display: grid; gap: 8px; margin-top: 20px; font-size: .66rem; }
.confirm-modal input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.toast { position: fixed; z-index: 999; right: 24px; bottom: 24px; max-width: min(430px,calc(100vw - 32px)); padding: 14px 18px; border-radius: var(--r-sm); background: var(--ink); color: white; font-size: .66rem; line-height: 1.5; }
.toast.error { background: var(--stop-dark); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 226px minmax(0,1fr); }
  .sidebar { padding-inline: 16px; }
  .plan-layout { grid-template-columns: 1fr; }
  .next-session { border-right: 0; border-bottom: 1px solid var(--line); }
  .plan-contact dl { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 18px; }
  .metric-band { grid-template-columns: 1fr; }
  .stop-card { display: grid; }
  .stop-actions { grid-template-columns: repeat(2,1fr); flex-basis: auto; }
}
@media (max-width: 760px) {
  body { padding-bottom: 74px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 50; inset: auto 0 0; display: block; width: 100%; height: 74px; padding: 0; border-top: 1px solid var(--line-strong); border-right: 0; background: rgba(237,243,241,.96); backdrop-filter: blur(12px); }
  .sidebar > :not(.nav) { display: none; }
  .nav { grid-template-columns: repeat(4,1fr); height: 100%; gap: 0; }
  .nav-item { flex-direction: column; justify-content: center; gap: 4px; min-height: 74px; padding: 5px; border-radius: 0; text-align: center; }
  .nav-item.is-active { background: transparent; box-shadow: inset 0 3px 0 var(--motion); }
  .nav-item span { font-size: .56rem; }
  .nav-item svg { width: 22px; height: 22px; }
  .mobile-header { position: sticky; z-index: 40; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: rgba(237,243,241,.96); backdrop-filter: blur(12px); }
  .brand.compact { gap: 8px; }
  .brand.compact svg { width: 32px; height: 32px; flex-basis: 32px; }
  .brand.compact span { font-size: 1.1rem; }
  .mobile-header > button { min-height: 42px; padding: 8px 10px; border: 1px solid rgba(163,62,70,.25); border-radius: var(--r-sm); background: var(--stop-soft); color: var(--stop-dark); font-size: .58rem; font-weight: 700; }
  .view { padding: 32px 16px 52px; }
  .page-heading.plan-heading { display: grid; }
  .integrity-badge { justify-self: start; }
  .setup-panel, .data-grid { grid-template-columns: 1fr; margin-inline: -16px; }
  .setup-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .setup-panel > div, .data-grid section { padding: 24px 16px; }
  .data-grid section:nth-child(odd) { border-right: 0; }
  .data-grid section + section { border-top: 1px solid var(--line); }
  .plan-layout { margin-inline: -16px; }
  .next-session, .plan-contact { padding: 24px 16px; }
  .plan-contact dl { grid-template-columns: 1fr; }
  .exercise-row { grid-template-columns: 42px minmax(0,1fr); }
  .exercise-video-tag { grid-column: 2; justify-self: start; }
  .reminder-strip { display: grid; margin-inline: -16px; padding: 24px 16px; }
  .reminder-strip .secondary-button { justify-self: start; }
  .metric-band dl { grid-template-columns: repeat(2,1fr); gap: 18px 0; }
  .pain-chart { margin-inline: -16px; padding: 22px 16px; border-inline: 0; }
  .section-heading { align-items: flex-start; }
  .history-row { grid-template-columns: 1fr auto; }
  .history-details { grid-column: 1/-1; }
  .settings-band { grid-template-columns: 1fr; margin-inline: -16px; }
  .settings-band > label, .settings-band > div { padding-inline: 16px; }
  .settings-band > label { border-right: 0; border-bottom: 1px solid var(--line); }
  .diagnostics { grid-template-columns: 1fr; margin-inline: -16px; padding: 24px 16px; }
  .diagnostic-actions { grid-column: auto; }
  .danger-zone { display: grid; margin-inline: -16px; padding: 24px 16px; }
  .danger-zone .danger-button { justify-self: start; }
  .stop-card { margin-inline: -16px; padding: 26px 16px; }
  .stop-actions { grid-template-columns: 1fr; }
  .limits-grid { grid-template-columns: 1fr; margin-inline: -16px; }
  .limits-grid section { padding: 24px 16px; }
  .limits-grid section + section { border-top: 1px solid var(--line); }
  .limits-grid section:nth-child(odd) { border-right: 0; }
  .help-facts { margin-inline: -16px; padding: 24px 16px; }
  .help-facts dl div { grid-template-columns: 1fr; gap: 5px; }
  .session-shell { padding: 22px 16px; }
  .session-progress { margin-inline: -16px; }
  .exercise-actions { grid-template-columns: 1fr; }
  .exercise-actions .danger-text { grid-column: auto; }
  .toast { right: 16px; bottom: 88px; left: 16px; }
}
@media (max-width: 480px) {
  :root.large-text { font-size: 17px; }
  .demo-banner { display: grid; }
  .metric-band dl { grid-template-columns: repeat(2,1fr); }
  .section-heading { display: grid; }
  .session-actions { display: grid; grid-template-columns: 1fr; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (prefers-contrast: more) { :root { --line: rgba(23,44,51,.35); --line-strong: rgba(23,44,51,.7); } .plan-status,.rule-note,.blocked-instruction { border: 2px solid currentColor; } }
@media print {
  .sidebar,.mobile-header,.page-heading,.data-grid,.settings-band,.diagnostics,.danger-zone,.nav,.toast { display: none !important; }
  body { padding: 0; background: white; }
  .app-shell { display: block; }
  .view { width: 100%; padding: 0; }
  .view:not([data-panel="progress"]) { display: none !important; }
  #view-progress { display: block !important; }
  .pain-chart { break-inside: avoid; }
}
