:root {
  --navy: #173f72;
  --navy-dark: #0e2d52;
  --blue: #2c7eea;
  --blue-soft: #eaf4ff;
  --teal: #16a982;
  --teal-dark: #08765c;
  --coral: #ef626c;
  --yellow: #ffd66b;
  --ink: #18324f;
  --muted: #657d96;
  --line: #d7e5f0;
  --paper: #fff;
  --cream: #fff9e9;
  --shadow: 0 22px 58px rgba(19, 54, 88, .15);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 5%, rgba(121, 220, 198, .24), transparent 28rem),
    radial-gradient(circle at 94% 7%, rgba(119, 179, 255, .25), transparent 32rem),
    linear-gradient(180deg, #f3fbff 0%, #fbfdff 54%, #eef7f6 100%);
}

button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(44, 126, 234, .27);
  outline-offset: 3px;
}

.stage-header {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 900;
}

.back-link > span:first-child {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(44, 126, 234, .18);
  border-radius: 14px;
  color: var(--navy);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 22px rgba(21, 63, 103, .08);
  font-size: 21px;
}

.back-link small,
.back-link strong { display: block; }
.back-link small { color: var(--muted); font-size: 11px; }
.back-link strong { margin-top: 2px; font-size: 15px; }

.completion-pill {
  padding: 9px 14px;
  border: 1px solid #cfe2f2;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, .85);
  font-size: 12px;
  font-weight: 900;
}

.catalog-shell,
.practice-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding-bottom: max(42px, env(safe-area-inset-bottom));
}

.catalog-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
  align-items: center;
  gap: 40px;
  margin: 12px 0 28px;
  padding: clamp(31px, 5vw, 60px);
  border-radius: 34px;
  color: white;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 214, 107, .24), transparent 17rem),
    linear-gradient(125deg, var(--navy-dark), var(--navy) 56%, #236b9d);
  box-shadow: var(--shadow);
}

.catalog-hero::before,
.catalog-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .11);
  pointer-events: none;
}

.catalog-hero::before { width: 330px; height: 330px; right: -110px; top: -185px; }
.catalog-hero::after { width: 190px; height: 190px; left: 46%; bottom: -135px; }

.hero-copy,
.stage-flow { position: relative; z-index: 1; }

.kicker {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  color: #dff8f0;
  background: rgba(255, 255, 255, .13);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.catalog-hero h1 {
  max-width: 700px;
  margin: 14px 0 14px;
  font-size: clamp(35px, 5.5vw, 65px);
  line-height: .98;
  letter-spacing: -.045em;
}

.catalog-hero h1 em { color: #8ff0c9; font-style: normal; }

.catalog-hero p {
  max-width: 690px;
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}

.stage-flow {
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 10px;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 25px;
  background: rgba(8, 38, 70, .3);
  backdrop-filter: blur(8px);
}

.stage-flow li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .09);
}

.stage-flow b {
  width: 35px;
  height: 35px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--navy-dark);
  background: #9aefd1;
}

.stage-flow span,
.stage-flow strong,
.stage-flow small { display: block; }
.stage-flow strong { font-size: 15px; }
.stage-flow small { margin-top: 2px; color: rgba(255, 255, 255, .7); }

.catalog-section {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(210, 226, 238, .9);
  border-radius: 30px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 18px 45px rgba(28, 73, 109, .09);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.section-heading span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .1em;
}

.section-heading h2 { margin: 5px 0 0; font-size: clamp(24px, 3.5vw, 36px); }
.section-heading p { max-width: 380px; margin: 0; color: var(--muted); font-weight: 800; text-align: right; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.story-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  align-items: end;
  border: 0;
  border-radius: 23px;
  color: white;
  text-decoration: none;
  background: var(--navy);
  box-shadow: 0 12px 28px rgba(20, 58, 92, .15);
  isolation: isolate;
  transition: transform .18s ease, box-shadow .18s ease;
}

.story-card:hover { transform: translateY(-5px); box-shadow: 0 19px 35px rgba(20, 58, 92, .23); }

.story-card img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.story-card:hover img { transform: scale(1.035); }

.story-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 25, 43, .05) 10%, rgba(8, 30, 53, .93) 88%);
}

.story-card-number {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  color: var(--navy);
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .12);
}

.story-card-status {
  position: absolute;
  top: 15px;
  right: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #dff8ef;
  background: rgba(5, 45, 38, .74);
  font-size: 10px;
  font-weight: 1000;
  backdrop-filter: blur(5px);
}

.story-card-body { width: 100%; padding: 44px 18px 18px; }
.story-card-body > span { font-size: 25px; }
.story-card-body h3 { margin: 7px 0 2px; font-size: 19px; line-height: 1.15; }
.story-card-body p { margin: 0; color: rgba(255, 255, 255, .73); font-size: 13px; font-weight: 800; }
.story-card-meta { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 900; }
.story-card-meta b { color: #9aefd1; }

/* Practice */
.practice-page { background: linear-gradient(180deg, #eef8ff, #f9fcff 55%, #eff8f4); }

.practice-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 14px;
}

.story-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.story-icon { width: 51px; height: 51px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 17px; background: #fff; box-shadow: 0 8px 22px rgba(24, 65, 103, .1); font-size: 25px; }
.story-identity small,
.story-identity strong { display: block; }
.story-identity small { color: var(--teal-dark); font-size: 11px; font-weight: 1000; letter-spacing: .05em; text-transform: uppercase; }
.story-identity strong { overflow: hidden; margin-top: 3px; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }

.sentence-progress { width: min(350px, 36%); display: flex; align-items: center; gap: 12px; }
.sentence-progress > span { color: var(--navy); font-size: 14px; font-weight: 1000; white-space: nowrap; }
.sentence-progress > div { height: 9px; flex: 1; overflow: hidden; border-radius: 999px; background: #dce9f2; }
.sentence-progress i { display: block; width: 10%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); transition: width .3s ease; }

.practice-steps {
  width: min(720px, 100%);
  margin: 0 auto -21px;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid #d7e6f1;
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 25px rgba(20, 62, 98, .11);
}

.practice-steps span { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; border-radius: 13px; color: #8095a8; font-size: 12px; font-weight: 1000; }
.practice-steps b { width: 27px; height: 27px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #eaf1f6; font-style: normal; }
.practice-steps i { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.practice-steps .is-active { color: var(--navy); background: #edf6ff; }
.practice-steps .is-active b { color: white; background: var(--blue); }
.practice-steps .is-done { color: var(--teal-dark); }
.practice-steps .is-done b { color: white; background: var(--teal); }

@media (min-width: 951px) {
  .practice-steps {
    width: auto;
    margin-right: clamp(20px, 3.2vw, 40px);
    margin-left: calc(37.5% + clamp(20px, 3.2vw, 40px));
  }
}

.practice-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(330px, .75fr) minmax(0, 1.25fr);
  align-items: start;
  border: 1px solid #d4e2ed;
  border-radius: 31px;
  background: white;
  box-shadow: var(--shadow);
}

.scene-panel {
  position: relative;
  min-height: 0;
  aspect-ratio: 3 / 2;
  align-self: start;
  margin: 0;
  overflow: hidden;
  background: var(--navy-dark);
}

.scene-image-button {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: var(--navy-dark);
  cursor: zoom-in;
}

.scene-image-button:focus-visible { outline: 4px solid rgba(255, 255, 255, .88); outline-offset: -7px; }
.scene-panel img { width: 100%; height: 100%; position: absolute; inset: 0; display: block; object-fit: contain; }
.scene-shade { position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4, 21, 37, .08) 30%, rgba(7, 28, 48, .9) 100%); }
.scene-panel figcaption { position: absolute; z-index: 2; left: 25px; right: 25px; bottom: 26px; pointer-events: none; color: white; }
.scene-panel figcaption > span { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 11px; font-weight: 1000; letter-spacing: .08em; backdrop-filter: blur(5px); }
.scene-panel figcaption p { max-width: 420px; margin: 10px 0 0; color: rgba(255, 255, 255, .84); font-size: 17px; font-weight: 800; line-height: 1.45; }

.scene-expand-hint {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  pointer-events: none;
  color: white;
  background: rgba(8, 35, 59, .58);
  font-size: 11px;
  font-weight: 1000;
  backdrop-filter: blur(6px);
}


.practice-workspace { min-width: 0; padding: 44px clamp(20px, 3.2vw, 40px) 30px; }

.listen-panel,
.build-panel,
.speaking-panel { padding: 18px; border: 1px solid var(--line); border-radius: 22px; }
.listen-panel { background: linear-gradient(135deg, #f4f9ff, #eff8ff); }
.build-panel { margin-top: 14px; background: white; }

.panel-heading { display: flex; align-items: center; gap: 10px; }
.panel-number { width: 36px; height: 36px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 12px; color: white; background: var(--blue); font-size: 14px; font-weight: 1000; }
.panel-heading small,
.panel-heading strong { display: block; }
.panel-heading small { color: var(--teal-dark); font-size: 9px; font-weight: 1000; letter-spacing: .1em; }
.panel-heading strong { margin-top: 2px; font-size: 17px; }

.listen-actions { display: flex; gap: 9px; margin-top: 13px; }
.listen-button { min-height: 47px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; border: 0; border-radius: 15px; font-size: 14px; }
.listen-button span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .18); font-size: 11px; }
.primary-listen { color: white; background: linear-gradient(135deg, #2779e3, #3e8ef1); box-shadow: 0 8px 20px rgba(44, 126, 234, .24); }
.slow-listen { color: var(--navy); background: white; border: 1px solid #cbdfee; }
.listen-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }

.answer-zone {
  min-height: 83px;
  margin-top: 15px;
  padding: 13px;
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  border: 2px dashed #8fb9dc;
  border-radius: 18px;
  background: repeating-linear-gradient(135deg, #fafdff, #fafdff 13px, #eef6fc 13px, #eef6fc 26px);
}

.answer-zone p { align-self: center; margin: auto 0; color: #7893aa; font-size: 13px; font-weight: 800; }
.word-bank-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 2px 8px; color: var(--muted); font-size: 12px; font-weight: 1000; }
.word-bank-heading button { border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 1000; }
.word-bank { min-height: 48px; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; }

.word-chip {
  min-height: 42px;
  padding: 8px 13px;
  border: 2px solid #ccdfed;
  border-radius: 13px;
  color: var(--ink);
  background: white;
  box-shadow: 0 4px 10px rgba(22, 62, 98, .06);
  font-size: 14px;
  font-weight: 1000;
  transition: transform .12s ease, border-color .12s ease;
}

.word-chip:hover { transform: translateY(-2px); border-color: #72a9d8; }
.answer-zone .word-chip { color: #14518a; border-color: #6ca4d7; background: #edf7ff; }
.answer-zone .word-chip.is-correct-place { color: #087057; border-color: #46bd98; background: #e8faf3; }
.answer-zone .word-chip.is-wrong-place { color: #a13a45; border-color: #ef8d97; background: #fff0f1; }
.word-chip:disabled { opacity: 1; cursor: default; }

.build-feedback { margin-top: 14px; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 14px; font-size: 12px; font-weight: 800; }
.build-feedback p { margin: 0; line-height: 1.4; }
.build-feedback.info { color: #3c668b; background: #eef7ff; }
.build-feedback.bad { color: #a13a45; background: #fff0f1; }
.build-feedback.good { color: #087057; background: #e9faf4; }

.why-button {
  margin: 9px 0 0 auto;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid #efb2b8;
  border-radius: 12px;
  color: #a13a45;
  background: #fff;
  font-size: 12px;
  font-weight: 1000;
}

.why-button span,
.help-icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #e45c68;
  font-family: Georgia, serif;
  font-weight: 1000;
}

.build-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 13px; }
.secondary-button,
.check-button,
.next-button,
.record-button,
.stop-button { min-height: 45px; border: 0; border-radius: 14px; padding: 10px 17px; font-weight: 1000; }
.secondary-button { color: #5e7890; background: #edf3f7; }
.check-button { color: white; background: linear-gradient(135deg, var(--blue), #665bd8); box-shadow: 0 8px 19px rgba(57, 94, 200, .23); }

.result-panel { margin-top: 14px; display: flex; align-items: flex-start; gap: 13px; padding: 17px; border: 1px solid #aee3cf; border-radius: 20px; background: linear-gradient(135deg, #eafaf4, #f6fffb); }
.success-mark { width: 39px; height: 39px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 13px; color: white; background: var(--teal); font-weight: 1000; }
.result-panel small { color: var(--teal-dark); font-size: 9px; font-weight: 1000; letter-spacing: .1em; }
.result-panel h2 { margin: 3px 0 3px; color: #075f49; font-size: clamp(18px, 2.4vw, 24px); line-height: 1.2; }
.result-panel p { margin: 0; color: #52776e; font-weight: 800; }

.speaking-panel { margin-top: 14px; background: linear-gradient(135deg, #fff, #f8f4ff); transition: opacity .2s ease; }
.speaking-panel.is-locked { opacity: .56; }
.speaking-panel .panel-number { background: var(--coral); }
.speaking-panel .panel-heading small { color: #b84250; }
.speaking-copy > p { margin: 9px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.45; }

.record-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #d8d7e7; }
.record-state { height: 28px; display: none; align-items: center; justify-content: center; gap: 5px; margin-bottom: 9px; }
.record-state.is-recording { display: flex; }
.record-state i { width: 5px; height: 10px; border-radius: 999px; background: var(--coral); animation: record-wave .7s ease-in-out infinite alternate; }
.record-state i:nth-child(2) { animation-delay: -.3s; }
.record-state i:nth-child(3) { animation-delay: -.55s; }
.record-state i:nth-child(4) { animation-delay: -.15s; }
.record-state i:nth-child(5) { animation-delay: -.42s; }
@keyframes record-wave { to { height: 27px; } }

.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.record-button { color: white; background: linear-gradient(135deg, #e6505d, #ef6d75); box-shadow: 0 8px 18px rgba(224, 78, 91, .22); }
.record-button span { margin-right: 4px; }
.stop-button { color: #667d92; background: #edf2f6; }
.record-status { min-height: 17px; margin: 8px 0 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.record-box audio { width: 100%; height: 42px; margin-top: 8px; }

.next-row { display: flex; justify-content: flex-end; margin-top: 15px; }
.next-button { min-width: 190px; color: white; background: linear-gradient(135deg, #0e936f, #25b98d); box-shadow: 0 9px 21px rgba(18, 152, 113, .23); }
.next-button span { margin-left: 7px; }

.finish-card { max-width: 860px; margin: 38px auto 0; padding: clamp(25px, 5vw, 52px); border: 1px solid #d6e5ee; border-radius: 31px; text-align: center; background: white; box-shadow: var(--shadow); }
.finish-icon { width: 70px; height: 70px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 24px; color: #7d5800; background: #ffe391; font-size: 34px; }
.finish-card > small { color: var(--teal-dark); font-weight: 1000; letter-spacing: .12em; }
.finish-card h1 { max-width: 680px; margin: 10px auto; font-size: clamp(28px, 5vw, 46px); line-height: 1.05; }
.finish-card > p { max-width: 650px; margin: 0 auto; color: var(--muted); font-weight: 800; line-height: 1.55; }
.finish-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 21px 0; }
.finish-actions button,
.finish-actions a { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border: 0; border-radius: 14px; text-decoration: none; font-weight: 1000; }
.finish-actions button { color: var(--navy); background: #eaf3fa; }
.finish-actions a { color: white; background: var(--teal); }
.finish-card ol { margin: 22px 0 0; padding: 0; display: grid; gap: 7px; list-style: none; text-align: left; }
.finish-card li { padding: 10px 13px; border-radius: 12px; color: #315a78; background: #f2f8fc; font-weight: 800; }
.finish-card li b { display: inline-grid; width: 25px; height: 25px; margin-right: 8px; place-items: center; border-radius: 8px; color: white; background: var(--teal); font-size: 11px; }

.help-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 20px;
  overflow: auto;
  background: rgba(7, 27, 47, .72);
  backdrop-filter: blur(7px);
}

.help-overlay:not([hidden]) { display: grid; place-items: center; }

.help-dialog {
  width: min(590px, 100%);
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 27px;
  background: white;
  box-shadow: 0 28px 80px rgba(4, 24, 42, .32);
}

.help-dialog > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; }
.help-icon { width: 42px; height: 42px; background: linear-gradient(135deg, var(--blue), #675bd8); font-size: 22px; }
.help-dialog header small { color: var(--teal-dark); font-size: 9px; font-weight: 1000; letter-spacing: .1em; }
.help-dialog h2 { margin: 2px 0 0; font-size: 25px; }
.help-close { width: 37px; height: 37px; border: 0; border-radius: 12px; color: #58738b; background: #edf3f7; font-size: 24px; line-height: 1; }
.help-summary { margin: 17px 0 13px; color: #496982; font-weight: 800; line-height: 1.5; }

.position-comparison { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 9px; }
.position-comparison > div { min-width: 0; padding: 12px; border-radius: 15px; background: #fff1f2; }
.position-comparison > div:last-child { background: #eaf9f3; }
.position-comparison small,
.position-comparison strong { display: block; }
.position-comparison small { color: #8a5e67; font-size: 8px; font-weight: 1000; letter-spacing: .07em; }
.position-comparison > div:last-child small { color: #367566; }
.position-comparison strong { overflow: hidden; margin-top: 4px; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.position-comparison > span { color: #8da0b1; font-size: 22px; }

.grammar-note { margin-top: 13px; padding: 14px; border-left: 4px solid #6d62da; border-radius: 4px 14px 14px 4px; background: #f5f3ff; }
.grammar-note strong { color: #5547b2; font-size: 12px; }
.grammar-note p { margin: 4px 0 0; color: #514e76; font-size: 13px; font-weight: 800; line-height: 1.5; }
.sentence-skeleton { margin-top: 14px; }
.sentence-skeleton > strong { font-size: 12px; }
.sentence-skeleton > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.skeleton-part { padding: 10px 8px; border: 1px solid #d5e4ef; border-radius: 13px; text-align: center; background: #f7fbfe; }
.skeleton-part b,
.skeleton-part small { display: block; }
.skeleton-part b { color: var(--navy); font-size: 12px; }
.skeleton-part small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 800; }
.skeleton-part.is-problem { border-color: #ef9ba4; background: #fff2f3; }
.help-footnote { margin: 13px 0 0; color: #7a8fa1; font-size: 11px; font-weight: 800; text-align: center; }

body.scene-lightbox-open { overflow: hidden; }

.scene-lightbox {
  position: fixed;
  z-index: 120;
  inset: 0;
  padding: clamp(14px, 3vw, 32px);
  overflow: auto;
  background: rgba(4, 19, 34, .9);
}

.scene-lightbox:not([hidden]) { display: grid; place-items: center; }

.scene-lightbox-dialog {
  width: min(1120px, 100%);
  position: relative;
  margin: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 24px;
  background: #0a2741;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
}

.scene-lightbox-dialog img {
  width: 100%;
  max-height: calc(100vh - 110px);
  display: block;
  border-radius: 17px;
  object-fit: contain;
  background: #071e32;
}

.scene-lightbox-dialog p { margin: 10px 50px 2px 8px; color: rgba(255, 255, 255, .84); font-size: 13px; font-weight: 800; }
.scene-lightbox-close { width: 43px; height: 43px; position: absolute; z-index: 2; top: 19px; right: 19px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 14px; color: white; background: rgba(5, 28, 47, .76); font-size: 28px; line-height: 1; backdrop-filter: blur(6px); }

@media (max-width: 950px) {
  .catalog-hero { grid-template-columns: 1fr; gap: 25px; }
  .stage-flow { grid-template-columns: repeat(3, 1fr); }
  .stage-flow li { justify-content: center; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-steps { margin-bottom: 12px; }
  .practice-card { grid-template-columns: 1fr; }
  .scene-panel { min-height: 0; }
  .scene-panel img { position: absolute; }
}

@media (max-width: 620px) {
  .stage-header,
  .catalog-shell,
  .practice-shell { width: min(100% - 24px, 1180px); }
  .stage-header { padding-top: 12px; }
  .completion-pill { padding: 8px 10px; font-size: 11px; }
  .catalog-hero { margin-top: 5px; padding: 27px 21px; border-radius: 25px; }
  .catalog-hero h1 { font-size: 38px; }
  .stage-flow { grid-template-columns: 1fr; padding: 10px; }
  .stage-flow li { justify-content: flex-start; }
  .catalog-section { padding: 18px 13px; border-radius: 24px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 8px; text-align: left; }
  .story-grid { grid-template-columns: 1fr; gap: 13px; }
  .story-card { min-height: 220px; }
  .practice-titlebar { align-items: flex-end; }
  .story-icon { width: 44px; height: 44px; border-radius: 14px; }
  .story-identity strong { max-width: 190px; font-size: 15px; }
  .sentence-progress { width: 92px; display: block; text-align: right; }
  .sentence-progress > div { margin-top: 5px; }
  .practice-steps { margin-bottom: -17px; padding: 6px; border-radius: 17px; }
  .practice-steps span { gap: 4px; padding: 7px 3px; font-size: 10px; }
  .practice-steps b { width: 24px; height: 24px; }
  .practice-card { border-radius: 24px; }
  .scene-panel { min-height: 0; }
  .scene-expand-hint { display: none; }
  .scene-panel figcaption { left: 18px; right: 18px; bottom: 18px; }
  .scene-panel figcaption p { font-size: 14px; }
  .practice-workspace { padding: 31px 12px 20px; }
  .listen-panel,
  .build-panel,
  .speaking-panel { padding: 14px; border-radius: 18px; }
  .listen-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .listen-button { padding-inline: 8px; }
  .answer-zone { min-height: 97px; }
  .word-chip { min-height: 43px; padding-inline: 12px; }
  .build-actions { display: grid; grid-template-columns: .72fr 1.28fr; }
  .record-actions { display: grid; grid-template-columns: 1.15fr .85fr; }
  .next-row { display: block; }
  .next-button { width: 100%; }
  .finish-card { margin-top: 20px; border-radius: 24px; }
  .help-overlay { padding: 12px; align-items: end; }
  .help-dialog { padding: 19px 16px; border-radius: 24px; }
  .position-comparison { grid-template-columns: 1fr; }
  .position-comparison > span { transform: rotate(90deg); text-align: center; line-height: .6; }
  .sentence-skeleton > div { gap: 5px; }
  .skeleton-part { padding-inline: 5px; }
}

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