:root {
  color-scheme: light;
  --background: #eef2eb;
  --surface: #fbfcf8;
  --surface-strong: #ffffff;
  --surface-soft: #edf4ee;
  --ink: #17261f;
  --muted: #607168;
  --line: #dce5dc;
  --primary: #34765c;
  --primary-hover: #285f49;
  --primary-soft: #dfece3;
  --on-primary: #ffffff;
  --warning: #a65f24;
  --danger: #a23d35;
  --focus: #0b755b;
  --shadow: 0 24px 70px rgba(32, 57, 44, .13);
  --font-body: "Raleway", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Lora", Georgia, serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; min-height: 100dvh; padding: 20px; color: var(--ink); background: radial-gradient(circle at 15% 0, #f7f7ef 0, transparent 34%), var(--background); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
body.has-report, body.has-safety-check, body.has-account, body.has-library { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 42%, transparent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.skip-link { position: fixed; top: -80px; left: 16px; z-index: 1000; padding: 10px 16px; border-radius: 10px; color: #fff; background: var(--ink); }
.skip-link:focus { top: 16px; }
.app-shell { width: min(1320px, 100%); min-height: calc(100dvh - 40px); margin: 0 auto; overflow: hidden; border: 1px solid rgba(42, 75, 59, .13); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.app-shell:has(.coach-stage.is-training) { overflow: clip; }

.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .18em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--primary); }
.brand-mark svg { width: 25px; height: 25px; }
.session-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.session-dot, .camera-status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #92a098; }
.session-state.is-live .session-dot, .camera-card.is-live .camera-status-dot { background: #48a976; box-shadow: 0 0 0 5px rgba(72, 169, 118, .13); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.language-picker { position: relative; }
.language-picker select { height: 38px; padding: 0 28px 0 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface-strong); font-size: 12px; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
.language-picker select:hover { border-color: #b6c8ba; background: var(--surface-soft); }
.icon-button, .profile-button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface-strong); transition: border-color .2s ease, background .2s ease; }
.icon-button:hover, .profile-button:hover { border-color: #b6c8ba; background: var(--surface-soft); }
.icon-button svg { width: 21px; height: 21px; }
.icon-button .sound-off { display: none; }
.icon-button[aria-pressed="false"] .sound-on { display: none; }
.icon-button[aria-pressed="false"] .sound-off { display: block; }
.profile-button { border: 0; color: #285844; background: #dceade; font-weight: 700; }
.profile-button.has-access { color: white; background: var(--primary); box-shadow: 0 0 0 4px rgba(52,118,92,.12); }

.practice-layout { min-height: calc(100dvh - 114px); display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(380px, .74fr); }
.coach-stage { position: relative; min-width: 0; min-height: 760px; overflow: hidden; background: radial-gradient(circle at 52% 42%, rgba(244, 249, 241, .96) 0, rgba(222, 237, 224, .88) 37%, rgba(196, 218, 204, .62) 70%, rgba(181, 206, 191,.45) 100%); }
.coach-stage::after { position: absolute; left: 7%; right: 7%; bottom: 57px; z-index: 0; height: 1px; content: ""; background: linear-gradient(90deg, transparent, rgba(54, 97, 75, .28), transparent); }
.stage-glow { position: absolute; left: 50%; top: 50%; width: min(52vw, 610px); aspect-ratio: 1; transform: translate(-50%, -52%); border: 1px solid rgba(255,255,255,.7); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.10), 0 0 0 145px rgba(255,255,255,.07); }
#trainer-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
.coach-stage.is-training {
  position: sticky;
  top: 12px;
  align-self: start;
  min-height: 0;
  height: clamp(370px, calc(100dvh - 115px), 780px);
}
.coach-stage.is-training #trainer-canvas { height: calc(100% - 128px); }
.trainer-id, .current-pose, .camera-card, .coach-cue, .welcome-layer { position: absolute; z-index: 3; }
.trainer-id { top: 24px; left: 24px; display: flex; align-items: center; gap: 10px; padding: 8px 13px 8px 8px; border: 1px solid rgba(255,255,255,.75); border-radius: 16px; color: #203f31; background: rgba(255,255,255,.73); backdrop-filter: blur(12px); }
.trainer-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(145deg, #4c856d, #265942); font-size: 13px; font-weight: 700; }
.trainer-id strong, .trainer-id small { display: block; }
.trainer-id strong { font-size: 13px; }
.trainer-id small { color: #5b7165; font-size: 11px; }
.current-pose { top: 27px; right: 25px; color: #234c3a; text-align: right; }
.current-pose span, .current-pose strong { display: block; }
.current-pose span { opacity: .68; font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.current-pose strong { margin-top: 4px; font: 600 19px/1.2 var(--font-display); }

.camera-card { left: 24px; bottom: 93px; width: 164px; overflow: hidden; border: 1px solid rgba(255,255,255,.75); border-radius: 16px; color: #294d3c; background: rgba(255,255,255,.8); box-shadow: 0 10px 28px rgba(30,64,47,.12); backdrop-filter: blur(12px); transition: opacity .2s ease, transform .2s ease; }
.camera-viewport { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: rgba(44,83,63,.08); }
#camera-video, #pose-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
#pose-overlay { z-index: 2; }
.camera-placeholder { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 8px; color: #61766b; font-size: 11px; }
.camera-placeholder svg { width: 28px; height: 28px; }
.camera-card.is-live .camera-placeholder { display: none; }
.camera-caption { min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 10px; }

.coach-cue { left: 50%; bottom: 22px; width: min(58%, 520px); min-height: 58px; display: flex; align-items: center; gap: 15px; padding: 11px 18px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.16); border-radius: 17px; color: #f8fcf9; background: rgba(25,55,43,.93); box-shadow: 0 16px 38px rgba(24,56,42,.23); backdrop-filter: blur(15px); }
.coach-cue p { margin: 0; font-size: 13px; line-height: 1.45; }
.voice-wave { height: 28px; display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.voice-wave i { width: 2px; height: 8px; border-radius: 3px; background: #aaddbd; opacity: .58; animation: voice-wave 1.05s ease-in-out infinite paused; }
.voice-wave i:nth-child(2) { animation-delay: -.82s; }
.voice-wave i:nth-child(3) { animation-delay: -.58s; }
.voice-wave i:nth-child(4) { animation-delay: -.25s; }
.voice-wave i:nth-child(5) { animation-delay: -.68s; }
.coach-cue.is-speaking .voice-wave i { opacity: 1; animation-play-state: running; }

.welcome-layer { inset: 0; z-index: 5; display: grid; align-items: start; padding: 96px 7% 78px; background: linear-gradient(90deg, rgba(222,237,224,.98) 0, rgba(222,237,224,.92) 35%, rgba(222,237,224,.48) 48%, rgba(222,237,224,.08) 68%, transparent 100%); transition: opacity .32s ease, visibility .32s ease; }
.welcome-layer.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.welcome-card { width: min(470px, 60%); color: #19382b; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.welcome-card h1 { margin: 0; font: 600 clamp(42px, 5.2vw, 68px)/1.03 var(--font-display); letter-spacing: -.035em; }
.welcome-card > p:not(.eyebrow) { max-width: 390px; margin: 20px 0 0; color: #4c675a; font-size: 16px; line-height: 1.6; }
.coach-picker { max-width: 440px; margin-top: 18px; }
.coach-picker > p { margin: 0 0 8px; color: #486457; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.coach-options { display: grid; grid-template-columns: repeat(3, minmax(86px, 1fr)); gap: 8px; }
.coach-option { position: relative; min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 7px 4px 6px; border: 1px solid rgba(54, 100, 76, .2); border-radius: 14px; color: #416354; background: rgba(255,255,255,.58); box-shadow: 0 5px 16px rgba(40,78,59,.04); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.coach-option:hover { border-color: rgba(52,118,92,.48); background: rgba(255,255,255,.82); transform: translateY(-1px); }
.coach-option svg { width: 27px; height: 27px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.coach-option span { max-width: 100%; overflow: hidden; font-size: 10px; font-weight: 700; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.coach-option[aria-pressed="true"] { border-color: var(--primary); color: #245842; background: rgba(250,255,250,.96); box-shadow: 0 0 0 2px rgba(52,118,92,.13), 0 8px 20px rgba(40,78,59,.1); }
.coach-option[aria-pressed="true"]::after { position: absolute; top: 5px; right: 6px; width: 14px; height: 14px; display: grid; place-items: center; content: "✓"; border-radius: 50%; color: white; background: var(--primary); font: 700 9px/1 var(--font-body); }
.model-credit { margin: 8px 2px 0 !important; color: #6a7c72 !important; font-size: 8px !important; line-height: 1.4 !important; }
.model-credit a { color: #426655; text-underline-offset: 2px; }
.primary-button { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; margin-top: 28px; padding: 0 22px; border: 0; border-radius: 14px; color: var(--on-primary); background: var(--primary); box-shadow: 0 12px 25px rgba(52,118,92,.25); font-weight: 700; transition: background .2s ease, transform .2s ease; }
.coach-picker + .primary-button { margin-top: 20px; }
.primary-button:hover { background: var(--primary-hover); transform: translateY(-1px); }
.primary-button svg { width: 20px; height: 20px; }
.welcome-card > small { max-width: 340px; display: flex; align-items: center; gap: 8px; margin-top: 17px; color: #5e7468; font-size: 11px; }
.welcome-card > small svg { width: 16px; height: 16px; flex: 0 0 auto; }

.calibration-layer { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: flex-end; padding: 92px 6% 92px 48%; background: linear-gradient(90deg, rgba(218,234,222,.48) 0, rgba(218,234,222,.78) 44%, rgba(235,243,235,.98) 73%, rgba(235,243,235,.99) 100%); transition: opacity .25s ease, visibility .25s ease; }
.calibration-layer.is-hidden, .calibration-action.is-hidden { display: none; }
.calibration-card { width: min(360px, 100%); padding: 24px; border: 1px solid rgba(255,255,255,.8); border-radius: 22px; color: #1d4030; background: rgba(255,255,255,.88); box-shadow: 0 20px 50px rgba(31,71,51,.16); backdrop-filter: blur(16px); }
.calibration-kicker { display: flex; align-items: center; justify-content: space-between; color: #537064; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.calibration-kicker strong { color: var(--primary); }
.calibration-figure { position: relative; width: 88px; height: 108px; display: grid; place-items: center; margin: 12px auto 15px; overflow: hidden; color: #4f846c; }
.calibration-figure svg { width: 76px; height: 108px; }
.calibration-scan { position: absolute; left: 8px; right: 8px; top: 12px; height: 2px; border-radius: 2px; background: #55a27f; box-shadow: 0 0 12px rgba(85,162,127,.8); animation: calibration-scan 2s ease-in-out infinite; }
.calibration-card .eyebrow { margin-bottom: 7px; text-align: center; }
.calibration-card h2 { margin: 0; font: 600 25px/1.22 var(--font-display); text-align: center; text-wrap: balance; }
.calibration-card > p:not(.eyebrow) { margin: 9px 0 0; color: #60756b; font-size: 13px; line-height: 1.55; text-align: center; }
.calibration-progress { height: 6px; overflow: hidden; margin-top: 18px; border-radius: 999px; background: #dfe8e0; }
.calibration-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #7bb596); transition: width .18s ease; }
.preflight-checks { display: grid; gap: 5px; margin: 13px 0 0; padding: 0; list-style: none; }
.preflight-checks li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 25px; padding: 0 8px; border-radius: 8px; color: #62766c; background: rgba(229,238,231,.62); font-size: 10px; }
.preflight-checks strong { color: #6e7f76; font-size: 9px; }
.preflight-checks li[data-state="ready"]::before { content: "✓"; color: var(--primary); font-weight: 800; }
.preflight-checks li[data-state="unavailable"]::before { content: "!"; color: #9b695f; font-weight: 800; }
.preflight-checks li::before { width: 10px; content: "·"; color: #789086; text-align: center; }
.preflight-checks li > span { margin-right: auto; }
.preflight-checks li[data-state="ready"] strong { color: var(--primary); }
.preflight-checks li[data-state="unavailable"] strong { color: #8c5c53; }
.calibration-card.is-ready .calibration-figure { color: var(--primary); }
.calibration-card.is-ready .calibration-scan { display: none; }
.calibration-action { width: 100%; margin-top: 18px; }
.calibration-cancel { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; padding: 0 18px; border: 1px solid #d8c5c0; border-radius: 14px; color: #82483f; background: rgba(255,255,255,.7); font-weight: 700; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.calibration-cancel:hover { color: #6f392f; border-color: #bd9288; background: #fff8f5; }
.calibration-cancel svg { width: 18px; height: 18px; }
.secondary-button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; border: 1px solid #b8ccbd; border-radius: 14px; color: #285d47; background: white; font-weight: 700; transition: background .2s ease, border-color .2s ease; }
.secondary-button:hover { border-color: var(--primary); background: var(--surface-soft); }
.secondary-button svg { width: 20px; height: 20px; }
.camera-card.is-calibrating { z-index: 8; left: 5%; bottom: 112px; width: min(39%, 360px); border-radius: 20px; box-shadow: 0 22px 55px rgba(30,64,47,.22); }
.camera-card.is-calibrating .camera-caption { min-height: 42px; padding: 9px 12px; font-size: 11px; }
.coach-stage.is-calibrating .coach-cue { opacity: 0; visibility: hidden; }

.session-panel { min-width: 0; padding: 34px 32px 24px; border-left: 1px solid var(--line); background: var(--surface-strong); }
.session-heading h2 { margin: 4px 0 8px; font: 600 32px/1.15 var(--font-display); letter-spacing: -.02em; }
.session-heading > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.session-progress { margin-top: 24px; }
.session-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.session-progress strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; overflow: hidden; margin-top: 10px; border-radius: 999px; background: #e5e9e3; }
.progress-track span { display: block; width: 0; height: 100%; transform-origin: left; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #78ab91); transition: width .3s ease; }
.pose-list { display: grid; gap: 5px; margin-top: 22px; }
.pose-item { width: 100%; min-height: 58px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid transparent; border-radius: 14px; color: var(--ink); text-align: left; background: transparent; transition: border-color .2s ease, background .2s ease; }
.pose-item:hover { background: #f4f7f3; }
.pose-item.is-active { border-color: #c9dbcf; background: var(--surface-soft); }
.pose-number { color: #7b8981; font-size: 11px; font-weight: 600; }
.pose-item.is-active .pose-number { color: var(--primary); }
.pose-copy strong, .pose-copy small { display: block; }
.pose-copy strong { font-size: 13px; }
.pose-copy small, .pose-duration { margin-top: 2px; color: var(--muted); font-size: 11px; }
.pose-duration { margin: 0; white-space: nowrap; }

.technique-card { min-height: 78px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 20px; padding: 12px; border: 1px solid #cfe0d5; border-radius: 16px; background: var(--surface-soft); }
.technique-card.is-adjust { border-color: #ecd5b8; background: #fbf4ea; }
.technique-card.is-error { border-color: #e8c4c0; background: #fbefed; }
.technique-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--primary); }
.is-adjust .technique-icon { background: var(--warning); }
.is-error .technique-icon { background: var(--danger); }
.technique-icon svg { width: 21px; height: 21px; }
.technique-copy > small, .technique-copy > strong, .technique-copy > span { display: block; }
.technique-copy > small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.guidance-state { color: var(--primary); }
.technique-card[data-guidance-state="demonstrating"] .guidance-state,
.technique-card[data-guidance-state="checking"] .guidance-state { color: #557365; }
.technique-card[data-guidance-state="correcting"] .guidance-state { color: var(--warning); }
.technique-card[data-guidance-state="modified"] .guidance-state { color: #7a5d2f; }
.technique-card[data-guidance-state="holding"] .guidance-state { color: #1d754f; }
.technique-copy > strong { margin-top: 2px; font-size: 13px; }
.technique-copy > span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.technique-metrics { min-width: 72px; display: grid; justify-items: end; gap: 3px; }
.technique-metrics small { color: var(--muted); font-size: 8px; line-height: 1.25; text-align: right; white-space: nowrap; }
.pose-score { color: var(--primary); font-size: 15px; font-variant-numeric: tabular-nums; }
.is-adjust .pose-score { color: var(--warning); }
.technique-card.is-uncertain { border-color: #d9dfd6; background: #f5f7f3; }
.technique-card.is-uncertain .technique-icon { color: #52675d; background: #dce4de; }

.session-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px; }
.control-button, .play-button { display: grid; place-items: center; padding: 0; border-radius: 50%; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.control-button { width: 46px; height: 46px; border: 1px solid var(--line); color: var(--ink); background: white; }
.control-button:hover { border-color: #b9cbbb; background: var(--surface-soft); }
.control-button svg { width: 21px; height: 21px; }
.play-button { width: 58px; height: 58px; border: 0; color: white; background: var(--primary); box-shadow: 0 11px 24px rgba(52,118,92,.26); }
.play-button:hover { background: var(--primary-hover); transform: scale(1.03); }
.play-button svg { width: 22px; height: 22px; }
.play-button .pause-symbol { display: none; }
.play-button[aria-pressed="true"] .play-symbol { display: none; }
.play-button[aria-pressed="true"] .pause-symbol { display: block; }
.camera-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; border: 1px solid #b9cbbb; border-radius: 13px; color: #285d47; background: white; font-weight: 700; transition: background .2s ease, border-color .2s ease; }
.camera-button:hover { border-color: var(--primary); background: var(--surface-soft); }
.camera-button.is-on { color: white; border-color: var(--primary); background: var(--primary); }
.camera-button svg { width: 20px; height: 20px; }
.voice-dialogue-control { margin-top: 10px; }
.voice-dialogue-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #c8d7cd; border-radius: 13px; color: #315b49; background: #f4f8f4; font-weight: 700; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.voice-dialogue-button:hover:not(:disabled) { border-color: var(--primary); background: #eaf3ec; }
.voice-dialogue-button.is-hands-free { color: white; border-color: var(--primary); background: var(--primary); }
.voice-dialogue-button.is-listening { color: white; border-color: #a45b50; background: #a45b50; box-shadow: 0 0 0 4px rgba(164,91,80,.12); }
.voice-dialogue-button:disabled { cursor: not-allowed; opacity: .52; }
.voice-dialogue-button svg { width: 20px; height: 20px; }
.voice-dialogue-control small { display: block; min-height: 28px; margin: 6px 4px 0; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: center; }

.quality-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 15px; background: #f9fbf7; }
.quality-panel > summary { min-height: 52px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 14px; color: #294c3d; cursor: pointer; list-style: none; transition: background .2s ease; }
.quality-panel > summary::-webkit-details-marker { display: none; }
.quality-panel > summary:hover { background: var(--surface-soft); }
.quality-summary-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #4d715f; background: #e7eee8; }
.quality-summary-icon svg { width: 19px; height: 19px; }
.quality-panel summary strong, .quality-panel summary small { display: block; }
.quality-panel summary strong { font-size: 12px; }
.quality-panel summary small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.quality-badge { min-width: 42px; padding: 5px 7px; border-radius: 999px; color: #617269; background: #e7ebe7; font-size: 9px; font-weight: 700; text-align: center; }
.quality-panel.is-active .quality-badge { color: #236046; background: #d9eee1; }
.quality-content { padding: 0 11px 12px; }
.quality-consent { min-height: 54px; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 4px; cursor: pointer; }
.quality-consent input { position: absolute; opacity: 0; pointer-events: none; }
.quality-switch { position: relative; width: 40px; height: 24px; border-radius: 999px; background: #cbd5ce; box-shadow: inset 0 0 0 1px rgba(31,65,48,.08); transition: background .2s ease; }
.quality-switch::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; content: ""; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(24,55,40,.22); transition: transform .2s ease; }
.quality-consent input:checked + .quality-switch { background: var(--primary); }
.quality-consent input:checked + .quality-switch::after { transform: translateX(16px); }
.quality-consent input:focus-visible + .quality-switch { outline: 3px solid rgba(11,117,91,.25); outline-offset: 2px; }
.quality-consent strong, .quality-consent small { display: block; }
.quality-consent strong { color: #28493b; font-size: 11px; }
.quality-consent small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.quality-workspace { display: none; padding-top: 10px; border-top: 1px solid var(--line); }
.quality-panel.is-active .quality-workspace { display: block; }
.quality-live { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.quality-live-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #3c8a67; box-shadow: 0 0 0 4px rgba(60,138,103,.1); }
.quality-panel.is-paused .quality-live-dot { background: #89958e; box-shadow: none; }
.quality-question { margin: 11px 0 7px; color: #304c40; font-size: 10px; font-weight: 700; }
.quality-feedback { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quality-feedback button, .quality-actions button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border: 1px solid #cfdad1; border-radius: 11px; color: #365748; background: white; font: 700 9px/1.25 var(--font-body); transition: border-color .2s ease, background .2s ease, color .2s ease; }
.quality-feedback button:hover:not(:disabled), .quality-actions button:hover:not(:disabled) { border-color: #88a995; background: var(--surface-soft); }
.quality-feedback button:disabled, .quality-actions button:disabled { cursor: not-allowed; opacity: .45; }
.quality-feedback button svg, .quality-actions button svg { width: 17px; height: 17px; flex: 0 0 auto; }
.quality-feedback button:last-child { grid-column: 1 / -1; color: #805d2b; border-color: #e3d5bd; background: #fdfaf2; }
.quality-feedback button.is-selected { color: white; border-color: var(--primary); background: var(--primary); }
.quality-feedback button:last-child.is-selected { border-color: #916525; background: #916525; }
.quality-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.quality-metrics span { min-width: 0; padding: 8px 5px; border-radius: 10px; background: #eef3ee; text-align: center; }
.quality-metrics small, .quality-metrics strong { display: block; }
.quality-metrics small { min-height: 22px; color: var(--muted); font-size: 7px; line-height: 1.25; }
.quality-metrics strong { margin-top: 2px; color: #285f49; font-size: 13px; font-variant-numeric: tabular-nums; }
.quality-by-pose { margin-top: 8px; }
.quality-by-pose p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.quality-pose-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 5px 1px; border-bottom: 1px solid #e7ece7; color: var(--muted); font-size: 8px; }
.quality-pose-row:last-child { border-bottom: 0; }
.quality-pose-row strong { overflow: hidden; color: #314e41; text-overflow: ellipsis; white-space: nowrap; }
.quality-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.quality-actions button { min-height: 42px; }
.quality-actions button:first-child { grid-column: 1 / -1; }
.quality-actions #quality-clear { color: #884d44; border-color: #e1cac5; }
.quality-privacy { margin: 9px 2px 0; color: #7b817d; font-size: 8px; line-height: 1.45; }

.finish-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; border: 1px solid #d8c5c0; border-radius: 13px; color: #82483f; background: #fffafa; font-weight: 700; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.finish-button:hover { color: #6f392f; border-color: #bd9288; background: #fff5f2; }
.finish-button svg { width: 18px; height: 18px; }
.finish-button.is-hidden { display: none; }
.safety-note { margin: 16px 2px 0; color: #748078; font-size: 10px; line-height: 1.5; text-align: center; }

.workout-choice { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 13px 0; padding: 11px 13px; border: 1px solid rgba(52,118,92,.22); border-radius: 14px; background: rgba(248,252,248,.78); }
.workout-choice span, .workout-choice small, .workout-choice strong { display: block; }
.workout-choice small { margin: 0 0 3px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workout-choice strong { color: #244a3a; font-size: 12px; }
.workout-choice > span:last-child { flex: 0 0 auto; text-align: right; }
.workout-choice b { display: block; color: var(--muted); font-size: 10px; }
.workout-choice button { margin-top: 3px; padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 10px; font-weight: 800; }

.library-layer { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 22px; overflow-y: auto; background: rgba(18,36,28,.66); backdrop-filter: blur(13px); }
.library-layer.is-hidden { display: none; }
.library-card { position: relative; width: min(980px, 100%); max-height: calc(100dvh - 44px); overflow-y: auto; padding: 30px; border: 1px solid rgba(255,255,255,.76); border-radius: 27px; color: var(--ink); background: rgba(252,253,249,.99); box-shadow: 0 30px 90px rgba(14,35,24,.34); }
.library-card > .eyebrow { margin-bottom: 5px; text-align: center; }
.library-card > h2 { margin: 0; font: 600 34px/1.16 var(--font-display); text-align: center; }
.weekly-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 20px 0 12px; }
.weekly-stats span { display: grid; gap: 2px; padding: 13px; border-radius: 14px; background: #eff5ef; text-align: center; }
.weekly-stats strong { color: #285c46; font: 600 23px/1 var(--font-display); }
.weekly-stats small { color: var(--muted); font-size: 9px; }
.recommendation-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #cce0d0; border-radius: 16px; background: linear-gradient(120deg,#e9f5eb,#f5f8ef); }
.recommendation-card span, .recommendation-card small, .recommendation-card strong { display: block; }
.recommendation-card small { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.recommendation-card strong { font-size: 14px; }
.recommendation-card button { min-height: 36px; padding: 0 15px; border: 0; border-radius: 11px; color: white; background: var(--primary); font-size: 10px; font-weight: 800; }
.program-section { margin-top: 17px; }
.program-section h3 { margin: 0 0 9px; font-size: 12px; }
.program-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.program-option { padding: 11px; border: 1px solid var(--line); border-radius: 13px; color: #38584a; background: white; text-align: left; }
.program-option strong, .program-option small { display: block; }
.program-option strong { font-size: 11px; }
.program-option small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.program-option.is-active { border-color: var(--primary); background: #edf6ef; box-shadow: 0 0 0 2px rgba(52,118,92,.09); }
#program-progress { min-height: 15px; margin: 7px 2px 0; color: var(--primary); font-size: 10px; font-weight: 700; }
.catalog-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.catalog-filters label span { display: block; margin: 0 0 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.catalog-filters select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; }
.catalog-count { margin: 12px 0 8px; color: var(--muted); font-size: 10px; }
.workout-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.workout-card { min-height: 112px; display: grid; align-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #fff; text-align: left; }
.workout-card:hover { border-color: #9ec2ac; background: #f8fbf7; }
.workout-card.is-selected { border-color: var(--primary); background: #edf6ef; box-shadow: 0 0 0 2px rgba(52,118,92,.1); }
.workout-card strong, .workout-card small { display: block; }
.workout-card strong { font: 600 15px/1.2 var(--font-display); }
.workout-card small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.workout-meta { display: flex; justify-content: space-between; gap: 8px; color: #3b6855; font-size: 9px; font-weight: 800; text-transform: uppercase; }

.account-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; overflow-y: auto; background: rgba(18,36,28,.65); backdrop-filter: blur(13px); }
.account-layer.is-hidden, .account-layer .is-hidden { display: none !important; }
.account-card { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 34px; border: 1px solid rgba(255,255,255,.76); border-radius: 26px; color: var(--ink); background: rgba(252,253,249,.99); box-shadow: 0 30px 90px rgba(14,35,24,.34); }
.account-close { position: absolute; top: 17px; right: 17px; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: white; font-size: 25px; line-height: 1; }
.account-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 20px 20px 20px 7px; color: white; background: linear-gradient(145deg,#4f896f,#286047); font: 600 25px/1 var(--font-display); }
.account-card .eyebrow { text-align: center; }
.account-card h2 { max-width: 410px; margin: 0 auto; font: 600 31px/1.18 var(--font-display); text-align: center; text-wrap: balance; }
.account-intro { max-width: 430px; margin: 12px auto 22px; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
.account-form label { display: block; margin: 0 0 7px; color: #345346; font-size: 11px; font-weight: 700; }
.account-form input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid #cfdbd1; border-radius: 13px; color: var(--ink); background: white; outline: 0; }
.account-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(52,118,92,.12); }
.account-form .primary-button { width: 100%; margin-top: 12px; }
.account-form p { margin: 0 0 14px; color: var(--muted); font-size: 12px; text-align: center; }
.account-form #account-development-note { display: block; margin-top: 7px; color: #8b652c; font-size: 10px; }
.account-link { display: block; margin: 14px auto 0; padding: 7px 10px; border: 0; color: var(--primary); background: transparent; font-size: 11px; font-weight: 700; }
.account-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 11px; font-weight: 700; text-align: center; }
.account-terms { max-width: 390px; margin: 9px auto 0; color: #7a867f; font-size: 9px; line-height: 1.45; text-align: center; }
.account-email-value { margin: 8px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.account-access { display: grid; gap: 5px; margin-top: 22px; padding: 18px; border: 1px solid #d4e0d6; border-radius: 17px; background: #f0f6f1; text-align: center; }
.account-status { width: fit-content; margin: 0 auto 3px; padding: 4px 9px; border-radius: 999px; color: #286047; background: #dcecdf; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.account-status[data-status="expired"], .account-status[data-status="past_due"] { color: #8b4139; background: #f4dfdb; }
.account-status[data-status="cancelling"] { color: #805d2b; background: #f1e6cc; }
.account-access strong { font-size: 14px; }
.account-access small { color: var(--muted); font-size: 11px; }
.account-subscribe, .account-cancel-subscription { width: 100%; margin-top: 12px; }
.account-consent { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; color: #53675e; font-size: 10px; line-height: 1.5; }
.account-consent input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.account-billing-note { margin: 12px 0 0; color: #7a6650; font-size: 10px; text-align: center; }
.account-cancel-subscription { min-height: 46px; }
.account-history-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.account-history-block h3 { margin: 0 0 9px; font-size: 12px; }
.account-history { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.account-history li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #f2f5f1; font-size: 10px; }
.account-history li strong, .account-history li span { display: block; }
.account-history li span { color: var(--muted); text-align: right; }
.account-history .account-history-empty { display: block; color: var(--muted); text-align: center; }
.account-layer.is-busy .account-card { cursor: progress; }

.safety-layer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; overflow-y: auto; background: rgba(18, 36, 28, .62); backdrop-filter: blur(12px); }
.safety-layer.is-hidden, .safety-block.is-hidden { display: none; }
.safety-card { width: min(680px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 26px; border: 1px solid rgba(255,255,255,.76); border-radius: 26px; color: var(--ink); background: rgba(252,253,249,.98); box-shadow: 0 28px 80px rgba(14,35,24,.3); }
.safety-card > form > div > .eyebrow { text-align: center; }
.safety-card h2 { margin: 0; font: 600 32px/1.18 var(--font-display); text-align: center; text-wrap: balance; }
.safety-intro { max-width: 530px; margin: 8px auto 18px; color: var(--muted); font-size: 13px; line-height: 1.55; text-align: center; }
.safety-section { min-width: 0; margin: 0; padding: 15px 0; border: 0; border-top: 1px solid var(--line); }
.safety-section legend { width: 100%; padding: 0 0 10px; color: #294b3c; font-size: 13px; font-weight: 700; }
.safety-section--compact { padding-bottom: 10px; }
.safety-choice-grid { display: grid; gap: 10px; }
.safety-choice-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.safety-choice { position: relative; min-height: 74px; display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid #d7e2d8; border-radius: 15px; background: #f7faf6; cursor: pointer; }
.safety-choice:has(input:checked) { border-color: var(--primary); background: #edf6ef; box-shadow: 0 0 0 2px rgba(52,118,92,.1); }
.safety-choice--warning:has(input:checked) { border-color: #c88473; background: #fff5f2; box-shadow: 0 0 0 2px rgba(162,61,53,.08); }
.safety-choice input, .safety-acknowledgement input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }
.safety-choice span, .safety-choice strong, .safety-choice small { display: block; }
.safety-choice strong { font-size: 12px; line-height: 1.35; }
.safety-choice small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.safety-choice--compact { min-height: 50px; }
.safety-choice-grid--three { grid-template-columns: repeat(3, 1fr); }
.safety-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.safety-chip-grid label { cursor: pointer; }
.safety-chip-grid input { position: absolute; opacity: 0; pointer-events: none; }
.safety-chip-grid span { min-height: 38px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid #d7e2d8; border-radius: 999px; color: #496258; background: #f8faf7; font-size: 11px; font-weight: 700; }
.safety-chip-grid input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 42%, transparent); outline-offset: 3px; }
.safety-chip-grid input:checked + span { border-color: var(--primary); color: #245842; background: #e4f1e7; }
.safety-acknowledgement { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid #d9e4da; border-radius: 14px; color: #415b50; background: #f5f8f3; font-size: 11px; line-height: 1.45; cursor: pointer; }
.safety-error { min-height: 18px; margin: 7px 2px 0; color: var(--danger); font-size: 11px; font-weight: 700; }
.safety-actions { display: grid; grid-template-columns: .7fr 1.3fr 1.5fr; gap: 10px; }
.safety-actions .primary-button, .safety-actions .secondary-button { width: 100%; min-height: 50px; margin: 0; }
.safety-privacy { margin: 12px 0 0; color: #718078; font-size: 9px; line-height: 1.45; text-align: center; }
.safety-block { max-width: 500px; margin: 0 auto; padding: 26px 10px; text-align: center; }
.safety-block-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 22px 22px 22px 8px; color: #fff; background: linear-gradient(145deg, #c17a68, #99473f); font-size: 25px; }
.safety-block > p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.safety-block .primary-button { min-width: 220px; margin-top: 24px; }

.report-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; overflow-y: auto; background: rgba(18, 36, 28, .56); backdrop-filter: blur(10px); }
.report-layer.is-hidden { display: none; }
.report-card { position: relative; width: min(570px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 34px; border: 1px solid rgba(255,255,255,.72); border-radius: 24px; color: var(--ink); background: rgba(252,253,249,.98); box-shadow: 0 28px 80px rgba(14,35,24,.28); }
.report-close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: white; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.report-close:hover { color: var(--ink); border-color: #b6c8ba; background: var(--surface-soft); }
.report-close svg { width: 20px; height: 20px; }
.report-mark { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 20px 20px 20px 8px; color: white; background: linear-gradient(145deg, #4f896f, #286047); box-shadow: 0 12px 28px rgba(52,118,92,.22); }
.report-mark svg { width: 34px; height: 34px; }
.report-card > .eyebrow { margin: 0 0 6px; text-align: center; }
.report-card h2 { margin: 0; font: 600 32px/1.2 var(--font-display); text-align: center; }
.report-summary { max-width: 440px; margin: 10px auto 0; color: var(--muted); font-size: 14px; line-height: 1.55; text-align: center; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.report-stats > div { min-height: 88px; display: grid; align-content: center; gap: 5px; padding: 14px; border: 1px solid #d9e4da; border-radius: 16px; background: var(--surface-soft); text-align: center; }
.report-stats small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.report-stats strong { color: #285f49; font: 600 21px/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.report-highlight { display: flex; align-items: center; gap: 13px; margin-top: 12px; padding: 14px 16px; border: 1px solid #e4ded0; border-radius: 16px; background: #fbf8ef; }
.report-highlight.is-hidden { display: none; }
.report-highlight-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #8a6632; background: #f0e5cc; }
.report-highlight-icon svg { width: 21px; height: 21px; }
.report-highlight small, .report-highlight strong { display: block; }
.report-highlight small { color: #756c5d; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.report-highlight strong { margin-top: 3px; font-size: 13px; line-height: 1.4; }
.report-quality { margin-top: 10px; padding: 13px 16px; border: 1px solid #ccded1; border-radius: 16px; background: #f0f6f1; }
.report-quality.is-hidden { display: none; }
.report-quality small, .report-quality strong, .report-quality span { display: block; }
.report-quality small { color: var(--primary); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.report-quality strong { margin-top: 4px; font-size: 13px; }
.report-quality span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.workout-feedback { display: grid; gap: 12px; margin-top: 16px; padding: 16px; border: 1px solid #d7e2d8; border-radius: 18px; background: #f7faf6; }
.workout-feedback fieldset { margin: 0; padding: 0; border: 0; }
.workout-feedback legend, .feedback-field > span { display: block; margin: 0 0 8px; color: #365748; font-size: 11px; font-weight: 750; }
.feedback-rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.feedback-rating label { cursor: pointer; }
.feedback-rating input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-rating span { min-height: 40px; display: grid; place-items: center; border: 1px solid #ccd9cf; border-radius: 11px; color: #496258; background: white; font-size: 13px; font-weight: 800; }
.feedback-rating input:checked + span { border-color: var(--primary); color: white; background: var(--primary); }
.feedback-rating input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 42%, transparent); outline-offset: 2px; }
.feedback-field { display: block; }
.feedback-field select, .feedback-field textarea { width: 100%; border: 1px solid #ccd9cf; border-radius: 12px; color: var(--ink); background: white; font: 500 12px/1.45 var(--font-body); }
.feedback-field select { min-height: 44px; padding: 0 12px; }
.feedback-field textarea { min-height: 76px; padding: 10px 12px; resize: vertical; }
.feedback-submit-row { display: grid; grid-template-columns: .9fr 1.2fr; gap: 8px; }
.feedback-submit-row .primary-button, .feedback-submit-row .secondary-button { width: 100%; min-height: 45px; margin: 0; padding: 8px 12px; font-size: 11px; }
.feedback-dictate.is-listening { border-color: #b5544c; color: #8f3d37; background: #fff2ef; }
.feedback-status { min-height: 16px; margin: -3px 0 0; color: var(--primary); font-size: 10px; font-weight: 700; }
.feedback-status.is-error { color: var(--danger); }
.feedback-privacy { margin: -4px 0 0; color: #718078; font-size: 9px; line-height: 1.4; }
.workout-feedback.is-sent { background: #eef7f0; }
.workout-feedback.is-sent > :not(.feedback-status):not(.feedback-privacy) { display: none; }
.report-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-top: 22px; }
.report-actions .primary-button, .report-actions .secondary-button { width: 100%; min-height: 50px; margin: 0; }
.report-privacy { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 14px 0 0; color: #718078; font-size: 10px; text-align: center; }
.report-privacy svg { width: 15px; height: 15px; flex: 0 0 auto; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: min(440px, calc(100% - 32px)); padding: 12px 16px; transform: translate(-50%, 24px); border-radius: 12px; color: white; background: #1e382d; box-shadow: 0 12px 34px rgba(17,40,29,.24); opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s ease; font-size: 13px; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@keyframes voice-wave { 0%, 100% { height: 7px; } 50% { height: 23px; } }
@keyframes calibration-scan { 0%, 100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(78px); opacity: 1; } }

@media (max-width: 980px) {
  body { padding: 0; }
  .app-shell { min-height: 100dvh; border: 0; border-radius: 0; }
  .practice-layout { grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr); }
  .coach-stage { min-height: 760px; }
  .session-panel { padding: 30px 24px 22px; }
  .welcome-layer { padding-left: 7%; }
  .welcome-card { width: min(380px, 62%); }
  .coach-cue { width: min(58%, 430px); }
}

@media (max-width: 760px) {
  .topbar { min-height: 64px; padding: 0 16px; }
  .session-state { display: none; }
  .practice-layout { display: block; }
  .coach-stage { min-height: 740px; }
  .coach-stage.is-training { position: relative; top: auto; height: clamp(360px, calc(100dvh - 80px), 630px); }
  .coach-stage.is-training #trainer-canvas { height: calc(100% - 144px); }
  .session-panel { border-top: 1px solid var(--line); border-left: 0; }
  .welcome-layer { padding: 78px 20px 92px; align-items: end; background: linear-gradient(0deg, rgba(222,237,224,.99) 0, rgba(222,237,224,.94) 48%, rgba(222,237,224,.1) 78%, transparent 100%); }
  .welcome-card { width: 100%; }
  .welcome-card h1 { font-size: clamp(38px, 12vw, 54px); }
  .welcome-card > p:not(.eyebrow) { max-width: 520px; font-size: 15px; }
  .coach-stage.is-calibrating { min-height: 720px; }
  .calibration-layer { align-items: flex-end; justify-content: center; padding: 315px 16px 18px; background: linear-gradient(0deg, rgba(230,240,232,.99) 0, rgba(230,240,232,.96) 57%, rgba(218,234,222,.48) 100%); }
  .calibration-card { width: min(430px, 100%); padding: 19px; }
  .calibration-figure { width: 68px; height: 78px; margin: 5px auto 9px; }
  .calibration-figure svg { width: 58px; height: 80px; }
  .calibration-scan { display: none; }
  .calibration-card h2 { font-size: 22px; }
  .camera-card.is-calibrating { top: 78px; bottom: auto; left: 50%; width: min(72%, 290px); transform: translateX(-50%); }
  .camera-card { left: 14px; bottom: 91px; width: 132px; }
  .coach-cue { right: 14px; left: auto; bottom: 17px; width: calc(100% - 28px); transform: none; }
  .pose-list { grid-template-columns: 1fr 1fr; }
  .pose-item { min-height: 70px; grid-template-columns: 25px 1fr; }
  .pose-duration { display: none; }
  .report-layer { align-items: end; padding: 16px; }
  .report-card { max-height: calc(100dvh - 32px); padding: 28px 20px 22px; border-radius: 22px; }
  .safety-layer { align-items: end; padding: 16px; }
  .safety-card { max-height: calc(100dvh - 32px); padding: 26px 20px 22px; border-radius: 22px; }
  .library-layer { align-items: end; padding: 12px; }
  .library-card { max-height: calc(100dvh - 24px); padding: 25px 18px 20px; border-radius: 22px; }
  .workout-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .brand { font-size: 15px; }
  .brand-mark { width: 36px; height: 36px; }
  .top-actions { gap: 6px; }
  .coach-stage { min-height: 730px; }
  .trainer-id { top: 15px; left: 14px; }
  .current-pose { top: 19px; right: 14px; }
  .trainer-id small { display: none; }
  .current-pose strong { font-size: 17px; }
  .welcome-layer { padding: 64px 16px 76px; }
  .coach-options { gap: 8px; }
  .coach-option { min-height: 62px; padding-right: 2px; padding-left: 2px; border-radius: 12px; }
  .coach-option svg { width: 26px; height: 26px; }
  .coach-option span { font-size: 9px; }
  .primary-button { width: 100%; }
  .welcome-card > small { font-size: 10px; }
  .calibration-layer { padding-right: 12px; padding-left: 12px; }
  .calibration-card { padding: 16px; border-radius: 18px; }
  .calibration-card > p:not(.eyebrow) { font-size: 12px; }
  .camera-card { width: 118px; bottom: 90px; }
  .camera-caption { min-height: 32px; padding: 6px 8px; }
  .coach-cue { gap: 11px; padding: 10px 13px; }
  .coach-cue p { font-size: 12px; }
  .session-panel { padding: 26px 16px 22px; }
  .session-heading h2 { font-size: 29px; }
  .pose-item { padding: 7px 8px; }
  .technique-card { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; }
  .technique-metrics { min-width: 62px; }
  .technique-metrics small { max-width: 65px; white-space: normal; }
  .report-layer { padding: 8px; }
  .report-card { max-height: calc(100dvh - 16px); padding: 24px 16px 18px; border-radius: 20px; }
  .report-card h2 { font-size: 28px; }
  .report-stats { grid-template-columns: 1fr; gap: 7px; }
  .report-stats > div { min-height: 64px; grid-template-columns: 1fr auto; align-items: center; text-align: left; }
  .report-stats strong { font-size: 19px; }
  .report-actions { grid-template-columns: 1fr; }
  .safety-layer { padding: 8px; }
  .safety-card { max-height: calc(100dvh - 16px); padding: 24px 16px 18px; border-radius: 20px; }
  .safety-card h2 { font-size: 27px; }
  .safety-choice-grid--two { grid-template-columns: 1fr; }
  .safety-choice-grid--three { grid-template-columns: repeat(3, 1fr); }
  .safety-choice { min-height: 58px; }
  .safety-actions { grid-template-columns: 1fr; }
  .feedback-submit-row { grid-template-columns: 1fr; }
  .workout-choice { margin: 10px 0; }
  .weekly-stats { gap: 5px; }
  .weekly-stats span { padding: 10px 5px; }
  .program-options, .workout-grid { grid-template-columns: 1fr; }
  .catalog-filters { grid-template-columns: 1fr; }
}

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

/* Internal visual-QA view: ?avatarPreview=1&trainer=sofia&pose=warrior */
body.avatar-preview { min-height: 100dvh; padding: 0; overflow: hidden; }
body.avatar-preview .app-shell { width: 100%; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
body.avatar-preview .topbar,
body.avatar-preview .welcome-layer,
body.avatar-preview .calibration-layer,
body.avatar-preview .camera-card,
body.avatar-preview .coach-cue,
body.avatar-preview .session-panel,
body.avatar-preview .safety-layer,
body.avatar-preview .report-layer { display: none !important; }
body.avatar-preview .practice-layout { min-height: 100dvh; display: block; }
body.avatar-preview .coach-stage { min-height: 100dvh; }
body.avatar-preview .trainer-id { top: 24px; left: 24px; }
body.avatar-preview .current-pose { top: 27px; right: 25px; }

/* Dedicated owner-only practice has a single coach and no billing. */
#open-library, .profile-button, .safety-analytics-consent, #workout-feedback { display: none; }

/* Let the complete trainer picker set the stage height, including on narrow phones. */
.coach-stage:has(.welcome-layer:not(.is-hidden)) { height: auto; }
.welcome-layer:not(.is-hidden) { position: relative; padding-bottom: 32px; }
.trainer-home .pose-item { cursor: default; }
@media (max-width: 760px) {
  .coach-stage:has(.welcome-layer:not(.is-hidden)) #trainer-canvas { top: 45px; height: 210px; }
  .welcome-layer:not(.is-hidden) {
    padding-top: 248px;
    background: linear-gradient(to bottom, transparent 200px, #deede0 251px);
  }
}

.trainer-home #trainer-canvas { inset: 64px 0 auto auto; width: 54%; height: min(43vw, 455px); }
.trainer-home .trainer-id, .trainer-home .current-pose { z-index: 6; }
.trainer-home .welcome-layer { background: linear-gradient(90deg, #deede0, #deede0d6 42%, transparent 57%); }
.trainer-home .welcome-card { width: min(470px, 49%); }
.trainer-home .welcome-card h1 { font-size: clamp(40px, 4.4vw, 64px); }
.trainer-home .coach-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trainer-home #start-practice { margin-top: 16px; }

@media (max-width: 900px) {
  .trainer-home .topbar { min-height: 56px; }
  .trainer-home .practice-layout { display: block; }
  .trainer-home .coach-stage {
    --home-preview-height: clamp(168px, 35svh, 238px);
    min-height: 0;
  }
  .trainer-home .coach-stage:has(.welcome-layer:not(.is-hidden)) #trainer-canvas {
    inset: 52px 0 auto;
    width: 100%;
    height: var(--home-preview-height);
  }
  .trainer-home .trainer-id { top: 14px; left: 16px; }
  .trainer-home .current-pose { top: 17px; right: 16px; max-width: 54%; }
  .trainer-home .welcome-layer:not(.is-hidden) {
    justify-items: center;
    padding: calc(52px + var(--home-preview-height)) 16px 28px;
    background: linear-gradient(to bottom, transparent calc(44px + var(--home-preview-height)), #deede0 calc(58px + var(--home-preview-height)));
  }
  .trainer-home .welcome-card { width: min(520px, 100%); }
  .trainer-home .welcome-card h1 { font-size: clamp(34px, 10vw, 50px); }
  .trainer-home #start-practice { width: 100%; }
  .trainer-home .session-panel { border-top: 1px solid var(--line); border-left: 0; }
}

.subscription-dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 20px 60px #142d2540;
}
.subscription-dialog::backdrop { background: #132b23a6; }
.subscription-dialog h2 { margin: 4px 32px 14px 0; font-size: 25px; line-height: 1.25; }
.subscription-dialog p.billing-terms { font-size: 0.75rem; line-height: 1.45; }
.subscription-dialog .subscription-details {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.8125rem;
}
.subscription-details > summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
.subscription-details > p { margin: 0 0 0.5rem; }
.subscription-dialog .subscription-legal { font-size: 0.75rem; line-height: 1.5; }
.subscription-dialog .subscription-legal p { margin: 0.5rem 0; }
.subscription-dialog .status { color: var(--muted); }
.subscription-dialog label { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; }
.subscription-dialog label > span { font-size: 0.75rem; line-height: 1.35; }
.subscription-dialog input { flex: none; width: 20px; height: 20px; accent-color: var(--primary); }
.subscription-dialog .action {
  display: inline-block;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  color: var(--on-primary);
  background: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem 1rem;
}
.legal-links a, .subscription-dialog a:not(.action) { color: var(--primary); }
