/* Keep the familiar colours, with the exercise as the main visual surface. */
.shell { max-width: 1120px; padding-top: 18px; }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: stretch; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid #c8dbe0; gap: 16px; }
.brand { font-size: 1.4rem; gap: 11px; flex: 0 0 auto; }
.brand-mark { width: 46px; height: 46px; font-size: 1.6rem; border-radius: 13px; }
.brand-subtitle { font-size: .875rem; }
.top-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; justify-self: end; gap: 8px; width: 350px; max-width: 100%; margin: 0; min-width: 0; }
.language-picker { font-size: .875rem; }
.language-picker select { min-width: 0; width: 100%; font-size: .875rem; border-width: 1px; }
.voice-settings-compact > summary { border-width: 1px; }
main { display: block; position: relative; }
.topics-nav { position: relative; top: auto; z-index: 8; display: block; max-height: none; overflow: visible; padding: 0; border: 0; background: transparent; border-radius: 12px; margin: 0; min-width: 0; }
.top-actions .topics-nav > details > summary, .top-actions > details > summary { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 12px; border: 1px solid #102c49; border-radius: 11px; color: #fff; background: #102c49; font-size: .875rem; font-weight: 800; line-height: 1.4; cursor: pointer; list-style: none; }
.top-actions summary::-webkit-details-marker { display: none; }
.top-actions summary::marker { content: ""; }
.top-actions .topics-nav > details > summary::before, .top-actions > details > summary::before { content: ""; width: 0; height: 0; flex: 0 0 auto; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #e3f75a; }
.top-actions .topics-nav > details[open] > summary::before, .top-actions > details[open] > summary::before { transform: rotate(90deg); }
.top-actions .topics-nav > details > summary:hover, .top-actions > details > summary:hover { background: #245371; }
.language-menu { position: relative; z-index: 9; }
.language-popover { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: min(310px, calc(100vw - 32px)); padding: 16px; border: 1px solid #c8dbe0; border-radius: 16px; background: #fff; box-shadow: 0 12px 30px rgba(16,44,73,.14); }
.top-actions .language-popover .language-picker { width: 100%; }
.top-actions .language-popover select { margin-top: 5px; }
.voice-support-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 14px; padding: 10px 14px; border: 1px solid #9cc1c8; border-radius: 11px; background: #eef5f6; color: #102c49; font-size: .9375rem; font-weight: 800; text-decoration: none; }
.voice-support-link:hover { background: #dff2f3; border-color: #218e9a; }
#voice-menu { z-index: 9; }
.topics-nav .menu-support { margin-top: 3px; font-size: .8rem; }
#topics-nav-list { position: absolute; top: calc(100% + 8px); left: 0; width: min(350px, calc(100vw - 32px)); max-height: min(65dvh, 620px); overflow: auto; overscroll-behavior: contain; padding: 8px 16px 16px; border: 1px solid #c8dbe0; border-radius: 16px; background: #fff; box-shadow: 0 14px 35px rgba(16,44,73,.18); }
.eyebrow { border: 0; padding: 0; border-radius: 0; font-size: .8125rem; letter-spacing: 0; text-transform: none; font-weight: 700; color: #52707f; }
#page-title { margin: 6px 0 10px; font-size: 1.25rem; letter-spacing: -.02em; }
.exercise-description { font-size: .875rem; color: #456575; margin: 0 0 14px; }
.exercise-description summary { cursor: pointer; min-height: 44px; display: list-item; padding: 12px 0; }
.exercise-description .intro { margin: 0 0 8px; font-size: 1rem; }
#exercise-content[data-kind="school"] .exercise-description { display: none; }
.card { border-radius: 22px; }
.school, .match, .article, .build { padding: 28px 32px 24px; }
.school > h2, .match > h2 { font-size: clamp(1.55rem, 3vw, 2rem); margin-bottom: 12px; }
.task-introduction { position: relative; padding-right: 160px; margin-bottom: 14px; }
.task-introduction > .listen { position: absolute; right: 0; top: 0; margin: 0; min-height: 44px; font-size: .875rem; }
.task-introduction .practice-description { margin: 0; line-height: 1.5; }
.task-introduction .school-support { margin: 4px 0 0; font-size: .875rem; }
.school .practice-progress, .match-progress { margin: 12px 0 16px; font-size: .875rem; color: #315c71; }
.matching-workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 24px; align-items: start; }
.matching-words .word-label { margin: 0 0 12px; font-size: .875rem; }
.matching-words .word-grid { grid-template-columns: 1fr; gap: 8px; }
.matching-words .word { min-height: 54px; text-align: left; padding-left: 15px; font-size: 1rem; }
.material-grid { gap: 10px; }
.school[data-stage="listenPictures"] .material-grid { max-width: 620px; margin: 14px auto 0; }
.school-task > .word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 500px; }
.school-task > .image-prompt, .school-task > .sentence-area, .school-task > .tile-options, .school-task > .school-form { max-width: 720px; }
/* Keep the next task reachable after a correct answer, at every scroll position. */
#school-next-task {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px), calc((100vw - 1016px) / 2));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 7;
  margin: 0;
  min-height: 52px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 0 0 4px #fff, 0 6px 24px rgba(16,44,73,.25);
}
.school[data-answer-ready="true"] { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
.school-sentence { font-size: clamp(1.4rem, 3.5vw, 2rem); }
.sentence-model { padding: 20px 24px; border: 1px solid #b8d9dd; border-radius: 18px; background: #f2fafb; }
.sentence-model .image-prompt { margin-bottom: 12px; }
.sentence-model .school-prompt-art { width: 132px; flex-basis: 132px; }
.sentence-model .school-sentence { margin: 8px 0 12px; font-weight: 800; }
.sentence-model .school-support { margin: 5px 0; }
.sentence-model > .practice-description { margin: 14px 0 0; }
.sentence-model > .next { display: block; }
.model-help .sentence-model { padding: 16px 0 0; border: 0; background: transparent; }
.school-help { font-size: .9375rem; padding: 8px 13px; margin: 16px 0; }
.school-help > summary { min-height: 44px; padding: 10px 0; }
.task-goal { margin-top: 22px; background: #fff; }
.school-journey { font-size: .8125rem; margin-bottom: 6px; padding-top: 12px; }
.school-storage-note { margin-top: 5px; }
.exercise-pager { padding: 14px 32px; grid-template-columns: 48px minmax(0, 1fr) 48px; }
.exercise-pager button { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 12px; }
.exercise-position { font-size: .875rem; font-weight: 700; }
.side { display: block; margin-top: 16px; border: 1px solid #c8dbe0; border-radius: 12px; background: #f9fcfc; padding: 0 16px; }
.side > summary { min-height: 44px; cursor: pointer; padding: 12px 0; color: #456575; font-weight: 750; font-size: .875rem; }
.extra-help-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 6px 0 16px; }
.tip { padding: 18px; border-radius: 14px; }
.tip h3 { font-size: 1rem; }
.visitor-footer { margin-top: 28px; font-size: .8125rem; }
.visitor-counter { padding: 8px 12px; font-size: .8125rem; }
.overview-heading { font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.035em; }
.theme-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.theme-card:first-child { grid-row: auto; border-top: 1px solid #c8dbe0; }
.theme-card { padding: 20px; }
.theme-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.theme-card-heading > div { min-width: 0; }
.theme-card-heading h2 { overflow-wrap: anywhere; margin-bottom: 0; }
.theme-thumbnail { display: block; width: 78px; flex: 0 0 78px; aspect-ratio: 1; border-radius: 14px; border: 1px solid #c8dbe0; background-color: #d4edf9; background-size: 300% 200%; background-repeat: no-repeat; }
.bilingual-word-list { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 1rem; }
.bilingual-word-list caption { text-align: left; color: #456575; padding: 0 0 12px; font-size: .875rem; }
.bilingual-word-list th, .bilingual-word-list td { text-align: start; padding: 12px 8px; border-top: 1px solid #dce9ec; line-height: 1.5; overflow-wrap: anywhere; vertical-align: middle; }
.bilingual-word-list thead th { font-size: .875rem; color: #456575; }
.bilingual-word-list th:last-child, .bilingual-word-list td:last-child { width: 56px; }
.bilingual-word-list .word-list-audio { position: relative; height: 62px; }
.word-list-audio .answer-speak { right: 4px; }
.words #word-list-title { margin: 0 0 12px; font-size: 1.125rem; }
.word-bank-entry { position: relative; min-height: 54px; padding: 12px 56px 12px 12px; border: 1px solid #c8dbe0; border-radius: 12px; background: #fff; }
.school-wordbank .school-support { margin: 6px 4px 0; }
.school-wordbank .answer-speak { top: 27px; }
@media (max-width: 700px) {
  .shell { padding-right: 16px; padding-left: 16px; }
  .topbar { gap: 16px; margin-bottom: 24px; }
  .top-actions { width: min(100%, 350px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .language-picker select { min-width: 0; width: 100%; }
  .task-introduction { padding-right: 0; }
  .task-introduction > .listen { position: static; margin-top: 8px; }
  .school, .match, .article, .build { padding: 22px 18px 20px; }
  .matching-workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .matching-words .word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matching-words .word { min-height: 56px; padding-left: 10px; }
  .material-grid { gap: 7px; }
  .matching-workspace > .material-grid { width: 100%; max-width: 480px; justify-self: center; }
  .sentence-model { padding: 16px; }
  .exercise-pager { padding: 14px 18px; gap: 8px; }
  .extra-help-content, .theme-cards { grid-template-columns: minmax(0, 1fr); }
  .theme-thumbnail { width: 64px; flex-basis: 64px; }
}
@media (max-width: 650px) {
  .topbar { grid-template-columns: minmax(0, 1fr); }
}
