:root {
  color-scheme: light;
  --ink: #1b3148;
  --muted: #647386;
  --line: #dbe8f2;
  --panel: #ffffff;
  --page: #f8fbff;
  --green: #00a884;
  --green-dark: #007a68;
  --coral: #ff6b6b;
  --gold: #ffc857;
  --blue: #2f80ed;
  --purple: #8b5cf6;
  --shadow: 0 18px 48px rgba(23, 43, 72, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(140deg, rgba(255, 200, 87, 0.36), transparent 28%),
    linear-gradient(40deg, rgba(47, 128, 237, 0.14), transparent 32%),
    linear-gradient(320deg, rgba(255, 107, 107, 0.18), transparent 34%),
    var(--page);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

body[data-theme="calm"] {
  --ink: #1e3a3a;
  --muted: #526766;
  --line: #cfe0dc;
  --page: #eef7f3;
  --green: #2f8f83;
  --green-dark: #1f6f67;
  --coral: #c56f63;
  --gold: #d6b85f;
  --blue: #4c7f9f;
  --purple: #6c729d;
  --shadow: 0 14px 38px rgba(30, 58, 58, 0.1);
  background: var(--page);
}

body[data-theme="focus"] {
  --ink: #102a43;
  --muted: #486581;
  --line: #bcccdc;
  --page: #f3f7fb;
  --green: #2f855a;
  --green-dark: #276749;
  --coral: #b7791f;
  --gold: #d69e2e;
  --blue: #2b6cb0;
  --purple: #4a5568;
  --shadow: 0 10px 26px rgba(16, 42, 67, 0.1);
  background: var(--page);
}

body[data-theme="contrast"] {
  --ink: #07111f;
  --muted: #1f2937;
  --line: #111827;
  --page: #ffffff;
  --green: #006b3f;
  --green-dark: #004d2f;
  --coral: #b91c1c;
  --gold: #a16207;
  --blue: #0047ab;
  --purple: #4c1d95;
  --shadow: none;
  background: #ffffff;
}

.simple-student-header {
  margin-bottom: 18px;
  text-align: left;
}

.simple-student-header h2,
.simple-student-header p,
.simple-section-heading h2,
.simple-section-heading p {
  margin: 4px 0;
}

.simple-start-practice-button {
  grid-column: 1 / -1;
  min-height: 54px;
  width: 100%;
  font-size: 18px;
}

.simple-quick-tools {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.simple-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.simple-tool-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(23, 50, 77, .07);
}

.simple-tool-card h3,
.simple-tool-card p {
  margin: 0;
}

.simple-tool-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.simple-tool-card button,
.simple-table-actions button {
  width: 100%;
  min-height: 48px;
}

.simple-table-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 700px) {
  .simple-tool-grid { grid-template-columns: 1fr; }
  .simple-table-actions { grid-template-columns: 1fr; }
  .simple-student-header { padding-inline: 2px; }
}

body[data-theme="calm"] .workspace,
body[data-theme="focus"] .workspace,
body[data-theme="contrast"] .workspace {
  box-shadow: var(--shadow);
}

body[data-theme="focus"] .sun-card,
body[data-theme="focus"] .celebration-burst,
body[data-theme="calm"] .celebration-burst {
  display: none;
}

body[data-theme="focus"] *,
body[data-theme="calm"] * {
  animation-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

body[data-theme="contrast"] button,
body[data-theme="contrast"] input,
body[data-theme="contrast"] select,
body[data-theme="contrast"] textarea,
body[data-theme="contrast"] .choice,
body[data-theme="contrast"] .passage-block,
body[data-theme="contrast"] .question-block,
body[data-theme="contrast"] .question-header,
body[data-theme="contrast"] .feedback,
body[data-theme="contrast"] .action-row,
body[data-theme="contrast"] .celebration-panel {
  border-color: #111827;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1560px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0;
  display: grid;
  place-items: center;
}

.workspace {
  width: 100%;
  min-height: min(850px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #fffaf2;
  border: 1px solid rgba(217, 226, 236, 0.85);
  box-shadow: 0 18px 52px rgba(23, 32, 42, 0.12);
  overflow: hidden;
  border-radius: 8px;
}

.setup-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 28px 24px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.96), rgba(255, 255, 255, 0.98)),
    #fffefd;
  border-right: 1px solid var(--line);
}

.homeschool-sidebar-copy,
.homeschool-side-nav,
.homeschool-subjects {
  display: none;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.mode-switch {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f5f9ff;
  border: 1px solid #dbe8f2;
  border-radius: 12px;
}

.mode-switch p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mode-switch button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 0 10px;
  color: #25415f;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.mode-switch button span {
  display: grid;
  place-items: center;
  min-height: 28px;
  color: #1763c6;
  background: #eaf4ff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 950;
}

.mode-switch button strong {
  font-size: 14px;
}

.mode-switch button.active-view,
.mode-switch button.selected,
.mode-switch button:hover {
  background: #ffffff;
  border-color: #d7e8f7;
  box-shadow: 0 8px 18px rgba(23, 50, 77, 0.08);
}

body[data-active-view="student"] #student-practice-button,
body[data-active-view="parent"] #homeschool-parent-button {
  background: #ffffff;
  border-color: #9ec8f2;
  box-shadow: 0 8px 18px rgba(23, 50, 77, 0.1);
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent 42%),
    linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(47, 128, 237, 0.24);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.05;
}

h2 {
  font-size: 30px;
  line-height: 1.12;
}

.controls {
  display: grid;
  gap: 18px;
}

.controls label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.controls span,
legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.controls small,
.homeschool-form small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

select:focus,
input[type="number"]:focus,
input[type="text"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(28, 124, 84, 0.13);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: #ecf5ff;
  border-radius: 8px;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented label {
  min-height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segmented input:checked + label {
  background: white;
  color: var(--blue);
  box-shadow: 0 7px 18px rgba(23, 32, 42, 0.11);
}

.subject-cards {
  display: grid;
  gap: 10px;
}

.subject-cards input {
  position: absolute;
  opacity: 0;
}

.subject-cards label {
  display: grid;
  gap: 4px;
  padding: 14px;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.subject-cards strong {
  font-size: 20px;
}

.subject-cards span {
  color: var(--muted);
  font-size: 13px;
}

.subject-cards input:checked + label {
  border-color: var(--blue);
  background: #eef7ff;
  box-shadow: 0 10px 24px rgba(47, 128, 237, 0.13);
}

.topic-control {
  display: grid;
  gap: 10px;
}

.topic-buttons {
  display: grid;
  gap: 8px;
}

.topic-buttons button {
  min-height: 42px;
  padding: 0 12px;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 12px;
  font-weight: 850;
  cursor: pointer;
  text-align: left;
}

.topic-buttons button.selected {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-color: transparent;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

.primary-button:hover {
  filter: brightness(0.95);
}

.setup-actions {
  display: grid;
  gap: 10px;
}

.secondary-button {
  color: #17466f;
  background: #e7f2ff;
}

.secondary-button:hover {
  background: #d7ebff;
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.mini-stats span {
  padding: 7px 9px;
  color: #274037;
  background: #fff2cc;
  border: 1px solid #ffe29a;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.math-helper {
  width: min(760px, calc(100% - 28px));
  margin-top: 20px;
  padding: 20px;
  background: #ffffff;
  border: 2px solid #ffe29a;
  border-radius: 18px;
  text-align: left;
  box-shadow: 0 14px 34px rgba(23, 50, 77, 0.1);
}

.math-helper h3 {
  margin: 0;
  font-size: 24px;
}

.helper-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.helper-header p {
  margin: 4px 0 0;
}

.game-score {
  min-width: 96px;
  padding: 9px 12px;
  color: #ffffff;
  background: var(--green);
  border-radius: 999px;
  font-weight: 900;
  text-align: center;
}

.helper-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  background: #ecf5ff;
  border-radius: 8px;
}

.helper-tabs button {
  min-height: 40px;
  color: #17466f;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-weight: 900;
  cursor: pointer;
}

.helper-tabs button.selected {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 8px 18px rgba(47, 128, 237, 0.17);
}

.helper-panel {
  display: block;
}

.table-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.table-picker button,
.answer-buttons button {
  min-height: 42px;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.table-picker button.selected {
  color: #ffffff;
  background: linear-gradient(135deg, var(--coral), var(--purple));
  border-color: transparent;
}

.table-reader {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #fffdf8;
  border: 1px solid #ffe29a;
  border-radius: 14px;
}

.reader-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.reader-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.reader-header p {
  margin: 4px 0 0;
  color: #33506a;
  font-size: 15px;
  font-weight: 850;
}

.table-reader-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.table-reader-list button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: #17324d;
  background: #ffffff;
  border: 1px solid #cde2f5;
  border-radius: 10px;
  cursor: pointer;
}

.table-reader-list button.active {
  border-color: var(--blue);
  background: #e7f2ff;
}

.table-reader-list span {
  font-size: 14px;
  font-weight: 900;
}

.table-reader-list strong {
  color: var(--purple);
  font-size: 20px;
}

.memory-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f4fff7;
  border: 1px solid #b7efc5;
  border-radius: 12px;
}

.memory-status div {
  display: grid;
  gap: 4px;
}

.memory-status span,
.memory-status strong {
  font-weight: 900;
}

.memory-status span {
  color: var(--green-dark);
}

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.fact-challenge {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

#challenge-label {
  color: var(--purple);
  font-size: 34px;
  font-weight: 950;
  text-align: center;
}

.answer-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.answer-buttons button {
  min-height: 54px;
  font-size: 22px;
  background: #fff7dc;
  border-color: #ffe29a;
}

.game-feedback {
  min-height: 48px;
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  font-weight: 800;
}

.game-feedback.correct {
  color: #006b59;
  background: #e6fbf6;
}

.game-feedback.review {
  color: #8a4b00;
  background: #fff2cc;
}

.missed-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 850;
}

.missed-facts button {
  min-height: 34px;
  padding: 0 10px;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.factor-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.factor-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.math-helper p {
  margin: 14px 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

.division-strategy {
  margin: -4px 0 16px;
  padding: 10px 12px;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.repeat-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.repeat-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 850;
}

.repeat-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.repeat-card h4 {
  margin: 0;
  color: var(--purple);
  font-size: 36px;
  line-height: 1;
}

.repeat-card p {
  margin: 8px 0 0;
  color: #33506a;
  font-size: 16px;
}

.repeat-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.repeat-choices button {
  min-height: 50px;
  color: #17466f;
  background: #fff7dc;
  border: 2px solid #ffe29a;
  border-radius: 12px;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.repeat-choices button.correct {
  color: #006b59;
  background: #e6fbf6;
  border-color: #7bd8c7;
}

.repeat-choices button.incorrect {
  color: #9f2f2f;
  background: #fff1f1;
  border-color: #ffb4b4;
}

.repeat-choices .repeat-restart {
  grid-column: 1 / -1;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-color: transparent;
}

.repeat-history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-weight: 850;
}

.repeat-history span {
  padding: 7px 10px;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 999px;
  font-weight: 900;
}

.repeat-result {
  position: relative;
  width: 100%;
  min-height: 86px;
  display: grid;
  place-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 16px;
  color: #17324d;
  background: #fff8df;
  border: 1px solid #f7d98b;
  border-radius: 14px;
  text-align: center;
}

.repeat-result strong,
.repeat-result span {
  position: relative;
  z-index: 1;
}

.repeat-result span {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-weight: 800;
}

.repeat-result.strong {
  background: #e6fbf6;
  border-color: #7bd8c7;
}

.repeat-result.perfect {
  min-height: 116px;
  background: linear-gradient(135deg, #fff1a8, #bff4d8 52%, #b9e6ff);
  border-color: #ffd15c;
}

.repeat-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.repeat-fireworks span {
  position: absolute;
  top: calc(12% + (var(--i) % 4) * 20%);
  left: calc(7% + (var(--i) * 17) % 86%);
  width: 14px;
  height: 14px;
  background: hsl(calc(var(--i) * 31deg), 88%, 58%);
  clip-path: polygon(50% 0, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0 50%, 38% 36%);
  animation: repeat-firework-pop 1.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.09s);
}

@keyframes repeat-firework-pop {
  0%,
  100% {
    scale: 0.75;
    opacity: 0.55;
  }
  50% {
    scale: 1.35;
    opacity: 1;
  }
}

.array-model {
  margin-bottom: 16px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  gap: 4px;
}

.table-grid button {
  min-height: 34px;
  color: #17324d;
  background: #eef7ff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.table-grid button.highlight {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.quiz-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.88), rgba(248, 251, 255, 0.96)),
    #f8fbff;
}

.test-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  color: #344054;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
}

.toolbar-button {
  min-height: 38px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--coral);
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.toolbar-button:hover {
  filter: brightness(0.96);
}

.empty-state {
  min-height: 100%;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 18px;
  padding: 28px;
  overflow: auto;
  text-align: left;
}

.math-mode .empty-state {
  align-content: start;
  padding: 26px 18px;
}

.math-mode .empty-state > .sun-card,
.math-mode .empty-state > h2,
.math-mode .empty-state > p {
  display: none;
}

.math-mode .math-helper {
  margin-top: 0;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.sun-card {
  width: 210px;
  height: 150px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #fff1b8, #d8efff);
  border: 1px solid #cde2f5;
  border-radius: 18px;
}

.sun-card::before {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  right: 24px;
  top: 24px;
  background: var(--gold);
  border-radius: 50%;
}

.sun-card span {
  position: absolute;
  left: 20px;
  right: 20px;
  height: 16px;
  background: rgba(28, 124, 84, 0.16);
  border-radius: 8px;
}

.sun-card span:nth-child(1) {
  bottom: 32px;
}

.sun-card span:nth-child(2) {
  bottom: 56px;
  right: 58px;
  background: rgba(232, 111, 81, 0.18);
}

.sun-card span:nth-child(3) {
  bottom: 80px;
  right: 88px;
  background: rgba(63, 111, 159, 0.18);
}

.question-view,
.results-view {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px 30px 30px;
}

.question-header,
.results-header,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.question-header {
  padding: 18px 20px;
  background: #fffdf8;
  border: 1px solid #ffe29a;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 50, 77, 0.07);
}

.question-header h2 {
  margin: 2px 0 0;
  font-size: 28px;
}

#session-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: #17466f;
  font-size: 13px;
}

.progress-wrap {
  width: min(360px, 38vw);
}

#progress-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  background: #e9eef2;
  border-radius: 99px;
}

#progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--coral));
}

.test-area {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.passage-block,
.question-block {
  min-width: 0;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(23, 50, 77, 0.08);
}

.question-block {
  border: 2px solid #cde2f5;
}

.passage-block {
  position: sticky;
  top: 18px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 16px;
  padding: 0 10px;
  color: #254236;
  background: #fff2cc;
  border: 1px solid #ffe29a;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.question-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.question-tools .section-label {
  margin-bottom: 0;
}

.read-question-button {
  min-height: 38px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.read-question-button:hover {
  background: #256ec9;
}

.reading-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.reading-tools button {
  min-height: 38px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.reading-tools button + button {
  background: var(--coral);
}

.reading-tools span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reading-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.reading-tools select {
  min-height: 36px;
  width: auto;
  padding: 0 28px 0 10px;
  border-radius: 999px;
}

.reading-tools.reading-support-off > span {
  display: none;
}

.passage-block p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.72;
  max-width: 72ch;
}

.reading-word {
  display: inline-block;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.reading-word:hover,
.reading-word.active {
  background: #e7f2ff;
  box-shadow: 0 0 0 3px #e7f2ff;
}

.choice .reading-word {
  position: relative;
  z-index: 1;
}

.long-word {
  margin: 0 2px;
  padding: 0 4px 3px;
  background: #fff7dc;
  box-shadow: 0 0 0 2px #fff7dc;
}

.long-word small {
  display: block;
  margin-top: -3px;
  color: #8a4b00;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.punctuation {
  display: inline-grid;
  place-items: center;
  min-width: 0.75em;
  margin: 0 2px;
  border-radius: 999px;
  font-weight: 900;
}

.punctuation.comma {
  color: #7a4a00;
  background: #fff2a8;
  box-shadow: 0 0 0 3px #fff2a8;
}

.punctuation.stop {
  color: #064b7a;
  background: #d8efff;
  box-shadow: 0 0 0 3px #d8efff;
}

.math-mode .passage-block p {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 22px;
  line-height: 1.55;
}

.math-visual {
  display: grid;
  place-items: center;
  margin: 4px 0 22px;
}

.homework-visual {
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: 100%;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid #d8e8f7;
  border-radius: 8px;
}

.homework-visual strong {
  font-size: 16px;
}

.area-grid {
  display: grid;
  gap: 0;
  border: 2px solid #17324d;
  background: #17324d;
}

.area-grid span {
  width: 28px;
  height: 28px;
  background: #ffffff;
  border: 1px solid #17324d;
}

.fraction-bar {
  display: grid;
  width: min(420px, 72vw);
  min-height: 62px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid #17324d;
  border-radius: 6px;
}

.fraction-bar span {
  border-right: 1px solid #17324d;
}

.fraction-bar span:last-child {
  border-right: 0;
}

.fraction-bar .shaded {
  background: repeating-linear-gradient(135deg, #2f80ed, #2f80ed 7px, #7db5ff 7px, #7db5ff 14px);
}

.line-model-card {
  width: min(420px, 100%);
}

.shape-family-card {
  width: min(620px, 100%);
}

.shape-family {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.shape-example {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  text-align: center;
}

.shape-example b {
  color: #17324d;
  font-size: 14px;
}

.shape-example small {
  color: #33506a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.shape-drawing {
  width: 76px;
  height: 54px;
  display: block;
  background: #e7f2ff;
  border: 4px solid #2f80ed;
}

.shape-drawing.rectangle {
  border-color: #2f80ed;
}

.shape-drawing.parallelogram {
  transform: skewX(-18deg);
  border-color: #00a884;
}

.shape-drawing.trapezoid {
  border: 0;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  background: #ffc857;
  outline: 4px solid #8a4b00;
  outline-offset: -4px;
}

.shape-drawing.polygon {
  border: 0;
  clip-path: polygon(50% 0, 96% 34%, 78% 100%, 22% 100%, 4% 34%);
  background: #ffcfde;
  outline: 4px solid #ff6b6b;
  outline-offset: -4px;
}

.pythagorean-card {
  width: min(560px, 100%);
  justify-items: stretch;
}

.pythagorean-triangle {
  position: relative;
  width: min(360px, 100%);
  height: 210px;
  justify-self: center;
  margin: 2px 0 4px;
  border-left: 5px solid #2f80ed;
  border-bottom: 5px solid #00a884;
}

.pythagorean-triangle::before {
  content: "";
  position: absolute;
  left: -2px;
  bottom: -5px;
  width: 365px;
  max-width: calc(100% + 5px);
  height: 5px;
  background: #ff6b6b;
  transform-origin: left center;
  transform: rotate(-31deg);
}

.pythagorean-triangle span {
  position: absolute;
  padding: 4px 8px;
  color: #17324d;
  background: #ffffff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.pythagorean-triangle .leg-a {
  left: -18px;
  top: 78px;
}

.pythagorean-triangle .leg-b {
  left: 45%;
  bottom: -22px;
}

.pythagorean-triangle .hypotenuse {
  right: 48px;
  top: 58px;
}

.pythagorean-triangle i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  border-top: 3px solid #17324d;
  border-right: 3px solid #17324d;
}

.pythagorean-steps {
  margin: 0;
  padding-left: 22px;
}

.pythagorean-steps li {
  margin: 8px 0;
  color: #33506a;
  font-size: 15px;
  line-height: 1.35;
}

.kindergarten-picture-wrap {
  width: min(520px, 100%);
  display: grid;
  gap: 10px;
}

.kindergarten-picture {
  position: relative;
  width: 100%;
  min-height: 300px;
  overflow: hidden;
  background: linear-gradient(#dff4ff 0 62%, #a7dfb0 62% 100%);
  border: 2px solid #b7dce9;
  border-radius: 8px;
}

.kindergarten-caption {
  padding: 12px 14px;
  color: #17324d;
  background: #ffffff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-size: 24px;
  text-align: center;
}

.kinder-sky,
.kinder-ground,
.kinder-main-item,
.kinder-item,
.kinder-item span {
  position: absolute;
}

.kinder-sky {
  inset: 0;
}

.kinder-sun {
  position: absolute;
  top: 24px;
  left: 28px;
  width: 58px;
  height: 58px;
  background: #ffd45c;
  border: 4px solid #f4b942;
  border-radius: 50%;
}

.kinder-cloud {
  position: absolute;
  width: 82px;
  height: 30px;
  background: #ffffff;
  border-radius: 999px;
}

.kinder-cloud::before,
.kinder-cloud::after {
  content: "";
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
}

.kinder-cloud::before {
  left: 12px;
  top: -14px;
  width: 34px;
  height: 34px;
}

.kinder-cloud::after {
  right: 12px;
  top: -20px;
  width: 42px;
  height: 42px;
}

.cloud-one {
  top: 38px;
  right: 40px;
}

.cloud-two {
  top: 94px;
  left: 130px;
  transform: scale(0.7);
}

.kinder-ground {
  left: 0;
  right: 0;
  bottom: 68px;
  height: 70px;
  background: #79c983;
}

.kinder-main-item {
  z-index: 2;
  top: 82px;
  left: 50%;
  width: 190px;
  height: 150px;
  transform: translateX(-50%);
}

.kinder-item {
  inset: 0;
}

.kinder-item .stem {
  left: 91px;
  top: 52px;
  width: 12px;
  height: 88px;
  background: #31945b;
  border-radius: 999px;
}

.kinder-item .leaf {
  top: 96px;
  width: 46px;
  height: 25px;
  background: #4fb86f;
  border-radius: 50%;
}

.kinder-item .leaf.left {
  left: 48px;
  transform: rotate(22deg);
}

.kinder-item .leaf.right {
  right: 48px;
  transform: rotate(-22deg);
}

.kinder-item .flower {
  left: 53px;
  top: 0;
  width: 84px;
  height: 84px;
  background: #ff8f9a;
  border-radius: 50%;
  box-shadow: 0 0 0 18px #ffd45c;
}

.kinder-item .center {
  left: 78px;
  top: 25px;
  width: 34px;
  height: 34px;
  background: #8a5a2b;
  border-radius: 50%;
}

.kinder-item.book .cover {
  left: 26px;
  top: 36px;
  width: 138px;
  height: 88px;
  background: #2f80ed;
  border-radius: 8px;
}

.kinder-item.book .page {
  top: 44px;
  width: 62px;
  height: 74px;
  background: #fff8df;
}

.kinder-item.book .page.left {
  left: 34px;
  border-radius: 6px 0 0 6px;
}

.kinder-item.book .page.right {
  right: 34px;
  border-radius: 0 6px 6px 0;
}

.kinder-item.book .line {
  left: 48px;
  width: 94px;
  height: 5px;
  background: #9aa8b5;
  border-radius: 999px;
}

.kinder-item.book .line.one {
  top: 68px;
}

.kinder-item.book .line.two {
  top: 92px;
}

.kinder-item.kite .diamond {
  left: 57px;
  top: 0;
  width: 78px;
  height: 78px;
  background: #ff8f9a;
  border: 4px solid #c94f5f;
  transform: rotate(45deg);
}

.kinder-item.kite .string {
  left: 96px;
  top: 76px;
  width: 4px;
  height: 72px;
  background: #17324d;
  transform: rotate(14deg);
}

.kinder-item.kite .tail {
  left: 92px;
  width: 28px;
  height: 18px;
  background: #ffd45c;
  transform: rotate(18deg);
}

.kinder-item.kite .tail.one {
  top: 104px;
}

.kinder-item.kite .tail.two {
  top: 132px;
}

.kinder-item.star .star-shape {
  left: 40px;
  top: 4px;
  width: 112px;
  height: 112px;
  background: #ffd45c;
  clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 56%, 80% 92%, 50% 70%, 20% 92%, 31% 56%, 2% 35%, 38% 34%);
}

.kinder-item.star .spark,
.kinder-item.heart .shine {
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
}

.kinder-item.star .spark.one {
  top: 8px;
  right: 18px;
}

.kinder-item.star .spark.two {
  bottom: 28px;
  left: 24px;
}

.kinder-item.heart .heart-shape {
  left: 45px;
  top: 16px;
  width: 100px;
  height: 92px;
  background: #ff6f8a;
  transform: rotate(-45deg);
}

.kinder-item.heart .heart-shape::before,
.kinder-item.heart .heart-shape::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 92px;
  background: #ff6f8a;
  border-radius: 50%;
}

.kinder-item.heart .heart-shape::before {
  top: -46px;
  left: 0;
}

.kinder-item.heart .heart-shape::after {
  left: 46px;
  top: 0;
}

.kinder-item.heart .shine {
  top: 28px;
  left: 90px;
  z-index: 2;
}

.kinder-item.blocks .block {
  width: 58px;
  height: 58px;
  border: 4px solid rgba(23, 50, 77, 0.25);
  border-radius: 8px;
}

.kinder-item.blocks .block.one {
  left: 36px;
  top: 82px;
  background: #ffd45c;
}

.kinder-item.blocks .block.two {
  left: 96px;
  top: 82px;
  background: #7dd3a8;
}

.kinder-item.blocks .block.three {
  left: 66px;
  top: 22px;
  background: #9bc7ff;
}

.kindergarten-math-card {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 18px;
  background: #fff8df;
  border: 2px solid #f7d98b;
  border-radius: 8px;
}

.kindergarten-math-card strong {
  color: #17324d;
  font-size: 24px;
  text-align: center;
}

.kinder-math-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  max-width: 420px;
}

.kinder-math-items span {
  width: 58px;
  height: 58px;
  display: block;
  background: #2f80ed;
  border: 4px solid rgba(23, 50, 77, 0.2);
}

.kinder-math-items .circle {
  background: #ff8f9a;
  border-radius: 50%;
}

.kinder-math-items .square {
  background: #7dd3a8;
  border-radius: 8px;
}

.kinder-math-items .triangle {
  width: 0;
  height: 0;
  background: transparent;
  border: 0;
  border-left: 34px solid transparent;
  border-right: 34px solid transparent;
  border-bottom: 60px solid #ffd45c;
}

.kinder-math-items .star {
  background: #ffd45c;
  border: 0;
  clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 56%, 80% 92%, 50% 70%, 20% 92%, 31% 56%, 2% 35%, 38% 34%);
}

.line-model {
  width: min(340px, 70vw);
  height: 90px;
  display: grid;
  place-items: center;
}

.line-model span {
  position: relative;
  width: 82%;
  height: 6px;
  background: #17324d;
  border-radius: 999px;
}

.line-model span::before,
.line-model span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-top: 6px solid #17324d;
  border-right: 6px solid #17324d;
}

.line-model span::before {
  left: -2px;
  transform: translateY(-50%) rotate(-135deg);
}

.line-model span::after {
  right: -2px;
  transform: translateY(-50%) rotate(45deg);
}

.clock-face {
  width: 230px;
  height: 230px;
  position: relative;
  display: grid;
  place-items: center;
  background: #fffdf8;
  border: 10px solid #ffc857;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #ffffff, 0 14px 30px rgba(23, 50, 77, 0.12);
}

.clock-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  width: 100%;
}

.labeled-clock {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.labeled-clock strong {
  color: var(--blue);
  font-size: 18px;
}

.labeled-clock .clock-face {
  width: 180px;
  height: 180px;
  border-width: 8px;
}

.labeled-clock .clock-face span {
  transform: scale(0.85);
}

.labeled-clock .clock-face i {
  left: calc(50% - 3px);
  width: 6px;
}

.labeled-clock .hour-hand {
  height: 48px;
}

.labeled-clock .minute-hand {
  height: 68px;
}

.clock-face::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  background: var(--coral);
  border-radius: 50%;
  z-index: 3;
}

.clock-face span {
  position: absolute;
  inset: 50%;
  width: 34px;
  height: 34px;
  margin: -17px;
  display: grid;
  place-items: center;
  color: #17324d;
  font-weight: 900;
}

.clock-face i {
  position: absolute;
  bottom: 50%;
  left: calc(50% - 4px);
  width: 8px;
  border-radius: 999px;
  transform-origin: 50% 100%;
}

.hour-hand {
  height: 62px;
  background: #17324d;
}

.minute-hand {
  height: 86px;
  background: var(--blue);
}

.array-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff7dc;
  border: 1px solid #ffe29a;
  border-radius: 8px;
}

.array-strategy {
  max-width: 420px;
  margin: 0;
  color: #33506a;
  font-size: 15px;
  font-weight: 850;
  text-align: center;
}

.axis-guide {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: #17466f;
  font-size: 13px;
  font-weight: 900;
}

.axis-guide span {
  padding: 6px 9px;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 999px;
}

.dot-array {
  display: grid;
  gap: 5px;
  max-width: 100%;
  overflow-x: auto;
}

.array-row {
  display: grid;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border-radius: 999px;
}

.array-row em {
  width: 20px;
  color: #33506a;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.array-row b {
  width: 2px;
  height: 18px;
  justify-self: center;
  background: #8a4b00;
  border-radius: 999px;
}

.array-row span {
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--coral), var(--purple));
  border-radius: 50%;
}

.array-row span.extra-dot {
  background: transparent;
  border: 2px dashed #8a4b00;
  opacity: 0.55;
}

.array-row.first-group {
  background: #e7f2ff;
}

.array-row.second-group {
  background: #fff2cc;
}

.array-row.ghost-row {
  background: #fffaf0;
}

.array-chunks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.array-chunks span {
  padding: 7px 9px;
  color: #17466f;
  background: #ffffff;
  border: 1px solid #cde2f5;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.question-block h3 {
  margin: 0 0 20px;
  font-size: 29px;
  line-height: 1.28;
  letter-spacing: 0;
}

.choices {
  display: grid;
  gap: 16px;
}

.choice {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 86px;
  padding: 16px 18px;
  color: var(--ink);
  background: white;
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 21px;
  line-height: 1.38;
  box-shadow: 0 8px 18px rgba(23, 50, 77, 0.05);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.choice:hover {
  border-color: var(--blue);
  background: #f8fbff;
  box-shadow: 0 12px 28px rgba(47, 128, 237, 0.14);
  transform: translateY(-1px);
}

.choice.selected {
  border-color: var(--blue);
  background: #eef7ff;
  box-shadow: 0 10px 28px rgba(47, 128, 237, 0.14);
}

.choice-letter {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #273746;
  border: 2px solid #9aa8b5;
  border-radius: 8px;
  font-weight: 900;
}

.choice.selected .choice-letter {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.choice.correct {
  border-color: var(--green);
  background: #eefcf8;
  box-shadow: 0 10px 26px rgba(0, 168, 132, 0.15);
}

.choice.incorrect {
  border-color: var(--coral);
  background: #fff1f1;
  box-shadow: 0 10px 26px rgba(255, 107, 107, 0.12);
}

.hint-panel {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 4px;
}

.hint-panel p {
  margin: 0;
  padding: 14px 16px;
  color: #17466f;
  background: #fff8df;
  border: 1px solid #f7d98b;
  border-radius: 8px;
  font-size: 17px;
  line-height: 1.45;
}

.true-false-table {
  display: grid;
  overflow: hidden;
  border: 2px solid #cde2f5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(23, 50, 77, 0.05);
}

.tf-header,
.tf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 100px;
  align-items: stretch;
}

.tf-header {
  color: #17466f;
  background: #eef7ff;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.tf-header span,
.tf-row > span {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.tf-row {
  border-top: 1px solid var(--line);
}

.tf-row button {
  min-height: 66px;
  color: var(--ink);
  background: #ffffff;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  font-weight: 900;
  font-size: 17px;
}

.tf-row button:last-child {
  border-right: 0;
}

.tf-row button.selected {
  color: #ffffff;
  background: var(--blue);
}

.tf-row button.correct {
  color: var(--green-dark);
  background: #eefcf8;
}

.tf-row button.incorrect {
  color: #9f2f2f;
  background: #fff1f1;
}

.feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid #bfeee4;
  background: #eefcf8;
  font-size: 18px;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(23, 50, 77, 0.08);
}

.feedback.review {
  border-color: #ffd0c9;
  background: #fff8f6;
}

.feedback-status-mark {
  min-width: 74px;
  min-height: 54px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--green);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.feedback.review .feedback-status-mark {
  background: var(--coral);
}

.feedback-copy {
  display: grid;
  gap: 5px;
}

.feedback strong {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
}

.feedback p {
  margin: 0;
  color: #344054;
  font-weight: 750;
}

.feedback-next-button {
  min-width: 170px;
  min-height: 54px;
}

.action-row {
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 50, 77, 0.06);
}

.result-list {
  display: grid;
  gap: 12px;
}

.stats-panel {
  display: grid;
  gap: 16px;
}

.celebration-panel {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  color: #17324d;
  border: 1px solid #ffd15c;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 241, 168, 0.85), rgba(191, 244, 216, 0.78) 52%, rgba(185, 230, 255, 0.72)),
    #fffdf8;
  box-shadow: 0 14px 32px rgba(255, 200, 87, 0.18);
}

.celebration-panel.super-celebration {
  color: #132b44;
  border-color: #ff9f1c;
  background:
    linear-gradient(135deg, rgba(255, 230, 109, 0.82), rgba(255, 159, 189, 0.48) 46%, rgba(117, 230, 218, 0.56)),
    #fffdf8;
  box-shadow: 0 16px 34px rgba(255, 159, 28, 0.2);
}

.celebration-panel.steady-celebration {
  border-color: #cde2f5;
  background: #f8fbff;
}

.celebration-badge {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 8px;
  font-size: 22px;
  font-weight: 950;
}

.celebration-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.celebration-kicker {
  margin: 0 0 6px;
  color: #007a68;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.celebration-panel h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.celebration-panel p {
  margin: 8px 0 0;
  color: #244157;
  font-size: 18px;
  font-weight: 750;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.results-summary-card,
.next-practice-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.results-summary-card h3,
.next-practice-card h3 {
  margin: 0;
}

.results-summary-card p,
.next-practice-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.stat-cards article {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat-cards strong {
  color: var(--purple);
  font-size: 30px;
}

.stat-cards span {
  color: var(--muted);
  font-weight: 800;
}

.student-resources {
  display: grid;
  gap: 14px;
  padding: 18px;
  color: #17324d;
  background: #f8fbff;
  border: 1px solid #c7d7eb;
  border-radius: 12px;
}

.student-resources h3,
.student-resources h4 {
  margin: 0;
}

.student-resources h3 {
  font-size: 22px;
}

.student-resources h4 {
  color: #17466f;
  font-size: 17px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resource-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.resource-grid ul {
  margin: 0;
  padding-left: 20px;
}

.resource-grid li {
  margin: 7px 0;
  color: #33506a;
  font-size: 15px;
  line-height: 1.4;
}

.reward-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #f4fff7;
  border: 2px solid #b7efc5;
  border-radius: 14px;
}

.reward-intro,
.reward-finish {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.reward-intro h3,
.reward-finish h3 {
  margin: 0;
  font-size: 26px;
}

.reward-intro p,
.reward-finish p,
.reward-game p {
  margin: 6px 0 0;
  color: #33506a;
  font-size: 17px;
  line-height: 1.4;
}

.reward-game {
  display: grid;
  gap: 14px;
}

.reward-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 850;
}

.reward-status strong {
  color: var(--green-dark);
}

.word-star {
  width: min(330px, 100%);
  min-height: 104px;
  justify-self: center;
  color: #17324d;
  font-size: 30px;
  font-weight: 900;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.75), transparent 18%),
    linear-gradient(135deg, #ffe66d, #ffbf69);
  border: 3px solid #ff9f1c;
  border-radius: 18px;
  box-shadow: 0 16px 26px rgba(255, 159, 28, 0.22);
  cursor: pointer;
}

.word-star:hover {
  transform: translateY(-1px);
}

.reward-answers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.reward-answers button {
  min-height: 58px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 850;
  background: #ffffff;
  border: 2px solid #cfe7f5;
  border-radius: 10px;
  cursor: pointer;
}

.reward-answers button:hover {
  border-color: var(--blue);
  background: #eff7ff;
}

.reward-feedback {
  padding: 12px 14px;
  font-weight: 850;
  border-radius: 10px;
}

.reward-feedback.correct {
  color: #075f4f;
  background: #dffbf2;
}

.reward-feedback.incorrect {
  color: #8a4b00;
  background: #fff0cf;
}

.treasure-fact {
  justify-self: center;
  min-width: 180px;
  padding: 16px 24px;
  color: #17324d;
  font-size: 34px;
  font-weight: 950;
  text-align: center;
  background: linear-gradient(135deg, #ffd166, #f4978e);
  border: 3px solid #ff9f1c;
  border-radius: 16px;
}

.mini-array {
  display: grid;
  gap: 4px;
  justify-content: center;
  max-width: 100%;
  overflow: auto;
  padding: 4px 0;
}

.mini-array span {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.mini-array i {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
}

.treasure-answers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archery-game {
  justify-items: stretch;
}

.archery-field {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  background:
    linear-gradient(#dff3ff 0 62%, #b7efc5 62% 100%);
  border: 2px solid #b8d7ea;
  border-radius: 14px;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.archery-field:active {
  cursor: grabbing;
}

.archery-field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24%;
  height: 3px;
  background: rgba(23, 70, 111, 0.16);
}

.archer {
  position: absolute;
  left: 9%;
  bottom: 18%;
  width: 84px;
  height: 144px;
}

.archer-head {
  position: absolute;
  top: 0;
  left: 26px;
  width: 34px;
  height: 34px;
  background: #ffd0a6;
  border: 3px solid #17324d;
  border-radius: 50%;
}

.archer-body {
  position: absolute;
  top: 36px;
  left: 34px;
  width: 18px;
  height: 70px;
  background: #2f80ed;
  border: 3px solid #17324d;
  border-radius: 12px;
}

.archer-body::before,
.archer-body::after {
  content: "";
  position: absolute;
  left: -18px;
  width: 54px;
  height: 5px;
  background: #17324d;
  border-radius: 999px;
}

.archer-body::before {
  top: 22px;
  left: 2px;
  width: 48px;
  rotate: -10deg;
}

.archer-body::after {
  bottom: -20px;
  rotate: 24deg;
}

.archer-bow {
  position: absolute;
  top: 38px;
  left: 62px;
  width: 34px;
  height: 92px;
  border: 5px solid #8a4b00;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.archer-bow::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 1px;
  width: 2px;
  background: rgba(23, 50, 77, 0.74);
}

.archer-arrow,
.flying-arrow,
.aim-line {
  position: absolute;
  width: 78px;
  height: 5px;
  background: #17324d;
  border-radius: 999px;
  transform-origin: left center;
}

.archer-arrow {
  top: 78px;
  left: 58px;
}

.archer-arrow::before,
.flying-arrow::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 20px;
  height: 18px;
  translate: 0 -50%;
  background:
    linear-gradient(45deg, transparent 45%, #ff6b6b 46% 60%, transparent 61%),
    linear-gradient(-45deg, transparent 45%, #ff6b6b 46% 60%, transparent 61%);
}

.archer-arrow::after,
.flying-arrow::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  translate: 0 -50%;
  border-left: 14px solid #17324d;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.aim-line {
  z-index: 2;
  height: 4px;
  background: repeating-linear-gradient(90deg, rgba(23, 50, 77, 0.62) 0 12px, transparent 12px 20px);
  pointer-events: none;
}

.flying-arrow {
  left: 15%;
  top: 70%;
  z-index: 3;
  width: 82px;
  translate: -100% -50%;
  transform-origin: right center;
  filter: drop-shadow(0 7px 8px rgba(23, 50, 77, 0.25));
  will-change: left, top, rotate;
}

.archery-target {
  position: absolute;
  top: 42%;
  right: 6%;
  width: min(146px, 30vw);
  aspect-ratio: 1;
  translate: 0 -50%;
  border-radius: 50%;
  box-shadow: 0 14px 26px rgba(23, 70, 111, 0.18);
}

.target-ring {
  position: absolute;
  inset: 50%;
  translate: -50% -50%;
  border-radius: 50%;
}

.ring-outer {
  width: 94%;
  height: 94%;
  background: #ffffff;
  border: 22px solid #2f80ed;
}

.ring-middle {
  width: 66%;
  height: 66%;
  background: #ffffff;
  border: 20px solid #ff6b6b;
}

.ring-inner {
  width: 38%;
  height: 38%;
  background: #ffffff;
  border: 18px solid #ffd166;
}

.ring-center {
  width: 14%;
  height: 14%;
  background: #06d6a0;
  border: 5px solid #075f4f;
}

.shot-mark {
  position: absolute;
  z-index: 1;
  width: 68px;
  height: 5px;
  translate: -100% -50%;
  border-radius: 999px;
  background: #17324d;
  border: 0;
  box-shadow: 0 8px 16px rgba(23, 50, 77, 0.24);
  pointer-events: none;
  transform-origin: right center;
  animation: arrow-stick 220ms ease-out;
}

.arrow-hit {
  z-index: 4;
}

.shot-mark::before,
.shot-mark::after {
  content: "";
  position: absolute;
}

.shot-mark::before {
  right: -10px;
  top: 50%;
  translate: 0 -50%;
  border-left: 14px solid #17324d;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.shot-mark::after {
  left: -12px;
  top: 50%;
  width: 20px;
  height: 18px;
  translate: 0 -50%;
  background:
    linear-gradient(45deg, transparent 45%, #ff6b6b 46% 60%, transparent 61%),
    linear-gradient(-45deg, transparent 45%, #ff6b6b 46% 60%, transparent 61%);
}

.shot-mark i {
  position: absolute;
  z-index: 1;
  right: 18px;
  top: -26px;
  min-width: 34px;
  padding: 3px 6px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 2px solid #17324d;
  border-radius: 999px;
  color: #ffffff;
  color: #17324d;
  font-style: normal;
  font-weight: 950;
  rotate: 0deg;
}

@keyframes arrow-stick {
  0% {
    scale: 1.18 1;
    filter: brightness(1.15);
  }
  60% {
    scale: 0.96 1;
  }
  100% {
    scale: 1;
    filter: brightness(1);
  }
}

.target-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #33506a;
  font-weight: 850;
}

.target-footer strong {
  color: #17324d;
}

.archery-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.archery-controls label {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.archery-controls span,
.archery-controls strong {
  color: #17324d;
  font-weight: 900;
}

.archery-controls input {
  width: 100%;
  accent-color: var(--blue);
}

.skill-breakdown {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.skill-breakdown div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(130px, 0.8fr);
  gap: 12px;
  align-items: center;
}

.skill-breakdown span,
.skill-breakdown strong {
  font-weight: 850;
}

.skill-breakdown meter {
  width: 100%;
}

.improvement-plan {
  padding: 18px;
  background: #fff7dc;
  border: 1px solid #ffe29a;
  border-radius: 14px;
}

.improvement-plan h3 {
  margin: 0 0 10px;
}

.improvement-plan p {
  margin: 8px 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
}

.result-item {
  padding: 18px;
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-item h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.result-item p {
  margin: 6px 0;
  color: #35424d;
  line-height: 1.45;
}

.hidden {
  display: none;
}

.admin-page {
  background: #f8fbff;
}

.admin-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.admin-header,
.admin-login,
.dashboard-cards,
.dashboard-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px;
}

.admin-link {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
}

.admin-login label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-login-copy {
  display: grid;
  gap: 5px;
}

.admin-login-copy strong {
  color: var(--ink);
}

.admin-login-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-email-login {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: 12px;
  align-items: end;
  grid-column: 1 / -1;
}

.feedback-form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.feedback-form label {
  display: grid;
  gap: 7px;
}

.feedback-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.feedback-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  outline: none;
}

.feedback-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(28, 124, 84, 0.13);
}

.feedback-form p {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-form .feedback-privacy-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Honeypot: off-screen for people, still present for bots that fill every field. */
.feedback-form .feedback-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.feedback-form .feedback-turnstile {
  max-width: 100%;
  overflow: hidden;
}

.practice-coming-soon {
  margin: 0;
  padding: 10px 12px;
  color: #415071;
  background: #fff7e0;
  border: 1px solid #f1d58a;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.home-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 8px;
}

.value-prop {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.value-prop h2 {
  font-size: 21px;
  line-height: 1.15;
}

.value-prop p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.value-points,
.empty-state-grid {
  display: grid;
  gap: 8px;
}

.value-points span,
.empty-state-grid article {
  padding: 10px 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
}

.empty-state-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.empty-state-grid article {
  display: grid;
  gap: 5px;
  text-align: left;
}

.empty-state-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.daily-practice-card,
.daily-plan-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: 8px;
}

.daily-practice-card h3,
.daily-plan-panel h4 {
  margin: 0;
  font-size: 22px;
}

.daily-practice-card p,
.daily-plan-panel p {
  margin: 0;
}

.daily-practice-card .eyebrow,
.daily-plan-panel .eyebrow {
  margin-bottom: 4px;
}

.daily-practice-reason {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.daily-practice-actions {
  display: grid;
  gap: 10px;
  min-width: 190px;
}

.sidebar-controls {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid rgba(215, 229, 242, 0.9);
  border-radius: 8px;
}

.sidebar-controls label {
  display: grid;
  gap: 7px;
}

.sidebar-controls span,
.sidebar-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button,
.side-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.side-nav button span {
  min-width: 38px;
  color: #1763c6;
  font-size: 10px;
  font-weight: 950;
}

.side-nav button strong {
  font-size: 14px;
}

.side-nav button:hover,
.side-nav button:focus-visible,
.side-nav button.selected,
.side-nav a:hover,
.side-nav a:focus-visible {
  background: #d7ebff;
}

.sidebar-note {
  display: grid;
  gap: 7px;
  padding: 14px;
  background: #fff6d7;
  border: 1px solid #ffe29a;
  border-radius: 8px;
  line-height: 1.35;
}

.sidebar-note strong {
  color: var(--ink);
}

body.homeschool-active {
  background:
    radial-gradient(circle at 84% 12%, rgba(82, 180, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%);
}

body.homeschool-active .workspace {
  grid-template-columns: 244px minmax(0, 1fr);
  background: #f6f9fd;
  border-color: #e6edf6;
  box-shadow: 0 20px 60px rgba(18, 38, 72, 0.09);
}

body.homeschool-active .setup-panel {
  gap: 16px;
  padding: 24px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-right: 1px solid #e3ebf5;
}

body.homeschool-active .test-toolbar,
body.homeschool-active .side-nav,
body.homeschool-active .sidebar-note,
body.homeschool-active .mini-stats {
  display: none;
}

body.homeschool-active .quiz-panel {
  background: #f7faff;
}

body.homeschool-active .brand-row {
  margin-bottom: 2px;
}

body.homeschool-active .brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 36%, rgba(255, 255, 255, 0.88) 0 15%, transparent 16%),
    linear-gradient(135deg, #0b66d8, #14b8a6);
  box-shadow: 0 10px 22px rgba(11, 102, 216, 0.22);
}

body.homeschool-active .brand-row .eyebrow {
  color: #0b66d8;
}

body.homeschool-active .brand-row h1 {
  color: #07183d;
  font-size: 25px;
  line-height: 1.06;
}

.homeschool-sidebar-copy {
  gap: 10px;
}

body.homeschool-active .homeschool-sidebar-copy {
  display: grid;
}

.homeschool-sidebar-copy h2 {
  color: #14244d;
  font-size: 15px;
  line-height: 1.25;
}

.homeschool-sidebar-copy p {
  margin: 0;
  color: #65728c;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

body.homeschool-active .homeschool-side-nav,
body.homeschool-active .homeschool-subjects {
  display: grid;
}

.homeschool-side-nav {
  gap: 6px;
  padding-top: 4px;
}

.homeschool-side-nav button,
.homeschool-subjects button {
  min-height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 0 9px;
  color: #15254d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.homeschool-side-nav span,
.homeschool-subjects span {
  min-height: 30px;
  display: grid;
  place-items: center;
  color: #1763c6;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 950;
}

.homeschool-side-nav strong,
.homeschool-subjects strong {
  font-size: 14px;
  line-height: 1.2;
}

.homeschool-side-nav button.selected,
.homeschool-side-nav button:hover,
.homeschool-subjects button.selected {
  background: #eaf3ff;
  border-color: #d9e9ff;
  box-shadow: inset 3px 0 0 #0b66d8;
}

body.homeschool-active .sidebar-controls {
  padding: 16px 0;
  background: transparent;
  border-width: 1px 0;
  border-radius: 0;
}

body.homeschool-active .sidebar-controls::before {
  content: "Preferences";
  color: #6c7892;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

body.homeschool-active .sidebar-controls label {
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
}

body.homeschool-active .sidebar-controls select {
  min-height: 38px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.homeschool-subjects {
  gap: 8px;
  padding-top: 2px;
  opacity: 0.86;
}

.homeschool-subjects p {
  margin: 0;
  color: #6c7892;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-hero,
.quick-practice-card,
.dashboard-card {
  border-radius: 8px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.35), rgba(255, 255, 255, 0.78) 45%),
    linear-gradient(315deg, rgba(0, 168, 132, 0.13), transparent 42%),
    #fffdf8;
  border: 1px solid #ffe29a;
  box-shadow: 0 18px 42px rgba(23, 50, 77, 0.1);
}

.hero-copy {
  display: grid;
  gap: 9px;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.02;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  color: #3b5267;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-actions .primary-button,
.hero-actions .secondary-button {
  min-width: 170px;
}

.hero-steps {
  display: grid;
  gap: 10px;
}

.hero-steps article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(215, 229, 242, 0.9);
  border-radius: 8px;
}

.hero-steps span,
.dashboard-card-marker {
  min-width: 54px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
}

.hero-steps strong {
  font-size: 16px;
}

.dashboard-intro {
  display: grid;
  gap: 4px;
}

.dashboard-intro h2 {
  font-size: 23px;
}

.dashboard-intro p {
  color: var(--muted);
  font-weight: 800;
}

.practice-setup-card {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) minmax(120px, 0.34fr) minmax(280px, 1.1fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: #ffffff;
  border: 1px solid rgba(215, 229, 242, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 50, 77, 0.06);
}

.practice-setup-heading {
  display: grid;
  gap: 2px;
}

.practice-setup-heading h2 {
  font-size: 22px;
}

.top-grade-control,
.top-subject-control {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.top-grade-control span,
.top-subject-control > span,
.daily-grade-control strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.top-grade-control select {
  min-height: 40px;
}

.top-subject-control .subject-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.top-subject-control .subject-card {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  min-width: 0;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  color: #244f73;
  background: #f8fbff;
  border: 1px solid #d8e8f6;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 14px rgba(23, 50, 77, 0.04);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.top-subject-control .subject-card:hover {
  background: #eef7ff;
  border-color: #bcd7ef;
  box-shadow: 0 10px 22px rgba(47, 128, 237, 0.12);
}

.top-subject-control .subject-card:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.22);
  outline-offset: 2px;
}

.top-subject-control .subject-card.active,
.top-subject-control .subject-card.selected {
  color: #102b4c;
  background: #eaf4ff;
  border-color: #6faeea;
  box-shadow: inset 0 0 0 1px rgba(47, 128, 237, 0.28), 0 10px 22px rgba(47, 128, 237, 0.1);
}

.top-subject-control .subject-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #1763c6;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 950;
}

.top-subject-control .subject-card-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.top-subject-control .subject-card-body strong {
  min-width: 0;
  color: #173450;
  font-size: 15px;
  line-height: 1.12;
}

.top-subject-control .subject-card-body small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.top-subject-control .subject-card-status {
  min-width: 34px;
  min-height: 22px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.top-subject-control .subject-card:not(.active):not(.selected) .subject-card-status {
  display: none;
}

.subject-coming-soon-note {
  min-height: 18px;
  margin: 0;
  color: #415071;
  font-size: 12px;
  font-weight: 800;
}

.view-tabs,
.student-tabs,
.parent-tabs {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  padding: 8px;
  background: rgba(232, 244, 255, 0.96);
  border: 1px solid #bfdaf1;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(23, 50, 77, 0.1);
  backdrop-filter: blur(10px);
}

.student-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.student-tab-button,
.parent-tab-button,
.view-tab-button,
.student-tabs button,
.parent-tabs button {
  min-height: 48px;
  padding: 0 14px;
  color: #244f73;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.student-tab-button.active,
.parent-tab-button.active,
.view-tab-button.active,
.student-tabs button.selected,
.parent-tabs button.selected,
.student-tabs button:hover,
.parent-tabs button:hover {
  color: #102b4c;
  background: #ffffff;
  border-color: #bcd7ef;
  box-shadow: 0 8px 18px rgba(23, 50, 77, 0.12);
}

.student-tab-button:focus-visible,
.parent-tab-button:focus-visible,
.view-tab-button:focus-visible,
.student-tabs button:focus-visible,
.parent-tabs button:focus-visible {
  outline: 3px solid rgba(27, 105, 210, 0.24);
  outline-offset: 2px;
}

.view-tab-panel,
.student-tab-panel,
.parent-tab-panel {
  display: grid;
  gap: 14px;
}

.view-tab-panel[hidden],
.student-tab-panel[hidden],
.parent-tab-panel[hidden] {
  display: none !important;
}

.compact-student-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-student-actions .daily-practice-card {
  grid-column: 1 / -1;
}

.student-feature-card {
  grid-template-columns: 72px minmax(0, 1fr) minmax(190px, auto);
  align-items: center;
}

.worksheet-answer-key-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 8px;
  color: #31536f;
  font-weight: 780;
}

.worksheet-answer-key-option input {
  width: 18px;
  height: 18px;
}

.student-progress-summary {
  display: grid;
  gap: 12px;
}

.student-progress-empty {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #dbe8f2;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(23, 50, 77, 0.06);
}

.student-progress-empty p {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.student-progress-insights {
  margin-top: 2px;
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(215, 229, 242, 0.92);
  box-shadow: 0 12px 30px rgba(23, 50, 77, 0.08);
}

.dashboard-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.dashboard-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.dashboard-card .secondary-button,
.dashboard-card .primary-button {
  width: 100%;
  align-self: end;
}

.dashboard-card.daily-practice-card {
  grid-column: span 2;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 0;
  border-left: 0;
}

.reading-marker {
  background: #ecfdf3;
  border-color: #bfedcf;
  color: #17623e;
}

.math-marker {
  background: #fff2cc;
  border-color: #ffe29a;
  color: #745015;
}

.worksheet-marker {
  background: #fff1ee;
  border-color: #ffd0c9;
  color: #9d3d31;
}

.progress-marker,
.report-marker {
  background: #f3efff;
  border-color: #ded3ff;
  color: #5b3ea2;
}

.quick-practice-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(215, 229, 242, 0.92);
  box-shadow: 0 12px 30px rgba(23, 50, 77, 0.08);
}

.quick-practice-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.quick-practice-header h2 {
  font-size: 28px;
}

.quick-practice-header p {
  max-width: 440px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.student-setup-grid,
.dashboard-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}

.student-setup-grid label,
.student-setup-grid fieldset {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 0;
}

.student-setup-grid label > span,
.student-setup-grid legend {
  color: #173450;
  font-size: 13px;
  font-weight: 850;
}

.student-setup-grid small {
  color: #5d7285;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.student-setup-grid input,
.student-setup-grid select {
  width: 100%;
  min-height: 46px;
}

.student-setup-grid .segmented {
  min-height: 46px;
}

.dashboard-controls .subject-picker {
  grid-column: span 3;
}

.dashboard-controls .subject-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-controls #topic-control {
  grid-column: span 2;
}

.dashboard-controls .topic-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-setup-actions,
.dashboard-controls .setup-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  align-items: center;
}

.student-setup-actions .primary-button,
.student-setup-actions .secondary-button {
  width: 100%;
}

.daily-student-row {
  display: grid;
  max-width: 430px;
}

.daily-student-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.daily-plan-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.daily-plan-details article {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.daily-plan-details strong {
  color: var(--purple);
  font-size: 13px;
}

.daily-plan-details span {
  color: var(--ink);
  font-weight: 900;
  line-height: 1.3;
}

.compact-plan-details {
  display: none;
}

.homeschool-view {
  display: grid;
  gap: 22px;
  padding: 32px 38px 24px;
}

.homeschool-header,
.homeschool-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.homeschool-header h2,
.homeschool-panel h3 {
  margin: 0;
}

.homeschool-header {
  padding: 0 2px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.homeschool-header h2 {
  color: #07183d;
  font-size: clamp(32px, 3vw, 42px);
  line-height: 1.06;
}

.homeschool-header p:not(.eyebrow) {
  margin: 9px 0 0;
  color: #485776;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.homeschool-user-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #263657;
  font-size: 13px;
}

.notification-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #ef4444;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 950;
}

.parent-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 950;
}

.homeschool-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.homeschool-actions button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 7px 14px;
  align-content: center;
  align-items: center;
  min-height: 132px;
  padding: 18px 18px 16px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96)),
    #ffffff;
  border: 1px solid rgba(220, 229, 241, 0.92);
  border-radius: 16px;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 14px 32px rgba(23, 45, 79, 0.075);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.homeschool-actions button:hover {
  transform: translateY(-2px);
  border-color: rgba(158, 195, 236, 0.95);
  box-shadow: 0 18px 36px rgba(23, 45, 79, 0.11);
}

.homeschool-actions button small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.homeschool-actions button strong {
  min-width: 0;
  color: #081942;
  font-size: 18px;
  line-height: 1.2;
}

.homeschool-actions button.selected {
  color: var(--ink);
  background: #ffffff;
  border-color: #dfe7f2;
}

.homeschool-actions button.selected small {
  color: var(--muted);
}

.homeschool-panel,
.worksheet-card,
.weekly-report-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(215, 229, 242, 0.92);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(23, 50, 77, 0.055);
}

#parent-tab-dashboard {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.homeschool-today-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 20px 26px;
  align-items: center;
  min-height: 280px;
  padding: 30px 30px 24px;
  background:
    radial-gradient(circle at 88% 20%, rgba(20, 184, 166, 0.12), transparent 28%),
    radial-gradient(circle at 12% 98%, rgba(11, 102, 216, 0.08), transparent 30%),
    #ffffff;
  border: 1px solid rgba(218, 228, 240, 0.92);
  border-radius: 18px;
  box-shadow: 0 20px 46px rgba(20, 42, 77, 0.105);
}

.homeschool-plan-copy {
  display: grid;
  gap: 8px;
}

.homeschool-plan-copy h3 {
  color: #081942;
  font-size: 24px;
  line-height: 1.14;
}

.homeschool-plan-copy .daily-practice-reason {
  position: relative;
  max-width: 760px;
  margin: 2px 0 0;
  padding-left: 112px;
  color: #4c5a79;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.homeschool-plan-copy .daily-practice-reason::before {
  content: "Why this recommendation?";
  position: absolute;
  left: 0;
  top: 0;
  color: #0f766e;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  pointer-events: none;
}

.plan-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.plan-title-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #0f766e;
  background: #ecfdf8;
  border: 1px solid #bfede5;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 950;
}

.plan-illustration {
  grid-row: 1 / span 3;
  grid-column: 2;
  position: relative;
  min-height: 180px;
  opacity: 0.96;
  pointer-events: none;
}

.plant-pot,
.book-stack,
.pencil-cup {
  position: absolute;
  display: block;
}

.book-stack {
  left: 8px;
  right: 10px;
  bottom: 16px;
  height: 42px;
  background:
    linear-gradient(#f8b4b4, #f8b4b4) 20px 25px / 136px 12px no-repeat,
    linear-gradient(#bfdbfe, #bfdbfe) 8px 14px / 146px 12px no-repeat,
    linear-gradient(#fde68a, #fde68a) 26px 3px / 122px 12px no-repeat;
  border-radius: 8px;
  transform: skewY(-6deg);
}

.plant-pot {
  width: 58px;
  height: 82px;
  right: 54px;
  top: 4px;
  background:
    radial-gradient(ellipse at 20% 18%, #9ac985 0 14%, transparent 15%),
    radial-gradient(ellipse at 65% 12%, #a7d28f 0 15%, transparent 16%),
    radial-gradient(ellipse at 45% 34%, #86bd72 0 15%, transparent 16%),
    linear-gradient(#f6b794 42px, #e99b72 43px 74px);
  border-radius: 24px 24px 12px 12px;
}

.pencil-cup {
  width: 42px;
  height: 72px;
  right: 10px;
  bottom: 34px;
  background:
    linear-gradient(90deg, #f59e0b 0 5px, transparent 5px 12px, #60a5fa 12px 17px, transparent 17px 25px, #fb7185 25px 30px, transparent 30px) 6px 0 / 34px 42px no-repeat,
    linear-gradient(#93c5fd, #60a5fa);
  border-radius: 10px 10px 14px 14px;
}

.homeschool-today-hero .daily-practice-actions {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.plan-actions-row {
  grid-column: 1;
  display: grid;
  gap: 10px;
}

.plan-actions-row > h3 {
  display: none;
}

.homeschool-today-hero .primary-button,
.homeschool-today-hero .secondary-button,
.recommended-next-card .primary-button,
.recommended-next-card .secondary-button {
  min-height: 46px;
  border-radius: 9px;
}

.homeschool-today-hero .primary-button,
.recommended-next-card .primary-button {
  min-width: 260px;
  background: linear-gradient(135deg, #075bd8, #0b74f2);
  box-shadow: 0 12px 24px rgba(11, 102, 216, 0.22);
}

.today-plan-summary,
.homeschool-week-progress,
.daily-plan-details {
  display: grid;
  gap: 8px;
}

.today-plan-summary {
  grid-column: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 0;
}

.today-plan-summary article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 15px;
  background: rgba(248, 251, 255, 0.86);
  border: 1px solid rgba(225, 233, 244, 0.94);
  border-radius: 14px;
}

.today-plan-summary article:last-child {
  border-right: 1px solid rgba(225, 233, 244, 0.94);
}

.today-plan-summary .student-plan-card {
  grid-template-columns: 56px minmax(0, 1fr) 82px;
  align-items: center;
}

.student-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 32%, #ffd3a5 0 24%, transparent 25%),
    linear-gradient(135deg, #f59e0b, #22c55e);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 950;
}

.student-plan-card label {
  display: grid;
  gap: 3px;
}

.student-plan-card input {
  min-height: 28px;
  padding: 0;
  color: #081942;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 17px;
  font-weight: 950;
}

.student-plan-card select {
  min-height: 32px;
  padding: 0 8px;
  color: #081942;
  background: #ffffff;
  border: 1px solid #d8e5ef;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.student-plan-card small {
  color: #465575;
  font-weight: 800;
}

.recommendation-card {
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
}

.recommendation-card > strong,
.recommendation-card > span:not(.recommendation-icon) {
  grid-column: 2;
}

.recommendation-icon {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #6d28d9;
  background: #f1e9ff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.math-plan-card .recommendation-icon {
  color: #15803d;
  background: #e9f8ed;
}

.focus-plan-card .recommendation-icon {
  color: #dc2626;
  background: #ffe8e8;
}

.homeschool-week-progress article,
.daily-plan-details article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 11px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.today-plan-summary strong,
.homeschool-week-progress span,
.daily-plan-details strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.today-plan-summary span,
.homeschool-week-progress strong,
.daily-plan-details span {
  color: var(--ink);
  font-weight: 950;
  line-height: 1.3;
}

.today-plan-summary .recommendation-card > strong {
  color: #4b5876;
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
}

.today-plan-summary .recommendation-card > span:not(.recommendation-icon) {
  color: #081942;
  font-size: 16px;
  font-weight: 950;
}

.today-plan-summary .student-plan-card strong {
  color: #4b5876;
  font-size: 11px;
  text-transform: none;
}

.homeschool-section,
.homeschool-dashboard-card {
  display: grid;
  gap: 14px;
}

.homeschool-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.homeschool-section-header h3,
.recommended-next-card h3 {
  margin: 0;
  color: #07183d;
  font-size: 21px;
}

.action-marker {
  grid-row: 1 / 4;
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #0b66d8;
  background: linear-gradient(135deg, #eaf4ff, #f5f9ff);
  border: 0;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px #dbeafe;
}

.worksheet-marker {
  color: #6d28d9;
  background: linear-gradient(135deg, #f1e9ff, #fbf8ff);
  box-shadow: inset 0 0 0 1px #e4d7ff;
}

.progress-marker {
  color: #0f766e;
  background: linear-gradient(135deg, #e4fbf7, #f8fffd);
  box-shadow: inset 0 0 0 1px #c8eee7;
}

.report-marker {
  color: #dc2626;
  background: linear-gradient(135deg, #ffe8e8, #fff8f8);
  box-shadow: inset 0 0 0 1px #ffd1d1;
}

.action-cta {
  grid-column: 2 / -1;
  align-self: end;
  justify-self: start;
  padding: 0;
  color: #0b66d8;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  font-weight: 950;
}

.action-cta::after {
  content: " ->";
}

.homeschool-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(310px, 0.78fr);
  gap: 20px;
}

.homeschool-dashboard-card {
  align-content: start;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 255, 0.98)),
    #ffffff;
  border: 1px solid rgba(220, 229, 241, 0.92);
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(23, 45, 79, 0.08);
}

.homeschool-week-progress {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.homeschool-week-progress article {
  min-height: 112px;
  align-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #f1f7ff, #f8fbff);
  border: 0;
  border-radius: 15px;
}

.homeschool-week-progress article:nth-child(2) {
  background: linear-gradient(135deg, #effaf4, #f9fffb);
}

.homeschool-week-progress article:nth-child(3) {
  background: linear-gradient(135deg, #f4edff, #fbf8ff);
}

.homeschool-week-progress article:nth-child(4) {
  background: linear-gradient(135deg, #fff0f0, #fff9f9);
}

.homeschool-week-progress strong {
  color: #06163a;
  font-size: 30px;
}

.homeschool-week-progress span {
  color: #4d5a75;
  font-size: 12px;
}

.homeschool-week-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.homeschool-week-insights article {
  display: grid;
  gap: 3px;
  padding: 14px 15px;
  color: var(--ink);
  background: #fffaf0;
  border: 1px solid #ffe29a;
  border-radius: 14px;
}

.homeschool-week-insights span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.homeschool-week-insights strong {
  color: #10204c;
  font-size: 15px;
  line-height: 1.25;
}

.homeschool-empty-state {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.homeschool-empty-state span,
.recommended-next-card p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.homeschool-empty-state div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.local-learners-panel,
.student-tasks-panel {
  display: grid;
  gap: 12px;
}

.child-profile-form-panel,
.assignment-form-panel {
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.child-profile-form,
.assignment-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.assignment-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.child-profile-form label,
.assignment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.privacy-helper {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.learner-dashboard-summary,
.child-card-meta {
  display: grid;
  gap: 8px;
}

.learner-dashboard-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.learner-dashboard-summary article,
.child-card,
.student-task-empty,
.student-task-card {
  min-width: 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid rgba(215, 229, 242, 0.92);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23, 50, 77, 0.05);
}

.learner-dashboard-summary strong {
  color: var(--blue);
  font-size: 24px;
}

.learner-dashboard-summary span,
.child-card-meta span,
.student-task-card span,
.student-task-card small {
  color: var(--muted);
  font-weight: 800;
}

.child-cards-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.child-card {
  display: grid;
  gap: 12px;
}

.child-card.selected {
  background: #eef7ff;
  border-color: #9ec8f2;
}

.child-card-header,
.student-task-header,
.student-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.child-card h4,
.student-task-header h3,
.student-task-empty h3 {
  margin: 0;
  font-size: 20px;
}

.child-card-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.child-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.learner-empty-state {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.student-task-list {
  display: grid;
  gap: 10px;
}

.student-task-header > span {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: #1763c6;
  background: #e7f2ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.recommended-next-card {
  position: relative;
  padding-left: 104px;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 200, 87, 0.18), transparent 26%),
    #ffffff;
  border-color: rgba(220, 229, 241, 0.92);
}

.recommended-next-card::before {
  content: "Next";
  position: absolute;
  left: 24px;
  top: 24px;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  color: #d97706;
  background: linear-gradient(135deg, #fff1c7, #fff9ea);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px #ffe6a3;
  pointer-events: none;
}

.recommended-next-card .daily-practice-actions {
  min-width: 0;
}

.homeschool-view .secondary-button {
  color: #17466f;
  background: #ffffff;
  border: 1px solid #cfddec;
}

.homeschool-view .secondary-button:hover {
  background: #eef7ff;
}

.homeschool-secondary-nav {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

.homeschool-secondary-nav button {
  min-height: 40px;
  padding: 0 13px;
  color: #17466f;
  background: #e7f2ff;
  border: 1px solid #cde2f5;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.homeschool-secondary-nav button.selected {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.homeschool-tips-banner {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  color: #263657;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.98), rgba(255, 255, 255, 0.98)),
    #ffffff;
  border: 1px solid #f4dfb7;
  border-radius: 15px;
  box-shadow: 0 12px 26px rgba(217, 119, 6, 0.07);
}

.homeschool-tips-banner span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #d97706;
  background: #fff3d8;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 950;
}

.homeschool-tips-banner strong {
  color: #07183d;
  font-size: 15px;
}

.homeschool-tips-banner p {
  margin: 0;
  color: #415071;
  font-size: 13px;
  font-weight: 800;
}

body:not([data-theme="contrast"]) .workspace {
  border-color: rgba(216, 229, 239, 0.86);
  box-shadow: 0 18px 48px rgba(28, 49, 78, 0.09);
}

body:not([data-theme="contrast"]) .setup-panel {
  border-right-color: rgba(216, 229, 239, 0.82);
}

body:not([data-theme="contrast"]) .eyebrow {
  color: #58718b;
  font-weight: 750;
  text-transform: none;
}

body:not([data-theme="contrast"]) .primary-button,
body:not([data-theme="contrast"]) .secondary-button,
body:not([data-theme="contrast"]) .toolbar-button {
  border-radius: 12px;
  font-weight: 780;
}

body:not([data-theme="contrast"]) .primary-button {
  background: linear-gradient(135deg, #1767d8, #6d5df6);
  box-shadow: 0 10px 22px rgba(47, 112, 222, 0.18);
}

body:not([data-theme="contrast"]) [data-view-action].active-view {
  border-color: rgba(93, 158, 234, 0.34);
  box-shadow: 0 10px 22px rgba(47, 112, 222, 0.14);
}

body:not([data-theme="contrast"]) .secondary-button,
body:not([data-theme="contrast"]) .toolbar-button {
  color: #23527c;
  background: #edf6ff;
  border: 1px solid #d8e8f6;
  box-shadow: none;
}

body:not([data-theme="contrast"]) select,
body:not([data-theme="contrast"]) input[type="number"],
body:not([data-theme="contrast"]) input[type="text"],
body:not([data-theme="contrast"]) textarea {
  color: #22364d;
  background: #ffffff;
  border-color: #d8e5ef;
  box-shadow: 0 1px 0 rgba(31, 56, 82, 0.02);
}

body:not([data-theme="contrast"]) select:focus,
body:not([data-theme="contrast"]) input[type="number"]:focus,
body:not([data-theme="contrast"]) input[type="text"]:focus,
body:not([data-theme="contrast"]) textarea:focus {
  border-color: #7db9ef;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.12);
}

body:not([data-theme="contrast"]) .dashboard-hero,
body:not([data-theme="contrast"]) .quick-practice-card,
body:not([data-theme="contrast"]) .dashboard-card,
body:not([data-theme="contrast"]) .homeschool-today-hero,
body:not([data-theme="contrast"]) .homeschool-actions button,
body:not([data-theme="contrast"]) .homeschool-dashboard-card,
body:not([data-theme="contrast"]) .homeschool-panel,
body:not([data-theme="contrast"]) .worksheet-card,
body:not([data-theme="contrast"]) .weekly-report-card {
  border-color: rgba(216, 229, 239, 0.92);
  box-shadow: 0 14px 34px rgba(28, 49, 78, 0.075);
}

body:not([data-theme="contrast"]) .dashboard-card h3,
body:not([data-theme="contrast"]) .homeschool-section-header h3,
body:not([data-theme="contrast"]) .recommended-next-card h3 {
  color: #162b44;
}

body:not([data-theme="contrast"]) .dashboard-card p,
body:not([data-theme="contrast"]) .homeschool-actions button small,
body:not([data-theme="contrast"]) .recommended-next-card p,
body:not([data-theme="contrast"]) .homeschool-header p:not(.eyebrow) {
  color: #5f7187;
  font-weight: 720;
}

body:not([data-theme="contrast"]).homeschool-active .setup-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
  border-right-color: rgba(216, 229, 239, 0.82);
}

body:not([data-theme="contrast"]).homeschool-active .homeschool-side-nav button,
body:not([data-theme="contrast"]).homeschool-active .homeschool-subjects button {
  color: #243952;
  border-color: transparent;
  box-shadow: none;
}

body:not([data-theme="contrast"]).homeschool-active .homeschool-side-nav button.selected,
body:not([data-theme="contrast"]).homeschool-active .homeschool-side-nav button:hover,
body:not([data-theme="contrast"]).homeschool-active .homeschool-subjects button.selected {
  background: #eef6ff;
  border-color: #dceaf8;
  box-shadow: inset 2px 0 0 #5d9eea;
}

body:not([data-theme="contrast"]) .homeschool-side-nav strong,
body:not([data-theme="contrast"]) .homeschool-subjects strong,
body:not([data-theme="contrast"]) .today-plan-summary span,
body:not([data-theme="contrast"]) .homeschool-week-progress strong,
body:not([data-theme="contrast"]) .daily-plan-details span {
  font-weight: 820;
}

.homeschool-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.homeschool-form label,
.checkbox-row {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-row {
  display: flex;
  align-items: center;
}

.homeschool-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.homeschool-metrics article,
.progress-list article {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.homeschool-metrics strong {
  color: var(--purple);
  font-size: 26px;
}

.homeschool-metrics span,
.progress-list span,
.homeschool-note {
  color: var(--muted);
  font-weight: 800;
}

.homeschool-breakdown {
  display: grid;
  gap: 8px;
}

.progress-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.homeschool-view.hidden,
.homeschool-panel.hidden {
  display: none;
}

.dashboard-content {
  display: grid;
  gap: 16px;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.dashboard-cards article {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: #ffffff;
}

.dashboard-cards strong {
  color: var(--purple);
  font-size: 28px;
}

.dashboard-cards span,
.dashboard-list span {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.dashboard-panel h2 {
  font-size: 22px;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-list article {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.test-mode .setup-panel {
  background: #f8fafc;
}

.test-mode .mini-stats {
  display: none;
}

.session-active .workspace {
  grid-template-columns: 1fr;
}

.session-active .setup-panel {
  display: none;
}

.session-active .quiz-panel {
  min-height: min(850px, calc(100vh - 40px));
}

@media (max-width: 1180px) {
  .homeschool-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homeschool-today-hero,
  .homeschool-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .plan-illustration {
    display: none;
  }

  .today-plan-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .quiz-panel {
    order: 6;
    border-top: 1px solid var(--line);
  }

  .test-toolbar {
    padding: 0 18px;
  }

  .question-view,
  .results-view {
    gap: 16px;
    padding: 18px 14px 22px;
  }

  .test-area {
    grid-template-columns: 1fr;
  }

  .passage-block {
    position: static;
  }

  .passage-block,
  .question-block {
    padding: 18px;
  }

  .passage-block p {
    font-size: 21px;
    line-height: 1.65;
  }

  .question-block h3 {
    font-size: 24px;
  }

  .choice {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 78px;
    padding: 14px;
    font-size: 19px;
  }

  .choice-letter {
    width: 48px;
    height: 48px;
  }

  .true-false-table {
    overflow-x: auto;
  }

  .tf-header,
  .tf-row {
    grid-template-columns: minmax(160px, 1fr) 86px 86px;
  }

  .feedback {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .feedback-status-mark,
  .feedback-next-button {
    width: 100%;
  }

  .celebration-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .celebration-badge {
    width: 68px;
    height: 68px;
  }

  .stat-cards,
  .resource-grid,
  .dashboard-cards,
  .dashboard-card-grid,
  .compact-student-actions,
  .dashboard-list.compact,
  .home-entry,
  .empty-state-grid,
  .dashboard-hero,
  .daily-practice-card,
  .daily-plan-panel,
  .daily-plan-details,
  .dashboard-controls,
  .student-setup-grid,
  .dashboard-controls .subject-cards,
  .dashboard-controls .topic-buttons,
  .practice-setup-card,
  .student-feature-card,
  .homeschool-today-hero,
  .today-plan-summary,
  .homeschool-dashboard-grid,
  .homeschool-week-progress,
  .homeschool-week-insights,
  .homeschool-actions,
  .homeschool-form,
  .child-profile-form,
  .assignment-form,
  .homeschool-metrics,
  .learner-dashboard-summary,
  .child-cards-list,
  .child-card-actions,
  .progress-list,
  .skill-breakdown div {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .admin-login,
  .admin-email-login,
  .homeschool-header,
  .homeschool-panel-header,
  .homeschool-section-header,
  .child-card-header,
  .student-task-header,
  .student-task-card,
  .results-header,
  .results-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .results-actions {
    justify-content: stretch;
  }

  .reward-intro,
  .reward-finish {
    display: grid;
  }

  .reward-answers,
  .treasure-answers,
  .archery-controls {
    grid-template-columns: 1fr;
  }

  .word-star,
  .treasure-fact {
    width: 100%;
  }

  .archery-field {
    min-height: 230px;
  }

  .archer {
    left: 4%;
    scale: 0.82;
    transform-origin: bottom left;
  }

  .archery-target {
    right: 4%;
    width: 108px;
  }

  .factor-row {
    grid-template-columns: 1fr;
  }

  .helper-header,
  .game-card,
  .memory-status,
  .repeat-card,
  .repeat-controls,
  .repeat-choices {
    grid-template-columns: 1fr;
  }

  .helper-header,
  .memory-status {
    display: grid;
  }

  .table-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-header {
    display: grid;
  }

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

  .table-grid {
    grid-template-columns: repeat(6, minmax(34px, 1fr));
  }

  .clock-pair {
    grid-template-columns: 1fr;
  }

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

  .setup-panel {
    display: contents;
    gap: 10px;
    padding: 12px 12px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-row {
    order: 1;
    gap: 10px;
    margin: 12px 12px 0;
    margin-bottom: 0;
  }

  .brand-mark,
  body.homeschool-active .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 18px;
    box-shadow: 0 6px 14px rgba(47, 128, 237, 0.18);
  }

  .brand-row .eyebrow,
  .homeschool-sidebar-copy,
  .mini-stats {
    display: none;
  }

  .brand-row h1,
  body.homeschool-active .brand-row h1 {
    font-size: 20px;
    line-height: 1.05;
  }

  .mode-switch {
    order: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0 12px;
    padding: 6px;
    border-radius: 8px;
  }

  .mode-switch p {
    display: none;
  }

  .mode-switch button {
    min-height: 36px;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 8px;
    justify-items: center;
    border-radius: 7px;
    text-align: center;
  }

  .mode-switch button span {
    display: none;
  }

  .mode-switch button strong {
    min-width: 0;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .sidebar-controls {
    order: 4;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 12px 10px;
    padding: 8px;
    border-radius: 8px;
  }

  .sidebar-controls label {
    gap: 4px;
  }

  .sidebar-controls span {
    font-size: 11px;
  }

  .sidebar-controls select,
  body.homeschool-active .sidebar-controls select {
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: #ffffff;
    font-size: 12px;
  }

  body.homeschool-active .sidebar-controls {
    padding: 8px;
    background: #ffffff;
    border: 1px solid rgba(215, 229, 242, 0.9);
    border-radius: 8px;
  }

  body.homeschool-active .sidebar-controls::before {
    display: none;
  }

  .side-nav,
  .homeschool-side-nav {
    order: 3;
  }

  .side-nav,
  body.homeschool-active .homeschool-side-nav {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0 12px 3px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .side-nav::-webkit-scrollbar,
  .homeschool-side-nav::-webkit-scrollbar,
  .student-tabs::-webkit-scrollbar,
  .parent-tabs::-webkit-scrollbar {
    display: none;
  }

  .side-nav button,
  .side-nav a,
  body.homeschool-active .homeschool-side-nav button {
    flex: 0 0 auto;
    min-height: 36px;
    min-width: 72px;
    width: auto;
    padding: 0 11px;
    border-radius: 999px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .side-nav button span,
  .side-nav button strong,
  body.homeschool-active .homeschool-side-nav button span,
  body.homeschool-active .homeschool-side-nav button strong {
    display: none;
  }

  .side-nav button::after,
  body.homeschool-active .homeschool-side-nav button::after {
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
  }

  .side-nav button.selected,
  .side-nav button:hover,
  body.homeschool-active .homeschool-side-nav button.selected,
  body.homeschool-active .homeschool-side-nav button:hover,
  body:not([data-theme="contrast"]).homeschool-active .homeschool-side-nav button.selected,
  body:not([data-theme="contrast"]).homeschool-active .homeschool-side-nav button:hover {
    background: #d7ebff;
    border-color: #bcd7ef;
    box-shadow: none;
  }

  .side-nav button[data-student-nav="home"]::after {
    content: "Home";
  }

  .side-nav button[data-student-nav="today"]::after {
    content: "Today";
  }

  .side-nav button[data-student-nav="reading"]::after {
    content: "Reading";
  }

  .side-nav button[data-student-nav="math"]::after {
    content: "Math";
  }

  .side-nav button[data-student-nav="worksheet"]::after {
    content: "Worksheet";
  }

  body.homeschool-active .homeschool-side-nav button[data-homeschool-tab="today"]::after {
    content: "Dashboard";
  }

  body.homeschool-active .homeschool-side-nav button[data-homeschool-tab="create"]::after {
    content: "Create";
  }

  body.homeschool-active .homeschool-side-nav button[data-homeschool-tab="worksheet"]::after {
    content: "Print";
  }

  body.homeschool-active .homeschool-side-nav button[data-homeschool-tab="progress"]::after {
    content: "Progress";
  }

  body.homeschool-active .homeschool-side-nav button[data-homeschool-tab="weekly"]::after {
    content: "Report";
  }

  .homeschool-subjects {
    order: 5;
    display: none !important;
  }

  .sidebar-note {
    order: 8;
    margin: 12px 12px 0;
    padding: 12px;
  }

  .feedback-form {
    order: 9;
    margin: 0 12px 18px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .feedback-form textarea {
    min-height: 76px;
  }

  .empty-state {
    gap: 12px;
    padding: 12px 12px 24px;
  }

  #student-view {
    align-content: start;
  }

  #student-view .student-tabs {
    order: 2;
  }

  #student-view .dashboard-hero,
  #student-view .dashboard-intro {
    display: none;
  }

  #student-view .practice-setup-card {
    order: 1;
  }

  #student-tab-practice {
    order: 3;
  }

  #student-tab-worksheet {
    order: 4;
  }

  #student-tab-games {
    order: 5;
  }

  #student-tab-progress {
    order: 6;
  }

  .practice-setup-card {
    gap: 8px;
    padding: 10px;
  }

  .practice-setup-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .practice-setup-heading .eyebrow {
    margin-bottom: 1px;
    font-size: 11px;
  }

  .practice-setup-heading h2 {
    font-size: 18px;
  }

  .top-grade-control,
  .top-subject-control {
    gap: 4px;
  }

  .top-grade-control select {
    min-height: 36px;
  }

  .top-subject-control .subject-card-grid {
    gap: 7px;
  }

  .top-subject-control .subject-card {
    min-height: 68px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 9px;
  }

  .top-subject-control .subject-card-icon {
    width: 34px;
    height: 34px;
    font-size: 9px;
  }

  .top-subject-control .subject-card-body strong {
    font-size: 14px;
  }

  .top-subject-control .subject-card-body small,
  .subject-coming-soon-note {
    font-size: 11px;
  }

  .hero-actions,
  .quick-practice-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .view-tabs,
  .student-tabs,
  .parent-tabs {
    position: static;
    display: flex;
    gap: 6px;
    margin: 0 -2px;
    padding: 5px;
    overflow-x: auto;
    border-radius: 999px;
    box-shadow: none;
  }

  .student-tab-button,
  .parent-tab-button,
  .view-tab-button,
  .student-tabs button,
  .parent-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    min-width: 78px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
  }

  .parent-tab-button[data-parent-tab="create"],
  .parent-tab-button[data-parent-tab="worksheet"],
  .parent-tab-button[data-parent-tab="weekly"] {
    font-size: 0;
  }

  .parent-tab-button[data-parent-tab="create"]::after,
  .parent-tab-button[data-parent-tab="worksheet"]::after,
  .parent-tab-button[data-parent-tab="weekly"]::after {
    font-size: 13px;
  }

  .parent-tab-button[data-parent-tab="create"]::after {
    content: "Create";
  }

  .parent-tab-button[data-parent-tab="worksheet"]::after {
    content: "Print";
  }

  .parent-tab-button[data-parent-tab="weekly"]::after {
    content: "Report";
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button,
  .dashboard-controls .setup-actions,
  .student-setup-actions,
  .dashboard-controls .subject-picker,
  .dashboard-controls #topic-control,
  .dashboard-card.daily-practice-card {
    grid-column: auto;
  }

  .dashboard-card.daily-practice-card {
    grid-template-columns: 1fr;
  }

  .dashboard-card,
  .quick-practice-card {
    gap: 10px;
    padding: 14px;
  }

  .dashboard-card h3,
  .daily-practice-card h3,
  .daily-plan-panel h4 {
    font-size: 18px;
  }

  .dashboard-card p,
  .quick-practice-header p,
  .daily-practice-reason {
    font-size: 13px;
    line-height: 1.35;
  }

  .dashboard-card-marker {
    min-width: 44px;
    min-height: 34px;
    font-size: 10px;
  }

  .daily-practice-actions {
    min-width: 0;
  }

  .primary-button,
  .secondary-button {
    min-height: 42px;
    padding: 0 12px;
    font-size: 14px;
  }

  .dashboard-controls .setup-actions,
  .student-setup-actions {
    grid-template-columns: 1fr;
  }

  .homeschool-view {
    gap: 12px;
    padding: 12px 12px 24px;
  }

  .homeschool-header,
  .homeschool-panel,
  .homeschool-today-hero {
    padding: 14px;
  }

  body.homeschool-active .workspace {
    grid-template-columns: 1fr;
  }

  body.homeschool-active .setup-panel {
    gap: 10px;
    padding: 12px 12px 10px;
  }

  body.homeschool-active .sidebar-controls label {
    grid-template-columns: 1fr;
  }

  .homeschool-header h2 {
    font-size: 24px;
  }

  .homeschool-header p {
    font-size: 14px;
  }

  .homeschool-user-tools {
    font-size: 13px;
  }

  .homeschool-user-tools {
    justify-content: start;
  }

  .homeschool-today-hero {
    gap: 14px;
  }

  .plan-title-row {
    align-items: start;
  }

  .homeschool-plan-copy .daily-practice-reason {
    padding-left: 0;
  }

  .homeschool-plan-copy .daily-practice-reason::before {
    position: static;
    display: block;
    margin-bottom: 4px;
  }

  .today-plan-summary {
    border: 0;
    gap: 10px;
  }

  .today-plan-summary article,
  .today-plan-summary article:last-child {
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .homeschool-actions button {
    min-height: 102px;
  }

  .homeschool-today-hero .daily-practice-actions,
  .recommended-next-card .daily-practice-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .homeschool-today-hero .primary-button,
  .recommended-next-card .primary-button {
    min-width: 0;
  }

  .action-cta {
    grid-row: auto;
    grid-column: 2 / -1;
    justify-self: start;
  }

  .recommended-next-card {
    padding-left: 18px;
    padding-top: 88px;
  }

  .homeschool-empty-state div {
    display: grid;
  }

  .homeschool-tips-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .homeschool-tips-banner p {
    grid-column: 1 / -1;
  }

  .question-header,
  .results-header,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-wrap {
    width: 100%;
  }

  #progress-label {
    text-align: left;
  }
}

.simple-student-header {
  padding: 6px 2px 2px;
}

.simple-student-header h2 {
  color: #102a5c;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
}

.simple-student-header > p:last-child {
  color: #405578;
  font-size: 17px;
  font-weight: 700;
}

#student-view > .practice-setup-card {
  grid-template-columns: minmax(180px, .7fr) minmax(360px, 1.35fr) minmax(220px, .75fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  border-color: #dce5f4;
  border-radius: 20px;
  box-shadow: 0 14px 36px rgba(38, 67, 120, .09);
}

.step-number {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  margin-right: 7px;
  color: #fff;
  background: linear-gradient(135deg, #2f80ed, #5b43e8);
  border-radius: 50%;
  font-size: 13px;
}

#student-view .top-grade-control > span,
#student-view .top-subject-control > span {
  color: #142a55;
  font-size: 15px;
}

#student-view .top-grade-control select {
  min-height: 64px;
  padding-inline: 16px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 850;
}

#student-view .top-subject-control .subject-card {
  min-height: 64px;
  border-radius: 14px;
  overflow: hidden;
}

#student-view .top-subject-control .subject-card-icon {
  color: #315cbd;
  background: linear-gradient(145deg, #edf5ff, #dceaff);
  border: 1px solid #c8daf8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

#student-view .top-subject-control .subject-card-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#student-view .top-subject-control .subject-card-body small {
  font-size: 14px;
  line-height: 1.3;
}

#student-view .top-subject-control .subject-card.active,
#student-view .top-subject-control .subject-card.selected {
  color: #fff;
  background: linear-gradient(135deg, #2878ed, #3159df);
  border-color: #2878ed;
  box-shadow: 0 10px 22px rgba(47, 99, 225, .25);
}

#student-view .top-subject-control .subject-card.active strong,
#student-view .top-subject-control .subject-card.active small,
#student-view .top-subject-control .subject-card.selected strong,
#student-view .top-subject-control .subject-card.selected small {
  color: #fff;
}

#student-view .top-subject-control .subject-card.active .subject-card-icon,
#student-view .top-subject-control .subject-card.selected .subject-card-icon {
  color: #fff;
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.42);
}

#student-view .subject-coming-soon-note { display: none; }

#student-view .simple-start-practice-button {
  grid-column: auto;
  min-height: 108px;
  padding: 18px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 82% 20%, rgba(255,255,255,.18), transparent 24%), linear-gradient(135deg, #1558e9 0%, #443ee8 50%, #8038df 100%);
  box-shadow: 0 16px 32px rgba(64, 54, 218, .3), inset 0 1px 0 rgba(255,255,255,.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

#student-view .simple-start-practice-button span { display: grid; gap: 7px; }
#student-view .simple-start-practice-button strong { font-size: 24px; line-height: 1.05; }
#student-view .simple-start-practice-button small { max-width: 190px; font-size: 14px; line-height: 1.35; }
#student-view .simple-start-practice-button > b {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #5427d6;
  background: #fff;
  border-radius: 50%;
  font-size: 30px;
  box-shadow: 0 8px 22px rgba(27, 22, 108, .28);
  transition: transform 150ms ease;
}

#student-view .simple-start-practice-button:hover > b { transform: translateX(3px); }
#student-view .simple-start-practice-button > b svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }

.simple-section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.simple-section-heading h2 {
  color: #172d59;
  font-size: 25px;
}

.simple-tool-card {
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 14px 16px;
  min-height: 228px;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(38, 67, 120, .1), inset 0 1px 0 rgba(255,255,255,.9);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.simple-tool-card:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(38, 67, 120, .15); }
.simple-tool-card > button { grid-column: 1 / -1; border-radius: 13px; }
.simple-tool-card h3 { color: #15346c; font-size: 20px; line-height: 1.15; }
.simple-tool-card p { font-size: 15px; }

.tool-visual {
  width: 78px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 12px 24px rgba(32, 57, 110, .14), inset 0 1px 0 #fff;
}

.tool-visual svg { width: 62px; height: 62px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tool-visual-trophy { color: #bd7200; background: linear-gradient(145deg, #fff8d7, #ffd978); }
.tool-visual-trophy .tool-symbol-fill { fill: #fff7cd; stroke: #d98a00; stroke-width: 2; }
.tool-visual-printer { color: #2662c5; background: linear-gradient(145deg, #edf5ff, #bcd6ff); }
.tool-visual-progress { color: #e76500; background: linear-gradient(145deg, #fff2d8, #ffd0a1); }

.simple-tool-tables { border-color: #9bb9ff; background: linear-gradient(145deg, #fff, #f3f6ff); }
.simple-tool-tables.is-recommended {
  border-color: #684ce8;
  box-shadow: 0 14px 34px rgba(83, 64, 211, .16);
}
.math-tool-recommendation {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 5px 10px;
  color: #4c2bc4;
  background: #eee9ff;
  border: 1px solid #d4c8ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}
.simple-tool-worksheet { border-color: #b8dec8; background: linear-gradient(145deg, #fff, #f3fbf6); }
.simple-tool-progress { border-color: #ffc08d; background: linear-gradient(145deg, #fff, #fff8f1); }
.simple-tool-worksheet .secondary-button { color: #fff; background: linear-gradient(135deg, #168953, #2bac6d); border-color: #168953; }
.simple-tool-progress .secondary-button { color: #fff; background: linear-gradient(135deg, #ff8200, #ff5d00); border-color: #ff7000; }

.student-tabs.simple-bottom-nav {
  display: none;
  position: sticky;
  top: auto;
  bottom: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
  background: rgba(244, 248, 255, .95);
}

body:not(.session-active) .test-toolbar {
  display: none;
}

.student-tabs.simple-bottom-nav .simple-home-nav.selected {
  color: #4d32d1;
  border-color: #9aaeff;
  background: #fff;
  box-shadow: 0 8px 18px rgba(64, 73, 190, .14);
}

#student-tab-games {
  margin-top: 4px;
}

#student-view .math-helper {
  width: 100%;
  margin: 0;
  padding: 24px 26px;
  border: 1px solid #d7c8ff;
  border-radius: 24px;
  background: radial-gradient(circle at 8% 0%, rgba(255,255,255,.92), transparent 30%), linear-gradient(135deg, #f9f7ff, #f0ebff);
  box-shadow: 0 16px 38px rgba(78, 54, 165, .12), inset 0 1px 0 #fff;
}

#student-view .math-helper .helper-header h3 {
  color: #4e2bc4;
  font-size: 23px;
}

#student-view .math-helper .helper-header { align-items: center; margin-bottom: 20px; }
#student-view .math-helper .helper-header p { color: #514c72; font-size: 15px; }
.table-header-badges { display: flex; align-items: center; gap: 8px; }
.table-position-badge { padding: 7px 12px; color: #fff; background: linear-gradient(135deg, #7144e8, #4f2bc7); border-radius: 999px; font-size: 13px; font-weight: 900; box-shadow: 0 7px 15px rgba(77,43,196,.22); }
.table-header-badges .game-score { background: #fff; }

#student-view #multiplication-panel {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr);
  grid-template-areas:
    "picker reader"
    "actions reader"
    "practice practice";
  gap: 16px 20px;
  align-items: start;
}

#student-view #multiplication-panel.hidden,
#student-view #division-panel.hidden,
#student-view #repeat-panel.hidden {
  display: none;
}

#student-view #multiplication-panel > .table-picker {
  grid-area: picker;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
}

#student-view #multiplication-panel > .table-reader {
  grid-area: reader;
  align-self: start;
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 18px;
  border: 1px solid #ddd4f5;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(74, 54, 142, .1);
}

#student-view #multiplication-panel > .table-reader h4 { color: #4e2bc4; font-size: 18px; text-align: center; }
#student-view #multiplication-panel > .table-reader #reader-tip { padding-top: 10px; border-top: 1px solid #eee9f9; color: #6756b6; font-size: 13px; text-align: center; }

#student-view #multiplication-panel > .table-reader .reader-header {
  display: flex;
  align-items: flex-start;
}

#student-view #multiplication-panel > .table-reader #read-table-button {
  display: none;
}

#student-view #multiplication-panel > .table-reader .table-reader-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  overflow: visible;
}

#student-view #multiplication-panel > .table-reader .table-reader-list button {
  min-height: 34px;
  padding: 5px 8px;
  border: 0;
  box-shadow: none;
}

#student-view #multiplication-panel > .simple-table-actions { grid-area: actions; }
#student-view #multiplication-panel > .table-practice-details { grid-area: practice; }

#student-view .table-picker button {
  min-width: 0;
  min-height: 50px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  border-color: #e4def3;
  box-shadow: 0 5px 13px rgba(63, 48, 121, .1);
  font-size: 16px;
  font-weight: 900;
}

#student-view .table-picker button.selected { background: linear-gradient(135deg, #7a43e7, #4a22d0); border-color: transparent; box-shadow: 0 9px 20px rgba(82,42,207,.3); transform: translateY(-2px); }
#student-view .simple-table-actions { gap: 14px; }
#student-view .simple-table-actions button { min-height: 54px; border-radius: 14px; font-size: 15px; }

.table-mode-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; padding: 5px; border-radius: 16px; background: #e9e3fa; }
.table-mode-tabs button { min-width: 0; min-height: 52px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 12px; background: transparent; color: #554a78; font: inherit; font-weight: 900; cursor: pointer; }
.table-mode-tabs button.selected { color: #fff; background: linear-gradient(135deg, #7144e8, #4f2bc7); box-shadow: 0 7px 15px rgba(77,43,196,.22); }
.operation-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.operation-badge { width: 29px; height: 29px; flex: 0 0 29px; display: inline-grid; place-items: center; border: 2px solid #c8bae9; border-radius: 50%; background: rgba(255,255,255,.7); color: #5431b9; font-size: 20px; font-weight: 950; line-height: 1; }
.table-mode-tabs button.selected .operation-badge { border-color: rgba(255,255,255,.75); background: rgba(255,255,255,.16); color: #fff; }
.table-preview { cursor: pointer; }
.table-preview:focus-visible { outline: 4px solid rgba(47,128,237,.3); outline-offset: 3px; }
.table-preview .reader-header { flex-wrap: wrap; }
.table-preview .reader-header > div:first-child { flex: 1 1 150px; min-width: 0; }
.table-expand-button { width: 42px; height: 42px; flex: 0 0 42px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #d5c9f1; border-radius: 12px; background: #f7f3ff; color: #5330bc; font: inherit; font-size: 23px; font-weight: 900; line-height: 1; cursor: pointer; }
.table-expand-button:hover { background: #eee7ff; }
.table-expand-button:focus-visible { outline: 4px solid rgba(47,128,237,.3); outline-offset: 2px; }
#student-view #division-panel { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr); grid-template-areas: "picker reader" "actions reader" "practice practice"; gap: 16px 20px; align-items: start; }
#student-view #division-panel > .table-picker { grid-area: picker; grid-template-columns: repeat(12, minmax(42px, 1fr)); }
#student-view #division-panel > .table-reader { grid-area: reader; align-self: start; height: auto; max-height: none; overflow: visible; padding: 18px; border: 1px solid #ddd4f5; border-radius: 19px; background: #fff; box-shadow: 0 12px 26px rgba(74,54,142,.1); }
#student-view #division-panel > .table-reader .table-reader-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; overflow: visible; }
#student-view #division-panel > .table-reader .table-reader-list button { min-width: 0; min-height: 34px; padding: 5px 8px; border: 0; box-shadow: none; }
#student-view #division-panel > .simple-table-actions { grid-area: actions; }
#student-view #division-panel > .table-practice-details { grid-area: practice; }

.table-study-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #f7f5ff; color: var(--ink); }
.table-study-dialog::backdrop { background: #f7f5ff; }
.table-study-shell { width: min(900px, 100%); min-height: 100%; margin: auto; padding: clamp(18px, 4vw, 42px); display: grid; grid-template-rows: auto 1fr auto; gap: 24px; }
.table-study-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.table-study-header h2, .table-study-header p { margin: 0; }
.table-study-header h2 { margin-top: 4px; color: #4e2bc4; font-size: clamp(30px, 6vw, 54px); }
.table-study-close { min-width: 88px; min-height: 48px; border: 2px solid #d8d0ee; border-radius: 14px; background: #fff; color: #3f3560; font: inherit; font-weight: 900; cursor: pointer; }
.table-study-facts { align-self: center; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.table-study-fact { display: flex; justify-content: space-between; gap: 20px; padding: 13px 18px; border-radius: 14px; background: #fff; box-shadow: 0 5px 14px rgba(63,48,121,.08); font-size: clamp(22px, 4vw, 32px); font-weight: 850; }
.table-study-fact strong { color: #5d35cc; }
.table-study-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.table-study-actions button { min-height: 54px; }
body.table-study-open { overflow: hidden; }

.weekly-feature-card {
  margin: 0 0 16px;
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  border-left: 5px solid var(--purple);
}

.weekly-feature-card [data-weekly-entry-progress] {
  display: block;
  margin-top: 8px;
  color: var(--green-dark);
}

.weekly-marker { background: #f3efff; border-color: #ded3ff; color: #5b3ea2; }
.weekly-study-screen { width: 100%; min-height: 70vh; padding: 24px; overflow-wrap: anywhere; }
.weekly-study-screen:focus { outline: 0; }
.weekly-header, .weekly-activity-toolbar { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.weekly-header > div, .weekly-activity-toolbar > div { flex: 1; min-width: 0; }
.weekly-header h2, .weekly-header p { margin: 3px 0; }
.weekly-session-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.weekly-session-card, .weekly-activity-card, .weekly-completion, .weekly-summary-section {
  padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow);
}
.weekly-session-card { display: grid; gap: 14px; }
.weekly-session-card h3, .weekly-session-card ul { margin: 0; }
.weekly-session-card li { margin: 6px 0; }
.weekly-session-card.is-complete { border-color: var(--green); }
.weekly-card-top, .weekly-progress-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.weekly-day, .weekly-subject-label { color: var(--purple); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.weekly-session-card progress, .weekly-question-progress { width: 100%; height: 12px; accent-color: var(--green); }
.weekly-complete-label { margin: 0; color: var(--green-dark); font-weight: 800; text-align: center; }
.weekly-activity-toolbar div { display: flex; justify-content: space-between; gap: 10px; }
.weekly-activity-card { max-width: 780px; margin: 18px auto; display: grid; gap: 22px; }
.weekly-lesson, .weekly-question { display: grid; gap: 14px; }
.weekly-lesson h3, .weekly-question h3, .weekly-lesson p, .weekly-example p { margin: 0; white-space: pre-line; line-height: 1.55; }
.weekly-example, .weekly-worked { padding: 14px; border-radius: 14px; background: #f5f2ff; }
.weekly-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.weekly-choice { min-height: 52px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.weekly-choice:hover, .weekly-choice.selected { border-color: var(--blue); background: #eef6ff; }
.weekly-choice.selected { box-shadow: 0 0 0 2px rgba(47, 128, 237, .18); }
.weekly-choice.selected.correct { border-color: var(--green); background: #effcf7; color: var(--green-dark); }
.weekly-choice:disabled { opacity: .48; cursor: default; }
.weekly-input-label { display: grid; gap: 8px; font-weight: 800; }
.weekly-input-label input, .weekly-input-label textarea { width: 100%; min-height: 52px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; font: inherit; font-size: 18px; }
.weekly-order-selected { min-height: 52px; padding: 14px; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); cursor: pointer; }
.weekly-order-selected.has-answer { color: var(--ink); border-style: solid; }
.weekly-order-help, .weekly-saved-note, .weekly-retry-label { margin: 0; color: var(--muted); }
.weekly-feedback-card { display: grid; gap: 12px; margin-top: 14px; padding: 16px; border-radius: 16px; border: 2px solid var(--gold); background: #fffbeb; }
.weekly-feedback-card.success { border-color: var(--green); background: #effcf7; }
.weekly-feedback-card p { margin: 0; line-height: 1.5; }
.weekly-completion { max-width: 820px; margin: 20px auto; text-align: center; }
.weekly-completion-stats, .weekly-parent-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.weekly-parent-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.weekly-completion-stats article, .weekly-parent-overview article { display: grid; gap: 5px; padding: 16px; border-radius: 14px; background: #f6f9fc; }
.weekly-completion-stats strong, .weekly-parent-overview strong { font-size: 22px; }
.weekly-completion-actions { display: flex; justify-content: center; gap: 12px; }
.weekly-topic-list { display: grid; gap: 8px; }
.weekly-topic-list article { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.weekly-response { margin-top: 12px; padding: 14px; border-radius: 12px; background: #f6f9fc; }
.weekly-response p { white-space: pre-wrap; }
.weekly-reset-button, .weekly-reset-confirm { min-height: 44px; padding: 10px 16px; border: 2px solid #a33; border-radius: 12px; background: #fff; color: #8a2525; font-weight: 800; }
.weekly-reset-dialog { max-width: 480px; padding: 22px; border: 0; border-radius: 18px; color: var(--ink); }
.weekly-reset-dialog::backdrop { background: rgba(7, 17, 31, .5); }
.weekly-reset-dialog form div { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 700px) {
  #student-view > .practice-setup-card { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  #student-view .simple-start-practice-button { grid-column: 1; min-height: 92px; }
  .simple-section-heading { display: grid; gap: 2px; }
  .simple-tool-card { min-height: 0; grid-template-columns: 70px minmax(0, 1fr); padding: 17px; }
  .tool-visual { width: 70px; height: 76px; border-radius: 17px; }
  .tool-visual svg { width: 55px; height: 55px; }
  .student-tabs.simple-bottom-nav { gap: 4px; padding: 6px; overflow: hidden; }
  .student-tabs.simple-bottom-nav button { min-width: 0; padding-inline: 4px; font-size: 12px; }
  #student-view .math-helper { padding: 16px; }
  .table-mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-mode-tabs button { padding-inline: 9px; font-size: 14px; }
  .table-reader-list,
  #student-view #multiplication-panel > .table-reader .table-reader-list,
  #student-view #division-panel > .table-reader .table-reader-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-reader-list button { min-width: 0; }
  .table-expand-button { width: 46px; height: 46px; flex-basis: 46px; }
  #student-view #multiplication-panel {
    grid-template-columns: 1fr;
    grid-template-areas: "picker" "reader" "actions" "practice";
  }
  #student-view #multiplication-panel > .table-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #student-view #division-panel { grid-template-columns: 1fr; grid-template-areas: "picker" "reader" "actions" "practice"; }
  #student-view #division-panel > .table-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .table-study-facts { grid-template-columns: 1fr; }
  .table-study-actions { grid-template-columns: 1fr; }
  .table-study-header { align-items: flex-start; }
  #student-view .math-helper .helper-header { display: grid; gap: 10px; }
  .table-header-badges { justify-content: flex-start; }
  .weekly-feature-card { grid-template-columns: 1fr; }
  .weekly-feature-card .dashboard-card-marker { display: inline-flex; }
  .weekly-study-screen { padding: 14px; }
  .weekly-header { align-items: flex-start; flex-wrap: wrap; }
  .weekly-header > div { flex-basis: calc(100% - 100px); }
  .weekly-session-grid, .weekly-parent-overview { grid-template-columns: 1fr; }
  .weekly-activity-card, .weekly-session-card, .weekly-completion, .weekly-summary-section { padding: 18px; border-radius: 16px; }
  .weekly-completion-stats { grid-template-columns: 1fr; }
  .weekly-completion-actions, .weekly-topic-list article { flex-direction: column; }
  .weekly-completion-actions button { width: 100%; }
  .weekly-activity-toolbar { align-items: flex-start; }
  .weekly-activity-toolbar div { display: grid; text-align: right; }
  .weekly-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekly-choice { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 340px) {
  .weekly-choice-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .top-subject-control .subject-card-grid {
    grid-template-columns: 1fr;
  }

  .top-subject-control .subject-card {
    min-height: 58px;
  }

  .simple-tool-card { grid-template-columns: 62px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .tool-visual { width: 62px; height: 68px; }
  .tool-visual svg { width: 49px; height: 49px; }
  .simple-tool-card h3 { font-size: 18px; }
}

@media (max-width: 840px) {
  .side-nav.simple-sidebar-nav {
    display: none;
  }

  .student-tabs.simple-bottom-nav {
    display: grid;
  }
}
