:root{--paper:#f7f5ee;--ink:#243b45;--muted:#61716f;--teal:#236b62;--line:#dce1d7;--white:#fffef9}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}a{color:inherit}button,input,select{font:inherit}button,a,input{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #c47a32;outline-offset:4px}.site-header{max-width:1240px;margin:auto;min-height:106px;display:flex;align-items:center;justify-content:space-between;padding:20px 42px;border-bottom:1px solid var(--line)}.brand{font-size:30px;font-weight:750;text-decoration:none;letter-spacing:-1.5px}.brand span{font-weight:400}.brand i{font-style:normal;color:var(--teal);margin-left:9px}.site-header nav{display:flex;gap:34px}.site-header nav a{text-decoration:none;color:var(--muted);font-size:14px;padding:8px 0}.site-header nav a[aria-current]{color:var(--teal);border-bottom:2px solid var(--teal)}.private-label,.eyebrow,.step-label{font-size:11px;letter-spacing:1.8px;font-weight:700}.private-label{color:var(--muted)}main{max-width:1010px;min-height:calc(100vh - 209px);margin:auto;padding:48px 42px 65px}.page-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 36px;gap:25px}.eyebrow{color:var(--teal);margin:0 0 15px}h1{font-family:Georgia,"Times New Roman",serif;font-weight:400;font-size:44px;line-height:1.13;letter-spacing:-1.2px;margin:0}h2{font-family:Georgia,"Times New Roman",serif;font-size:28px;font-weight:400;line-height:1.4}.heading-note{font-size:14px;color:var(--muted);line-height:1.8}.practice-card{background:var(--white);border:1px solid var(--line);border-radius:16px;padding:34px 40px;box-shadow:0 10px 32px #243b4504}.card-top{display:flex;justify-content:space-between;align-items:center;gap:15px}.step-label{color:var(--teal)}.mode{font-size:12px;color:var(--muted);background:#f0f3ec;border-radius:20px;padding:5px 12px}.sentence{font-size:clamp(26px,3.5vw,36px);line-height:1.7;margin:36px 0 5px;overflow-wrap:anywhere}.blank{display:inline-block;min-width:100px;border-bottom:2px solid var(--teal);height:1.1em;vertical-align:baseline;background:#edf3ed;border-radius:3px}.translation{color:var(--muted);font-size:16px;margin:0 0 20px}.clues{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:32px}.clues span{border:1px solid var(--line);border-radius:5px;padding:3px 10px;font-size:12px;color:var(--muted)}label{display:block;font-size:13px;font-weight:600;margin-bottom:8px}.answer-row{display:flex;gap:12px}input[type=text],input[type=number]{background:#fff;border:1px solid #acbab3;border-radius:7px;padding:14px 16px;min-width:0;color:var(--ink)}#answer{flex:1;width:100%}input::placeholder{color:#81908c}.primary{display:inline-flex;align-items:center;justify-content:center;gap:25px;background:var(--teal);color:white;border:0;border-radius:7px;padding:14px 22px;font-size:14px;font-weight:600;text-decoration:none;white-space:nowrap}.primary:hover{background:#19574f}.hint{min-height:25px;color:#975121;font-size:13px;margin:8px 0}.input-tools{display:flex;justify-content:space-between;align-items:center;gap:14px}.accent-keys{display:flex;gap:5px;flex-wrap:wrap}.accent-keys button{border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:5px;min-width:32px;min-height:34px}.accent-keys button:hover{background:#e1ebe2}.keyboard-note{font-size:11px;color:var(--muted)}kbd{border:1px solid var(--line);border-radius:3px;padding:2px 4px;font-size:10px}.study-note{text-align:center;font-size:12px;color:var(--muted);margin:22px 0}.revealed{color:var(--teal);background:#e6f0e5;padding:2px 5px;border-radius:4px}.feedback{padding:18px 22px;border-radius:8px;background:#eef4e9;margin-bottom:24px}.feedback p{margin:4px 0;font-size:14px}mark{background:#f6d99d;color:var(--ink);border-radius:2px}.completion-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.completion-actions form{margin-left:auto}.completion-actions audio{width:240px;max-width:100%;height:40px}.secondary{border:1px solid var(--line);border-radius:6px;background:transparent;padding:9px 12px;color:var(--teal);font-size:13px}.subtle,.audio-status{font-size:13px;color:var(--muted)}.audio-status{flex:1;min-width:200px}.settings-card{max-width:710px}.settings-card h2{margin-top:0}.field{margin:28px 0}.field input[type=text],.field input[type=number]{width:100%;max-width:400px}.field .subtle{margin:7px 0}.checkbox-field label{display:inline-block;margin-right:18px}.checkbox-field input{width:20px;height:20px;accent-color:var(--teal);vertical-align:middle}.errorlist{color:#9b3e25;font-size:14px;padding-left:20px}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:25px}.stats-grid article{padding:25px;background:var(--white);border:1px solid var(--line);border-radius:12px}.stats-grid p{font-size:13px;margin:0}.stats-grid strong{display:block;font:52px/1.5 Georgia,serif;color:var(--teal)}.stats-grid span{font-size:12px;color:var(--muted)}.text-link{font-size:14px;color:var(--teal)}.empty p{max-width:600px}.empty .primary{margin-top:20px}footer{border-top:1px solid var(--line);max-width:1156px;margin:auto;padding:25px 0;display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}footer span+span{font-size:9px;letter-spacing:1px}.skip{position:absolute;left:10px;top:-100px;background:white;padding:10px;z-index:2}.skip:focus{top:10px}@media(max-width:700px){.site-header{padding:15px 22px;min-height:85px}.site-header nav{gap:18px}.private-label{display:none}.brand{font-size:25px}main{padding:32px 20px 40px}.page-heading{margin-bottom:25px}.heading-note{display:none}h1{font-size:36px}.practice-card{padding:25px 22px}.card-top{align-items:flex-start}.step-label{font-size:9px;letter-spacing:1px}.mode{font-size:10px}.sentence{margin-top:27px}.answer-row{flex-direction:column}.primary{min-height:49px}.input-tools{align-items:flex-start;flex-direction:column}.keyboard-note{display:none}.accent-keys{gap:6px}.accent-keys button{min-width:34px;min-height:40px}.stats-grid{grid-template-columns:1fr;gap:10px}.stats-grid article{display:grid;grid-template-columns:1fr auto;align-items:center;padding:17px 22px}.stats-grid strong{grid-column:2;grid-row:1/3;font-size:40px}.stats-grid span{grid-column:1}.completion-actions form{width:100%}.completion-actions .primary{width:100%}footer{margin:0 22px;gap:20px}.page-heading .text-link{display:none}}@media(prefers-reduced-motion:no-preference){button,a{transition:background .15s,color .15s}}
/* The gap shares the sentence's font and baseline; only its underline adds height. */
.sentence #answer{display:inline-block;flex:none;width:auto;min-width:3ch;max-width:100%;font:inherit;line-height:inherit;vertical-align:baseline;padding:0 .12em;margin:0;border:0;border-bottom:2px solid var(--teal);border-radius:3px;height:auto;background:#edf3ed;color:var(--ink)}
.sentence #answer::placeholder{color:#8b481e;opacity:1}
.translation-target{background:#e6f0e5;color:#19574f;font-weight:650;text-decoration:underline;text-decoration-color:#6b9b78;text-underline-offset:3px;border-radius:2px;padding:0 .08em}
button:disabled{cursor:wait;opacity:.65}
.empty #continue-form{margin:20px 0}.empty #continue-form .primary{margin-top:0}
[hidden]{display:none!important}
/* Keep the sentence and primary action anchored across answer/retry/completion. */
.answer-gap{display:inline-block;width:max(8ch,var(--gap-width));max-width:100%;vertical-align:baseline}
.sentence .answer-gap #answer,.sentence .answer-gap .revealed{display:inline-block;width:100%;min-width:0;max-width:100%;font:inherit;line-height:inherit;vertical-align:baseline;padding:0 .12em;margin:0;border:0;border-bottom:2px solid var(--teal);border-radius:3px}
.practice-action{display:flex;justify-content:flex-end;margin:0;width:152px;max-width:100%;min-height:44px}
.practice-action form{margin:0;width:100%;max-width:100%}
.practice-action .primary{width:100%;max-width:100%;min-width:0;min-height:44px;gap:12px;padding:10px 14px}
.practice-feedback{height:128px;min-height:128px;min-width:0;padding-top:0}
.practice-feedback .feedback{margin:0;padding:12px 16px}
.practice-feedback .hint{margin:0;padding:12px 16px}
.practice-tools{min-width:0}
.practice-tools .secondary{min-height:44px;max-width:100%}
.practice-tools audio{min-width:0;max-width:100%}
.practice-tools .audio-status{min-width:0;margin:0}
.practice-tools #audio-status{margin:8px 0 0}
.practice-card:not(.empty) .card-top{min-height:36px}
.study-note{min-height:3.2em}
@media(max-width:700px){
  .practice-tools .completion-actions{align-items:flex-start}
}
/* Glosses occupy the reserved feedback area rather than moving the action. */
.sentence-word{appearance:none;display:inline;padding:0;margin:0;border:0;border-radius:2px;background:transparent;color:inherit;font:inherit;line-height:inherit;vertical-align:baseline;text-align:inherit;text-decoration:underline dotted #81908c;text-underline-offset:.15em}
.sentence-word:hover,.sentence-word[aria-expanded=true]{color:var(--teal);text-decoration-style:solid}
.practice-feedback{position:relative}
.word-meaning{position:absolute;inset:0 0 8px;overflow:auto;background:#eef4e9;border:1px solid var(--line);border-radius:8px;padding:12px 16px;display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.word-meaning>div{min-width:0;overflow-wrap:anywhere}
.word-meaning p{margin:0;font-size:14px}
.word-meaning .meaning-label{font-size:11px;color:var(--muted)}
.word-meaning .secondary{flex-shrink:0;padding:4px 8px}

/* Keep diacritics below grammar clues and reserve their row after completion. */
.practice-card:not(.empty) .clues{margin-bottom:12px}
.practice-accents{min-height:40px;margin-bottom:16px}
.practice-accents.is-complete{visibility:hidden;pointer-events:none}
@media(max-width:700px){.practice-accents{min-height:86px}}

/* Full-width feedback precedes playback on the left and a compact primary action. */
.practice-response{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.practice-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px;min-height:88px}
.practice-strength{min-height:54px;padding-top:8px}
.strength-caption{font-size:11px;color:var(--muted)}
.strength-detail{display:grid;grid-template-columns:90px minmax(0,1fr);align-items:center;gap:10px}
.practice-strength .strength-bar{display:flex;gap:4px}
.practice-strength .strength-segment{height:8px;flex:1;border:1px solid #b4bcb6;border-radius:2px;background:#e7e9e3}
.practice-strength .strength-step-1.is-filled{background:#ad493e;border-color:#ad493e}
.practice-strength .strength-step-2.is-filled{background:#bd6a30;border-color:#bd6a30}
.practice-strength .strength-step-3.is-filled{background:#a58b30;border-color:#a58b30}
.practice-strength .strength-step-4.is-filled{background:#708b42;border-color:#708b42}
.practice-strength .strength-step-5.is-filled{background:#236b62;border-color:#236b62}
.practice-strength .strength-label{font-size:12px;font-weight:600}
@media(max-width:700px){
  .practice-controls{min-height:112px}
  .practice-action{width:120px}
  .practice-action .primary{font-size:12px;padding-inline:10px;gap:6px;white-space:normal}
  .practice-tools .secondary{font-size:12px;padding:8px;line-height:1.4}
  .practice-tools .completion-actions{gap:8px}
  .practice-feedback .feedback,.practice-feedback .hint{padding:10px;overflow-wrap:anywhere}
  .practice-feedback{height:176px;min-height:176px}
  .word-meaning{display:block;padding:10px}
  .word-meaning .secondary{margin-top:8px}
}

#practice-feedback-content{max-height:100%;overflow:auto}

/* Idioms separate the natural meaning from the word-for-word construction. */
.translation-pair{margin-bottom:20px}
.translation-pair .translation{margin:0;overflow-wrap:anywhere}
.translation-pair .translation+.translation{margin-top:6px}
.translation-label{font-size:11px;font-weight:650;letter-spacing:.03em;margin-right:6px;color:var(--muted)}

/* Normalize the native select's closed appearance across browsers. */
.settings-card .field select{
  -webkit-appearance:none;appearance:none;
  width:100%;max-width:400px;min-width:0;height:56px;
  font:inherit;line-height:1.6;color:var(--ink);
  border:1px solid #acbab3;border-radius:7px;padding:14px 44px 14px 16px;
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m5 7.5 5 5 5-5' stroke='%2361716f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 16px center;background-size:18px 18px;
}
.settings-card select:focus-visible{outline:3px solid #c47a32;outline-offset:4px}
@media(forced-colors:active){.settings-card .field select{-webkit-appearance:auto;appearance:auto;background-image:none}}

/* Account forms reuse the settings card and controls. */
.account-card input[type="email"], .account-card input[type="password"] { width:100%; max-width:32rem; padding:.8rem; border:1px solid var(--line, #dad8cf); border-radius:.5rem; background:var(--paper, #fffdf7); font:inherit; }
.account-card .errorlist { color:#923a28; }
.logout-form { display:inline; margin:0; }
.logout-form button { background:none; border:0; padding:0; font:inherit; color:inherit; cursor:pointer; }
.course-choice { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 0; border-bottom:1px solid var(--line, #dad8cf); }
@media(max-width:600px) { .course-choice { align-items:flex-start; flex-direction:column; } .site-header nav { flex-wrap:wrap; } }
