/*
 * Shared curriculum runtime surfaces.
 * The course shells keep their own page chrome; this file gives the generated
 * lesson stages and index lists one calm, accessible visual language.
 */

/* ---------- Shared tokens ---------- */
[data-fcurr-level],
[data-curriculum-index] {
  --fc-bg: #f5f5f7;
  --fc-card: #ffffff;
  --fc-card-subtle: #fbfbfd;
  --fc-ink: #1d1d1f;
  --fc-muted: #6e6e73;
  --fc-line: rgba(29, 29, 31, .12);
  --fc-line-strong: rgba(29, 29, 31, .22);
  --fc-accent: #0071e3;
  --fc-accent-soft: rgba(0, 113, 227, .10);
  --fc-success: #1d7a45;
  --fc-success-soft: rgba(29, 122, 69, .11);
  --fc-warning: #9a5b00;
  --fc-warning-soft: rgba(218, 137, 0, .12);
  --fc-danger: #b3261e;
  --fc-shadow: 0 1px 2px rgba(29, 29, 31, .04), 0 12px 32px rgba(29, 29, 31, .06);
  --fc-shadow-hover: 0 2px 4px rgba(29, 29, 31, .06), 0 18px 42px rgba(29, 29, 31, .10);
  --fc-radius-lg: 28px;
  --fc-radius-md: 20px;
  --fc-radius-sm: 14px;
  color: var(--fc-ink);
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

/* Explicit theme choices win over the shell's light/dark defaults. */
[data-theme="dark"] [data-fcurr-level],
[data-theme="dark"] [data-curriculum-index],
[data-fcurr-level][data-theme="dark"],
[data-curriculum-index][data-theme="dark"] {
  --fc-bg: #1d1d1f;
  --fc-card: #2c2c2e;
  --fc-card-subtle: #242426;
  --fc-ink: #f5f5f7;
  --fc-muted: #a1a1a6;
  --fc-line: rgba(255, 255, 255, .14);
  --fc-line-strong: rgba(255, 255, 255, .26);
  --fc-accent: #2997ff;
  --fc-accent-soft: rgba(41, 151, 255, .16);
  --fc-success: #63d48a;
  --fc-success-soft: rgba(99, 212, 138, .16);
  --fc-warning: #ffb340;
  --fc-warning-soft: rgba(255, 179, 64, .16);
  --fc-danger: #ff6961;
  --fc-shadow: 0 1px 2px rgba(0, 0, 0, .24), 0 16px 36px rgba(0, 0, 0, .28);
  --fc-shadow-hover: 0 2px 5px rgba(0, 0, 0, .30), 0 22px 48px rgba(0, 0, 0, .36);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-fcurr-level],
  :root:not([data-theme="light"]) [data-curriculum-index] {
    --fc-bg: #1d1d1f;
    --fc-card: #2c2c2e;
    --fc-card-subtle: #242426;
    --fc-ink: #f5f5f7;
    --fc-muted: #a1a1a6;
    --fc-line: rgba(255, 255, 255, .14);
    --fc-line-strong: rgba(255, 255, 255, .26);
    --fc-accent: #2997ff;
    --fc-accent-soft: rgba(41, 151, 255, .16);
    --fc-success: #63d48a;
    --fc-success-soft: rgba(99, 212, 138, .16);
    --fc-warning: #ffb340;
    --fc-warning-soft: rgba(255, 179, 64, .16);
    --fc-danger: #ff6961;
    --fc-shadow: 0 1px 2px rgba(0, 0, 0, .24), 0 16px 36px rgba(0, 0, 0, .28);
    --fc-shadow-hover: 0 2px 5px rgba(0, 0, 0, .30), 0 22px 48px rgba(0, 0, 0, .36);
    color-scheme: dark;
  }
}

/* ---------- Lesson frame ---------- */
.fcurr-lesson {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 0 clamp(48px, 8vw, 96px);
  color: var(--fc-ink);
  font-size: 1rem;
  line-height: 1.65;
}

.fcurr-lesson h2,
.fcurr-lesson h3,
.fcurr-lesson p,
.fcurr-lesson ul,
.fcurr-lesson ol,
.fcurr-lesson fieldset,
.fcurr-lesson figure {
  margin-top: 0;
}

.fcurr-lesson h2,
.fcurr-lesson h3,
[data-curriculum-index] .fcurr-module h3,
[data-curriculum-index] .fcurr-index-copy b {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--fc-ink);
}

.fcurr-lesson p,
.fcurr-lesson li,
.fcurr-lesson label,
[data-curriculum-index] .fcurr-module,
[data-curriculum-index] .fcurr-index-row {
  overflow-wrap: anywhere;
}

/* ---------- Stage wayfinding ---------- */
.fcurr-stage-nav {
  position: sticky;
  top: var(--fcurr-nav-top, 76px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 28px;
  padding: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-snap-type: inline proximity;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 24px rgba(29, 29, 31, .07);
  background: var(--fc-bg);
  background: color-mix(in srgb, var(--fc-bg) 86%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.fcurr-stage-nav::-webkit-scrollbar { display: none; }

[data-theme="dark"] .fcurr-stage-nav,
[data-fcurr-level][data-theme="dark"] .fcurr-stage-nav,
[data-curriculum-index][data-theme="dark"] .fcurr-stage-nav {
  background: rgba(44, 44, 46, .84);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fcurr-stage-nav {
    background: rgba(44, 44, 46, .84);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
  }
}

.fcurr-stage-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--fc-muted);
  background: transparent;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .12s ease;
}

.fcurr-stage-link:hover {
  color: var(--fc-ink);
  background: var(--fc-accent-soft);
}

.fcurr-stage-link[aria-current="step"] {
  color: #fff;
  border-color: var(--fc-accent);
  background: var(--fc-accent);
  box-shadow: 0 2px 7px rgba(0, 113, 227, .22);
}

.fcurr-stage-link:active,
.fcurr-next-stage:active {
  transform: scale(.98);
}

.fcurr-stage-link-last { margin-left: auto; }

.fcurr-stage-number {
  display: inline-grid;
  width: 1.45em;
  min-width: 1.45em;
  place-items: center;
  color: currentColor;
  font-size: .8em;
  font-variant-numeric: tabular-nums;
  opacity: .68;
}

.fcurr-stage-link[aria-current="step"] .fcurr-stage-number { opacity: .86; }

/* ---------- Stage cards ---------- */
.fcurr-stage {
  display: flow-root;
  margin: 0 0 18px;
  padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 46px) clamp(32px, 4vw, 50px);
  scroll-margin-top: calc(var(--fcurr-nav-top, 76px) + 84px);
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-lg);
  background: var(--fc-card);
  box-shadow: var(--fc-shadow);
}

.fcurr-stage:last-child { margin-bottom: 0; }

.fcurr-stage-head {
  max-width: 65ch;
  margin: 0 0 28px;
}

.fcurr-index,
.fcurr-module-no {
  margin: 0 0 12px;
  color: var(--fc-accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.35;
  text-transform: uppercase;
}

.fcurr-stage-head h2 {
  max-width: 24ch;
  margin: 0 0 12px;
  color: var(--fc-ink);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 720;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.fcurr-stage-head > p:last-child {
  max-width: 65ch;
  margin: 0;
  color: var(--fc-muted);
  line-height: 1.72;
}

.fcurr-stage h3 {
  margin: 28px 0 10px;
  color: var(--fc-ink);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.012em;
  line-height: 1.25;
}

.fcurr-stage p,
.fcurr-stage li,
.fcurr-stage label { color: var(--fc-ink); }

.fcurr-stage p { margin: 0 0 1rem; }

.fcurr-stage .fcurr-en,
.fcurr-stage .fcurr-muted,
.fcurr-stage .fcurr-count,
.fcurr-stage .fcurr-support,
.fcurr-stage .fcurr-save-status,
.fcurr-stage .fcurr-feedback,
.fcurr-stage .fcurr-input-label,
.fcurr-stage .fcurr-textarea-label,
.fcurr-stage .fcurr-rate,
.fcurr-stage .fcurr-voice { color: var(--fc-muted); }

.fcurr-stage .fcurr-feedback-ok { color: var(--fc-success); }
.fcurr-stage .fcurr-feedback-no { color: var(--fc-danger); }
.fcurr-stage .fcurr-feedback-warn { color: var(--fc-warning); }

.fcurr-list {
  max-width: 65ch;
  margin: 0 0 20px;
  padding-left: 1.3rem;
  line-height: 1.72;
}

.fcurr-list li + li { margin-top: .45rem; }
.fcurr-list li::marker { color: var(--fc-accent); }

/* Grouped explanation, outcome, pronunciation and transfer surfaces. */
.fcurr-callout,
.fcurr-explanation,
.fcurr-pronunciation,
.fcurr-transfer,
.fcurr-bank {
  margin: 20px 0;
  padding: 20px 22px;
  border: 1px solid rgba(0, 113, 227, .20);
  border-radius: var(--fc-radius-md);
  background: var(--fc-accent-soft);
}

.fcurr-callout > strong,
.fcurr-bank > strong,
.fcurr-transfer > strong {
  display: block;
  color: var(--fc-ink);
  font-weight: 700;
}

.fcurr-callout p,
.fcurr-explanation p,
.fcurr-pronunciation p,
.fcurr-transfer p {
  max-width: 65ch;
  margin: .6rem 0 0;
  line-height: 1.7;
}

.fcurr-callout p:last-child,
.fcurr-explanation p:last-child,
.fcurr-pronunciation p:last-child,
.fcurr-transfer p:last-child { margin-bottom: 0; }

.fcurr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.fcurr-grid > div {
  padding: 20px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: var(--fc-card-subtle);
}

.fcurr-grid h3 { margin: 0 0 9px; }
.fcurr-grid p { max-width: 65ch; margin: 0; line-height: 1.65; }

.fcurr-vocab {
  display: grid;
  gap: 0;
  margin: 12px 0 24px;
  padding: 0 18px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: var(--fc-card-subtle);
}

.fcurr-vocab-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 58px;
  padding: 12px 0;
  border-bottom: 1px solid var(--fc-line);
}

.fcurr-vocab-row:last-child { border-bottom: 0; }
.fcurr-fr { color: var(--fc-ink); font-weight: 650; }
.fcurr-en,
.fcurr-muted,
.fcurr-count,
.fcurr-support,
.fcurr-save-status { color: var(--fc-muted); }

.fcurr-models,
.fcurr-references {
  margin: 22px 0;
  padding: 20px 22px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: var(--fc-card-subtle);
}

.fcurr-models h3,
.fcurr-references h3 { margin: 0 0 4px; }

.fcurr-pair,
.fcurr-model,
.fcurr-reference-item,
.fcurr-partner-line {
  padding: 14px 0;
  border-bottom: 1px solid var(--fc-line);
}

.fcurr-pair:last-child,
.fcurr-model:last-child,
.fcurr-reference-item:last-child,
.fcurr-partner-line:last-child { border-bottom: 0; }

.fcurr-pair p,
.fcurr-model p,
.fcurr-reference-item p,
.fcurr-partner-line p {
  max-width: 65ch;
  margin: 0;
  line-height: 1.62;
}

.fcurr-pair p + p,
.fcurr-model p + p,
.fcurr-reference-item p + p,
.fcurr-partner-line p + p { margin-top: 4px; }

.fcurr-references > h3 { margin-bottom: 10px; }

/* ---------- Audio, details and support ---------- */
.fcurr-listening,
.fcurr-reading,
.fcurr-recognize-items,
.fcurr-partner {
  margin: 22px 0;
  padding: 22px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: var(--fc-card-subtle);
}

.fcurr-listening > h3,
.fcurr-reading > h3,
.fcurr-recognize-items > h3,
.fcurr-partner > h3 { margin: 0 0 12px; }

.fcurr-audio-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.fcurr-rate,
.fcurr-voice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--fc-muted);
  font-size: .86rem;
  line-height: 1.35;
}

.fcurr-rate input { width: 130px; accent-color: var(--fc-accent); }

.fcurr-voice select,
.fcurr-input-label input,
.fcurr-textarea-label textarea {
  min-height: 48px;
  border: 1px solid var(--fc-line-strong);
  border-radius: var(--fc-radius-sm);
  color: var(--fc-ink);
  background: var(--fc-card);
  font: inherit;
}

.fcurr-voice select {
  max-width: min(240px, 100%);
  padding: 9px 11px;
}

.fcurr-support {
  max-width: 65ch;
  margin: 10px 0;
  font-size: .9rem;
  line-height: 1.55;
}

.fcurr-support-used { color: var(--fc-warning); }

.fcurr-reveals,
.fcurr-model-reveal,
.fcurr-reference {
  margin: 18px 0;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-sm);
  background: var(--fc-card);
}

.fcurr-reveals details + details { border-top: 1px solid var(--fc-line); }

.fcurr-reveals summary,
.fcurr-model-reveal summary,
.fcurr-reference summary,
.fcurr-listening details > summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  color: var(--fc-ink);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.4;
}

.fcurr-reveals summary::marker,
.fcurr-model-reveal summary::marker,
.fcurr-reference summary::marker,
.fcurr-listening summary::marker { color: var(--fc-accent); }

.fcurr-reveals details > p,
.fcurr-reveals details > .fcurr-glossary,
.fcurr-model-reveal > p,
.fcurr-reference > .fcurr-reference-items,
.fcurr-listening details > p,
.fcurr-listening details > .fcurr-audio-toolbar {
  margin: 0;
  padding: 0 14px 14px;
}

.fcurr-reveals details > .fcurr-glossary { padding: 10px 14px; }

.fcurr-reading-text {
  max-width: 65ch;
  margin: 0 0 14px;
  color: var(--fc-ink);
  font-size: 1.08rem;
  line-height: 1.82;
  white-space: pre-line;
}

.fcurr-transcript { font-size: 1.05rem; }

.fcurr-glossary {
  display: grid;
  gap: 0;
  padding: 10px 14px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-sm);
  background: var(--fc-card-subtle);
}

.fcurr-glossary > strong { margin-bottom: 5px; }

.fcurr-gloss {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--fc-line);
}

.fcurr-gloss:last-child { border-bottom: 0; }

/* ---------- Exercises and answer states ---------- */
.fcurr-questions {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.fcurr-question,
.fcurr-practice-item {
  padding: 20px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: var(--fc-card);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.fcurr-question:focus-within,
.fcurr-practice-item:focus-within {
  border-color: var(--fc-accent);
  box-shadow: 0 0 0 3px var(--fc-accent-soft);
}

.fcurr-prompt {
  max-width: 65ch;
  margin: 0 0 14px;
  color: var(--fc-ink);
  font-weight: 650;
  line-height: 1.55;
}

.fcurr-options { display: grid; gap: 8px; }

.fcurr-option {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--fc-line-strong);
  border-radius: var(--fc-radius-sm);
  color: var(--fc-ink);
  background: var(--fc-card-subtle);
  font: inherit;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .12s ease;
}

.fcurr-option:hover,
.fcurr-option.selected,
.fcurr-option[aria-pressed="true"] {
  border-color: var(--fc-accent);
  background: var(--fc-accent-soft);
}

.fcurr-feedback {
  min-height: 1.5em;
  max-width: 65ch;
  margin: 12px 0 0;
  color: var(--fc-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.fcurr-feedback-ok { color: var(--fc-success); }
.fcurr-feedback-no { color: var(--fc-danger); }
.fcurr-feedback-warn { color: var(--fc-warning); }

.fcurr-frame {
  max-width: 65ch;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-sm);
  color: var(--fc-ink);
  background: var(--fc-card-subtle);
  font: .92rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.fcurr-frame span {
  display: block;
  margin-bottom: 4px;
  color: var(--fc-muted);
  font: 700 .68rem/1.3 system-ui, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.fcurr-bank {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.fcurr-bank > span { display: inline-flex; gap: 7px; flex-wrap: wrap; }

.fcurr-bank-item {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--fc-accent);
  background: var(--fc-card);
  font-size: .87rem;
  font-weight: 650;
}

.fcurr-input-label,
.fcurr-textarea-label {
  display: grid;
  gap: 8px;
  max-width: 65ch;
  margin: 16px 0;
  color: var(--fc-muted);
  font-size: .87rem;
  line-height: 1.45;
}

.fcurr-input-label input,
.fcurr-textarea-label textarea {
  width: 100%;
  padding: 11px 12px;
  resize: vertical;
}

.fcurr-textarea-label textarea { min-height: 120px; }

.fcurr-correction {
  max-width: 65ch;
  margin: 16px 0 0;
  padding: 15px 16px;
  border: 1px solid rgba(0, 113, 227, .22);
  border-left: 3px solid var(--fc-accent);
  border-radius: 0 var(--fc-radius-sm) var(--fc-radius-sm) 0;
  background: var(--fc-accent-soft);
}

.fcurr-correction[hidden] { display: none; }
.fcurr-correction > strong { display: block; margin-bottom: 6px; }
.fcurr-correction-answers p { margin: 7px 0 0; }
.fcurr-explanation { font-size: .92rem; }

.fcurr-criteria,
.fcurr-rating {
  display: grid;
  gap: 11px;
  max-width: 65ch;
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: var(--fc-card-subtle);
}

.fcurr-criteria legend,
.fcurr-rating legend {
  padding: 0 7px;
  color: var(--fc-ink);
  font-weight: 700;
}

.fcurr-criterion,
.fcurr-rating label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  color: var(--fc-ink);
  line-height: 1.5;
}

.fcurr-criterion input,
.fcurr-rating input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--fc-accent);
}

/* ---------- Buttons and audio controls ---------- */
.fcurr-speak,
.fcurr-stop,
.fcurr-check,
.fcurr-retry,
.fcurr-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 5px 7px 5px 0;
  padding: 8px 13px;
  border: 1px solid var(--fc-line-strong);
  border-radius: 12px;
  color: var(--fc-ink);
  background: var(--fc-card);
  font: inherit;
  font-size: .87rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.fcurr-speak:hover,
.fcurr-stop:hover,
.fcurr-check:hover,
.fcurr-retry:hover,
.fcurr-save-secondary:hover {
  color: var(--fc-accent);
  border-color: var(--fc-accent);
  background: var(--fc-accent-soft);
}

.fcurr-stop { color: var(--fc-danger); }
.fcurr-retry { color: var(--fc-muted); }

.fcurr-check,
.fcurr-save {
  color: #fff;
  border-color: var(--fc-accent);
  background: var(--fc-accent);
}

.fcurr-check:hover,
.fcurr-save:hover {
  color: #fff;
  background: color-mix(in srgb, var(--fc-accent) 86%, #000);
}

.fcurr-save-secondary { color: var(--fc-ink); background: transparent; }

.fcurr-lesson button:focus-visible,
.fcurr-lesson a:focus-visible,
.fcurr-lesson summary:focus-visible,
.fcurr-lesson select:focus-visible,
.fcurr-lesson input:focus-visible,
.fcurr-lesson textarea:focus-visible,
[data-curriculum-index] .fcurr-module a:focus-visible,
[data-curriculum-index] .fcurr-index-row:focus-visible {
  outline: 3px solid var(--fc-accent);
  outline-offset: 2px;
}

.fcurr-lesson button:active,
.fcurr-lesson select:active { transform: scale(.98); }

.fcurr-lesson button[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

/* ---------- Completion / empty states ---------- */
.fcurr-evidence { margin: 0 0 20px; }
.fcurr-evidence h3 { margin-top: 0; }

.fcurr-save-status {
  min-height: 1.5em;
  margin: 10px 0;
  font-size: .9rem;
}

.fcurr-empty {
  padding: 24px;
  border: 1px dashed var(--fc-line-strong);
  border-radius: var(--fc-radius-md);
  color: var(--fc-muted);
  background: var(--fc-card-subtle);
}

.fcurr-next-stage {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 30px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--fc-line);
  color: var(--fc-accent);
  font-size: .9rem;
  font-weight: 650;
  text-align: right;
  text-decoration: none;
  transition: color .16s ease, transform .12s ease;
}

.fcurr-next-stage:hover { color: var(--fc-ink); text-decoration: underline; }

/* ---------- Generated course index cards and lesson rows ---------- */
[data-curriculum-index] [data-curriculum-modules] {
  display: grid;
  gap: 16px;
}

[data-curriculum-index] .fcurr-module {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-lg);
  background: var(--fc-card);
  box-shadow: var(--fc-shadow);
  color: var(--fc-ink);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

[data-curriculum-index] .fcurr-module::before { content: none; }

[data-curriculum-index] .fcurr-module:hover {
  border-color: var(--fc-accent);
  box-shadow: var(--fc-shadow-hover);
  transform: translateY(-2px);
}

[data-curriculum-index] .fcurr-module-no { margin-bottom: 14px; font-variant-numeric: tabular-nums; }

[data-curriculum-index] .fcurr-module h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 720;
  letter-spacing: -.025em;
  line-height: 1.2;
}

[data-curriculum-index] .fcurr-module p {
  max-width: 52ch;
  margin: 0;
  color: var(--fc-muted);
  font-size: .93rem;
  line-height: 1.65;
}

[data-curriculum-index] .fcurr-module a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 0;
  color: var(--fc-accent);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}

[data-curriculum-index] .fcurr-module a:hover { text-decoration: underline; }

[data-curriculum-index] [data-curriculum-list] {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  border: 0;
}

[data-curriculum-index] .fcurr-index-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 15px 18px;
  border: 1px solid var(--fc-line);
  border-radius: var(--fc-radius-md);
  background: var(--fc-card);
  box-shadow: 0 1px 1px rgba(29, 29, 31, .025);
  color: var(--fc-ink);
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .12s ease, background-color .16s ease;
}

[data-curriculum-index] .fcurr-index-row:hover {
  border-color: var(--fc-accent);
  background: var(--fc-card-subtle);
  box-shadow: var(--fc-shadow);
  transform: translateY(-2px);
}

[data-curriculum-index] .fcurr-index-no {
  color: var(--fc-accent);
  font-size: .82rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}

[data-curriculum-index] .fcurr-index-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

[data-curriculum-index] .fcurr-index-copy b {
  display: block;
  font-size: .99rem;
  font-weight: 680;
  letter-spacing: -.012em;
  line-height: 1.35;
}

[data-curriculum-index] .fcurr-index-copy span {
  display: block;
  color: var(--fc-muted);
  font-size: .87rem;
  line-height: 1.5;
}

[data-curriculum-index] .fcurr-index-status {
  min-width: 152px;
  padding: 7px 10px;
  border: 1px solid var(--fc-line);
  border-radius: 999px;
  color: var(--fc-muted);
  font-size: .75rem;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

[data-curriculum-index] .fcurr-index-status[data-status="developing"] {
  border-color: rgba(0, 113, 227, .30);
  color: var(--fc-accent);
  background: var(--fc-accent-soft);
}

[data-curriculum-index] .fcurr-index-status[data-status="can-do"] {
  border-color: rgba(29, 122, 69, .28);
  color: var(--fc-success);
  background: var(--fc-success-soft);
  font-weight: 700;
}

[data-curriculum-index] .fcurr-index-arrow {
  color: var(--fc-accent);
  font-size: 1.2rem;
  transition: transform .16s ease;
}

[data-curriculum-index] .fcurr-index-row:hover .fcurr-index-arrow { transform: translateX(3px); }

/* ---------- Small screens and accessibility preferences ---------- */
@media (max-width: 700px) {
  .fcurr-stage-nav {
    gap: 4px;
    margin-bottom: 20px;
    padding: 7px;
  }

  .fcurr-stage-link { padding-inline: 11px; }
  .fcurr-stage-link-last { margin-left: 0; }

  .fcurr-voice {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .fcurr-voice select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .fcurr-stage {
    padding: 26px 18px 32px;
    border-radius: 22px;
  }

  .fcurr-grid,
  .fcurr-vocab-row,
  .fcurr-gloss { grid-template-columns: 1fr; }

  .fcurr-vocab { padding-inline: 14px; }
  .fcurr-listening,
  .fcurr-reading,
  .fcurr-recognize-items,
  .fcurr-partner { padding: 18px; }

  [data-curriculum-index] .fcurr-index-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 12px;
    min-height: 78px;
    padding: 15px;
  }

  [data-curriculum-index] .fcurr-index-status {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }

  [data-curriculum-index] .fcurr-index-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fcurr-stage-nav { scroll-behavior: auto; }

  .fcurr-lesson *,
  [data-curriculum-index] .fcurr-module,
  [data-curriculum-index] .fcurr-index-row {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .fcurr-stage-nav {
    background: var(--fc-card);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .fcurr-stage-nav,
  .fcurr-stage,
  .fcurr-module,
  .fcurr-index-row,
  .fcurr-question,
  .fcurr-practice-item,
  .fcurr-option,
  .fcurr-criteria,
  .fcurr-rating { border-color: var(--fc-line-strong); }

  .fcurr-stage-nav { background: var(--fc-card); }
}
