:root {
  --ink: #183249;
  --navy: #164c78;
  --navy-deep: #103a5d;
  --coral: #f1745b;
  --yellow: #f7c95c;
  --green: #3f8568;
  --sky: #e8f4fb;
  --paper: #fffdf8;
  --line: #dbe5ea;
  --muted: #688095;
  --shadow: 0 18px 46px rgba(25, 56, 82, 0.09);
  --display: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", sans-serif;
  --body: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, rgba(22, 76, 120, .055) 1px, transparent 1.5px) 0 0 / 24px 24px,
    #f5f8fb;
  font-family: var(--body);
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(247, 201, 92, .9); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: white;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.1);
}
.brand b { display: block; font: 700 17px var(--display); letter-spacing: .02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); letter-spacing: .2em; }
.site-header nav { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.nav-pill {
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(24, 50, 73, .04);
}
.nav-pill:hover { border-color: #aac4d6; background: white; }
.nav-pill.accent { color: #a84b38; border-color: #f0b5a7; background: #fff4f0; }

.shell { width: min(1440px, calc(100% - 32px)); margin: 4px auto 64px; }
.home-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.course-sidebar, .course-main, .lesson-heading, .study-card, .practice-zone {
  border: 1px solid rgba(205, 218, 226, .9);
  background: rgba(255, 253, 248, .96);
  box-shadow: var(--shadow);
}
.course-sidebar { position: sticky; top: 16px; border-radius: 24px; padding: 19px 14px; }
.sidebar-title { display: flex; align-items: center; gap: 9px; font: 700 17px var(--display); color: var(--navy); }
.tiny-stamp { padding: 5px 6px; border-radius: 7px 7px 7px 2px; color: white; background: var(--coral); font: 800 10px var(--display); letter-spacing: .08em; }
.course-sidebar > p { margin: 7px 0 18px; color: var(--muted); font-size: 13px; }
.mode-note { padding: 13px; border-radius: 14px; color: #526b7b; background: var(--sky); font-size: 12px; line-height: 1.65; }
.course-choice { width: 100%; margin: 17px 0; padding: 15px 13px; display: flex; justify-content: space-between; gap: 8px; border: 1.5px solid #f0aa9c; border-radius: 17px; background: #fff6f1; text-align: left; cursor: pointer; }
.course-choice b, .course-choice small { display: block; }
.course-choice small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.course-choice em { align-self: center; color: var(--coral); font-style: normal; font-size: 11px; white-space: nowrap; }
.course-main { border-radius: 28px; padding: 20px; min-width: 0; }
.eyebrow { color: var(--navy); font: 800 11px var(--display); letter-spacing: .12em; }
.eyebrow.coral { color: var(--coral); }
.lesson-heading h1 { margin: 5px 0 3px; color: #152f45; font: 800 clamp(27px, 4vw, 39px) var(--display); letter-spacing: -.03em; }
.home-actions { margin-bottom: 16px; display: grid; grid-template-columns: max-content minmax(96px, 1fr) max-content; gap: 0; align-items: stretch; }
.home-actions.is-opened { grid-template-columns: 1fr; }
.continue-card { min-width: 0; margin: 0; padding: 15px 18px; grid-column: 1; display: flex; justify-content: flex-start; align-items: center; gap: 20px; border: 1px solid #cfe3d8; border-left: 6px solid var(--green); border-radius: 18px; background: #f2faf6; }
.continue-card small, .continue-card strong, .continue-card span { display: block; }
.continue-card small { color: var(--muted); }
.continue-card strong { margin: 3px 0; font: 700 17px var(--display); }
.continue-card span { color: var(--muted); font-size: 11px; }
.continue-card .button { flex: 0 0 auto; white-space: nowrap; }
.button { border: 1px solid transparent; border-radius: 999px; padding: 10px 17px; cursor: pointer; font-weight: 750; }
.button.green { color: white; background: var(--green); }
.button.primary { color: white; background: var(--navy); }
.button.ghost { border-color: var(--line); background: white; }
.button.outline { color: var(--green); border-color: #91bda5; background: #f2faf5; }
.button.completed { color: white; background: var(--green); }
.button.wide { width: 100%; border-radius: 13px; padding: 13px; }
.button:disabled { opacity: .55; cursor: wait; }

.unlock-banner { width: max-content; min-width: 0; margin: 0; padding: 13px 13px 13px 16px; grid-column: 3; display: grid; grid-template-columns: repeat(3, max-content); gap: 8px; align-items: stretch; border: 1px solid var(--line); border-left: 6px solid var(--coral); border-radius: 16px; background: white; }
.unlock-banner h2 { margin: 4px 0; font: 700 16px var(--display); }
.unlock-banner p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.unlock-banner > button { width: max-content; height: 100%; padding: 10px 11px; border: 1.5px solid #eaa491; border-radius: 13px; background: #fff7f3; text-align: left; cursor: pointer; }
.unlock-banner > button:last-child { border-color: #8eb8db; background: #f2f8ff; }
.unlock-banner button b, .unlock-banner button span { display: block; }
.unlock-banner button span { margin-top: 4px; color: var(--muted); font-size: 10px; }

.lesson-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lesson-card { min-width: 0; min-height: 136px; padding: 11px; display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; border: 1px solid var(--line); border-radius: 17px; background: white; transition: transform .18s ease, box-shadow .18s ease; }
.lesson-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(30, 58, 82, .1); }
.lesson-thumb { position: relative; width: 80px; aspect-ratio: 2480 / 3508; overflow: hidden; align-self: start; border-radius: 9px; background: white; }
.lesson-thumb img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.day-placeholder { height: 100%; display: grid; place-content: center; text-align: center; background: linear-gradient(150deg, #e4f3fb 0 52%, #fef4d9 52%); }
.day-placeholder span { color: var(--coral); font: 800 11px var(--display); letter-spacing: .12em; }
.day-placeholder b { color: var(--navy); font: 800 34px var(--display); }
.day-placeholder small { color: var(--muted); font-size: 10px; }
.completed-badge { position: absolute; right: 7px; top: 7px; padding: 4px 7px; border-radius: 99px; color: white; background: var(--green); font-size: 9px; }
.lesson-copy { min-width: 0; padding: 1px 0; display: flex; flex-direction: column; align-items: flex-start; }
.lesson-meta { color: var(--muted); font-size: 11px; line-height: 1.4; }
.lesson-meta span { margin-left: 4px; color: #9b6729; }
.lesson-card h3 { margin: 4px 0 2px; overflow: hidden; display: -webkit-box; font: 700 17px/1.25 var(--display); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.lesson-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.card-action { min-width: 92px; margin-top: auto; padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; background: white; cursor: pointer; font-size: 13px; font-weight: 750; text-align: center; }
.lesson-card:not(.is-locked) { border-color: #ecd39a; }
.lesson-card:not(.is-locked) .card-action { color: #9b6729; border-color: #e4c777; background: #fffaf0; }
.is-locked .card-action { color: #8b6b2e; border-color: #e6d2a3; background: #fffaf0; }

.lesson-shell { margin-top: 12px; }
.lesson-heading { min-height: 120px; padding: 20px; border-radius: 28px; display: flex; align-items: center; gap: 16px; }
.lesson-heading > div:nth-child(2) { flex: 1; }
.lesson-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.lesson-heading h1 { margin: 3px 0 0; font-size: 32px; }
.lesson-heading span { color: var(--muted); }
.back-button { width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--navy); background: var(--sky); cursor: pointer; font-size: 21px; }
.lesson-heading-actions { display: flex; gap: 8px; }
.study-card { margin-top: 18px; padding: 20px; border-radius: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr); gap: 17px; align-items: start; }
.page-tabs { margin-bottom: 13px; display: flex; gap: 8px; }
.page-tabs button { padding: 9px 15px; border: 1px solid var(--line); border-radius: 99px; background: white; cursor: pointer; font-weight: 700; }
.page-tabs .is-active { color: white; border-color: var(--navy); background: var(--navy); }
.page-image-button { position: relative; width: 84%; margin-inline: auto; padding: 8px; display: block; border: 1px solid var(--line); border-radius: 20px; background: #fff; cursor: zoom-in; }
.page-image-button img { width: 100%; display: block; border-radius: 14px; }
.page-image-button span { position: absolute; right: 18px; bottom: 18px; padding: 6px 9px; border-radius: 99px; color: white; background: rgba(16, 58, 93, .85); font-size: 10px; }
.missing-page { min-height: 520px; display: grid; place-content: center; gap: 6px; border: 1px dashed #9cbace; border-radius: 20px; text-align: center; background: linear-gradient(145deg, #f0f8fc, #fff8e9); }
.missing-page b { color: var(--navy); font: 800 32px var(--display); }
.missing-page span { font-weight: 700; }
.missing-page small { color: var(--muted); }
.passage-card { margin-top: 14px; padding: 19px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.interactive-passage { margin: 0; font: clamp(21px, 1.65vw, 25px)/1.68 var(--display); }
.inline-word { margin: 0 1px; padding: 0 3px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; cursor: pointer; font: inherit; line-height: 1.22; vertical-align: baseline; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.inline-word:hover { color: #bb4f39; background: #fff3dc; }
.inline-word.is-selected { color: #a6402d; background: #ffd785 !important; box-shadow: 0 0 0 2px rgba(241, 116, 91, .18); }
.highlight-peach { background: #ffd9c9 !important; }
.highlight-sky { background: #d9ecff !important; }
.highlight-mint { background: #dcf7e7 !important; }
.highlight-lilac { background: #eadbff !important; }
.translation-toggle { margin-top: 13px; padding: 7px 10px; border: 1px solid #c7d8e3; border-radius: 99px; color: var(--navy); background: var(--sky); cursor: pointer; }
.translation { padding: 12px 0 0; color: #536b7c; line-height: 1.8; }
.focus-words { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.focus-words > span { color: var(--muted); font: 800 10px var(--display); letter-spacing: .1em; }
.focus-words button { padding: 6px 9px; border: 1px solid transparent; border-radius: 9px; color: var(--navy); cursor: pointer; }

.listening-lab { position: sticky; top: 12px; padding: 18px; border: 1px solid #e9dfc6; border-radius: 23px; background: #fffaf0; }
.lab-label { color: #b67a22; font: 800 10px var(--display); letter-spacing: .09em; }
.audio-title { margin-top: 12px; display: flex; gap: 13px; align-items: center; }
.big-play { flex: 0 0 53px; height: 53px; border: 0; border-radius: 50%; color: white; background: var(--coral); cursor: pointer; font-size: 20px; }
.audio-title small, .audio-title h2, .audio-title p { margin: 0; }
.audio-title h2 { margin: 2px 0; font: 700 21px var(--display); }
.audio-title p { color: var(--muted); font-size: 11px; }
.audio-progress { margin: 16px 0 12px; display: grid; grid-template-columns: 34px 1fr 34px; gap: 7px; align-items: center; color: var(--muted); font-size: 10px; }
.audio-progress input { accent-color: var(--coral); }
.audio-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.audio-tools span { margin-right: 3px; color: var(--muted); font-size: 11px; }
.audio-tools button { padding: 6px 9px; border: 1px solid #e2d7c4; border-radius: 99px; background: white; cursor: pointer; font-size: 11px; }
.audio-tools .is-active { color: white; border-color: var(--navy); background: var(--navy); }
.sentence-panel { margin-top: 16px; padding: 14px; border: 1px solid #eadfca; border-radius: 17px; background: rgba(255, 255, 255, .7); }
.sentence-panel-head { margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.sentence-panel h3 { margin: 0; font: 700 17px var(--display); }
.sentence-panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.sentence-panel-head > button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #e4b29f; border-radius: 99px; color: #b84f37; background: #fff7f2; cursor: pointer; font-size: 10px; font-weight: 700; }
.sentence-panel ol { max-height: 282px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.sentence-panel li + li { margin-top: 6px; }
.sentence-panel li button { width: 100%; padding: 9px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px; align-items: center; border: 1px solid #e1e5e7; border-radius: 12px; background: white; cursor: pointer; text-align: left; line-height: 1.4; }
.sentence-panel li span { display: grid; place-items: center; color: var(--navy); border-radius: 8px; background: var(--sky); font-size: 9px; }
.sentence-panel li b { font-weight: 600; }
.sentence-panel li em { display: none; font-style: normal; font-size: 9px; font-weight: 700; white-space: nowrap; }
.sentence-panel li button.is-active { color: white; border-color: var(--navy); background: #233b68; }
.sentence-panel li button.is-active span { color: white; background: rgba(255, 255, 255, .18); }
.sentence-panel li button.is-active em { display: block; }
.vocab-panel h2 { margin: 18px 0 8px; font: 700 18px var(--display); }
.vocab-panel article { padding: 10px 4px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; border-bottom: 1px dashed #dfd5c1; }
.vocab-panel strong, .vocab-panel span { display: block; }
.vocab-panel strong { font: 700 14px var(--display); }
.vocab-panel span { color: var(--muted); font-size: 10px; }
.vocab-panel button { cursor: pointer; }
.vocab-main { padding: 0; border: 0; background: transparent; text-align: left; }
.vocab-speak { width: 35px; height: 35px; border: 1px solid #efd292; border-radius: 50%; background: #fff6dc; }
.vocab-explain { padding: 7px 10px; border: 0; border-radius: 99px; color: var(--navy); font-size: 10px; font-weight: 700; white-space: nowrap; }

.lookup-backdrop { position: fixed; z-index: 29; inset: 0; border: 0; background: rgba(12, 31, 45, .48); backdrop-filter: blur(3px); }
.lookup-panel { position: fixed; z-index: 30; right: 24px; top: 88px; width: min(430px, calc(100% - 32px)); min-height: 430px; max-height: calc(100vh - 112px); overflow: auto; padding: 24px; border: 0; border-radius: 22px; color: var(--ink); background: white; box-shadow: 0 28px 80px rgba(14, 40, 60, .28); }
.lookup-panel header { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.lookup-panel header h2 { margin: 0 0 4px; font: 800 30px var(--display); }
.lookup-panel header p { margin: 0; color: var(--muted); font-size: 12px; }
.lookup-panel header > div:last-child { display: flex; gap: 8px; }
.lookup-panel header button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff3c8; cursor: pointer; font-size: 17px; }
.lookup-pronunciation { margin: 28px 0 18px; padding-bottom: 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.lookup-pronunciation > div { display: flex; gap: 5px; }
.lookup-pronunciation button { padding: 8px 16px; border: 1px solid #d8e3ed; border-radius: 9px; color: var(--navy); background: #f4f8fc; cursor: pointer; font-weight: 700; }
.lookup-pronunciation button.is-active { color: white; border-color: var(--navy); background: var(--navy); }
.lookup-panel > p { color: #34495a; line-height: 1.7; }
.lookup-panel > p b { color: var(--ink); }
.lookup-meaning { padding: 13px 15px; display: flex; gap: 12px; align-items: center; border-radius: 13px; background: #fff7f2; }
.lookup-meaning strong { color: var(--coral); }
.lookup-context small { margin-top: 8px; display: block; color: var(--muted); font-size: 13px; }
.lookup-context small b { color: var(--muted); }
.lookup-save { margin-top: 10px; }

.practice-zone { margin-top: 18px; padding: 24px; border-radius: 28px; }
.practice-zone > header h2 { margin: 4px 0; font: 700 27px var(--display); }
.practice-zone > header p { margin: 0 0 18px; color: var(--muted); }
.question-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.question-card { padding: 17px; border: 1px solid #f1c7bd; border-radius: 18px; background: #fff8f5; }
.question-card small, .writing-card small { color: var(--coral); font-weight: 700; }
.question-card h3, .writing-card h3 { min-height: 46px; margin: 7px 0 12px; font: 700 16px/1.4 var(--display); }
.question-card > div { display: grid; gap: 7px; }
.question-card button { padding: 9px; display: flex; gap: 8px; align-items: center; border: 1px solid #eadbd6; border-radius: 11px; background: white; cursor: pointer; text-align: left; }
.question-card button b { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--coral); background: #fff0ec; font-size: 10px; }
.question-card .is-selected { border-color: var(--navy); }
.question-card .is-correct { border-color: #69a584; background: #edf9f2; }
.question-card .is-wrong { border-color: #e27c6a; background: #fff0ee; }
.writing-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.writing-card { padding: 24px; border: 1px solid #d6c7ed; border-radius: 18px; background: #faf7ff; }
.writing-card.green { border-color: #c8e2d1; background: #f4faf6; }
.writing-card.green small { color: var(--green); }
.writing-card h3 { min-height: auto; font-size: 24px; }
.word-bank { padding: 9px; border-radius: 10px; color: #67479c; background: white; font-weight: 700; }
.fill-lines p { line-height: 1.9; }
.inline-input { width: 105px; padding: 2px 5px; border: 0; border-bottom: 2px solid currentColor; background: transparent; }
.cloze-bank { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.cloze-bank button { padding: 10px 18px; border: 1px solid rgba(86, 113, 139, .18); border-radius: 999px; color: #253b6a; cursor: pointer; font: 700 18px var(--display); box-shadow: 0 4px 10px rgba(25, 56, 82, .06); transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease; }
.cloze-bank button:hover { transform: translateY(-2px); box-shadow: 0 7px 14px rgba(25, 56, 82, .1); }
.cloze-bank button.is-used { opacity: .55; box-shadow: none; }
.cloze-hint { margin: 12px 0 8px; color: var(--muted); font-size: 13px; }
.cloze-lines { padding-top: 2px; }
.cloze-lines p { margin: 7px 0; font: 20px/2.5 var(--display); }
.cloze-input { width: clamp(96px, 10vw, 140px); height: 44px; margin: 0 5px; padding: 7px 10px; border: 2px solid #a4c0ea; border-radius: 10px; color: #253b6a; background: white; text-align: center; font: 700 18px var(--display); vertical-align: middle; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease; }
.cloze-input.is-active { border-color: #2d7dea; box-shadow: 0 0 0 4px rgba(45, 125, 234, .14); }
.cloze-input.is-filled { background: #f6faff; }
.cloze-input.just-filled { transform: scale(1.035); }
.answer-actions { margin: 18px 0 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.answer-check-status { min-width: 260px; flex: 1; margin: 0 0 0 6px; color: var(--muted); font-size: 13px; }
.answer-check-status.is-warning { color: #a95542; }
.answer-check-status.is-success { color: #347454; font-weight: 700; }
.answer-card { padding: 18px; border: 1px solid #e5d7ad; border-radius: 18px; background: #fff9e7; }
.answer-card h3 { margin: 4px 0 12px; font: 700 21px var(--display); }
.answer-card p { color: #576e7f; }
.lesson-next { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.lesson-next button { padding: 10px 15px; border: 1px solid var(--line); border-radius: 99px; background: white; cursor: pointer; font-weight: 700; }

.print-shell { width: min(1120px, calc(100% - 32px)); margin-top: 16px; }
.print-toolbar { position: sticky; z-index: 8; top: 12px; margin-bottom: 16px; padding: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .96); box-shadow: 0 12px 32px rgba(48, 88, 67, .12); }
.print-version-switch { justify-self: center; padding: 4px; display: flex; gap: 4px; border-radius: 13px; background: #edf4ef; }
.print-version-switch button { padding: 10px 16px; border: 0; border-radius: 10px; color: #526c62; background: transparent; cursor: pointer; font-weight: 700; }
.print-version-switch button.is-active { color: white; background: var(--green); box-shadow: 0 5px 13px rgba(48, 88, 67, .16); }
.print-sheet { width: min(900px, 100%); margin: 0 auto; padding: 40px; border: 1px solid #d7e5dc; border-radius: 22px; background: white; box-shadow: 0 18px 46px rgba(48, 88, 67, .1); }
.print-sheet-heading { padding-bottom: 22px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid #dcebe1; }
.print-sheet-heading p { margin: 0 0 5px; color: #4a956f; font-size: 12px; font-weight: 800; }
.print-sheet-heading h1 { margin: 0; font: 800 36px/1.15 var(--display); }
.print-sheet-heading span { display: block; margin-top: 5px; color: var(--muted); }
.print-sheet-heading > strong { padding: 8px 13px; border-radius: 99px; color: #29434a; background: #f4c95d; white-space: nowrap; }
.print-reading { margin-top: 24px; display: grid; grid-template-columns: minmax(180px, 270px) minmax(0, 1fr); gap: 28px; align-items: start; }
.print-reading img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 10px; box-shadow: 0 7px 20px rgba(48, 88, 67, .1); }
.print-reading h2, .print-section > h2 { margin: 0 0 10px; color: #347454; font: 800 20px var(--display); }
.print-reading p { margin: 0; font: 18px/1.85 var(--display); }
.print-section { margin-top: 24px; }
.print-vocabulary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.print-vocabulary article { padding: 10px 12px; border-radius: 11px; background: #eef8f1; }
.print-vocabulary strong, .print-vocabulary span { display: block; }
.print-vocabulary span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.print-questions { display: grid; gap: 10px; }
.print-questions article { padding: 14px 16px; break-inside: avoid; border: 1px solid #eadfd6; border-radius: 13px; background: #fffaf6; }
.print-questions h3 { margin: 0; font: 700 15px/1.45 var(--display); }
.print-questions ol { margin: 9px 0 0; padding-left: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; color: #536b65; }
.print-writing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.print-writing { padding: 18px; break-inside: avoid; border: 1px solid #d6c7ed; border-radius: 15px; background: #faf7ff; }
.print-writing.green { border-color: #c8e2d1; background: #f4faf6; }
.print-word-bank { display: flex; flex-wrap: wrap; gap: 7px; }
.print-word-bank span { padding: 5px 10px; border-radius: 99px; color: #29434a; background: white; font-size: 12px; font-weight: 700; }
.print-fill-lines p { margin: 12px 0; line-height: 1.8; }
.print-blank { display: inline-block; min-width: 92px; margin-inline: 4px; border-bottom: 2px solid #29434a; color: transparent; }
.print-answer { margin: 10px 0 0; padding: 8px 10px; border-radius: 9px; color: #347454; background: #eaf5ed; font-size: 12px; font-weight: 700; }

.wordbook-shell { padding: 34px; border: 1px solid rgba(205, 218, 226, .9); border-radius: 28px; background: rgba(255, 253, 248, .96); box-shadow: var(--shadow); }
.wordbook-shell > h1 { margin: 7px 0 4px; font: 800 clamp(31px, 5vw, 48px) var(--display); }
.wordbook-shell > p { margin: 0 0 30px; color: var(--muted); }
.wordbook-list { display: grid; gap: 10px; }
.wordbook-entry { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 18px; background: white; }
.wordbook-entry h2 { margin: 0; font: 750 21px var(--display); }
.wordbook-entry h2 small { color: var(--muted); font-size: 13px; }
.wordbook-entry p { margin: 7px 0; }
.wordbook-entry p b { margin-right: 6px; color: var(--coral); }
.wordbook-entry span { color: var(--muted); font-size: 12px; }
.wordbook-speak { width: 42px; height: 42px; border: 1px solid #efd292; border-radius: 50%; background: #fff6dc; cursor: pointer; }
.wordbook-remove { padding: 9px 13px; border: 1px solid #e5d5d0; border-radius: 99px; color: #9b5e51; background: #fff8f5; cursor: pointer; }
.wordbook-empty { min-height: 260px; padding: 30px; display: grid; place-content: center; justify-items: center; gap: 10px; border: 1px dashed #b8cbd7; border-radius: 20px; color: var(--muted); background: #f8fbfd; text-align: center; }
.wordbook-empty b { color: var(--ink); font: 700 22px var(--display); }
.wordbook-empty .button { margin-top: 8px; }

.modal { width: min(580px, calc(100% - 28px)); padding: 27px; border: 0; border-radius: 25px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 80px rgba(14, 40, 60, .25); }
.modal::backdrop, .image-dialog::backdrop { background: rgba(12, 31, 45, .58); backdrop-filter: blur(5px); }
.modal.compact { width: min(440px, calc(100% - 28px)); }
.modal-close { position: absolute; right: 15px; top: 13px; width: 35px; height: 35px; border: 0; border-radius: 50%; background: var(--sky); cursor: pointer; font-size: 22px; }
.modal h2 { margin: 5px 0; font: 700 27px var(--display); }
.modal-copy p, .form-note { color: var(--muted); line-height: 1.7; }
.segmented { margin: 18px 0 13px; padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 13px; background: #eaf1f5; }
.segmented button { padding: 9px 5px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 12px; }
.segmented .is-active { color: white; background: var(--navy); }
.access-form label { display: grid; gap: 7px; color: #52687a; font-size: 12px; font-weight: 700; }
.access-form input { width: 100%; padding: 13px; border: 1px solid #c8d7e1; border-radius: 12px; background: white; }
.access-form .button { margin-top: 12px; }
.form-error { min-height: 20px; margin: 9px 0 0; color: #bc4a3c; font-size: 12px; }
.form-note { margin: 4px 0 0; font-size: 11px; }
.account-code { padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; border: 1px dashed #9bb9cc; border-radius: 15px; background: var(--sky); }
.account-code small { grid-column: 1 / -1; color: var(--muted); }
.account-code strong { color: var(--navy); font: 800 28px var(--display); letter-spacing: .08em; }
.account-code button { border: 0; color: var(--navy); background: transparent; cursor: pointer; font-weight: 700; }
.account-stats { margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.account-stats span { padding: 13px; border-radius: 13px; background: #f3f6f8; color: var(--muted); font-size: 11px; }
.account-stats b { display: block; color: var(--ink); font: 700 19px var(--display); }
.image-dialog { width: min(960px, calc(100% - 28px)); max-height: 92vh; padding: 12px; overflow: hidden; border: 0; border-radius: 18px; background: white; }
.image-dialog[open] { display: grid; place-items: center; }
.image-dialog img { width: auto; height: auto; max-width: 100%; max-height: calc(92vh - 24px); display: block; object-fit: contain; border-radius: 10px; }
.image-dialog button { position: absolute; z-index: 2; right: 14px; top: 14px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; font-size: 24px; box-shadow: 0 5px 16px rgba(14, 40, 60, .15); }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 17px; border-radius: 99px; color: white; background: var(--navy-deep); opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.loading-screen, .empty-state { min-height: 70vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.loading-dot { width: 28px; height: 28px; margin: 0 auto 12px; border: 4px solid #d5e6f1; border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
.empty-state h1 { color: var(--ink); font: 700 30px var(--display); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1060px) {
  .lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .home-shell { grid-template-columns: 1fr; }
  .course-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .course-sidebar > p, .mode-note { grid-column: 1; }
  .course-choice { grid-column: 2; grid-row: 1 / span 3; margin: 0; align-self: stretch; }
  .home-actions { grid-template-columns: max-content minmax(96px, 1fr) max-content; }
  .unlock-banner { grid-template-columns: max-content max-content; }
  .unlock-banner > div { grid-column: 1 / -1; }
  .study-card { grid-template-columns: 1fr; }
  .listening-lab { position: static; }
  .question-grid { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { min-height: 68px; gap: 10px; align-items: center; padding-top: 4px; }
  .brand { gap: 7px; }
  .brand-mark { width: 46px; height: 46px; border-radius: 50%; }
  .brand b { font-size: 12px; white-space: nowrap; }
  .brand small { font-size: 8px; }
  .site-header nav { gap: 5px; }
  .nav-pill { padding: 7px 8px; font-size: 10px; }
  .shell { width: min(100% - 20px, 1440px); }
  .course-sidebar { display: block; padding: 17px; }
  .course-choice { margin: 13px 0 0; }
  .course-main { padding: 15px; border-radius: 22px; }
  .home-actions { grid-template-columns: 1fr; gap: 12px; }
  .continue-card, .unlock-banner { grid-column: auto; }
  .continue-card { gap: 14px; align-items: flex-end; }
  .continue-card .button { padding: 9px 12px; font-size: 11px; }
  .unlock-banner { width: auto; grid-template-columns: 1fr; }
  .unlock-banner > div { grid-column: auto; }
  .unlock-banner > button { width: 100%; }
  .lesson-grid { grid-template-columns: 1fr; gap: 9px; }
  .lesson-card { min-height: 154px; padding: 11px; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; }
  .lesson-thumb { width: 82px; }
  .lesson-heading { padding: 15px; align-items: flex-start; flex-wrap: wrap; }
  .lesson-heading h1 { font-size: 25px; }
  .lesson-heading-actions { width: 100%; justify-content: flex-end; }
  .study-card, .practice-zone { padding: 12px; border-radius: 21px; }
  .missing-page { min-height: 420px; }
  .writing-grid { grid-template-columns: 1fr; }
  .answer-check-status { width: 100%; min-width: 0; margin: 5px 0 0; }
  .print-toolbar { position: static; grid-template-columns: 1fr; }
  .print-version-switch { width: 100%; justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .print-toolbar > .button { width: 100%; }
  .print-sheet { padding: 20px 16px; border-radius: 16px; }
  .print-sheet-heading h1 { font-size: 27px; }
  .print-reading { grid-template-columns: 1fr; }
  .print-reading img { max-height: 420px; }
  .print-vocabulary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .print-questions ol { grid-template-columns: 1fr; }
  .print-writing-grid { grid-template-columns: 1fr; }
  .segmented { grid-template-columns: 1fr; }
  .lookup-panel { inset: 78px 10px auto; width: auto; max-height: calc(100vh - 90px); min-height: 390px; }
  .wordbook-shell { padding: 20px; }
  .wordbook-entry { grid-template-columns: minmax(0, 1fr) auto; }
  .wordbook-remove { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .001ms !important; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: white; }
  .site-header, .lesson-heading, .page-tabs, .passage-card, .listening-lab, .practice-zone, .lesson-next, .print-toolbar, .toast { display: none !important; }
  .shell, .study-card, .page-column { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .study-card { display: block; }
  .page-image-button { padding: 0; border: 0; }
  .page-image-button span { display: none; }
  .page-image-button img { width: 100%; border-radius: 0; }
  .print-shell { width: 100%; margin: 0; }
  .print-sheet { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-reading { grid-template-columns: 54mm minmax(0, 1fr); }
  .print-reading img { max-height: 88mm; box-shadow: none; }
  .print-section, .print-reading, .print-writing { break-inside: avoid; }
}
