:root {
  color-scheme: light;
  --canvas: #fbf8f4;
  --surface: #fff;
  --ink: #282127;
  --muted: #625960;
  --edge: #e8dedb;
  --accent: #a92b46;
  --accent-dark: #801c37;
  --accent-soft: #fcebf0;
  --shadow: 0 12px 28px #4727310c;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.54;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-dark); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #215dad; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
h2 { font-size: clamp(1.18rem, 2vw, 1.42rem); letter-spacing: -.025em; }
h3 { font-size: 1.04rem; }
small { font-size: .76rem; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; padding: .7rem; clip-path: none; z-index: 10; top: .5rem; left: .5rem; background: white; }
.top { background: var(--surface); border-bottom: 1px solid var(--edge); }
.top-inner, .legend, .workspace, footer { width: min(1440px, 100% - 72px); margin: 0 auto; }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 86px; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; flex-shrink: 0; }
.brand-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); font-size: 1.6rem; }
.brand strong { display: block; font-size: 1.14rem; font-weight: 850; letter-spacing: .018em; }
.brand small { display: block; color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
nav a { padding: .6rem .75rem; border-radius: 10px; color: var(--muted); font-size: .9rem; font-weight: 700; text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent-dark); background: var(--accent-soft); }
nav small { display: block; font-size: .68rem; line-height: 1.1; }
.legend-wrap { position: sticky; top: 0; z-index: 5; background: #fffcf9; border-bottom: 1px solid var(--edge); }
.legend { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 66px; padding-block: .65rem; }
.legend-intro { flex-shrink: 0; font-size: .88rem; }
.legend-intro small { display: block; color: var(--muted); }
.legend-list { display: flex; gap: .32rem; align-items: center; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.legend-list li { border-radius: .38rem; padding: .18rem .42rem; font-weight: 750; font-size: .72rem; white-space: nowrap; }
.verb { --pos: #a9283d; --wash: #fce6e9; }
.noun { --pos: #1e4ab5; --wash: #e8efff; }
.adjective { --pos: #126046; --wash: #e5f5eb; }
.pronoun { --pos: #6327a5; --wash: #f2e9ff; }
.preposition, .conjunction { --pos: #88400d; --wash: #fff0d9; }
.article { --pos: #45566b; --wash: #edf0f5; }
.adverb { --pos: #125b5a; --wash: #e2f4f1; }
.legend-list li, .word { color: var(--pos); background: var(--wash); }
.switch { flex-shrink: 0; display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .45rem; border: 0; background: none; color: var(--ink); font-size: .78rem; }
.switch-track { position: relative; width: 34px; height: 19px; border-radius: 30px; background: var(--accent); }
.switch-track::after { content: ""; position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%; background: white; }
[aria-checked="false"] .switch-track { background: #71656c; }
[aria-checked="false"] .switch-track::after { right: 18px; }
.workspace { display: grid; grid-template-columns: minmax(228px, 275px) minmax(0, 1fr); gap: clamp(1.1rem, 3vw, 2.25rem); align-items: start; padding-top: 2rem; }
#stage { min-width: 0; scroll-margin-top: 135px; }
.dashboard { display: grid; gap: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--edge); border-radius: 17px; padding: 1.15rem; box-shadow: var(--shadow); min-width: 0; }
.panel-label { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.eyebrow { text-transform: uppercase; color: var(--accent-dark); letter-spacing: .12em; font-size: .69rem; font-weight: 850; }
.lesson-progress, .label { border-radius: 30px; padding: .15rem .5rem; background: var(--accent-soft); color: var(--accent-dark); font-weight: 750; font-size: .72rem; white-space: nowrap; }
.syllabus h2 { margin: .45rem 0 .7rem; }
#syllabus, #daily-list { list-style: none; margin: 0; padding: 0; }
#syllabus a { display: grid; grid-template-columns: 1.55rem minmax(0, 1fr) auto; align-items: center; gap: .45rem; margin: .15rem -.35rem; padding: .47rem .4rem; border-radius: 9px; color: var(--ink); font-size: .83rem; text-decoration: none; }
#syllabus a:hover, #syllabus a[aria-current="step"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 750; }
.lesson-number { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 7px; background: #f4eeed; color: #65515e; font-size: .73rem; font-weight: 750; }
.completed { color: #126046; font-weight: 800; }
.mastery-number { margin: .35rem 0 .1rem; color: var(--muted); }
.mastery-number strong { font-size: 1.8rem; color: var(--accent-dark); }
progress { display: block; width: 100%; height: .6rem; accent-color: var(--accent); }
.daily-icon { color: var(--accent); }
#daily-date { font-size: .76rem; color: var(--muted); margin: .25rem 0 .55rem; }
#daily-list li { display: flex; justify-content: space-between; align-items: center; gap: .4rem; min-height: 34px; font-size: .8rem; }
#daily-list a { min-width: 0; text-decoration: none; }
#daily-list a:hover { text-decoration: underline; }
#daily-list small { color: var(--muted); }
.hero { position: relative; overflow: hidden; isolation: isolate; min-height: 175px; display: flex; align-items: center; justify-content: space-between; padding: clamp(1.25rem, 3.5vw, 2.4rem); border-radius: 22px; background: linear-gradient(110deg,#7e1f3b,#a22c4d 63%,#ad3658); color: white; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; width: 420px; height: 240px; right: -95px; bottom: -133px; border: 1px solid #ffffff45; border-radius: 50%; transform: rotate(-22deg); box-shadow: 0 0 0 14px #ffffff12, 0 0 0 30px #ffffff15, 0 0 0 49px #ffffff13; pointer-events: none; }
.hero::after { right: -230px; bottom: auto; top: -170px; }
.hero .eyebrow { color: #ffe1e9; margin-bottom: .55rem; }
.hero h1 { font-family: Georgia, Cambria, serif; font-size: clamp(2rem, 5vw, 3.7rem); letter-spacing: -.046em; font-weight: 700; text-wrap: balance; }
.hero h1 + p { margin-top: .65rem; max-width: 42rem; color: #fff1f5; }
.hero-mark { padding-left: .65rem; font-size: clamp(1.4rem, 5vw, 3.4rem); color: #ffe1e9; }
.stage-stack { display: grid; gap: 1rem; margin-top: 1rem; }
.lesson-panel { padding: clamp(1rem, 2.8vw, 1.6rem); }
.lesson-panel > p { margin-top: .5rem; color: var(--muted); max-width: 77ch; }
.example { padding: .85rem 0; border-bottom: 1px solid var(--edge); }
.example:last-child { border-bottom: 0; padding-bottom: 0; }
.example-line { display: flex; align-items: flex-start; gap: .55rem; }
.words { display: flex; flex-wrap: wrap; align-items: baseline; gap: .19rem .27rem; }
.word { padding: .08rem .36rem; border-radius: 6px; border: 1px solid transparent; font-size: clamp(.92rem, 1.7vw, 1.13rem); font-weight: 760; line-height: 1.5; }
.word:hover, .word[aria-expanded="true"] { border-color: currentColor; }
.colors-off .word { background: transparent; color: var(--ink); }
.translation { margin-top: .34rem; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.speaker { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: .25rem; border: 1px solid var(--edge); border-radius: 9px; color: var(--accent-dark); background: #fff9fa; }
.speaker:hover { background: var(--accent-soft); }
.speaker svg { width: 17px; height: 17px; }
.why { background: #fff6e9; border-color: #efddc7; }
.why h2 { color: #714017; }
.dialogue { display: grid; gap: .15rem; }
.dialogue-name { margin-bottom: .35rem; color: var(--accent-dark); font-weight: 800; font-size: .78rem; }
.quiz fieldset { border: 1px solid var(--edge); border-radius: 10px; margin: .9rem 0; padding: .6rem .85rem .7rem; min-width: 0; }
.quiz legend { font-weight: 750; padding: 0 .25rem; }
.quiz label { display: flex; align-items: baseline; gap: .45rem; margin: .25rem 0; cursor: pointer; }
input[type="radio"] { accent-color: var(--accent); }
.quiz-result { color: var(--muted); font-size: .9rem; margin-top: .38rem; }
.quiz-result.correct { color: #126046; }
.quiz-result.incorrect { color: #8e2939; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.primary, .secondary, .filter { display: inline-flex; align-items: center; justify-content: center; padding: .45rem .7rem; border: 1px solid transparent; border-radius: 9px; font-size: .85rem; font-weight: 750; text-decoration: none; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary, .filter { background: white; border-color: var(--edge); color: var(--ink); }
.secondary:hover, .filter:hover, .filter[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.lesson-actions { justify-content: space-between; }
.lab-tools { display: grid; gap: .65rem; }
.search-row { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.search-row label { flex: 1 1 210px; }
.search-row small { display: block; margin-bottom: .25rem; font-weight: 750; }
input[type="search"], input[type="email"] { width: 100%; min-width: 0; padding: .54rem .7rem; border: 1px solid #aa9a9e; border-radius: 9px; color: var(--ink); background: white; }
.results-summary { color: var(--muted); font-size: .86rem; }
.verb-grid { display: grid; grid-template-columns: repeat(2,minmax(0, 1fr)); gap: .85rem; }
.verb-card { scroll-margin-top: 135px; }
.verb-card h2 { overflow-wrap: anywhere; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-subtitle { color: var(--muted); margin: .34rem 0 .66rem; overflow-wrap: anywhere; }
.forms { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; margin: .7rem 0; }
.forms > div { background: #f7f3f1; padding: .45rem; border-radius: 8px; min-width: 0; }
.forms dt { font-size: .71rem; color: var(--muted); }
.forms dd { margin: 0; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; overflow-wrap: anywhere; gap: .2rem; }
.forms strong { font-size: .88rem; }
.forms .speaker { min-width: 29px; min-height: 29px; }
.learned-button[aria-pressed="true"] { color: #126046; background: #e5f5eb; border-color: #a4d4bb; }
.verb-card .example { margin-bottom: .7rem; padding-bottom: .7rem; border-bottom: 1px solid var(--edge); }
.pager { justify-content: center; gap: .7rem; padding: .25rem 0; }
.card-study { padding: clamp(1rem, 4vw, 2rem); max-width: 780px; margin-inline: auto; width: 100%; }
.flash-front { min-height: 170px; display: grid; place-items: center; align-content: center; gap: .65rem; text-align: center; }
.flash-front h2 { font-family: Georgia, serif; color: var(--accent-dark); font-size: clamp(2.1rem, 6vw, 3.5rem); overflow-wrap: anywhere; }
.flash-back { border-top: 1px solid var(--edge); margin-top: .75rem; padding-top: .85rem; }
.flash-actions { justify-content: space-between; margin-top: .8rem; }
.print-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; margin: 1rem 0; }
.print-grid h2 { margin-top: .7rem; }
.signup label { display: block; margin-top: .55rem; }
.signup form > div { display: flex; gap: .6rem; max-width: 430px; }
.thanks { max-width: 500px; margin: 15vh auto; }
.thanks p { margin: .75rem 0; }
#word-tooltip { position: fixed; z-index: 20; max-width: min(260px, calc(100vw - 16px)); color: white; background: #33232c; padding: .42rem .62rem; border-radius: 8px; box-shadow: 0 4px 18px #29152138; font-size: .8rem; pointer-events: none; }
#word-tooltip span { display: block; color: #f7d9e3; font-size: .72rem; }
.toast { position: fixed; right: .8rem; bottom: .8rem; z-index: 15; max-width: min(350px, calc(100% - 1.6rem)); padding: .65rem .85rem; border: 1px solid var(--edge); border-radius: 10px; background: white; box-shadow: var(--shadow); }
footer { display: flex; justify-content: space-between; gap: .65rem; flex-wrap: wrap; padding-block: 2rem 1.1rem; color: var(--muted); font-size: .8rem; }
@media (max-width: 1090px) {
  .top-inner { flex-wrap: wrap; gap: .55rem; padding: .65rem 0; }
  .legend { flex-wrap: wrap; gap: .3rem .8rem; }
  .legend-list { order: 3; width: 100%; }
}
@media (max-width: 820px) {
  .top-inner, .legend, .workspace, footer { width: calc(100% - 32px); }
  .workspace { grid-template-columns: 205px minmax(0,1fr); gap: .8rem; }
  .verb-grid { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
  .workspace { display: flex; flex-direction: column; gap: 1rem; padding-top: .9rem; }
  #stage { order: -1; width: 100%; }
  .dashboard { width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
  .syllabus { grid-row: span 2; }
  .top-inner, .legend, .workspace, footer { width: calc(100% - 22px); }
  nav a { padding: .4rem .5rem; font-size: .76rem; }
  .legend-list li { font-size: .65rem; }
  .legend-intro small { display: none; }
  .hero { min-height: 135px; }
}
@media (max-width: 360px) {
  .dashboard, .print-grid { grid-template-columns: 1fr; }
  .syllabus { grid-row: auto; }
}
.interjection { --pos: #125b5a; --wash: #e2f4f1; }
.mobile-dashboard { display: none; }
#dashboard { scroll-margin-top: 145px; }
@media (max-width: 660px) {
  .mobile-dashboard { display: inline-block; margin-left: auto; font-size: .75rem; font-weight: 700; }
}
.word-group { display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; }
.word-role { color: var(--pos); font-size: .66rem; line-height: 1.2; font-weight: 700; }
.colors-off .word-role, .colors-off .legend-intro, .colors-off .legend-list { display: none; }
.colors-off .legend { min-height: 0; justify-content: flex-end; padding-block: .28rem; }
.builder-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: .65rem; margin-block: .85rem .45rem; }
.builder-controls label { display: grid; gap: .24rem; font-size: .82rem; font-weight: 700; min-width: 0; }
.builder-controls select { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: white; border: 1px solid #aa9a9e; border-radius: 9px; padding: .45rem; }
.builder-vocab { padding-block: .55rem; border-bottom: 1px solid var(--edge); }
.builder-vocab summary { cursor: pointer; font-weight: 750; }
.builder-vocab h3 { margin-top: .65rem; }
.builder-vocab ul { columns: 2 185px; padding-left: 1.2rem; margin-block: .35rem .6rem; }
.lesson-phrase { padding-block: .4rem .85rem; border-bottom: 1px solid var(--edge); }
.lesson-phrase:last-child { border-bottom: 0; padding-bottom: 0; }
.phrase-walkthrough { margin-top: .55rem; padding: .65rem .8rem; border-radius: 9px; background: var(--accent-soft); }
.phrase-walkthrough summary { cursor: pointer; font-weight: 750; color: var(--accent-dark); }
.phrase-walkthrough ol { margin: .55rem 0 .15rem; padding-inline-start: 1.35rem; }
.phrase-walkthrough li + li { margin-top: .5rem; }
.phrase-walkthrough p { color: var(--muted); }
.builder-result { margin-top: .45rem; }
.sentence-map { display: flex; flex-wrap: wrap; gap: .5rem; margin: .55rem 0; }
.sentence-map > div { background: #f7f3f1; padding: .3rem .5rem; border-radius: 8px; }
.sentence-map dt { font-weight: 750; font-size: .72rem; color: var(--muted); }
.sentence-map dd { margin: 0; font-size: .9rem; }
.builder-explanation { padding: .55rem .7rem; border-radius: 9px; background: var(--accent-soft); }
.builder-explanation p { color: var(--muted); }

.cognate-chapter h3 { margin-top: 1rem; }
.cognate-chapter ul { padding-inline-start: 1.3rem; }
.cognate-chapter li + li { margin-top: .35rem; }
.cognate-chapter table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: .65rem; }
.cognate-chapter th, .cognate-chapter td { padding: .4rem .3rem; border-bottom: 1px solid var(--edge); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.cognate-chapter span { font-weight: 750; }
.cognate-chapter .action-red { color: #a9283d; }
.cognate-chapter .thing-blue { color: #1e4ab5; }
.cognate-chapter .desc-green { color: #126046; }
.cognate-chapter .who-purple { color: #6327a5; }
.cognate-chapter .glue-orange { color: #88400d; }
.colors-off .cognate-chapter span { color: inherit; }

.possessive { --pos: #45566b; --wash: #edf0f5; }
.phrase-steps { display: grid; gap: .55rem; margin: .65rem 0 0; }
.phrase-steps dt { font-weight: 750; }
.phrase-steps dd { margin: .12rem 0 0; color: var(--muted); }
.action-steps { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-block: .3rem .6rem; }
.action-steps > span { font-size: .88rem; }
.action-steps .speaker, .cognate-chapter li > .speaker { margin-inline-start: .35rem; vertical-align: middle; }

.starter-mode .workspace { display: block; max-width: 900px; }
.starter-mode .dashboard, .starter-mode .mobile-dashboard { display: none; }
.starter-path summary { cursor: pointer; font-weight: 750; }
.starter-path ol { display: grid; gap: .35rem; margin-bottom: 0; }
.starter-path [aria-current="step"] { font-weight: 800; }
.starter-turn { border-bottom: 1px solid var(--edge); padding-bottom: .6rem; }
#beginner-view .why ol { padding-inline-start: 1.4rem; }
#beginner-view .why li + li { margin-top: .75rem; }
#beginner-view .why li p { margin-top: .16rem; color: var(--muted); }
#beginner-view select { display: block; width: min(100%, 24rem); margin-top: .3rem; padding: .45rem; border: 1px solid var(--edge); border-radius: 8px; font: inherit; }
.starter-actions { justify-content: flex-end; }
