.learning-theme {
  --canvas: #f8f5ef;
  --line: #e3dfd4;
  --ink: #26352e;
}
.learning-theme .study-library { max-width: 800px; }
.book-intro {
  display: grid;
  grid-template-columns: clamp(82px, 19vw, 144px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(17px, 4vw, 34px);
  padding: clamp(18px, 5vw, 36px);
  border: 1px solid #e8dfd1;
  border-radius: 22px;
  background: radial-gradient(ellipse at 5% 0%, #f5ead9, transparent 70%), #fdfbf7;
}
.book-intro img, .login-book-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px 6px 6px 3px;
  box-shadow: 3px 5px 14px #38271838;
}
.book-intro-copy h1 {
  margin: 6px 0 9px;
  font-size: clamp(1.7rem, 5.5vw, 3rem);
  line-height: 1.14;
}
.book-intro-copy p { margin: 0; color: #675b4e; line-height: 1.5; }
.book-intro-copy p:first-child { color: #8e4e3d; font-weight: 750; font-size: .82rem; }
.book-intro-copy p[lang=en] { font-family: Georgia, serif; font-size: clamp(.95rem, 2.9vw, 1.25rem); }
.library-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin: 19px 0 13px;
  border-radius: 12px;
  background: #ede9df;
}
.library-modes a {
  display: grid;
  place-items: center;
  padding: 7px;
  min-height: 44px;
  border-radius: 9px;
  color: #514c43;
  font-size: .94rem;
  font-weight: 750;
  text-decoration: none;
}
.library-modes a[aria-current] { background: #fffdf8; color: #783b2e; box-shadow: 0 1px 3px #39271824; }
.library-tools { display: flex; flex-wrap: wrap; gap: 5px 20px; align-items: center; margin: 0 2px 12px; }
.library-tools a { display: inline-flex; align-items: center; min-height: 40px; font-size: .92rem; font-weight: 650; }
.study-tools-page h1 { margin-block: 14px; }
.study-tool-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 13px 16px; }
.study-tool-row > div { min-width: 0; overflow-wrap: anywhere; }
.study-tool-row small { display: block; color: var(--muted); margin: 4px 0; }
.study-tool-row summary { padding-block: 5px; font-size: .85rem; }
.study-tool-row p { margin: 4px 0; font-size: .85rem; }
.study-tool-row a { flex-shrink: 0; }
.mistake-pages { display: flex; gap: 16px; justify-content: center; margin-top: 12px; }
.learning-theme .mistake-book { max-width: 650px; }
.mistake-book .back-link { margin-bottom: 12px; }
.mistake-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px; }
.mistake-header h1 { margin: 0; font-size: clamp(1.65rem, 5vw, 2.3rem); }
.mistake-header .button { padding-inline: 14px; white-space: nowrap; }
.mistake-statuses { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.mistake-statuses a { display: flex; align-items: center; gap: 5px; min-height: 44px; font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; }
.mistake-statuses a[aria-current] { color: #245a4d; border-color: #367360; }
.mistake-statuses small { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .76em; }
.mistake-units { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
.mistake-units a { display: grid; place-items: center; min-height: 36px; padding-inline: 10px; border-radius: 7px; text-decoration: none; font-size: .8rem; color: #46544d; }
.mistake-units a[aria-current] { color: #245a4d; background: #e5efea; font-weight: 750; }
.mistake-words { list-style: none; border: 1px solid var(--line); background: #fffdf9; border-radius: 15px; padding: 0; margin: 12px 0; }
.mistake-word { padding: 14px 15px; overflow-wrap: anywhere; }
.mistake-word + .mistake-word { border-top: 1px solid var(--line); }
.mistake-word-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.mistake-word h2 { margin: 2px 0; font-size: 1.12rem; line-height: 1.35; }
.mistake-meta, .mistake-gloss { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.55; }
.mistake-action { min-height: 40px; padding-inline: 12px; }
.mistake-text-link { font-size: .86rem; }
.mistake-details summary { font-size: .82rem; padding: 8px 0 0; cursor: pointer; min-height: 38px; }
.mistake-example { margin-block: 7px; padding: 8px 10px; border-radius: 8px; background: #f2f5f1; }
.mistake-example p { margin: 5px 0; font-size: .86rem; }
.mistake-example .mistake-meta { font-size: .76rem; }
.mistake-incorrect { color: #813e3b; }
.mistake-correct { color: #245a4d; }
.mistake-empty { padding: 25px 10px; text-align: center; color: var(--muted); font-size: .9rem; }
.library-units {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}
.library-units li + li { border-top: 1px solid var(--line); }
.library-unit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 11px clamp(11px, 4vw, 23px);
  text-decoration: none;
  border-radius: inherit;
}
.library-units li:first-child .library-unit { border-radius: 15px 15px 0 0; }
.library-units li:last-child .library-unit { border-radius: 0 0 15px 15px; }
a.library-unit:hover { background: #f4eee3; }
.library-unit-number { font-size: .83rem; font-weight: 800; color: #854936; white-space: nowrap; }
.library-unit-title { display: grid; gap: 4px; }
.library-unit-title strong { font-size: .98rem; line-height: 1.3; overflow-wrap: anywhere; }
.library-unit-title small, .library-unit.is-closed { color: var(--muted); }
.library-unit-arrow { font-size: 1.45rem; color: #7c6b57; }
.learning-theme .learner-login .login-intro { background: #294139; }
.login-book-cover { justify-self: start; width: min(145px, 37%); margin-top: 21px; }
@media (max-width: 640px) {
  .learning-theme .learner-login .login-intro {
    grid-template-columns: minmax(0, 1fr) min(84px, 31%);
    column-gap: 15px;
  }
  .login-intro .login-book-cover { grid-column: 2; grid-row: 1 / 4; width: 100%; margin: 0; align-self: center; }
}

.learning-theme .course-directory,
.learning-theme .unit-study-home,
.learning-theme .focus-vocabulary {
  max-width: 640px;
}

.directory-heading { margin-bottom: 24px; }
.directory-heading h1 {
  margin: 0 0 7px;
  font-size: clamp(1.85rem, 5vw, 2.65rem);
  line-height: 1.18;
  letter-spacing: -.025em;
}
.directory-heading p:not(.kicker) { margin: 0; color: var(--muted); }
.directory-heading .kicker { letter-spacing: .03em; }
.directory-units { list-style: none; margin: 0; padding: 0; }
.directory-unit + .directory-unit { margin-top: 9px; }
.directory-unit > a, .directory-unit > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px 17px;
  align-items: center;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  padding: 13px 17px;
  color: var(--ink);
  text-decoration: none;
}
.directory-unit > a:hover { border-color: #8dae78; background: #fbfdf8; }
.directory-unit-closed > div { background: #edf2e9; color: var(--muted); }
.directory-number {
  border-radius: 9px;
  padding: 7px 9px;
  background: var(--mint);
  color: var(--leaf);
  font-size: .86rem;
  font-weight: 750;
  white-space: nowrap;
}
.directory-unit-text { display: grid; gap: 5px; }
.directory-unit-text strong { line-height: 1.28; overflow-wrap: anywhere; font-size: 1.04rem; }
.directory-unit-text small, .course-activity p { color: var(--muted); font-size: .88rem; }
.directory-arrow { font-size: 1.55rem; color: var(--leaf); }
.directory-mode-actions { grid-column: 3; justify-self: end; }
.learning-theme .directory-mode-actions .button {
  min-height: 44px; padding: 8px 12px; white-space: nowrap;
  background: var(--mint); color: var(--leaf); border: 1px solid var(--line); box-shadow: none;
}
.learning-theme .directory-mode-actions .button:hover { background: #dcefd5; }
.course-activity { margin-top: 18px; padding: 0 5px; }
.course-activity > summary { padding-block: 12px; min-height: 44px; }
.course-activity p { margin-block: 7px 12px; line-height: 1.5; }

.learning-theme .unit-main-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: clamp(18px, 5vw, 28px);
}
.learning-theme .unit-main-task h2 { font-size: 1.45rem; margin-bottom: 6px; }
.unit-main-task p { color: var(--muted); margin: 0; }
.unit-main-task .unit-progress { width: 100%; font-size: .88rem; }
.unit-main-task .learning-progress { height: 8px; }
.unit-main-task .button { margin-top: 3px; }
.unit-main-task .secondary-link { justify-self: center; text-underline-offset: 3px; font-size: .88rem; padding: 7px; }
.unit-secondary-tasks { margin-top: 15px; border-bottom: 1px solid var(--line); }
.unit-secondary-tasks form { margin: 0; }
.unit-task-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 9px 6px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.25;
  text-decoration: none;
  text-align: left;
}
a.unit-task-link:hover, button.unit-task-link:hover { background: var(--mint); }
button.unit-task-link { cursor: pointer; }
.unit-task-link small { margin-left: auto; color: var(--muted); text-align: right; }
.unit-task-link span { margin-left: auto; color: var(--leaf); font-size: 1.4rem; }
.unit-task-link small + span { margin-left: 0; }
.review-list { list-style: none; margin: 0; padding: 0; }
.review-list li { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.review-list li span { color: var(--muted); font-size: .88rem; }

.word-session { scroll-margin-top: 16px; }
.word-session p { display: flex; justify-content: space-between; margin: 0; gap: 10px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.word-session .learning-progress { height: 6px; margin-top: 8px; }
#word-step { font-variant-numeric: tabular-nums; }
.word-total { margin: 0; color: var(--muted); font-size: .82rem; text-align: center; }
.focus-vocabulary .vocab-stage { margin: 17px 0 12px; }
.focus-word {
  padding: clamp(16px, 4.5vw, 28px);
  border: 1px solid #d8e2e0;
  border-radius: 16px;
  background: #fff;
}
.word-head { display: grid; gap: 4px; }
.word-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.06;
  overflow-wrap: anywhere;
}
.word-head .word-pos { margin: 0; color: var(--muted); font-size: .96rem; }
.focus-vocabulary .word-meaning { margin: 21px 0 6px; line-height: 1.45; font-size: 1.24rem; font-weight: 730; overflow-wrap: anywhere; }
.focus-vocabulary .vocab-definition { margin: 6px 0 0; color: #3c5246; line-height: 1.55; overflow-wrap: anywhere; }
.word-usage { display: grid; gap: 8px; margin-top: 19px; }
.word-usage h3 { margin: 0; color: var(--ink); font-size: .93rem; }
.learning-theme .focus-vocabulary .word-usage blockquote {
  margin: 0;
  padding: 1px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.learning-theme .focus-vocabulary .word-usage .target-term { color: var(--leaf); font-weight: 800; text-decoration: none; }
.word-usage details summary { padding: 8px 0; font-size: .88rem; }
.word-usage .word-example {
  margin: 0;
  padding: 10px 12px;
  border-inline-start: 2px solid #aec3bd;
  background: #f5f8f7;
  border-radius: 0 8px 8px 0;
}
.word-usage .word-example + .word-example { margin-top: 4px; }
.word-example figcaption { margin-top: 5px; color: #55695f; font-size: .78rem; overflow-wrap: anywhere; }
.word-example a { color: #28564b; text-decoration: underline; }
.focus-vocabulary .rating-question { margin: 22px 0 9px; font-size: .9rem; color: var(--ink); font-weight: 700; }
.focus-vocabulary .vocab-ratings { margin: 0; gap: 7px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.focus-vocabulary .save-status { min-height: 0; margin: 8px 0 0; }
.focus-vocabulary .save-status:empty { display: none; }

.word-question h2, .word-outcome h2 { margin: 0 0 8px; font-size: 1.5rem; }
.word-question-instruction { margin: 0 0 10px; color: #485f58; font-size: .93rem; line-height: 1.5; }
.word-question-passage {
  background: #eff5f3;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.word-question-base { color: var(--muted); }
.word-options {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 16px 0;
  padding: 0;
  border: 0;
}
.word-options label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid #d8e2e0;
  border-radius: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.word-options input[type=radio] { position: absolute; inset-inline-start: 12px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.option-letter { flex: 0 0 25px; display: grid; place-items: center; height: 25px; border-radius: 5px; background: #edf2f1; color: #38554c; font-size: .76rem; font-weight: 750; }
.word-options label:has(input:enabled):hover { border-color: #8aa99f; }
.word-options label:has(input:focus-visible) { outline: 2px solid #2e6355; outline-offset: 2px; }
.word-options label:has(input:checked) { background: #edf5f2; border-color: #5c8d80; }
.word-options label:has(input:checked) .option-letter { background: #235a4c; color: #fff; }
.word-options label:has(input:disabled) { cursor: default; }
.focus-vocabulary .word-options label.option-correct, .focus-vocabulary .word-fill input.option-correct {
  background: #d8efcf; border-color: #568b48; color: #173f27;
}
.focus-vocabulary .word-options label.option-incorrect, .focus-vocabulary .word-fill input.option-incorrect {
  background: #f8d5d5; border-color: #ba6464; color: #682626;
}
.word-options label.option-incorrect .option-letter { background: #8e3c3c; color: #fff; }
.option-result { margin-left: auto; flex-shrink: 0; font-size: .78rem; font-weight: 750; }
.option-wording { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; min-width: 0; }
.option-headword { font-weight: 650; }
.option-pos { color: #475954; font-size: .8em; font-style: italic; font-weight: 550; }
.answer-word { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 0 0 7px; font-size: 1.25rem; }
.option-gloss { font-size: .88em; color: inherit; }
.word-feedback .word-outcome { padding: 0; margin-top: 13px; background: transparent; }
.word-feedback .word-outcome h2 { font-size: 1rem; }
.ipa { font-family: "Segoe UI", "Arial", sans-serif; font-size: .85em; font-weight: 500; color: #52665c; overflow-wrap: anywhere; }
.answer-pronunciation { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 7px; }
.textbook-drill .focus-word { border-radius: 12px; }
.textbook-drill .word-question-passage { background: #f4f5f1; line-height: 1.75; }
.drill-source { display: inline-block; margin-top: 0; padding: 5px 9px; border-radius: 7px; background: #edf2e9; color: var(--leaf); font-size: .82rem; }
@media (max-width: 570px) {
  .learning-theme .topbar nav.student-nav { display: flex; order: 3; width: 100%; gap: 20px; }
  .learning-theme .topbar:has(.student-nav) { row-gap: 0; }
  .learning-theme .topbar nav.student-nav a { min-height: 42px; }
}
.word-fill { display: grid; gap: 6px; margin: 16px 0; font-size: .94rem; }
.word-fill input { width: 100%; padding: 8px 11px; font: inherit; }
.word-question .button { margin-top: 3px; }
.word-outcome { padding: 15px; border-radius: 12px; background: #f2f5ee; overflow-wrap: anywhere; }
.word-outcome p { margin: 0; }
.word-outcome.word-correct { background: #eaf5e5; color: #16452b; }
.word-outcome.word-incorrect { background: #fff0e3; color: #783e22; }
.word-notes { margin-block: 10px; }
.word-notes summary { min-height: 44px; padding-block: 10px; }
.word-notes .word-meaning { margin-top: 12px; }
.word-notes .check-explanation { line-height: 1.55; margin: 4px 0 10px; }
.word-reference { margin-top: 11px; }
.word-reference p, .word-reference figure { margin: 0 0 10px; }
.word-reference a { color: var(--leaf); text-decoration: underline; overflow-wrap: anywhere; }
.word-next { margin-top: 13px; }

.learning-theme:has(.records-page) { background: #fff; }
.learning-theme .records-page {
  --records-ink: #292824;
  --records-muted: #66635d;
  --records-rule: #e5e3de;
  max-width: 920px;
  color: var(--records-ink);
}
.records-page h1 { margin: 0 0 clamp(15px, 3vw, 29px); font-size: clamp(1.56rem, 3.8vw, 2.16rem); line-height: 1.2; }
.records-month { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.records-month h2 { margin: 0; font-size: 1.08rem; }
.records-month nav { display: flex; gap: 3px; align-items: center; }
.records-month nav :is(a, span) { display: grid; place-items: center; min-height: 40px; border-radius: 4px; text-decoration: none; }
.records-arrow { width: 37px; font-size: 1.3rem; color: var(--records-ink); }
.records-month nav span { color: #a5a19a; }
.records-today { padding-inline: 9px; font-size: .81rem; color: var(--records-ink); }
.records-month nav a:hover { background: #f2f1ee; }
.records-metrics { display: flex; flex-wrap: wrap; gap: 4px clamp(15px, 3.4vw, 30px); margin: 5px 0 15px; font-size: .82rem; }
.records-metrics > div { display: flex; gap: 6px; align-items: baseline; }
.records-metrics dt { color: var(--records-muted); }
.records-metrics dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.records-calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.records-calendar th { height: 28px; padding: 0 7px 4px; text-align: left; color: var(--records-muted); font-weight: 500; font-size: .75rem; }
.records-calendar td { padding: 0; vertical-align: top; border: 1px solid var(--records-rule); }
.record-outside { background: #faf9f7; }
.record-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-height: 68px; height: 100%; padding: 6px 7px; text-decoration: none; color: var(--records-ink); font-variant-numeric: tabular-nums; }
.record-day:focus-visible { outline-offset: -3px; z-index: 1; }
.record-day.is-selected { background: #f3f2ef; box-shadow: inset 0 0 0 1px #8c887e; }
.record-day:hover:not(.is-selected):not(.is-future) { background: #f9f8f6; }
.record-day.is-future { color: #817e75; }
.record-date { font-size: .84rem; line-height: 1.4; }
.record-day.is-today .record-date { font-weight: 750; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #49745a; }
.record-entry { display: flex; align-items: center; min-width: 0; max-width: 100%; gap: 5px; color: #365343; }
.record-entry > span { width: 4px; height: 4px; border-radius: 50%; background: #4b785d; flex: 0 0 4px; }
.record-entry small { font-size: .69rem; overflow-wrap: anywhere; }
.records-detail { margin: 16px 0 0; padding: 11px 0 0; scroll-margin-top: 16px; }
.records-detail:focus { outline: none; }
.records-detail header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; }
.records-detail h2 { margin: 0; font-size: 1rem; }
.records-detail header p, .records-empty { margin: 0; font-size: .82rem; color: var(--records-muted); }
.records-empty { margin-top: 9px; }
.records-day-metrics { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 9px 0 0; font-size: .83rem; }
.records-day-metrics > div { display: flex; gap: 6px; }
.records-day-metrics dt { color: var(--records-muted); }
.records-day-metrics dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 630px) {
  .records-calendar th { text-align: center; padding-inline: 1px; }
  .record-day { align-items: center; min-height: 43px; padding: 6px 2px; gap: 5px; }
  .record-entry small { display: none; }
}

.word-search { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .9rem; }
.word-list { margin-top: 17px; border-bottom: 1px solid var(--line); }
.word-list-item { border-top: 1px solid var(--line); padding: 0 2px; scroll-margin-top: 75px; }
.word-list-item[open] { padding-bottom: 13px; }
.word-list-item summary { min-height: 47px; padding-block: 11px; overflow-wrap: anywhere; }
.word-list-item summary span { margin-left: 7px; }
.word-list-item summary small { margin-left: 5px; color: var(--muted); font-weight: 500; }
.focus-vocabulary .word-list-item .word-meaning { margin-top: 0; }

@media (max-width: 500px) {
  .directory-unit > a, .directory-unit > div { gap: 10px; padding-inline: 11px; }
  .directory-unit-text strong { font-size: .98rem; }
  .directory-mode-actions { grid-column: 2 / -1; }
  .word-question .button, .word-next { width: 100%; }
}
