/* CloseFlow: self-contained, mobile-first, system fonts only. */
:root {
  color-scheme: dark;
  --bg: #0b0b10;
  --surface: #141419;
  --raised: #1b1b23;
  --line: #2a2934;
  --text: #f5f3fa;
  --muted: #aaa8ba;
  --accent: #a78bfa;
  --accent-solid: #8052ed;
  --accent-wash: #a78bfa12;
  --radius: 18px;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button, input, select { border-radius: 10px; }
button, select, input { min-height: 44px; }
button { border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
main:focus { outline: none; }
button, a { transition: background .18s, border-color .18s, color .18s, transform .18s; }
button:not(:disabled):active { transform: translateY(1px); }
h1, h2, h3, p, blockquote { margin: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.035em; }
h1 { font-size: clamp(2.25rem, 6vw, 4rem); font-weight: 760; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; letter-spacing: -.015em; }
p { color: var(--muted); }
ul { margin: 0; padding-left: 1.2em; }
svg { display: block; }
.icon { width: 22px; height: 22px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -70px; left: 16px; padding: 12px 20px; background: var(--accent-solid); z-index: 100; }
.skip-link:focus { top: 10px; }
.app-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 80px; padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: #0b0b10f2; backdrop-filter: blur(18px);
}
.brand { display: inline-flex; gap: 11px; align-items: center; min-height: 44px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-solid); box-shadow: 0 0 28px #8052ed24; }
.brand-mark .icon { width: 25px; height: 25px; }
.wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: -.06em; line-height: 1.2; }
.brand-tagline { margin-top: 3px; font-size: .75rem; letter-spacing: .01em; color: var(--muted); }
.header-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #a78bfa80; }
.app-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 7px 8px max(7px, env(safe-area-inset-bottom)); background: #121217f7; backdrop-filter: blur(18px); border-top: 1px solid var(--line);
}
.nav-link { min-height: 55px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: var(--muted); border-radius: 9px; font-size: .64rem; font-weight: 600; white-space: nowrap; }
.nav-link[aria-current="page"] { color: var(--accent); background: var(--accent-wash); }
.nav-link:hover { color: var(--text); background: var(--raised); }
.app-main { max-width: 1224px; margin: auto; padding: 32px 20px 52px; min-height: calc(100vh - 210px); }
.app-footer { max-width: 1184px; margin: 0 auto; padding: 24px 20px 106px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: .69rem; text-transform: uppercase; letter-spacing: .17em; font-weight: 750; color: var(--accent); margin-bottom: 18px; }
.eyebrow .icon { width: 15px; height: 15px; }
.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin-bottom: 15px; }
.page-heading p { max-width: 640px; }
.hero { padding: 6px 0 32px; }
.hero h1 { max-width: 690px; margin-bottom: 20px; }
.hero h1 span { color: var(--accent); }
.hero-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.hero-bottom p { max-width: 430px; }
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 18px; border: 1px solid var(--line); background: var(--raised); font-size: .875rem; font-weight: 650; line-height: 1.5; }
.btn:hover:not(:disabled) { background: #282732; border-color: #4f4b60; }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; box-shadow: 0 4px 22px #8052ed15; }
.btn-primary:hover:not(:disabled) { background: #9163fc; border-color: #9163fc; }
.btn-subtle { background: transparent; }
.btn .icon { width: 18px; height: 18px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-size: .875rem; font-weight: 650; }
.text-link .icon { width: 16px; height: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-pad { padding: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title h2 { font-size: 1.2rem; }
.section-title .meta { flex-shrink: 0; }
.meta { font-size: .75rem; color: var(--muted); letter-spacing: .02em; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .72rem; }
.pill-accent { color: var(--accent); border-color: #a78bfa30; background: var(--accent-wash); }
.flow-layout { display: grid; gap: 32px; }
.journey-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.journey-header h2 { font-size: 1.1rem; }
.progress-label { color: var(--accent); font-size: .8rem; white-space: nowrap; }
.progress-track { height: 3px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transition: width .3s; }
.journey-list { list-style: none; padding: 12px 16px; }
.stage { position: relative; padding-left: 54px; }
.stage:not(:last-child)::before { content: ""; position: absolute; width: 1px; background: var(--line); left: 19px; top: 50px; bottom: -17px; }
.stage.is-visited:not(:last-child)::before { background: #a78bfa60; }
.stage-toggle { position: relative; width: 100%; display: flex; text-align: left; align-items: center; gap: 12px; padding: 22px 0; background: transparent; border-radius: 0; }
.stage:not(:last-child) .stage-toggle { border-bottom: 1px solid #24232d; }
.stage-number { position: absolute; left: -54px; width: 39px; height: 39px; border: 1px solid #35323f; border-radius: 50%; background: #19181f; display: grid; place-items: center; font-size: .78rem; font-weight: 650; color: var(--muted); }
.is-visited .stage-number { border-color: #a78bfa66; color: var(--accent); background: #292039; }
.is-open .stage-number { background: var(--accent-solid); color: white; border-color: var(--accent-solid); box-shadow: 0 0 0 5px #a78bfa0d; }
.stage-copy { flex: 1; }
.stage-copy strong { font-size: 1rem; display: block; font-weight: 650; }
.stage-copy small { display: block; font-size: 1rem; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.stage-chevron { width: 18px; color: #777385; transition: transform .2s; }
.is-open .stage-chevron { transform: rotate(180deg); color: var(--accent); }
.stage-detail { padding: 2px 8px 24px 0; font-size: 1rem; animation: enter .2s ease; }
.stage-detail p { margin: 4px 0 16px; }
.teach-list { list-style: none; padding: 0; display: grid; gap: 9px; }
.teach-list li { position: relative; padding-left: 18px; }
.teach-list li::before { content: ""; width: 5px; height: 5px; position: absolute; top: .65em; left: 0; border-radius: 50%; background: var(--accent); }
.flow-aside { display: flex; flex-direction: column; gap: 22px; }
.weekly-list { display: grid; }
.weekly-item { display: flex; gap: 12px; padding: 17px 0; align-items: flex-start; border-bottom: 1px solid var(--line); }
.weekly-item:last-child { border-bottom: 0; padding-bottom: 0; }
.weekly-item:hover strong { color: var(--accent); }
.day-swatch { width: 5px; height: 32px; border-radius: 4px; flex-shrink: 0; background: var(--module-color); margin-top: 4px; }
.weekly-item .meta { text-transform: uppercase; font-size: .64rem; letter-spacing: .09em; display: flex; gap: 8px; align-items: center; }
.today-tag { color: var(--accent); font-weight: 650; }
.weekly-item strong { font-weight: 550; font-size: 1rem; line-height: 1.5; display: block; margin-top: 3px; }
.weekly-item .icon { margin-left: auto; width: 15px; color: var(--muted); margin-top: 10px; }
.principle-feature { background: linear-gradient(130deg, #211a32, #141419 80%); border-color: #3a2c50; }
.principle-feature h3 { margin-bottom: 12px; font-size: 1.4rem; }
.principle-feature p { font-size: 1rem; }
.day-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 24px; }
.day-chip { min-height: 54px; padding: 10px 3px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 7px; font-size: .83rem; font-weight: 650; }
.day-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--module-color); }
.day-chip[aria-pressed="true"] { border-color: var(--module-color); background: color-mix(in srgb, var(--module-color) 16%, var(--surface)); }
.module-hero { padding: 26px; margin-bottom: 24px; position: relative; overflow: hidden; border-top: 2px solid var(--module-color); }
.module-hero .eyebrow { color: var(--muted); margin-bottom: 16px; }
.module-hero blockquote { font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.035em; font-weight: 720; line-height: 1.2; max-width: 840px; margin-bottom: 18px; }
.module-hero p { max-width: 800px; font-size: 1rem; }
.goals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.mode-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 26px 0; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.segmented button { min-width: 105px; padding: 9px 15px; background: transparent; color: var(--muted); font-size: .84rem; font-weight: 650; }
.segmented button[aria-pressed="true"] { background: #312641; color: #d6c5fc; }
.streaks { display: flex; gap: 18px; color: var(--muted); font-size: .78rem; }
.streaks strong { color: var(--text); }
.script-grid { display: grid; gap: 16px; }
.script-card { overflow: hidden; align-self: start; }
.script-toggle { width: 100%; padding: 24px; display: block; text-align: left; background: transparent; min-height: 215px; }
.script-toggle:hover { background: #ffffff03; }
.script-top { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.script-index { color: var(--accent); font-size: .72rem; font-weight: 600; letter-spacing: .05em; }
.script-title { font-weight: 650; line-height: 1.3; }
.script-hint { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: .75rem; margin-top: 24px; }
.script-hint .icon { width: 15px; height: 15px; }
.script-card.is-flipped { border-color: #6c4e9f; background: #1b1724; }
.script-back { display: block; animation: flip-in .25s ease; }
.bubble { display: block; padding: 15px 17px; background: #22212b; border: 1px solid #302e3b; border-radius: 3px 13px 13px; margin-top: 12px; text-align: left; }
.bubble-label { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 7px; }
.bubble-text { display: block; font-size: 1rem; line-height: 1.7; color: var(--text); }
.bubble-you { background: #a78bfa0a; border-color: #a78bfa26; border-radius: 13px 3px 13px 13px; }
.bubble-you .bubble-label { color: var(--accent); }
.followup-label { display: block; margin-top: 16px; color: var(--accent); font-size: .78rem; font-weight: 650; }
.pause-bubble { animation: after-beat 1.1s both; }
.pause-label { color: var(--muted); font-style: italic; }
.practice-panel { max-width: 800px; margin: 0 auto; padding: 26px; }
.practice-prompt { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; margin: 20px 0; }
.practice-instruction { font-size: .875rem; margin-bottom: 24px; }
.practice-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.practice-actions .btn { flex: 1; }
.answer-list { display: grid; gap: 22px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); animation: enter .2s ease; }
.answer-title { font-size: .875rem; }
.completion { text-align: center; padding: 44px 24px; }
.completion-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); margin: 0 auto 20px; }
.completion-icon .icon { width: 28px; height: 28px; }
.completion h2 { margin-bottom: 12px; }
.completion .btn { margin-top: 24px; }
.setup-grid { display: grid; gap: 24px; }
.module-options { display: grid; gap: 12px; margin: 24px 0; }
.module-option { position: relative; cursor: pointer; display: flex; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; gap: 14px; }
.module-option:has(input:checked) { background: var(--accent-wash); border-color: #a78bfa55; }
input[type="checkbox"] { accent-color: var(--accent-solid); width: 22px; height: 22px; min-height: 22px; flex-shrink: 0; cursor: pointer; }
.module-option strong { display: block; font-size: 1rem; font-weight: 550; }
.module-option .meta { display: block; margin-bottom: 3px; }
.field-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 10px; }
.text-input, select { width: 100%; border: 1px solid #3a3748; background: #0f0f15; color: var(--text); padding: 12px 14px; }
.setup-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.setup-controls > div { flex: 1; }
.reminder { color: var(--accent); font-size: .78rem; text-align: center; margin: 26px 0 0; line-height: 1.8; }
.history-list { list-style: none; padding: 0; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-item strong { display: block; font-size: .875rem; font-weight: 600; }
.history-accuracy { color: var(--accent); font-size: 1.25rem; font-weight: 700; }
.empty-state { padding: 30px 0; color: var(--muted); font-size: .875rem; }
.speed-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.timer { position: relative; width: 180px; height: 180px; margin: 26px auto; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-track { stroke: var(--line); }
.timer-progress { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
.timer-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-value strong { font-size: 3.5rem; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.timer-value span { font-size: .65rem; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); margin-top: 5px; }
.timer.is-urgent .timer-progress { stroke: #fbab79; }
.timer.is-urgent .timer-value strong { color: #fbab79; }
.speed-prompt { text-align: center; }
.speed-prompt .practice-instruction { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.stat { padding: 18px 8px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.stat strong { display: block; font-size: 1.8rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat span { display: block; color: var(--muted); font-size: .72rem; }
.stat:last-child strong { color: var(--accent); }
.score-layout { display: grid; gap: 24px; }
.score-form { padding: 24px; }
.score-form-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.score-form-head h2 { font-size: 1.2rem; }
.rating-field { border: 0; padding: 23px 0 0; margin: 0; min-width: 0; }
.rating-field legend { float: left; width: 100%; padding: 0; font-size: 1rem; font-weight: 550; margin-bottom: 12px; }
.rating-field legend span { font-size: .7rem; color: var(--muted); margin-right: 9px; }
.rating-options { clear: both; display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 5px; }
.rating-option { position: relative; min-width: 0; }
.rating-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rating-option span { display: flex; align-items: center; justify-content: center; min-height: 44px; background: #202028; border: 1px solid #363340; border-radius: 7px; color: var(--muted); font-size: .8rem; }
.rating-option input:checked + span { color: white; background: var(--accent-solid); border-color: var(--accent-solid); }
.rating-option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.rating-option:hover span { border-color: var(--accent); }
.score-form-foot { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.score-aside { display: flex; flex-direction: column; gap: 24px; }
.trend-chart { width: 100%; margin-top: 16px; overflow: visible; }
.trend-chart text { fill: var(--muted); font: 11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.trend-key { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .7rem; margin-top: 8px; }
.trend-key::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.latest-list { display: grid; gap: 18px; margin-top: 24px; }
.latest-item { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; align-items: center; font-size: .78rem; }
.latest-item strong { color: var(--accent); font-size: .875rem; }
.latest-meter { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 4px; }
.latest-meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.playbook-section { margin-top: 38px; }
.principles-grid, .rounds-grid, .drills-grid { display: grid; gap: 16px; }
.reference-card { padding: 26px; }
.reference-number { color: var(--accent); font-size: .72rem; font-weight: 650; letter-spacing: .06em; margin-bottom: 24px; display: block; }
.reference-card h3 { margin-bottom: 13px; }
.reference-card p { font-size: 1rem; }
.round-card { border-top: 2px solid #6c4e9f; }
.final-goal { display: grid; gap: 24px; margin-top: 32px; padding: 30px; background: linear-gradient(110deg, #251b39, #15131b); border-color: #49355f; }
.final-goal p { margin-top: 15px; }
.final-goal .teach-list { font-size: 1rem; gap: 12px; }
.toast { position: fixed; left: 50%; transform: translate(-50%, 12px); bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 60; max-width: min(480px, calc(100% - 32px)); width: max-content; border: 1px solid #67518b; border-radius: 12px; padding: 12px 18px; background: #292033; color: var(--text); font-size: .875rem; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s; box-shadow: 0 8px 30px #0005; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.storage-notice { max-width: 1184px; margin: 16px auto 0; padding: 12px 20px; border: 1px solid #67518b; background: #292033; font-size: .875rem; }
.noscript { padding: 30px; }
[hidden] { display: none !important; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flip-in { from { opacity: 0; transform: rotateX(-8deg); } to { opacity: 1; transform: rotateX(0); } }
@keyframes after-beat { 0%, 65% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: translateY(0); } }
@media (min-width: 560px) {
  .app-main { padding: 40px 28px 60px; }
  .journey-list { padding: 12px 26px; }
  .script-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-status { font-size: .75rem; }
}
@media (min-width: 640px) { .rating-options { grid-template-columns: repeat(10, minmax(44px, 1fr)); } }
@media (min-width: 900px) {
  .app-header { padding: 18px max(28px, calc((100vw - 1184px) / 2)); height: 91px; }
  .brand-tagline { font-size: .7rem; }
  .header-status { margin-left: auto; }
  .app-nav { top: 91px; bottom: auto; padding: 0 max(28px, calc((100vw - 1184px) / 2)); height: 63px; display: flex; gap: 25px; background: #0b0b10f5; border-top: 0; border-bottom: 1px solid var(--line); }
  .nav-link { position: relative; flex-direction: row; font-size: .82rem; gap: 9px; padding: 0 10px; min-width: 105px; border-radius: 0; }
  .nav-link .icon { width: 18px; height: 18px; }
  .nav-link[aria-current="page"] { background: transparent; color: var(--accent); }
  .nav-link[aria-current="page"]::after { position: absolute; content: ""; height: 2px; bottom: 0; left: 8px; right: 8px; background: var(--accent); }
  .app-main { padding-top: 106px; }
  .hero { padding: 0 0 45px; }
  .hero-bottom { justify-content: space-between; }
  .hero h1 { font-size: 4.25rem; max-width: 740px; }
  .hero-bottom p { max-width: none; }
  .flow-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .setup-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .score-layout { grid-template-columns: minmax(0, 1fr) 310px; align-items: start; }
  .score-form { padding: 28px; }
  .score-form .rating-options { gap: 5px; grid-template-columns: repeat(5, minmax(44px, 1fr)); }
  .principles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rounds-grid, .drills-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .final-goal { grid-template-columns: 1fr 1.4fr; padding: 36px; }
  .app-footer { padding: 25px 0 35px; margin-left: 28px; margin-right: 28px; }
  .toast { bottom: 28px; }
  .storage-notice { position: relative; top: 64px; margin-bottom: 20px; }
}
@media (min-width: 1000px) { .score-form .rating-options { gap: 4px; grid-template-columns: repeat(10, minmax(44px, 1fr)); } }
@media (min-width: 1100px) {
  .script-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .score-form .rating-options { gap: 6px; }
}
@media (min-width: 1240px) { .app-footer { margin-left: auto; margin-right: auto; } }
@media (max-width: 359px) {
  .app-main { padding-left: 14px; padding-right: 14px; }
  .app-header { padding-left: 14px; padding-right: 14px; }
  .header-status { display: none; }
  .panel-pad, .score-form, .module-hero, .practice-panel { padding: 20px; }
  .stage { padding-left: 48px; }
  .stage-number { left: -48px; }
  .day-chip { gap: 4px; }
}
/* V2 motion: incoming views and list cards, with a single reduced-motion gate. */
button:not(:disabled):active, .btn:not(:disabled):active { transform: scale(.97); }
.nav-link, .day-chip, .segmented button { transition: transform .35s cubic-bezier(.2, 1.8, .4, 1), background .18s, color .18s; }
.nav-link:active, .day-chip:not(:disabled):active, .segmented button:active { transform: scale(.91); }
.nav-link[aria-current="page"] .icon { animation: tab-settle .42s cubic-bezier(.2, 1.8, .4, 1); }
.view-enter { animation: view-enter .32s ease-out both; }
.view-enter :is(.stage, .script-card, .reference-card, .persona-card) { animation: card-enter .38s ease-out both; animation-delay: calc(var(--order, 0) * 45ms); }
@keyframes view-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-enter { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes tab-settle { from { transform: scale(.8); } to { transform: scale(1); } }

/* Both faces stay mounted: changing the class rotates a real 3D surface. */
.script-card { perspective: 1200px; overflow: visible; background: transparent; border: 0; }
.script-card.is-flipped { background: transparent; }
.script-toggle { display: grid; padding: 0; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.2, .75, .25, 1); }
.script-toggle:hover { background: transparent; }
.script-face { grid-area: 1 / 1; display: block; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.script-front { transform: rotateY(0deg); }
.script-back { animation: none; transform: rotateY(180deg); background: #1b1724; border-color: #6c4e9f; }
.is-flipped .script-toggle { transform: rotateY(180deg); }
.script-card .script-toggle:active { transform: rotateY(0deg) scale(.99); }
.script-card.is-flipped .script-toggle:active { transform: rotateY(180deg) scale(.99); }
.script-card:not(.is-flipped) .pause-bubble { animation: none; }
.script-card.is-flipped .pause-bubble { animation: after-beat 1.35s both; }
.script-face .script-hint { margin-top: 24px; }
.timer-progress { transition: stroke-dashoffset .1s linear, stroke .25s; }
.timer.is-warning .timer-progress { stroke: #fbbf24; }
.timer.is-warning .timer-value strong { color: #fbbf24; }
.timer.is-urgent .timer-progress { stroke: #fb7185; }
.timer.is-urgent .timer-value strong { color: #fb7185; }
.timer.is-urgent.is-ticking { animation: timer-pulse .8s ease-in-out infinite; }
@keyframes timer-pulse { 50% { filter: drop-shadow(0 0 9px #fb718577); transform: scale(1.025); } }
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }
[data-count] { font-variant-numeric: tabular-nums; }
.stat strong [data-count] { display: inline; font: inherit; color: inherit; }

/* Live practice shares v1's cards, type, and spacing. */
textarea { font: inherit; border-radius: 10px; resize: vertical; min-height: 135px; }
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.mode-bar .segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 350px); }
.mode-bar .segmented button { min-width: 0; padding-inline: 10px; }
.live-setup { display: grid; gap: 24px; align-items: start; }
.live-setup > *, .live-call, .customer-identity > div { min-width: 0; }
.live-setup .eyebrow { font-size: .63rem; margin-bottom: 9px; }
.persona-heading { margin: 28px 0 16px; font-size: 1rem; }
.persona-grid { display: grid; gap: 12px; }
.persona-card { position: relative; display: grid; gap: 8px; padding: 20px; text-align: left; border: 1px solid var(--line); background: var(--raised); border-radius: 14px; }
.persona-card:hover { border-color: #67518b; }
.persona-card[aria-pressed="true"] { background: #251e35; border-color: var(--accent); box-shadow: 0 0 0 1px #a78bfa22; }
.persona-card strong { font-size: 1rem; }
.persona-card > span:not(.persona-emoji):not(.persona-selection) { color: var(--muted); font-size: .875rem; line-height: 1.6; }
.persona-emoji { font-size: 1.65rem; }
.persona-selection { position: absolute; top: 15px; right: 15px; color: var(--accent); width: 22px; height: 22px; }
.live-start { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-top: 26px; }
.live-start strong { font-size: .875rem; }
.live-start p { font-size: .875rem; margin-top: 4px; }
.live-note { margin-top: 18px; }
.scoring-guide { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 12px; color: var(--muted); }
.scoring-guide summary, .turn-feedback summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-size: .8rem; color: var(--accent); }
.scoring-guide p { font-size: .8rem; margin: 8px 0; }
.live-call { max-width: 880px; margin: 0 auto; padding: 24px; }
.live-call-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.customer-identity { display: flex; align-items: center; gap: 13px; }
.customer-identity h2 { font-size: 1.1rem; margin-bottom: 5px; }
.customer-avatar { flex-shrink: 0; display: grid; place-items: center; width: 50px; height: 50px; font-size: 1.7rem; border-radius: 15px; background: #302641; }
.call-transcript { list-style: none; display: grid; gap: 18px; padding: 24px 0 0; margin: 0; }
.chat-message { width: min(92%, 650px); border: 1px solid var(--line); padding: 18px 20px; overflow-wrap: anywhere; }
.chat-message:last-child { animation: enter .25s ease-out; }
.chat-message p { color: var(--text); font-size: 1rem; white-space: pre-wrap; }
.chat-customer { justify-self: start; background: var(--raised); border-radius: 4px 16px 16px; }
.chat-rep { justify-self: end; background: #a78bfa0c; border-color: #a78bfa30; border-radius: 16px 4px 16px 16px; }
.chat-rep > .bubble-label { color: var(--accent); }
.turn-feedback { margin-top: 10px; border-top: 1px solid #a78bfa26; }
.turn-feedback li, .turn-feedback p { font-size: .78rem; color: var(--muted); }
.turn-feedback p { margin-top: 10px; }
.live-composer { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 24px; }
.voice-controls { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.voice-controls > div { min-width: 0; }
.voice-controls .btn { padding-left: 0; font-size: .78rem; }
.mic-button { display: flex; flex-direction: column; flex-shrink: 0; align-items: center; justify-content: center; gap: 12px; width: 145px; min-height: 125px; border: 1px solid #a78bfa55; border-radius: 20px; background: #a78bfa15; color: var(--accent); font-size: .8rem; font-weight: 650; }
.mic-button .icon { width: 30px; height: 30px; }
.mic-button.is-listening { color: #fb7185; border-color: #fb7185; background: #fb718515; animation: mic-pulse 1.6s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 7px #fb718511; } }
.composer-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.composer-footer .btn { min-width: 120px; }
.live-result { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 28px; scroll-margin: 180px; }
.live-result:focus { outline: none; }
.result-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.result-heading h2 { font-size: 1.4rem; }
.result-heading p { margin-top: 10px; font-size: .875rem; }
.call-score { color: var(--accent); font-size: 3rem; line-height: 1.1; letter-spacing: -.04em; font-weight: 750; flex-shrink: 0; }
.call-score > .meta { display: block; text-align: right; letter-spacing: 0; margin-top: 6px; }
.call-score-track, .dimension-track { height: 7px; border-radius: 6px; background: var(--line); overflow: hidden; }
.call-score-track { margin: 24px 0; }
.call-score-track > span { display: block; height: 100%; width: var(--score); background: linear-gradient(90deg, #8052ed, #c4b5fd); transform-origin: left; animation: score-fill .8s ease-out both; }
@keyframes score-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.dimension-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.dimension > span { display: block; font-size: .8rem; color: var(--muted); }
.dimension strong { display: block; margin: 5px 0 9px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.dimension small { color: var(--muted); font-size: .72rem; font-weight: 400; }
.dimension-track { height: 4px; }
.dimension-track > span { display: block; height: 100%; background: var(--accent); }
.study-card { margin-top: 24px; padding: 22px; background: #a78bfa08; border: 1px solid #a78bfa30; border-radius: 14px; }
.study-card h3 { font-size: 1rem; line-height: 1.5; margin-bottom: 8px; }
.study-card p { font-size: .8rem; }
.study-card .text-link { background: transparent; padding: 0; margin-top: 16px; }
@media (min-width: 480px) { .persona-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) { .dimension-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .live-setup { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 479px) {
  .live-call { padding: 20px; }
  .voice-controls { align-items: flex-start; flex-direction: column; }
  .mic-button { width: 100%; min-height: 110px; }
  .chat-message { width: 100%; padding: 16px; }
  .result-heading { align-items: flex-start; }
  .call-score { font-size: 2.5rem; }
  .study-card { padding: 16px; }
  .live-result { scroll-margin: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .script-card .script-toggle, .script-card.is-flipped .script-toggle, .script-face { transform: none !important; }
  .script-card:not(.is-flipped) .script-back, .script-card.is-flipped .script-front { visibility: hidden; }
  button:not(:disabled):active, .btn:not(:disabled):active, .nav-link:active { transform: none !important; }
}
