:root {
  color-scheme: light;
  --bg: #f6f7f2; --surface: #fffefa; --ink: #172c24; --muted: #4b6056;
  --line: #d5ded3; --soft: #e8efe5; --accent: #295944; --on-accent: #fff;
  --hero: #193c30; --hero-ink: #f4f8ee; --hero-muted: #d4e4d8;
  --good-bg: #e2f0e4; --good: #205631; --bad-bg: #fae8e1; --bad: #852f24;
  --focus: #346c55; --shadow: 0 5px 22px #1c392309;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131d19; --surface: #1c2923; --ink: #edf4ed; --muted: #bbcbbf;
  --line: #41554a; --soft: #253b30; --accent: #a8d1b8; --on-accent: #133023;
  --hero: #214638; --hero-ink: #f4f8ee; --hero-muted: #d4e4d8;
  --good-bg: #233d2d; --good: #b8e4bd; --bad-bg: #482b28; --bad: #ffd1c5;
  --focus: #b1dbbf; --shadow: 0 5px 22px #0002;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 system-ui, sans-serif; }
button, select, input { font: inherit; }
button, select {
  min-height: 46px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: .75rem; padding: .6rem .95rem; font-weight: 650;
}
button { cursor: pointer; transition: background-color .15s, border-color .15s; }
button:hover:not(:disabled) { background: var(--soft); border-color: var(--focus); }
button:disabled { cursor: default; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button.primary:hover:not(:disabled) { background: var(--ink); color: var(--surface); }
button.primary:disabled { opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.18; overflow-wrap: anywhere; }
h1, h2 { letter-spacing: -.035em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.17rem; letter-spacing: -.02em; }
small, .muted { color: var(--muted); }
small { font-size: .875rem; }
.skip { position: fixed; top: .5rem; left: .5rem; color: var(--ink); background: var(--surface); padding: .7rem; z-index: 2; transform: translateY(-180%); }
.skip:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner, main, footer { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.header-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { padding: .2rem; display: flex; gap: .42rem; align-items: center; border: 0; white-space: nowrap; }
.mark, .mode-icon { display: inline-grid; place-items: center; border-radius: .7rem; background: var(--soft); color: var(--accent); width: 2.35rem; height: 2.35rem; font-size: 1.25rem; }
.brand-secondary { color: var(--muted); font-weight: 500; }
.theme { min-width: 46px; padding: .2rem; font-size: 1.2rem; }
main { padding-block: clamp(1.15rem, 4vw, 2.5rem); min-height: 70vh; }
footer { padding: 1.4rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.stack { display: grid; gap: 1.5rem; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; padding: clamp(1.45rem, 5vw, 3.5rem);
  border-radius: 1.5rem; background: var(--hero); color: var(--hero-ink); min-height: 17rem;
}
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; width: 26rem; aspect-ratio: 1; right: -5rem; bottom: -14rem;
  border: 1px solid #d6ebd748; border-radius: 43% 57% 45% 55%; transform: rotate(34deg);
  box-shadow: 0 0 0 20px #d6ebd719, 0 0 0 45px #d6ebd712, 0 0 0 75px #d6ebd70c, 0 0 0 110px #d6ebd709;
}
.hero::after { right: -10rem; bottom: -11rem; transform: rotate(65deg); }
.eyebrow { font-size: .875rem; letter-spacing: .075em; text-transform: uppercase; font-weight: 700; }
.hero h1 { font-size: clamp(2rem, 5.3vw, 4rem); line-height: 1.02; max-width: 13ch; margin-bottom: .85rem; }
.hero p { color: var(--hero-muted); }
.stats, .actions, .card-meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.stats { margin-top: 1.55rem; }
.stats span { border: 1px solid #d6ebd76b; border-radius: 99px; padding: .32rem .78rem; font-size: .875rem; background: var(--hero); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.mode, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; box-shadow: var(--shadow); }
.mode { text-align: left; display: grid; align-content: start; justify-items: start; gap: .55rem; padding: 1rem; overflow-wrap: anywhere; }
.mode:disabled { color: var(--muted); box-shadow: none; }
.mode-icon { margin-bottom: .15rem; }
.mode small { font-weight: 450; }
.panel { padding: clamp(1rem, 3.6vw, 2rem); }
.compact { width: min(100%, 49rem); margin-inline: auto; }
.tight { display: grid; gap: .85rem; }
.resume { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; }
.fields { display: grid; gap: .9rem; }
.fields label { display: grid; gap: .35rem; font-weight: 650; min-width: 0; }
.fields select { width: 100%; min-width: 0; }
.fields .toggle { display: flex; align-items: center; min-height: 46px; gap: .65rem; }
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.quiz-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; }
.quiz-head strong { font-variant-numeric: tabular-nums; }
progress { display: block; appearance: none; width: 100%; height: .55rem; border: 0; border-radius: 99px; overflow: hidden; background: var(--soft); accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--soft); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.pill { justify-self: start; display: inline-block; border-radius: .55rem; background: var(--soft); color: var(--accent); padding: .28rem .57rem; font-size: .875rem; font-weight: 700; }
.options { display: grid; gap: .55rem; }
.choice { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; text-align: left; gap: .65rem; min-height: 56px; overflow-wrap: anywhere; }
.letter { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .48rem; background: var(--soft); }
.choice.selected { background: var(--soft); border-color: var(--focus); }
.choice.good, .good { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.choice.bad, .bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.feedback { border-radius: .7rem; padding: .8rem .95rem; overflow-wrap: anywhere; }
.feedback small { display: block; }
.spread { justify-content: space-between; }
.score { font-size: clamp(2.4rem, 10vw, 4rem); line-height: 1; font-weight: 750; letter-spacing: -.06em; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: .5rem; margin: 0; }
.metrics div { background: var(--soft); border-radius: .65rem; padding: .6rem .8rem; }
.metrics dt { font-size: .875rem; color: var(--muted); }
.metrics dd { font-weight: 750; margin: 0; }
.rows { display: grid; gap: .55rem; list-style: none; padding: 0; margin: 0; }
.row { border-bottom: 1px solid var(--line); padding: .65rem 0; display: grid; gap: .45rem; overflow-wrap: anywhere; }
.row:last-child { border-bottom: 0; }
.row small { display: block; }
details summary { cursor: pointer; padding-block: .55rem; font-weight: 650; overflow-wrap: anywhere; }
details .options { margin: .5rem 0; }
#notice { padding: .65rem; border-radius: .5rem; margin-bottom: 1rem; background: var(--bad-bg); color: var(--bad); }
dialog { width: min(28rem, calc(100% - 2rem)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem; }
dialog p { margin-block: .7rem 1rem; }
dialog::backdrop { background: #0a1b14a0; }
@media (max-width: 56rem) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 24rem) { .modes { grid-template-columns: 1fr; } .hero::before, .hero::after { right: -16rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
