/* ScienceQuiz.org — playful science learning */
/* Visual_Token_Set v1: the sole shared source for learner-facing visual values. */
:root {
  color-scheme: light;
  --visual-token-set: "Visual_Token_Set";
  --visual-token-set-version: "1";

  /* Palette: retained aliases keep existing learner surfaces visually stable. */
  --ink: #17233f;
  --muted: #5f6880;
  --cream: #fff9ed;
  --paper: #ffffff;
  --line: #e9e2d7;
  --blue: #5b72e8;
  --blue-dark: #4257c8;
  --coral: #f26b5e;
  --yellow: #f6bd45;
  --green: #49ad78;
  /* WCAG 2.1 AA (1.4.3). `--coral`, `--green` and `--blue` are the decorative
     faces -- progress bars, dots, borders, gradients, orbit dots -- where no
     text sits on them, and they keep their hue. Every face that carries a
     LABEL, and every accent used AS text, points at one of the tokens below
     instead. Same hue family, so the brand reads unchanged; the raised-block
     shadows step down with them.

     Fills that carry white text:
       --coral-strong  white 4.81:1   --green-strong  white 5.02:1
       --blue-strong   white 5.39:1   (plain `--blue` is white 4.19:1, which
       still clears the 3:1 large-text bar, so `.card-icon` at 23px/700 keeps
       it; anything smaller moves to `--blue-strong`.)

     Accents used as text on cream or white:
       --coral-text   4.58:1 on cream, 4.81:1 on white
       --green-text   4.79:1 on cream, 5.02:1 on white
       --coral-display  3.42:1 on cream -- reserved for display type at 24px
       and up (the hero `h1 em`, the 39px heart glyph), where 1.4.3 asks 3:1
       and darkening to `--coral-text` would flatten the headline. */
  --coral-strong: #c8453a;
  --coral-strong-shadow: #a03329;
  --green-strong: #2f7d55;
  --green-strong-shadow: #23613f;
  --blue-strong: #4a5fd6;
  --coral-text: var(--coral-strong);
  --green-text: var(--green-strong);
  --coral-display: #e15c50;

  /* Subject accents. */
  --subject-chemistry: var(--blue);
  --subject-biology: var(--green);
  --subject-physics: var(--coral);
  --subject-space: var(--blue-dark);
  --subject-earth: var(--green-strong);
  --subject-math: var(--yellow);

  /* Kid-readable typography and bounded learner measure. */
  --font-display: "Fredoka", sans-serif;
  --font-reading: "Atkinson Hyperlegible", system-ui, sans-serif;
  --text-caption: 12px;
  --text-small: 14px;
  --text-body: 18px;
  --text-heading: 24px;
  --text-display: 46px;
  --measure-readable: 65ch;
  --target-min: 44px;

  /* Spacing, shape, and elevation. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-round: 50%;
  --transparent: transparent;
  --radius: var(--radius-lg);
  --elevation-soft: 0 7px 18px rgba(31, 40, 75, 0.08);
  --elevation-raised: 0 14px 36px rgba(31, 40, 75, 0.1);
  --elevation-button: 0 3px 0 var(--ink);
  --elevation-button-soft: 0 2px 0 var(--line);
  --elevation-note: 8px 8px 0 var(--yellow);
  --soft-shadow: var(--elevation-soft);
  --shadow: var(--elevation-raised);

  /* Purposeful motion only: interaction, reveal, and celebration. */
  --motion-quick: 150ms;
  --motion-reveal: 300ms;
  --motion-celebrate: 600ms;
  --ease-standard: ease;
  --ease-reveal: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-celebrate: cubic-bezier(0.22, 1, 0.36, 1);

  /* State color/icon/label triples keep visual and textual cues paired. */
  --state-correct-color: var(--green-strong);
  --state-correct-icon: "✓";
  --state-correct-label: "Correct";
  --state-incorrect-color: var(--coral-strong);
  --state-incorrect-icon: "↻";
  --state-incorrect-label: "Try again";
  --state-current-color: var(--blue-strong);
  --state-current-icon: "•";
  --state-current-label: "Current";
  --state-locked-color: var(--muted);
  --state-locked-icon: "🔒";
  --state-locked-label: "Locked";
  --state-complete-color: var(--green-strong);
  --state-complete-icon: "★";
  --state-complete-label: "Complete";
  --state-error-color: var(--coral-strong);
  --state-error-icon: "!";
  --state-error-label: "Something went wrong";

  /* Periodic-table category colors remain part of the shared palette. */
  --nonmetal: #8dd9c4;
  --noble: #a8b8f7;
  --alkali: #f49a8b;
  --alkaline: #f6c76b;
  --metalloid: #86cde3;
  --halogen: #d4a7e8;
  --transition: #f2b1c2;
  --post-transition: #a9d6a8;
  --lanthanide: #efbf8c;
  --actinide: #d9b0a4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font-reading); font-size: var(--text-body); line-height: 1.5; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible, h3[tabindex="-1"]:focus-visible { outline: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 16px; background: var(--ink); color: white; border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.page-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 50; min-height: 72px; display: flex; align-items: center; gap: 36px; padding: 10px max(24px, calc((100vw - 1180px) / 2)); background: rgba(255, 249, 237, 0.94); border-bottom: 1px solid rgba(23, 35, 63, 0.08); backdrop-filter: blur(14px); }
body:not(.route-home) .site-header { min-height: 64px; max-height: 64px; padding-block: 6px; gap: 16px; }
body:not(.route-home) .science-brand { font-size: 16px; }
body:not(.route-home) .score-pill,
body:not(.route-home) .streak-pill,
body:not(.route-home) .account-button { height: 40px; }
body:not(.route-home) .level-pill { min-width: 0; width: auto; height: 40px; grid-template-columns: auto; padding: 2px; }
body:not(.route-home) .score-pill small,
body:not(.route-home) .level-pill > div,
body:not(.route-home) .level-pill > small,
body:not(.route-home) .streak-pill small,
body:not(.route-home) .account-button small { display: none; }
body:not(.route-home) .module-nav { top: 64px; }
body:not(.route-home) .page-view[data-page="library"] { min-height: calc(100vh - 64px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Fredoka", sans-serif; font-size: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.brand strong { color: var(--coral-text); } /* a11y-on: var(--cream) */
.brand-tile { position: relative; display: grid; place-items: center; width: 38px; height: 42px; background: var(--ink); border-radius: 8px; color: white; font-size: 22px; line-height: 1; box-shadow: 3px 3px 0 var(--yellow); }
.brand-tile small { position: absolute; top: 4px; left: 5px; font: 700 8px "Atkinson Hyperlegible", sans-serif; }
.main-nav { display: flex; gap: 28px; margin-right: auto; }
.main-nav a { position: relative; color: #536079; font-weight: 700; text-decoration: none; } /* a11y-on: var(--cream) */
.main-nav a::after { content: ""; position: absolute; right: 50%; bottom: -6px; left: 50%; height: 3px; background: var(--coral); border-radius: 3px; transition: .2s ease; }
.main-nav a:hover::after, .main-nav a:focus-visible::after { right: 0; left: 0; }
.player-bar { display: flex; align-items: center; gap: 10px; }
.streak-pill { display: flex; align-items: center; gap: 5px; height: 45px; padding: 0 13px; background: #fff2df; border: 1px solid #f6ddba; border-radius: 14px; }
.streak-pill span { font-size: 20px; }
.streak-pill strong { font: 700 18px "Fredoka", sans-serif; }
.streak-pill small { color: var(--muted); }
.level-pill { display: grid; grid-template-columns: auto 82px auto; align-items: center; gap: 8px; min-width: 205px; height: 48px; padding: 5px 10px 5px 5px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--soft-shadow); }
.level-orb { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 12px; background: var(--blue-strong); color: white; font: 700 17px "Fredoka", sans-serif; }
.level-pill > div { display: grid; gap: 2px; }
.level-pill strong { font: 600 12px "Fredoka", sans-serif; }
.level-pill > small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.xp-track { width: 82px; height: 5px; overflow: hidden; background: #e8eaf4; border-radius: 9px; }
.xp-track i { display: block; width: 0; height: 100%; background: var(--yellow); transition: width .4s ease; }

.hero { min-height: 590px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 45px; padding-block: 78px 68px; overflow: hidden; }
.hero-copy { position: relative; z-index: 2; }
.eyebrow, .section-kicker { margin: 0 0 13px; color: var(--blue-dark); font: 700 12px "Fredoka", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow span { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 6px; background: #e8eaff; border-radius: 50%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; }
h1 { max-width: 650px; margin-bottom: 20px; font-size: clamp(46px, 5.1vw, 72px); letter-spacing: -.04em; }
h1 em { color: var(--coral-display); font-style: normal; position: relative; } /* a11y-on: var(--cream) */
h1 em::after { content: ""; position: absolute; right: 2px; bottom: -5px; left: 2px; height: 8px; border-top: 3px solid var(--yellow); border-radius: 50%; transform: rotate(-2deg); }
.hero-text { max-width: 590px; margin-bottom: 28px; color: var(--muted); font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 48px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 0 20px; border: 2px solid transparent; border-radius: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--coral-strong); color: white; box-shadow: 0 7px 0 var(--coral-strong-shadow); }
.button-primary:hover { box-shadow: 0 5px 0 var(--coral-strong-shadow); }
.button-secondary { background: white; border-color: #dcd8d1; box-shadow: 0 5px 0 #ddd7ce; }
.button-success { background: var(--green-strong); color: white; box-shadow: 0 5px 0 var(--green-strong-shadow); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.compact { min-height: 42px; padding-inline: 15px; font-size: 14px; }
.button.compact span { font-size: 11px; opacity: .8; }
.hero-stats { display: flex; gap: 32px; margin-top: 38px; padding-top: 23px; border-top: 1px dashed #d9d2c7; }
.hero-stats div { display: grid; }
.hero-stats strong { color: var(--ink); font: 700 25px "Fredoka", sans-serif; }
.hero-stats span { color: var(--muted); font-size: 12px; }

.explore-section { padding-block: 8px 12px; background: white; --tile: clamp(44px, calc((100vh - 300px) / 10), 62px); }
.explore-bar { display: flex; align-items: center; gap: 10px; height: 56px; margin-bottom: 8px; }
.explore-bar .search-box { flex: 1; max-width: none; height: 44px; margin: 0; }
.explore-bar .family-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.explore-bar .family-filter select { height: 44px; min-width: 160px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: white; font-weight: 700; color: var(--ink); }
.collection-ring--compact { width: 44px; height: 44px; flex: 0 0 auto; }
.collection-ring--compact span { font-size: 10px; }
.collection-ring--compact strong { font-size: 11px; }
.collection-ring-label { align-self: center; margin-left: -6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.explore-section .results-status { min-height: 0; margin: 0 0 6px; padding-inline: max(24px, calc((100vw - 1180px) / 2)); font-size: 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.section-heading h2 { margin-bottom: 9px; font-size: clamp(33px, 4vw, 46px); letter-spacing: -.025em; }
.section-heading p:not(.section-kicker) { max-width: 580px; margin-bottom: 0; color: var(--muted); font-size: 17px; }
.collection-ring { position: relative; flex: 0 0 auto; width: 100px; height: 100px; display: grid; place-items: center; }
.collection-ring svg { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); }
.collection-ring circle { fill: none; stroke: #ecedf3; stroke-width: 4; }
.collection-ring circle:last-child { stroke: var(--yellow); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset .5s ease; }
.collection-ring span { z-index: 1; display: grid; text-align: center; }
.collection-ring strong { font: 700 20px "Fredoka", sans-serif; }
.collection-ring small { color: var(--muted); font-size: 10px; }
.table-tools { display: flex; gap: 10px; margin-bottom: 15px; }
.search-box { flex: 1; max-width: 480px; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #f8f8fb; border: 2px solid transparent; border-radius: 13px; transition: .2s ease; }
.search-box:focus-within { background: white; border-color: var(--blue); box-shadow: 0 0 0 4px #e9ebff; }
.search-box > span { color: var(--muted); font-size: 25px; line-height: 1; }
.search-box input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink); }
.search-box kbd { padding: 2px 7px; background: white; border: 1px solid #dddfe8; border-bottom-width: 2px; border-radius: 6px; color: var(--muted); font-size: 11px; }
.icon-button { width: 48px; height: 48px; background: white; border: 1px solid var(--line); border-radius: 13px; font-size: 22px; cursor: pointer; }
.category-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; background: white; border: 1px solid var(--line); border-radius: 99px; color: #5d667c; font-size: 12px; font-weight: 700; cursor: pointer; }
.filter-chip::before { content: ""; width: 9px; height: 9px; background: var(--chip-color, #c9cbd2); border-radius: 3px; }
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: white; }
.filter-chip[data-category="all"]::before { background: conic-gradient(var(--coral), var(--yellow), var(--nonmetal), var(--blue), var(--coral)); }
.results-status { min-height: 21px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: clip; padding: 8px 2px 18px; }
.periodic-table { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); grid-template-rows: repeat(7, var(--tile, clamp(46px, 5.2vw, 70px))) 18px repeat(2, var(--tile, clamp(46px, 5.2vw, 70px))); gap: clamp(2px, .35vw, 5px); }
.element-tile { position: relative; min-width: 0; padding: 6px 4px 4px; overflow: hidden; background: var(--tile-color); border: 2px solid transparent; border-radius: 10px; text-align: center; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease; }
.element-tile:hover, .element-tile:focus-visible { z-index: 3; border-color: var(--ink); outline: 0; transform: translateY(-4px) scale(1.08); box-shadow: 0 9px 16px rgba(31, 40, 75, .18); }
.element-tile .tile-number { position: absolute; top: 3px; left: 5px; font-size: 8px; font-weight: 700; opacity: .7; }
.element-tile .tile-symbol { display: block; margin-top: 5px; font: 700 24px/1 "Fredoka", sans-serif; }
.element-tile .tile-name { display: block; overflow: hidden; margin-top: 3px; font-size: 8px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
@media (max-height: 820px) {
  .element-tile .tile-name { display: none; }
}
.element-tile.mastered::after { content: "★"; position: absolute; top: 1px; right: 4px; color: #553800; font-size: 10px; filter: drop-shadow(0 1px white); } /* a11y-on: #f49a8b -- the lightest category tile; 5.04:1 there, higher on the other nine */
.element-tile.dimmed { opacity: .12; filter: grayscale(.5); }
.element-tile.match { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.08); } }
.f-block-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px; background: #f4f1eb; border: 1px dashed #c7c0b7; border-radius: 9px; color: var(--muted); font-size: 10px; line-height: 1.15; hyphens: auto; overflow-wrap: break-word; text-align: center; }
.f-block-label strong { font-size: 12px; color: var(--ink); }
.nonmetal { --tile-color: var(--nonmetal); }
.noble { --tile-color: var(--noble); }
.alkali { --tile-color: var(--alkali); }
.alkaline { --tile-color: var(--alkaline); }
.metalloid { --tile-color: var(--metalloid); }
.halogen { --tile-color: var(--halogen); }
.transition { --tile-color: var(--transition); }
.post-transition { --tile-color: var(--post-transition); }
.lanthanide { --tile-color: var(--lanthanide); }
.actinide { --tile-color: var(--actinide); }
.table-hint { display: none; justify-content: center; gap: 7px; color: var(--muted); font-size: 12px; }
@media (max-width: 1023px) {
  .table-hint { display: flex; }
}

.page-view[data-page="train"] { height: calc(100vh - 122px); overflow: hidden; }
.training-section { display: flex; flex-direction: column; min-height: 0; height: 100%; padding-block: 12px 16px; overflow: hidden; }
.train-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.train-head h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); }
.train-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 6px 12px; background: #eef0ff; border: 1px solid #d8dcfc; border-radius: 999px; color: var(--muted); font-size: 13px; }
.train-summary small { color: var(--muted); }
.train-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.train-tabs [role="tab"] { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: white; font-weight: 700; cursor: pointer; white-space: nowrap; }
.train-tabs [role="tab"].active, .train-tabs [aria-selected="true"] { background: var(--ink); color: white; border-color: var(--ink); }
.train-panels { flex: 1; min-height: 0; max-height: none; display: flex; flex-direction: column; }
.train-panel { flex: 1; min-height: 0; max-height: none; overflow: auto; }
.train-panel > .training-card, .train-panel > .chemistry-study { width: min(100%, 860px); margin: 0 auto; }
.page-view[data-page="train"] .training-grid { display: block; }
.page-view[data-page="train"] .flashcard { height: clamp(180px, 30vh, 260px); }
.page-view[data-page="train"] .quiz-content { min-height: 0; padding: 12px; }
.page-view[data-page="train"] .card-heading { margin-bottom: 10px; }
.page-view[data-page="train"] .flash-face strong { font-size: 56px; }
.centered-heading { display: block; max-width: 650px; margin-inline: auto; text-align: center; }
.centered-heading p { margin-inline: auto; }
.training-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.training-card { padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--soft-shadow); }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-icon { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; color: white; font: 700 23px "Fredoka", sans-serif; transform: rotate(-3deg); }
.card-icon.blue { background: var(--blue); }
.card-icon.coral { background: var(--coral-strong); }
.card-heading div:nth-child(2) { margin-right: auto; }
.card-heading p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card-heading h3 { margin: 2px 0 0; font-size: 20px; }
.card-count, .combo-pill { padding: 6px 10px; background: #f3f4f9; border-radius: 99px; color: var(--muted); font-size: 11px; font-weight: 700; }
.combo-pill { display: flex; gap: 4px; color: #a75b00; background: #fff1cf; }
.flashcard { width: 100%; height: 285px; padding: 0; background: transparent; border: 0; perspective: 1000px; cursor: pointer; }
.flashcard-inner { position: relative; width: 100%; height: 100%; display: block; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.flashcard.revealed .flashcard-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border-radius: 20px; backface-visibility: hidden; }
.flash-front { background: #eef0ff; border: 2px solid #d9defd; }
.flash-back { background: #e6f7ef; border: 2px solid #c8eadb; transform: rotateY(180deg); }
.flash-face::before, .flash-face::after { content: "✦"; position: absolute; color: rgba(91, 114, 232, .22); font-size: 22px; }
.flash-face::before { top: 22px; left: 25px; }
.flash-face::after { right: 25px; bottom: 22px; }
.flash-face strong { margin: 9px 0; font: 700 78px/1 "Fredoka", sans-serif; }
.flash-back strong { font-size: 48px; }
.flash-face > span:not(.flash-prompt) { font-weight: 700; }
.flash-prompt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.flash-face small { max-width: 330px; margin-top: 16px; color: var(--muted); text-align: center; }
.flash-actions { display: flex; align-items: center; gap: 9px; margin-top: 16px; }
.text-button { margin-left: auto; padding: 8px 3px; background: transparent; border: 0; color: var(--blue-dark); font-weight: 700; cursor: pointer; }
.quiz-content { min-height: 343px; padding: 22px; background: #fff7f3; border: 2px solid #f6dfd7; border-radius: 20px; }
.quiz-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.quiz-progress { height: 6px; margin: 8px 0 25px; overflow: hidden; background: #f2dcd4; border-radius: 8px; }
.quiz-progress i { display: block; width: 10%; height: 100%; background: var(--coral); border-radius: inherit; transition: width .3s ease; }
.quiz-question { min-height: 52px; margin-bottom: 18px; font: 600 21px/1.25 "Fredoka", sans-serif; text-align: center; }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.answer-button { min-height: 66px; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 8px 13px; background: white; border: 2px solid #e5ddd8; border-radius: 13px; cursor: pointer; transition: .15s ease; }
.answer-button strong { font: 700 25px "Fredoka", sans-serif; }
.answer-button:hover:not(:disabled) { border-color: var(--blue); transform: translateY(-2px); }
.answer-button.correct { background: #dff4e9; border-color: var(--green); color: #246f4a; }
.answer-button.wrong { background: #fee4e0; border-color: var(--coral); color: #a43f35; }
.answer-button:disabled { cursor: default; }
.quiz-feedback { min-height: 24px; margin: 14px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }
.quiz-feedback.good { color: #26764e; }
.quiz-feedback.bad { color: #a43f35; }
.quiz-next { width: 100%; min-height: 41px; margin-top: 6px; box-shadow: none; }

.badges-section { padding-block: 16px 20px; background: #f0effb; }
.page-view[data-page="badges"] .section-heading { margin-bottom: 12px; }
.page-view[data-page="badges"] .section-heading h2 { margin-bottom: 4px; font-size: clamp(24px, 3vw, 32px); }
.page-view[data-page="badges"] .section-heading p:not(.section-kicker) { font-size: 14px; }
.badge-total { padding: 9px 15px; background: white; border-radius: 99px; color: var(--muted); font-size: 13px; box-shadow: var(--soft-shadow); }
.badge-total strong { color: var(--ink); }
.badge-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.badge-card { position: relative; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 8px; background: white; border: 1px solid #deddea; border-radius: 20px; text-align: center; }
.badge-card.locked { filter: grayscale(1); opacity: .58; }
.badge-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 8px; background: #fff2cb; border: 5px solid white; outline: 2px solid #edcf75; border-radius: 50%; font-size: 26px; box-shadow: 0 5px 0 #d4c17f; }
.badge-card:nth-child(2n) .badge-icon { background: #e5e8ff; outline-color: #aeb8ef; box-shadow-color: #8f9bd8; }
.badge-card h3 { margin: 0 0 4px; font-size: 15px; }
.badge-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.25; }
.badge-lock { position: absolute; top: 10px; right: 11px; font-size: 13px; }
.badge-card.unlocked { animation: badge-in .5s ease; border-color: #e7c34a; }
@keyframes badge-in { 50% { transform: translateY(-5px) rotate(1deg); } }

footer { padding-block: 30px; background: var(--ink); color: white; }
footer .page-shell { display: flex; align-items: center; gap: 25px; }
footer p { margin: 0 auto 0 0; color: #b8bfd0; }
footer .reset-button { margin: 0; color: #d6dae6; font-size: 12px; }

.element-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100vh - 30px); padding: 0; overflow: visible; background: white; border: 0; border-radius: 28px; color: var(--ink); box-shadow: 0 24px 80px rgba(11, 19, 40, .35); }
.element-dialog::backdrop { background: rgba(14, 21, 39, .65); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 38px; height: 38px; display: grid; place-items: center; background: rgba(255,255,255,.8); border: 0; border-radius: 50%; font-size: 25px; cursor: pointer; }
.dialog-hero { min-height: 240px; display: grid; grid-template-columns: 155px 1fr; align-items: center; gap: 28px; padding: 40px 38px 28px; background: var(--tile-color); border-radius: 28px 28px 0 0; }
.dialog-tile { position: relative; width: 150px; height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,.58); border: 3px solid rgba(255,255,255,.8); border-radius: 22px; box-shadow: 7px 8px 0 rgba(23,35,63,.14); }
.dialog-tile small:first-child { position: absolute; top: 12px; left: 14px; font-weight: 700; }
.dialog-tile strong { font: 700 72px/1 "Fredoka", sans-serif; }
.dialog-tile span { font-weight: 700; }
.dialog-info .dialog-category { display: inline-block; margin-bottom: 8px; padding: 5px 9px; background: rgba(255,255,255,.65); border-radius: 99px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dialog-info h2 { margin-bottom: 8px; font-size: 37px; }
.dialog-info p { margin: 0; font-size: 14px; }
.dialog-body { padding: 27px 38px 34px; }
.dialog-fact { position: relative; margin-bottom: 22px; padding: 15px 16px 15px 45px; background: #fff7e1; border-radius: 14px; color: #565264; }
.dialog-fact::before { content: "💡"; position: absolute; top: 13px; left: 14px; }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 23px; }
.fact-grid div { padding: 10px; background: #f6f6f9; border-radius: 11px; text-align: center; }
.fact-grid small { display: block; color: var(--muted); font-size: 10px; }
.fact-grid strong { font-size: 13px; }
.master-button { width: 100%; }
.master-button.is-mastered { background: #fff3c6; border-color: #e7c34a; color: #765900; box-shadow: 0 5px 0 #d8b842; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; min-width: 240px; padding: 12px 18px; background: var(--ink); border: 1px solid #3d4863; border-radius: 14px; color: white; font-weight: 700; text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast strong { color: var(--yellow); }
.confetti-layer { position: fixed; z-index: 200; inset: 0; overflow: hidden; pointer-events: none; }
.confetti { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: confetti-fall 1.3s ease-in forwards; }
@keyframes confetti-fall { to { transform: translate(var(--drift), 105vh) rotate(720deg); opacity: .3; } }

@media (max-width: 960px) {
  .main-nav { display: none; }
  .player-bar { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding-top: 55px; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-actions, .hero-stats { justify-content: center; }
  .training-grid { grid-template-columns: 1fr; max-width: 690px; margin-inline: auto; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 650px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 64px; padding: 8px 12px; }
  .brand { font-size: 16px; }
  .brand-tile { width: 32px; height: 36px; font-size: 19px; }
  .streak-pill { padding-inline: 9px; }
  .streak-pill small, .level-pill > div, .level-pill > small { display: none; }
  .level-pill { min-width: 43px; width: 43px; grid-template-columns: 1fr; padding: 3px; border: 0; background: transparent; box-shadow: none; }
  .hero { min-height: auto; gap: 15px; padding-block: 50px 42px; }
  h1 { font-size: clamp(42px, 13vw, 58px); }
  .hero-text { font-size: 17px; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; padding-inline: 12px; }
  .hero-stats { width: 100%; gap: 8px; }
  .hero-stats div { flex: 1; }
  .hero-stats strong { font-size: 20px; }
  .hero-stats span { font-size: 10px; }
  .explore-section, .training-section, .badges-section { padding-block: 12px; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 34px; }
  .collection-ring { width: 82px; height: 82px; }
  .category-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .filter-chip { flex: 0 0 auto; }
  .periodic-table { grid-template-rows: repeat(10, 64px); min-width: 1020px; }
  .table-hint { display: flex; }
  .training-card { padding: 15px; border-radius: 20px; }
  .flashcard { height: 270px; }
  .flash-actions { flex-wrap: wrap; }
  .flash-actions .button { flex: 1; }
  .flash-actions .text-button { flex-basis: 100%; margin: 0; }
  .quiz-content { padding: 16px; }
  .answer-grid { gap: 7px; }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .badge-card { min-height: 170px; }
  footer .page-shell { flex-wrap: wrap; justify-content: center; text-align: center; }
  footer p { width: 100%; margin: 0; order: 3; }
  .dialog-hero { grid-template-columns: 110px 1fr; gap: 18px; padding: 34px 22px 24px; }
  .dialog-tile { width: 110px; height: 135px; }
  .dialog-tile strong { font-size: 55px; }
  .dialog-info h2 { font-size: 28px; }
  .dialog-body { padding: 22px; }
}

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

/* Paginated game navigation and adaptive activities */
button.brand-button { padding: 0; background: transparent; border: 0; color: inherit; cursor: pointer; }
.main-nav .nav-tab { position: relative; padding: 8px 2px; background: transparent; border: 0; color: #536079; font-weight: 700; cursor: pointer; } /* a11y-on: var(--cream) */
.main-nav .nav-tab::after { content: ""; position: absolute; right: 50%; bottom: 1px; left: 50%; height: 3px; background: var(--coral); border-radius: 3px; transition: .2s ease; }
.main-nav .nav-tab:hover::after, .main-nav .nav-tab:focus-visible::after, .main-nav .nav-tab.active::after { right: 0; left: 0; }
.main-nav .nav-tab.active { color: var(--ink); }
.score-pill { height: 48px; display: flex; align-items: center; gap: 8px; padding: 5px 13px; background: var(--ink); border-radius: 15px; color: white; box-shadow: var(--soft-shadow); }
.score-pill > span { color: var(--yellow); font-size: 21px; }
.score-pill div { display: grid; line-height: 1.05; }
.score-pill small { color: #aeb7d0; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.score-pill strong { font: 600 15px "Fredoka", sans-serif; white-space: nowrap; }
body:not(.route-home) .platform-footer { display: none; }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } }
.page-view .explore-section, .page-view .badges-section { min-height: 0; }

.learning-summary { max-width: 700px; display: flex; align-items: center; gap: 13px; margin: -10px auto 24px; padding: 13px 17px; background: #eef0ff; border: 1px solid #d8dcfc; border-radius: 16px; }
.learning-summary > span { font-size: 27px; }
.learning-summary div { display: grid; }
.learning-summary strong { font: 600 14px "Fredoka", sans-serif; }
.learning-summary small { color: var(--muted); }
.button-missed { background: #fff0ed; border-color: #f3b5ad; color: #a54439; box-shadow: 0 5px 0 #edc3bc; }
.quiz-mode-tabs { display: flex; gap: 5px; margin-bottom: 12px; padding: 5px; overflow-x: auto; background: #f3f3f7; border-radius: 13px; }
.quiz-mode { flex: 1 0 auto; min-height: 34px; padding: 0 10px; background: transparent; border: 0; border-radius: 9px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.quiz-mode.active { background: white; color: var(--ink); box-shadow: 0 2px 7px rgba(31, 40, 75, .1); }
.quiz-challenge { min-height: 74px; display: grid; place-items: center; }
.quiz-challenge .quiz-question { min-height: 0; margin-bottom: 10px; }
.missing-tile-card { position: relative; width: 100px; min-height: 112px; display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 0 auto 12px; background: var(--tile-color); border: 3px solid white; outline: 1px solid rgba(23,35,63,.12); border-radius: 15px; box-shadow: 5px 6px 0 rgba(23,35,63,.14); }
.missing-tile-card .missing-number { position: absolute; top: 8px; left: 10px; display: grid; place-items: center; min-width: 18px; min-height: 16px; font-size: 11px; font-weight: 700; }
.missing-tile-card strong { font: 700 42px/1 "Fredoka", sans-serif; }
.missing-tile-card small { margin-top: 7px; font-weight: 700; }
.tile-blank { display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden; background: rgba(255,255,255,.48); border: 1.5px dashed rgba(23,35,63,.48); border-radius: 6px; color: rgba(23,35,63,.7); line-height: 1; }
.missing-number .blank-number { width: 18px; height: 16px; font-size: 10px; }
.missing-tile-card > .blank-symbol { width: 49px; height: 45px; margin: 0; font: 700 28px/1 "Fredoka", sans-serif; }
.missing-tile-card > .blank-name { width: 68px; height: 19px; margin-top: 7px; font-size: 10px; }
.typed-answer { grid-column: 1 / -1; display: flex; gap: 8px; }
.typed-answer input, .typed-answer select { flex: 1; min-width: 0; height: 49px; padding: 0 13px; background: white; border: 2px solid #ded9d5; border-radius: 12px; outline: 0; }
.typed-answer input:focus, .typed-answer select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #e4e7ff; }
.typed-answer button { min-width: 88px; min-height: 49px; padding: 0 14px; background: var(--blue-strong); border: 0; border-radius: 12px; color: white; font-weight: 700; cursor: pointer; }

.puzzle-section { --tile: clamp(44px, calc((100vh - 300px) / 10), 62px); min-height: 0; padding-block: 10px 16px; }
.puzzle-bar { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 8px; padding: 6px 10px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.puzzle-bar .puzzle-token { width: 74px; height: 64px; flex: 0 0 auto; padding-top: 2px; border-width: 3px; border-radius: 12px; box-shadow: 3px 3px 0 rgba(23,35,63,.12); }
.puzzle-bar .puzzle-token > span { display: none; }
.puzzle-bar .puzzle-token strong { font-size: 26px; }
.puzzle-bar .puzzle-token small { max-width: 100%; margin-top: 2px; overflow: hidden; font-size: 9px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.puzzle-bar #puzzle-hint { flex: 1; margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.puzzle-bar select { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }
.puzzle-bar .puzzle-meter { min-width: 120px; margin-left: 0; }
.puzzle-bar .text-button { margin-left: 0; }
.puzzle-table-scroll { min-width: 0; overflow-x: auto; padding: 4px; background: rgba(255,255,255,.48); border: 1px solid var(--line); border-radius: 20px; }
.puzzle-table { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); grid-template-rows: repeat(7, var(--tile)) 14px repeat(2, var(--tile)); gap: clamp(1px, .25vw, 4px); padding: clamp(5px, .7vw, 10px); }
.puzzle-score { min-width: 120px; padding: 12px 18px; background: var(--ink); border-radius: 16px; color: white; text-align: center; box-shadow: var(--soft-shadow); }
.puzzle-score small { display: block; color: #aeb7d0; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.puzzle-score strong { color: var(--yellow); font: 700 28px "Fredoka", sans-serif; }
.puzzle-meter { min-width: 210px; margin-left: auto; }
.puzzle-meter > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; text-align: right; }
.puzzle-meter > div { height: 8px; overflow: hidden; background: #e8e9ef; border-radius: 8px; }
.puzzle-meter i { display: block; width: 0; height: 100%; background: var(--green); border-radius: inherit; transition: width .3s ease; }
.puzzle-token { position: relative; width: 112px; height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--tile-color); border: 4px solid white; outline: 1px solid rgba(23,35,63,.12); border-radius: 17px; box-shadow: 6px 7px 0 rgba(23,35,63,.15); transition: .2s ease; }
.puzzle-token > span { position: absolute; top: 8px; left: 10px; font-weight: 700; }
.puzzle-token strong { font: 700 48px/1 "Fredoka", sans-serif; }
.puzzle-token small { margin-top: 7px; font-weight: 700; }
.puzzle-token.bump { animation: token-bump .35s ease; }
@keyframes token-bump { 50% { transform: translateY(-8px) rotate(2deg); } }
.puzzle-slot { position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px; background: rgba(255,255,255,.7); border: 2px dashed #c8cbd6; border-radius: 9px; color: transparent; cursor: pointer; transition: .18s ease; }
.puzzle-slot:hover:not(.placed) { background: #eef0ff; border-color: var(--blue); transform: translateY(-2px); }
.puzzle-slot::after { content: "?"; color: #878b9c; font: 700 19px "Fredoka", sans-serif; }
.puzzle-slot.placed { background: var(--tile-color); border: 2px solid rgba(23,35,63,.13); color: var(--ink); cursor: default; animation: slot-light .55s ease; box-shadow: 0 0 0 3px rgba(73,173,120,.22); }
.puzzle-slot.placed::after { display: none; }
.puzzle-slot .puzzle-slot-number { position: absolute; top: 3px; left: 5px; font-size: 8px; font-weight: 700; }
.puzzle-slot strong { font: 700 21px/1 "Fredoka", sans-serif; }
.puzzle-slot small { max-width: 100%; margin-top: 3px; overflow: hidden; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.puzzle-slot.wrong { animation: slot-wrong .35s ease; border-color: var(--coral); background: #fee4e0; }
.puzzle-slot.target-pulse { animation: target-pulse .75s ease 2; }
.puzzle-placeholder { display: grid; place-items: center; padding: 2px; background: #f2efe9; border: 1px dashed #c7c0b7; border-radius: 9px; color: var(--muted); font-size: 10px; line-height: 1.15; hyphens: auto; overflow-wrap: break-word; text-align: center; }
@keyframes slot-light { 40% { transform: scale(1.12); filter: brightness(1.15); } }
@keyframes slot-wrong { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@keyframes target-pulse { 50% { border-color: var(--yellow); box-shadow: 0 0 0 5px rgba(246,189,69,.35); } }
.puzzle-feedback { min-height: 27px; margin: 8px 0 0; font-weight: 700; text-align: center; }
.puzzle-feedback.good { color: #28784f; }
.puzzle-feedback.bad { color: #a43f35; }

@media (max-width: 1100px) {
  .site-header { gap: 18px; }
  .main-nav { gap: 15px; }
  .score-pill { padding-inline: 10px; }
}
@media (max-width: 960px) {
  .main-nav { display: flex; position: fixed; z-index: 60; right: 12px; bottom: 12px; left: 12px; justify-content: space-around; gap: 2px; margin: 0; padding: 6px; background: rgba(23,35,63,.96); border-radius: 17px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
  .main-nav .nav-tab { flex: 1; padding: 10px 3px; color: #cfd4e2; font-size: 12px; }
  .main-nav .nav-tab.active { background: #35405c; border-radius: 11px; color: white; }
  .main-nav .nav-tab::after { display: none; }
  footer { padding-bottom: 85px; }
  .page-view { min-height: calc(100vh - 64px); }
}
@media (max-width: 760px) {
  .score-pill small { display: none; }
  .score-pill div { display: block; }
  .score-pill { height: 43px; padding-inline: 9px; }
  .score-pill strong { font-size: 12px; }
  .puzzle-token { width: 92px; height: 104px; }
  .puzzle-token strong { font-size: 39px; }
  .puzzle-feedback { margin-left: 0; }
}
@media (max-width: 650px) {
  .player-bar { gap: 5px; }
  .streak-pill { height: 43px; }
  .site-header > .brand > span:last-child { display: none; }
  .puzzle-section { padding-block: 10px 16px; }
  .puzzle-meter { width: 100%; margin-left: 0; }
  .puzzle-meter > span { text-align: left; }
  .quiz-mode { font-size: 10px; }
  .typed-answer { flex-direction: column; }
  .flash-actions .button { flex: 1 1 30%; padding-inline: 8px; }
}

/* Preserve legibility on phones while keeping tablet landscape fully fitted. */
@media (max-width: 650px) {
  .table-scroll { overflow-x: auto; scrollbar-color: #c9cad1 transparent; }
}
@media (max-width: 520px) {
  .puzzle-table-scroll { overflow-x: auto; scrollbar-color: #c9cad1 transparent; }
  .puzzle-table { min-width: 720px; }
}

/* Firebase accounts */
.account-button { min-width: 154px; height: 48px; display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; background: white; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: var(--soft-shadow); cursor: pointer; text-align: left; }
.account-button:hover { border-color: #bfc5ec; transform: translateY(-1px); }
.account-avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; background: #e9ebff; border-radius: 11px; color: var(--blue-dark); font: 700 15px "Fredoka", sans-serif; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-button > span:last-child { min-width: 0; display: grid; line-height: 1.1; }
.account-button small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.account-button strong { max-width: 92px; overflow: hidden; font: 600 12px "Fredoka", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.account-button.syncing .account-avatar { animation: account-pulse .8s ease infinite alternate; }
.account-button.synced .account-avatar { background: #dff4e9; color: #26764e; }
.account-button.sync-error .account-avatar { background: #fee4e0; color: #a43f35; }
@keyframes account-pulse { to { filter: brightness(.88); transform: scale(.94); } }

.auth-dialog { width: min(470px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow-x: hidden; overflow-y: auto; background: white; border: 0; border-radius: 26px; color: var(--ink); box-shadow: 0 24px 80px rgba(11,19,40,.36); }
.auth-dialog::backdrop { background: rgba(14,21,39,.65); backdrop-filter: blur(4px); }
.auth-dialog .dialog-close { position: absolute; top: 12px; right: 12px; }
.auth-shell { padding: 30px; }
.auth-heading { display: flex; align-items: center; gap: 14px; padding-right: 38px; margin-bottom: 20px; }
.auth-heading p { margin: 0; color: var(--blue-dark); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.auth-heading h2 { margin: 2px 0 0; font-size: 27px; }
.auth-intro { margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 14px; padding: 5px; background: #f2f3f7; border-radius: 13px; }
.auth-tabs button { min-height: 38px; background: transparent; border: 0; border-radius: 9px; color: var(--muted); font-weight: 700; cursor: pointer; }
.auth-tabs button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(31,40,75,.1); }
.google-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; background: white; border: 2px solid #dedfe6; border-radius: 13px; font-weight: 700; cursor: pointer; }
.google-button:hover { background: #f8f9ff; border-color: #bbc2ec; }
.google-button span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #4285f4; font: 700 18px Arial, sans-serif; } /* a11y-exempt: Google brand mark; SC 1.4.3 exempts logotypes and the blue G may not be recoloured */
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 11px; } /* a11y-on: white */
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #e5e5eb; }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 5px; color: #535d74; font-size: 11px; font-weight: 700; }
.auth-form input { width: 100%; height: 47px; padding: 0 13px; background: #f8f8fb; border: 2px solid transparent; border-radius: 11px; color: var(--ink); outline: 0; }
.auth-form input:focus { background: white; border-color: var(--blue); box-shadow: 0 0 0 3px #e6e8ff; }
.auth-form .button { width: 100%; margin-top: 2px; }
.auth-message { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.auth-message.error { color: #a43f35; }
.auth-message.success { color: #26764e; }
.forgot-button { display: block; margin: 0 auto; color: var(--blue-dark); font-size: 12px; }
.guest-button { width: 100%; min-height: 42px; margin-top: 7px; background: #f7f7fa; border: 1px solid #e4e4eb; border-radius: 11px; color: var(--muted); font-weight: 700; cursor: pointer; }
.auth-profile { display: flex; flex-direction: column; align-items: center; padding-top: 5px; text-align: center; }
.profile-avatar { width: 82px; height: 82px; display: grid; place-items: center; overflow: hidden; margin: 5px 0 14px; background: #e9ebff; border: 5px solid white; outline: 2px solid #b8c0ef; border-radius: 26px; color: var(--blue-dark); font: 700 32px "Fredoka", sans-serif; box-shadow: var(--soft-shadow); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.auth-profile h3 { margin: 0 0 4px; font-size: 24px; }
.auth-profile > p { margin: 0 0 20px; color: var(--muted); }
.cloud-status { width: 100%; display: flex; align-items: center; gap: 11px; padding: 13px 15px; background: #eaf7f0; border: 1px solid #cfeadb; border-radius: 14px; text-align: left; }
.cloud-status > span { width: 31px; height: 31px; display: grid; place-items: center; background: var(--green-strong); border-radius: 50%; color: white; font-weight: 700; }
.cloud-status div { display: grid; }
.cloud-status small { color: var(--muted); font-size: 10px; }
.cloud-status.error { background: #fff0ed; border-color: #f2cbc4; }
.cloud-status.error > span { background: var(--coral-strong); }
.signout-button { width: 100%; margin-top: 17px; }

@media (max-width: 1160px) {
  .site-header { gap: 14px; }
  .main-nav { gap: 12px; }
  .level-pill { display: none; }
  .account-button { min-width: 138px; }
}
@media (max-width: 650px) {
  .account-button { min-width: 43px; width: 43px; height: 43px; padding: 3px; border: 0; background: transparent; box-shadow: none; }
  .account-button > span:last-child { display: none; }
  .account-avatar { width: 37px; height: 37px; }
  .auth-shell { padding: 25px 18px 22px; }
  .auth-heading h2 { font-size: 23px; }
}

/* ScienceQuiz.org platform */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.science-brand > span:last-child { display: inline-flex; align-items: baseline; }
.science-brand strong { color: var(--blue-dark); } /* a11y-on: var(--cream) */
.science-brand small { color: var(--coral-text); font-size: .58em; } /* a11y-on: var(--cream); a11y-size: 11.6px */
.science-mark { position: relative; flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; background: var(--ink); border-radius: 14px; color: white; box-shadow: 3px 3px 0 var(--yellow); }
.science-mark::before, .science-mark::after, .science-mark i { content: ""; position: absolute; width: 27px; height: 11px; border: 1.5px solid rgba(255,255,255,.5); border-radius: 50%; }
.science-mark::before { transform: rotate(60deg); }
.science-mark::after { transform: rotate(-60deg); }
.science-mark b { z-index: 1; font: 700 17px "Fredoka", sans-serif; }
.platform-header { background: rgba(255,249,237,.96); }
.platform-nav { gap: 24px; }
.platform-nav .section-link { white-space: nowrap; }

.module-nav { position: sticky; z-index: 44; top: 72px; min-height: 58px; display: flex; align-items: center; gap: 18px; padding: 7px max(24px, calc((100vw - 1180px) / 2)); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); box-shadow: 0 5px 14px rgba(31,40,75,.05); backdrop-filter: blur(12px); }
.module-back { flex: 0 0 auto; padding: 7px 10px; background: transparent; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; } /* a11y-on: rgba(255,255,255,.96) -- the .module-nav bar over the page cream */
.module-back:hover { color: var(--blue-dark); } /* a11y-on: rgba(255,255,255,.96) -- the .module-nav bar over the page cream */
.module-identity { display: flex; align-items: center; gap: 8px; padding-right: 17px; border-right: 1px solid var(--line); }
.module-identity > span:last-child { display: grid; line-height: 1.05; }
.module-identity small { color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; } /* a11y-on: rgba(255,255,255,.96) -- the .module-nav bar over the page cream */
.module-identity strong { font: 600 12px "Fredoka", sans-serif; white-space: nowrap; }
.mini-element { position: relative; width: 35px; height: 39px; display: grid; place-items: center; background: var(--nonmetal); border-radius: 8px; font: 700 20px "Fredoka", sans-serif; }
.mini-element small { position: absolute; top: 3px; left: 4px; color: var(--ink); font: 700 7px "Atkinson Hyperlegible", sans-serif; }
.module-links { display: flex; gap: 5px; margin-left: auto; }
.module-links button { min-height: 36px; padding: 0 13px; background: transparent; border: 0; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; } /* a11y-on: rgba(255,255,255,.96) -- the .module-nav bar over the page cream */
.module-links button:hover, .module-links button.active { background: #eef0ff; color: var(--blue-dark); }

.platform-hero { min-height: 650px; display: grid; grid-template-columns: 1.03fr .97fr; align-items: center; gap: 54px; padding-block: 80px; overflow: hidden; }
.platform-hero-copy { position: relative; z-index: 2; }
.platform-hero-copy h1 { max-width: 680px; }
.platform-hero-copy .hero-text { max-width: 620px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; color: var(--muted); font-size: 13px; font-weight: 700; }
.hero-proof span { display: inline-flex; align-items: center; gap: 6px; }
.hero-proof b { width: 20px; height: 20px; display: grid; place-items: center; background: #ddf2e7; border-radius: 50%; color: #28784f; font-size: 11px; }
.platform-hero-visual { position: relative; min-height: 470px; display: grid; place-items: center; }
.hero-blob { position: absolute; width: 440px; height: 405px; background: #eeeafd; border-radius: 43% 57% 51% 49% / 53% 43% 57% 47%; transform: rotate(-5deg); }
.preview-card { position: relative; z-index: 2; width: min(410px, 90%); padding: 24px; background: white; border: 1px solid #dfdeeb; border-radius: 24px; box-shadow: 0 22px 45px rgba(31,40,75,.15); transform: rotate(-1.5deg); }
.preview-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.preview-top b { padding: 4px 8px; background: #fff1cf; border-radius: 99px; color: #a75b00; }
.preview-card > p { margin: 25px auto 18px; font: 600 22px/1.25 "Fredoka", sans-serif; text-align: center; }
.preview-answers { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.preview-answers span { min-height: 53px; display: grid; place-items: center; background: #f7f7fa; border: 2px solid #e6e4eb; border-radius: 12px; font: 600 20px "Fredoka", sans-serif; }
.preview-answers .correct { background: #dff4e9; border-color: var(--green); color: #246f4a; }
.preview-card > small { display: block; margin-top: 16px; color: var(--muted); text-align: center; }
.subject-float { position: absolute; z-index: 3; display: flex; align-items: center; gap: 9px; padding: 10px 13px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--soft-shadow); }
.subject-float > span { font-size: 26px; }
.subject-float div { display: grid; line-height: 1.1; }
.subject-float small { color: var(--muted); font-size: 9px; }
.subject-float strong { font: 600 13px "Fredoka", sans-serif; }
.subject-chem { top: 28px; left: 0; transform: rotate(-4deg); }
.subject-space { right: -4px; bottom: 38px; transform: rotate(3deg); }
.xp-pop { position: absolute; z-index: 4; top: 80px; right: 5px; padding: 8px 12px; background: var(--yellow); border-radius: 11px; font: 700 14px "Fredoka", sans-serif; box-shadow: 0 5px 0 #d39b28; transform: rotate(5deg); }

.trust-strip { background: var(--ink); color: white; }
.trust-strip .page-shell { min-height: 106px; display: flex; align-items: center; gap: 40px; }
.trust-strip p { max-width: 180px; margin: 0 auto 0 0; color: #c6ccdc; font: 600 15px/1.2 "Fredoka", sans-serif; }
.trust-strip .page-shell > div { flex: 1; display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.trust-strip span { display: grid; color: #b9c0d3; font-size: 10px; text-align: center; }
.trust-strip strong { color: var(--yellow); font: 700 24px "Fredoka", sans-serif; }

.why-section { padding-block: 100px; }
.benefit-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.benefit-card { position: relative; min-height: 345px; padding: 28px; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--soft-shadow); }
.benefit-number { position: absolute; top: 15px; right: 18px; color: rgba(23,35,63,.09); font: 700 48px "Fredoka", sans-serif; }
.benefit-icon { width: 61px; height: 61px; display: grid; place-items: center; margin-bottom: 45px; background: #fff0ed; border-radius: 18px; font-size: 29px; transform: rotate(-4deg); }
.blue-card .benefit-icon { background: #e9ebff; }
.green-card .benefit-icon { background: #e3f5eb; }
.benefit-card h3 { font-size: 23px; }
.benefit-card p { color: var(--muted); }
.benefit-card small { position: absolute; right: 28px; bottom: 25px; left: 28px; padding-top: 14px; border-top: 1px dashed #dddde5; color: var(--blue-dark); font-weight: 700; }

.how-section { padding-block: 85px; background: white; }
.how-section .section-heading { align-items: center; }
.steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.steps-grid article { display: flex; align-items: flex-start; gap: 15px; padding: 22px; background: var(--cream); border: 1px solid var(--line); border-radius: 18px; }
.steps-grid article > span { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; background: var(--blue-strong); border-radius: 13px; color: white; font: 700 18px "Fredoka", sans-serif; box-shadow: 3px 4px 0 #bac1ee; }
.steps-grid h3 { margin: 2px 0 5px; font-size: 17px; }
.steps-grid p { margin: 0; color: var(--muted); font-size: 13px; }

.featured-section { padding-block: 95px; }
.library-link { margin: 0; }
.featured-cards { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.featured-card { min-height: 310px; display: flex; flex-direction: column; align-items: flex-start; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 23px; color: var(--ink); text-align: left; box-shadow: var(--soft-shadow); }
button.featured-card { cursor: pointer; }
button.featured-card:hover { border-color: var(--blue); transform: translateY(-3px); }
.feature-art { position: relative; width: 82px; height: 94px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 20px; background: var(--nonmetal); border: 4px solid white; outline: 1px solid #b8d9cf; border-radius: 16px; box-shadow: 5px 6px 0 #78b9a8; }
.feature-art i { position: absolute; top: 7px; left: 8px; font: 700 10px "Atkinson Hyperlegible",sans-serif; }
.feature-art b { font: 700 42px/1 "Fredoka",sans-serif; }
.feature-art small { font-size: 8px; }
.featured-card > span:nth-child(2) { display: grid; }
.featured-card > span:nth-child(2) small { color: var(--blue-dark); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.featured-card > span:nth-child(2) strong { margin: 6px 0; font: 600 21px "Fredoka",sans-serif; }
.featured-card em { color: var(--muted); font-size: 13px; font-style: normal; }
.featured-card > b { margin-top: auto; padding-top: 16px; color: var(--coral-text); font-size: 13px; }
.future-feature { opacity: .75; }
.future-feature .feature-art { width: 74px; height: 74px; border-radius: 50%; font-size: 31px; box-shadow: none; }
.biology-art { background: #e4f4e6; outline-color: #b9dcbf; }
.space-art { background: #e8e9ff; outline-color: #bfc2ee; }

.platform-cta { padding-block: 48px; background: var(--blue-strong); color: white; }
.platform-cta .page-shell { position: relative; min-height: 190px; display: flex; align-items: center; gap: 35px; overflow: hidden; }
.platform-cta .section-kicker { color: #ecedff; }
.platform-cta h2 { max-width: 670px; margin-bottom: 8px; font-size: clamp(30px,4vw,46px); }
.platform-cta p:last-child { margin: 0; color: #f1f2ff; }
.platform-cta .button { margin-left: auto; flex: 0 0 auto; background: var(--yellow); color: var(--ink); box-shadow: 0 7px 0 #d09a2b; }
.cta-orbit { position: absolute; right: 170px; color: rgba(255,255,255,.13); font-size: 150px; }

.library-hero { max-height: 160px; padding-block: 16px; background: #eef0ff; text-align: left; }
.library-hero-line { display: flex; align-items: center; gap: 20px; }
.library-hero h1 { max-width: none; margin: 0; font-size: clamp(28px, 3vw, 36px); }
.library-hero > .page-shell > p:not(.eyebrow) { max-width: 680px; margin: 0 auto 25px; color: var(--muted); font-size: 18px; }
.library-search { flex: 1 1 320px; max-width: 520px; min-width: 260px; height: 44px; display: flex; align-items: center; gap: 10px; margin: 0; padding: 0 14px; background: white; border: 2px solid transparent; border-radius: 16px; box-shadow: var(--soft-shadow); }
.library-search:focus-within { border-color: var(--blue); }
.library-search > span { font-size: 27px; color: var(--muted); }
.library-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; }
.library-content { padding-block: 12px 24px; }
.library-toolbar { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; }
.subject-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.subject-filters button { min-height: 38px; padding: 0 14px; background: white; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.subject-filters button.active { background: var(--ink); border-color: var(--ink); color: white; }
.library-toolbar > p { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }
.quiz-library-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.library-card { display: flex; flex-direction: column; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 23px; box-shadow: var(--soft-shadow); }
.library-card.available { border-color: #b9c1f0; box-shadow: 0 12px 30px rgba(66,87,200,.13); }
.library-card-art { position: relative; min-height: 90px; display: grid; place-items: center; background: #f2f0e9; overflow: hidden; }
.library-card-art::before { content: ""; position: absolute; width: 120px; height: 120px; border: 1px solid rgba(23,35,63,.08); border-radius: 50%; }
.library-card-art > i { position: absolute; top: 13px; right: 13px; padding: 5px 8px; background: rgba(255,255,255,.8); border-radius: 99px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 700; text-transform: uppercase; }
.element-art { background: #def1eb; }
.element-art > span { position: relative; z-index: 1; width: 54px; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--nonmetal); border: 4px solid white; border-radius: 16px; box-shadow: 5px 6px 0 #6dae9e; font: 700 24px/1 "Fredoka",sans-serif; transform: rotate(-3deg); }
.element-art > span small { position: absolute; top: 6px; left: 8px; font: 700 9px "Atkinson Hyperlegible",sans-serif; }
.element-art > span em { margin-top: 4px; font: 700 8px "Atkinson Hyperlegible",sans-serif; font-style: normal; }
.library-card-art > span:not(.element-art span) { position: relative; z-index: 1; font-size: 32px; }
.biology-card-art { background: #e4f4e6; }
.space-card-art { background: #e7e7fa; }
.physics-card-art { background: #fff0dc; }
.earth-card-art { background: #e5f2e8; }
.body-card-art { background: #fee8e5; }
.library-card-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 12px 14px; }
.card-meta { width: 100%; display: flex; justify-content: space-between; color: var(--blue-dark); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; } /* a11y-on: white */
.card-meta b { color: var(--green-text); } /* a11y-on: white; a11y-size: 9px; a11y-weight: 700 */
.library-card:not(.available) .card-meta b { color: #8a6c2c; } /* a11y-on: white; a11y-size: 9px; a11y-weight: 700 */
.library-card h3 { margin: 4px 0; font-size: 18px; }
.library-card p { color: var(--muted); font-size: 13px; }
.library-card ul { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 10px; padding: 0; list-style: none; }
@media (max-height: 820px) {
  .library-card p, .library-card ul { display: none; }
}
.library-card li { padding: 4px 7px; background: #f3f3f7; border-radius: 6px; color: #666f84; font-size: 9px; font-weight: 700; }
.library-card .button { width: 100%; }
.library-empty { padding: 70px 20px; text-align: center; }
.library-empty span { font-size: 50px; }
.library-empty h3 { margin: 12px 0 5px; }
.library-empty p { color: var(--muted); }

.overview-menu { padding-block: 18px 24px; }
.overview-head h1 { margin-bottom: 8px; font-size: clamp(32px, 4vw, 42px); max-width: none; }
.overview-head > p { max-width: 52ch; margin-bottom: 0; color: var(--muted); }
.overview-menu .hero-stats { margin-top: 16px; padding-top: 14px; }
.overview-actions { margin-top: 18px; }
.activity-grid.overview-actions button { min-height: 0; padding: 16px 18px; }
.overview-actions p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.overview-actions .activity-icon { width: 40px; height: 40px; margin-bottom: 10px; font-size: 20px; }
.overview-actions b { margin-top: 8px; }
.breadcrumb { margin-bottom: 22px; padding: 0; background: transparent; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.breadcrumb:hover { color: var(--blue-dark); }
.activity-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.activity-grid button { min-height: 285px; display: flex; flex-direction: column; align-items: flex-start; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 21px; color: var(--ink); text-align: left; box-shadow: var(--soft-shadow); cursor: pointer; }
.activity-grid button:hover { border-color: var(--blue); transform: translateY(-4px); }
.activity-icon { width: 53px; height: 53px; display: grid; place-items: center; margin-bottom: 29px; border-radius: 16px; font-size: 25px; transform: rotate(-3deg); }
.activity-icon.mint { background: #dcf2eb; }
.activity-icon.blue { background: #e5e8ff; }
.activity-icon.coral { background: #fee5e1; }
.activity-icon.gold { background: #fff1cc; }
.activity-grid small { color: var(--blue-dark); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.activity-grid strong { margin: 6px 0 9px; font: 600 20px "Fredoka",sans-serif; }
.activity-grid p { color: var(--muted); font-size: 13px; }
.activity-grid b { margin-top: auto; color: var(--coral-text); font-size: 12px; } /* a11y-on: white */

.platform-footer { padding-block: 32px 22px; }
.footer-main { display: flex; align-items: center; gap: 28px; }
.footer-main > p { margin: 0 auto 0 0; }
.footer-main nav { display: flex; gap: 16px; }
.footer-main nav button { background: transparent; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; } /* a11y-on: var(--cream) */
.footer-main nav button:hover { color: var(--blue-dark); } /* a11y-on: var(--cream) */
.footer-bottom { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; } /* a11y-on: var(--cream) */
.auth-heading .science-mark { width: 40px; height: 40px; }

@media (max-width: 1050px) {
  .platform-nav .section-link { display: none; }
  .platform-hero { grid-template-columns: 1fr 1fr; gap: 20px; }
  .quiz-library-grid { grid-template-columns: repeat(2,1fr); }
  .activity-grid { grid-template-columns: repeat(2,1fr); }
  .featured-cards { grid-template-columns: 1.2fr 1fr; }
  .featured-card:last-child { display: none; }
}
@media (max-width: 960px) {
  .module-nav { top: 64px; padding-inline: 12px; }
  .module-identity { display: none; }
  .module-links { overflow-x: auto; }
  .module-links button { flex: 0 0 auto; }
  .platform-hero { grid-template-columns: 1fr; padding-top: 58px; text-align: center; }
  .platform-hero-copy { display: flex; flex-direction: column; align-items: center; }
  .platform-hero-visual { width: min(580px,100%); margin-inline: auto; }
  .hero-proof { justify-content: center; }
  .trust-strip .page-shell { display: block; padding-block: 24px; }
  .trust-strip p { max-width: none; margin-bottom: 17px; text-align: center; }
}
@media (max-width: 760px) {
  .benefit-grid, .steps-grid { grid-template-columns: 1fr; }
  .benefit-card { min-height: 285px; }
  .benefit-icon { margin-bottom: 25px; }
  .featured-cards { grid-template-columns: 1fr; }
  .featured-card:last-child { display: flex; }
  .quiz-library-grid { grid-template-columns: 1fr; }
  .library-toolbar { align-items: flex-start; flex-direction: column; }
  .library-toolbar > p { margin-left: 0; }
  .activity-grid { grid-template-columns: 1fr 1fr; }
  .platform-cta .page-shell { flex-direction: column; align-items: flex-start; padding-block: 30px; }
  .platform-cta .button { margin-left: 0; }
  .footer-main { flex-wrap: wrap; }
  .footer-main > p { width: 100%; order: 3; }
}
@media (max-width: 650px) {
  .science-brand > span:last-child { display: none; }
  .science-mark { width: 36px; height: 36px; border-radius: 11px; }
  .module-nav { top: 64px; gap: 5px; }
  .module-back { width: 38px; overflow: hidden; white-space: nowrap; }
  .module-back span { margin-right: 20px; }
  .module-links { gap: 2px; }
  .module-links button { padding-inline: 9px; font-size: 10px; }
  .platform-hero { min-height: auto; padding-block: 52px 35px; }
  .platform-hero-visual { min-height: 390px; margin-top: -10px; }
  .hero-blob { width: 340px; height: 330px; }
  .preview-card { width: 90%; padding: 17px; }
  .preview-card > p { font-size: 19px; }
  .subject-chem { left: -3px; }
  .subject-space { right: -3px; }
  .trust-strip .page-shell > div { grid-template-columns: repeat(2,1fr); gap: 15px; }
  .why-section, .featured-section { padding-block: 65px; }
  .how-section { padding-block: 60px; }
  .activity-grid { grid-template-columns: 1fr; }
  .activity-grid button { min-height: 240px; }
  .activity-grid.overview-actions button { min-height: 0; }
  .library-hero { padding-block: 16px; }
  .library-hero h1 { font-size: 28px; }
  .subject-filters { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .subject-filters button { flex: 0 0 auto; }
  .footer-main nav { width: 100%; order: 4; flex-wrap: wrap; }
  .footer-bottom { flex-direction: column; gap: 4px; }
}

/* Unified mastery courses — shared by current and future chapter-based subjects */
.mini-physics { width: 37px; height: 37px; display: grid; place-items: center; background: #fff0dc; border: 1px solid #f1c88e; border-radius: 11px; font-size: 20px; }
.physics-path { display: flex; flex-direction: column; height: calc(100vh - 122px); min-height: 0; padding-block: 12px 16px; overflow: hidden; }
.physics-path-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; max-height: 120px; }
.physics-path-head h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); }
.physics-path-head .eyebrow { margin-bottom: 4px; }
.physics-path-meta { margin: 0; color: var(--muted); font-size: 14px; }
.physics-path-meta strong { color: var(--ink); font: 700 22px "Fredoka", sans-serif; }
.physics-path-head .button { margin-left: auto; }
.physics-tier-tabs { display: flex; flex: 0 0 auto; gap: 6px; margin-bottom: 12px; padding: 5px; overflow-x: auto; background: #f3f3f7; border-radius: 13px; }
.physics-tier-tabs [role="tab"] { min-height: 40px; padding: 0 14px; background: transparent; border: 0; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.physics-tier-tabs [role="tab"].active, .physics-tier-tabs [aria-selected="true"] { background: white; color: var(--ink); box-shadow: var(--soft-shadow); }
.physics-chapter-page, .physics-test-page { height: calc(100vh - 122px); min-height: 0; padding-block: 8px 12px; overflow: hidden; }
.physics-test-page { display: grid; align-content: start; justify-items: center; overflow: auto; }
.physics-test-page .mastery-quiz { width: min(760px, 100%); }
.chapter-lesson { display: grid; grid-template-rows: auto 1fr auto; height: 100%; max-height: 100%; }
.chapter-lesson .lesson-layout { min-height: 0; padding-bottom: 28px; overflow: auto; mask-image: linear-gradient(black calc(100% - 28px), transparent); }
.course-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.course-overview-head h2 { margin-bottom: 10px; font-size: clamp(35px,4vw,50px); }
.course-overview-head > div:first-child > p:last-child { max-width: 660px; margin: 0; color: var(--muted); font-size: 17px; }
.course-progress-ring { flex: 0 0 auto; width: 105px; height: 105px; display: grid; place-content: center; background: white; border: 8px solid #dfe3ff; outline: 1px solid #c9cfee; border-radius: 50%; text-align: center; box-shadow: var(--soft-shadow); }
.course-progress-ring strong { font: 700 23px "Fredoka",sans-serif; }
.course-progress-ring span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.course-meter { height: 10px; margin: 24px 0 54px; overflow: hidden; background: #e5e4df; border-radius: 99px; }
.course-meter i { display: block; height: 100%; background: linear-gradient(90deg,var(--green),var(--blue)); border-radius: inherit; transition: width .45s ease; }
.course-stage + .course-stage { margin-top: 65px; padding-top: 60px; border-top: 1px dashed #cbc9c2; }
.course-stage-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 23px; }
.course-stage-heading > span { flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; background: white; border: 1px solid var(--line); border-radius: 18px; font-size: 28px; box-shadow: var(--soft-shadow); transform: rotate(-3deg); }
.course-stage-heading small { color: var(--blue-dark); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.course-stage-heading h3 { margin: 3px 0 5px; font-size: 27px; }
.course-stage-heading p { margin: 0; color: var(--muted); }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 10px; min-height: 0; overflow: auto; }
.physics-path .chapter-grid { flex: 1; }
.physics-path #physics-course { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.chapter-card { position: relative; min-height: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 0 12px; padding: 12px 14px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--soft-shadow); transition: .2s ease; }
.chapter-card.is-open:hover, .chapter-card.is-passed:hover { transform: translateY(-3px); border-color: #bdc4ef; box-shadow: var(--shadow); }
.chapter-card.is-passed { border-color: #b9ddc9; background: linear-gradient(145deg,#fff 60%,#eff9f4); }
.chapter-card.is-locked { background: #f1f0ed; box-shadow: none; }
.chapter-number { grid-row: 1; width: 43px; height: 43px; display: grid; place-items: center; background: var(--coral-strong); border-radius: 13px; color: white; font: 700 16px "Fredoka",sans-serif; }
.is-passed .chapter-number { background: var(--green-strong); }
.is-locked .chapter-number { background: #d9d6d0; filter: grayscale(1); }
.chapter-card-copy { min-width: 0; }
.chapter-card-copy > small { color: var(--blue-dark); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.is-locked .chapter-card-copy { opacity: .6; }
.chapter-card h4 { margin: 4px 0 6px; font: 600 16px/1.15 "Fredoka",sans-serif; }
.chapter-card p { margin: 0 0 6px; color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chapter-score { display: block; color: var(--muted); font-size: 10px; } /* a11y-on: #f1f0ed -- the locked-card ground, the darkest of the three chapter-card states */
.chapter-card > .button { grid-column: 1 / -1; width: 100%; margin-top: 8px; }
.chapter-lesson, .mastery-quiz, .course-results { max-width: 1000px; margin-inline: auto; }
.chapter-lesson > header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px; padding: 16px; background: linear-gradient(135deg,#eef0ff,#fff7ea); border: 1px solid #dce0f4; border-radius: 20px; }
.chapter-lesson-icon { flex: 0 0 auto; width: 72px; height: 72px; display: grid; place-items: center; background: white; border-radius: 21px; font-size: 35px; box-shadow: var(--soft-shadow); }
.chapter-lesson header h2 { margin-bottom: 6px; font-size: clamp(24px, 3vw, 36px); }
.chapter-lesson header p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
.lesson-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.lesson-panel { padding: 23px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--soft-shadow); }
.lesson-panel h3 { margin-bottom: 16px; font-size: 19px; }
.lesson-panel ul { margin: 0; padding-left: 21px; }
.lesson-panel li { margin: 8px 0; color: #4f5a70; }
.lesson-panel li::marker { color: var(--green-text); } /* a11y-on: white */
.key-ideas div + div, .formulas div + div { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #dddde5; }
.key-ideas strong, .formulas code { color: var(--blue-dark); }
.key-ideas p, .formulas p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.formulas code { display: inline-block; padding: 5px 8px; background: #eef0ff; border-radius: 7px; font: 700 14px "Atkinson Hyperlegible",sans-serif; }
.worked-example { grid-column: 1 / -1; background: #fff9e9; border-color: #eedba8; }
.worked-example p { margin-bottom: 8px; }
.worked-example p:last-child { margin: 0; color: #5d6170; }
.lesson-test-callout { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 16px; margin-top: 10px; padding: 12px 16px; background: var(--ink); border-radius: 16px; color: white; }
.lesson-test-callout > div { display: grid; margin-right: auto; }
.lesson-test-callout strong { color: var(--yellow); font: 600 19px "Fredoka",sans-serif; }
.lesson-test-callout span { color: #bcc3d4; font-size: 11px; }
.mastery-quiz { max-width: 820px; }
.mastery-quiz-card { padding: 16px; background: white; border: 1px solid #dcdfea; border-radius: 20px; box-shadow: var(--shadow); }
.mastery-quiz-card .quiz-progress { margin-bottom: 12px; }
.mastery-quiz-card .quiz-progress i { background: linear-gradient(90deg,var(--coral),var(--yellow)); }
.question-skill { width: fit-content; margin: 0 auto 12px; padding: 5px 9px; background: #eef0ff; border-radius: 99px; color: var(--blue-dark); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mastery-quiz-card h2 { max-width: 700px; margin: 0 auto 10px; font-size: clamp(18px, 2.4vw, 26px); line-height: 1.25; text-align: center; }
.question-context { max-width: 680px; margin: 0 auto 20px; padding: 11px 14px; background: #f7f7f9; border-radius: 11px; color: var(--muted); font-size: 13px; text-align: center; }
.mastery-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mastery-answer { position: relative; min-height: 52px; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; background: #fafafa; border: 2px solid #e4e3e0; border-radius: 14px; color: var(--ink); cursor: pointer; text-align: left; transition: .16s ease; }
.mastery-answer:hover:not(:disabled) { background: #f5f6ff; border-color: var(--blue); transform: translateY(-2px); }
.mastery-answer > span { width: 30px; height: 30px; display: grid; place-items: center; background: white; border: 1px solid #d8d8df; border-radius: 9px; color: var(--blue-dark); font-weight: 700; text-transform: uppercase; }
.mastery-answer > b { font-size: 20px; }
.mastery-answer.correct { background: #e2f5eb; border-color: var(--green); color: #246f4a; }
.mastery-answer.wrong { background: #fee7e3; border-color: var(--coral); color: #9d4036; }
.mastery-answer:disabled { cursor: default; opacity: .72; }
.mastery-answer.correct:disabled, .mastery-answer.wrong:disabled { opacity: 1; }
.answer-explanation { margin-top: 18px; padding: 17px 19px; border: 1px solid #dddfe8; border-radius: 15px; background: #f7f7fa; }
.answer-explanation.good { background: #e9f8f0; border-color: #c5e8d5; }
.answer-explanation.bad { background: #fff0ed; border-color: #f0c7c0; }
.answer-explanation > strong { display: block; margin-bottom: 7px; font: 600 16px "Fredoka",sans-serif; }
.answer-explanation.good > strong { color: #26764e; }
.answer-explanation.bad > strong { color: #a43f35; }
.answer-explanation p { margin: 5px 0 0; color: #555f73; font-size: 13px; }
.mastery-next { width: 100%; margin-top: 13px; }
.course-results { max-width: 720px; padding: 50px 40px; background: white; border: 1px solid #dcdfea; border-radius: 28px; text-align: center; box-shadow: var(--shadow); }
.course-results.passed { background: linear-gradient(155deg,#fff 50%,#eaf8f0); border-color: #badfc9; }
.course-results.retry { background: linear-gradient(155deg,#fff 50%,#fff2e9); border-color: #efd5bd; }
.result-icon { display: block; margin-bottom: 12px; font-size: 62px; }
.course-results h2 { margin-bottom: 18px; font-size: clamp(35px,5vw,50px); }
.result-score { display: grid; width: 210px; margin: 0 auto 20px; padding: 17px; background: var(--ink); border-radius: 18px; color: white; }
.result-score strong { color: var(--yellow); font: 700 42px/1 "Fredoka",sans-serif; }
.result-score span { margin-top: 7px; color: #bcc3d4; font-size: 10px; }
.course-results > p:not(.section-kicker) { max-width: 540px; margin: 0 auto 25px; color: var(--muted); }
.result-actions { display: flex; justify-content: center; gap: 10px; }
@media (max-width: 960px) {
  .physics-path-head { align-items: flex-start; }
  .physics-path-head .button { margin-left: 0; }
}
@media (max-width: 760px) {
  .course-overview-head { align-items: flex-start; }
  .chapter-grid, .lesson-layout { grid-template-columns: 1fr; }
  .worked-example { grid-column: auto; }
  .chapter-card { min-height: 215px; }
}
@media (max-width: 650px) {
  .course-overview-head { display: block; }
  .course-progress-ring { width: 88px; height: 88px; margin-top: 20px; }
  .course-meter { margin-bottom: 38px; }
  .course-stage + .course-stage { margin-top: 45px; padding-top: 40px; }
  .course-stage-heading > span { width: 49px; height: 49px; font-size: 23px; }
  .course-stage-heading h3 { font-size: 23px; }
  .chapter-card { grid-template-columns: 39px 1fr; padding: 16px; }
  .chapter-number { width: 39px; height: 39px; }
  .chapter-lesson > header { display: block; padding: 20px; }
  .chapter-lesson-icon { width: 58px; height: 58px; margin-bottom: 17px; }
  .lesson-panel { padding: 18px; }
  .lesson-test-callout { align-items: stretch; flex-direction: column; }
  .lesson-test-callout .button { width: 100%; }
  .mastery-quiz-card { padding: 18px; }
  .mastery-answer-grid { grid-template-columns: 1fr; }
  .mastery-answer { min-height: 67px; }
  .course-results { padding: 35px 18px; }
  .result-actions { flex-direction: column; }
  .result-actions .button { width: 100%; }
}

/* Production gate for subjects that have not completed research and release review */
.physics-gate { min-height: calc(100vh - 138px); display: grid; align-content: center; padding-block: 64px 100px; }
.physics-gate > .breadcrumb { width: fit-content; margin-bottom: 18px; }
.physics-gate-card { max-width: 760px; padding: clamp(28px, 6vw, 58px); background: white; border: 1px solid #d8ddea; border-radius: 28px; box-shadow: var(--shadow); }
.physics-gate-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 22px; background: #fff0dc; border: 1px solid #d9a65e; border-radius: 18px; font-size: 30px; }
.physics-gate-card h1 { margin-bottom: 16px; font-size: clamp(34px, 6vw, 58px); }
.physics-gate-card > p:not(.section-kicker) { max-width: 650px; color: var(--muted); font-size: 17px; }
.physics-gate-status { display: grid; gap: 4px; margin: 28px 0; padding: 16px 18px; background: #fff8e9; border: 1px solid #d6b66c; border-left: 5px solid #9b6b00; border-radius: 14px; }
.physics-gate-status strong { color: #624600; }
.physics-gate-status span { color: #4d5669; font-size: 13px; }
@media (max-width: 650px) {
  .physics-gate { min-height: calc(100vh - 64px); padding-block: 34px 90px; }
  .physics-gate-card { padding: 24px 18px; border-radius: 20px; }
}
@media (forced-colors: active) {
  .physics-gate-card, .physics-gate-status, .physics-gate-icon { border: 2px solid CanvasText; }
}

/* Reusable single-viewport guided lesson */
.physics-pilot-page {
  min-width: 0;
  min-height: 100svh;
  height: auto;
  display: grid;
  place-items: center;
  overflow: visible;
  padding: 16px;
  background: #f3f6fc;
}
.physics-pilot-page #physics-pilot {
  width: min(100%, 980px);
  min-height: calc(100svh - 32px);
  height: auto;
  margin: 0;
}
.guided-lesson {
  width: 100%;
  min-height: calc(100svh - 32px);
  height: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: visible;
  background: #fff;
  border: 1px solid #d7dfef;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(31, 49, 89, .12);
}
.guided-lesson-header {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 32%);
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid #dfe5f0;
}
.guided-lesson-header p { margin: 0; }
.guided-lesson-kicker {
  color: #314ea6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.guided-lesson-position { color: #536079; font-size: 13px; }
.guided-lesson progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: #314ea6;
}
.guided-lesson progress::-webkit-progress-bar { background: #e2e7f2; border-radius: inherit; }
.guided-lesson progress::-webkit-progress-value { background: #314ea6; border-radius: inherit; }
.guided-lesson-content {
  min-height: 0;
  overflow: visible;
  overscroll-behavior: contain;
  padding: clamp(12px, 2vh, 20px) clamp(24px, 6vw, 64px);
}
.guided-lesson-copy { width: min(100%, 720px); margin: auto; }
.guided-lesson-copy h1 {
  margin-bottom: 20px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.025em;
}
.guided-lesson-copy h1:focus-visible { outline: 4px solid #f2b63d; outline-offset: 7px; }
.guided-lesson-copy > p { max-width: 68ch; color: #39465f; font-size: clamp(16px, 1.7vw, 19px); }
.guided-lesson-prompt,
.guided-lesson-review,
.guided-lesson-answer,
.guided-lesson-think {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 14px;
}
.guided-lesson-prompt { background: #eef2ff; border-left: 5px solid #314ea6; color: #17233f !important; font-weight: 700; }
.guided-lesson-review { background: #fef3cf; border: 1px solid #e6c35e; color: #4b3b04 !important; }
.guided-lesson-answer { background: #e5f5eb; border: 1px solid #86c79e; color: #174d2c !important; font-weight: 700; }
.guided-lesson-think { background: #f5f6f9; border: 1px dashed #8792aa; color: #3d4960; }
.guided-lesson-equation {
  width: fit-content;
  margin-top: 26px;
  padding: 16px 24px;
  background: #17233f;
  border-radius: 14px;
  color: #fff !important;
  font: 700 clamp(24px, 4vw, 38px) "Fredoka", sans-serif;
}
.guided-lesson-model { margin: 26px 0 0; }
.guided-lesson-model dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; }
.guided-lesson-model-part { min-width: 0; padding: 15px; background: #eef2ff; border: 1px solid #c8d1f4; border-radius: 14px; }
.guided-lesson-model-part dt { color: #52617c; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.guided-lesson-model-part dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #17233f; font-size: clamp(17px, 2vw, 22px); font-weight: 800; }
.guided-lesson-model figcaption { margin-top: 12px; color: #536079; font-size: 14px; }
.guided-lesson-worked-steps { display: grid; gap: 9px; padding-left: 28px; color: #2f3c55; }
.guided-lesson-worked-steps li { padding-left: 5px; }
.guided-lesson-controls {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(108px, auto) 1fr minmax(108px, auto);
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: #f8f9fc;
  border-top: 1px solid #dfe5f0;
}
.guided-lesson-button {
  min-height: 48px;
  padding: 8px 20px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}
.guided-lesson-button:focus-visible { outline: 4px solid #f2b63d; outline-offset: 2px; }
.guided-lesson-button:disabled { cursor: not-allowed; opacity: .55; }
.guided-lesson-button-secondary { background: #fff; border: 2px solid #64728d; color: #26344e; }
.guided-lesson-button-primary { background: #263f9f; border: 2px solid #263f9f; color: #fff; }
.guided-lesson-key-hint { color: #67738a; font-size: 12px; text-align: center; } /* a11y-on: #fff */

/* Keep each already-paginated desktop step in the baseline viewport without
   turning its ordinary lesson content into a second scroll container. */
@media (min-width: 521px) and (max-height: 800px) {
  .physics-pilot-page { align-items: stretch; padding: 0; }
  .physics-pilot-page #physics-pilot { min-height: 100svh; }
  .guided-lesson { min-height: 100svh; border-radius: 0; }
  .guided-lesson-header { padding-block: 6px; }
  .guided-lesson-content { padding-block: 4px; }
  .guided-lesson-copy h1 { margin-bottom: 8px; }
  .guided-lesson-prompt,
  .guided-lesson-review,
  .guided-lesson-answer,
  .guided-lesson-think { margin-top: 8px; }
}

@media (max-width: 520px) {
  .physics-pilot-page { height: auto; min-height: 100svh; overflow: visible; padding: 0; }
  .physics-pilot-page #physics-pilot { width: 100%; height: auto; min-height: 100svh; margin: 0; }
  .guided-lesson { height: auto; min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
  .guided-lesson-content { overflow: visible; }
  .guided-lesson-header { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; }
  .guided-lesson-content { padding: 22px 16px; }
  .guided-lesson-copy h1 { margin-bottom: 16px; font-size: clamp(28px, 10vw, 36px); }
  .guided-lesson-model dl { grid-template-columns: 1fr; }
  .guided-lesson-controls { min-height: 72px; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 12px; }
  .guided-lesson-key-hint { display: none; }
  .guided-lesson-button { min-width: 0; padding-inline: 12px; }
}

/* Human Body Mission — scoped Oxygen Journey learning module */
.mini-body { width: 37px; height: 37px; display: grid; place-items: center; background: #fee8e5; border: 1px solid #e6aaa3; border-radius: 11px; font-size: 20px; }
.human-body-page { height: calc(100vh - 122px); min-height: 0; overflow: hidden; background: linear-gradient(145deg,#fff9f3 0%,#f3fbf8 52%,#eef3ff 100%); }
#human-body-course { height: 100%; min-height: 0; }
.human-body-module { width: min(1180px,calc(100% - 32px)); height: 100%; min-height: 0; margin-inline: auto; color: var(--ink); }
.body-journey-progress { min-height: 48px; display: grid; grid-template-columns: repeat(5,1fr); align-items: center; gap: 7px; margin: 0; padding: 8px 0; list-style: none; }
.body-journey-progress li { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 9px; border-radius: 99px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; } /* a11y-on: #eef3ff -- the darkest stop of the .human-body-page gradient */
.body-journey-progress li span { width: 8px; height: 8px; flex: 0 0 auto; border: 2px solid #aab1c0; border-radius: 50%; }
.body-journey-progress li.complete { color: #297353; background: #e7f5ed; }
.body-journey-progress li.complete span { background: var(--green-strong); border-color: var(--green-strong); }
.body-journey-progress li[aria-current="step"] { color: white; background: var(--ink); }
.body-journey-progress li[aria-current="step"] span { background: var(--yellow); border-color: var(--yellow); }

.body-overview { display: flex; flex-direction: column; height: 100%; min-height: 0; padding-bottom: 8px; overflow: hidden; }
.body-overview-grid { min-height: 0; flex: 0 1 auto; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(16px, 3vw, 36px); }
.body-overview-copy h1 { max-width: 720px; margin-bottom: 10px; font-size: clamp(28px, 3.2vw, 40px); }
.body-overview-copy .hero-text { max-width: 650px; }
.body-overview-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.body-session-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.body-session-facts span { display: flex; align-items: center; gap: 7px; padding: 8px 11px; background: rgba(255,255,255,.8); border: 1px solid #dce4e0; border-radius: 99px; color: var(--muted); font-size: 11px; font-weight: 700; }
.body-session-facts strong { color: var(--blue-dark); font: 700 16px "Fredoka",sans-serif; }
.body-system-preview { min-height: 160px; display: grid; place-items: center; align-content: center; padding: 16px; background: rgba(255,255,255,.78); border: 1px solid #d7e1dd; border-radius: 36% 64% 50% 50% / 49% 45% 55% 51%; box-shadow: var(--shadow); }
.body-preview-route { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; }
.body-preview-route > span { min-height: 88px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 10px; background: white; border: 2px solid #d9e0de; border-radius: 18px; font-size: 28px; text-align: center; box-shadow: var(--soft-shadow); }
.body-preview-route > span small { color: var(--muted); font-size: 9px; font-weight: 700; }
.body-preview-route .lungs { border-color: #bbaae1; background: #f5f1ff; }
.body-preview-route .heart { border-color: #eab0aa; background: #fff1ef; color: var(--coral-display); } /* a11y-size: 39px -- the heart glyph inherits .body-preview-route > span */
.body-preview-route .cells { border-color: #e6c46d; background: #fff9e7; }
.body-preview-route > i { color: var(--blue-dark); font-style: normal; font-weight: 700; }
.body-system-preview > p { max-width: 380px; margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.body-evidence-panel { flex: 0 1 auto; min-height: 0; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; padding: 16px; background: white; border: 1px solid #dbe2df; border-radius: 22px; box-shadow: var(--soft-shadow); }
.body-evidence-panel h2 { margin-bottom: 7px; font-size: 26px; }
.body-evidence-panel p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.body-evidence-panel ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.body-evidence-panel li { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 12px; background: #f7f8fa; border-radius: 10px; font-size: 12px; }
.body-evidence-panel li strong { flex: 0 0 auto; color: var(--muted); }
.body-evidence-panel .evidence-practiced { color: #8b6516; }
.body-evidence-panel .evidence-provisional { color: var(--blue-dark); }
.body-evidence-panel .evidence-retained { color: #24704c; }

.body-workspace { display: grid; grid-template-rows: auto 1fr; align-items: stretch; height: 100%; min-height: 0; padding-bottom: 8px; overflow: hidden; }
.body-stage-card { min-height: 0; align-self: stretch; display: flex; flex-direction: column; padding: 16px 20px; overflow: hidden; background: rgba(255,255,255,.95); border: 1px solid #d8e1dd; border-radius: 25px; box-shadow: var(--shadow); }
.body-quiz-card, .body-summary { overflow: auto; }
.body-stage-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 8px; color: var(--blue-dark); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.body-stage-meter { height: 7px; margin-bottom: 12px; overflow: hidden; background: #e2e9e6; border-radius: 99px; }
.body-stage-meter i { display: block; height: 100%; background: linear-gradient(90deg,var(--green),var(--blue)); border-radius: inherit; }
.body-lesson-grid { display: grid; grid-template-columns: .9fr 1.1fr; align-items: start; gap: clamp(16px, 3vw, 36px); min-height: 0; flex: 1; overflow: auto; scrollbar-gutter: stable; }
.body-lesson-copy h1, .body-builder-heading h1 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 36px); }
.body-lesson-copy > p:not(.section-kicker), .body-builder-heading p:last-child { color: var(--muted); font-size: 16px; }
.body-lesson-copy details { margin-top: 18px; padding: 12px 14px; background: #f5f8f7; border: 1px solid #dbe5e1; border-radius: 12px; }
.body-lesson-copy summary { color: var(--blue-dark); font-weight: 700; cursor: pointer; }
.body-lesson-copy ol { margin-bottom: 0; padding-left: 19px; color: var(--muted); font-size: 13px; }
.body-lesson-copy li + li { margin-top: 6px; }
.body-model-card { padding: 21px; background: linear-gradient(145deg,#f3fbf8,#f0f2ff); border: 1px solid #d2dfdb; border-radius: 21px; }
.body-model-flow { display: grid; grid-template-columns: repeat(3,1fr); align-items: stretch; gap: 9px; margin: 0; padding: 0; list-style: none; }
.body-model-flow li { position: relative; min-height: 88px; display: grid; place-content: center; gap: 7px; padding: 10px 8px; background: white; border: 2px solid #d8dfdd; border-radius: 16px; text-align: center; }
.body-model-flow li:not(:last-child)::after { content: "→"; position: absolute; z-index: 2; right: -11px; top: 50%; color: #64746f; font-weight: 700; transform: translateY(-50%); }
.body-model-flow li.oxygen { border-color: #8bbbea; background: #eef7ff; }
.body-model-flow li.exchange { border-color: #b6a0d9; background: #f5f0ff; }
.body-model-flow li.pump { border-color: #e99c95; background: #fff0ee; }
.body-model-flow li.cells { border-color: #e5bf5f; background: #fff8e3; }
.body-model-flow li.route { border-color: #94c6b5; background: #eef9f5; }
.body-model-flow strong { color: #293c4f; }
.body-model-flow small { color: var(--muted); font-size: 10px; }
.body-model-card > p { margin: 14px 0 0; padding: 10px 12px; background: white; border-radius: 10px; color: #536070; font-size: 12px; }
.body-stage-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-shrink: 0; }
.body-stage-actions > div { display: flex; gap: 8px; margin-left: auto; }

.body-builder-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 10px; }
.body-builder-heading > span { width: 66px; height: 66px; flex: 0 0 auto; display: grid; place-items: center; background: #edf5ff; border: 2px solid #a9c9e7; border-radius: 20px; color: var(--blue-dark); font: 700 22px "Fredoka",sans-serif; }
.body-builder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; flex: 1; overflow: auto; }
.body-builder-board, .body-builder-controls { padding: 18px; background: #f7faf9; border: 1px solid #d6e2de; border-radius: 17px; }
.body-builder-board ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: body-route; }
.body-builder-board li { min-height: 43px; display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: white; border: 1px dashed #9eb8b0; border-radius: 10px; color: var(--muted); font-size: 12px; }
.body-builder-board li::before { counter-increment: body-route; content: counter(body-route); width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; background: #e4f2ed; border-radius: 50%; color: #277359; font-weight: 700; }
.body-builder-board li.filled { border-style: solid; border-color: #78b8a2; color: #27483d; font-weight: 700; }
.body-builder-controls h2 { margin-bottom: 12px; font-size: 20px; }
.body-builder-controls > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.body-builder-controls button { min-height: 47px; padding: 8px; background: white; border: 2px solid #c4d8d1; border-radius: 11px; color: var(--ink); font-weight: 700; cursor: pointer; }
.body-builder-controls button:hover { background: #eef8f4; border-color: var(--green); }
.body-builder-feedback { min-height: 54px; margin: 11px 0 0; padding: 10px 12px; background: #edf2f1; border-radius: 10px; color: #4f6260; font-size: 12px; }
.body-builder-feedback.good { background: #e5f6ec; color: #236744; }
.body-builder-feedback.correction { background: #fff1df; color: #744a1d; }

.body-quiz-card { width: min(850px,100%); justify-self: center; }
.body-objective-tag { width: fit-content; margin: 0 auto 12px; padding: 5px 9px; background: #e9f0ff; border-radius: 99px; color: var(--blue-dark); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.body-quiz-card > h1 { max-width: 720px; margin: 0 auto 12px; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.22; text-align: center; }
.body-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.body-answer-grid button { position: relative; min-height: 52px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; background: #fafafa; border: 2px solid #e1e4e2; border-radius: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.body-answer-grid button:hover:not(:disabled) { background: #f0f7ff; border-color: var(--blue); }
.body-answer-grid button > span { width: 29px; height: 29px; display: grid; place-items: center; background: white; border: 1px solid #d7dce0; border-radius: 8px; color: var(--blue-dark); font-weight: 700; }
.body-answer-grid button.correct { background: #e4f6ec; border-color: var(--green); }
.body-answer-grid button.wrong { background: #fff0ed; border-color: var(--coral); }
.body-answer-grid button:disabled { cursor: default; opacity: .72; }
.body-answer-grid button.correct:disabled, .body-answer-grid button.wrong:disabled { opacity: 1; }
.body-answer-grid em { font-style: normal; }
.body-answer-feedback { min-height: 0; margin: 10px 0 0; padding: 10px 12px; background: #f3f5f4; border: 1px solid #dfe5e2; border-radius: 12px; color: #52605d; font-size: 12px; }
.body-answer-feedback.good { background: #e8f7ee; border-color: #bfe4cf; }
.body-answer-feedback.correction { background: #fff1e8; border-color: #ebcabc; }
.body-answer-feedback p { margin: 5px 0 0; }

.body-summary { width: min(760px,100%); justify-self: center; text-align: center; }
.body-summary-icon { display: block; margin-bottom: 7px; font-size: 50px; }
.body-summary h1 { margin-bottom: 14px; font-size: clamp(32px,5vw,48px); }
.body-summary > p:not(.section-kicker,.body-review-timing) { max-width: 610px; margin: 0 auto 18px; color: var(--muted); }
.body-summary-score { display: grid; width: 185px; margin: 0 auto 16px; padding: 14px; background: var(--ink); border-radius: 16px; color: white; }
.body-summary-score strong { color: var(--yellow); font: 700 37px/1 "Fredoka",sans-serif; }
.body-summary-score span { margin-top: 5px; color: #bdc4d4; font-size: 10px; }
.body-summary-evidence { display: grid; gap: 7px; margin: 0 auto 14px; padding: 0; list-style: none; }
.body-summary-evidence li { display: flex; justify-content: space-between; gap: 15px; padding: 9px 11px; background: #f5f7f6; border-radius: 9px; font-size: 12px; text-align: left; }
.body-review-timing { width: fit-content; margin: 0 auto 16px; padding: 6px 10px; background: #eef0ff; border-radius: 99px; color: var(--blue-dark); font-size: 11px; font-weight: 700; }
.body-summary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

@media (max-width: 900px) {
  .body-overview-grid, .body-lesson-grid { grid-template-columns: 1fr; }
  .body-overview-grid { padding-block: 40px; text-align: center; }
  .body-overview-copy { display: flex; flex-direction: column; align-items: center; }
  .body-system-preview { min-height: 270px; }
  .body-evidence-panel { grid-template-columns: 1fr; gap: 18px; }
  .body-lesson-grid { gap: 22px; }
}
@media (max-width: 700px) {
  .human-body-module { width: min(100% - 20px,1180px); }
  .human-body-page { height: calc(100vh - 114px); }
  .body-journey-progress { gap: 3px; }
  .body-journey-progress li { padding-inline: 4px; font-size: 0; }
  .body-journey-progress li span { width: 10px; height: 10px; }
  .body-overview-copy h1 { font-size: 42px; }
  .body-system-preview { min-height: 225px; padding: 20px 12px; }
  .body-preview-route { gap: 4px; }
  .body-preview-route > span { min-height: 96px; padding: 7px; font-size: 28px; }
  .body-builder-grid { grid-template-columns: 1fr; }
  .body-builder-heading > span { width: 52px; height: 52px; }
  .body-model-flow { grid-template-columns: 1fr; }
  .body-model-flow li { min-height: 68px; }
  .body-model-flow li:not(:last-child)::after { content: "↓"; top: auto; right: auto; bottom: -13px; left: 50%; transform: translateX(-50%); }
  .body-answer-grid, .body-builder-controls > div { grid-template-columns: 1fr; }
  .body-stage-card { overflow: visible; }
  .body-stage-actions { align-items: stretch; flex-direction: column; }
  .body-stage-actions > div { width: 100%; margin-left: 0; }
  .body-stage-actions .button { flex: 1; }
  .body-summary-actions { flex-direction: column; }
  .body-summary-actions .button { width: 100%; }
}
@media (max-height: 720px) and (min-width: 701px) {
  .body-journey-progress { min-height: 38px; padding-block: 4px; }
  .body-stage-card { padding-block: 12px; }
  .body-stage-meter { margin-bottom: 10px; }
  .body-lesson-copy h1, .body-builder-heading h1 { font-size: 28px; }
  .body-model-flow li { min-height: 72px; }
  .body-stage-actions { margin-top: 10px; }
  .body-answer-grid button { min-height: 52px; }
}
@media (forced-colors: active) {
  .body-stage-card, .body-model-card, .body-builder-board, .body-builder-controls, .body-answer-grid button, .body-evidence-panel { border: 2px solid CanvasText; }
  .body-journey-progress li[aria-current="step"] { outline: 2px solid CanvasText; }
}

/* Guided checks and explanatory feedback */
.guided-check { margin-top: 20px; }
.guided-check-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.guided-check-fields label { display: grid; gap: 6px; color: #34415b; font-size: 13px; font-weight: 800; }
.guided-check-fields input {
  width: 100%;
  min-height: 50px;
  padding: 9px 12px;
  background: #fff;
  border: 2px solid #73809a;
  border-radius: 11px;
  color: #17233f;
}
.guided-check-fields input:focus { border-color: #263f9f; outline: 3px solid #c9d4ff; outline-offset: 1px; }
.guided-check-fields input[aria-invalid="true"] { border-color: #a43129; }
.guided-check-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.guided-check-actions button { min-height: 44px; padding: 8px 15px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.guided-check-actions button:focus-visible { outline: 4px solid #f2b63d; outline-offset: 2px; }
.guided-check-submit { background: #263f9f; border: 2px solid #263f9f; color: #fff; }
.guided-check-hint { background: #fff; border: 2px solid #6a7690; color: #26344e; }
.guided-check-hint:disabled { cursor: not-allowed; opacity: .55; }
.guided-check-actions > span { margin-left: auto; color: #647087; font-size: 12px; } /* a11y-on: #fff */
.guided-check-hints { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: guided-hint; }
.guided-check-hints li { padding: 11px 13px; background: #fff7d9; border: 1px solid #d8bb59; border-radius: 10px; color: #493b0d; counter-increment: guided-hint; }
.guided-check-hints li::before { content: "Hint " counter(guided-hint) ": "; font-weight: 800; }
.guided-check-hints li:focus-visible { outline: 4px solid #263f9f; outline-offset: 2px; }
.guided-check-feedback { min-height: 24px; margin: 14px 0 0; padding: 0; color: #44516a; font-weight: 700; }
.guided-check-feedback.is-correct,
.guided-check-feedback.is-incorrect { padding: 13px 15px; border-radius: 11px; }
.guided-check-feedback.is-correct { background: #e1f3e8; border: 1px solid #75b98c; color: #164d2a; }
.guided-check-feedback.is-incorrect { background: #fff0ed; border: 1px solid #d88c84; color: #792a24; }
.guided-check-feedback:focus-visible { outline: 4px solid #263f9f; outline-offset: 2px; }
@media (max-width: 520px) {
  .guided-check-fields { grid-template-columns: 1fr; }
  .guided-check-actions > span { width: 100%; margin-left: 0; }
}

/* Independent application and evidence */
.independent-application-label { margin: 0 0 13px; color: #4d596f; font-size: 13px; font-weight: 700; }
.independent-application .guided-check-submit { background: #174d2c; border-color: #174d2c; }
.independent-application input:disabled { background: #f0f2f6; color: #4d596f; opacity: 1; }
.independent-evidence-note { margin: 12px 0 0; padding: 11px 13px; background: #eef2ff; border: 1px solid #b8c5ee; border-radius: 10px; color: #273b77; font-size: 13px; }

/* Concept checks */
.guided-check-choice { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.guided-check-choice legend { margin-bottom: 8px; color: #34415b; font-size: 13px; font-weight: 800; }
.guided-check-choice-option { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; background: #fff; border: 2px solid #8792a8; border-radius: 11px; color: #24314a; cursor: pointer; }
.guided-check-choice-option:has(input:checked) { background: #eef2ff; border-color: #263f9f; }
.guided-check-choice-option:focus-within { outline: 4px solid #f2b63d; outline-offset: 2px; }
.guided-check-choice-option input { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; accent-color: #263f9f; }
.guided-check-choice[aria-invalid="true"] .guided-check-choice-option { border-color: #a43129; }
.guided-check-choice:disabled .guided-check-choice-option { cursor: default; opacity: .82; }

/* Guided lesson resilience and high-contrast affordances */
.physics-pilot-notice {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 50%;
  width: min(calc(100% - 24px), 640px);
  padding: 10px 14px;
  transform: translateX(-50%);
  background: #17233f;
  border: 2px solid #fff;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 18px rgba(23, 35, 63, .24);
}
.physics-pilot-notice:empty { display: none; }
.guided-lesson-fallback { grid-template-rows: minmax(0, 1fr); }
.guided-lesson-fallback .guided-lesson-content { display: grid; align-items: center; }
.guided-lesson-copy,
.guided-lesson-copy h1,
.guided-lesson-copy p,
.guided-lesson-worked-steps,
.guided-check-choice-option span { min-width: 0; overflow-wrap: anywhere; }

@media (forced-colors: active) {
  .guided-lesson,
  .guided-lesson-header,
  .guided-lesson-controls,
  .guided-lesson-model-part,
  .guided-lesson-prompt,
  .guided-lesson-review,
  .guided-lesson-answer,
  .guided-check-fields input,
  .guided-check-choice-option,
  .guided-check-feedback.is-correct,
  .guided-check-feedback.is-incorrect,
  .guided-check-hints li,
  .guided-lesson-button,
  .guided-check-actions button,
  .physics-pilot-notice { border: 2px solid CanvasText; }
  .guided-lesson-copy h1:focus-visible,
  .guided-lesson-button:focus-visible,
  .guided-check-actions button:focus-visible,
  .guided-check-choice-option:focus-within,
  .guided-check-feedback:focus-visible,
  .guided-check-hints li:focus-visible { outline: 3px solid Highlight; }
  .guided-check-fields input[aria-invalid="true"],
  .guided-check-choice[aria-invalid="true"] .guided-check-choice-option { border-color: Mark; }
  .guided-check-choice-option:has(input:checked) { outline: 3px solid Highlight; }
  .guided-lesson-button:disabled,
  .guided-check-actions button:disabled,
  .guided-check-choice:disabled .guided-check-choice-option { color: GrayText; opacity: 1; }
  .guided-lesson progress { border: 1px solid CanvasText; forced-color-adjust: auto; }
}

/* Oxygen Journey release-hardening overrides */
.human-body-module .button-primary { background: #334ea3; box-shadow: 0 6px 0 #233779; color: #fff; }
.human-body-module .button-primary:hover { background: #293f88; }
.body-preview-route > span small { color: #465169; }
.body-evidence-panel li strong { color: #4d566a; }
.body-model-flow small { color: #50596d; font-size: 11px; }
.body-builder-board li { color: #596271; }
.body-offline-note { width: min(1180px,calc(100% - 32px)); margin: 0 auto; padding: 9px 13px; background: #fff4d5; border: 1px solid #b98a20; border-top: 0; border-radius: 0 0 12px 12px; color: #60470d; font-size: 12px; font-weight: 700; text-align: center; }
.body-unavailable { display: grid; align-content: center; padding-block: 55px 90px; }
.body-unavailable > .breadcrumb { width: fit-content; }
.body-unavailable-card { max-width: 720px; padding: clamp(26px,5vw,52px); background: white; border: 1px solid #d7dfdc; border-radius: 26px; box-shadow: var(--shadow); }
.body-unavailable-card > span { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 19px; background: #fee8e5; border: 1px solid #d99d96; border-radius: 18px; font-size: 30px; }
.body-unavailable-card h1 { margin-bottom: 12px; font-size: clamp(34px,5vw,54px); }
.body-unavailable-card > p:not(.section-kicker) { max-width: 610px; color: var(--muted); }
.body-unavailable-card > div { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
@media (max-height: 800px) and (min-width: 701px) {
  .body-workspace .body-journey-progress { min-height: 36px; padding-block: 3px; }
  .body-workspace .body-stage-card { padding-block: 13px; }
  .body-workspace .body-stage-meter { margin-bottom: 12px; }
  .body-workspace .body-builder-heading { margin-bottom: 9px; }
  .body-workspace .body-builder-heading h1 { margin-bottom: 7px; font-size: 34px; }
  .body-workspace .body-builder-heading p:last-child { margin-bottom: 5px; font-size: 14px; }
  .body-workspace .body-builder-board, .body-workspace .body-builder-controls { padding: 13px; }
  .body-workspace .body-builder-board ol { gap: 5px; }
  .body-workspace .body-builder-board li { min-height: 36px; }
  .body-workspace .body-builder-feedback { min-height: 45px; margin-top: 8px; padding-block: 7px; }
  .body-workspace .body-stage-actions { margin-top: 10px; }
}
@media (max-width: 700px) {
  .body-offline-note { width: min(100% - 20px,1180px); }
  .body-unavailable-card > div { flex-direction: column; }
  .body-unavailable-card .button { width: 100%; }
}

/* Route recovery — the shell-owned region for an unknown, unavailable, or
   failed route. Additive: it reuses the existing page-view rhythm, card
   treatment, and button system so a recoverable state still looks like the
   rest of the app rather than an error screen. */
.route-recovery { display: grid; align-content: center; padding-block: 64px 100px; animation: none; }
.route-recovery > * { width: min(760px, calc(100% - 40px)); min-width: 0; margin-inline: auto; }
.route-recovery-heading, .route-recovery-body { overflow-wrap: anywhere; }
.route-recovery-heading { margin-bottom: 14px; font-size: clamp(34px, 5vw, 56px); }
.route-recovery-heading:focus { outline: none; }
.route-recovery-heading:focus-visible { outline: 3px solid var(--blue); outline-offset: 6px; border-radius: 12px; }
.route-recovery-status { display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin-bottom: 18px; padding: 7px 15px; background: #e8eaff; border: 1px solid #c3c9f4; border-radius: 999px; color: var(--blue-dark); font: 700 12px "Fredoka", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.route-recovery-status::before { content: ""; width: 9px; height: 9px; background: var(--blue); border-radius: 50%; }
.route-recovery-status[data-recovery-status="persistence-unavailable"],
.route-recovery-status[data-recovery-status="initialization-failed"] { background: #fff0dc; border-color: #d9a65e; color: #7a4d00; }
.route-recovery-status[data-recovery-status="persistence-unavailable"]::before,
.route-recovery-status[data-recovery-status="initialization-failed"]::before { background: var(--yellow); }
.route-recovery-body { max-width: 620px; margin-bottom: 30px; color: var(--muted); font-size: 18px; }
.route-recovery-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.route-recovery-action { min-height: 48px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 0 20px; background: white; border: 2px solid #dcd8d1; border-radius: 13px; box-shadow: 0 5px 0 #ddd7ce; font-weight: 700; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.route-recovery-action:first-child { background: var(--coral-strong); border-color: transparent; box-shadow: 0 7px 0 var(--coral-strong-shadow); color: white; }
.route-recovery-action:hover { transform: translateY(2px); box-shadow: 0 3px 0 #ddd7ce; }
.route-recovery-action:first-child:hover { box-shadow: 0 5px 0 var(--coral-strong-shadow); }

@media (max-width: 700px) {
  .route-recovery { padding-block: 34px 90px; }
  .route-recovery-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .route-recovery { animation: none !important; }
  .route-recovery-action { transition: none !important; }
}

@media (forced-colors: active) {
  .route-recovery-status, .route-recovery-action, .route-recovery-action:first-child { border: 2px solid CanvasText; }
}
