:root {
  --ink: #17352d;
  --muted: #5c6f68;
  --paper: #f5f8f6;
  --white: #ffffff;
  --line: #d9e4df;
  --green: #176b4d;
  --green-dark: #10513b;
  --green-soft: #e0f2e9;
  --blue: #256fa8;
  --blue-soft: #e3f1fa;
  --coral: #c8524a;
  --coral-soft: #fde9e6;
  --sun: #f0a225;
  --sun-soft: #fff1d9;
  --violet: #7157a6;
  --violet-soft: #eee9f8;
  --topic: #176b4d;
  --topic-soft: #e0f2e9;
  --shadow: 0 12px 28px rgba(18, 51, 41, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--paper); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #ffbd4a; outline-offset: 3px; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sign-in-gate { position: relative; min-height: 100vh; display: grid; align-items: center; overflow: hidden; }
.sign-in-gate > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gate-shade { position: absolute; inset: 0; background: rgba(8, 39, 31, 0.68); }
.gate-copy { position: relative; width: min(620px, calc(100% - 48px)); margin-left: max(24px, calc((100vw - 1180px) / 2)); color: var(--white); }
.gate-copy h1 { margin: 0; font-size: 4.8rem; line-height: 0.98; letter-spacing: 0; }
.gate-copy > p:not(.eyebrow) { max-width: 570px; margin: 18px 0 24px; color: rgba(255, 255, 255, 0.88); font-size: 1.04rem; line-height: 1.6; }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand > span:last-child, .learner-chip > span:nth-child(2) { display: grid; }
.brand strong, .learner-chip strong { line-height: 1.15; }
.brand small, .learner-chip small { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.brand-light { margin-bottom: 52px; }
.brand-light small { color: rgba(255, 255, 255, 0.72); }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; flex: 0 0 40px; color: #27312d; background: var(--sun); border-radius: 50%; font-weight: 950; }

.topbar { position: sticky; z-index: 30; top: 0; display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.learner-chip { display: flex; align-items: center; gap: 10px; }
.learner-chip strong { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; }
.student-initial { display: grid; width: 36px; height: 36px; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; font-weight: 950; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.icon-button:hover { color: var(--ink); background: var(--paper); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow { margin: 0 0 7px; color: var(--topic); font-size: 0.75rem; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
.day-hero .eyebrow, .gate-copy .eyebrow { color: #ffd77f; }
.day-hero { position: relative; height: min(54vh, 520px); min-height: 390px; overflow: hidden; background: #284039; }
.day-hero > img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero-shade { position: absolute; inset: 0; background: rgba(9, 42, 33, 0.58); }
.hero-copy { position: absolute; inset: 0; display: grid; width: min(1180px, calc(100% - 48px)); align-content: center; justify-items: start; margin: auto; color: var(--white); }
.hero-copy h1 { margin: 0; font-size: 5rem; line-height: 0.98; letter-spacing: 0; }
.hero-copy > p:not(.eyebrow) { max-width: 620px; margin: 18px 0 22px; color: rgba(255, 255, 255, 0.9); font-size: 1.05rem; line-height: 1.58; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 17px; border: 1px solid transparent; border-radius: 6px; font-weight: 850; text-decoration: none; transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.button-primary { color: var(--white); background: var(--topic); box-shadow: 0 6px 16px color-mix(in srgb, var(--topic) 22%, transparent); }
.button-primary:hover { filter: brightness(0.9); }
.button-light { color: var(--green-dark); background: var(--white); }
.button-sun { color: #3b2b0c; background: var(--sun); }
.button-outline { color: var(--topic); background: var(--white); border-color: color-mix(in srgb, var(--topic) 52%, var(--line)); }

.progress-band { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 28px; }
.progress-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.progress-heading h2 { margin: 0; font-size: 2rem; letter-spacing: 0; }
.progress-heading > strong { color: var(--muted); font-size: 0.88rem; }
.progress-track { height: 10px; overflow: hidden; background: #dce6e1; border-radius: 5px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green); transition: width 400ms ease; }
.schedule-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.schedule-item { min-width: 0; padding: 12px 8px; text-align: center; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--item-color); border-radius: 6px; }
.schedule-item span { display: block; font-size: 1.35rem; }
.schedule-item strong { display: block; margin-top: 3px; overflow: hidden; color: var(--ink); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.schedule-item.is-started { background: #f0faf5; }
.schedule-item.is-complete::after { content: "✓"; display: inline-grid; width: 18px; height: 18px; place-items: center; margin-top: 6px; color: var(--white); background: var(--green); border-radius: 50%; font-size: 0.7rem; font-weight: 950; }

.learning-workspace { display: grid; grid-template-columns: 285px minmax(0, 1fr); width: min(1180px, calc(100% - 48px)); min-height: 720px; margin: 12px auto 54px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.topic-rail { min-width: 0; padding: 26px 14px; background: #edf4f0; border-right: 1px solid var(--line); border-radius: 8px 0 0 8px; }
.rail-heading { padding: 0 10px 14px; }
.rail-heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: 0; }
.subject-nav { display: grid; gap: 5px; }
.subject-button { display: grid; grid-template-columns: 40px 1fr 20px; min-width: 0; min-height: 62px; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); text-align: left; background: transparent; border: 1px solid transparent; border-radius: 6px; }
.subject-button:hover { background: rgba(255, 255, 255, 0.72); }
.subject-button.is-active { background: var(--white); border-color: color-mix(in srgb, var(--button-color) 45%, var(--line)); box-shadow: 0 4px 12px rgba(18, 51, 41, 0.08); }
.subject-button .nav-icon { display: grid; width: 40px; height: 40px; place-items: center; background: var(--button-soft); border-radius: 6px; font-size: 1.35rem; }
.subject-button .nav-copy { min-width: 0; }
.subject-button strong, .subject-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject-button strong { font-size: 0.85rem; }
.subject-button small { margin-top: 3px; color: var(--muted); font-size: 0.68rem; }
.nav-status { color: var(--muted); font-size: 0.75rem; font-weight: 950; }
.subject-button.is-complete .nav-status { color: var(--green); }

.topic-stage { min-width: 0; padding: 32px 38px 42px; }
.topic-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topic-heading-line { display: flex; min-width: 0; align-items: center; gap: 14px; }
.topic-heading-line > div { min-width: 0; }
.topic-icon { display: grid; width: 56px; height: 56px; place-items: center; flex: 0 0 56px; background: var(--topic-soft); border-radius: 8px; font-size: 1.85rem; }
.topic-header h2 { margin: 0; font-size: 2.15rem; line-height: 1.1; letter-spacing: 0; }
.diary-note { margin: 16px 0 20px; padding: 11px 14px; color: #4a5e57; background: var(--topic-soft); border-left: 4px solid var(--topic); border-radius: 0 6px 6px 0; font-size: 0.85rem; line-height: 1.5; }
.mode-tabs { display: flex; gap: 4px; min-height: 50px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.mode-tab { min-width: 112px; padding: 10px 14px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; font-weight: 850; }
.mode-tab.is-active { color: var(--topic); border-bottom-color: var(--topic); }
.mode-content { min-height: 480px; animation: reveal 220ms ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.lesson-intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr); gap: 28px; align-items: center; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.lesson-intro h3, .activity-start h3 { margin: 0 0 10px; font-size: 1.75rem; letter-spacing: 0; }
.lesson-intro p, .activity-start p { margin: 0; color: var(--muted); line-height: 1.68; }
.lesson-visual { min-height: 210px; display: grid; place-items: center; overflow: hidden; background: var(--topic-soft); border: 1px solid color-mix(in srgb, var(--topic) 24%, var(--line)); border-radius: 8px; }
.lesson-visual > img { width: 100%; height: 230px; object-fit: cover; }
.lesson-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.lesson-point { min-width: 0; padding: 17px; background: var(--paper); border-top: 4px solid var(--topic); border-radius: 6px; }
.lesson-point span { font-size: 1.45rem; }
.lesson-point h4 { margin: 8px 0 6px; font-size: 1rem; }
.lesson-point p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.lesson-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.saved-state { color: var(--green); font-size: 0.84rem; font-weight: 850; }

.block-demo { width: min(330px, calc(100% - 24px)); }
.block-equation { margin-bottom: 16px; color: var(--topic); text-align: center; font-size: 1.8rem; font-weight: 950; }
.block-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.block-group { display: flex; min-height: 78px; flex-wrap: wrap; align-content: center; justify-content: center; gap: 5px; padding: 8px; background: var(--white); border: 2px dashed color-mix(in srgb, var(--topic) 55%, var(--line)); border-radius: 6px; }
.math-block { width: 21px; height: 21px; background: var(--block-color, var(--sun)); border: 2px solid rgba(33, 48, 42, 0.18); border-radius: 4px; box-shadow: inset 0 3px rgba(255, 255, 255, 0.42); }
.word-tiles { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 20px; }
.word-tile { display: grid; min-width: 58px; min-height: 52px; place-items: center; padding: 8px 12px; color: var(--topic); background: var(--white); border: 2px solid color-mix(in srgb, var(--topic) 45%, var(--line)); border-radius: 6px; font-size: 1.2rem; font-weight: 950; }
.word-plus { color: var(--muted); font-size: 1.45rem; font-weight: 950; }
.sort-preview { display: grid; grid-template-columns: 1fr 1fr; width: calc(100% - 24px); gap: 10px; }
.sort-bin { min-height: 150px; padding: 16px; background: var(--white); border: 2px dashed color-mix(in srgb, var(--topic) 48%, var(--line)); border-radius: 6px; text-align: center; }
.sort-bin strong { display: block; margin-bottom: 10px; }
.sort-bin span { display: block; margin: 5px; color: var(--muted); font-size: 0.82rem; }
.movement-steps { display: flex; width: calc(100% - 30px); align-items: center; justify-content: center; gap: 8px; }
.movement-step { display: grid; width: 58px; height: 58px; place-items: center; background: var(--white); border-radius: 50%; font-size: 1.5rem; }
.movement-arrow { color: var(--topic); font-weight: 950; }

.activity-start { display: grid; grid-template-columns: 94px 1fr; gap: 22px; align-items: center; padding: 26px 0; }
.activity-start-icon { display: grid; width: 94px; height: 94px; place-items: center; background: var(--topic-soft); border-radius: 50%; font-size: 2.4rem; }
.activity-start .button { margin-top: 18px; }
.best-score { display: inline-block; margin-left: 10px; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.question-shell { max-width: 780px; margin: 0 auto; }
.question-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; color: var(--muted); font-size: 0.84rem; font-weight: 800; }
.question-card { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.question-card h3 { min-height: 60px; margin: 0 0 20px; font-size: 1.75rem; line-height: 1.3; }
.question-visual { margin: 0 0 18px; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-button { min-height: 58px; padding: 12px 14px; color: var(--ink); text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 6px; font-weight: 780; }
.answer-button:hover:not(:disabled) { border-color: var(--topic); background: var(--topic-soft); }
.answer-button.is-correct { color: #10543c; background: var(--green-soft); border-color: #5eaa85; }
.answer-button.is-wrong { color: #84342f; background: var(--coral-soft); border-color: #d5837d; }
.answer-feedback { margin: 16px 0 0; padding: 12px 14px; background: var(--white); border-left: 4px solid var(--topic); border-radius: 0 6px 6px 0; line-height: 1.5; }
.mission-shell { max-width: 860px; margin: 0 auto; }
.mission-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; color: var(--muted); font-size: 0.84rem; font-weight: 800; }
.mission-card { padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.mission-heading { margin-bottom: 20px; }
.mission-heading h3 { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 1.65rem; line-height: 1.3; }
.mission-type { color: var(--topic); font-size: 0.72rem; font-weight: 900; text-transform: uppercase; }
.mission-board { min-height: 330px; }
.mission-feedback { margin: 18px 0 0; padding: 13px 15px; background: var(--white); border-left: 4px solid var(--topic); border-radius: 0 6px 6px 0; line-height: 1.55; }
.mission-feedback.is-success { color: #10543c; background: var(--green-soft); border-left-color: #3f906a; }
.mission-feedback.is-progress { color: #10543c; background: var(--green-soft); border-left-color: #5eaa85; }
.mission-feedback.is-effort { color: #6c4b0e; background: var(--sun-soft); border-left-color: var(--sun); }
.mission-feedback.is-hint { color: #73342f; background: var(--coral-soft); border-left-color: var(--coral); }
.mission-card .button:disabled { cursor: default; }
.mission-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.share-workbench { display: grid; gap: 16px; }
.share-instruction { display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 13px; color: #704615; background: var(--sun-soft); border-left: 4px solid var(--sun); border-radius: 0 6px 6px 0; font-size: 0.82rem; line-height: 1.45; }
.share-instruction > span { font-size: 1.4rem; }
.block-pool { min-height: 96px; padding: 13px; background: var(--white); border: 2px solid color-mix(in srgb, var(--topic) 38%, var(--line)); border-radius: 7px; }
.candy-pool { background: #fff9e9; border-color: #e4b44d; }
.block-pool header, .share-bin header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.block-pool header span, .share-bin header span { color: var(--topic); font-size: 0.78rem; font-weight: 900; }
.loose-blocks, .placed-blocks { display: flex; min-height: 42px; flex-wrap: wrap; align-content: center; gap: 5px; margin-top: 9px; }
.activity-candy { display: inline-grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; font-size: 1.3rem; filter: drop-shadow(0 2px 1px rgba(68, 47, 17, .14)); }
.share-groups { display: grid; grid-template-columns: repeat(var(--group-count), minmax(110px, 1fr)); gap: 9px; }
.share-bin { display: grid; min-height: 154px; grid-template-rows: auto 1fr auto; padding: 12px; background: var(--white); border: 2px dashed color-mix(in srgb, var(--topic) 48%, var(--line)); border-radius: 7px; }
.friend-plate header, .extras-bin header { display: grid; grid-template-columns: 42px minmax(0, 1fr) 28px; align-items: center; }
.friend-avatar { display: grid; width: 40px; height: 40px; place-items: center; color: initial !important; background: var(--topic-soft); border-radius: 50%; font-size: 1.55rem !important; }
.friend-label { display: grid; min-width: 0; }
.friend-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.friend-label small { color: var(--muted); font-size: 0.62rem; }
.candy-count { display: grid; width: 28px; height: 28px; place-items: center; background: var(--topic-soft); border-radius: 50%; }
.extras-bin { background: #fff9e9; border-color: #e4b44d; }
.extras-bin .friend-avatar, .extras-bin .candy-count { background: #ffedba; }
.extras-bin .friend-label strong { overflow: visible; white-space: normal; line-height: 1.1; }
.placed-blocks { align-content: start; }
.bin-controls { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.mini-icon-button { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--topic); background: var(--topic-soft); border: 1px solid color-mix(in srgb, var(--topic) 38%, var(--line)); border-radius: 6px; font-size: 1.35rem; font-weight: 900; }
.mini-icon-button:disabled { cursor: default; opacity: 0.38; }

.sort-workbench { display: grid; gap: 16px; }
.card-tray { display: flex; min-height: 92px; flex-wrap: wrap; align-content: center; justify-content: center; gap: 9px; padding: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; }
.sort-card, .builder-tile, .sequence-card { min-height: 48px; padding: 10px 14px; color: var(--ink); background: var(--white); border: 2px solid color-mix(in srgb, var(--topic) 35%, var(--line)); border-radius: 6px; font-weight: 850; overflow-wrap: anywhere; }
.sort-card:hover, .builder-tile:hover, .sequence-card:hover { border-color: var(--topic); background: var(--topic-soft); }
.sort-card.is-selected, .builder-tile.is-selected { color: var(--white); background: var(--topic); border-color: var(--topic); }
.tray-complete { align-self: center; color: var(--green); font-weight: 900; }
.sort-targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sort-target { display: grid; min-height: 180px; grid-template-rows: auto 1fr; gap: 12px; padding: 16px; color: var(--ink); text-align: left; background: var(--topic-soft); border: 2px dashed color-mix(in srgb, var(--topic) 55%, var(--line)); border-radius: 7px; }
.sort-target:hover { border-style: solid; }
.sort-target-heading strong, .sort-target-heading small { display: block; }
.sort-target-heading small { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.sorted-cards { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; }
.sorted-cards span { padding: 7px 9px; background: var(--white); border: 1px solid color-mix(in srgb, var(--topic) 28%, var(--line)); border-radius: 5px; font-size: 0.78rem; font-weight: 800; }

.match-workbench { display: grid; grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr); gap: 12px; align-items: center; }
.match-workbench h4 { margin: 0 0 9px; color: var(--topic); text-align: center; }
.match-column { display: grid; gap: 8px; }
.match-card { min-height: 54px; padding: 10px 12px; color: var(--ink); background: var(--white); border: 2px solid var(--line); border-radius: 6px; font-weight: 850; overflow-wrap: anywhere; }
.match-card:hover:not(:disabled), .match-card.is-selected { border-color: var(--topic); background: var(--topic-soft); }
.match-card.is-matched { color: #10543c; background: var(--green-soft); border-color: #5eaa85; opacity: 1; }
.match-lines { color: var(--topic); text-align: center; font-size: 1.5rem; font-weight: 900; }

.builder-workbench { display: grid; justify-items: center; gap: 18px; }
.sentence-bridge { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.55fr) minmax(130px, 1fr); width: 100%; align-items: stretch; gap: 9px; }
.sentence-bridge > span, .word-machine > span, .word-machine > strong { display: grid; min-height: 70px; place-items: center; padding: 12px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 6px; font-weight: 850; overflow-wrap: anywhere; }
.builder-slot { color: var(--muted); border: 2px dashed color-mix(in srgb, var(--topic) 50%, var(--line)) !important; }
.builder-slot.is-filled { color: var(--topic); background: var(--topic-soft) !important; border-style: solid !important; }
.tile-rack { display: flex; min-height: 70px; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px; padding: 10px; }
.builder-tile { min-width: 82px; font-size: 1rem; }
.prefix-tile { font-size: 1.1rem; }
.word-machine { display: grid; grid-template-columns: minmax(88px, 0.6fr) 32px minmax(100px, 0.8fr) 32px minmax(130px, 1fr); width: 100%; align-items: center; gap: 7px; }
.machine-plus, .machine-equals { min-height: 0 !important; padding: 0 !important; color: var(--topic); background: transparent !important; border: 0 !important; font-size: 1.3rem; }
.base-word { color: var(--ink); }
.word-machine strong { color: var(--topic); background: var(--topic-soft); }

.sequence-workbench { display: grid; gap: 16px; }
.sequence-source { display: flex; min-height: 84px; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px; padding: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 7px; }
.sequence-path { display: grid; gap: 8px; }
.sequence-slot { display: grid; grid-template-columns: 34px 1fr; min-height: 52px; align-items: center; gap: 10px; padding: 8px 12px; color: var(--ink); text-align: left; background: var(--white); border: 2px solid color-mix(in srgb, var(--topic) 36%, var(--line)); border-radius: 6px; font-weight: 800; }
.sequence-slot > span { display: grid; width: 30px; height: 30px; place-items: center; color: var(--white); background: var(--topic); border-radius: 50%; font-size: 0.78rem; }
.sequence-slot.is-empty { color: transparent; background: transparent; border-style: dashed; }
.sequence-slot.is-empty > span { color: var(--topic); background: var(--topic-soft); }

.recall-workbench { display: grid; max-width: 620px; gap: 16px; margin: 0 auto; }
.recall-clue { display: grid; min-height: 170px; place-content: center; gap: 9px; padding: 24px; text-align: center; background: var(--topic-soft); border: 1px solid color-mix(in srgb, var(--topic) 30%, var(--line)); border-radius: 7px; }
.recall-clue span { color: var(--topic); font-size: 0.72rem; font-weight: 900; text-transform: uppercase; }
.recall-clue strong { overflow-wrap: anywhere; font-size: 1.25rem; line-height: 1.45; }
.recall-clue small { color: var(--muted); font-weight: 800; }
.recall-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.recall-form label { grid-column: 1 / -1; font-size: 0.82rem; font-weight: 850; }
.recall-form input { min-width: 0; height: 46px; padding: 0 12px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.next-row { display: flex; justify-content: flex-end; margin-top: 14px; }
.result-panel { padding: 34px 24px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.result-score { display: block; color: var(--topic); font-size: 4.5rem; line-height: 1; font-weight: 950; }
.result-panel h3 { margin: 10px 0 8px; font-size: 1.8rem; }
.result-panel p { max-width: 540px; margin: 0 auto 20px; color: var(--muted); line-height: 1.6; }

.word-bank { margin: 24px 0; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.word-bank h3 { margin: 0 0 6px; }
.word-bank > p { margin: 0 0 16px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.word-form { display: grid; grid-template-columns: minmax(130px, 0.45fr) minmax(180px, 1fr) auto; gap: 8px; }
.word-form input { min-width: 0; height: 44px; padding: 0 12px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.word-list { display: grid; gap: 7px; margin-top: 14px; }
.word-row { display: grid; grid-template-columns: minmax(100px, 0.35fr) minmax(160px, 1fr) 36px; align-items: center; gap: 10px; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.word-row strong, .word-row span { min-width: 0; overflow-wrap: anywhere; }
.word-row span { color: var(--muted); font-size: 0.84rem; }
.remove-word { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; color: var(--coral); background: transparent; border: 1px solid var(--line); border-radius: 6px; font-weight: 950; }
.empty-words { padding: 15px; color: var(--muted); text-align: center; background: var(--white); border: 1px dashed var(--line); border-radius: 6px; }

.teacher-check { display: grid; grid-template-columns: 74px 1fr; width: min(1180px, calc(100% - 48px)); gap: 20px; align-items: start; margin: 0 auto 56px; padding: 26px 30px; background: var(--sun-soft); border: 1px solid #efca83; border-radius: 8px; }
.check-symbol { display: grid; width: 64px; height: 64px; place-items: center; background: var(--white); border-radius: 50%; font-size: 1.8rem; }
.teacher-check .eyebrow { color: #875b08; }
.teacher-check h2 { margin: 0 0 8px; font-size: 1.6rem; }
.teacher-check p:last-child { margin: 0; color: #5c533f; line-height: 1.65; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(24px, calc((100vw - 1180px) / 2)); color: var(--muted); background: #e8f0ec; border-top: 1px solid var(--line); font-size: 0.76rem; }
.site-footer p { margin: 0; }

.activity-dialog { width: min(760px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; color: var(--ink); background: var(--white); border: 0; border-radius: 8px; box-shadow: 0 28px 72px rgba(8, 31, 24, 0.32); }
.activity-dialog::backdrop { background: rgba(8, 31, 24, 0.68); backdrop-filter: blur(3px); }
.dialog-close { position: sticky; z-index: 2; top: 12px; float: right; margin: 12px 12px -52px 0; }
.dialog-content { padding: 34px; }
.dialog-content h2 { margin: 0 48px 18px 0; font-size: 2rem; }
.review-topic { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--topic); font-size: 0.78rem; font-weight: 900; }
.coach-reply { min-height: 98px; margin: 18px 0; padding: 17px; color: #21453a; background: var(--green-soft); border-left: 4px solid var(--green); border-radius: 0 6px 6px 0; line-height: 1.62; white-space: pre-wrap; }
.coach-form { display: grid; gap: 10px; }
.coach-form label { font-size: 0.84rem; font-weight: 850; }
.coach-form textarea { width: 100%; resize: vertical; padding: 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; line-height: 1.5; }
.coach-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.coach-privacy { margin: 16px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }

.mascot-dock { position: fixed; z-index: 35; right: 18px; bottom: 58px; display: grid; justify-items: end; pointer-events: none; }
.mascot-dock img { width: 112px; max-height: 150px; object-fit: contain; object-position: right bottom; filter: drop-shadow(0 10px 10px rgba(13, 45, 37, 0.2)); animation: mascot-float 3.2s ease-in-out infinite; }
.mascot-dock[data-age-group="younger"] img { animation-duration: 2.6s; }
.mascot-bubble { max-width: 220px; margin: 0 74px -10px 0; padding: 10px 12px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: 0.78rem; font-weight: 780; line-height: 1.4; opacity: 0; transform: translateY(7px); transition: opacity 180ms ease, transform 180ms ease; }
.mascot-bubble.is-visible { opacity: 1; transform: none; }
@keyframes mascot-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
.reaction-layer { position: fixed; z-index: 55; inset: 0; overflow: hidden; pointer-events: none; }
.reaction-emoji { position: absolute; font-size: 2rem; animation: reaction-pop 1100ms ease-out forwards; }
@keyframes reaction-pop { 0% { opacity: 0; transform: translateY(12px) scale(0.5) rotate(-8deg); } 20% { opacity: 1; transform: translateY(0) scale(1.16) rotate(4deg); } 100% { opacity: 0; transform: translateY(-90px) scale(0.9) rotate(10deg); } }
.toast { position: fixed; z-index: 60; right: 20px; bottom: 20px; max-width: min(390px, calc(100% - 40px)); padding: 12px 15px; color: var(--white); background: #18332c; border-radius: 6px; box-shadow: var(--shadow); font-size: 0.84rem; }

@media (max-width: 960px) {
  .schedule-strip { grid-template-columns: repeat(4, 1fr); }
  .learning-workspace { grid-template-columns: minmax(0, 1fr); overflow: hidden; }
  .topic-rail { padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
  .rail-heading { padding: 0 0 12px; }
  .subject-nav { display: flex; max-width: 100%; gap: 7px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  .subject-button { grid-template-columns: 38px minmax(92px, 1fr) 18px; min-width: 178px; }
  .lesson-intro { grid-template-columns: 1fr; }
  .lesson-visual { order: -1; }
}

@media (max-width: 680px) {
  .topbar { min-height: 64px; padding: 0 14px; }
  .topbar .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .topbar .brand small { display: none; }
  .learner-chip > span:nth-child(2) { display: none; }
  .day-hero { height: 490px; min-height: 490px; }
  .day-hero > img { object-position: 52% center; }
  .hero-copy { width: calc(100% - 32px); align-content: end; padding-bottom: 28px; }
  .hero-copy h1, .gate-copy h1 { font-size: 3.25rem; }
  .hero-copy > p:not(.eyebrow) { margin: 12px 0 16px; font-size: 0.9rem; }
  .hero-actions { width: 100%; }
  .hero-actions .button { width: 100%; }
  .progress-band, .learning-workspace, .teacher-check { width: calc(100% - 28px); }
  .progress-heading { align-items: start; }
  .progress-heading h2 { font-size: 1.6rem; }
  .progress-heading > strong { max-width: 120px; text-align: right; }
  .schedule-strip { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .schedule-item { padding: 10px 5px; }
  .schedule-item strong { font-size: 0.62rem; }
  .learning-workspace { margin-bottom: 38px; }
  .topic-stage { padding: 24px 18px 32px; }
  .topic-header { align-items: flex-start; }
  .topic-heading-line { align-items: flex-start; }
  .topic-icon { width: 48px; height: 48px; flex-basis: 48px; font-size: 1.55rem; }
  .topic-header h2 { font-size: 1.55rem; overflow-wrap: anywhere; }
  #coachButton { min-width: 44px; width: 44px; overflow: hidden; padding: 0; color: transparent; font-size: 0; }
  #coachButton::before { content: "✨"; color: var(--topic); font-size: 1.1rem; }
  .mode-tabs { overflow-x: auto; }
  .mode-tab { min-width: 104px; }
  .lesson-points { grid-template-columns: 1fr; }
  .lesson-actions { align-items: stretch; flex-direction: column; }
  .activity-start { grid-template-columns: 68px 1fr; gap: 14px; }
  .activity-start-icon { width: 68px; height: 68px; font-size: 1.8rem; }
  .question-card { padding: 20px 16px; }
  .question-card h3 { min-height: 0; font-size: 1.35rem; }
  .answer-grid { grid-template-columns: 1fr; }
  .mission-status { align-items: flex-start; }
  .mission-card { padding: 20px 14px; }
  .mission-heading h3 { font-size: 1.35rem; }
  .mission-board { min-height: 300px; }
  .share-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sort-targets { grid-template-columns: 1fr; }
  .sort-target { min-height: 140px; }
  .match-workbench { grid-template-columns: 1fr; }
  .match-lines { transform: rotate(90deg); }
  .sentence-bridge { grid-template-columns: 1fr; }
  .sentence-bridge > span { min-height: 56px; }
  .word-machine { grid-template-columns: minmax(80px, 1fr) 24px minmax(90px, 1fr); }
  .word-machine > strong { grid-column: 1 / -1; min-height: 58px; }
  .machine-equals { display: none !important; }
  .recall-form { grid-template-columns: 1fr; }
  .recall-form label { grid-column: auto; }
  .mission-tools .button { flex: 1 1 150px; }
  .word-form { grid-template-columns: 1fr; }
  .word-row { grid-template-columns: minmax(80px, 0.4fr) minmax(120px, 1fr) 34px; }
  .teacher-check { grid-template-columns: 1fr; padding: 22px; }
  .check-symbol { width: 52px; height: 52px; }
  .site-footer { flex-direction: column; }
  .dialog-content { padding: 28px 20px; }
  .coach-actions .button { width: 100%; }
  .mascot-dock { right: 4px; bottom: 6px; }
  .mascot-dock img { width: 54px; max-height: 72px; }
  .mascot-bubble { display: none; }
  .reaction-emoji { font-size: 1.55rem; }
}

@media (max-width: 420px) {
  .schedule-strip { grid-template-columns: repeat(2, 1fr); }
  .subject-button { min-width: 168px; }
  .movement-steps { gap: 4px; }
  .movement-step { width: 46px; height: 46px; font-size: 1.2rem; }
  .mission-status { font-size: 0.75rem; }
  .share-groups { grid-template-columns: 1fr 1fr; gap: 6px; }
  .share-bin { min-height: 142px; padding: 9px; }
  .activity-candy { width: 23px; height: 23px; flex-basis: 23px; font-size: 1.1rem; }
  .sort-card, .builder-tile, .sequence-card { width: 100%; }
  .tile-rack { width: 100%; }
}

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

body[data-animation="off"] .mascot-dock img, body[data-animation="off"] .reaction-emoji { animation: none; }
body[data-animation="off"] .reaction-layer { display: none; }
