* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --paper: #f9f7f1;
  --ink: #222036;
  --muted: #5f596d;
  --violet: #4936b3;
  --soft-violet: #ece7fb;
  --line: #dfd9e6;
  --white: #fffcf8;
  --correct: #256047;
  --wrong: #91421f;
  --sans: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
}
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
[tabindex="-1"] { scroll-margin-top: 22px; }
.wrap { width: min(1100px, calc(100% - 72px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-inner { min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.36rem; font-weight: 850; letter-spacing: -.04em; }
.brand:hover span { text-decoration: underline; text-underline-offset: 4px; }
.header-label { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: .78rem; font-weight: 750; }
.header-label span { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }
.layout { display: grid; grid-template-columns: minmax(190px, .78fr) minmax(0, 2.15fr); gap: 35px; align-items: start; min-height: calc(100vh - 139px); padding-block: 51px 55px; }
.lesson { padding-top: 14px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--violet); font-size: .73rem; font-weight: 850; letter-spacing: .14em; }
.eyebrow span { width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 50%; }
h1 { margin: 13px 0 8px; font-size: clamp(1.85rem, 4vw, 3.03rem); line-height: 1.24; letter-spacing: -.07em; }
h1 span { display: block; }
.lesson-intro { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.85; }
.progress-card { margin-top: 22px; border: 1px solid #ded5f5; border-radius: 13px; background: var(--soft-violet); padding: 13px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #4a378e; font-size: .78rem; font-weight: 800; }
.progress-label span { font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 8px; overflow: hidden; appearance: none; border: 0; border-radius: 999px; background: #d9ccf4; color: var(--violet); }
progress::-webkit-progress-bar { background: #d9ccf4; }
progress::-webkit-progress-value { border-radius: 999px; background: var(--violet); }
progress::-moz-progress-bar { border-radius: 999px; background: var(--violet); }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--white); padding: clamp(22px, 3.6vw, 38px); box-shadow: 0 7px 24px #2b1d5210; }
.setup h2 { margin: 8px 0 7px; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.setup-intro { margin: 0 0 24px; color: var(--muted); font-size: .9rem; line-height: 1.75; }
.setup label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 800; }
.setup select { width: min(100%, 14rem); min-height: 46px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; color: var(--ink); }
.question-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.question-top h2 { margin: 0; color: var(--violet); font-size: .89rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.category { padding: 4px 10px; border-radius: 999px; background: var(--soft-violet); color: #4a378e; font-size: .75rem; font-weight: 800; }
.prompt { margin: 18px 0 24px; color: var(--ink); font-size: clamp(1.24rem, 2.75vw, 1.79rem); font-weight: 650; line-height: 1.62; letter-spacing: -.023em; white-space: pre-line; overflow-wrap: anywhere; }
.blank { display: inline-block; min-width: 3.25em; border: 1px dashed #ab99dc; border-radius: 6px; background: var(--soft-violet); padding: 0 .45em; vertical-align: .12em; color: var(--violet); font-size: .64em; line-height: 1.63; text-align: center; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin: 0 0 11px; color: var(--muted); font-size: .83rem; font-weight: 700; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice { display: flex; align-items: center; gap: 11px; position: relative; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; cursor: pointer; }
.choice:hover { border-color: #9784d8; }
.choice:has(input:checked) { border-color: var(--violet); background: var(--soft-violet); box-shadow: 0 0 0 1px var(--violet); }
.choice:has(input:focus-visible) { outline: 3px solid var(--violet); outline-offset: 3px; }
.choice input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.letter { display: inline-grid; place-items: center; flex: none; width: 29px; height: 29px; border-radius: 7px; background: #eee9f8; color: #503b92; font-size: .82rem; font-weight: 850; }
.choice-word { font-size: 1.02rem; font-weight: 700; overflow-wrap: anywhere; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.action { display: inline-flex; align-items: center; justify-content: space-between; gap: 19px; min-height: 46px; padding: 9px 14px 9px 17px; border: 1px solid transparent; border-radius: 9px; background: var(--violet); color: white; cursor: pointer; font-size: .87rem; font-weight: 800; }
.action span { margin-left: 16px; font-size: 1.05rem; }
.action:hover { background: #38268f; }
.action:disabled { border-color: #ded8e5; background: #ece8f0; color: #6b627a; cursor: default; }
.answer-summary { border: 1px solid; border-radius: 11px; padding: 13px 15px; }
.answer-summary.right { border-color: #b6d9c3; background: #ebf5ed; color: var(--correct); }
.answer-summary.wrong { border-color: #efd1bc; background: #fbefe4; color: var(--wrong); }
.feedback-heading { margin: 0; font-size: 1.15rem; }
.correct-answer { margin: 4px 0 0; font-size: .92rem; }
.completed { margin: 16px 0 5px; font-size: 1.05rem; line-height: 1.65; white-space: pre-line; }
.completed strong { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }
.translation { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.7; white-space: pre-line; }
.option-heading { margin: 21px 0 9px; font-size: .95rem; }
.explanations { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.explanation { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fffefa; }
.explanation.correct-option { border-color: #b6d9c3; background: #f5faf4; }
.option-top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.option-word { margin-right: 3px; }
.badge { flex: none; border-radius: 999px; padding: 3px 7px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.correct-badge { background: #def1e4; color: var(--correct); }
.selected-badge { background: var(--soft-violet); color: var(--violet); }
.wrong-badge { background: #fae7d9; color: var(--wrong); }
.meaning { margin: 6px 0 2px; font-size: .86rem; font-weight: 800; }
.reason { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.65; }
.results h2 { margin: 8px 0 15px; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.results > h3 { margin: 20px 0 8px; font-size: 1.04rem; }
.score { border: 1px solid #ded5f5; border-radius: 12px; padding: 14px 17px; background: var(--soft-violet); color: var(--violet); }
.score > span { font-size: .81rem; font-weight: 800; }
.score p { margin: 0; font-weight: 700; }
.score strong { font-size: 2.8rem; font-variant-numeric: tabular-nums; }
.review-item { border-bottom: 1px solid var(--line); }
.review-summary { display: flex; align-items: center; gap: 9px; padding: 10px 0; cursor: pointer; font-size: .84rem; font-weight: 750; }
.review-summary::before { flex: none; content: "+"; color: var(--violet); font-size: 1.1rem; line-height: 1; }
.review-item[open] > .review-summary::before { content: "−"; }
.review-summary::-webkit-details-marker { display: none; }
.review-summary .badge { margin-left: auto; }
.review-item .answer-details { padding-bottom: 13px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { min-height: 62px; font-size: .73rem; }
@media (max-width: 800px) {
  .wrap { width: calc(100% - 44px); }
  .layout { gap: 21px; padding-block: 32px 40px; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 60px; }
  .brand { gap: 7px; font-size: 1.15rem; }
  .brand img { width: 32px; height: 32px; }
  .layout { grid-template-columns: 1fr; gap: 16px; padding-block: 18px 32px; min-height: calc(100vh - 123px); }
  .lesson { padding-top: 0; }
  h1 { margin-top: 6px; font-size: clamp(1.55rem, 6.5vw, 2rem); }
  h1 span { display: inline; }
  .progress-card { margin-top: 11px; padding: 9px 11px; }
  .progress-label { margin-bottom: 4px; }
  .panel { padding: 17px; border-radius: 15px; }
  .prompt { margin-block: 14px 16px; }
  .form-actions { margin-top: 17px; }
}
@media (max-width: 420px) {
  .choices { grid-template-columns: 1fr; gap: 7px; }
  .choice { min-height: 47px; padding: 6px 9px; }
  .action { width: 100%; justify-content: center; }
  .action span { margin-left: 0; }
}
