:root {
  color-scheme: light;
  --navy-900: #12263a;
  --navy-800: #17324d;
  --navy-700: #244d6d;
  --teal-700: #0f6f69;
  --teal-600: #148078;
  --teal-100: #d9f2ee;
  --gold-500: #d7a52e;
  --gold-100: #fff4d0;
  --red-700: #a12e3d;
  --red-100: #fde7ea;
  --green-800: #165c45;
  --green-100: #dff3e8;
  --ink: #14212b;
  --muted: #596a75;
  --line: #d7e0e6;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --canvas: #e5edf2;
  --focus: #d98c00;
  --shadow: 0 12px 32px rgb(18 38 58 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--canvas);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
label:has(input:not(:disabled)) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--navy-900);
  line-height: 1.16;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.8rem, 8vw, 2.35rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

p {
  margin-bottom: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

small {
  line-height: 1.35;
}

code,
pre,
textarea {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  border-radius: 0.3rem;
  background: #eaf0f4;
  color: #23445d;
  padding: 0.08em 0.3em;
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  margin: 1rem 0 0;
  overflow-x: auto;
  border: 1px solid #304e66;
  border-radius: 0.75rem;
  background: var(--navy-900);
  color: #f5fbff;
  padding: 1rem;
  line-height: 1.55;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  translate: 0 -160%;
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--navy-900);
  padding: 0.75rem 1rem;
  font-weight: 800;
}

.skip-link:focus {
  translate: 0;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "header"
    "update"
    "content"
    "advertisement"
    "navigation";
  width: min(100%, 30rem);
  height: 100vh;
  height: 100dvh;
  margin-inline: auto;
  overflow: hidden;
  background: var(--surface-soft);
}

.app-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(4rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  padding: calc(0.5rem + env(safe-area-inset-top)) 0.75rem 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 2.75rem;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-right: 0.55rem;
  border-radius: 0.7rem;
  background: var(--navy-800);
  color: #a8ece3;
  font: 800 0.82rem/1 "Cascadia Code", monospace;
}

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

.brand strong {
  color: var(--navy-900);
  font-size: 0.92rem;
  line-height: 1.1;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.network-status {
  display: flex;
  align-items: center;
  min-height: 2rem;
  border-radius: 999px;
  background: #edf3f6;
  color: #40545f;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 750;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #21835e;
}

.network-status[data-online="false"] {
  background: var(--gold-100);
  color: #6d4b00;
}

.network-status[data-online="false"] .status-dot {
  background: #b16d00;
}

.icon-button,
.update-notice button {
  min-height: 2.75rem;
  border: 1px solid var(--navy-700);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--navy-800);
  padding: 0.45rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 800;
}

.update-notice {
  grid-area: update;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid #e3bd59;
  background: var(--gold-100);
  color: #583d00;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
}

main {
  grid-area: content;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}

.page {
  width: 100%;
  padding: 1.1rem 1rem 2rem;
}

.eyebrow {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--teal-700);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  border-radius: 999px;
  background: var(--teal-100);
  color: #0b5e59;
  padding: 0.3rem 0.65rem;
  font-size: 0.73rem;
  font-weight: 800;
}

.hero {
  margin: -1.1rem -1rem 1rem;
  background: var(--navy-800);
  color: #ffffff;
  padding: 1.5rem 1rem 1.25rem;
}

.hero .eyebrow {
  color: #8ee1d6;
}

.hero h1 {
  max-width: 18rem;
  color: #ffffff;
}

.hero > p {
  max-width: 25rem;
  color: #dceaf2;
}

.course-progress {
  margin-top: 1.35rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 7%);
  padding: 0.85rem;
}

.course-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
}

.course-progress progress,
.lesson-activity-progress progress {
  display: block;
  width: 100%;
  height: 0.48rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: #79d8cb;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #d8e1e7;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--teal-600);
}

.hero progress::-webkit-progress-bar {
  background: rgb(255 255 255 / 20%);
}

.hero progress::-webkit-progress-value {
  background: #8ee1d6;
}

.course-progress small {
  display: block;
  margin-top: 0.45rem;
  color: #cfe0e9;
}

.continue-card,
.plain-section,
.sync-card,
.certificate-card,
.access-card,
.bonus-card,
.settings-list,
.concept-card,
.task-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 5px 18px rgb(18 38 58 / 5%);
}

.continue-card {
  margin-bottom: 1rem;
  padding: 1rem;
}

.card-topline,
.section-heading,
.lesson-heading,
.lesson-actions,
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-topline > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-kicker {
  margin: 1rem 0 0.3rem;
  color: var(--teal-700);
  font-size: 0.78rem;
  font-weight: 800;
}

.continue-card h2 {
  font-size: 1.35rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin: 1rem 0;
  color: #40545f;
  font-size: 0.74rem;
  font-weight: 700;
}

.card-actions,
.completed-lesson-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 2.9rem;
  border-radius: 0.7rem;
  padding: 0.72rem 1rem;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--teal-700);
  background: var(--teal-700);
  color: #ffffff;
  box-shadow: 0 5px 12px rgb(15 111 105 / 18%);
}

.primary-button:hover:not(:disabled) {
  background: #0b5e59;
}

.secondary-button {
  border: 1px solid var(--navy-700);
  background: var(--surface);
  color: var(--navy-800);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--teal-700);
  padding-inline: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.wide {
  width: 100%;
}

.plain-section {
  padding: 1rem;
}

.section-heading {
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.learning-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learning-steps li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.75rem;
  padding: 0.8rem 0;
}

.learning-steps li + li {
  border-top: 1px solid var(--line);
}

.learning-steps li > span,
.number-badge {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  background: var(--teal-100);
  color: #0b5e59;
  font-size: 0.8rem;
  font-weight: 900;
}

.learning-steps strong {
  font-size: 0.9rem;
}

.learning-steps p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}

.sync-card {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
  border-color: #d5b65c;
  background: #fff9e8;
  padding: 0.85rem;
}

.sync-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gold-100);
  color: #755000;
  font-size: 1.2rem;
  font-weight: 900;
}

.sync-card strong {
  display: block;
  margin-bottom: 0.15rem;
  color: #583d00;
  font-size: 0.88rem;
}

.sync-card p {
  margin: 0;
  color: #725714;
  font-size: 0.78rem;
}

.lesson-page {
  padding-top: 0.75rem;
}

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

.back-button {
  flex: none;
  min-height: 2.75rem;
  font-size: 0.82rem;
}

.lesson-intro {
  margin-bottom: 1rem;
}

.learning-goal {
  border-left: 4px solid var(--teal-600);
  border-radius: 0 0.75rem 0.75rem 0;
  background: var(--teal-100);
  padding: 0.8rem 0.9rem;
}

.learning-goal strong {
  display: block;
  margin-bottom: 0.2rem;
  color: #0b5e59;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.learning-goal p {
  margin: 0;
  color: #294c4a;
  font-size: 0.85rem;
}

.lesson-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #e8eef2;
  padding: 0.25rem;
}

.lesson-tabs button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: #52646f;
  font-size: 0.82rem;
  font-weight: 800;
}

.lesson-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--navy-900);
  box-shadow: 0 2px 8px rgb(18 38 58 / 10%);
}

.lesson-panel {
  min-width: 0;
}

.concept-card,
.task-card {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.8rem;
  padding: 1rem;
}

.concept-card h2,
.task-card h2 {
  margin-top: 0.35rem;
}

.concept-card p,
.task-card p {
  font-size: 0.88rem;
}

.check-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #41545f;
  font-size: 0.82rem;
  line-height: 1.7;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 -1rem 0.8rem;
  overflow-x: auto;
  padding: 0 1rem 0.4rem;
  scrollbar-width: thin;
}

.editor-toolbar > span {
  flex: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.editor-toolbar button {
  flex: 0 0 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--navy-800);
  font-family: "Cascadia Code", monospace;
  font-weight: 900;
}

.code-editor-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.editor-block {
  min-width: 0;
  margin: 0;
}

.editor-block label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.editor-block label span {
  color: var(--navy-900);
  font-size: 0.82rem;
  font-weight: 900;
}

.editor-block label small {
  color: var(--muted);
  font-size: 0.7rem;
}

.editor-block textarea {
  display: block;
  width: 100%;
  min-height: 9.5rem;
  resize: vertical;
  border: 2px solid #a9b8c2;
  border-radius: 0.75rem;
  background: var(--navy-900);
  color: #f5fbff;
  padding: 0.9rem;
  font-size: 1rem;
  line-height: 1.55;
  tab-size: 2;
}

.editor-block textarea:focus {
  border-color: #78cfc4;
}

.editor-block-readonly textarea {
  border-color: #8396a3;
  background: #263b4f;
  color: #e2ebf0;
  cursor: default;
}

.editor-block-readonly label small {
  color: #52646f;
  font-weight: 750;
}

.draft-status {
  min-height: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.73rem;
}

.lesson-actions {
  align-items: stretch;
}

.lesson-actions > * {
  flex: 1 1 0;
}

.preview-header {
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.preview-header h2,
.preview-header p {
  margin-bottom: 0.2rem;
}

.preview-header p {
  font-size: 0.78rem;
}

.security-label {
  flex: none;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-800);
  padding: 0.35rem 0.55rem;
  font-size: 0.69rem;
  font-weight: 850;
}

.lesson-preview {
  display: block;
  width: 100%;
  min-height: 17rem;
  margin-bottom: 0.85rem;
  border: 2px solid #a9b8c2;
  border-radius: 0.85rem;
  background: #ffffff;
}

.feedback-region:not(:empty) {
  margin-top: 1rem;
}

.feedback-card {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.75rem;
  border: 1px solid;
  border-radius: 1rem;
  padding: 1rem;
}

.feedback-symbol {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 950;
}

.feedback-card h2 {
  margin-top: 0.2rem;
}

.feedback-card p {
  font-size: 0.84rem;
}

.feedback-error {
  border-color: #e4aeb5;
  background: var(--red-100);
}

.feedback-error .feedback-symbol {
  background: var(--red-700);
  color: #ffffff;
}

.feedback-success {
  border-color: #99cdb4;
  background: var(--green-100);
}

.feedback-success .feedback-symbol {
  background: var(--green-800);
  color: #ffffff;
}

.memory-note,
.sync-note {
  border-radius: 0.65rem;
  background: rgb(255 255 255 / 62%);
  padding: 0.7rem;
}

.lesson-activity-progress {
  display: grid;
  width: min(9rem, 48%);
  gap: 0.4rem;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
  padding: 0.75rem;
}

.lesson-activity-progress > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.lesson-activity-progress progress,
.completion-progress progress {
  display: block;
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: var(--teal-600);
}

section.lesson-step {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  padding: 1rem;
  box-shadow: 0 5px 18px rgb(18 38 58 / 5%);
}

section.lesson-step + section.lesson-step {
  margin-top: 0.8rem;
}

section.lesson-step > :last-child {
  margin-bottom: 0;
}

.beginner-example {
  margin: 0.9rem 0 1rem;
  border: 1px solid #9bcfc8;
  border-left: 4px solid var(--teal-600);
  border-radius: 0 0.85rem 0.85rem 0;
  background: #effaf8;
  padding: 0.85rem;
}

.beginner-example pre {
  margin: 0.65rem 0;
  padding: 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.example-intro {
  margin: 0.55rem 0 0;
}

.worked-example-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.worked-example {
  min-width: 0;
  border: 1px solid #b8d9d4;
  border-radius: 0.75rem;
  background: var(--surface);
  padding: 0.75rem;
}

.worked-example h3 {
  margin: 0 0 0.45rem;
  color: var(--navy-900);
  font-size: 0.9rem;
}

.worked-example pre {
  margin-top: 0;
}

.example-guide {
  margin-top: 0.75rem;
  border: 1px solid #d6c37a;
  border-radius: 0.75rem;
  background: #fffbea;
  padding: 0.75rem;
}

.example-guide h3 {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}

.example-guide ol {
  margin: 0;
  padding-left: 1.25rem;
}

.example-guide li + li {
  margin-top: 0.35rem;
}

.example-result {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
  padding: 0.75rem;
}

.example-result figcaption {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.example-heading-output,
.example-paragraph-output,
.example-explanation {
  margin: 0;
}

.example-heading-output {
  color: var(--navy-900);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.2;
}

.example-paragraph-output {
  color: var(--ink);
}

.example-explanation {
  padding-top: 0.7rem;
  font-size: 0.8rem;
}

.generic-example-output > :first-child {
  margin-top: 0;
}

.generic-example-output > :last-child {
  margin-bottom: 0;
}

.example-link-output {
  color: #075f9e;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.15em;
}

.example-learning-image {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
  border-radius: 0.65rem;
}

.element-anatomy {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.element-anatomy > div {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  padding: 0.65rem 0.75rem;
}

.element-anatomy span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: right;
}

.code-choice-list code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.code-choice-list .choice-code {
  white-space: pre-wrap;
}

.review-topic-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.review-topic {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-soft);
  padding: 0.8rem;
}

.review-topic > :last-child {
  margin-bottom: 0;
}

.review-topic h3 {
  font-size: 0.95rem;
}

.review-topic pre {
  margin: 0.65rem 0 0;
  padding: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.practice-prompt {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.fill-code {
  display: block;
  min-width: 0;
  margin: 0.75rem 0 1rem;
  border: 1px solid #8fa8ba;
  border-radius: 0.8rem;
  background: var(--navy-900);
  padding: 0.85rem;
  color: #f6fbff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 2.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.fill-code-text {
  white-space: pre-wrap;
}

.fill-blank {
  display: inline-block;
  max-width: 100%;
  margin: 0.15rem 0.2rem;
  vertical-align: middle;
  white-space: normal;
}

.fill-blank input,
.fill-blank select {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 2.75rem;
  border: 2px solid #77cfc4;
  border-radius: 0.55rem;
  background: #f8fffe;
  padding: 0.45rem 0.55rem;
  color: var(--navy-900);
  font: inherit;
  font-weight: 850;
}

.fill-blank input:focus-visible,
.fill-blank select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.fill-blank input[aria-invalid="true"],
.fill-blank select[aria-invalid="true"] {
  border-color: var(--red-700);
  background: #fff1f2;
}

.start-help {
  margin-bottom: 0.8rem;
  border: 1px solid #d2b250;
  border-radius: 0.75rem;
  background: #fff9e8;
  overflow: hidden;
}

.start-help summary {
  min-height: 2.75rem;
  padding: 0.75rem 0.85rem;
  color: #664800;
  font-weight: 850;
}

.start-help summary::marker {
  color: #9b6b00;
}

.start-help[open] summary {
  border-bottom: 1px solid #e3ca7f;
}

.start-help-content {
  padding: 0.8rem 0.85rem;
}

.start-help-content > :last-child {
  margin-bottom: 0;
}

.start-help-content ol {
  margin: 0 0 0.8rem;
  padding-left: 1.25rem;
  color: #5f4a16;
  line-height: 1.65;
}

.hint-tier-stack {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.hint-tier-list {
  display: grid;
  gap: 0.65rem;
}

.hint-tier-list .start-help {
  margin-bottom: 0;
}

.hint-tier-reveal {
  min-height: 2.75rem;
}

.hint-tier-note,
.hint-tier-complete {
  margin: 0;
  color: #725714;
  font-size: 0.74rem;
}

.hint-tier-complete {
  border-radius: 0.6rem;
  background: #fff9e8;
  padding: 0.65rem 0.75rem;
  font-weight: 750;
}

.hint-tier pre {
  margin-top: 0.65rem;
}

.choice-list {
  display: grid;
  min-inline-size: 0;
  gap: 0.65rem;
  margin: 0 0 0.9rem;
  border: 0;
  padding: 0;
}

.choice-card {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  border: 2px solid #a9b8c2;
  border-radius: 0.75rem;
  background: var(--surface);
  padding: 0.75rem;
  color: var(--ink);
  line-height: 1.45;
  text-align: left;
}

.choice-card:hover {
  border-color: var(--teal-600);
}

.choice-card:has(input:checked) {
  border-color: var(--teal-700);
  background: var(--teal-100);
}

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

.choice-card:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.65;
}

.choice-card input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--teal-700);
}

section.lesson-step .choice-card > span {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.choice-card code,
.choice-card small {
  overflow-wrap: anywhere;
}

.choice-card small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.token-bank {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 0;
  margin: 0.75rem 0;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #e8eef2;
  padding: 0.75rem;
}

.token-target {
  margin-bottom: 0.9rem;
  border: 1px solid #9bcfc8;
  border-radius: 0.75rem;
  background: #effaf8;
  padding: 0.75rem;
}

.token-target h3 {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.95rem;
}

.token-target ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.token-target li {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
}

.token-target code {
  overflow-wrap: anywhere;
}

.token-target p {
  margin: 0.7rem 0 0;
}

.token-button,
.token-build-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  max-width: 100%;
  min-height: 2.75rem;
  border: 1px solid #9aabb6;
  border-radius: 0.6rem;
  background: var(--surface);
  padding: 0.55rem 0.75rem;
  color: var(--navy-800);
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.token-button:hover:not(:disabled),
.token-build-item:hover:not(:disabled) {
  border-color: var(--teal-700);
  background: #f2fbf9;
}

.token-button code,
.token-build-item code {
  overflow-wrap: anywhere;
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: 800;
}

.token-build {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  min-height: 5rem;
  margin: 0.75rem 0;
  border: 2px dashed #8fa3af;
  border-radius: 0.8rem;
  background: var(--surface-soft);
  padding: 0.75rem;
}

.token-build:focus-within {
  border-color: var(--teal-600);
}

.token-build-item {
  border-color: #89bfb8;
  background: var(--teal-100);
  color: #0b5e59;
}

section.lesson-step .token-build-item > span {
  display: inline;
  color: #315d59;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 750;
}

.lesson-completion {
  min-width: 0;
  margin-bottom: calc(1rem + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  padding: 1rem;
  box-shadow: 0 5px 18px rgb(18 38 58 / 5%);
}

.completion-heading {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.completion-heading h1,
.completion-heading h2 {
  margin-bottom: 0;
}

.completion-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--green-800);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 950;
}

.completion-summary {
  margin-bottom: 1rem;
  color: #314651;
  font-size: 0.92rem;
}

.completion-progress {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-soft);
  padding: 0.8rem;
}

.completion-progress > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  color: var(--navy-900);
  font-size: 0.8rem;
}

.pending-reward {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  border: 1px solid #d5b65c;
  border-radius: 0.8rem;
  background: #fff9e8;
  padding: 0.8rem;
  color: #583d00;
}

.pending-reward > * {
  margin: 0;
}

.pending-reward p {
  color: #725714;
}

.completion-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  margin-top: 1rem;
}

.completion-actions > * {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
}

.next-lesson-card {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.8rem;
  border-left: 4px solid var(--teal-600);
  border-radius: 0 0.75rem 0.75rem 0;
  background: var(--teal-100);
  padding: 0.8rem 0.9rem;
}

.next-lesson-card > * {
  margin: 0;
}

.next-lesson-card strong {
  color: #0b5e59;
}

.curated-solutions {
  min-width: 0;
  margin-top: 0.8rem;
  border: 1px solid #9bcfc8;
  border-radius: 0.85rem;
  background: #f3faf8;
  padding: 0.9rem;
}

.curated-solutions h2 {
  margin: 0.25rem 0 0.5rem;
}

.curated-solutions-disclaimer {
  margin-bottom: 0.8rem;
  color: #315d59;
  font-size: 0.8rem;
}

.curated-solution-list {
  display: grid;
  gap: 0.65rem;
}

.curated-solution {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #add4cf;
  border-radius: 0.7rem;
  background: var(--surface);
}

.curated-solution summary {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  color: var(--navy-900);
  font-weight: 850;
}

.curated-solution[open] summary {
  border-bottom: 1px solid #c7dfdc;
}

.curated-solution-content {
  min-width: 0;
  padding: 0.8rem;
}

.curated-solution-content > :last-child {
  margin-bottom: 0;
}

.curated-solution-content p {
  font-size: 0.8rem;
}

.curated-code-block + .curated-code-block {
  margin-top: 0.8rem;
}

.curated-code-block h4 {
  margin: 0 0 0.35rem;
  color: var(--navy-900);
  font-size: 0.78rem;
}

.curated-code-block pre {
  margin-top: 0;
  font-size: 0.78rem;
}

.status-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.page-title {
  margin-bottom: 1rem;
}

.page-title p {
  max-width: 27rem;
}

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

.stat-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
  padding: 0.8rem 0.55rem;
  text-align: center;
}

.stat-grid strong,
.stat-grid span {
  display: block;
}

.stat-grid strong {
  color: var(--navy-800);
  font-size: 1.2rem;
}

.stat-grid span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

.completed-lessons,
.lesson-library {
  margin-bottom: 1rem;
}

.learning-stage {
  min-width: 0;
  margin-bottom: 1.25rem;
  border: 1px solid #b9cbd5;
  border-radius: 1rem;
  background: #edf3f6;
  padding: 0.75rem;
}

.learning-stage.completed {
  border-color: #91c7bf;
  background: #e9f7f4;
}

.learning-stage.locked {
  border-color: #cdd8de;
  background: #f1f4f6;
}

.learning-stage-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.2rem 0.2rem 0;
}

.learning-stage-heading h2 {
  margin-bottom: 0;
}

.learning-stage-summary {
  margin: 0.65rem 0.2rem 0.8rem;
  font-size: 0.82rem;
}

.learning-stage-blocks {
  display: grid;
  min-width: 0;
  gap: 0.75rem;
}

.learning-stage .lesson-library {
  margin-bottom: 0;
  box-shadow: none;
}

.lesson-block + .lesson-block {
  margin-top: 0;
}

.learning-overview-status {
  margin: -0.15rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.path-lesson-list {
  display: grid;
  gap: 0.75rem;
}

.completed-lesson-card,
.path-lesson-card {
  min-width: 0;
  border: 1px solid #9bcfc8;
  border-radius: 0.85rem;
  background: var(--surface-soft);
  padding: 0.9rem;
}

.path-lesson-card.available {
  border-color: var(--line);
  background: var(--surface);
}

.path-lesson-card.locked {
  border-color: var(--line);
  background: #f1f4f6;
}

.path-lesson-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.path-lesson-heading > span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.completed-lesson-card h3,
.path-lesson-card h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1rem;
}

.completed-lesson-card p,
.path-lesson-card p {
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
}

.path-lesson-card .locked-reason {
  margin-bottom: 0;
  color: #52636d;
  font-weight: 750;
}

.achievement-card {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.9rem 0;
}

.stage-achievement-group {
  margin-top: 1rem;
}

.stage-achievement-group + .stage-achievement-group {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.achievement-card + .achievement-card {
  border-top: 1px solid var(--line);
}

.achievement-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: var(--teal-100);
  color: #0b5e59;
  font: 800 0.72rem/1 "Cascadia Code", monospace;
}

.achievement-card.locked {
  opacity: 0.7;
}

.achievement-card.locked .achievement-mark {
  background: #e9eef1;
  color: #53656f;
}

.achievement-card strong,
.achievement-card p,
.achievement-card .status-text {
  display: block;
}

.achievement-card strong {
  font-size: 0.86rem;
}

.achievement-card p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
}

.status-text {
  margin-top: 0.3rem;
  color: var(--teal-700);
  font-size: 0.7rem;
  font-weight: 850;
}

.certificate-card {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem;
}

.certificate-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--gold-100);
  color: #735000;
  font-size: 1.5rem;
}

.certificate-card p {
  margin: 0;
  font-size: 0.8rem;
}

.certificate-card.locked {
  opacity: 0.72;
}

.access-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.access-card p {
  margin-bottom: 0;
  font-size: 0.8rem;
}

.access-badge {
  flex: none;
  border-radius: 999px;
  background: var(--teal-100);
  color: #0b5e59;
  padding: 0.4rem 0.6rem;
  font-size: 0.69rem;
  font-weight: 850;
}

.mode-picker {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
  border: 0;
  padding: 0;
}

.mode-picker legend {
  margin-bottom: 0.55rem;
  color: var(--navy-900);
  font-size: 0.84rem;
  font-weight: 900;
}

.mode-picker label {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.7rem;
  min-height: 4.4rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
  padding: 0.8rem;
}

.mode-picker label:has(input:checked) {
  border: 2px solid var(--teal-600);
  background: #f3fbfa;
  padding: calc(0.8rem - 1px);
}

.mode-picker input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.1rem 0 0;
  accent-color: var(--teal-700);
}

.mode-picker strong,
.mode-picker small {
  display: block;
}

.mode-picker strong {
  margin-bottom: 0.2rem;
  font-size: 0.86rem;
}

.mode-picker small {
  color: var(--muted);
  font-size: 0.75rem;
}

.bonus-card {
  margin-bottom: 1rem;
  padding: 1rem;
}

.bonus-card p {
  font-size: 0.82rem;
}

.bonus-card.ad-free-bonus {
  border-color: #99cdb4;
  background: var(--green-100);
}

.fine-print,
.inline-message {
  margin: 0.6rem 0 0;
  font-size: 0.7rem !important;
}

.inline-message:not(:empty) {
  border-radius: 0.6rem;
  background: var(--gold-100);
  color: #654800;
  padding: 0.65rem;
}

.settings-list {
  padding: 0 1rem;
}

.settings-list > div {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.95rem 0;
}

.settings-list > div + div {
  border-top: 1px solid var(--line);
}

.settings-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  background: #eaf0f4;
  color: var(--navy-700);
  font-weight: 900;
}

.settings-list h2 {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
}

.settings-list p {
  margin: 0;
  font-size: 0.75rem;
}

.ad-slot {
  grid-area: advertisement;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 4.5rem;
  border-top: 1px solid #cfd9df;
  background: #f0f3f5;
  padding: 0.55rem 0.75rem;
}

.ad-label {
  border: 1px solid #8798a2;
  border-radius: 0.25rem;
  color: #53646e;
  padding: 0.18rem 0.3rem;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot p {
  margin: 0;
  color: #53646e;
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: center;
}

.bottom-nav {
  grid-area: navigation;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: calc(4rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
}

.bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.16rem;
  min-width: 0;
  min-height: 3.5rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: #5b6d77;
  padding: 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
}

.bottom-nav button > span:first-child {
  font: 850 1rem/1 "Cascadia Code", monospace;
}

.bottom-nav button[aria-current] {
  background: var(--teal-100);
  color: #0b5e59;
}

.learning-course-list {
  display: grid;
  gap: 0.9rem;
}

.learning-course-card {
  min-width: 0;
  border: 1px solid #b9cbd5;
  border-radius: 1rem;
  background: var(--surface);
  padding: 1rem;
}

.learning-course-card.completed {
  border-color: #91c7bf;
  background: #e9f7f4;
}

.learning-course-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.learning-course-heading h2 {
  margin: 0.2rem 0 0;
}

.learning-course-card > p {
  margin-block: 0.75rem;
  font-size: 0.84rem;
}

.learning-course-card .course-next {
  border-left: 3px solid var(--teal-600);
  padding-left: 0.65rem;
}

.course-back-button {
  margin-bottom: 0.8rem;
}

.course-progress {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.85rem;
  color: var(--navy-800);
  font-size: 0.78rem;
  font-weight: 800;
}

.course-progress progress {
  width: 100%;
  accent-color: var(--teal-600);
}

.course-recommendation,
.course-topics {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
  padding: 0.9rem;
}

.course-recommendation {
  border-color: #91c7bf;
  background: var(--surface-soft);
}

.course-recommendation h2 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1.05rem;
}

.course-recommendation p,
.course-topics > p {
  margin-bottom: 0.8rem;
  font-size: 0.82rem;
}

.lesson-topic {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
}

.lesson-topic.open {
  border-color: #8fbfb9;
}

.lesson-topic-heading {
  margin: 0;
  font-size: 1rem;
}

.lesson-topic-toggle {
  display: flex;
  width: 100%;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--navy-900);
  padding: 0.8rem;
  text-align: left;
}

.lesson-topic-toggle > span:first-child {
  min-width: 0;
}

.lesson-topic-title {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.25;
}

.lesson-topic-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
}

.topic-chevron {
  font-size: 1.25rem;
  line-height: 1;
  transform: rotate(-90deg);
}

.lesson-topic.open .topic-chevron {
  transform: rotate(0deg);
}

.lesson-topic-panel {
  border-top: 1px solid var(--line);
  background: #f5f8fa;
  padding: 0.75rem;
}

.path-lesson-card.recommended {
  border-color: #16847c;
  box-shadow: 0 0 0 2px rgb(22 132 124 / 10%);
}

.path-lesson-card.in-progress,
.path-lesson-card.selected {
  border-color: #c6942f;
  background: #fff9e8;
}

.path-lesson-card .recommended-knowledge {
  margin-top: -0.25rem;
  border-radius: 0.55rem;
  background: #edf3f6;
  color: #405764;
  padding: 0.6rem;
  font-size: 0.74rem;
}

@media (min-width: 31rem) {
  .app-shell {
    border-inline: 1px solid #cad6dd;
    box-shadow: var(--shadow);
  }

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

@media (max-width: 22rem) {
  .app-header {
    gap: 0.3rem;
    padding-inline: 0.5rem;
  }

  .brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    margin-right: 0.4rem;
  }

  .brand small {
    display: none;
  }

  .page {
    padding-inline: 0.75rem;
  }

  .hero {
    margin-inline: -0.75rem;
    padding-inline: 0.75rem;
  }

  .network-status {
    padding-inline: 0.4rem;
  }

  .icon-button {
    padding-inline: 0.45rem;
  }

  .lesson-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: no-preference) {
  button,
  .mode-picker label {
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  }
}

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