:root {
  color-scheme: light;
  --ink: #142c32;
  --sub: #425b61;
  --green: #0c6353;
  --green-dark: #084d40;
  --line: #cbdcd8;
  --paper: #fff;
  --tint: #eaf3f0;
  font: 100%/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--tint); }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, summary:focus-visible { outline: 3px solid #13796a; outline-offset: 3px; }
button:disabled { cursor: default; }
.shell { width: min(100% - 28px, 700px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: #f7faf9; }
.top-inner, .progress-label, .dialog-top, .question-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top-inner { min-height: 66px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.brand-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: none; background: var(--green-dark); color: white; border-radius: 9px; font-weight: 750; }
.index-button, .dialog-top button, .light-button { min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: .875rem; font-weight: 700; }
#main { padding-top: 17px; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.progress-label { color: var(--sub); font-size: .875rem; font-weight: 700; }
progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; border-radius: 8px; overflow: hidden; background: #ccdfd9; margin: 7px 0 15px; }
progress::-webkit-progress-bar { background: #ccdfd9; }
progress::-webkit-progress-value { background: var(--green); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--green); }
#card { border: 1px solid var(--line); border-radius: 21px; padding: clamp(14px,4vw,28px); background: var(--paper); box-shadow: 0 8px 24px #2248400c; overflow-wrap: anywhere; }
.question-tools { align-items: start; }
.number { background: #ddf0e9; color: var(--green-dark); border-radius: 7px; font-weight: 800; padding: 5px 10px; font-size: .91rem; }
h1 { margin: 10px 0 13px; font-size: clamp(1.4rem, 5vw, 1.85rem); line-height: 1.35; }
h1:focus { outline: 0; }
h2 { font-size: 1.15rem; margin: 0; }
p { margin: 0; }
.stem { line-height: 2.02; }
.guidance { margin-bottom: 12px; color: var(--sub); font-size: .875rem; }
.blank { margin: 3px 2px; padding: 4px 8px; min-width: 50px; min-height: 44px; vertical-align: baseline; border: 1px dashed #408879; border-radius: 8px; background: #effaf6; color: var(--green-dark); font-weight: 750; line-height: 1.35; max-width: 100%; }
.blank[aria-expanded="true"] { border-style: solid; background: #ccebdd; }
figure { margin: 16px 0; text-align: center; }
figure img { display: block; margin-inline: auto; max-width: 100%; width: auto; max-height: 395px; border: 1px solid var(--line); border-radius: 8px; }
figcaption { margin-top: 5px; color: var(--sub); font-size: .875rem; }
fieldset { margin: 15px 0 0; padding: 0; min-width: 0; border: 0; }
fieldset + fieldset { margin-top: 22px; }
legend { width: 100%; margin-bottom: 9px; padding: 0; font-weight: 750; }
.label { color: var(--green-dark); margin-right: 5px; }
.choices { display: grid; gap: 7px; }
.choice { display: flex; align-items: center; gap: 9px; min-height: 49px; padding: 8px 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: white; width: 100%; overflow-wrap: anywhere; }
.choice-code { display: grid; place-items: center; flex: 0 0 26px; min-height: 26px; border-radius: 6px; background: #eaf2f1; color: var(--sub); font-weight: 750; font-size: .875rem; }
.choice[aria-pressed="true"] { border-color: var(--green); background: #eaf7f2; }
.choice.is-right { border-color: #238563; background: #e6f8ee; }
.choice.is-wrong { border-color: #ad5b49; background: #fff1ec; }
.check { min-height: 44px; border: 1px solid var(--green); border-radius: 9px; color: white; background: var(--green); padding: 6px 12px; font-weight: 750; }
.check:disabled { background: #eaf2f1; color: #4c6468; border-color: var(--line); }
.feedback { margin-top: 8px; font-size: .9375rem; }
.feedback:empty { margin-top: 0; }
.field-explanation { margin-top: 8px; }
.field-explanation summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f4f8f7; font-size: .875rem; }
.field-explanation summary::-webkit-details-marker { display: none; }
.field-explanation summary::before { content: "+"; font-size: 1rem; }
.field-explanation[open] summary::before { content: "−"; }
.field-explanation p { margin-top: 8px; padding: 11px 13px; border-left: 3px solid #408879; border-radius: 0 8px 8px 0; background: #eff7f4; line-height: 1.75; }
.practice, .explanation { border-top: 1px solid var(--line); margin-top: 18px; }
summary { min-height: 48px; padding: 12px 2px; cursor: pointer; color: var(--green-dark); font-weight: 750; touch-action: manipulation; }
.explanation p { padding: 2px 0 7px; line-height: 1.8; }
.dock { position: fixed; inset: auto 0 0; border-top: 1px solid var(--line); background: #f7faf9; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 2; }
.dock-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dock button { min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: white; font-weight: 750; }
#next { background: var(--green); color: white; border-color: var(--green); }
.dock button:disabled { background: #edf2f1; color: #53666a; }
dialog { width: min(95vw,480px); max-height: 85dvh; border: 1px solid var(--line); border-radius: 18px; padding: 16px; color: var(--ink); box-shadow: 0 20px 60px #132b3552; }
dialog::backdrop { background: #142c326e; }
.index-group { margin-top: 14px; }
.index-group h3 { margin: 0 0 6px; font-size: .9rem; color: var(--sub); }
.index-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; }
.index-grid button { min-height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f4f8f7; font-weight: 750; }
.index-grid button[aria-current] { background: var(--green); color: white; }
[hidden] { display: none !important; }
.blank-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.blank-picker button { min-width: 44px; }
.blank-picker button[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }

.bank-status { margin: 12px 0 7px; font-weight: 750; }
.word-bank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.word-bank .choice { gap: 6px; padding-inline: 7px; }
.word-bank .choice-code { flex-basis: 23px; }

.top-actions { display: flex; align-items: center; gap: 6px; }
.finish-button { color: #713829; border-color: #c9a79c; }
.primary-button { display: block; width: 100%; margin-top: 16px; min-height: 50px; padding: 9px 12px; border: 1px solid var(--green); border-radius: 10px; color: white; background: var(--green); font-weight: 750; }
.screen-description { color: var(--sub); }
.mistake-section { margin-top: 22px; }
.mistake-group { padding: 11px 12px; margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; background: #f7faf9; }
.mistake-group h3 { margin: 0; font-size: 1rem; }
.mistake-list { padding-inline-start: 1.25rem; margin: 6px 0 0; }
.mistake-list li + li { margin-top: 5px; }
.review-complete, .reviewed-label { color: var(--green-dark); font-size: .875rem; font-weight: 750; }
.reviewed-label { margin-left: 8px; }
.restart-button { margin-top: 18px; width: 100%; }
.blank-context { color: var(--sub); font-weight: 650; }
.result-summary { display: flex; flex-wrap: wrap; gap: 3px 14px; }
