@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=DM+Serif+Display:ital@0;1&display=swap');

/* ─────────────────────────────────────────
   V7 DESIGN SYSTEM — matches curriculum v7
   ───────────────────────────────────────── */
:root {
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface2: #EDEAE3;
  --border: #E4E0D8;
  --border-strong: #CEC9BF;
  --text: #1A1814;
  --text-muted: #7A7268;
  --text-faint: #ADA89E;
  --green: #2E9E7A;
  --red: #D95470;
  --gold: #C4922A;
  --accent: #5B4FD9;
  --accent2: #7B6FEF;
  /* sc = session colour, changes per phase */
  --sc: #5B4FD9;
  --sc-light: #EEEAFF;
  --sc-mid: #C8C0F5;
  /* phase colours */
  --phase1:#5B4FD9; --phase1-bg:#EEEAFF; --phase1-border:#C8C0F5;
  --phase2:#2E9E7A; --phase2-bg:#E4F7F1; --phase2-border:#A8DFD0;
  --phase3:#C4922A; --phase3-bg:#FDF3E3; --phase3-border:#F0D49A;
  --phase4:#2980B9; --phase4-bg:#EBF5FB; --phase4-border:#AED6F1;
  --phase5:#D95470; --phase5-bg:#FDEAEE; --phase5-border:#F4B8C4;
  --phase6:#7B6FEF; --phase6-bg:#F0EEFF; --phase6-border:#C8C0F5;
  --phase7:#E67E22; --phase7-bg:#FEF5E7; --phase7-border:#F5CBA7;
  --phase8:#8E44AD; --phase8-bg:#F5EEF8; --phase8-border:#D2B4DE;
  --phase9:#27AE60; --phase9-bg:#E8F8F0; --phase9-border:#A9DFBF;
  --nav-h: 72px;
  --header-top: 52px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 480px;
  margin: 0 auto;
}

.screen { display: none; min-height: 100vh; flex-direction: column; padding-bottom: var(--nav-h); }
.screen.active { display: flex; }
#screen-apikeys { padding-bottom: 0; }

/* ── BOTTOM NAV — v7 frosted glass ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 480px; margin: 0 auto;
  height: var(--nav-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; flex: 1; padding: 6px 0;
  border: none; background: none; font-family: 'Nunito', sans-serif;
  transition: all 0.15s;
}
.nav-item:active { transform: scale(0.92); }
.nav-icon svg { width: 22px; height: 22px; stroke: var(--text-faint); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon svg { stroke: var(--accent); }
.nav-label { font-size: 11px; font-weight: 700; color: var(--text-faint); letter-spacing: 0.04em; }
.nav-item.active .nav-label { color: var(--accent); }

/* ── BUTTONS — v7 pill style ── */
.btn-primary {
  background: var(--sc); color: white; border: none;
  border-radius: 100px; padding: 14px 36px;
  font-size: 16px; font-weight: 900;
  font-family: 'Nunito', sans-serif; cursor: pointer;
  width: 100%; max-width: 320px;
  transition: opacity 0.15s, transform 0.1s; letter-spacing: -0.2px;
  display: block; margin: 0 auto;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.88; }

.btn-secondary {
  background: var(--surface); color: var(--text-muted);
  border: 1.5px solid var(--border-strong);
  border-radius: 100px; padding: 13px 36px;
  font-size: 15px; font-weight: 800;
  font-family: 'Nunito', sans-serif; cursor: pointer;
  width: 100%; max-width: 320px;
  transition: opacity 0.15s; display: block; margin: 12px auto 0;
}
.btn-secondary:active { opacity: 0.75; }

.back-btn { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; padding: 0; margin-bottom: 20px; display: block; }

/* ── CURRICULUM SCREEN ── */
#screen-curriculum { overflow-y: auto; padding-bottom: calc(var(--nav-h) + 20px); }

/* v7 header */
.curr-header { padding: 16px 20px 16px; }
.curr-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.curr-title { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--text); letter-spacing: -0.3px; line-height: 1.15; margin-bottom: 16px; }

/* v7 progress strip */
.curr-progress-strip { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 14px 16px 12px; margin-bottom: 6px; }
.curr-progress-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.curr-progress-num { font-size: 21px; font-weight: 900; color: var(--text); letter-spacing: -0.5px; }
.curr-progress-num span { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.curr-phase-pill { font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gold); background: #FDF3E3; border: 1px solid #F0D49A; border-radius: 100px; padding: 4px 12px; }
.curr-track { height: 5px; background: var(--border); border-radius: 100px; overflow: hidden; margin-bottom: 7px; }
.curr-fill { height: 100%; background: linear-gradient(90deg, #5B4FD9 0%, #C4922A 100%); border-radius: 100px; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); width: 0%; }
.curr-endpoints { display: flex; justify-content: space-between; }
.curr-endpoint { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.curr-rule { height: 1px; background: linear-gradient(to bottom, var(--border), transparent); margin-top: 4px; }

/* phase blocks — keep structure, v7 colours */
.phase-block { margin: 0 14px 10px; border-radius: 22px; overflow: hidden; border: 1.5px solid var(--border); background: var(--surface); }
.phase-block.ph1 { border-left: 4px solid var(--phase1); background: var(--phase1-bg); }
.phase-block.ph2 { border-left: 4px solid var(--phase2); background: var(--phase2-bg); }
.phase-block.ph3 { border-left: 4px solid var(--phase3); background: var(--phase3-bg); }
.phase-block.ph4 { border-left: 4px solid var(--phase4); background: var(--phase4-bg); }
.phase-block.ph5 { border-left: 4px solid var(--phase5); background: var(--phase5-bg); }
.phase-block.ph6 { border-left: 4px solid var(--phase6); background: var(--phase6-bg); }
.phase-block.ph7 { border-left: 4px solid var(--phase7); background: var(--phase7-bg); }
.phase-block.ph8 { border-left: 4px solid var(--phase8); background: var(--phase8-bg); }
.phase-block.ph9 { border-left: 4px solid var(--phase9); background: var(--phase9-bg); }
.phase-block.locked-block { opacity: 0.45; filter: grayscale(0.2); }
.phase-header-btn { padding: 20px 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; background: transparent; border: none; width: 100%; text-align: left; font-family: 'Nunito', sans-serif; }
.phase-icon-circle { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; background: rgba(255,255,255,0.8); }
.phase-header-text { flex: 1; min-width: 0; }
.phase-header-label { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.phase-header-tag { font-size: 11px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.phase-block.ph1 .phase-header-tag { color: var(--phase1); }
.phase-block.ph2 .phase-header-tag { color: var(--phase2); }
.phase-block.ph3 .phase-header-tag { color: var(--phase3); }
.phase-block.ph4 .phase-header-tag { color: var(--phase4); }
.phase-block.ph5 .phase-header-tag { color: var(--phase5); }
.phase-block.ph6 .phase-header-tag { color: var(--phase6); }
.phase-block.ph7 .phase-header-tag { color: var(--phase7); }
.phase-block.ph8 .phase-header-tag { color: var(--phase8); }
.phase-block.ph9 .phase-header-tag { color: var(--phase9); }
.phase-header-dot { font-size: 11px; color: var(--text-muted); }
.phase-header-progress { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.phase-header-name { font-family: 'DM Serif Display', serif; font-size: 20px; font-weight: 400; color: var(--text); line-height: 1.2; }
.phase-header-benefit { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 4px; }
.phase-chevron { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-muted); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); }
.phase-chevron svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.phase-sessions-inner { padding: 4px 14px 14px; }
.session-card { background: rgba(255,255,255,0.75); border: 1.5px solid rgba(255,255,255,0.9); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all 0.15s; margin-bottom: 8px; }
.session-card:active { transform: scale(0.98); }
.session-card.s-passed { border-color: rgba(46,158,122,0.4); background: rgba(46,158,122,0.04); }
.session-card.s-current { border-color: rgba(91,79,217,0.5); background: rgba(255,255,255,0.95); }
.session-card.s-tried { border-color: rgba(217,84,112,0.35); background: rgba(217,84,112,0.03); }
.session-card.s-locked { opacity: 0.5; cursor: not-allowed; }
.session-num { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; flex-shrink: 0; background: rgba(255,255,255,0.9); color: var(--text-muted); border: 2px solid rgba(0,0,0,0.08); }
.session-num.s-passed { background: var(--green); color: white; border-color: var(--green); }
.session-num.s-current { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 0 14px rgba(91,79,217,0.35); }
.session-info { flex: 1; min-width: 0; }
.session-info .session-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
/* session-desc defined in v7 section below */
.current-arrow { font-size: 13px; color: var(--accent); font-weight: 800; flex-shrink: 0; }

/* Burger menu */
.burger-btn { background: none; border: none; cursor: pointer; padding: 8px; display: flex; flex-direction: column; gap: 5px; z-index: 102; }
.burger-btn span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.25s; }
.burger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }
.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.menu-overlay.open { opacity: 1; pointer-events: auto; }
.menu-drawer { position: fixed; top: 0; right: 0; width: 220px; height: auto; max-height: 80vh; background: var(--surface); z-index: 101; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); padding: 56px 20px 24px; box-shadow: -4px 0 24px rgba(0,0,0,0.08); border-radius: 0 0 0 20px; }
.menu-drawer.open { transform: translateX(0); }
.menu-item { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; transition: color 0.15s; }
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { color: var(--accent); text-decoration: none; }
.menu-item-sub { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.menu-cta { display: block; text-align: center; background: var(--accent); color: white; border-radius: 100px; padding: 14px; font-size: 14px; font-weight: 800; font-family: 'Nunito', sans-serif; text-decoration: none; transition: opacity 0.2s; }
.menu-cta:hover { opacity: 0.9; text-decoration: none; color: white; }

/* ── PRACTICE SCREEN (old free-form, uses --sc) ── */
#screen-practice { background: var(--bg); }
.practice-header { padding: var(--header-top) 20px 20px; background: linear-gradient(180deg, var(--sc-light) 0%, var(--bg) 100%); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.level-chip { background: var(--sc-light); border: 1px solid var(--sc-mid); border-radius: 100px; padding: 5px 13px; font-size: 11px; font-weight: 800; color: var(--sc); white-space: nowrap; flex-shrink: 0; }
.prompt-card { margin: 0 20px 20px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 22px; padding: 24px 20px; }
.prompt-label { font-size: 11px; color: var(--sc); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; margin-bottom: 10px; }
.prompt-text { font-family: 'DM Serif Display', serif; font-size: 20px; line-height: 1.45; color: var(--text); }
.prompt-meta { display: flex; gap: 14px; margin-top: 14px; }
.meta-item { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.coaching-tip { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); line-height: 1.6; font-style: italic; }
.coaching-tip strong { color: var(--sc); font-style: normal; }
.recording-zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24px 40px; gap: 22px; }

/* ── WAVEFORM + RECORD ── */
.waveform { width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; gap: 3px; opacity: 0.4; transition: opacity 0.3s; }
.waveform.active { opacity: 1; }
.wave-bar { width: 3px; background: var(--sc); border-radius: 100px; animation: wave 1.2s ease-in-out infinite; height: 8px; }
@keyframes wave { 0%,100% { height: 8px; } 50% { height: 40px; } }
.wave-bar:nth-child(2) { animation-delay: .1s; } .wave-bar:nth-child(3) { animation-delay: .2s; } .wave-bar:nth-child(4) { animation-delay: .3s; } .wave-bar:nth-child(5) { animation-delay: .4s; } .wave-bar:nth-child(6) { animation-delay: .3s; } .wave-bar:nth-child(7) { animation-delay: .2s; } .wave-bar:nth-child(8) { animation-delay: .1s; }
.waveform:not(.active) .wave-bar { animation: none; }
.timer { font-size: 40px; font-weight: 300; color: var(--text); letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.timer.recording { color: var(--red); }
.record-btn { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #E0E0E0; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; background: white; position: relative; padding: 0; -webkit-appearance: none; }
.record-btn::after { content: ''; width: 48px; height: 48px; border-radius: 50%; background: #E53935; transition: all 0.25s; }
.record-btn::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid transparent; transition: all 0.3s; }
.record-btn.recording::after { width: 24px; height: 24px; border-radius: 6px; background: #E53935; }
.record-btn.recording { border-color: #E53935; }
.record-btn.recording::before { border-color: rgba(229,57,53,0.3); animation: pulse-ring 1.5s ease-in-out infinite; }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.record-hint { font-size: 13px; color: var(--text-muted); text-align: center; }

/* ── LESSON SCREEN (Read → Check → Talk) ── */
#screen-lesson { overflow-y: auto; padding-bottom: 40px; background: var(--bg); }
.lesson-step-bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245,243,238,0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex; align-items: center;
  min-height: 64px;
}
.lesson-step-back {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; padding: 0;
  flex-shrink: 0; font-family: 'Nunito', sans-serif;
  line-height: 1; width: 32px;
}
.lesson-steps-group {
  display: flex; align-items: center; gap: 0;
  flex: 1; justify-content: center;
}
.lesson-step-spacer { width: 32px; flex-shrink: 0; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 0 auto; width: 64px; }
.step-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); background: var(--bg); transition: all 0.3s; }
.step-icon svg { width: 14px; height: 14px; stroke: var(--text-muted); stroke-width: 2.5; fill: none; }
.step-item.active .step-icon { border-color: var(--sc); background: var(--sc); }
.step-item.active .step-icon svg { stroke: white; }
.step-item.done .step-icon { border-color: var(--sc); background: var(--sc); }
.step-item.done .step-icon svg { stroke: white; }
.step-label { font-size: 11px; font-weight: 700; color: var(--border); letter-spacing: 0.4px; text-transform: uppercase; transition: color 0.3s; }
.step-item.active .step-label { color: var(--sc); }
.step-item.done .step-label { color: var(--sc); }
.step-connector { width: 28px; height: 1.5px; background: var(--border); margin: 0 -2px; margin-bottom: 16px; transition: background 0.3s; }
.step-connector.done { background: var(--sc); }
.lesson-header { padding: 24px 20px 16px; background: linear-gradient(180deg, var(--sc-light) 0%, var(--bg) 100%); }
.lesson-title { font-family: 'DM Serif Display', serif; font-size: 22px; line-height: 1.25; color: var(--text); }
.lesson-body { padding: 0 16px; }
.lesson-content { background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 22px; margin-bottom: 14px; }
.lesson-content p { font-size: 16px; color: var(--text); line-height: 1.7; margin-bottom: 14px; }
.lesson-content p:last-child { margin-bottom: 0; }
.lesson-content .highlight-box { background: var(--sc-light); border-left: 3px solid var(--sc); border-radius: 0 12px 12px 0; padding: 14px 16px; margin: 16px 0; font-size: 14px; color: var(--text); line-height: 1.6; font-style: italic; }
.lesson-content h3 { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--text); margin-bottom: 10px; margin-top: 4px; }
.key-insight { background: var(--sc-light); border: 1px solid var(--sc-mid); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; display: flex; gap: 14px; align-items: flex-start; }
.key-insight-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.key-insight-text { font-size: 14px; color: var(--text); line-height: 1.6; }
.key-insight-text strong { color: var(--sc); font-weight: 700; }
.quiz-question { background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 22px; margin-bottom: 16px; }
.quiz-q-num { font-size: 11px; color: var(--sc); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; margin-bottom: 10px; }
.quiz-q-text { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 18px; }
.quiz-option { background: var(--surface2); border: 1.5px solid var(--border); border-radius: 12px; padding: 15px 16px; margin-bottom: 10px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text); transition: all 0.15s; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; font-family: 'Nunito', sans-serif; }
.quiz-option:active { transform: scale(0.98); }
.quiz-option.selected { border-color: var(--sc); background: var(--sc-light); }
.quiz-option.correct { border-color: var(--green); background: rgba(46,158,122,0.08); color: var(--green); }
.quiz-option.wrong { border-color: var(--red); background: rgba(217,84,112,0.06); color: var(--red); }
.quiz-option-letter { width: 26px; height: 26px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--text-muted); flex-shrink: 0; transition: all 0.15s; }
.quiz-option.selected .quiz-option-letter { background: var(--sc); color: white; }
.quiz-option.correct .quiz-option-letter { background: var(--green); color: white; }
.quiz-option.wrong .quiz-option-letter { background: var(--red); color: white; }
.quiz-feedback { margin-top: 12px; padding: 14px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.65; display: none; }
.quiz-feedback.show { display: block; }
.quiz-feedback.correct-fb { background: rgba(46,158,122,0.08); border: 1px solid rgba(46,158,122,0.25); color: var(--green); }
.quiz-feedback.wrong-fb { background: rgba(217,84,112,0.06); border: 1px solid rgba(217,84,112,0.2); color: var(--red); }
.quiz-progress { font-size: 13px; font-weight: 600; color: var(--text-muted); text-align: center; margin-bottom: 20px; }
.quiz-all-correct { background: rgba(46,158,122,0.08); border: 1px solid rgba(46,158,122,0.3); border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 16px; display: none; }
.quiz-all-correct.show { display: block; }
.talk-intro { background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 16px 18px; margin-bottom: 10px; }
.talk-intro-label { font-size: 11px; color: var(--sc); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; margin-bottom: 8px; }
.talk-prompt-text { font-family: 'DM Serif Display', serif; font-size: 18px; line-height: 1.4; color: var(--text); margin-bottom: 12px; }
.talk-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.talk-meta-item { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.talk-coach { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); line-height: 1.55; font-style: italic; }
.talk-coach strong { color: var(--sc); font-style: normal; }
.talk-recording-zone { display: flex; flex-direction: column; align-items: center; padding: 4px 24px 8px; gap: 12px; }
.lesson-nav { padding: 20px 20px 32px; display: flex; gap: 10px; }
.lesson-nav .btn-primary { flex: 1; padding: 15px; font-size: 15px; background: var(--sc); border-radius: 100px; }
.lesson-nav .btn-back { background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 100px; padding: 15px 18px; font-size: 15px; cursor: pointer; flex-shrink: 0; font-family: 'Nunito', sans-serif; color: var(--text-muted); font-weight: 800; transition: opacity 0.15s; }

/* ── FEEDBACK SCREEN ── */
#screen-feedback { background: var(--bg); overflow-y: auto; padding-bottom: calc(var(--nav-h) + 20px); }
.feedback-header { padding: var(--header-top) 20px 28px; background: linear-gradient(180deg, var(--sc-light) 0%, var(--bg) 100%); text-align: center; }
.feedback-score { width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--green) var(--pct), var(--surface2) 0); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; position: relative; }
.feedback-score::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }
.score-num { position: relative; font-family: 'DM Serif Display', serif; font-size: 30px; color: var(--text); z-index: 1; }
.feedback-title { font-family: 'DM Serif Display', serif; font-size: 24px; margin-bottom: 6px; }
.feedback-sub { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.session-context-strip { margin: 0 20px 14px; background: var(--sc-light); border: 1px solid var(--sc-mid); border-radius: 14px; padding: 12px 16px; font-size: 13px; color: var(--text-muted); line-height: 1.5; font-weight: 600; }
.score-widget { flex: 1; background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 10px 6px; text-align: center; }
.sw-icon { font-size: 16px; margin-bottom: 4px; }
.sw-val { font-size: 19px; font-weight: 800; margin-bottom: 2px; }
.sw-bar-wrap { width: 80%; height: 4px; background: var(--surface2); border-radius: 2px; margin: 4px auto; overflow: hidden; }
.sw-bar { height: 100%; width: 0%; border-radius: 2px; transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.sw-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.transcript-box { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 18px; font-size: 14px; color: var(--text-muted); line-height: 2; }
.filler { background: rgba(244,198,90,0.2); color: var(--gold); border-radius: 4px; padding: 0 3px; }
.tips-section { padding: 0 20px; }
.tips-title { font-size: 11px; color: var(--sc); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; margin-bottom: 14px; }
.tip-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 10px; display: flex; gap: 12px; align-items: flex-start; }
.tip-num { width: 28px; height: 28px; border-radius: 50%; background: var(--sc-light); border: 1px solid var(--sc-mid); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--sc); flex-shrink: 0; font-weight: 900; }
.tip-text { font-size: 15px; color: var(--text-muted); line-height: 1.65; font-weight: 600; }
.feedback-actions { padding: 8px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.feedback-actions .btn-primary, .feedback-actions .btn-secondary { margin: 0; }

/* ── DASHBOARD ── */
#screen-dashboard { overflow-y: auto; padding-bottom: calc(var(--nav-h) + 20px); }
.dash-header { padding: var(--header-top) 20px 28px; }
.dash-greeting { font-size: 11px; color: var(--text-faint); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; margin-bottom: 8px; }
.dash-title { font-family: 'DM Serif Display', serif; font-size: 28px; margin-bottom: 20px; letter-spacing: -0.3px; }
.streak-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 18px; display: flex; align-items: center; gap: 16px; }
.streak-icon { font-size: 32px; }
.streak-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; font-weight: 900; letter-spacing: 0.08em; margin-bottom: 4px; }
.streak-value { font-size: 20px; font-weight: 800; color: var(--text); }
.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 20px; }
.stat-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 16px 12px; text-align: center; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 700; }
.section-title { font-size: 11px; color: var(--text-faint); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; padding: 0 20px; margin-bottom: 14px; }
.history-list { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.history-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.history-prompt { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.history-meta { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.history-score { font-size: 22px; font-weight: 800; }
.dash-practice-btn { margin: 20px; display: flex; flex-direction: column; align-items: center; }

/* ── FREE PRACTICE ── */
#screen-free { overflow-y: auto; padding-bottom: calc(var(--nav-h) + 20px); background: var(--bg); }
.free-header { padding: var(--header-top) 20px 20px; background: linear-gradient(180deg, #FDF3E3 0%, var(--bg) 100%); }
.free-header h1 { font-family: 'DM Serif Display', serif; font-size: 28px; margin-bottom: 6px; }
.free-header p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.free-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 20px; }
.free-mode-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 18px 14px; cursor: pointer; transition: all 0.15s; text-align: center; }
.free-mode-card:active { transform: scale(0.96); }
.free-mode-card.selected { border-color: var(--accent); background: rgba(91,79,217,0.05); }
.free-mode-icon { font-size: 32px; margin-bottom: 8px; }
.free-mode-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.free-mode-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.free-prompt-area { margin: 0 16px 20px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 18px; }
.free-prompt-label { font-size: 11px; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 900; margin-bottom: 10px; }
.free-prompt-text { font-family: 'DM Serif Display', serif; font-size: 19px; line-height: 1.45; color: var(--text); margin-bottom: 14px; }
.free-recording-zone { display: flex; flex-direction: column; align-items: center; padding: 0 16px 24px; gap: 18px; }
.free-section-title { font-size: 11px; font-weight: 900; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; padding: 0 20px; margin-bottom: 8px; }

/* ── LOADING ── */
.loading-screen { display: none; position: fixed; inset: 0; background: rgba(245,243,238,0.94); align-items: center; justify-content: center; flex-direction: column; gap: 18px; z-index: 100; backdrop-filter: blur(10px); }
.loading-screen.active { display: flex; }
.spinner { width: 44px; height: 44px; border: 3px solid var(--border); border-top-color: var(--sc); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--text-muted); font-weight: 600; }

/* Utility */
.text-green { color: var(--green); } .text-gold { color: var(--gold); } .text-red { color: var(--red); } .text-accent { color: var(--accent2); }

/* ── V7 CURRICULUM CARD SYSTEM ── */
.v7-phase-list {
  padding: 14px 14px calc(var(--nav-h) + 20px);
  display: flex; flex-direction: column; gap: 10px;
}

/* Phase card */
.phase-card {
  background: var(--surface);
  border-radius: 22px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  animation: cardIn 0.35s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes cardIn { to { opacity: 1; transform: none; } }
.phase-card.state-active { border-color: var(--pc); box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
.phase-card.state-locked { background: #FAFAF8; }
.phase-accent { height: 3px; background: var(--pc); display: none; }
.state-active .phase-accent { display: block; }
.phase-body { padding: 16px 16px 0; }
.phase-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.phase-number { font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.phase-badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 100px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.badge-done { background: #EBF9F1; color: #1A7A42; border: 1px solid #A9DFBF; }
.badge-active { background: var(--pc-light); color: var(--pc); border: 1px solid var(--pc-mid); }
.badge-locked { background: #F0EEE9; color: var(--text-faint); border: 1px solid var(--border); }
.css-check { width: 12px; height: 12px; border-radius: 50%; background: #1A7A42; flex-shrink: 0; position: relative; }
.css-check::after { content:''; position: absolute; left: 2.5px; top: 5.5px; width: 7px; height: 3.5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-2px); }
.css-lock { width: 10px; height: 12px; position: relative; flex-shrink: 0; }
.css-lock::before { content:''; position: absolute; bottom: 0; left: 0; right: 0; height: 7px; background: var(--text-faint); border-radius: 2px; }
.css-lock::after { content:''; position: absolute; bottom: 5px; left: 1.5px; right: 1.5px; height: 6px; border: 2px solid var(--text-faint); border-bottom: none; border-radius: 4px 4px 0 0; }
.phase-name { font-family: 'DM Serif Display', serif; font-size: 21px; line-height: 1.15; color: var(--text); letter-spacing: -0.2px; margin-bottom: 12px; }
.state-locked .phase-name { color: var(--text-muted); }
.progress-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.prog-pill { display: flex; align-items: center; background: var(--pc-light); border: 1px solid var(--pc-mid); border-radius: 100px; padding: 3px 8px 3px 6px; gap: 5px; flex-shrink: 0; }
.state-locked .prog-pill { background: #F0EEE9; border-color: var(--border); }
.prog-pill-count { font-size: 11px; font-weight: 900; color: var(--pc); letter-spacing: -0.3px; white-space: nowrap; }
.state-locked .prog-pill-count { color: var(--text-faint); }
.dots-inline { display: flex; align-items: center; gap: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-done { background: var(--pc); }
.dot-current { background: transparent; border: 2px solid var(--pc); width: 8px; height: 8px; }
.dot-todo { background: var(--border-strong); }
.state-locked .dot-todo { background: var(--border); }
.outcomes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.outcome-item { display: flex; align-items: flex-start; gap: 10px; }
.outcome-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; background: var(--pc-light); }
.outcome-icon svg { width: 14px; height: 14px; stroke: var(--pc); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.state-locked .outcome-icon { background: #F0EEE9; }
.state-locked .outcome-icon svg { stroke: var(--text-faint); }
.outcome-text { font-size: 14px; font-weight: 700; color: var(--text-muted); line-height: 1.5; padding-top: 5px; }
.state-locked .outcome-text { color: var(--text-faint); }
.unlock-note { margin-bottom: 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); display: none; }
.state-locked .unlock-note { display: block; }

/* Sessions trigger */
.sessions-trigger { display: none; width: 100%; border: none; background: none; border-top: 1.5px solid var(--border); padding: 12px 16px; cursor: pointer; font-family: 'Nunito', sans-serif; transition: background 0.12s; }
.state-active .sessions-trigger, .state-done .sessions-trigger { display: flex; }
.sessions-trigger:active { background: var(--bg); }
.trigger-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.trigger-label { font-size: 12px; font-weight: 900; color: var(--pc); letter-spacing: 0.04em; text-transform: uppercase; }
.trigger-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--pc-light); display: flex; align-items: center; justify-content: center; }
.trigger-icon svg { width: 12px; height: 12px; stroke: var(--pc); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); }
.phase-card.open .trigger-icon svg { transform: rotate(180deg); }

/* Session list */
.phase-sessions { display: none; border-top: 1px solid var(--border); }
.phase-card.open .phase-sessions { display: block; }

/* Session row — v7 style */
.session-row { padding: 18px 16px 16px; border-bottom: 1px solid var(--border); background: #FAFAF8; cursor: pointer; transition: background 0.1s; }
.session-row:last-child { border-bottom: none; }
.session-row:active { background: #F5F3EE; }
.session-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.session-title-block { flex: 1; min-width: 0; }
.session-label { font-size: 11px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 3px; }
.session-title { font-family: 'DM Serif Display', serif; font-size: 17px; font-weight: 400; line-height: 1.25; color: var(--text); letter-spacing: -0.2px; }
.session-score-block { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.session-score { display: flex; align-items: baseline; gap: 1px; line-height: 1; }
.session-score .score-num { font-size: 16px; font-weight: 900; letter-spacing: -0.5px; position: static; font-family: 'Nunito', sans-serif; }
.session-score .score-num.zero { color: var(--text-faint); }
.session-score .score-denom { font-size: 11px; font-weight: 700; color: var(--text-faint); letter-spacing: -0.2px; }
.session-stars { font-size: 13px; letter-spacing: 1.5px; line-height: 1; }
.session-stars.earned { color: #C4922A; }
.session-stars.unearned { color: var(--border-strong); }
.session-desc { font-size: 14px; font-weight: 600; color: var(--text-muted); line-height: 1.55; margin-top: 8px; margin-bottom: 12px; padding-left: 10px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.session-desc strong { font-weight: 900; color: var(--text); }
.session-btn-row { display: flex; justify-content: center; padding-top: 4px; }
.btn-start-session { display: inline-block; padding: 14px 36px; border-radius: 14px; border: none; font-size: 15px; font-weight: 900; font-family: 'Nunito', sans-serif; color: #fff; cursor: pointer; letter-spacing: -0.1px; transition: opacity 0.15s, transform 0.1s; }
.btn-start-session:active { opacity: 0.82; transform: scale(0.97); }
.btn-redo-session { display: inline-block; padding: 13px 32px; border-radius: 14px; border: 1.5px solid var(--border-strong); font-size: 14px; font-weight: 800; font-family: 'Nunito', sans-serif; color: var(--text-muted); background: var(--surface); cursor: pointer; letter-spacing: -0.1px; transition: opacity 0.15s; }
.btn-redo-session:active { opacity: 0.7; }

/* ── COURSE OVERVIEW ── */
.course-overview { margin: 0 14px 12px; border-radius: 18px; border: 1.5px solid var(--border); background: var(--surface); overflow: hidden; }
.course-overview-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; background: none; border: none; cursor: pointer; font-family: 'Nunito', sans-serif; }
.course-overview-btn:active { background: var(--bg); }
.course-overview-left { display: flex; align-items: center; gap: 10px; }
.course-overview-icon { font-size: 18px; }
.course-overview-title { font-size: 13px; font-weight: 900; color: var(--text); letter-spacing: -0.1px; }
.course-overview-sub { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.course-overview-chevron { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); }
.course-overview-chevron svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.course-overview.open .course-overview-chevron { transform: rotate(180deg); }
.course-overview-body { display: none; padding: 0 16px 16px; }
.course-overview.open .course-overview-body { display: block; }
.co-phase { padding: 18px 0; border-bottom: 1px solid var(--border); }
.co-phase:last-child { border-bottom: none; }
.co-phase-label { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.co-phase-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.co-phase-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.co-phase-name { font-size: 15px; font-weight: 800; color: var(--text); flex: 1; }
.co-phase-difficulty { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 100px; flex-shrink: 0; }
.co-bullets { list-style: none; display: flex; flex-direction: column; gap: 5px; padding: 0; }
.co-bullets li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.co-bi { font-size: 15px; flex-shrink: 0; margin-top: 0px; }


/* ── FORMAT BADGE on session cards ── */


/* ── CONTENT CARDS (swipeable read) ── */
.content-cards-wrap { position: relative; overflow: hidden; border-radius: 16px; margin-bottom: 14px; }
.content-cards-track { display: flex; transition: transform 0.35s cubic-bezier(0.4,0,0.2,1); }
.content-card-item { min-width: 100%; padding: 24px 22px; box-sizing: border-box; }
.content-card-item .lesson-content { margin-bottom: 0; }
.cards-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0; }
.cards-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all 0.2s; }
.cards-dot.active { background: var(--sc); width: 18px; border-radius: 3px; }
.cards-nav { display: flex; justify-content: space-between; padding: 0 16px; }
.cards-nav-btn { background: none; border: 1.5px solid var(--border); border-radius: 100px; padding: 8px 20px; font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; font-family: 'Nunito', sans-serif; transition: all 0.15s; }
.cards-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.cards-nav-btn.primary { background: var(--sc); color: white; border-color: var(--sc); }

/* ── REFRAME EXERCISE ── */
.reframe-wrap { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 20px; margin: 0 16px 14px; }
.reframe-label { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sc); margin-bottom: 8px; }
.reframe-prompt { font-size: 14px; color: var(--text); line-height: 1.6; margin-bottom: 12px; }
.reframe-input { width: 100%; min-height: 80px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-family: 'Nunito', sans-serif; color: var(--text); resize: vertical; outline: none; }
.reframe-input:focus { border-color: var(--sc); }
.reframe-response { margin-top: 12px; padding: 14px 16px; background: var(--sc-light); border-radius: 12px; font-size: 13px; color: var(--text); line-height: 1.6; display: none; }

/* ── SCENARIO PICK ── */
.pick-options { display: flex; flex-direction: column; gap: 8px; margin: 0 16px 16px; }
.pick-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; transition: all 0.15s; font-family: 'Nunito', sans-serif; }
.pick-option:active { transform: scale(0.98); }
.pick-option.selected { border-color: var(--sc); background: var(--sc-light); }
.pick-option-letter { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--text-muted); flex-shrink: 0; }
.pick-option.selected .pick-option-letter { background: var(--sc); color: white; }
.pick-option-text { font-size: 14px; font-weight: 700; color: var(--text); }

