:root {
  --blue: #2a7f77;
  --blue-dark: #1f625c;
  --sky: #f9f6f0;
  --ink: #25403e;
  --muted: #566f6c;
  --card: #ffffff;
  --line: #dfe9e4;
  --yellow: #ffd75e;
  --coral: #f5907f;
  --green: #47b881;
  --purple: #2a7f77;
  --radius: 24px;
  --shadow: 0 12px 30px rgba(30, 70, 66, .10);
}

* { box-sizing: border-box; }

html { background: #fbf6ea; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, #dff1ec 0 16%, transparent 36%),
    radial-gradient(circle at 100% 20%, #fff3d2 0 14%, transparent 36%),
    #fbf6ea;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 1.125rem;
}

button { font: inherit; }
button, [role="button"] { touch-action: manipulation; }
main:focus, main:focus-visible { outline: none; }
button:focus-visible, [tabindex]:focus-visible { outline: 4px solid #ffbe2e; outline-offset: 3px; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 7px max(18px, env(safe-area-inset-left));
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; border: 0; background: none; color: var(--ink); font-weight: 800; font-size: 1.12rem; cursor: pointer; }
.brand-mark { display: block; width: 40px; height: 40px; border-radius: 13px; box-shadow: 0 6px 14px rgba(42,127,119,.24); }
.voice-control { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.voice-control select { min-height: 40px; padding: 7px 32px 7px 12px; border: 2px solid var(--line); border-radius: 12px; background-color: #fbf8f3; color: var(--ink); font-weight: 800; cursor: pointer; }

main { width: min(1800px, 100%); margin: 0 auto; padding: 24px 32px 70px; }

.hero { display: grid; grid-template-columns: 1.3fr .7fr; align-items: center; gap: 30px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .88rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; max-width: 760px; font-size: clamp(2.1rem, 5vw, 4rem); line-height: .98; letter-spacing: -.04em; }
.hero p:not(.eyebrow) { margin: 16px 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.hero-shapes { position: relative; height: 175px; }
.shape { position: absolute; display: grid; place-items: center; border-radius: 30px; box-shadow: var(--shadow); font-size: 3rem; }
.shape.one { left: 15%; top: 0; width: 120px; height: 120px; background: var(--yellow); transform: rotate(-7deg); }
.shape.two { right: 2%; bottom: 0; width: 130px; height: 105px; background: #bce8d1; transform: rotate(6deg); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 34px 0 16px; }
.section-heading h2 { margin: 0; font-size: 1.45rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .92rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }

.story-card { overflow: hidden; padding: 0; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.story-card:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(30,70,66,.16); }
.story-card:active { transform: scale(.985); }
.story-cover { min-height: 0; aspect-ratio: 3 / 1; background-color: #fbf9f4; background-repeat: no-repeat; background-size: 100% auto; background-position: center bottom; }
.story-card.perfect .story-cover { background-position: center bottom; }
.story-info { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 22px; }
.story-info h3 { margin: 0 0 6px; font-size: 1.35rem; }
.story-info p { margin: 0; color: var(--muted); font-size: .88rem; }
.go { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--blue); color: white; font-size: 1.5rem; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quick { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 8px 20px rgba(30,70,66,.06); }
.quick span { display: block; margin-bottom: 8px; font-size: 1.8rem; }
.quick strong { display: block; margin-bottom: 5px; }
.quick small { color: var(--muted); line-height: 1.4; }

.back-button, .action-button, .choice, .step-dot, .picto-card, .sequence-card { border: 0; cursor: pointer; }
.back-button { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 12px 16px; border-radius: 14px; background: #f9f5ee; color: var(--blue-dark); font-weight: 800; }
.story-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.story-head h1 { font-size: clamp(2rem, 4vw, 3rem); }
.progress-copy { color: var(--muted); font-weight: 800; white-space: nowrap; }
.reader { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .85fr); align-items: start; gap: 20px; }
.reader-card { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.reader-art { aspect-ratio: 1 / 1; min-height: 0; background-color: #fbf9f4; background-repeat: no-repeat; background-size: 300% auto; background-position-y: bottom; transition: background-position .3s ease; }
.reader-copy { display: flex; flex-direction: column; justify-content: center; padding: 20px; }
.reader-copy p { min-height: 0; margin: 0; font-size: clamp(1.15rem, 1.55vw, 1.38rem); font-weight: 800; line-height: 1.5; }
.story-word { padding: 1px 2px; border-radius: 5px; transition: background-color .12s ease, color .12s ease; }
.story-word.reading { background: #ffd75e; color: #1d3533; box-shadow: 0 0 0 2px #ffd75e; }
.reader-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.reader-card .action-button { min-height: 44px; padding: 9px 13px; border-radius: 13px; font-size: .88rem; }
.reading-speed-control { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 5px 7px 5px 11px; border: 2px solid var(--line); border-radius: 13px; background: white; color: var(--muted); font-size: .78rem; font-weight: 800; }
.reading-speed-control select { min-height: 30px; border: 0; border-radius: 8px; background: #f8f4ed; color: var(--ink); font-weight: 800; }
.recording-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.record-button.recording { background: #d94d42; color: white; }
.self-audio { width: min(100%, 310px); height: 44px; }
.record-note { width: 100%; color: var(--muted); font-size: .78rem; font-weight: 700; }
.action-button { min-height: 54px; padding: 13px 19px; border-radius: 16px; background: var(--blue); color: white; font-weight: 800; }
.action-button.secondary { background: #f8f4ed; color: var(--ink); }
.action-button:disabled { opacity: .45; cursor: default; }
.story-map { padding: 22px; border: 1px solid var(--line); border-radius: 28px; background: #faf8f3; }
.story-map h2 { margin: 0 0 8px; font-size: 1.25rem; }
.story-map > p { margin: 0 0 18px; color: var(--muted); font-size: .9rem; }
.steps { display: grid; gap: 10px; }
.step-dot { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; border-radius: 15px; background: rgba(255,255,255,.7); color: var(--ink); font-weight: 800; }
.step-dot span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: white; color: var(--blue); }
.step-dot.active { background: var(--blue); color: white; }
.step-dot.active span { background: white; }
.challenge-button { width: 100%; margin-top: 18px; background: var(--coral); }

.activity-nav { margin-bottom: 12px; }
.session-badge { display: inline-flex; align-items: center; margin-bottom: 9px; padding: 8px 13px; border-radius: 999px; background: #fff4c7; color: #725400; font-size: .82rem; font-weight: 800; }
.mode-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px; }
.mode-tabs button { min-height: 50px; padding: 12px 18px; white-space: nowrap; border: 0; border-radius: 15px; background: #ebf4f3; color: var(--ink); font-weight: 800; cursor: pointer; }
.mode-tabs button.active { background: var(--blue); color: white; }
.activity-panel { padding: 26px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: var(--shadow); }
.question-count { color: var(--blue); font-weight: 800; }
.question { margin: 8px 0 22px; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.choice { display: grid; grid-template-rows: minmax(96px, 1fr) auto; align-items: center; justify-items: stretch; overflow: hidden; min-height: 158px; padding: 10px; border: 3px solid transparent; border-radius: 20px; background: #f9f5ee; color: var(--ink); font-size: 1.05rem; font-weight: 800; cursor: pointer; }
.choice > span:last-child { padding: 10px 8px 5px; text-align: center; }
.activity-emoji { display: grid; place-items: center; width: 100%; min-height: 96px; border-radius: 14px; background: white; font-size: 3.3rem; }
.activity-picto { display: block; width: min(100%, 140px); aspect-ratio: 1; margin: 0 auto; border-radius: 14px; background-color: white; background-image: url('cuento02.jpeg'); background-size: 731% auto; background-repeat: no-repeat; }
.choice.correct { border-color: var(--green); background: #e7f8ef; }
.choice.wrong { border-color: var(--coral); background: #fff0ec; }
.feedback { min-height: 34px; margin: 18px 0 0; font-size: 1.15rem; font-weight: 800; }
.feedback.good { color: #167c4e; }

.sequence-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sequence-card { position: relative; display: grid; grid-template-rows: 118px auto; align-content: start; overflow: hidden; min-height: 176px; padding: 9px; border: 3px solid transparent; border-radius: 20px; background: #f9f5ee; color: var(--ink); font-weight: 800; line-height: 1.3; cursor: pointer; }
.sequence-symbol { display: grid; place-items: center; width: 100%; height: 118px; border-radius: 14px; background: white; font-size: clamp(2.8rem, 6vw, 4.4rem); }
.sequence-card strong { padding: 10px 6px 4px; text-align: center; }
.sequence-card.selected { border-color: var(--blue); background: #f8f4eb; }
.sequence-card .number { position: absolute; top: 17px; left: 17px; display: grid; place-items: center; width: 38px; height: 38px; margin: 0; border-radius: 50%; background: white; color: var(--blue); box-shadow: 0 3px 10px rgba(30,70,66,.18); }

.picto-intro { max-width: 760px; margin-bottom: 24px; }
.picto-intro h1 { margin-bottom: 12px; }
.picto-intro p { color: var(--muted); line-height: 1.55; }
.picto-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.picto-card { overflow: hidden; padding: 8px 8px 12px; border: 2px solid var(--line); border-radius: 20px; background: white; color: var(--ink); box-shadow: 0 7px 16px rgba(30,70,66,.07); font-weight: 800; }
.picto-card:active { transform: scale(.97); }
.picto-image { aspect-ratio: 1; border-radius: 14px; background-image: url('cuento02.jpeg'); background-size: 731% auto; background-repeat: no-repeat; }
.picto-card span { display: block; min-height: 2.4em; margin-top: 8px; font-size: .72rem; line-height: 1.18; }
.picto-card.speaking { border-color: var(--yellow); background: #fff9df; }
.sentence-builder { margin: 0 0 30px; padding: 26px; border: 1px solid #d3e8e5; border-radius: 28px; background: linear-gradient(135deg, #f9f6f0, #fff9df); box-shadow: var(--shadow); }
.sentence-builder-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.sentence-builder h2 { margin: 0 0 5px; font-size: 1.5rem; }
.sentence-builder p { margin: 0; color: var(--muted); }
.sentence-stage { min-height: 150px; display: flex; align-items: stretch; gap: 10px; overflow-x: auto; padding: 15px; border: 3px dashed #a6ddd4; border-radius: 20px; background: white; }
.sentence-empty { display: grid; place-items: center; width: 100%; color: var(--muted); font-weight: 800; }
.sentence-piece { display: grid; flex: 0 0 92px; grid-template-rows: 72px auto; align-items: center; justify-items: center; padding: 8px; border-radius: 16px; background: #fbf9f5; }
.sentence-piece .visual { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 14px; background: white; font-size: 2.3rem; box-shadow: 0 4px 10px rgba(30,70,66,.08); }
.sentence-piece strong { margin-top: 8px; text-align: center; font-size: .9rem; line-height: 1.1; }
.sentence-text { min-height: 42px; margin: 14px 0 0 !important; color: var(--ink) !important; font-size: 1.4rem; font-weight: 800; }
.builder-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 22px; }
.builder-actions .action-button { min-height: 48px; padding-block: 10px; }
.pace-control { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px 6px 14px; border: 2px solid #d9ece9; border-radius: 15px; background: white; color: var(--ink); font-weight: 800; }
.pace-control select { min-height: 34px; border: 0; border-radius: 9px; background: #f9f5ee; color: var(--ink); font-weight: 800; }
.word-groups { display: grid; gap: 14px; }
.word-group h3 { margin: 0 0 8px; color: var(--blue-dark); font-size: .86rem; letter-spacing: .06em; text-transform: uppercase; }
.token-options { display: flex; flex-wrap: wrap; gap: 8px; }
.token-button { min-height: 52px; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 2px solid #d9ece9; border-radius: 15px; background: white; color: var(--ink); font-weight: 800; cursor: pointer; }
.token-button span { font-size: 1.45rem; }
.token-button.connector { border-color: #f0ca55; background: #fff7d8; }
.full-story-dialog { width: min(920px, calc(100% - 28px)); max-height: 92vh; padding: 0; border: 0; border-radius: 26px; background: white; box-shadow: 0 24px 80px rgba(20,50,48,.35); }
.full-story-dialog::backdrop { background: rgba(16,35,55,.66); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: white; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.2rem; }
.dialog-close { width: 46px; height: 46px; border: 0; border-radius: 50%; background: #f8f4ed; color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.full-story-dialog img { display: block; width: 100%; height: auto; }
.word-section { margin-top: 34px; padding: 26px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: var(--shadow); }
.word-section h2 { margin: 0 0 6px; }
.word-section > p { margin: 0 0 18px; color: var(--muted); }
.vocabulary-groups { display: grid; gap: 22px; }
.vocabulary-group h3 { margin: 0 0 10px; color: var(--blue-dark); font-size: 1rem; }
.word-bank { display: flex; flex-wrap: wrap; gap: 10px; }
.word-chip { min-height: 50px; padding: 11px 17px; border: 2px solid #daece9; border-radius: 999px; background: #fbf9f4; color: var(--ink); font-weight: 800; cursor: pointer; }
.word-chip:active, .word-chip.speaking { border-color: var(--purple); background: #f9f6f0; }
.source-sheet { margin-top: 22px; }
.source-sheet summary { cursor: pointer; color: var(--blue-dark); font-weight: 800; }
.source-sheet img { display: block; width: min(100%, 780px); margin: 16px auto 0; border-radius: 18px; border: 1px solid var(--line); }

.celebration { text-align: center; padding: 34px; }
.celebration .big { font-size: 4rem; }
.celebration h2 { margin: 8px 0; font-size: 2rem; }

.main-nav { display: flex; flex: 1 1 auto; justify-content: center; gap: 6px; }
.main-nav button { display: grid; grid-template-columns: 21px 1fr; align-items: center; min-width: 104px; min-height: 42px; padding: 6px 11px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font-size: .88rem; font-weight: 800; cursor: pointer; }
.main-nav button span { font-size: 1.15rem; }
.main-nav button.active { background: var(--blue); color: white; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 28px; padding: 13px 20px; transform: translate(-50%, 20px); border-radius: 999px; background: var(--ink); color: white; opacity: 0; pointer-events: none; transition: .2s ease; font-weight: 800; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 821px) {
  .reader-card { align-self: start; grid-template-columns: minmax(300px, .95fr) minmax(360px, 1.05fr); }
  .reader-actions { display: grid; grid-template-columns: minmax(112px, .8fr) minmax(165px, 1.2fr); }
  .reader-actions > .action-button { width: 100%; }
  .reader-actions > [data-action="full-story"] { grid-column: 1 / -1; }
  .recording-tools { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .record-note { width: auto; line-height: 1.35; }
  .self-audio { grid-column: 1 / -1; }
  .story-map { padding: 20px; }
  .story-map > p { margin-bottom: 14px; }
  .story-map .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .story-map .step-dot { min-height: 54px; padding: 7px 9px; }
  .story-map .challenge-button { min-height: 48px; margin-top: 14px; }
}

@media (max-width: 820px) {
  main { padding: 28px 22px 60px; }
  .topbar { gap: 8px; padding-inline: 12px; }
  .brand span:last-child { display: none; }
  .main-nav button { min-width: 0; padding-inline: 10px; }
  .hero { grid-template-columns: 1fr; }
  .hero-shapes { display: none; }
  .reader { grid-template-columns: 1fr; }
  .reader-card { grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); }
  .back-button { margin-bottom: 12px; }
  .story-head { margin-bottom: 14px; }
  .story-map { display: grid; grid-template-columns: auto minmax(260px, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 4px 14px; padding: 12px 14px; }
  .story-map h2 { grid-column: 1; grid-row: 1; margin: 0; font-size: 1rem; }
  .story-map > p { grid-column: 1; grid-row: 2; margin: 0; font-size: .72rem; }
  .story-map .steps { grid-column: 2; grid-row: 1 / 3; }
  .story-map .challenge-button { grid-column: 3; grid-row: 1 / 3; width: auto; min-height: 44px; margin: 0; padding: 8px 12px; font-size: .82rem; }
  .steps { grid-template-columns: repeat(6, 1fr); }
  .step-dot { display: block; padding: 7px; text-align: center; font-size: 0; }
  .step-dot span { margin: auto; font-size: 1rem; }
  .picto-grid { grid-template-columns: repeat(4, 1fr); }
  .sentence-builder-head { align-items: start; flex-direction: column; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .brand { gap: 8px; font-size: .9rem; line-height: 1.08; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .voice-control > span { display: none; }
  .voice-control select { max-width: 105px; padding-inline: 8px; }
  main { padding-inline: 15px; }
  .cards, .quick-grid, .choices, .sequence-list { grid-template-columns: 1fr; }
  .story-cover { min-height: 0; }
  .reader-card { grid-template-columns: 1fr; }
  .reader-art { min-height: 280px; }
  .story-map { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .story-map h2, .story-map > p { display: none; }
  .story-map .steps { grid-column: 1; grid-row: 1; }
  .story-map .challenge-button { grid-column: 1; grid-row: 2; width: 100%; margin-top: 7px; }
  .story-head { align-items: start; flex-direction: column; }
  .picto-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .picto-card { border-radius: 16px; }
  .main-nav { gap: 2px; }
  .main-nav button { grid-template-columns: 1fr; min-width: 0; min-height: 44px; padding: 5px; font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.question-row { display: flex; align-items: center; gap: 14px; margin: 8px 0 22px; }
.question-row .question { margin: 0; }
.listen-button { flex: 0 0 auto; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--blue); color: white; font-size: 1.5rem; cursor: pointer; }

.order-help { margin: 8px 0 0; color: var(--muted); font-size: 1.05rem; }
.order-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.order-slot { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 3px dashed #c7e2de; border-radius: 16px; background: #fcfaf7; color: var(--muted); font-weight: 800; }
.order-slot small { font-size: .72rem; }
.order-slot span { font-size: 1.7rem; line-height: 1.3; }
.order-slot.next { border-color: var(--blue); color: var(--blue); background: #f9f6f0; }
.order-slot.filled { border-style: solid; border-color: var(--green); background: #e7f8ef; color: var(--ink); }
.order-prompt { margin: 0 0 14px; font-size: 1.5rem; font-weight: 800; }
.sequence-card.hint { border-color: #f0b400; background: #fff6d0; box-shadow: 0 0 0 5px rgba(255, 190, 46, .45); }
.sequence-card.selected { opacity: .55; cursor: default; }
.order-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hint-button { background: #f0b400; color: #3d2d00; }
@media (max-width: 600px) { .order-slots { grid-template-columns: repeat(3, 1fr); } }

/* Escritorio: cada pantalla cabe en la altura de la ventana (100vh), sin scroll. Pictogramas sigue con scroll por su cantidad de contenido. */
@media (min-width: 821px) and (min-height: 620px) {
  main.fit { height: calc(100vh - 62px); padding-block: 12px 14px; overflow: hidden; display: flex; flex-direction: column; }
  main.fit > * { flex-shrink: 0; }
  main.fit h1 { font-size: clamp(1.7rem, 4.4vh, 2.6rem); }
  main.fit .back-button { margin-bottom: 8px; padding: 8px 14px; align-self: flex-start; }
  main.fit .story-head { margin-bottom: 8px; }
  main.fit .section-heading { margin: 14px 0 8px; }

  /* Inicio y biblioteca */
  main.fit .hero { margin-bottom: 0; gap: 20px; }
  main.fit .hero-shapes { height: 12vh; }
  main.fit .shape.one { width: 9vh; height: 9vh; font-size: 2.2rem; }
  main.fit .shape.two { width: 10vh; height: 8vh; font-size: 2.2rem; }
  main.fit .hero p:not(.eyebrow) { margin-top: 6px; }
  main.fit .story-cover { aspect-ratio: 3 / 1; height: auto; }
  main.fit[data-view='home'], main.fit[data-view='stories'] { justify-content: space-evenly; }
  main.fit .story-info { padding: 12px 18px; }
  main.fit .quick { padding: 12px 16px; }
  main.fit .quick span { margin-bottom: 2px; font-size: 1.4rem; }

  /* Lector */
  main.fit .reader { flex: 1; min-height: 0; align-items: center; }
  main.fit .reader-card { align-self: center; grid-template-columns: min(var(--w, 48%), calc((100vh - 15rem) * var(--ar, 1.01))) minmax(0, 1fr); }
  main.fit .reader-art { align-self: center; width: 100%; height: auto; min-height: 0; margin: 14px; width: calc(100% - 28px); border-radius: 18px; }
  main.fit .reader-copy { min-height: 0; padding: 22px 26px; }
  main.fit .reader-copy p { font-size: clamp(1.25rem, 1.15rem + .55vw, 1.9rem); }
  main.fit .story-map { overflow: auto; padding: 14px; }
  main.fit .story-map .step-dot { min-height: 46px; }

  /* Actividades */
  main.fit .activity-nav { margin-bottom: 8px; }
  main.fit .session-badge { margin-bottom: 6px; padding: 5px 11px; }
  main.fit .mode-tabs button { min-height: 42px; padding-block: 8px; }
  main.fit .activity-panel { flex: 1; min-height: 0; padding: 16px 22px; overflow: hidden; display: flex; flex-direction: column; }
  main.fit .question-row { margin: 4px 0 12px; }
  main.fit .question { font-size: clamp(1.3rem, 3.4vh, 1.9rem); }
  main.fit .listen-button { width: 46px; height: 46px; font-size: 1.2rem; }
  main.fit .choices { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  main.fit .choice { min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  main.fit .activity-emoji { min-height: 0; height: 100%; font-size: clamp(2.4rem, 9vh, 4rem); }
  main.fit .activity-picto { width: auto; height: 100%; max-width: 100%; }
  main.fit .feedback { min-height: 26px; margin-top: 8px; }
  main.fit .celebration { justify-content: center; }

  /* Ordenar: seis tarjetas en una sola fila */
  main.fit .order-slots { margin-bottom: 8px; }
  main.fit .order-slot { padding: 4px; }
  main.fit .order-slot span { font-size: 1.3rem; line-height: 1.1; }
  main.fit .order-prompt { margin-bottom: 8px; font-size: 1.25rem; }
  main.fit .sequence-list { flex: 1; min-height: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 10px; }
  main.fit .sequence-card { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
  main.fit .sequence-symbol { height: 100%; font-size: clamp(2.2rem, 8vh, 3.6rem); }
  main.fit .sequence-card strong { padding: 6px 2px 2px; font-size: .9rem; }
  main.fit .sequence-card .number { top: 12px; left: 12px; width: 32px; height: 32px; }
  main.fit .order-buttons { margin-top: 6px; }
  main.fit .order-buttons .action-button { min-height: 44px; padding-block: 8px; }
}

.question-row .hint-button { margin-left: auto; min-height: 46px; padding: 8px 16px; }
.choice.hint { border-color: #f0b400; background: #fff6d0; box-shadow: 0 0 0 5px rgba(255, 190, 46, .45); }
.choice.faded { opacity: .3; pointer-events: none; filter: grayscale(.6); }

.scene-hint { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 10px 14px; border: 3px solid #f0b400; border-radius: 18px; background: #fff9df; }
.scene-hint-art { flex: 0 0 auto; width: 96px; aspect-ratio: 1; border-radius: 12px; background-color: #fbf9f4; background-repeat: no-repeat; background-size: 300% auto; background-position-y: center; }
.scene-hint p { margin: 0; font-size: 1.05rem; line-height: 1.4; font-weight: 700; }

/* Pantallas grandes: todo se agranda un poco para aprovechar el espacio */
@media (min-width: 821px) and (min-height: 620px) {
  html { font-size: clamp(16px, min(1.1vw, 2vh), 24px); }
  main.fit { padding-inline: clamp(24px, 3vw, 56px); }
  main.fit .activity-panel { padding: 18px clamp(22px, 2.4vw, 44px); }
}

/* Pictogramas: la frase queda fija arriba y el resto se desplaza en su propio panel */
.sentence-builder { margin: 0 0 12px; padding: 12px 16px; border-radius: 20px; }
.sentence-builder-head { align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.sentence-builder h2 { margin: 0; font-size: 1.15rem; }
.sentence-builder .builder-actions { margin: 0; gap: 8px; }
.sentence-builder .builder-actions .action-button { min-height: 42px; padding: 8px 14px; font-size: .9rem; }
.sentence-builder .pace-control { min-height: 42px; font-size: .9rem; }
.sentence-stage { min-height: 0; padding: 8px 10px; border-width: 2px; border-radius: 16px; }
.sentence-piece { flex: 0 0 auto; min-width: 74px; grid-template-rows: 48px auto; padding: 5px 8px; }
.sentence-piece .visual { width: 46px; height: 46px; font-size: 1.6rem; border-radius: 12px; }
.sentence-piece strong { margin-top: 4px; font-size: .85rem; }
.sentence-empty { min-height: 72px; }
.picto-tabs { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; overflow-x: auto; }
.picto-tabs button { min-height: 44px; padding: 8px 18px; border: 0; border-radius: 13px; background: #ebf4f3; color: var(--ink); font-weight: 800; white-space: nowrap; cursor: pointer; }
.picto-tabs button.active { background: var(--blue); color: white; }
.picto-tip { margin-left: auto; color: var(--muted); font-size: .85rem; font-weight: 700; white-space: nowrap; }
.picto-panel { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.picto-panel .picto-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.picto-panel .word-groups { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; gap: 18px; }
.picto-panel .word-section { margin: 0; }

@media (min-width: 821px) and (min-height: 620px) {
  main.fit[data-view='pictos'] .picto-panel { flex: 1; min-height: 0; overflow: auto; }
  main.fit[data-view='pictos'] .picto-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 11vw, 170px), 1fr)); }
}

/* Vocabulario con imágenes */
.vocab-filter { position: sticky; top: -18px; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin: -18px -18px 16px; padding: 14px 18px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.vocab-filter button { min-height: 38px; padding: 6px 14px; border: 2px solid #daece9; border-radius: 999px; background: #fbf9f4; color: var(--ink); font-size: .85rem; font-weight: 800; cursor: pointer; }
.vocab-filter button.active { border-color: var(--blue); background: var(--blue); color: white; }
.vocabulary-group { margin-bottom: 22px; }
.vocabulary-group h3 { margin: 0 0 10px; color: var(--blue-dark); font-size: 1rem; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(104px, 9vw, 150px), 1fr)); gap: 10px; }
.vocab-card { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 12px; border: 2px solid var(--line); border-radius: 18px; background: white; color: var(--ink); cursor: pointer; box-shadow: 0 5px 12px rgba(30,70,66,.06); }
.vocab-card:active { transform: scale(.97); }
.vocab-card.speaking { border-color: var(--yellow); background: #fff9df; }
.vocab-emoji { display: grid; place-items: center; width: 100%; height: clamp(54px, 7vh, 80px); border-radius: 12px; background: #fbf9f5; font-size: clamp(2rem, 4.2vh, 3rem); line-height: 1; }
.vocab-word { font-size: .95rem; font-weight: 800; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }

/* Frase + escena */
.sentence-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 26%); gap: 12px; }
.sentence-body .sentence-stage { min-height: 132px; align-items: center; }
.sentence-scene { min-height: 132px; }
.scene, .scene-empty { height: 100%; min-height: 132px; border-radius: 16px; }
.scene-empty { display: grid; place-items: center; padding: 10px; border: 2px dashed #c7e2de; color: var(--muted); font-size: .85rem; font-weight: 700; text-align: center; }
.scene { position: relative; display: grid; place-items: end center; overflow: hidden; border: 2px solid #d3e8e5; }
.scene-place { position: absolute; top: 8px; right: 12px; font-size: 2.2rem; opacity: .9; }
.scene-stage { display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding-bottom: 10px; }
.scene-actor { position: relative; font-size: 4.2rem; line-height: 1; animation: scene-bob 2.6s ease-in-out infinite; }
.scene-mood { position: absolute; top: -12px; right: -18px; font-size: 1.7rem; }
.scene-thing { font-size: 3.2rem; line-height: 1; margin-bottom: 4px; }
@keyframes scene-bob { 50% { transform: translateY(-4px); } }
.sentence-piece.reading { background: #ffd75e; box-shadow: 0 0 0 3px #ffd75e; transform: scale(1.05); }
.sentence-piece { transition: background-color .15s ease, transform .15s ease; }
@media (max-width: 820px) { .sentence-body { grid-template-columns: 1fr; } }

/* ===== Refinamiento visual ===== */
:root {
  --blue: #2a7f77; --blue-dark: #1f625c; --ink: #25403e; --muted: #566f6c; --line: #dfe9e4; --card: #fff;
  --radius: 20px; --shadow: 0 1px 2px rgba(30, 70, 66, .06), 0 8px 22px rgba(30, 70, 66, .06);
}
html { background: #fbf6ea; }
body { background: #fbf6ea; font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; letter-spacing: .005em; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; }
h1 { line-height: 1.05; }
.eyebrow { color: var(--blue); font-size: .78rem; letter-spacing: .09em; }
.ico { width: 1.2em; height: 1.2em; flex: none; }
button { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }

.topbar { background: #fff; backdrop-filter: none; box-shadow: 0 1px 0 var(--line); }
.brand { gap: 12px; text-align: left; }
.brand-mark { box-shadow: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.main-nav { flex: 0 1 auto; margin: 0 auto; padding: 4px; gap: 2px; border-radius: 14px; background: #f8f5ee; }
.main-nav button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 40px; padding: 6px 16px; border-radius: 10px; font-size: .92rem; font-weight: 700; }
.main-nav button:hover:not(.active) { background: rgba(255,255,255,.7); color: var(--ink); }
.main-nav button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(30,70,66,.14); }
.voice-control select { border-radius: 10px; font-weight: 700; }

.hero { grid-template-columns: 1fr; }
.hero-shapes { display: none; }
.hero p:not(.eyebrow) { color: var(--muted); }
.story-card, .quick, .activity-panel, .reader-card, .word-section, .picto-panel { box-shadow: var(--shadow); }
.story-card:hover { box-shadow: 0 2px 4px rgba(30,70,66,.08), 0 14px 30px rgba(30,70,66,.10); }
.go { background: var(--blue); }
.quick { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; row-gap: 2px; border-radius: 16px; box-shadow: none; }
.quick span { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; border-radius: 12px; background: #f9f5ee; color: var(--blue); font-size: 1.3rem; }
.quick strong { margin: 0; align-self: end; }
.quick small { align-self: start; }

.action-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; font-weight: 700; box-shadow: 0 1px 2px rgba(30,70,66,.12); }
.action-button:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); }
.action-button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.action-button.secondary:hover:not(:disabled) { background: #faf7f2; color: var(--ink); }
.challenge-button { background: #c94f3d; }
.challenge-button:hover:not(:disabled) { background: #a83f30; }
.hint-button { background: #fff4d6; color: #6b4a00; border: 1px solid #f0cf7a; box-shadow: none; }
.hint-button:hover:not(:disabled) { background: #ffe9ad; color: #4a3300; }
.back-button { background: transparent; color: var(--muted); padding: 8px 12px 8px 6px; border-radius: 10px; font-weight: 700; }
.back-button:hover { background: #e9f3f2; color: var(--ink); }
.listen-button { display: inline-grid; place-items: center; box-shadow: 0 1px 2px rgba(30,70,66,.2); }

.session-badge { gap: 6px; background: #f8f5ee; color: var(--muted); font-size: .8rem; font-weight: 700; }
.mode-tabs { gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border-radius: 14px; background: #ebf4f3; }
.mode-tabs button { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; background: transparent; font-weight: 700; }
.mode-tabs button:hover:not(.active) { background: rgba(255,255,255,.7); }
.mode-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(30,70,66,.14); }
.picto-tabs { gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border-radius: 14px; background: #ebf4f3; }
.picto-tabs button { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; background: transparent; font-weight: 700; }
.picto-tabs button:hover:not(.active) { background: rgba(255,255,255,.7); }
.picto-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(30,70,66,.14); }
.picto-tip { margin-left: 16px; }

.choice, .sequence-card, .picto-card, .vocab-card { border-radius: 16px; }
.choice:hover:not(.faded), .picto-card:hover, .vocab-card:hover, .token-button:hover { border-color: #8fcfc3; }
.sequence-card:hover:not(:disabled) { border-color: #8fcfc3; }
.step-dot { border-radius: 12px; font-weight: 700; }
.step-dot.active { background: var(--blue); }
.story-map { background: #fff; border-color: var(--line); box-shadow: var(--shadow); border-radius: 22px; }
.reader-card, .activity-panel { border-radius: 22px; }
.reader-art { border-radius: 14px; }
.sentence-builder { background: #fff; border-color: var(--line); }
.sentence-stage { border-color: #c6e2dd; background: #fefdfc; }
.sentence-piece { background: #faf7f2; }
.token-button, .word-chip { font-weight: 700; }
.celebration .big .ico { width: 4rem; height: 4rem; color: #f0b400; fill: #ffd75e; }
.toast { background: #25403e; font-weight: 600; }
.order-slot, .vocab-filter button { font-weight: 700; }

* { scrollbar-width: thin; scrollbar-color: #c3dcd8 transparent; }

@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Nombre */
.name-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 180px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }
.name-button:hover { background: #faf7f2; }
.name-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-dialog { width: min(440px, calc(100% - 32px)); padding: 28px; border: 0; border-radius: 22px; box-shadow: 0 24px 80px rgba(20,50,48,.35); }
.name-dialog::backdrop { background: rgba(16,35,55,.6); backdrop-filter: blur(4px); }
.name-dialog h2 { margin: 0 0 6px; font-size: 1.6rem; }
.name-dialog p { margin: 0 0 18px; color: var(--muted); }
.name-dialog input { width: 100%; min-height: 56px; margin-bottom: 14px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 14px; font: inherit; font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.name-dialog input:focus { border-color: var(--blue); outline: none; }
.name-dialog .action-button { width: 100%; min-height: 54px; font-size: 1.1rem; }
.picto-emoji { display: grid; place-items: center; background-image: none; background-color: #fbf9f5; font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 1; }
@media (max-width: 600px) { .name-button span { display: none; } .name-button { padding-inline: 10px; } }

/* Cuentos con una imagen por parte */
.story-card.custom .story-cover { background-size: cover; background-position: center; }
.activity-image { display: block; width: min(100%, 140px); aspect-ratio: 1; margin: 0 auto; border-radius: 14px; background-color: #fbf9f4; background-size: cover; background-position: center; }
.thumb { display: block; width: 100%; height: 100%; border-radius: 10px; background-size: cover; background-position: center; }
.order-slot .thumb { width: 36px; height: 36px; margin: 0 auto; }
.order-slot span { line-height: 1.1; }
.sequence-symbol .thumb { border-radius: 12px; }
@media (min-width: 821px) and (min-height: 620px) {
  main.fit .activity-image { width: auto; height: 100%; max-width: 100%; }
  main.fit .order-slots { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
  main.fit .sequence-list { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
}

/* Con más cuentos de los que caben, Inicio y Cuentos se desplazan en vez de recortarse */
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); } }
@media (min-width: 821px) and (min-height: 620px) {
  main.fit[data-view='home'], main.fit[data-view='stories'] { overflow-y: auto; }
  main.fit[data-view='home'] > *, main.fit[data-view='stories'] > * { flex-shrink: 0; }
}

.hero h1 .listen-button { width: 44px; height: 44px; margin-left: 8px; vertical-align: middle; font-size: 1.15rem; }

/* Textos largos: letra un poco menor y desplazamiento propio, para que la tarjeta no se salga de la pantalla */
@media (min-width: 821px) and (min-height: 620px) {
  main.fit .reader-card { max-height: 100%; grid-template-rows: minmax(0, 1fr); }
  main.fit .reader-copy { overflow-y: auto; }
  main.fit .reader-copy p.long { font-size: clamp(1.05rem, .95rem + .4vw, 1.5rem); }
}

/* Volver al sitio de CotyMom */
.site-link { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: .88rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-link:hover { background: #faf7f2; color: var(--ink); }
.site-link span:first-child { font-size: 1.3rem; line-height: 1; }
@media (max-width: 820px) { .site-link .t { display: none; } .site-link { padding-inline: 12px; } }

/* Celular: la barra de arriba pasa a dos filas (no cabe todo en una) y los botones son más fáciles de tocar */
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 6px 8px; padding-block: 8px; }
  .main-nav { order: 3; flex: 1 0 100%; width: 100%; justify-content: stretch; margin: 0; }
  .main-nav button { flex: 1 1 0; min-width: 0; padding-inline: 6px; font-size: .82rem; }
  .brand { margin-right: auto; }
  .back-button { min-height: 44px; }
  .vocab-filter button, .picto-tabs button, .mode-tabs button { min-height: 44px; }
  .reading-speed-control select, .pace-control select { min-height: 38px; }
}
@media (max-width: 420px) {
  .main-nav button { gap: 4px; font-size: .78rem; }
  .main-nav button .ico { width: 1.05em; height: 1.05em; }
}

/* Celular: el cuento y el mapa de partes no deben ensanchar la pantalla */
@media (max-width: 820px) {
  .reader { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .step-dot { padding: 6px 0; min-height: 44px; }
  .step-dot span { width: 34px; height: 34px; }
  .story-map { padding: 12px; }
}
@media (max-width: 820px) { .reader-art { min-height: 0; width: 100%; } }
@media (max-width: 440px) { .main-nav button .ico { display: none; } .main-nav button { font-size: .8rem; padding-inline: 4px; } }
@media (max-width: 600px) {
  .reader-card { grid-template-columns: minmax(0, 1fr); }
  .reader-copy, .reader-art, .reader-actions { min-width: 0; }
  .reader-actions > * { flex: 1 1 auto; }
  .main-nav button { flex: 1 1 auto; font-size: .76rem; padding-inline: 5px; }
}

/* ===== Paleta CotyMom: turquesa, coral, amarillo y marfil ===== */
:root {
  --blue: #2a7f77; --blue-dark: #1f625c; --ink: #25403e; --muted: #566f6c; --line: #dfe9e4;
  --soft: #e3f3ee; --ivory: #fbf6ea; --coral: #f5907f; --yellow: #edc25a; --side: 15.5rem;
}
html, body { background-color: #fbf6ea; }
.challenge-button { background: #c94f3d; }
.challenge-button:hover:not(:disabled) { background: #a83f30; }
.celebration .big .ico { color: #edc25a; fill: #f6dc8f; }

/* ===== Escritorio: menú lateral ===== */
.brand-text { display: grid; line-height: 1.15; text-align: left; }
.brand-text strong { font-size: 1.1rem; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .74rem; font-weight: 600; }
@media (max-width: 820px) { .brand-text { display: none; } }

@media (min-width: 1100px) {
  body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); align-items: start; }
  .topbar { position: sticky; top: 0; height: 100vh; min-height: 0; flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; gap: .4rem; padding: 1.4rem 1rem 1.2rem; border-right: 1px solid var(--line); border-bottom: 0; box-shadow: none; background: #fff; overflow-y: auto; }
  .brand { order: 1; margin: 0 0 1.1rem; padding: .2rem .35rem; }
  .main-nav { order: 2; flex: 0 0 auto; flex-direction: column; gap: .3rem; width: 100%; margin: 0; padding: 0; background: none; border-radius: 0; }
  .main-nav button { flex: none; justify-content: flex-start; width: 100%; gap: .8rem; min-height: 3rem; padding: .5rem .95rem; border-radius: 12px; font-size: 1rem; font-weight: 700; }
  .main-nav button .ico { width: 1.3em; height: 1.3em; }
  .main-nav button.active { background: var(--soft); color: var(--blue-dark); box-shadow: inset 4px 0 0 var(--blue); }
  .name-button { order: 3; margin-top: auto; width: 100%; max-width: none; justify-content: flex-start; min-height: 2.9rem; }
  .voice-control { order: 4; justify-content: space-between; width: 100%; padding: .2rem .1rem; }
  .voice-control select { flex: 1; max-width: 10rem; }
  .site-link { order: 5; width: 100%; justify-content: flex-start; margin-top: .2rem; }
  main.fit { height: 100vh; }
}

.scene-hint .listen-button { width: 44px; height: 44px; margin-left: auto; font-size: 1.1rem; }

/* Ajustes del tutor */
.setting-group { margin: 0 0 18px; padding: 0; border: 0; }
.setting-group legend { margin-bottom: 8px; padding: 0; font-weight: 800; }
.setting-radio { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.setting-radio:has(input:checked) { border-color: var(--blue); background: var(--soft); }
.setting-radio input { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--blue); }
.setting-radio span { display: grid; gap: 2px; }
.setting-radio small { color: var(--muted); font-size: .85rem; }
.choice.previewing { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(42, 127, 119, .28); }
.choice.speaking { border-color: var(--yellow); background: #fff6d0; }
@media (max-width: 440px) { #settingsButton span { display: none; } }

.setting-update { display: grid; gap: 6px; margin: 0 0 14px; }
.setting-update small { color: var(--muted); text-align: center; }
