:root {
  --bg: #f7f1e7;
  --paper: #fffaf1;
  --panel: #ffffff;
  --panel-soft: #edf6f4;
  --text: #243042;
  --muted: #546574;
  --brand: #477f8a;
  --brand-strong: #2f5f69;
  --brand-soft: #dceeee;
  --yellow: #f3d98b;
  --yellow-soft: #fbefcd;
  --green: #8fb79b;
  --green-soft: #e4efe7;
  --peach: #e2b197;
  --peach-soft: #f7dfd8;
  --lavender: #a7a0c8;
  --lavender-soft: #eeeaf6;
  --line: #d4ddd8;
  --line-strong: #9eb9b3;
  --focus: #f3d98b;
  --shadow: 0 18px 40px rgba(36, 48, 66, 0.09);
  --shadow-soft: 0 8px 22px rgba(36, 48, 66, 0.06);
  --header-bg-rgb: 255, 250, 241;
  --header-border-rgb: 212, 221, 216;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 34px;
  --space-6: 48px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Verdana, sans-serif;
}

body.dark {
  --bg: #172034;
  --paper: #1d2a42;
  --panel: #22304a;
  --panel-soft: #2b3b54;
  --text: #f5f0e6;
  --muted: #c8cccf;
  --brand: #9bb9c0;
  --brand-strong: #d1e0e3;
  --brand-soft: #304858;
  --yellow: #d8c67a;
  --yellow-soft: #3e3925;
  --green: #9bbd9f;
  --green-soft: #2d493a;
  --peach: #c99f71;
  --peach-soft: #4a3329;
  --lavender: #aaa0c8;
  --lavender-soft: #38334a;
  --line: #4b5b6e;
  --line-strong: #6f8095;
  --focus: #d8c67a;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 16px rgba(0, 0, 0, 0.22);
  --header-bg-rgb: 29, 42, 66;
  --header-border-rgb: 75, 91, 110;
}

body.calm,
body.low-contrast {
  --bg: #f4efdf;
  --paper: #fbf8ef;
  --panel: #fbf8ef;
  --panel-soft: #ece7d9;
  --text: #4d4a42;
  --muted: #706d64;
  --brand: #7284a6;
  --brand-strong: #61708d;
  --brand-soft: #e1e5ed;
  --yellow: #d9c982;
  --yellow-soft: #eee6c8;
  --green: #a8cebe;
  --green-soft: #e0ebe6;
  --peach: #d2ad7f;
  --peach-soft: #eee0d1;
  --lavender: #aaa0ca;
  --lavender-soft: #e4e0ef;
  --line: #d7d0bf;
  --line-strong: #bdb4a1;
  --focus: #d9c982;
  --shadow: none;
  --shadow-soft: none;
  --header-bg-rgb: 251, 248, 239;
  --header-border-rgb: 215, 208, 191;
}

@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-Italic.otf") format("opentype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "OpenDyslexic";
  src: url("fonts/OpenDyslexic-BoldItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(143, 183, 155, 0.26), transparent 26rem),
    radial-gradient(circle at 88% 14%, rgba(71, 127, 138, 0.16), transparent 30rem),
    linear-gradient(180deg, var(--bg), #eef4f1 72%, var(--bg));
  font-family: var(--font);
  line-height: 1.55;
}

body.calm,
body.low-contrast {
  background: var(--bg);
}

html.open-dyslexic {
  font-size: 85%;
}

html.open-dyslexic body {
  letter-spacing: 0;
}

html.open-dyslexic h1,
html.open-dyslexic h2,
html.open-dyslexic h3,
html.open-dyslexic .eyebrow,
html.open-dyslexic .folder-tab,
html.open-dyslexic .mini-label,
html.open-dyslexic .choice-kicker,
html.open-dyslexic .brand-words,
html.open-dyslexic .product-image,
html.open-dyslexic .detail-image {
  letter-spacing: 0;
}

html.open-dyslexic nav a,
html.open-dyslexic button,
html.open-dyslexic select,
html.open-dyslexic .button,
html.open-dyslexic .back-home,
html.open-dyslexic .customize-panel summary,
html.open-dyslexic .toolkit-chip,
html.open-dyslexic .choice-item,
html.open-dyslexic .choice-title,
html.open-dyslexic .choice-text,
html.open-dyslexic .filter-button,
html.open-dyslexic .item-tag,
html.open-dyslexic .product-card {
  height: auto;
  overflow-wrap: anywhere;
  word-break: normal;
}

html.open-dyslexic .brand-text span {
  white-space: normal;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: var(--space-3);
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--panel);
}

.skip-link:focus {
  top: var(--space-3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(var(--header-border-rgb), var(--header-border-alpha, 1));
  background: rgba(var(--header-bg-rgb), var(--header-alpha, 0.96));
  backdrop-filter: blur(10px);
  font-family: var(--font);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.nav {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) 140px;
  align-items: center;
  gap: var(--space-3);
}

.brand {
  grid-column: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Verdana, sans-serif;
  font-size: 1.08rem;
  font-weight: 850;
}

.logo {
  width: 78px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-md);
  background: #050505;
  box-shadow: none;
}

.logo img,
.package-visual img,
.footer-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-words {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

nav,
.controls,
.theme-buttons,
.language-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

nav {
  grid-column: 2;
  position: relative;
  z-index: 1;
  justify-content: center;
  flex-flow: row wrap;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  overflow: visible;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

nav::-webkit-scrollbar {
  display: none;
}

nav a,
button,
select {
  font: inherit;
}

nav a {
  flex: 0 1 auto;
  max-width: 280px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

nav a:hover,
nav a:focus-visible,
nav a.active {
  border-color: var(--line);
  background: var(--brand-soft);
  color: var(--text);
  outline: none;
}

.customize-panel {
  grid-column: 3;
  position: relative;
  z-index: 2;
  justify-self: end;
  align-self: stretch;
  display: flex;
  align-items: center;
  width: 140px;
  min-width: 0;
  max-width: 100%;
}

.customize-panel summary {
  min-height: 42px;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customize-panel summary span {
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customize-panel summary::-webkit-details-marker {
  display: none;
}

.controls {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 340px;
  max-width: min(400px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.controls > label {
  width: 100%;
}

@media (min-width: 761px) {
  .site-header:has(.customize-panel[open]) {
    margin-bottom: var(--space-6);
  }
}

.controls-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.theme-buttons,
.language-buttons {
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.theme-buttons {
  width: fit-content;
  max-width: 100%;
}

.theme-buttons button,
.language-buttons button {
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 800;
}

.theme-buttons button:last-child,
.language-buttons button:last-child {
  border-right: 0;
}

.theme-buttons button.active,
.language-buttons button.active {
  background: var(--brand);
  color: #ffffff;
}

body.dark .theme-buttons button.active,
body.dark .language-buttons button.active {
  color: #172034;
}

select {
  min-height: 40px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  padding: 8px 10px;
  font-weight: 750;
}

button:focus-visible,
select:focus-visible,
.button:focus-visible,
.choice-item:focus-visible,
.back-home:focus-visible,
.customize-panel summary:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

main {
  width: min(1180px, 100%);
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-5) 24px 84px;
  overflow-x: clip;
}

.page {
  min-height: calc(100vh - 132px);
}

.hero {
  position: relative;
  min-width: 0;
  min-height: 500px;
  display: grid;
  align-items: center;
}

.home-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.7fr);
  gap: var(--space-6);
  padding: var(--space-4) 0 var(--space-5);
}

.home-about {
  margin-top: var(--space-5);
}

.about-panel.home-about {
  padding: var(--space-4);
}

.home-about .about-copy,
.home-about .about-copy p {
  width: 100%;
  max-width: none;
}

.home-about .about-copy {
  line-height: 1.58;
}

.home-about .about-copy p {
  line-height: inherit;
}

@media (max-width: 760px) {
  .about-panel.home-about {
    padding: var(--space-3);
  }
}

.home-intro {
  position: relative;
  min-width: 0;
  max-width: 100%;
  padding: var(--space-5) 0;
  overflow-wrap: anywhere;
}

.home-intro::before {
  content: "";
  position: absolute;
  left: -20px;
  top: var(--space-5);
  bottom: var(--space-5);
  width: 7px;
  border-radius: 999px;
  background: var(--green);
}

.eyebrow,
.folder-tab {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 var(--space-3);
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-xs) var(--radius-xs);
  background: var(--yellow-soft);
  color: var(--brand-strong);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
  overflow-wrap: break-word;
}

h1 {
  max-width: 15ch;
  font-size: clamp(2.45rem, 5.4vw, 4.7rem);
  letter-spacing: -0.01em;
}

h2 {
  margin-bottom: var(--space-3);
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

h3 {
  margin-bottom: var(--space-2);
  font-size: 1.16rem;
}

p {
  margin: 0;
}

/* Readability boost for longer explanatory text blocks. */
.hero-text,
.section-intro,
.about-copy,
.choice-text,
.hero-toolkit-card p:not(.mini-label),
.detail-description,
.detail-section p,
.product-card p,
.physical-item-text,
.physical-example-note,
.physical-detail-section p,
.game-fallback,
.student-testimonies p {
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.hero-text,
.section-intro {
  font-size: clamp(1.1rem, 1.55vw, 1.28rem);
}

.choice-text,
.hero-toolkit-card p:not(.mini-label),
.product-card p,
.detail-description,
.detail-section p,
.physical-detail-section p,
.physical-item-text,
.physical-example-note,
.game-fallback,
.student-testimonies p {
  font-size: clamp(1rem, 1.45vw, 1.12rem);
}

.about-copy {
  font-size: clamp(1.16rem, 1.65vw, 1.38rem);
  line-height: 1.82;
}

.article-module-panel ul {
  gap: 16px;
  font-size: clamp(1.08rem, 2vw, 1.2rem);
  line-height: 1.82;
}

.kit-expansion-callout {
  width: fit-content;
  margin-top: var(--space-2);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--brand-strong);
  box-shadow: var(--shadow-soft);
  font-size: 1.08rem;
  font-weight: 850;
}

.hero-text,
.section-intro {
  width: 100%;
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
  overflow-wrap: anywhere;
}

.hero-text {
  margin: var(--space-4) 0 var(--space-4);
  line-height: 1.58;
}

.hero-toolkit-card {
  position: relative;
  min-height: 330px;
  display: grid;
  align-content: end;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(220, 238, 238, 0.86), rgba(255, 250, 241, 0.94) 64%),
    var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-toolkit-card::before {
  content: "";
  position: absolute;
  inset: var(--space-3);
  border: 1px solid rgba(47, 95, 105, 0.16);
  border-radius: calc(var(--radius-lg) - 8px);
  pointer-events: none;
}

.hero-toolkit-card img {
  position: relative;
  z-index: 1;
  width: 118px;
  height: 118px;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.hero-toolkit-card img.hero-full-logo {
  width: min(340px, 100%);
  height: auto;
  aspect-ratio: 45 / 28;
  padding: 0;
  border: 0;
  object-fit: cover;
  background: #050505;
  box-shadow: none;
}

.hero-toolkit-card > div {
  position: relative;
  z-index: 1;
}

.hero-toolkit-card h2 {
  max-width: 12ch;
  margin-bottom: var(--space-2);
}

.hero-toolkit-card p:not(.mini-label) {
  color: var(--muted);
  font-weight: 650;
}

.mini-label {
  margin-bottom: var(--space-2);
  color: var(--brand-strong);
  font-size: 0.83rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.button,
.back-home {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
  font-weight: 850;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
}

body.dark .button,
body.dark .back-home {
  color: #172034;
}

.button.secondary,
.back-home {
  background: var(--paper);
  color: var(--brand-strong);
}

body.dark .button.secondary,
body.dark .back-home {
  color: var(--brand-strong);
}

.back-home {
  margin-bottom: var(--space-3);
}

.button:hover,
.back-home:hover,
.choice-item:hover {
  border-color: var(--brand-strong);
}

.choice-board {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: var(--space-5) 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.choice-board::after {
  display: none;
}

.choice-board > * {
  position: relative;
  z-index: 1;
}

.choice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.choice-item {
  width: 100%;
  max-width: 100%;
  min-height: 250px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.choice-item::before {
  content: "";
  position: absolute;
  left: var(--space-4);
  right: var(--space-4);
  top: 0;
  height: 7px;
  border-radius: 0 0 999px 999px;
  background: var(--choice-accent, var(--brand));
}

.choice-articles,
.choice-practice {
  --choice-accent: var(--brand);
  background:
    linear-gradient(180deg, rgba(220, 238, 238, 0.96), rgba(255, 250, 241, 0.96)),
    var(--brand-soft);
}

.choice-diy {
  --choice-accent: var(--lavender);
  background:
    linear-gradient(180deg, rgba(238, 234, 246, 0.96), rgba(255, 250, 241, 0.96)),
    var(--lavender-soft);
}

.choice-cards {
  --choice-accent: var(--green);
  background:
    linear-gradient(180deg, rgba(228, 239, 231, 0.96), rgba(255, 250, 241, 0.96)),
    var(--green-soft);
}

.choice-kit {
  --choice-accent: var(--yellow);
  background:
    linear-gradient(180deg, rgba(251, 239, 205, 0.98), rgba(255, 250, 241, 0.96)),
    var(--yellow-soft);
}

.choice-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.choice-kicker {
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.choice-title {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-size: clamp(1.22rem, 2vw, 1.55rem);
  line-height: 1.15;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.choice-text {
  display: block;
  max-width: 100%;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.choice-action {
  margin-top: auto;
  min-width: 64px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #ffffff;
  font-weight: 850;
  text-align: center;
  overflow-wrap: anywhere;
}

body.dark .choice-action {
  color: #172034;
}

.section-heading {
  max-width: 760px;
  margin-bottom: var(--space-4);
}

.about-panel,
.placeholder-panel,
.kit-package {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 241, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.about-panel {
  padding: var(--space-5);
  border-left: 7px solid var(--green);
}

.about-panel h1,
.placeholder-panel h1,
.kit-package h1 {
  max-width: none;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.about-copy {
  max-width: 76ch;
  color: var(--muted);
  font-size: clamp(1.12rem, 1.6vw, 1.34rem);
  line-height: 1.68;
}

.placeholder-panel {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-5);
  background:
    linear-gradient(180deg, rgba(220, 238, 238, 0.42), rgba(255, 250, 241, 0.92)),
    var(--paper);
}

.placeholder-box {
  min-height: 340px;
  margin-top: var(--space-4);
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  border: 1px dashed var(--brand);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 241, 0.72);
  text-align: center;
  overflow: hidden;
}

.placeholder-box::before {
  content: "";
  position: absolute;
  inset: var(--space-3);
  border: 1px solid rgba(47, 95, 105, 0.18);
  border-radius: calc(var(--radius-md) - 6px);
  pointer-events: none;
}

.placeholder-box strong {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text);
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.15;
}

.placeholder-box span {
  color: var(--muted);
  font-weight: 750;
}

.card-game-panel {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(220, 238, 238, 0.32), rgba(255, 250, 241, 0.86)),
    var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-game-page {
  width: min(1500px, 100%);
  max-width: 1500px;
}

.card-game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.card-game-header .section-intro {
  margin-bottom: 0;
}

.card-game-frame {
  width: 100%;
  min-width: 0;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  overflow: hidden;
}

.card-game-iframe {
  display: block;
  width: 100%;
  min-height: 760px;
  height: min(86vh, 940px);
  border: 0;
  border-radius: calc(var(--radius-md) - 8px);
  background: transparent;
}

.game-fallback {
  margin: calc(var(--space-2) * -1) 0 0;
  color: var(--muted);
  font-weight: 750;
}

.game-fallback a {
  color: var(--brand-strong);
}

.article-resource-page {
  display: grid;
  gap: var(--space-4);
}

.article-resource-hero,
.article-module {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(220, 238, 238, 0.42), rgba(255, 250, 241, 0.94)),
    var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.article-resource-hero {
  padding: var(--space-5);
}

.article-resource-hero h1 {
  max-width: none;
  font-size: clamp(2.15rem, 4.8vw, 3.7rem);
}

.article-resource-hero .section-intro {
  max-width: 920px;
  margin-bottom: 0;
}

.article-module-list {
  display: grid;
  gap: var(--space-3);
}

.article-module h2 {
  margin: 0;
}

.article-module-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4);
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.article-module-toggle span {
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.article-module-toggle strong {
  grid-column: 1;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.15;
}

.article-module-toggle::after {
  content: "+";
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-size: 1.5rem;
  font-weight: 850;
}

.article-module-toggle[aria-expanded="true"]::after {
  content: "-";
}

.article-module-panel {
  display: grid;
  gap: var(--space-4);
  padding: 0 var(--space-4) var(--space-4);
}

.article-module-panel[hidden] {
  display: none;
}

.article-module-panel ul {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 14px;
  color: var(--text);
  font-size: clamp(1.04rem, 2vw, 1.16rem);
  line-height: 1.7;
}

.article-module-panel li {
  padding-left: 4px;
  overflow-wrap: anywhere;
}

.video-resource,
.student-testimonies {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.resources-panel {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.resources-panel summary {
  cursor: pointer;
  color: var(--text);
  font-size: clamp(1.18rem, 2.2vw, 1.45rem);
  font-weight: 850;
}

.resources-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.resources-list a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-weight: 800;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.resources-list a:hover,
.resources-list a:focus-visible,
.resources-panel summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.video-resource h3,
.student-testimonies h3 {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.youtube-placeholder,
.video-resource iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.video-resource iframe {
  display: block;
  border-style: solid;
}

.youtube-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  color: #ffffff;
  text-decoration: none;
  font-weight: 900;
}

.youtube-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62);
}

.youtube-card span {
  position: relative;
  z-index: 1;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  text-align: center;
}

.youtube-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.video-fallback {
  margin: 0;
  font-weight: 850;
}

.video-fallback a {
  color: var(--brand-strong);
}

body.dark .video-fallback a {
  color: var(--yellow);
}

.youtube-placeholder {
  display: grid;
  place-items: center;
  padding: var(--space-4);
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.student-testimonies p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.article-module-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.builder-page {
  display: grid;
  gap: var(--space-4);
}

.builder-page,
.builder-page > *,
.builder-workspace,
.filter-panel,
.catalog-panel,
.product-grid,
.product-card,
.toolkit-box-panel,
.toolkit-box-visual {
  min-width: 0;
  max-width: 100%;
}

.builder-hero {
  width: 100%;
  max-width: none;
}

.builder-hero h1 {
  max-width: none;
  font-size: clamp(2.15rem, 4.8vw, 3.7rem);
}

.builder-hero .section-intro {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  line-height: 1.58;
}

.toolkit-box-panel,
.builder-workspace {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.toolkit-box-panel {
  padding: var(--space-4);
  background:
    linear-gradient(180deg, rgba(220, 238, 238, 0.62), rgba(255, 250, 241, 0.96)),
    var(--paper);
}

.toolkit-box-header,
.catalog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.compact-button {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.94rem;
}

.toolkit-box-visual {
  min-height: 150px;
  display: grid;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.78), rgba(237, 246, 244, 0.78)),
    var(--panel-soft);
}

.toolkit-empty {
  color: var(--muted);
  font-weight: 750;
}

.toolkit-chip-list {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.toolkit-chip {
  min-width: min(210px, 100%);
  max-width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text);
}

.item-thumb,
.product-image,
.detail-image {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, var(--brand-soft), rgba(255, 250, 241, 0.78)),
    var(--panel-soft);
  color: var(--brand-strong);
  font-weight: 900;
}

.item-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.toolkit-chip-name {
  min-width: 0;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.chip-remove,
.drawer-close {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

.chip-remove {
  width: 36px;
  padding: 0;
}

.builder-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.filter-panel,
.catalog-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  padding: var(--space-4);
  width: 100%;
}

.catalog-panel {
  border-left: 1px solid var(--line);
}

.filter-panel {
  position: sticky;
  top: 92px;
}

.filter-heading h2,
.catalog-heading h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.filter-group {
  display: grid;
  gap: var(--space-2);
}

.filter-button {
  min-height: 44px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
}

.filter-button::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
}

.filter-button.active,
.filter-button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--text);
}

.filter-button.active::before,
.filter-button[aria-pressed="true"]::before {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  box-shadow: inset 0 0 0 3px var(--brand-soft);
}

.subfilter-area {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.subfilter-area[hidden] {
  display: none;
}

.filter-panel [data-reset-filters] {
  margin-top: var(--space-3);
}

.catalog-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: var(--space-3);
}

.product-card {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  overflow: hidden;
}

.product-image {
  min-height: 132px;
  border-radius: var(--radius-md);
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  letter-spacing: 0.04em;
}

.product-card-header {
  display: grid;
  gap: var(--space-1);
}

.product-card h3 {
  margin-bottom: 0;
  font-size: clamp(1.08rem, 2vw, 1.28rem);
}

.product-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.item-tag {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.product-actions,
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.product-actions .button,
.drawer-actions .button {
  flex: 1 1 150px;
}

.button[disabled] {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(36, 48, 66, 0.34);
}

.drawer-backdrop[hidden] {
  display: none;
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 31;
  width: min(440px, 100vw);
  max-width: 100%;
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.detail-drawer[hidden] {
  display: none;
}

.drawer-close {
  justify-self: start;
  padding: 8px 12px;
}

.detail-image {
  min-height: 210px;
  border-radius: var(--radius-md);
  font-size: clamp(1.7rem, 5vw, 2.5rem);
}

.detail-description {
  color: var(--muted);
  font-size: 1.06rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.detail-section {
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.detail-section p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.kit-package {
  padding: var(--space-5);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(237, 246, 244, 0.88)),
    var(--paper);
  min-width: 0;
  overflow: hidden;
}

.kit-package-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 300px);
  gap: var(--space-5);
  align-items: center;
}

.package-visual {
  width: 100%;
  min-width: 0;
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  overflow: hidden;
}

.package-visual .package-box-image {
  width: min(270px, 92%);
  height: auto;
  max-height: 200px;
  object-fit: contain;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.notice-card {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--peach);
  border-radius: var(--radius-md);
  background: var(--peach-soft);
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 850;
}

.coming-soon-sign {
  margin: 0;
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--yellow);
  border-left-width: 10px;
  background: var(--yellow-soft);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 900;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.catalog-panel .coming-soon-sign {
  margin-bottom: var(--space-4);
}

.teacher-note {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.package-contents {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 241, 0.74);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.contents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.content-group {
  padding: var(--space-3);
  padding-left: calc(var(--space-3) + 10px);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(90deg, var(--group-color, var(--brand)) 0 8px, var(--paper) 8px);
  box-shadow: none;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.content-group:nth-child(2n) {
  border-right: 0;
}

.content-group:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.communication-group {
  --group-color: var(--brand);
}

.sensory-group {
  --group-color: var(--green);
}

.routine-group {
  --group-color: var(--lavender);
}

.calm-group {
  --group-color: var(--peach);
}

.content-group h3 {
  margin-bottom: var(--space-2);
}

.content-group ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.classroom-toolkit .section-heading {
  margin-bottom: var(--space-3);
}

.classroom-toolkit .section-heading h2 {
  max-width: none;
}

.physical-item-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
  gap: var(--space-3);
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.physical-item-list {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

.physical-item-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text);
  text-align: left;
  white-space: normal;
  box-shadow: none;
  cursor: pointer;
}

.physical-item-card.active {
  border-color: var(--brand-strong);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(77, 150, 255, 0.16);
}

.physical-item-thumb,
.physical-detail-image {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
}

.physical-item-thumb {
  width: 104px;
  min-width: 104px;
  height: 84px;
  min-height: 84px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.physical-item-thumb img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(36, 48, 66, 0.08));
}

.physical-item-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.physical-item-title {
  display: block;
  font-size: clamp(1.12rem, 2.2vw, 1.3rem);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.physical-item-text {
  display: block;
  color: var(--muted);
  font-size: clamp(0.88rem, 1.65vw, 0.98rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.physical-detail-panel {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text);
  min-width: 0;
  max-width: 100%;
}

.physical-detail-image {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font-size: clamp(2rem, 8vw, 4rem);
}

.physical-detail-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(320px, 55vh);
  object-fit: contain;
}

.physical-detail-image img:not(.keep-background) {
  filter: drop-shadow(0 8px 14px rgba(36, 48, 66, 0.08));
}

.physical-example-note {
  margin: calc(var(--space-2) * -1) 0 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.physical-detail-panel h3 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  overflow-wrap: anywhere;
}

.physical-detail-section {
  display: grid;
  gap: 6px;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.physical-detail-section[hidden] {
  display: none;
}

.physical-detail-section h4 {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.physical-detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: var(--space-4) 18px;
  text-align: center;
}

.footer-logo {
  width: 71px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #050505;
}

body.calm .choice-board::after,
body.calm .home-intro::before,
body.low-contrast .choice-board::after,
body.low-contrast .home-intro::before {
  display: none;
}

body.calm .placeholder-box,
body.low-contrast .placeholder-box,
body.calm .card-game-panel,
body.low-contrast .card-game-panel,
body.calm .article-resource-hero,
body.low-contrast .article-resource-hero,
body.calm .article-module,
body.low-contrast .article-module,
body.calm .resources-panel,
body.low-contrast .resources-panel,
body.calm .card-game-frame,
body.low-contrast .card-game-frame,
body.calm .package-contents,
body.calm .physical-detail-panel,
body.low-contrast .package-contents,
body.low-contrast .physical-detail-panel,
body.calm .toolkit-box-panel,
body.low-contrast .toolkit-box-panel,
body.calm .builder-workspace,
body.low-contrast .builder-workspace {
  background: var(--panel);
}

body.dark .logo,
body.dark .hero-toolkit-card img,
body.dark .footer-logo {
  border-color: transparent;
  background: #050505;
  box-shadow: none;
}

body.dark .package-visual img {
  border-color: #d8c67a;
  background: #fffaf1;
  box-shadow: 0 0 0 3px rgba(216, 198, 122, 0.24);
}

body.dark .hero-toolkit-card,
body.dark .about-panel,
body.dark .placeholder-panel,
body.dark .card-game-panel,
body.dark .article-resource-hero,
body.dark .article-module,
body.dark .resources-panel,
body.dark .kit-package,
body.dark .toolkit-box-panel,
body.dark .builder-workspace,
body.dark .physical-item-card,
body.dark .physical-detail-panel,
body.dark .product-card,
body.dark .toolkit-chip,
body.dark .detail-drawer {
  background: var(--paper);
}

body.dark .choice-practice,
body.dark .choice-articles,
body.dark .choice-diy,
body.dark .choice-cards,
body.dark .choice-kit {
  background: var(--panel);
}

body.dark .placeholder-box,
body.dark .card-game-frame,
body.dark .package-contents,
body.dark .toolkit-box-visual,
body.dark .physical-item-thumb,
body.dark .physical-detail-image,
body.dark .catalog-count,
body.dark .item-tag {
  background: var(--panel-soft);
}

body.dark .physical-item-card.active {
  background: rgba(77, 150, 255, 0.16);
}

body.dark .physical-detail-image {
  border: 0;
  background: transparent;
}

body.dark .physical-item-thumb {
  background: transparent;
}

body.dark .package-visual .package-box-image {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.dark .chip-remove,
body.dark .drawer-close {
  background: var(--panel);
  color: var(--text);
}

body.dark .contents-grid,
body.dark .content-group {
  background: var(--paper);
}

body.dark .content-group {
  background: linear-gradient(90deg, var(--group-color, var(--brand)) 0 8px, var(--paper) 8px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .nav {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) 134px;
    gap: var(--space-2);
  }

  .customize-panel {
    justify-self: end;
    width: 134px;
  }

  nav {
    justify-content: flex-start;
    align-items: stretch;
  }

  nav a {
    flex: 1 1 calc(50% - var(--space-2));
    max-width: none;
    padding-inline: 10px;
    font-size: 0.9rem;
    line-height: 1.18;
  }

  .home-workspace,
  .builder-workspace {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }

  .catalog-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .choice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-workspace {
    gap: var(--space-4);
  }

  .hero-toolkit-card {
    max-width: 520px;
  }

  .home-intro::before {
    left: 0;
    right: auto;
  }

  .home-intro {
    padding-left: var(--space-4);
  }

  .package-visual {
    max-width: 420px;
  }
}

@media (max-width: 760px) {
  main {
    padding: var(--space-4) var(--space-3) var(--space-6);
  }

  .site-header {
    position: sticky;
  }

  .nav {
    grid-template-columns: 50px minmax(0, 1fr) 72px;
    align-items: start;
    gap: 4px;
    padding: 8px;
  }

  .brand {
    width: 50px;
  }

  .brand-text {
    display: none;
  }

  .logo {
    width: 48px;
    height: 32px;
    border-radius: var(--radius-sm);
  }

  nav {
    width: 100%;
    justify-content: stretch;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 4px;
    overflow: visible;
  }

  nav a {
    flex: 1 1 calc(50% - 4px);
    max-width: none;
    min-height: 36px;
    padding: 6px 5px;
    font-size: 0.72rem;
    line-height: 1.16;
  }

  .customize-panel {
    width: 72px;
  }

  .customize-panel summary {
    min-height: 36px;
    padding: 6px 5px;
    font-size: 0.72rem;
  }

  .controls {
    position: fixed;
    top: 64px;
    right: 8px;
    align-items: stretch;
    width: min(336px, calc(100vw - 16px));
    min-width: 0;
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }

  nav a,
  .theme-buttons button,
  .language-buttons button,
  select {
    text-align: center;
  }

  .theme-buttons button,
  .language-buttons button {
    flex: 1 1 0;
  }

  select {
    width: 100%;
  }

  h1 {
    max-width: none;
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .hero {
    min-height: auto;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-toolkit-card {
    padding: var(--space-4);
    min-height: 0;
  }

  .hero-toolkit-card h2 {
    max-width: 100%;
  }

  .hero-toolkit-card p:not(.mini-label) {
    max-width: 100%;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    max-width: none;
  }

  .actions .button {
    width: 100%;
  }

  .section-heading h2 {
    max-width: 14ch;
    font-size: clamp(1.55rem, 7.2vw, 2rem);
  }

  .choice-board,
  .about-panel,
  .placeholder-panel,
  .card-game-panel,
  .kit-package,
  .toolkit-box-panel,
  .builder-workspace {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }

  .builder-workspace {
    padding: 0;
  }

  .choice-board {
    padding-inline: 0;
  }

  .choice-list {
    grid-template-columns: 1fr;
  }

  .choice-item {
    min-height: 0;
    border-radius: var(--radius-md);
  }

  .choice-action {
    width: 100%;
    justify-self: stretch;
  }

  .card-game-header {
    display: grid;
  }

  .card-game-header .button {
    width: 100%;
  }

  .card-game-panel {
    padding-inline: 10px;
  }

  .card-game-frame {
    padding: 0;
  }

  .card-game-iframe {
    min-height: 720px;
    height: 78vh;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .product-card {
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
  }

  .product-image {
    min-height: 92px;
    border-radius: var(--radius-sm);
    font-size: clamp(1rem, 5vw, 1.28rem);
  }

  .product-card h3 {
    font-size: clamp(0.96rem, 3.8vw, 1.08rem);
  }

  .product-card p {
    font-size: 0.9rem;
    line-height: 1.42;
  }

  .item-tag {
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  .product-actions {
    gap: 6px;
  }

  .product-actions .button {
    min-height: 40px;
    flex: 1 1 100%;
    padding: 8px 9px;
    font-size: 0.86rem;
  }

  .toolkit-box-header,
  .catalog-heading {
    display: grid;
  }

  .toolkit-box-header .button,
  .catalog-count {
    justify-self: start;
  }

  .toolkit-chip {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .item-thumb {
    width: 38px;
    height: 38px;
  }

  .detail-drawer {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    border-left: 0;
    border-radius: 0;
  }

  .package-contents {
    padding: var(--space-3);
  }

  .classroom-toolkit .section-heading h2 {
    max-width: none;
  }

  .physical-item-layout {
    grid-template-columns: 1fr;
  }

  .physical-item-card {
    padding: var(--space-2);
    border-radius: var(--radius-sm);
  }

  .physical-item-thumb {
    width: 72px;
    min-width: 72px;
    height: 62px;
    min-height: 62px;
    font-size: 0.82rem;
  }

  .physical-detail-panel {
    padding: var(--space-3);
  }

  .physical-detail-image {
    min-height: 132px;
  }

  .contents-grid {
    grid-template-columns: 1fr;
  }

  .content-group,
  .content-group:nth-child(2n),
  .content-group:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-group:last-child {
    border-bottom: 0;
  }

  html.open-dyslexic nav a {
    min-height: 36px;
    padding-block: 4px;
    line-height: 1.14;
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .nav {
    grid-template-columns: 50px minmax(0, 1fr) 76px;
  }

  .customize-panel {
    width: 76px;
  }

  nav a {
    flex-basis: 100%;
  }

  .toolkit-chip {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .chip-remove {
    width: 34px;
  }

  .product-actions .button,
  .drawer-actions .button {
    flex-basis: 100%;
  }
}

@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-image {
    min-height: 96px;
  }
}

/* Final readability overrides for longer text after component and mobile rules. */
.hero-text,
.section-intro,
.about-copy,
.choice-text,
.hero-toolkit-card p:not(.mini-label),
.detail-description,
.detail-section p,
.product-card p,
.physical-item-text,
.physical-example-note,
.physical-detail-section p,
.teacher-note,
.notice-card,
.game-fallback,
.student-testimonies p {
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.hero-text,
.section-intro,
.about-copy {
  font-size: clamp(1.12rem, 1.55vw, 1.32rem);
}

.choice-text,
.hero-toolkit-card p:not(.mini-label),
.detail-description,
.detail-section p,
.product-card p,
.physical-item-text,
.physical-example-note,
.physical-detail-section p,
.teacher-note,
.game-fallback,
.student-testimonies p {
  font-size: clamp(1rem, 1.35vw, 1.14rem);
}

.notice-card {
  font-size: clamp(1.08rem, 1.6vw, 1.26rem);
}

.article-module-panel ul {
  gap: 16px;
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  line-height: 1.82;
}


/* Placeholder styling for physical toolkit items while final product photos are unavailable. */
.physical-item-thumb,
.physical-detail-image {
  border: 1px dashed var(--line-strong);
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.physical-detail-image {
  min-height: 220px;
  padding: var(--space-4);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
}

body.dark .physical-item-thumb,
body.dark .physical-detail-image {
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

/* Digital toolkit catalog additions. */
.product-image,
.detail-image {
  padding: var(--space-3);
  overflow: hidden;
}

.product-image img,
.detail-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-image .image-placeholder-text,
.detail-image .image-placeholder-text {
  max-width: 100%;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.3vw, 0.92rem);
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}

.price-line {
  color: var(--text);
  font-weight: 750;
  line-height: 1.55;
}

.resource-link-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.resource-link-list a,
.link-placeholder {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-weight: 850;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.link-placeholder {
  color: var(--muted);
}

body.dark .resource-link-list a,
body.dark .link-placeholder {
  background: var(--panel-soft);
}

/* Product catalog overflow fixes for larger fonts and dark mode. */
.product-card,
.product-card-header,
.tag-row,
.item-tag,
.price-line {
  min-width: 0;
}

.tag-row {
  align-items: flex-start;
}

.item-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 11px;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
}

.price-line,
.product-card h3,
.product-card p {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}

@media (max-width: 720px) {
  .item-tag {
    min-height: 32px;
    padding: 6px 9px;
    font-size: clamp(0.68rem, 2.8vw, 0.78rem);
  }
}

@media (max-width: 430px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .tag-row {
    gap: 8px;
  }

  .item-tag {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

/* Keep toolkit cards readable by preventing cramped two-column layouts. */
.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

@media (max-width: 720px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Keep language selector segments evenly sized in the options panel. */
.language-buttons {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  flex-wrap: nowrap;
}

.language-buttons button {
  flex: 0 0 64px;
  width: 64px;
}

@media (max-width: 760px) {
  .language-buttons button {
    flex: 0 0 64px;
    width: 64px;
  }
}

.home-intro {
  z-index: 1;
}

/* Align the card game intro with the other page headers. */
.card-game-header {
  display: grid;
  grid-template-columns: minmax(0, 920px) auto;
  align-items: start;
  justify-content: start;
}

.card-game-header > div {
  min-width: 0;
  max-width: 920px;
  justify-self: start;
  text-align: left;
}

.card-game-header h1,
.card-game-header .section-intro {
  max-width: 920px;
  text-align: left;
}

.card-game-header .button {
  justify-self: end;
}

@media (max-width: 980px) {
  .card-game-header {
    grid-template-columns: 1fr;
  }

  .card-game-header .button {
    justify-self: start;
  }
}

/* Stretch the card game header across the panel instead of centering it. */
.card-game-header {
  width: 100%;
  justify-self: stretch;
  grid-template-columns: minmax(0, 920px) minmax(max-content, 1fr);
}

.card-game-header .button {
  justify-self: end;
}

/* OpenDyslexic layout fixes: keep controls readable without awkward wrapping. */
html.open-dyslexic .nav {
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) 180px;
}

html.open-dyslexic .customize-panel {
  width: 180px;
}

html.open-dyslexic .customize-panel summary,
html.open-dyslexic .customize-panel summary span {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

html.open-dyslexic .controls {
  min-width: 430px;
  max-width: min(520px, calc(100vw - 24px));
  grid-template-columns: 116px minmax(0, 1fr);
  gap: var(--space-2);
}

html.open-dyslexic .theme-buttons,
html.open-dyslexic .language-buttons {
  width: fit-content;
  max-width: 100%;
  flex-wrap: nowrap;
}

html.open-dyslexic .theme-buttons button {
  flex: 0 0 auto;
  min-width: 106px;
  white-space: nowrap;
}

html.open-dyslexic .language-buttons button {
  flex: 0 0 68px;
  width: 68px;
  white-space: nowrap;
}

html.open-dyslexic select {
  min-width: 0;
  width: 100%;
  white-space: nowrap;
}

@media (max-width: 980px) {
  html.open-dyslexic .nav {
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) 180px;
  }
}

@media (max-width: 760px) {
  html.open-dyslexic .nav {
    grid-template-columns: 34px minmax(0, 1fr) 114px;
  }

  html.open-dyslexic .customize-panel {
    width: 114px;
  }

  html.open-dyslexic .customize-panel summary {
    font-size: 0.68rem;
    padding-inline: 5px;
  }

  html.open-dyslexic .controls {
    width: min(420px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    grid-template-columns: 104px minmax(0, 1fr);
  }

  html.open-dyslexic .theme-buttons button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 6px;
  }

  html.open-dyslexic .language-buttons button {
    flex-basis: 60px;
    width: 60px;
  }
}

/* Give OpenDyslexic controls enough room for all theme buttons on one row. */
html.open-dyslexic .controls {
  min-width: 520px;
  max-width: min(560px, calc(100vw - 24px));
}

@media (max-width: 760px) {
  html.open-dyslexic .controls {
    min-width: 0;
    width: min(420px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
  }
}
