:root {
  color-scheme: light;
  --ink: #203c32;
  --text: #253a32;
  --muted: #596b62;
  --green: #244c3d;
  --green-dark: #173a30;
  --paper: #f8f7f2;
  --white: #fffefa;
  --border: #dddeda;
  --pale: #edf3ec;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font: 16px/1.55 var(--sans);
  color: var(--text);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #b57a39; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--white); border-bottom: 1px solid #e8e8e0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 16px; }
.brand { padding: 0; border: 0; background: none; }
.brand img { display: block; width: 168px; height: auto; }
nav { display: flex; align-items: center; gap: 8px; }
.nav-button { display: flex; align-items: center; gap: 7px; border: 0; background: none; border-radius: 8px; padding: 9px 14px; color: var(--muted); font-size: .9rem; font-weight: 650; }
.nav-button:hover, .nav-button[aria-current] { background: var(--pale); color: var(--ink); }
main { padding-block: 32px 38px; min-height: calc(100vh - 150px); }
main:focus, [tabindex="-1"]:focus { outline: none; }
h1,h2,h3,p { margin: 0; }
h1,h2 { font-family: var(--serif); color: var(--ink); line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.05rem); }
h3 { line-height: 1.35; }
.muted { color: var(--muted); }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.section-heading { margin: 29px 0 14px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.home-heading { margin-top: 0; }
.home-heading h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
.section-heading p { margin-top: 5px; }
.deck-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.panel, .deck { border: 1px solid var(--border); border-radius: 17px; background: var(--white); box-shadow: 0 3px 9px #1f352605; }
.deck { padding: 23px 25px 20px; }
.deck-top, .deck-foot, .row, .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.deck-top, .deck-foot, .spread { justify-content: space-between; }
.deck-icon { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 12px; background: #e8f0e9; color: #2d604a; }
.deck-icon .icon { width: 24px; height: 24px; }
.bonus .deck-icon { background: #f5ecdc; color: #865d2e; }
.deck h3 { font: bold clamp(1.4rem, 3vw, 1.65rem)/1.2 var(--serif); margin: 13px 0 5px; }
.deck p { color: var(--muted); }
.deck-foot { border-top: 1px solid #e9e9e2; padding-top: 15px; margin-top: 18px; }
.tag { font-size: .83rem; color: var(--green); background: #edf3ec; padding: 4px 10px; border-radius: 99px; font-weight: 700; }
.bonus .tag { color: #725025; background: #f6eedf; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: var(--green); color: white; border-radius: 9px; padding: 9px 15px; font-weight: 680; min-height: 42px; text-align: center; }
.button:hover:not(:disabled) { background: var(--green-dark); }
.button.secondary { color: var(--ink); background: var(--white); border-color: #d5dcd2; }
.button.secondary:hover:not(:disabled) { background: var(--pale); }
.button.flat { background: transparent; color: var(--green); padding-inline: 7px; }
.button.flat:hover:not(:disabled) { background: var(--pale); }
.recent { margin-top: 24px; padding: 17px 22px; }
.recent-content { flex: 1; min-width: 170px; }
.site-footer { border-top: 1px solid #e3e4dc; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 20px; font-size: .85rem; color: var(--muted); }
.site-footer span:first-child { font-family: var(--serif); font-weight: bold; color: var(--green); }
.page-head { margin-bottom: 21px; }
.page-head h1 { margin-block: 4px 7px; }
.page-head > .button { margin-left: -7px; }
.setup { max-width: 730px; padding: clamp(18px, 4vw, 30px); }
fieldset { border: none; padding: 0; margin: 0 0 23px; min-inline-size: 0; }
legend { font-weight: 750; margin-bottom: 10px; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.choice-grid label, .check-row { position: relative; cursor: pointer; display: flex; gap: 8px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 9px; align-items: center; }
.choice-grid label:has(:checked) { background: var(--pale); border-color: #759685; }
input { accent-color: var(--green); }
.check-row { border: 0; padding: 0; margin-bottom: 23px; width: fit-content; }
.quiz-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px, 315px); align-items: start; gap: 19px; }
.quiz-main, .quiz-side { padding: clamp(15px, 3vw, 24px); }
.quiz-side { position: sticky; top: 16px; }
.quiz-top { margin-bottom: 13px; }
progress { display: block; width: 100%; height: 8px; appearance: none; border: none; border-radius: 999px; background: #e7ece5; overflow: hidden; }
progress::-webkit-progress-bar { background: #e7ece5; }
progress::-webkit-progress-value, progress::-moz-progress-bar { background: #588269; }
progress::-webkit-progress-value { background: #588269; }
.quiz-question { margin: 22px 0 17px; font: bold clamp(1.24rem,3vw,1.56rem)/1.38 var(--serif); }
.option { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 9px; min-height: 55px; }
.option:hover:not(:disabled) { background: #f6f8f3; border-color: #9eb4a4; }
.option.picked { border-color: #729682; background: var(--pale); }
.option.correct { border-color: #729682; background: #e7f1e8; }
.option.wrong { border-color: #c78773; background: #f9ebe6; }
.option:disabled { opacity: 1; }
.letter { width: 31px; height: 31px; display: grid; place-items: center; flex: none; border-radius: 8px; background: #eff0eb; font-weight: 750; }
.picked .letter, .correct .letter { background: var(--green); color: white; }
.wrong .letter { background: #943f2c; color: white; }
.feedback { font-weight: 700; margin-top: 12px; }
.feedback.bad { color: #84362a; }
.quiz-actions { border-top: 1px solid #e6e7e1; margin-top: 18px; padding-top: 15px; }
.grid { margin: 13px 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(38px,1fr)); gap: 6px; max-height: 255px; overflow: auto; padding: 4px; }
.q-number { border: 1px solid #dcdfd8; border-radius: 6px; min-height: 37px; background: var(--white); position: relative; padding: 3px; font-size: .875rem; }
.q-number.answered { background: #e2ede3; color: #234a39; }
.q-number.current { border: 2px solid var(--green); font-weight: 750; }
.q-number.marked::after { position: absolute; content: ''; inset: 3px 3px auto auto; width: 6px; height: 6px; background: #af7131; border-radius: 50%; }
.side-actions { margin-top: 13px; display: grid; gap: 8px; }
.tiny { font-size: .86rem; }
.result-banner { padding: clamp(17px,4vw,30px); }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(115px,1fr)); gap: 9px; margin-block: 17px; }
.stat { padding: 13px; border-radius: 11px; background: var(--pale); }
.stat b { display: block; color: var(--green); font-size: 1.4rem; }
.review { padding: 13px 16px; margin-top: 9px; }
.review summary { cursor: pointer; font-weight: 650; }
.review ul { padding-left: 25px; }
.result-list { display: grid; gap: 9px; }
.result-row { width: 100%; padding: 15px 18px; text-align: left; }
.result-row:hover { border-color: #7f9e8a; }
.empty { padding: 20px; }
dialog { color: var(--text); width: min(95vw,465px); background: var(--white); border: 1px solid var(--border); border-radius: 17px; padding: 23px; }
dialog p { margin: 9px 0 15px; }
dialog::backdrop { background: #152d27a0; }
#storage-alert { position: fixed; bottom: 10px; left: 10px; right: 10px; max-width: 550px; z-index: 5; background: #f7ecd5; border: 1px solid #c5a365; padding: 10px; border-radius: 8px; }
@media (max-width: 740px) {
  .shell { width: calc(100% - 32px); }
  main { padding-top: 18px; }
  .quiz-layout { grid-template-columns: 1fr; }
  .quiz-side { position: static; }
  .deck { padding: 17px; }
}
@media (max-width: 500px) {
  .header-inner { min-height: 64px; gap: 6px; }
  .brand img { width: 122px; }
  nav { gap: 2px; }
  .nav-button { padding-inline: 8px; font-size: .81rem; }
  .deck-grid { grid-template-columns: 1fr; gap: 12px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
