:root {
  color-scheme: light;
  --ink: #24354b;
  --muted: #526578;
  --paper: #fffaf3;
  --orange: #b34b13;
  --line: #e3e6e4;
  --teal: #186b70;
  --shadow: 0 8px 28px #25344908;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.55 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--teal);
  text-underline-offset: 3px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #176bcb;
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.3;
}
h3 {
  font-size: 1.12rem;
  line-height: 1.35;
}
small,
.muted {
  color: var(--muted);
}
.header,
.navigation,
main,
footer,
.storage-note {
  max-width: 1120px;
  margin: auto;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.account-link {
  margin-left: auto;
  color: var(--teal);
  font-weight: 650;
  text-decoration: none;
  font-size: 0.88rem;
}
#login-form {
  max-width: 540px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.45rem;
  font-weight: 750;
}
.brand img {
  object-fit: contain;
  border-radius: 50%;
}
.brand b {
  color: var(--orange);
}
.brand small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.progress-link {
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  background: white;
  border: 1px solid var(--line);
  padding: 10px 15px;
  border-radius: 30px;
  white-space: nowrap;
}
.progress-link span {
  color: var(--orange);
  margin-left: 7px;
}
.navigation {
  display: flex;
  gap: 6px;
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--line);
}
.navigation a {
  padding: 10px 21px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 650;
  color: var(--muted);
}
.navigation a[aria-current="page"] {
  background: #fde3cb;
  color: #843606;
}
main {
  min-height: 65vh;
  padding: 34px 24px 50px;
}
footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
.skip {
  position: absolute;
  left: 12px;
  top: -90px;
  background: white;
  padding: 10px;
  z-index: 10;
}
.skip:focus {
  top: 10px;
}
.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 750;
  color: var(--teal);
  margin-bottom: 12px;
}
.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  align-items: center;
  background: #fff0dc;
  border: 1px solid #f5dec0;
  border-radius: 28px;
  padding: 34px 38px;
  margin-bottom: 32px;
  overflow: hidden;
}
.hero p {
  max-width: 520px;
}
.hero img {
  max-width: 245px;
  width: 100%;
  height: auto;
  justify-self: center;
  mix-blend-mode: multiply;
}
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--orange);
  border-radius: 12px;
  padding: 11px 18px;
  background: var(--orange);
  color: white;
  text-decoration: none;
  font-weight: 650;
  min-height: 46px;
}
.button.secondary {
  background: white;
  color: var(--ink);
  border-color: #ccd4d8;
}
.button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--teal);
  padding: 8px 10px;
}
.button.small {
  font-size: 0.85rem;
  padding: 7px 12px;
  min-height: 38px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 16px;
}
.section-heading h2,
.section-heading p {
  margin: 0;
}
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.section-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
}
.section-card h2 {
  margin: 14px 0 8px;
}
.section-card p {
  margin-bottom: 12px;
}
.icon {
  display: inline-flex;
  border-radius: 12px;
  width: 43px;
  height: 43px;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  font-size: 1.3rem;
  background: #fff0dc;
  color: #9a440f;
}
.teal .icon {
  background: #dcf0ed;
  color: #176a65;
}
.purple .icon {
  background: #eee7fb;
  color: #7350a0;
}
.green .icon {
  background: #e7f2d9;
  color: #4b7025;
}
.section-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-weight: 650;
}
.section-meta a {
  text-decoration: none;
}
.strip {
  background: #e8f3ef;
  padding: 20px 24px;
  border-radius: 16px;
  margin: 24px 0;
}
.strip p:last-child {
  margin-bottom: 0;
}
.page-intro {
  max-width: 760px;
  margin-bottom: 25px;
}
.page-intro p {
  color: var(--muted);
}
.search-label {
  display: block;
  font-weight: 650;
  margin-bottom: 7px;
}
.search {
  width: 100%;
  max-width: 600px;
  border: 1px solid #b4c0c7;
  border-radius: 12px;
  padding: 12px 15px;
  background: white;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}
.filter {
  border: 1px solid #cbd4d5;
  background: white;
  border-radius: 30px;
  padding: 8px 14px;
  color: var(--ink);
  font-size: 0.88rem;
}
.filter[aria-pressed="true"] {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.topic-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: start;
}
.topic-card h2 {
  font-size: 1.14rem;
  margin: 12px 0 4px;
}
.topic-card p {
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.topic-card .button {
  margin-top: auto;
}
.badge {
  display: inline-block;
  border-radius: 6px;
  background: #edf2f4;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 650;
  color: #46596c;
}
.done {
  background: #e4f4df;
  color: #386024;
}
.visited {
  color: #6d5c3e;
  font-size: 0.8rem;
}
.breadcrumbs {
  font-size: 0.86rem;
  margin-bottom: 20px;
}
.lesson {
  max-width: 850px;
  margin: auto;
}
.lesson-heading {
  padding: 26px;
  background: #fff0dc;
  border-radius: 22px;
  margin-bottom: 22px;
}
.lesson-heading h1 {
  margin-top: 12px;
}
.lesson-heading ul {
  padding-left: 22px;
  margin-bottom: 0;
}
.scene {
  padding: 20px 24px;
  border-left: 4px solid #75a9a4;
  background: #eaf4f1;
  border-radius: 0 16px 16px 0;
  margin: 20px 0;
}
.english {
  font-weight: 650;
}
.lesson-block {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 25px;
  margin: 18px 0;
}
.formula {
  display: block;
  background: #f3f5f7;
  padding: 12px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 650;
  margin: 15px 0;
  overflow-wrap: anywhere;
}
.example {
  padding: 12px 0;
  border-top: 1px solid #edf0f0;
}
.example p {
  margin-bottom: 5px;
}
.example details {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 5px;
}
summary {
  cursor: pointer;
  width: fit-content;
}
.speak {
  border: 1px solid #d2dedf;
  background: white;
  border-radius: 8px;
  color: var(--teal);
  font-size: 0.8rem;
  padding: 5px 9px;
  margin-left: 8px;
}
.error-example {
  background: #fff4e8;
  border: 1px solid #f0d9bd;
}
.error-example del {
  color: #8d3939;
}
.checklist {
  margin-top: 18px;
  border: 0;
  padding: 0;
  min-width: 0;
}
.checklist legend {
  font-weight: 750;
  font-size: 1.12rem;
  margin-bottom: 10px;
}
.check-row {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 9px 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.check-row input {
  width: 19px;
  height: 19px;
  margin: 3px 0 0;
  accent-color: var(--teal);
  flex-shrink: 0;
}
.check-row.all {
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
  margin-bottom: 4px;
}
.test-summary {
  position: sticky;
  bottom: 10px;
  background: var(--ink);
  color: white;
  border-radius: 18px;
  padding: 17px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  box-shadow: 0 8px 25px #24354b25;
}
.test-summary p {
  margin: 0;
}
.test-summary small {
  color: #d6e2ed;
}
.test-summary .button {
  background: #ffe0b9;
  border-color: #ffe0b9;
  color: #77370e;
  white-space: nowrap;
}
.activity {
  max-width: 800px;
  margin: auto;
}
.activity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}
.meter {
  height: 7px;
  background: #e3e8e6;
  border-radius: 10px;
  margin: 15px 0 25px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: #39857c;
}
.question-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 23px;
  padding: 28px;
}
.question-card h1 {
  font-size: 1.5rem;
  letter-spacing: 0;
  line-height: 1.4;
  margin: 16px 0 24px;
}
.question-card fieldset {
  padding: 0;
  border: 0;
  margin: 0;
}
.question-card legend {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #cbd5d8;
  border-radius: 12px;
  padding: 13px 16px;
  margin: 10px 0;
  cursor: pointer;
}
.option:has(input:checked) {
  background: #ecf6f3;
  border-color: var(--teal);
}
.option input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  flex-shrink: 0;
}
.answer-input {
  width: 100%;
  border: 1px solid #9aadb7;
  padding: 13px 15px;
  border-radius: 12px;
}
.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 15px 0;
}
.word-bank button {
  background: #f1f5f7;
  border: 1px solid #c6d2d7;
  padding: 9px 13px;
  border-radius: 9px;
  color: var(--ink);
}
.ordered {
  min-height: 62px;
  background: #edf5f2;
  border: 1px dashed #8daea8;
  border-radius: 12px;
  padding: 16px;
  overflow-wrap: anywhere;
}
.feedback {
  margin-top: 20px;
  border-radius: 13px;
  padding: 18px;
  background: #e9f5e5;
  border: 1px solid #b9d7aa;
}
.feedback.retry {
  background: #fff1df;
  border-color: #ebca98;
}
.feedback p:last-child {
  margin: 0;
}
.hint {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff6e7;
}
.hint p {
  margin: 10px 0 0;
}
.activity-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.error {
  color: #a62828;
  font-weight: 600;
  margin: 12px 0;
}
.question-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}
.question-dots button {
  width: 35px;
  height: 35px;
  border: 1px solid #c8d4d7;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 0.8rem;
}
.question-dots button.answered {
  background: #dcf0e8;
}
.question-dots button[aria-current="step"] {
  border: 2px solid var(--teal);
  font-weight: 750;
}
.result-hero {
  background: #e7f2eb;
  padding: 30px;
  border-radius: 22px;
  margin-bottom: 24px;
}
.result-number {
  font-size: 2.7rem;
  line-height: 1;
  font-weight: 750;
  margin: 18px 0;
}
.result-list {
  display: grid;
  gap: 12px;
}
.result-topic {
  background: white;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.result-topic h3,
.result-topic p {
  margin: 0;
}
.review {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 12px 0;
}
.review summary {
  font-weight: 650;
}
.review p {
  margin: 12px 0 0;
}
.progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.progress-table th,
.progress-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  vertical-align: top;
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.storage-note {
  color: #9c3b24;
  padding: 0 24px;
  font-size: 0.88rem;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: 14px 20px;
  z-index: 9;
  max-width: 90%;
}
.empty {
  padding: 30px;
  border: 1px dashed #bfcdd1;
  border-radius: 16px;
}
.danger {
  color: #9e3030 !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 850px) {
  .topic-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero {
    padding: 28px;
  }
  .hero img {
    max-width: 190px;
  }
  .navigation a {
    padding: 10px 16px;
  }
}
@media (max-width: 600px) {
  .header {
    padding: 16px;
  }
  .brand {
    font-size: 1.1rem;
    gap: 6px;
  }
  .brand img {
    width: 42px;
    height: 42px;
  }
  .brand small {
    font-size: 0.6rem;
  }
  .progress-link {
    padding: 8px 10px;
    font-size: 0.76rem;
  }
  .navigation {
    padding: 0 12px 13px;
    gap: 1px;
    justify-content: space-between;
  }
  .navigation a {
    padding: 9px 10px;
    font-size: 0.83rem;
  }
  main {
    padding: 24px 16px 35px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 25px;
  }
  .hero img {
    max-width: 125px;
    grid-row: 1;
    justify-self: end;
    margin-bottom: 12px;
  }
  .hero .eyebrow {
    max-width: 150px;
  }
  .section-grid,
  .topic-grid {
    grid-template-columns: 1fr;
  }
  .section-card {
    padding: 22px;
  }
  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
  .lesson-heading,
  .lesson-block,
  .question-card {
    padding: 21px;
  }
  .test-summary {
    padding: 16px;
    flex-wrap: wrap;
    gap: 10px;
    position: static;
  }
  .test-summary .button {
    width: 100%;
  }
  .result-topic {
    align-items: start;
    flex-direction: column;
  }
  .activity-top {
    align-items: start;
  }
  .result-hero {
    padding: 24px;
  }
  .progress-table th,
  .progress-table td {
    padding: 12px 8px;
  }
  .speak {
    margin-left: 0;
    margin-top: 5px;
  }
  .actions .button {
    flex-grow: 1;
  }
  .question-card h1 {
    font-size: 1.25rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button,
  .topic-card,
  .section-card {
    transition:
      background 0.15s,
      box-shadow 0.15s;
  }
  .button:hover {
    filter: brightness(0.97);
  }
  .topic-card:hover {
    box-shadow: var(--shadow);
  }
}
