:root {
  color-scheme: light;
  --paper: #f7f4eb;
  --ink: #252b29;
  --muted: #52605a;
  --teal: #17665b;
  --teal-dark: #104c43;
  --rust: #a13e29;
  --rule: #cacdc2;
  --margin: #cdc2ad;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { min-height: 46px; min-width: 44px; padding: 10px 19px; border: 1px solid #7d8880; border-radius: 4px; background: transparent; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.4; cursor: pointer; }
button:hover:not(:disabled) { background: #e9e7dc; }
button:disabled { color: #687168; border-color: #c6cabe; background: #eeece3; cursor: default; }
button.primary, button.active { background: var(--teal); border-color: var(--teal); color: white; }
button.primary:hover:not(:disabled), button.active:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
button.primary:disabled { background: #eeece3; color: #687168; border-color: #c6cabe; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 400 clamp(42px, 5vw, 60px)/1.12 Georgia, "Times New Roman", serif; letter-spacing: -1.6px; margin-bottom: 16px; }
h2 { font-size: 20px; font-weight: 650; line-height: 1.4; margin-bottom: 10px; }
h3 { font-size: 17px; line-height: 1.5; margin-bottom: 8px; }
p { margin-bottom: 16px; }
.page { max-width: 1360px; padding: 24px 64px 32px; margin: 0 auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.catalog { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--ink); font-size: 16px; text-underline-offset: 6px; }
.intro { font-size: 17px; color: var(--muted); margin-bottom: 30px; }
.toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.mode-controls, .sheet-controls, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mode { min-width: 128px; min-height: 50px; font-size: 16px; }
.workbook-meta { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 12px; padding-top: 19px; color: var(--muted); }
.tally { font-size: 21px; font-weight: 650; color: var(--teal); }
.notice { color: var(--teal); font-size: 14px; min-height: 23px; margin: 7px 0 20px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 64px; padding-bottom: 34px; }
.section-note { color: var(--muted); max-width: 800px; }
label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
input, textarea { border: 1px solid #869087; border-radius: 3px; color: var(--ink); background: #fffdf7; min-height: 46px; width: 100%; padding: 11px 13px; }
textarea { resize: vertical; min-height: 108px; }
input::placeholder, textarea::placeholder { color: #72796f; opacity: 1; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--rust); }
.hint { font-size: 14px; color: var(--muted); margin: 5px 0 20px; }
.error { color: var(--rust); font-size: 15px; font-weight: 550; margin: 0 0 12px; }
.error:empty { display: none; }
.preview-area { padding: 14px 0 20px; border-top: 1px solid var(--rule); }
.preview { font: 400 25px/1.6 Georgia, "Times New Roman", serif; margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview.muted { font: 14px/1.6 system-ui, sans-serif; color: var(--muted); }
mark { background: transparent; color: inherit; border-bottom: 2px solid var(--teal); padding-bottom: 2px; }
.samples { border-left: 2px solid var(--margin); padding-left: 30px; }
.samples h2 { margin-top: 10px; }
.sample-sentence { font: 400 27px/1.6 Georgia, "Times New Roman", serif; margin: 20px 0 0; }
.confirmation { border-top: 2px solid var(--teal); margin-top: 22px; padding-top: 16px; }
.confirmation p { font-size: 14px; color: var(--muted); }
.section-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule); padding-top: 24px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; }
.empty { display: flex; gap: 28px; padding: 28px 0 32px; }
.empty-number { font: 40px/1.3 Georgia, "Times New Roman", serif; color: #70796e; }
.empty > div { border-left: 2px solid var(--margin); padding-left: 28px; max-width: 660px; }
.empty p { color: var(--muted); }
.worksheet { list-style: none; padding: 0; margin: 18px 0 0; }
.exercise { display: grid; grid-template-columns: 74px minmax(0, 1fr); }
.exercise-number { padding: 26px 12px 0 0; font: 400 39px/1.2 Georgia, "Times New Roman", serif; color: #70796e; }
.exercise-body { min-width: 0; border-left: 2px solid var(--margin); padding: 25px 0 28px 30px; }
.exercise + .exercise .exercise-body { border-top: 1px solid var(--rule); }
.sentence { font: 400 clamp(27px, 2.7vw, 38px)/1.9 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; white-space: pre-wrap; margin-bottom: 18px; }
.target-note { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.target-note strong { color: var(--teal); white-space: pre-wrap; }
.remove { color: var(--rust); }
.practice-sentence { padding-top: 13px; }
.answer-unit { display: inline-flex; flex-wrap: nowrap; align-items: baseline; max-width: calc(100% - 8px); vertical-align: baseline; margin: 0 4px 7px; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.answer-wrap { display: inline-block; flex: 0 1 auto; width: 15ch; min-width: 0; max-width: 100%; position: relative; white-space: normal; }
.answer-punctuation { display: block; flex: 0 0 auto; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.answer-wrap label { font: 500 14px/1.4 system-ui, sans-serif; color: var(--muted); margin: 0 0 3px; }
.answer-input { display: block; min-width: 0; font: 400 30px/1.35 Georgia, "Times New Roman", serif; border: 0; border-radius: 3px 3px 0 0; border-bottom: 3px solid var(--teal); padding: 8px 12px; background: #ebece2; min-height: 58px; }
.answer-input.correct { background: #e7efe6; border-bottom-color: var(--teal); }
.answer-input.incorrect { background: #f4e6dc; border-bottom-color: var(--rust); }
.feedback { margin: 14px 0 0; font-size: 16px; color: var(--muted); }
.feedback:empty { display: none; }
.feedback.correct { color: var(--teal); font-weight: 600; }
.feedback.incorrect { color: var(--rust); font-weight: 600; }
.revealed { border-left: 3px solid var(--teal); padding: 7px 12px; margin: 14px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.practice-note { margin: 20px 0 30px 106px; max-width: 760px; color: var(--muted); }
.practice-note strong { display: block; color: var(--ink); margin-bottom: 5px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
footer { border-top: 1px solid var(--rule); margin-top: 36px; padding-top: 19px; color: var(--muted); font-size: 14px; }
footer p { margin-bottom: 8px; }
@media (max-width: 850px) {
  .page { padding: 20px 32px 28px; }
  .editor-layout { gap: 30px; grid-template-columns: minmax(0, 1.4fr) minmax(210px, 1fr); }
  .samples { padding-left: 20px; }
}
@media (max-width: 620px) {
  .page { padding: 12px 20px 24px; }
  .masthead { flex-direction: column-reverse; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  h1 { font-size: 43px; }
  .intro { margin-bottom: 24px; }
  .toolbar { gap: 12px; }
  .mode-controls, .sheet-controls { width: 100%; gap: 10px; }
  .mode-controls button, .sheet-controls button { flex: 1; min-width: 0; }
  .sheet-controls button { padding-left: 9px; padding-right: 9px; }
  .editor-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .samples { padding-left: 20px; }
  .exercise { grid-template-columns: 43px minmax(0, 1fr); }
  .exercise-number { font-size: 28px; padding-top: 28px; }
  .exercise-body { padding-left: 15px; }
  .sentence { font-size: 27px; line-height: 1.9; }
  .answer-wrap { width: 12ch; }
  .answer-input { font-size: 27px; }
  .exercise .actions { gap: 8px; }
  .exercise .actions button { padding: 10px 12px; font-size: 14px; }
  .practice-note { margin-left: 58px; }
  .empty { gap: 16px; }
  .empty > div { padding-left: 16px; }
  .tally { font-size: 19px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .12s ease; }
}
