:root {
  --navy-950: #07152f;
  --navy-900: #0b1f4b;
  --navy-800: #12346f;
  --blue-600: #155eef;
  --blue-700: #1249bd;
  --cyan-400: #22d3ee;
  --yellow-300: #ffe34d;
  --lime-300: #b7f36b;
  --canvas: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --ink: #101828;
  --muted: #5f6b7b;
  --border: #d9e1eb;
  --success: #087443;
  --danger: #b42318;
  --shadow-sm: 0 8px 30px rgba(7, 21, 47, .07);
  --shadow-lg: 0 32px 90px rgba(7, 21, 47, .17);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  color-scheme: light;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 211, 238, .08), transparent 28rem),
    var(--canvas);
}
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid #6e97ff;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 11px 14px;
  background: var(--surface);
  color: var(--navy-900);
  border-radius: 10px;
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; }
.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 10px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(203, 214, 226, .78);
  background: rgba(244, 247, 251, .84);
  backdrop-filter: blur(22px) saturate(130%);
}
.brand {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  color: var(--navy-900);
  text-decoration: none;
}
.brand img { border-radius: 13px; box-shadow: 0 7px 22px rgba(21, 94, 239, .16); }
.brand > span, .footer-brand > span { display: flex; flex-direction: column; }
.brand strong { font-size: 20px; letter-spacing: -.6px; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }

.primary-nav {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(203, 214, 226, .7);
  border-radius: 15px;
  background: rgba(235, 241, 248, .86);
}
.nav-item {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}
.nav-item.is-active {
  background: var(--surface);
  color: var(--navy-900);
  box-shadow: 0 3px 12px rgba(7, 21, 47, .08);
}
.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, .8);
  color: var(--navy-900);
  cursor: pointer;
}
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.offline-banner {
  padding: 10px 20px;
  background: #fff4d8;
  color: #714c00;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.audio-error-banner, .storage-error-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid #f2b8b5;
  background: #fff1f0;
  color: #7a271a;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}
.audio-error-banner button, .storage-error-banner button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e38b86;
  border-radius: 11px;
  background: #fff;
  color: #8f231b;
  font-weight: 850;
  cursor: pointer;
}
.storage-error-banner {
  border-bottom-color: #f0cd77;
  background: #fff8e6;
  color: #664700;
}
.storage-error-banner button { border-color: #d8af4d; color: #664700; }

main { width: min(1240px, 100%); margin: 0 auto; padding: 44px clamp(18px, 4vw, 48px) 96px; }
.view { animation: view-in .25s ease both; }
@keyframes view-in { from { opacity: .2; transform: translateY(8px); } }
.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan-400);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1.35px;
}
.eyebrow-blue { color: var(--blue-600); }
.eyebrow-cyan { color: var(--cyan-400); }

.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  min-height: 610px;
  align-items: center;
  gap: clamp(34px, 6vw, 88px);
  overflow: hidden;
  padding: clamp(42px, 7vw, 88px);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 34px;
  background:
    radial-gradient(circle at 89% 16%, rgba(34, 211, 238, .23), transparent 28%),
    linear-gradient(145deg, var(--navy-950), #0b2f70 66%, #0d4673);
  box-shadow: var(--shadow-lg);
}
.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, .08), transparent 26%, transparent 72%, rgba(255, 255, 255, .05));
}
.hero-copy, .speech-stage { position: relative; z-index: 1; }
.hero-copy h1 {
  max-width: 740px;
  margin: 0;
  color: #fff;
  font-size: clamp(46px, 5.4vw, 76px);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: -3.5px;
  word-break: keep-all;
}
.hero-copy h1 span { color: #bdeef8; }
.hero-lead {
  max-width: 660px;
  margin: 24px 0 0;
  color: #dbe8fb;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 34px; }
.privacy-line { display: flex; gap: 8px; margin: 24px 0 0; color: #afc5e3; font-size: 12px; line-height: 1.6; }
.privacy-line span { color: #59e4bb; font-size: 9px; transform: translateY(4px); }

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button-primary { background: var(--blue-600); color: #fff; box-shadow: 0 10px 26px rgba(21, 94, 239, .22); }
.button-primary:hover:not(:disabled) { background: var(--blue-700); }
.hero-stage .button-primary { background: var(--yellow-300); color: var(--navy-950); box-shadow: none; }
.hero-stage .button-primary:hover { background: #ffea72; }
.button-secondary { background: #eaf1ff; color: var(--blue-700); border-color: #d7e4ff; }
.button-ghost { background: var(--surface); color: var(--navy-900); border-color: var(--border); }
.button-danger { background: #fff3f1; color: var(--danger); border-color: #ffd1ca; }
.text-button { min-height: 46px; padding: 0 4px; border: 0; background: transparent; color: #d9eaff; font-weight: 750; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; }

.speech-stage {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 26px;
  background: rgba(8, 28, 63, .62);
  box-shadow: inset 0 1px rgba(255, 255, 255, .16), 0 28px 60px rgba(0, 0, 0, .2);
  backdrop-filter: blur(18px);
  transform: perspective(900px) rotateY(-4deg) rotateX(2deg);
}
.speech-stage-top { display: flex; justify-content: space-between; color: #8debf3; font-size: 10px; font-weight: 850; letter-spacing: 1px; }
.speech-sample { margin: 30px 0; color: #f8fbff; font-size: clamp(23px, 2.2vw, 34px); line-height: 1.72; letter-spacing: -.45px; }
.speech-sample .soft { color: #a8b8ce; }
.speech-sample strong { font-weight: 900; }
.speech-sample i { margin: 0 4px; color: #64dce9; font-style: normal; font-weight: 900; }
.speech-sample mark { padding: 0 3px; border-radius: 5px; background: var(--yellow-300); color: var(--navy-950); font-weight: 900; }
.speech-sample mark.fall { background: var(--lime-300); }
.speech-sample .linked { text-decoration: underline; text-decoration-color: #74e8f2; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 7px; }
.legend span { padding: 6px 9px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; background: rgba(255, 255, 255, .07); color: #d8e6f8; font-size: 11px; }
.legend .legend-rise { color: #ffeb82; }
.legend .legend-fall { color: #c8fa8e; }
.audio-chip {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  margin-top: 23px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.play-icon { color: var(--yellow-300); font-size: 11px; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 18px; margin-top: 20px; }
.daily-path {
  margin-top: 20px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.daily-path-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.daily-path-head h2 { max-width: 720px; margin: 0; color: var(--navy-900); font-size: clamp(26px, 3.2vw, 40px); line-height: 1.2; letter-spacing: -1.2px; }
.habit-proof { flex: 0 0 auto; text-align: right; }
.habit-proof strong { display: block; color: var(--navy-900); font-size: 30px; letter-spacing: -1px; }
.habit-proof span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.path-stations { position: relative; display: grid; margin-top: 28px; }
.path-stations::before { content: ""; position: absolute; top: 30px; bottom: 30px; left: 27px; width: 1px; background: #cfdaea; }
.path-station { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 92px; padding: 15px 0; }
.path-station + .path-station { border-top: 1px solid #e8edf3; }
.path-number { z-index: 1; display: grid; width: 56px; height: 56px; place-items: center; border: 1px solid #b7caf0; border-radius: 50%; background: #edf3ff; color: var(--blue-700); font-size: 12px; font-weight: 900; }
.path-station.is-done .path-number { border-color: #9ed7ba; background: #effbf4; color: var(--success); }
.path-station strong { color: var(--navy-900); font-size: 18px; }
.path-station p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.lesson-brief, .next-action {
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.next-action { background: var(--navy-900); color: #fff; border-color: transparent; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.lesson-brief h2, .next-action h2 { max-width: 700px; margin: 0; color: var(--navy-900); font-size: clamp(26px, 3vw, 38px); line-height: 1.25; letter-spacing: -1.2px; word-break: keep-all; }
.next-action h2 { color: #fff; font-size: clamp(25px, 2.5vw, 34px); }
.lesson-brief > p, .next-action > p { color: var(--muted); line-height: 1.7; }
.next-action > p { color: #b8c9df; }
.duration-label { flex: 0 0 auto; padding: 8px 11px; border-radius: 10px; background: #eef4ff; color: var(--blue-700); font-size: 13px; font-weight: 850; }
.lesson-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px 0; border-block: 1px solid #e6ebf1; }
.lesson-facts div { padding: 17px 14px 17px 0; }
.lesson-facts div + div { padding-left: 18px; border-left: 1px solid #e6ebf1; }
.lesson-facts dt { color: var(--muted); font-size: 11px; }
.lesson-facts dd { margin: 5px 0 0; color: var(--navy-900); font-weight: 850; }
.actual-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin-top: 30px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; background: rgba(255, 255, 255, .12); }
.actual-metrics div { padding: 18px; background: rgba(3, 15, 35, .56); }
.actual-metrics strong { display: block; font-size: 25px; }
.actual-metrics span { display: block; margin-top: 3px; color: #9fb3cf; font-size: 11px; }
.principle-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; border-block: 1px solid var(--border); }
.principle-strip > div { position: relative; padding: 32px clamp(18px, 3vw, 34px); }
.principle-strip > div + div::before { content: ""; position: absolute; inset: 24px auto 24px 0; width: 1px; background: var(--border); }
.principle-strip span { color: var(--blue-600); font-size: 11px; font-weight: 850; }
.principle-strip strong { display: block; margin-top: 8px; color: var(--navy-900); font-size: 19px; }
.principle-strip p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.lesson-view { width: 100%; margin-inline: 0; }
.lesson-header { display: grid; grid-template-columns: 150px 1fr 150px; align-items: end; gap: 24px; }
.lesson-header h2 { margin: 0; color: var(--navy-900); font-size: clamp(28px, 3.2vw, 46px); line-height: 1.18; letter-spacing: -1.5px; word-break: keep-all; }
.back-button { min-height: 44px; width: fit-content; border: 0; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.lesson-time { justify-self: end; padding: 9px 11px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 800; }
.lesson-progress { overflow: hidden; height: 4px; margin: 25px 0; border-radius: 5px; background: #dae2ec; }
.lesson-progress span { display: block; width: 12.5%; height: 100%; border-radius: inherit; background: var(--blue-600); transition: width .25s ease; }
.lesson-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 280px; align-items: start; gap: 18px; }
.lesson-rail, .lesson-aside {
  position: sticky;
  top: 100px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}
.rail-step { display: grid; grid-template-columns: 30px 1fr; min-height: 54px; width: 100%; align-items: center; gap: 8px; padding: 7px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.rail-step span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--border); border-radius: 9px; font-size: 11px; font-weight: 850; }
.rail-step strong { font-size: 13px; }
.rail-step.is-active { background: #eaf1ff; color: var(--blue-700); }
.rail-step.is-active span { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.rail-step.is-complete span { border-color: #a6dfc2; color: var(--success); }
.lesson-workspace { min-height: 610px; padding: clamp(24px, 4vw, 44px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.workspace-head { margin-bottom: 30px; }
.workspace-head h2 { max-width: 800px; margin: 0; color: var(--navy-900); font-size: clamp(30px, 3.3vw, 46px); line-height: 1.2; letter-spacing: -1.6px; word-break: keep-all; }
.workspace-head > p:not(.eyebrow) { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.prompt-card { padding: 24px; border-radius: 18px; background: #eff4fb; }
.prompt-card strong { display: block; color: var(--navy-900); font-size: clamp(22px, 2.5vw, 32px); line-height: 1.5; letter-spacing: -.6px; word-break: keep-all; }
.prompt-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.65; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.option-button { min-height: 58px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--navy-900); text-align: left; font-weight: 750; cursor: pointer; }
.option-button:hover, .option-button.is-selected { border-color: #9ebcff; background: #edf3ff; }
.audio-console { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; padding: 22px; border: 1px solid #dbe5f2; border-radius: 18px; background: #f7faff; }
.audio-main { width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--blue-600); color: #fff; font-weight: 900; cursor: pointer; }
.audio-console strong { color: var(--navy-900); }
.audio-console p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.speed-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.speed-button, .sentence-tab { min-height: 42px; padding: 0 13px; border: 1px solid var(--border); border-radius: 11px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.speed-button.is-active, .sentence-tab.is-active { border-color: var(--blue-600); background: #eaf1ff; color: var(--blue-700); }
.script-list { display: grid; gap: 12px; }
.script-sentence { padding: 20px; border: 1px solid var(--border); border-radius: 16px; }
.script-sentence p { margin: 0; color: var(--navy-900); font-size: 20px; line-height: 1.65; }
.script-sentence .ko { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e6ebf1; color: var(--muted); font-size: 15px; }
.reveal-button { min-height: 42px; margin-top: 12px; padding: 0 13px; border: 0; border-radius: 10px; background: #edf3ff; color: var(--blue-700); font-size: 12px; font-weight: 800; cursor: pointer; }
.sentence-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.prosody-line { margin: 26px 0; color: var(--navy-900); font-size: clamp(26px, 3.4vw, 43px); line-height: 1.72; letter-spacing: -.8px; }
.prosody-line .reduced { color: #818da0; }
.prosody-line .stress { font-weight: 950; }
.prosody-line .rise, .prosody-line .fall { padding: 0 3px; border-radius: 5px; color: var(--navy-950); font-weight: 900; }
.prosody-line .rise { background: var(--yellow-300); }
.prosody-line .fall { background: var(--lime-300); }
.prosody-line .boundary { margin: 0 5px; color: var(--blue-600); font-weight: 900; }
.prosody-line .linked { text-decoration: underline; text-decoration-color: var(--cyan-400); text-underline-offset: 6px; }
.prosody-line.hide-stress .stress { font-weight: inherit; }
.prosody-line.hide-intonation .rise, .prosody-line.hide-intonation .fall { padding-inline: 0; background: transparent; }
.prosody-line.hide-boundary .boundary { display: none; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.toggle-control { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); font-size: 12px; font-weight: 800; }
.toggle-control input { width: 17px; height: 17px; accent-color: var(--blue-600); }
.expression-grid { display: grid; gap: 10px; }
.expression-card { padding: 18px 0; border-bottom: 1px solid #e5eaf0; }
.expression-card:first-child { padding-top: 0; }
.expression-card strong { color: var(--navy-900); font-size: 20px; }
.expression-card span { display: block; margin-top: 4px; color: var(--blue-700); font-weight: 750; }
.expression-card p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; }
.recorder { margin-top: 22px; padding: 22px; border: 1px solid #d4e1f2; border-radius: 18px; background: #f2f6fc; }
.record-status { display: flex; align-items: center; gap: 10px; color: var(--navy-900); }
.record-status::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #aab5c3; }
.recorder.is-recording .record-status::before { background: #e5484d; box-shadow: 0 0 0 7px rgba(229, 72, 77, .12); }
.record-status time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.record-helper { margin: 10px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.record-actions, .compare-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.audio-playback { width: 100%; margin-top: 16px; }
.quality-note { margin: 12px 0 0; color: var(--success); font-size: 12px; font-weight: 750; }
.record-error { margin: 12px 0 0; padding: 12px 14px; border: 1px solid #f2b8b5; border-radius: 12px; background: #fff1f0; color: #8f231b; font-size: 13px; font-weight: 750; line-height: 1.55; }
.hint-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hint-box, .answer-box, .coach-box { margin-top: 16px; padding: 18px; border-radius: 15px; line-height: 1.65; }
.hint-box { background: #edf4ff; color: var(--blue-700); }
.answer-box { border: 1px solid #b9e5cd; background: #effbf4; color: #0b5435; }
.answer-box strong { display: block; font-size: 20px; }
.answer-box p { margin: 7px 0 0; }
.self-check { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.conversation { display: grid; gap: 12px; }
.conversation-turn { max-width: 82%; padding: 14px 16px; border-radius: 16px; line-height: 1.6; }
.conversation-turn.coach { background: #edf3ff; color: var(--navy-900); }
.conversation-turn.user { margin-left: auto; background: var(--navy-900); color: #fff; }
.conversation-actions { display: flex; gap: 8px; margin-top: 18px; }
.transfer-prompt { padding: clamp(22px, 4vw, 34px); border: 1px solid #d5e1f1; border-radius: 20px; background: linear-gradient(135deg, #f4f8ff, #eefcff); }
.transfer-prompt .ko { margin: 0; color: var(--navy-900); font-size: clamp(24px, 3vw, 37px); font-weight: 800; line-height: 1.45; word-break: keep-all; }
.transfer-prompt .en { margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.timer-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 16px 18px; border-radius: 15px; background: var(--navy-900); color: #fff; }
.timer-box strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.coach-box { background: #fff8d8; color: #5f4a00; }
.lesson-aside h3 { margin: 5px 6px 12px; color: var(--navy-900); font-size: 16px; }
.aside-card { padding: 14px; border-radius: 14px; background: #eff4fa; }
.aside-card + .aside-card { margin-top: 9px; }
.aside-card strong { color: var(--navy-900); font-size: 13px; }
.aside-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.lesson-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-left: 208px; padding-right: 298px; }

.page-heading { max-width: 850px; margin: 20px 0 38px; }
.page-heading h2 { margin: 0; color: var(--navy-900); font-size: clamp(42px, 5.4vw, 70px); line-height: 1.08; letter-spacing: -3px; word-break: keep-all; }
.page-heading > p:not(.eyebrow) { max-width: 680px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.lab-heading { margin-bottom: 24px; }
.lab-recommendation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius-lg);
  background: var(--navy-900);
  color: #fff;
}
.lab-recommendation h3 { margin: 0; font-size: clamp(28px, 3.5vw, 46px); line-height: 1.15; letter-spacing: -1.5px; }
.lab-recommendation p:not(.eyebrow) { max-width: 660px; margin: 10px 0 0; color: #c3d2e6; line-height: 1.65; }
.lab-recommendation > div:last-child { display: flex; align-items: flex-end; flex-direction: column; gap: 12px; }
.lab-recommendation span { color: #9fb6d3; font-size: 12px; font-weight: 800; }
.lab-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; gap: 18px; margin-top: 18px; }
.lab-filters, .template-library { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.lab-filters { position: sticky; top: 96px; display: grid; gap: 17px; padding: 22px; }
.lab-filters h3, .library-head h3 { margin: 0; color: var(--navy-900); font-size: 23px; }
.lab-filters label, .studio-builder label, .studio-output > label { display: grid; gap: 7px; color: var(--navy-900); font-size: 12px; font-weight: 850; }
.lab-filters select, .studio-builder select, .studio-builder input { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px; background: #fff; color: var(--navy-900); }
.template-library { min-width: 0; overflow: hidden; }
.library-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 24px; border-bottom: 1px solid var(--border); }
.library-head > p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.template-list { display: grid; }
.template-topic-group + .template-topic-group { border-top: 1px solid var(--border); }
.template-topic-group > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 18px; padding: 22px 24px 12px; background: #fbfdff; }
.template-topic-group > header .eyebrow { grid-column: 1 / -1; margin: 0; }
.template-topic-group > header h4 { margin: 0; color: var(--navy-900); font-size: 18px; }
.template-topic-group > header span { color: var(--muted); font-size: 11px; font-weight: 800; }
.template-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(190px, .8fr) auto; align-items: center; gap: 22px; padding: 22px 24px; }
.template-topic-group .template-row + .template-row { border-top: 1px solid #e8edf3; }
.template-row-main > p { margin: 0; color: var(--blue-700); font-size: 11px; font-weight: 850; }
.template-row-main h4 { margin: 6px 0 0; color: var(--navy-900); font-size: 20px; }
.template-row-main > span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.template-row-result { padding-left: 20px; border-left: 1px solid var(--border); }
.template-row-result small { display: block; color: var(--muted); font-size: 10px; }
.template-row-result strong { display: block; margin-top: 5px; color: var(--navy-900); font-size: 13px; line-height: 1.5; }
.template-row-actions { display: grid; justify-items: stretch; gap: 4px; }
.template-delete { min-height: 44px; border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 800; cursor: pointer; }
.empty-state.compact { margin: 22px; box-shadow: none; }
.empty-state.compact h2, .empty-state.compact h4 { margin: 0; color: var(--navy-900); font-size: 24px; }
.inline-empty { margin: 0; padding: 18px; border: 1px dashed var(--border); border-radius: 14px; background: #f8fafc; }
.mistake-summary { margin-bottom: 16px; background: #fbfdff; }
.mistake-row .review-day { background: #e8fbff; color: #0f6d7c; }

.template-studio { margin-top: 22px; padding: clamp(26px, 4vw, 42px); border-radius: var(--radius-lg); background: var(--navy-900); color: #fff; }
.studio-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr); gap: 36px; }
.studio-head h2 { max-width: 700px; margin: 0; font-size: clamp(30px, 4vw, 50px); line-height: 1.14; letter-spacing: -1.7px; word-break: keep-all; }
.studio-head > p { margin: 0; color: #b8c9df; line-height: 1.7; }
.studio-journey { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 28px 0 0; padding: 1px; border-radius: 14px; background: rgba(255, 255, 255, .16); list-style: none; }
.studio-journey li { display: flex; min-height: 66px; align-items: center; gap: 11px; padding: 13px 16px; background: #0a2448; color: #dbe7f7; }
.studio-journey span, .handoff-number { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--cyan-400); color: #03203c; font-size: 12px; font-weight: 950; }
.studio-recovery-note { margin: 0; padding: 12px 14px; border: 1px solid rgba(59, 169, 255, .34); border-radius: 12px; background: rgba(10, 56, 99, .48); color: #cbdcf0; font-size: 13px; line-height: 1.55; }
.studio-recovery-note strong { color: #fff; }
.studio-journey strong { font-size: 13px; line-height: 1.4; }
.studio-grid { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.28fr); gap: 28px; margin-top: 28px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, .14); }
.studio-builder { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 16px; }
.studio-builder label { color: #dbe7f7; }
.studio-builder .studio-topic, .studio-builder .button, .interest-fieldset, .history-choice, .history-preview { grid-column: 1 / -1; }
.studio-topic span { color: #8fa5c1; font-weight: 500; }
.interest-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.interest-fieldset legend { color: #fff; font-size: 14px; font-weight: 900; }
.interest-fieldset > p { margin: 6px 0 12px; color: #9fb3cd; font-size: 12px; line-height: 1.55; }
.interest-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.studio-builder .interest-options label { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; background: rgba(255, 255, 255, .05); color: #e8f0fb; cursor: pointer; }
.studio-builder .interest-options input, .studio-builder .history-choice input { width: 18px; min-height: 18px; flex: 0 0 auto; accent-color: var(--cyan-400); }
.studio-builder .interest-options label:has(input:checked) { border-color: #61ddec; background: rgba(59, 203, 222, .14); }
.studio-builder .history-choice { display: flex; min-height: 44px; align-items: center; gap: 9px; padding-top: 4px; cursor: pointer; }
.history-preview { display: grid; gap: 11px; padding: 15px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 13px; background: #071a37; color: #dbe7f7; }
.history-preview p { margin: 0; }
.history-preview p strong, .history-preview p span { display: block; }
.history-preview p strong, .history-retry > strong { margin-bottom: 3px; color: #8fa5c1; font-size: 10px; letter-spacing: .4px; }
.history-preview p span { color: #f0f6ff; font-size: 12px; line-height: 1.55; }
.history-summary-row { display: grid; grid-template-columns: .7fr 1.3fr; gap: 12px; }
.history-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.history-metrics span, .history-retry span { padding: 5px 7px; border-radius: 7px; background: rgba(255, 255, 255, .08); color: #cfe0f4; font-size: 10px; }
.history-preview details { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 9px; }
.history-preview summary { display: flex; min-height: 44px; align-items: center; color: #bcd0e7; font-size: 11px; font-weight: 800; cursor: pointer; }
.history-preview ul { display: grid; gap: 5px; margin: 8px 0 0; padding-left: 18px; color: #dbe7f7; font-size: 11px; line-height: 1.5; }
.history-retry > div { display: flex; flex-wrap: wrap; gap: 5px; }
.history-preview small { color: #829ab8; font-size: 10px; line-height: 1.5; }
.history-excluded { color: #a9bdd5; font-size: 12px; }
.studio-output { display: grid; gap: 10px; min-width: 0; }
.studio-output > label { color: #dbe7f7; }
.studio-output textarea { width: 100%; resize: vertical; padding: 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 13px; background: #071a37; color: #edf5ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6; }
.handoff-step { display: flex; align-items: flex-start; gap: 12px; margin-top: 4px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .13); }
.handoff-step:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.handoff-number { margin: 1px 0 0; }
.handoff-step label { color: #fff; font-size: 14px; font-weight: 900; }
.handoff-step p:not(.handoff-number) { margin: 5px 0 0; color: #9fb3cd; font-size: 12px; line-height: 1.55; }
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-safety-note { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #efd8a5; border-radius: 12px; background: #fffaf0; color: #5f4a1f; font-size: 13px; line-height: 1.55; }
.studio-safety-note strong { color: #3f2f0f; }
.template-validation { min-height: 46px; padding: 12px 14px; border-radius: 11px; color: #c7d6e9; font-size: 13px; line-height: 1.55; }
.template-validation:empty { min-height: 0; padding: 0; }
.template-validation.is-success { background: #dff7e9; color: #0a5a36; }
.template-validation.is-error { background: #fff1f0; color: #8f231b; }
.plan-validation-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.plan-validation-meta div { padding: 9px 10px; border: 1px solid rgba(108, 159, 211, .22); border-radius: 9px; background: rgba(7, 31, 58, .42); }
.plan-validation-meta dt { color: #8fa8c4; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.plan-validation-meta dd { margin: 3px 0 0; color: #e7f1fb; font-size: 11px; font-weight: 800; overflow-wrap: anywhere; }
.plan-import-history { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
.plan-import-history h3 { margin: 0 0 9px; color: #dce9f7; font-size: 13px; }
#plan-import-history-list { display: grid; gap: 7px; }
.plan-import-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 11px; border-radius: 9px; background: rgba(255, 255, 255, .055); }
.plan-import-item strong { color: #f4f8fc; font-size: 12px; }
.plan-import-item span, .plan-import-item small, .plan-import-empty { color: #9fb3cd; font-size: 10px; }
.plan-import-item small { grid-column: 1 / -1; overflow-wrap: anywhere; }
.template-preview { padding: 20px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; background: rgba(255, 255, 255, .08); }
.template-preview p { color: #c4d3e6; line-height: 1.6; }
.template-preview h3 { margin: 6px 0; font-size: 24px; }
.plan-preview-head > p, .plan-preview-topic header p { margin: 0; color: #66d9e8; font-size: 10px; font-weight: 900; letter-spacing: .8px; }
.plan-preview-head > span { display: block; color: #c4d3e6; font-size: 13px; line-height: 1.55; }
.plan-preview-topics { margin: 18px -20px 20px; border-top: 1px solid rgba(255, 255, 255, .14); }
.plan-preview-topic { padding: 18px 20px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.plan-preview-topic > header { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.plan-preview-topic header h3 { margin: 4px 0 0; font-size: 20px; }
.plan-preview-topic header > span { color: #92a9c5; font-size: 10px; font-weight: 800; }
.plan-preview-topic > p { margin: 8px 0 12px; font-size: 12px; }
.plan-preview-topic article { padding: 13px 0; }
.plan-preview-topic article + article { border-top: 1px dashed rgba(255, 255, 255, .15); }
.plan-preview-topic article p { margin: 0; color: #66d9e8; font-size: 10px; font-weight: 850; }
.plan-preview-topic article h4 { margin: 5px 0; color: #fff; font-size: 15px; }
.plan-preview-topic article > span, .plan-preview-topic article small { display: block; color: #c4d3e6; font-size: 11px; line-height: 1.5; }
.plan-preview-topic article small { margin-top: 5px; color: #8fa6c2; }
.template-preview dl, .practice-scene dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border-radius: 12px; background: rgba(255, 255, 255, .14); }
.template-preview dl div, .practice-scene dl div { padding: 14px; background: rgba(3, 15, 35, .6); }
.template-preview dt, .practice-scene dt { color: #93a8c3; font-size: 10px; }
.template-preview dd, .practice-scene dd { margin: 5px 0 0; color: #fff; font-size: 13px; line-height: 1.5; }

.practice-modal { width: min(820px, calc(100vw - 28px)); }
.practice-shell { min-height: min(720px, calc(100dvh - 32px)); }
.practice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.practice-head p { margin: 0 0 6px; color: var(--blue-700); font-size: 11px; font-weight: 850; }
.practice-head h2 { margin: 0; color: var(--navy-900); font-size: clamp(27px, 4vw, 40px); }
.practice-progress { overflow: hidden; height: 4px; margin: 22px 0 30px; border-radius: 4px; background: #dfe6ef; }
.practice-progress span { display: block; height: 100%; border-radius: inherit; background: var(--blue-600); transition: width .2s ease; }
.practice-body { min-height: 410px; }
.practice-scene, .practice-stage { padding: clamp(22px, 4vw, 34px); border-radius: 20px; background: var(--navy-900); color: #fff; }
.practice-scene h3, .practice-stage h3 { margin: 0; font-size: clamp(26px, 3.7vw, 40px); line-height: 1.3; letter-spacing: -1px; word-break: keep-all; }
.practice-scene > p:last-child, .practice-instruction, .real-world-note { color: #bacbe0; line-height: 1.65; }
.warmup-list { display: grid; gap: 12px; padding-left: 22px; font-size: 18px; line-height: 1.6; }
.coach-line { padding: 22px; border-radius: 16px; background: #fff; color: var(--navy-900); }
.coach-line span, .learner-cue span { display: block; margin-bottom: 8px; color: var(--blue-700); font-size: 11px; font-weight: 850; }
.coach-line strong { font-size: clamp(21px, 3vw, 30px); line-height: 1.5; }
.learner-cue { margin-top: 14px; padding: 18px 22px; border: 1px solid rgba(255, 255, 255, .17); border-radius: 16px; }
.learner-cue span { color: #75e6f5; }
.learner-cue p { margin: 0; font-size: 18px; line-height: 1.6; }
.answer-detail, .speech-detail { margin-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 16px; }
.answer-detail summary, .speech-detail summary { min-height: 44px; color: #d6e4f5; font-weight: 800; cursor: pointer; }
.answer-detail p { color: #fff; font-size: 20px; line-height: 1.6; }
.speech-map { display: grid; gap: 12px; margin-top: 10px; }
.speech-map-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.speech-map-legend span { padding: 5px 7px; border-radius: 7px; background: rgba(255, 255, 255, .09); color: #bdd0e7; font-size: 10px; }
.speech-groups { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.speech-group { min-width: min(270px, 75vw); flex: 1 0 210px; padding: 14px; border: 1px solid rgba(255, 255, 255, .17); border-top-width: 4px; border-radius: 12px; background: #0a2448; }
.speech-group.pitch-rise, .speech-group.pitch-high { border-top-color: #61ddec; }
.speech-group.pitch-fall, .speech-group.pitch-low { border-top-color: #ffca65; }
.speech-group.pitch-mid { border-top-color: #8da5ff; }
.speech-group > p { margin: 0; color: #fff; font-size: 17px; font-weight: 750; line-height: 1.55; }
.speech-group.length-long > p { letter-spacing: .3px; }
.speech-group-cues, .stress-words { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.speech-group-cues span, .stress-words span { padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #c7d8eb; font-size: 9px; }
.stress-words strong { width: 100%; color: #8fa5c1; font-size: 9px; }
.letter-cues { display: grid; gap: 7px; margin: 11px 0 0; padding: 0; list-style: none; }
.letter-cues li { display: grid; grid-template-columns: minmax(76px, auto) 1fr; align-items: center; gap: 8px; padding-top: 7px; border-top: 1px dashed rgba(255, 255, 255, .13); color: #aec2da; font-size: 9px; line-height: 1.4; }
.letter-word { color: #fff; font-size: 13px; font-weight: 800; }
.letter-word mark { padding: 1px 2px; border-radius: 3px; background: #ffdb75; color: #302100; }
.speech-boundary { align-self: center; color: #7891af; font-size: 19px; font-weight: 900; }
.speech-map-note { margin: 0; color: #8fa5c1; font-size: 10px; line-height: 1.55; }
.target-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.target-strip span { padding: 8px 10px; border-radius: 9px; background: #fff8d8; color: #5f4a00; font-size: 12px; font-weight: 850; }
.practice-self-check { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); }
.practice-self-check p { margin: 0; font-weight: 800; }
.practice-self-check > div { display: flex; gap: 8px; }
.practice-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.empty-state, .review-summary, .progress-grid > article, .progress-note {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.empty-state h2, .review-summary h2, .progress-note h2 { margin: 0; color: var(--navy-900); font-size: clamp(25px, 3vw, 36px); }
.empty-state p, .review-summary p, .progress-note p { color: var(--muted); line-height: 1.7; }
.review-list { display: grid; gap: 10px; margin-top: 18px; }
.review-row { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 16px; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.review-day { display: grid; min-height: 54px; place-items: center; border-radius: 13px; background: #edf3ff; color: var(--blue-700); font-weight: 900; }
.review-row strong { color: var(--navy-900); }
.review-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.review-row.is-complete { opacity: .65; }
.progress-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.progress-grid strong { display: block; color: var(--navy-900); font-size: clamp(30px, 4vw, 48px); letter-spacing: -1.5px; }
.progress-grid span { display: block; margin-top: 6px; color: var(--muted); }
.progress-note { margin-top: 16px; background: var(--navy-900); border-color: transparent; }
.progress-note h2 { color: #fff; }
.progress-note p { color: #c2d2e7; }

.site-footer {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 1.4fr) 1fr;
  align-items: center;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 64px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 9px; color: var(--navy-900); }
.footer-brand img { border-radius: 9px; }
.footer-brand small { color: var(--muted); }
.site-footer p { text-align: center; }
.site-footer nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; }
.site-footer a { display: inline-flex; min-height: 44px; align-items: center; text-underline-offset: 4px; }

.modal {
  width: min(720px, calc(100vw - 28px));
  max-height: min(860px, calc(100dvh - 28px));
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 26px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(7, 21, 47, .32);
}
.modal::backdrop { background: rgba(3, 12, 29, .62); backdrop-filter: blur(6px); }
.modal form { padding: clamp(24px, 5vw, 42px); }
.modal-head h2 { margin: 0; color: var(--navy-900); font-size: clamp(27px, 4vw, 40px); line-height: 1.25; letter-spacing: -1.2px; }
.modal-head p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.modal-head-inline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-close {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.modal-close span { font-size: 18px; line-height: 1; }
.modal fieldset { margin: 26px 0 0; padding: 0; border: 0; }
.modal legend { margin-bottom: 12px; color: var(--navy-900); font-weight: 850; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice-grid label { cursor: pointer; }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-grid label > span { display: block; min-height: 94px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.choice-grid input:focus-visible + span { outline: 3px solid #6e97ff; outline-offset: 2px; }
.choice-grid input:checked + span { border-color: var(--blue-600); background: #edf3ff; box-shadow: inset 0 0 0 1px var(--blue-600); }
.choice-grid strong { display: block; color: var(--navy-900); }
.choice-grid small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.45; }
.data-notice { margin-top: 24px; padding: 16px; border-radius: 14px; background: #eef9f4; color: #135b3c; }
.data-notice p { margin: 5px 0 0; font-size: 13px; line-height: 1.6; }
.modal select { width: 100%; min-height: 50px; padding: 0 13px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--navy-900); }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 28px; }
.modal-actions.split { align-items: center; justify-content: space-between; }
.modal-actions.split > div { display: flex; gap: 8px; }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 28px; }
.small-copy { color: var(--muted); font-size: 12px; line-height: 1.6; }
.export-review-modal, .prompt-review-modal { width: min(680px, calc(100vw - 28px)); }
.export-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.export-review-grid section { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: #f8fafc; }
.export-review-grid h3 { margin: 0; color: var(--navy-900); font-size: 15px; }
.export-review-grid ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.export-review-check { display: flex; min-height: 44px; align-items: center; gap: 10px; margin-top: 18px; color: var(--navy-900); font-size: 13px; font-weight: 800; cursor: pointer; }
.export-review-check input { width: 18px; min-height: 18px; flex: 0 0 auto; accent-color: var(--blue-700); }
.export-review-error { padding: 12px; border-radius: 10px; background: #fff1f2; color: #9f1239; font-size: 13px; font-weight: 800; }
.review-modal-content { color: var(--navy-900); }
.review-modal-content .review-prompt { padding: 20px; border-radius: 16px; background: #eef4fb; font-size: 20px; font-weight: 800; line-height: 1.55; }
.review-targets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.review-targets span { padding: 7px 9px; border-radius: 8px; background: #fff8d8; color: #674f00; font-size: 12px; font-weight: 800; }
.sr-live { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.legal-shell { width: min(840px, calc(100% - 36px)); margin: 0 auto; padding: 72px 0; }
.legal-shell .brand { margin-bottom: 56px; }
.legal-shell h1 { margin: 0; color: var(--navy-900); font-size: clamp(42px, 7vw, 68px); letter-spacing: -2.5px; }
.legal-shell h2 { margin: 42px 0 12px; color: var(--navy-900); font-size: 24px; }
.legal-shell p, .legal-shell li { color: var(--muted); line-height: 1.8; }
.legal-shell .legal-lead { color: var(--navy-900); font-size: 19px; }
.legal-shell .legal-meta { margin: 12px 0 24px; color: var(--blue-700); font-size: 13px; font-weight: 800; }
.legal-shell a:not(.brand) { color: var(--blue-700); text-underline-offset: 4px; }
.legal-back { display: inline-flex; margin-top: 42px; color: var(--blue-700); font-weight: 800; }

@media (max-width: 1100px) {
  .hero-stage { grid-template-columns: 1fr; min-height: auto; }
  .speech-stage { max-width: 720px; transform: none; }
  .lesson-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .lesson-aside { position: static; grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .aside-card + .aside-card { margin-top: 0; }
  .lesson-aside h3 { grid-column: 1 / -1; }
  .lesson-actions { padding-left: 168px; padding-right: 0; }
  .template-row { grid-template-columns: minmax(0, 1fr) auto; }
  .template-row-result { grid-column: 1; padding-left: 0; border-left: 0; }
  .template-row-actions { grid-column: 2; grid-row: 1 / 3; }
  .progress-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 68px; padding-bottom: 8px; background: var(--canvas); backdrop-filter: none; }
  .primary-nav { position: fixed; z-index: 50; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); left: 12px; justify-content: space-around; box-shadow: 0 18px 60px rgba(7, 21, 47, .22); }
  .nav-item { flex: 1; padding-inline: 5px; font-size: 12px; white-space: nowrap; }
  .icon-button { grid-column: 2; grid-row: 1; }
  main { padding-top: 24px; padding-bottom: 122px; }
  .hero-stage { padding: 42px 28px; border-radius: 26px; }
  .hero-copy h1 { font-size: clamp(43px, 9vw, 64px); letter-spacing: -2.5px; }
  .today-grid { grid-template-columns: 1fr; }
  .daily-path-head { align-items: flex-start; flex-direction: column; }
  .habit-proof { text-align: left; }
  .path-station { grid-template-columns: 56px minmax(0, 1fr); }
  .path-station .button { grid-column: 2; width: fit-content; }
  .principle-strip { grid-template-columns: 1fr; }
  .principle-strip > div + div::before { inset: 0 18px auto; width: auto; height: 1px; }
  .lesson-view { width: 100%; margin-inline: 0; }
  .lesson-header { grid-template-columns: 1fr auto; align-items: start; }
  .lesson-header > div { grid-column: 1 / -1; grid-row: 2; }
  .lesson-time { grid-column: 2; grid-row: 1; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-rail { position: static; display: flex; overflow-x: auto; padding: 7px; }
  .rail-step { flex: 0 0 110px; grid-template-columns: 26px 1fr; min-height: 48px; }
  .lesson-aside { grid-column: 1; grid-template-columns: 1fr 1fr; }
  .lesson-actions { padding: 0; }
  .page-heading h2 { font-size: clamp(40px, 10vw, 62px); }
  .lab-recommendation { grid-template-columns: 1fr; align-items: start; }
  .lab-recommendation > div:last-child { align-items: flex-start; }
  .lab-layout { grid-template-columns: 1fr; }
  .lab-filters { position: static; grid-template-columns: 1fr 1fr; }
  .lab-filters > div, .lab-filters > button { grid-column: 1 / -1; }
  .studio-head, .studio-grid { grid-template-columns: 1fr; }
  .studio-grid { gap: 36px; }
  .progress-grid { grid-template-columns: 1fr 1fr; }
  .site-footer { grid-template-columns: 1fr; padding-bottom: 110px; text-align: center; }
  .footer-brand, .site-footer nav { justify-content: center; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-grid label > span { min-height: auto; }
}

@media (max-width: 560px) {
  .brand small { display: none; }
  .brand img { width: 38px; height: 38px; }
  .hero-stage { padding: 36px 22px; }
  .hero-copy h1 { font-size: 43px; line-height: 1.09; }
  .hero-lead { font-size: 16px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button, .hero-actions .text-button { width: 100%; }
  .speech-stage { padding: 21px; }
  .speech-sample { font-size: 24px; }
  .section-heading { display: block; }
  .duration-label { display: inline-block; margin-top: 12px; }
  .lesson-facts { grid-template-columns: 1fr; }
  .lesson-facts div + div { padding-left: 0; border-top: 1px solid #e6ebf1; border-left: 0; }
  .option-grid, .self-check, .settings-actions, .export-review-grid { grid-template-columns: 1fr; }
  .path-station { gap: 12px; }
  .path-station p { font-size: 13px; }
  .lab-filters { grid-template-columns: 1fr; }
  .lab-filters > div, .lab-filters > button { grid-column: auto; }
  .library-head { align-items: flex-start; flex-direction: column; }
  .template-row { grid-template-columns: 1fr; gap: 14px; }
  .template-row-result, .template-row-actions { grid-column: 1; grid-row: auto; }
  .template-row-actions { justify-items: stretch; }
  .template-topic-group > header { grid-template-columns: 1fr; align-items: start; }
  .template-topic-group > header .eyebrow { grid-column: 1; }
  .template-studio { padding: 24px 18px; }
  .studio-journey { grid-template-columns: 1fr; }
  .studio-journey li { min-height: 52px; }
  .studio-builder { grid-template-columns: 1fr; }
  .studio-builder .studio-topic, .studio-builder .button { grid-column: 1; }
  .interest-options, .history-summary-row { grid-template-columns: 1fr; }
  .studio-actions { display: grid; }
  .studio-actions .button { width: 100%; }
  .handoff-step { align-items: flex-start; }
  .plan-validation-meta { grid-template-columns: 1fr; }
  .speech-groups { display: grid; overflow-x: visible; }
  .speech-group { min-width: 0; width: 100%; }
  .speech-boundary { justify-self: center; transform: rotate(90deg); }
  .practice-head { align-items: stretch; flex-direction: column-reverse; }
  .practice-head .modal-close { align-self: flex-end; }
  .practice-body { min-height: 360px; }
  .practice-self-check { align-items: stretch; flex-direction: column; }
  .practice-self-check > div { display: grid; }
  .template-preview dl, .practice-scene dl { grid-template-columns: 1fr; }
  .progress-grid { grid-template-columns: 1fr; }
  .lesson-workspace { min-height: 560px; padding: 24px 19px; }
  .lesson-aside { grid-template-columns: 1fr; }
  .review-row { grid-template-columns: 58px 1fr; }
  .review-row .button { grid-column: 1 / -1; }
  .modal-actions.split { align-items: stretch; flex-direction: column; }
  .modal-actions.split > div { display: grid; grid-template-columns: 1fr; }
  .modal-actions .button { width: 100%; }
  .audio-error-banner, .storage-error-banner { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .speech-stage { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header, .lesson-rail, .lesson-aside, .modal { background: #fff; backdrop-filter: none; }
}

@media print {
  .site-header, .site-footer, .lesson-actions, .button, .text-button { display: none !important; }
  main { width: 100%; padding: 0; }
  .view[hidden] { display: none !important; }
}
