:root {
  color-scheme: light;
  --ink: #1d2340;
  --muted: #65708b;
  --line: #e2e6f0;
  --paper: #ffffff;
  --canvas: #f6f7fb;
  --navy: #27336d;
  --blue: #3659ce;
  --blue-soft: #edf1ff;
  --teal: #157765;
  --teal-soft: #e9f7f3;
  --amber: #9c5c09;
  --amber-soft: #fff4df;
  --red: #a73545;
  --red-soft: #fff0f1;
  font-family: ui-rounded, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(226, 232, 255, 0.45), transparent 34rem),
    var(--canvas);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #89a1ff;
  outline-offset: 3px;
}

a {
  color: var(--blue);
}

.screen-app {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
  padding: 0 max(1.25rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(226, 230, 240, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 850;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-button {
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 700;
}

.nav-button:hover,
.nav-button.active {
  background: var(--blue-soft);
  color: var(--navy);
}

.page-content {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.75fr);
  gap: 1.25rem;
  align-items: stretch;
}

.hero-copy,
.hero-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 15px 40px rgba(39, 51, 109, 0.045);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(circle at 92% 17%, rgba(117, 143, 255, 0.16) 0 72px, transparent 73px),
    linear-gradient(132deg, #fff 12%, #f5f7ff 100%);
}

.hero-copy::after {
  position: absolute;
  right: 7%;
  bottom: -96px;
  width: 185px;
  height: 185px;
  border: 1px solid rgba(54, 89, 206, 0.1);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

.hero h1 {
  max-width: 670px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.15rem, 5vw, 3.7rem);
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 580px;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.65rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 0.91rem;
  font-weight: 750;
  text-align: center;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(39, 51, 109, 0.1);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  background: var(--navy);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: #1c285d;
}

.button-secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--navy);
}

.button-small {
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  border-color: var(--line);
  background: #fff;
  color: var(--navy);
  font-size: 0.83rem;
}

.button-danger {
  flex: 0 0 auto;
  border-color: #efc3c8;
  background: #fff;
  color: var(--red);
}

.button-card {
  width: 100%;
  min-height: 42px;
  margin-top: 1rem;
  border-color: #e8ebf3;
  background: #f7f8fc;
  color: var(--navy);
}

.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.7rem;
  background: var(--navy);
  color: #fff;
}

.hero-card .eyebrow {
  color: #cbd4ff;
}

.hero-number {
  margin-top: 0.15rem;
  font-size: 3.1rem;
  letter-spacing: -0.06em;
  line-height: 1;
}

.hero-card > span {
  margin-top: 0.4rem;
  color: #d6dcf8;
  font-size: 0.85rem;
}

.hero-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.3rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #d6dcf8;
  font-size: 0.81rem;
}

.hero-stat-row strong {
  color: #fff;
  text-align: right;
}

.privacy-strip,
.privacy-callout {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.25rem 0 2.7rem;
  padding: 1rem 1.2rem;
  border: 1px solid #cce9df;
  border-radius: 17px;
  background: var(--teal-soft);
  color: #23594e;
}

.privacy-strip p,
.privacy-callout p {
  flex: 1;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.privacy-strip strong,
.privacy-callout strong {
  color: #125747;
}

.privacy-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 10px;
  background: #d3eee5;
  color: var(--teal);
  font-size: 0.6rem;
}

.text-button {
  padding: 0.3rem 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-block {
  scroll-margin-top: 100px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.page-heading h1,
.content-panel h2,
.privacy-panel h2 {
  margin: 0;
  color: var(--navy);
  letter-spacing: -0.035em;
}

.section-heading h2 {
  font-size: 1.8rem;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 1rem;
}

.section-heading.compact h2 {
  font-size: 1.42rem;
}

.section-note,
.page-heading > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.6;
}

.section-note {
  margin: 0 0 1.6rem;
}

.segmented-control {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eceff6;
}

.segmented-control button {
  min-height: 39px;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.segmented-control button.selected {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(39, 51, 109, 0.08);
}

.subject-section {
  margin: 1.55rem 0 2rem;
}

.subject-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.8rem;
}

.subject-heading h3,
.curriculum-subject h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.13rem;
}

.subject-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
}

.subject-dot.english {
  background: #bb6b30;
}

.subject-dot.science {
  background: var(--teal);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.lesson-card,
.content-panel,
.stat-card,
.privacy-panel,
.curriculum-level,
.completion-panel,
.learning-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(39, 51, 109, 0.035);
}

.lesson-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.15rem;
}

.lesson-card-top,
.lesson-card-footer,
.lesson-heading-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.lesson-card-top,
.lesson-card-footer {
  justify-content: space-between;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0.27rem 0.55rem;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 0.69rem;
  font-weight: 800;
}

.tag-preview {
  background: var(--amber-soft);
  color: var(--amber);
}

.duration,
.subject-label {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 650;
}

.lesson-card h4 {
  margin: 0.85rem 0 0.45rem;
  color: var(--navy);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.lesson-card > p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.lesson-card-footer {
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.topic {
  line-height: 1.4;
}

.last-score {
  flex: 0 0 auto;
  color: var(--teal);
  font-weight: 800;
}

.page-heading {
  max-width: 760px;
  margin: 0 0 1.45rem;
}

.page-heading h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.page-heading > p:not(.eyebrow) {
  margin: 0.65rem 0 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  padding: 1.15rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-card strong {
  margin-top: 0.4rem;
  color: var(--navy);
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.content-panel {
  margin: 1rem 0;
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.empty-state {
  margin: 0;
  padding: 0.8rem 0;
  color: var(--muted);
  line-height: 1.55;
}

.suggestion-list,
.record-list {
  display: grid;
  gap: 0.65rem;
}

.suggestion-card,
.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.suggestion-card:first-child,
.record-row:first-child {
  border-top: 0;
}

.suggestion-card strong {
  color: var(--navy);
}

.suggestion-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.record-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.record-title > div {
  min-width: 0;
}

.record-title strong,
.record-title small {
  display: block;
}

.record-title strong {
  color: var(--navy);
}

.record-title small {
  margin-top: 0.2rem;
  color: var(--muted);
}

.record-metrics {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}

.record-metrics > strong {
  font-size: 1.2rem;
}

.score-good {
  color: var(--teal);
}

.score-review {
  color: var(--amber);
}

.privacy-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.4rem;
}

.privacy-panel h2 {
  font-size: 1.27rem;
}

.privacy-panel p:not(.eyebrow) {
  max-width: 620px;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.curriculum-level {
  margin: 1rem 0;
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.curriculum-level > p {
  color: var(--muted);
  line-height: 1.5;
}

.preview-level {
  border-color: #eddcb9;
  background: #fffcf6;
}

.curriculum-subject {
  margin: 1rem 0;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
}

.source-list {
  display: grid;
  gap: 0.8rem;
}

.source-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.source-row:first-child {
  border-top: 0;
}

.source-subject {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
}

.source-row p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.lesson-page {
  max-width: 850px;
  margin: 0 auto;
}

.lesson-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.back-button {
  padding: 0.45rem 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 750;
}

.lesson-heading {
  margin-bottom: 1.15rem;
}

.lesson-heading-meta {
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.lesson-heading h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.05em;
}

.lesson-heading > p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.lesson-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin: 1.3rem 0;
  padding: 0;
  list-style: none;
}

.lesson-steps li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem 0.45rem;
  border-bottom: 2px solid var(--line);
  color: #828ba1;
  font-size: 0.74rem;
  font-weight: 700;
}

.lesson-steps li span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 50%;
  background: #eceff6;
  color: var(--muted);
  font-size: 0.75rem;
}

.lesson-steps li.current {
  border-color: var(--blue);
  color: var(--navy);
}

.lesson-steps li.current span,
.lesson-steps li.complete span {
  background: var(--blue);
  color: #fff;
}

.lesson-steps li.complete {
  border-color: #bac6ff;
  color: var(--navy);
}

.learning-panel {
  padding: clamp(1.15rem, 4vw, 2rem);
}

.learning-panel h2,
.lesson-content h2 {
  margin: 0.1rem 0 0.6rem;
  color: var(--navy);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.learning-goal {
  margin: 0;
  color: var(--ink);
  font-size: 1.03rem;
  line-height: 1.6;
}

.learning-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.learning-card {
  padding: 1rem;
  border-radius: 15px;
  background: #f5f7fb;
}

.learning-card h3,
.worked-example h3 {
  margin: 0 0 0.4rem;
  color: var(--navy);
  font-size: 0.97rem;
}

.learning-card p,
.worked-example p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.worked-example {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid #dfe5ff;
  border-radius: 15px;
  background: var(--blue-soft);
}

.worked-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 11px;
  background: #dce4ff;
  color: var(--blue);
  font-weight: 900;
}

.worked-example .eyebrow {
  margin-bottom: 0.25rem;
  font-size: 0.64rem;
}

.gentle-reminder {
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.stage-intro {
  margin: 0.2rem 0 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.question-list {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.question-card {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.3rem);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.question-number {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question-card h3 {
  margin: 0.4rem 0 0.8rem;
  color: var(--navy);
  font-size: 1.02rem;
  line-height: 1.5;
}

input[type="text"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cfd5e2;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: #9299aa;
}

.answer-options {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 43px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  cursor: pointer;
}

.choice-option:has(input:checked) {
  border-color: #9baeff;
  background: #f2f4ff;
}

.choice-option input {
  accent-color: var(--blue);
}

.choice-letter {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 8px;
  background: #edf0f7;
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 800;
}

.hint-button {
  margin-top: 0.65rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hint-text {
  margin: 0.45rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #754d16;
  font-size: 0.84rem;
  line-height: 1.5;
}

.answer-feedback,
.inline-notice,
.inline-success {
  margin-top: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 11px;
  background: #f2f4fa;
  color: var(--ink);
}

.answer-feedback strong {
  color: var(--navy);
  font-size: 0.85rem;
}

.answer-feedback p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.answer-feedback.correct,
.inline-success {
  background: var(--teal-soft);
  color: #155e50;
}

.answer-feedback.try-again,
.inline-notice {
  background: var(--amber-soft);
  color: #80500f;
}

.parent-feedback {
  background: #f2f4fa;
}

.stage-next {
  margin-top: 0.9rem;
}

.stage-next .inline-success {
  margin: 0 0 0.85rem;
}

.confidence-control {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 480px;
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.confidence-control label {
  flex: 1;
}

.confidence-control select {
  width: auto;
  min-width: 150px;
}

.parent-rubric {
  margin-top: 0.8rem;
  padding: 0.9rem;
  border: 1px solid #e8d6b3;
  border-radius: 12px;
  background: #fffaf0;
}

.parent-rubric h4 {
  margin: 0;
  color: #754d16;
}

.parent-rubric ul {
  margin: 0.5rem 0;
  padding-left: 1.2rem;
  color: #755e3f;
  font-size: 0.8rem;
  line-height: 1.5;
}

.parent-rubric label,
.field-label {
  display: block;
  margin: 0.6rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.parent-rubric select {
  max-width: 260px;
}

.sample-answer {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.sample-answer summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 750;
}

.sample-answer p {
  margin-bottom: 0;
  line-height: 1.5;
}

.parent-key {
  margin-top: 1.1rem;
  padding: 1.2rem;
  border: 1px solid #e8d6b3;
  border-radius: 17px;
  background: #fffaf0;
}

.parent-key ol {
  padding-left: 1.3rem;
}

.parent-key li {
  margin: 0.7rem 0;
  line-height: 1.5;
}

.parent-key li p,
.parent-key li small {
  display: block;
  margin: 0.25rem 0;
  color: #755e3f;
}

.parent-key-toggle {
  margin: 0.6rem 0 1rem;
}

.completion-panel {
  padding: clamp(1.5rem, 5vw, 2.5rem);
  text-align: center;
}

.completion-panel h2 {
  margin: 0;
  color: var(--navy);
  font-size: 3.3rem;
  letter-spacing: -0.07em;
}

.completion-panel > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.completion-panel .inline-success,
.completion-panel .inline-notice {
  max-width: 520px;
  margin: 1rem auto;
}

.completion-panel .button-row {
  justify-content: center;
}

.completion-icon {
  display: grid;
  width: 55px;
  height: 55px;
  margin: 0 auto 0.7rem;
  place-items: center;
  border-radius: 19px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 1.5rem;
  font-weight: 900;
}

.scan-panel {
  max-width: 850px;
  margin-inline: auto;
}

.scan-panel .privacy-callout {
  display: block;
  margin: 0 0 1.1rem;
}

.scan-panel .privacy-callout p {
  margin-top: 0.25rem;
}

.scan-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.8rem 0;
}

.scan-upload > span {
  color: var(--muted);
  font-size: 0.77rem;
}

.scan-preview {
  display: block;
  width: min(100%, 520px);
  max-height: 420px;
  margin: 0.8rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f1f3f8;
  object-fit: contain;
}

.ocr-progress {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.8rem 0;
  color: var(--navy);
  font-size: 0.85rem;
}

.ocr-progress progress {
  width: min(180px, 35vw);
  accent-color: var(--blue);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #dce3ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ocr-result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 1.2rem 0 0.7rem;
}

.ocr-result-heading h2 {
  margin: 0;
  color: var(--navy);
}

.engine-label,
.confidence-note {
  color: var(--muted);
  font-size: 0.73rem;
}

.transcript-details {
  margin: 0.65rem 0 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9faff;
}

.transcript-details summary {
  color: var(--navy);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
}

.transcript-details textarea {
  margin-top: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.79rem;
}

.scan-question {
  border-left: 3px solid #acbaff;
}

.confidence-note {
  margin: 0.35rem 0 0.6rem;
}

.confirmed-answer {
  margin-top: 0.7rem;
  color: var(--teal);
  font-size: 0.83rem;
}

.confirmed-answer > p {
  margin: 0.25rem 0;
  color: var(--muted);
}

.manual-grade {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.manual-grade .button-row {
  margin-top: 0.5rem;
}

.manual-entry-note {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.manual-entry-note h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.2rem;
}

.manual-entry-note > p {
  margin: 0.35rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.manual-question-list {
  margin-top: 0.8rem;
}

.scan-saved-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 13px;
  background: var(--teal-soft);
  color: #155e50;
}

.scan-saved-result h2 {
  margin: 0;
  font-size: 1.2rem;
}

.scan-saved-result p {
  line-height: 1.5;
}

.storage-notice {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0.75rem auto 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #80500f;
  font-size: 0.84rem;
  line-height: 1.5;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

.print-sheet {
  display: none;
}

@media (max-width: 760px) {
  .site-header {
    display: block;
    padding: 0.65rem 0.8rem 0.55rem;
  }

  .brand {
    margin-bottom: 0.55rem;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.15rem;
  }

  .nav-button {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.35rem;
    font-size: 0.72rem;
  }

  .page-content {
    width: min(100% - 1.25rem, 620px);
    padding-top: 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .hero-copy {
    padding: 1.65rem 1.25rem;
    border-radius: 22px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 0.94rem;
  }

  .hero-card {
    padding: 1.25rem;
    border-radius: 19px;
  }

  .hero-number {
    font-size: 2.55rem;
  }

  .privacy-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem 0.7rem;
    margin: 0.75rem 0 2rem;
    padding: 0.8rem;
  }

  .privacy-strip p {
    flex-basis: calc(100% - 42px);
    font-size: 0.79rem;
  }

  .privacy-strip .text-button {
    margin-left: 40px;
    font-size: 0.78rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: 1.55rem;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
  }

  .lesson-grid,
  .stat-grid,
  .learning-columns {
    grid-template-columns: 1fr;
  }

  .lesson-card {
    padding: 1rem;
  }

  .stat-grid {
    gap: 0.55rem;
  }

  .stat-card {
    min-height: 85px;
    padding: 0.9rem 1rem;
  }

  .stat-card strong {
    font-size: 1.45rem;
  }

  .suggestion-card,
  .record-row {
    align-items: flex-start;
  }

  .record-row {
    flex-direction: column;
  }

  .record-metrics {
    justify-items: start;
    text-align: left;
  }

  .privacy-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .lesson-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .lesson-steps li {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.25rem;
    padding-inline: 0.15rem;
    font-size: 0.65rem;
    text-align: center;
  }

  .learning-panel {
    padding: 1.1rem;
  }

  .confidence-control {
    align-items: flex-start;
    flex-direction: column;
  }

  .confidence-control select {
    width: 100%;
  }

  .source-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .ocr-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .ocr-progress {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-footer {
    width: min(100% - 1.25rem, 620px);
    font-size: 0.72rem;
  }
}

@media (max-width: 390px) {
  .nav-button {
    font-size: 0.66rem;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .button {
    min-height: 43px;
    font-size: 0.85rem;
  }
}

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

@media print {
  @page {
    margin: 16mm;
    size: auto;
  }

  body {
    min-width: 0;
    background: #fff;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .screen-app {
    display: none !important;
  }

  .print-sheet {
    display: block !important;
    color: #111;
    font-size: 11pt;
    line-height: 1.45;
  }

  .print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid #27336d;
  }

  .print-header h1 {
    margin: 0;
    color: #27336d;
    font-size: 22pt;
  }

  .print-header .eyebrow {
    color: #3659ce;
  }

  .print-name {
    display: grid;
    gap: 1.1rem;
    min-width: 130px;
    color: #333;
    font-size: 10pt;
  }

  .print-name span {
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #777;
  }

  .print-example {
    margin: 0.8rem 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid #b8c2e8;
    background: #f7f8fc;
  }

  .print-example h2,
  .print-sheet > h2,
  .print-answer-key h2 {
    margin: 0.35rem 0;
    color: #27336d;
    font-size: 14pt;
  }

  .print-question {
    margin: 1rem 0;
    break-inside: avoid;
  }

  .print-question h3 {
    margin: 0 0 0.55rem;
    color: #111;
    font-size: 11.5pt;
  }

  .working-lines {
    min-height: 42px;
    background: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 20px,
      #b9beca 21px,
      transparent 22px
    );
  }

  .working-lines.more-lines {
    min-height: 100px;
  }

  .print-answer-key {
    margin-top: 1.5rem;
    padding-top: 0.8rem;
    border-top: 2px dashed #888;
    break-before: page;
  }

  .print-answer-key > ol {
    padding-left: 1.3rem;
  }

  .print-answer-key li {
    margin: 0.55rem 0;
    break-inside: avoid;
  }

  .print-answer-key ul {
    margin: 0.25rem 0;
  }

  .print-sheet footer {
    margin-top: 1.2rem;
    padding-top: 0.4rem;
    border-top: 1px solid #ccc;
    color: #555;
    font-size: 9pt;
  }
}
