:root {
  color-scheme: light;
  font-family: ui-rounded, "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1b2734;
  background: #f5f1e9;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(circle at 50% -15%, #fffdf7 0, #f5f1e9 47rem, #eee7dc 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #176d75; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .62; }

.shell { width: min(760px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.25rem, 5vw, 3.5rem) 0 max(2.5rem, env(safe-area-inset-bottom)); }
.topbar, .progress-copy, .action-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar { justify-content: flex-end; }
.quiet-button { min-height: 48px; flex: 0 0 auto; padding: .65rem .85rem; border: 1px solid #cfc6b9; border-radius: 999px; background: #fffdf9; color: #344451; font-size: .86rem; font-weight: 750; line-height: 1.1; }
.quiet-button:hover { border-color: #78939a; background: #f1f8f7; }

.progress-block { margin: clamp(1.6rem, 5vw, 2.8rem) 0 .85rem; }
.progress-copy { margin-bottom: .6rem; color: #63717b; font-size: .84rem; font-weight: 700; }
progress { width: 100%; height: .7rem; overflow: hidden; border: 0; border-radius: 999px; background: #ded7cc; accent-color: #08717a; }
progress::-webkit-progress-bar { border-radius: 999px; background: #ded7cc; }
progress::-webkit-progress-value { border-radius: 999px; background: #08717a; }
progress::-moz-progress-bar { border-radius: 999px; background: #08717a; }

.card { min-height: 24rem; padding: clamp(1.3rem, 5vw, 2.7rem); border: 1px solid #e0d9ce; border-radius: clamp(1rem, 3vw, 1.5rem); background: #fffdf9; box-shadow: 0 1.2rem 3.5rem rgba(55, 45, 29, .09); }
.prompt { max-width: 42rem; margin: 0 0 1.65rem; font-size: clamp(1.22rem, 3.1vw, 1.55rem); font-weight: 700; line-height: 1.48; letter-spacing: -.018em; }
.instruction { margin: 0 0 .75rem; color: #63717b; font-size: .94rem; line-height: 1.45; }
.choice-list { display: grid; gap: .7rem; margin: 0; padding: 0; border: 0; list-style: none; }
.choice { display: flex; min-height: 58px; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid #d6d1c8; border-radius: .9rem; background: #fff; color: #263641; line-height: 1.5; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.choice:hover { border-color: #77a0a4; background: #f4fbfa; box-shadow: 0 .35rem .9rem rgba(32, 74, 76, .08); }
.choice:has(input:checked), .choice.is-selected { border: 2px solid #08717a; padding: calc(.9rem - 1px) calc(1rem - 1px); background: #e9f6f4; box-shadow: 0 .35rem .9rem rgba(8, 113, 122, .12); }
.choice.is-correct { border: 2px solid #20734d; padding: calc(.9rem - 1px) calc(1rem - 1px); background: #e9f6ed; }
.choice.is-not-correct { border: 2px solid #a3422a; padding: calc(.9rem - 1px) calc(1rem - 1px); background: #fff0eb; }
.choice input { width: 1.2rem; height: 1.2rem; margin: .12rem 0 0; flex: 0 0 auto; accent-color: #08717a; }
.choice-label { margin-right: .22rem; color: #08717a; font-weight: 850; }
.choice-verdict { align-self: center; margin-left: auto; padding: .23rem .5rem; border-radius: 999px; background: #fffdf9; color: inherit; font-size: .76rem; line-height: 1.1; white-space: nowrap; }
.cloze-label { display: grid; gap: .55rem; }
.cloze-label input { width: 100%; min-height: 56px; padding: .7rem .85rem; border: 1px solid #627d80; border-radius: .8rem; background: #fff; color: #1b2734; font-size: 1.05rem; }
.cloze-label input:focus { border-color: #08717a; }
.cloze-label input:disabled { background: #f0ede7; }

.validation { margin: 1rem 0 0; padding: .8rem .95rem; border-left: 4px solid #a3422a; border-radius: .45rem; background: #fff0eb; color: #7f2e20; font-weight: 750; line-height: 1.45; }
.action-row { margin-top: 1.35rem; justify-content: flex-end; flex-wrap: wrap; }
.primary-button, .secondary-button { min-height: 48px; padding: .7rem 1.1rem; border: 1px solid transparent; border-radius: .78rem; font-weight: 800; line-height: 1.15; }
.primary-button { background: #08717a; color: #fff; box-shadow: 0 .3rem .65rem rgba(8, 113, 122, .18); }
.primary-button:hover { background: #075e66; }
.secondary-button { border-color: #bdb7ad; background: #fffdf9; color: #33434d; }
.secondary-button:hover { border-color: #718e91; background: #f4fbfa; }

.feedback { margin-top: 1.8rem; padding-top: 1.5rem; border-top: 1px solid #ded8ce; }
.result { display: inline-flex; align-items: center; min-height: 34px; margin: 0 0 1rem; padding: .35rem .7rem; border-radius: 999px; font-size: .9rem; font-weight: 850; }
.result.correct { background: #e3f4e9; color: #17633a; }.result.incorrect { background: #fff0eb; color: #8a321f; }
.result:focus { outline: 3px solid #176d75; outline-offset: 3px; }
.answer, .feedback-copy, .layer p, .layer li { line-height: 1.68; }
.answer { margin: .45rem 0 1.2rem; font-size: 1.04rem; font-weight: 650; }
.layer { margin: 1.15rem 0; padding-top: 1.15rem; border-top: 1px solid #ece7de; }
.layer h2 { margin: 0 0 .45rem; color: #40535e; font-size: .78rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.layer p { margin: 0; }.layer ol { display: grid; gap: .45rem; margin: .4rem 0 0; padding-left: 1.35rem; }
details { margin-top: 1rem; border: 1px solid #e1dcd3; border-radius: .85rem; background: #faf8f3; }
details[open] { background: #f4f8f6; }
summary { min-height: 48px; padding: .85rem 1rem; color: #344951; cursor: pointer; font-weight: 800; }
details p { margin: 0; padding: 0 1rem 1rem; line-height: 1.62; }
.completion { max-width: 31rem; margin: 2rem auto; text-align: center; }.completion h2 { margin: .35rem 0 .7rem; font-size: clamp(1.65rem, 4vw, 2.2rem); letter-spacing: -.045em; }.status { color: #17633a; font-weight: 850; }.help { color: #63717b; line-height: 1.55; }
ruby rt { color: #08717a; font-size: .58em; font-weight: 700; user-select: none; } body[data-furigana="off"] ruby rt { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 560px) {
  .shell { width: min(100% - 1rem, 760px); padding-top: 1rem; }
  .topbar { gap: .65rem; }.quiet-button { max-width: 8.3rem; padding-inline: .7rem; }
  .progress-copy { gap: .5rem; }.card { min-height: 28rem; padding: 1.2rem; border-radius: 1rem; }
  .prompt { margin-bottom: 1.35rem; }.action-row { align-items: stretch; justify-content: stretch; }.action-row button { flex: 1 1 10rem; }
  #item-region > .action-row { position: sticky; z-index: 2; bottom: 0; margin-right: -.2rem; margin-left: -.2rem; padding: .85rem .2rem max(.15rem, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(255,253,249,0), #fffdf9 28%); }
}

@media (min-width: 680px) { .feedback-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, .8fr); gap: 1.5rem; align-items: start; }.feedback-grid .layer { margin-top: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
