:root {
  --ink: #1c1915;
  --muted: #6f685e;
  --paper: #f3efe6;
  --card: #fbf8f3;
  --line: #e4dccf;
  --line-strong: #d3c8b6;
  --forest: #14342b;
  --forest-deep: #0e2821;
  --green: #1d6b45;
  --green-bg: #e7f3ec;
  --rose: #8e2f2a;
  --rose-bg: #f8ecea;
  --amber: #8a5a12;
  --amber-bg: #f8f0e2;
  --mark: #3d4f86;
  --mark-bg: #eef1f8;
  --gutter: 20px;
  --shell: min(1120px, calc(100% - 2 * var(--gutter)));
  --radius: 16px;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (min-width: 720px) {
  :root { --gutter: 28px; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; max-width: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(20, 52, 43, .05), transparent 60%),
    var(--paper);
  color: var(--ink);
  font: 16.5px/1.55 var(--sans);
  letter-spacing: -.011em;
  font-feature-settings: "ss01";
}
img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 0; }
h2 { font-size: 1.55rem; margin: 0; }
h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 650; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: #d7ebe1; color: var(--ink); }
.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  transform: translateY(-120%);
  background: var(--card);
  padding: 8px 12px;
  border-radius: 999px;
  z-index: 50;
}
.skip:focus { transform: none; top: 8px; }
.shell { width: var(--shell); margin-inline: auto; }
.exam { --shell: min(1180px, calc(100% - 2 * var(--gutter))); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  background: rgba(243, 239, 230, .9);
  border-bottom: 1px solid transparent;
  padding-top: env(safe-area-inset-top);
}
@supports (backdrop-filter: blur(16px)) {
  .site-header { backdrop-filter: blur(16px); }
}
.bar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.03em;
  font-size: 1.35rem;
  flex: 0 0 auto;
}
.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--forest);
  color: #f4efe6;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: 0;
}
.nav-toggle {
  cursor: pointer;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
}
.site-nav { display: none; }
.site-nav a, .linkish {
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  width: fit-content;
}
.site-nav a.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--forest);
  color: #f4efe6;
  min-height: 40px;
  padding: 0 16px;
}
.site-nav a.nav-cta:hover { background: var(--forest-deep); }
.site-nav form { margin: 0; display: flex; }
@media (max-width: 899px) {
  .site-nav.is-open {
    display: grid;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(28, 25, 21, .08);
  }
  .site-nav.is-open a, .site-nav.is-open .linkish {
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    color: var(--ink);
  }
  .site-nav.is-open a.nav-cta { margin-top: 4px; color: #f4efe6; }
  .site-nav.is-open form { display: block; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 2px;
    min-width: 0;
  }
  .site-nav a, .site-nav .linkish { padding: 8px 12px; }
  .site-nav a:hover, .site-nav .linkish:hover { color: var(--ink); background: rgba(28, 25, 21, .04); }
  .site-nav a.nav-cta { margin-left: 8px; color: #f4efe6; }
  .site-nav a.nav-cta:hover { background: var(--forest-deep); color: #f4efe6; }
}

.confirm-bar {
  background: #efe6d4;
  border-bottom: 1px solid var(--line);
}
.confirm-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.confirm-inner p { font-size: .95rem; }
.confirm-inner form { margin: 0; }

.flash-bar { width: 100%; padding-top: 18px; }
.flash {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--green-bg);
  border: 1px solid #c9e4d4;
}
.flash-bad { background: var(--rose-bg); border-color: #f0d0cc; color: var(--rose); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-block: 36px 64px;
}
@media (min-width: 720px) {
  main { gap: 64px; padding-block: 48px 80px; }
}
.home main { gap: 56px; }
.auth main { justify-content: center; padding-block: 32px 64px; }
.exam main { padding-block: 16px 40px; gap: 16px; }

.page-head { display: flex; flex-direction: column; gap: 12px; max-width: 40rem; }
.page-head.full { max-width: none; }
.page-head .actions, .hero .actions { margin-top: 4px; }
.kicker {
  margin: 0;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 650;
  color: var(--forest);
}
.lead, .meta { color: var(--muted); }
.lead { font-size: 1.15rem; max-width: 36rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.hero { display: grid; gap: 36px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 18px; max-width: 38rem; }
.home h1 {
  font-size: clamp(2.7rem, 6.4vw, 4.7rem);
  line-height: .96;
  font-weight: 500;
  letter-spacing: -.04em;
}
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric { padding: 18px 16px 18px 0; display: flex; flex-direction: column; gap: 4px; }
.metric dd { margin: 0; order: 1; font-family: var(--serif); font-size: clamp(1.45rem, 2vw, 1.9rem); letter-spacing: -.03em; }
.metric dt { order: 2; color: var(--muted); font-size: .92rem; }
@media (min-width: 800px) {
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .metric + .metric { border-left: 1px solid var(--line); padding-left: 22px; }
}
@media (min-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 56px; }
}

.desk {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(28, 25, 21, .05);
}
.desk-top, .desk-q {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .82rem;
}
.desk-time {
  font-family: var(--mono);
  color: var(--forest);
  background: #e7f3ec;
  border-radius: 999px;
  padding: 2px 8px;
}
.desk-stem { font-size: 1.05rem; line-height: 1.45; }
.desk-opt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-size: .95rem;
}
.desk-opt span {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  font-size: .8rem;
  font-weight: 650;
}
.desk-opt.is-on { border-color: var(--forest); }
.desk-opt.is-on span { background: var(--forest); color: #f4efe6; border-color: var(--forest); }
.desk-pal { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.desk-pal i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: block;
}
.desk-pal .ok { background: var(--green-bg); border-color: #b7dfc4; }
.desk-pal .no { background: var(--rose-bg); border-color: #e4b4b4; }
.desk-pal .mark { background: var(--mark-bg); border-color: #d5dced; }
.desk-note { color: var(--muted); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }

.facts, .cards, .stat-row { display: grid; gap: 12px; }
.facts { grid-template-columns: 1fr; }
.stat-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); align-items: stretch; }
@media (min-width: 520px) {
  .facts { grid-template-columns: 1fr 1fr; }
}
.fact, .card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.panel { display: flex; flex-direction: column; gap: 12px; }
.fact { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 96px; }
.fact strong { font-family: var(--serif); font-size: 1.55rem; letter-spacing: -.03em; font-weight: 500; }
.fact span, .stat-row .fact { color: var(--muted); font-size: .92rem; }
.stat-row .fact strong { color: var(--ink); display: block; }
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  height: 100%;
  transition: border-color .15s ease, transform .15s ease;
}
.card-link { text-decoration: none; color: inherit; }
.card-cover, .package-cover {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #e7e1d6;
}
.card .card-cover {
  align-self: stretch;
  width: auto;
  margin: -18px -18px 6px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.package-cover { border-radius: 16px; margin: 0 0 16px; max-height: 280px; }
.price {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -.03em;
}
.price span { font-family: var(--sans); font-size: 1rem; letter-spacing: 0; color: var(--muted); font-weight: 600; }
.card-action { margin-top: auto; padding-top: 8px; }
.text-link {
  color: var(--forest);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.text-link:hover { border-bottom-color: var(--forest); }
.block { display: flex; flex-direction: column; gap: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 650;
  background: rgba(28, 25, 21, .05);
  color: var(--ink);
}
.badge.lock { background: var(--amber-bg); color: var(--amber); }
.badge.free { background: var(--green-bg); color: var(--green); }
.soon { border-style: dashed; background: transparent; color: var(--muted); }
.soon h2 { color: var(--ink); }
.split, .grid-2 { display: grid; gap: 12px; }
@media (min-width: 768px) {
  .split, .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (hover: hover) {
  .card:hover, .card-link:hover { border-color: var(--forest); transform: translateY(-1px); }
}

.btn, .exam-nav button, .section-tab, dialog button[data-close] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #f4efe6;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
  font-weight: 600;
}
.btn.secondary, .exam-nav button, .section-tab, dialog button[data-close] {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
  font-weight: 600;
}
.btn.danger, .exam-nav .primary {
  background: var(--forest);
  color: #f4efe6;
  border-color: var(--forest);
}
.btn.danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn:hover, .exam-nav button:hover, .section-tab:hover { border-color: var(--forest); }
.btn:hover { background: var(--forest-deep); }
.btn.secondary:hover, .exam-nav button:hover, .section-tab:hover, dialog button[data-close]:hover {
  background: rgba(20, 52, 43, .05);
  color: var(--ink);
}
.btn.danger:hover { background: #7a2824; border-color: #7a2824; color: #fff; }
.exam-nav .primary:hover { background: var(--forest-deep); color: #f4efe6; border-color: var(--forest); }
.linkish { color: var(--muted); text-decoration: none; }
button.linkish {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 0;
  font: inherit;
  cursor: pointer;
}
.linkish:hover { color: var(--ink); }
.site-nav form { margin: 0; }
.auth-card {
  width: min(100%, 28rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 24px;
}
.auth-card form.form,
.panel form.form,
main form.form {
  display: grid;
  gap: 16px;
  width: min(100%, 40rem);
}
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: auto; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
label { display: grid; gap: 6px; font-size: .92rem; font-weight: 650; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 550; }
label.check input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; accent-color: var(--forest); }
.form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]),
.form textarea,
.form select,
input[type="text"], input[type="email"], input[type="password"], input:not([type]), input[type="file"], textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}
input[type="text"], input[type="email"], input[type="password"], input:not([type]), select { min-height: 46px; }
input[type="file"] { padding: 8px; background: #fff; }
textarea { min-height: 14rem; resize: vertical; font-family: var(--mono); font-size: .92rem; }
input[type="checkbox"] { width: auto; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--forest); outline-offset: 1px; border-color: var(--forest); }
.form input:user-invalid, .form textarea:user-invalid { border-color: var(--rose); }
.form-error { color: var(--rose); background: #f8ece8; border-radius: 12px; padding: 10px 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .9rem;
}
.filters a:hover { border-color: var(--forest); }

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; min-width: 36rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  background: rgba(255, 255, 255, .45);
}
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.subnav a {
  flex: 0 0 auto;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .9rem;
}
.subnav a:hover { border-color: var(--forest); }

.site-footer {
  width: 100%;
  margin-top: auto;
  background: var(--forest);
  color: #d7e4dc;
  font-size: .95rem;
  padding: 36px 0 calc(28px + env(safe-area-inset-bottom));
}
.footer-grid { display: grid; gap: 28px; }
.footer-grid p { margin: 0 0 8px; max-width: 36rem; }
.footer-brand {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: #f4efe6;
  letter-spacing: -.03em;
}
.footer-label {
  margin: 0 0 10px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #b7c9c0;
  font-weight: 650;
}
.site-footer a { color: #f4efe6; text-decoration: none; border-bottom: 1px solid transparent; }
.site-footer a:hover { border-bottom-color: #f4efe6; }
.footer-end { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(244, 239, 230, .2); }
.footer-end p { margin: 0; color: #b7c9c0; font-size: .85rem; }
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.4fr .8fr .9fr; align-items: start; }
}
@media (max-width: 640px) {
  .package-cover { max-height: 200px; }
}

.exam-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}
.exam-top {
  display: grid;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.exam-title { min-width: 0; }
.exam-title h1 { font-size: clamp(1.35rem, 2vw, 1.8rem); overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
.exam-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.timer {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--forest);
  color: #f4efe6;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: .95rem;
}
.exam-tools .btn { width: 100%; }
@media (min-width: 760px) {
  .exam-top { grid-template-columns: minmax(0, 1fr) auto; }
  .exam-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
  .timer { grid-column: auto; width: auto; }
  .exam-tools .btn { width: auto; }
}
.exam-grid { display: grid; gap: 22px; margin-top: 18px; }
.exam-main, .palette-aside, .stem, .opt-body, .figure-frame { min-width: 0; max-width: 100%; }
.q-meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.stem-text { font-size: 1.16rem; line-height: 1.55; }
.math-scroll, mjx-container[display="true"] { overflow-x: auto; max-width: 100%; }
.figure-frame {
  margin: 4px 0;
  padding: 12px;
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  justify-content: center;
}
.figure-frame img { max-width: 100%; max-height: 360px; width: auto; height: auto; object-fit: contain; }
.options { border: 0; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.options legend { padding: 0; font-size: .9rem; color: var(--muted); }
.opt {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
}
li.opt { grid-template-columns: auto minmax(0, 1fr); cursor: default; }
.opt input { width: 1.05rem; height: 1.05rem; margin-top: .35rem; accent-color: var(--forest); }
.opt-key {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  font-weight: 650;
  font-size: .85rem;
}
.opt:has(input:checked), .is-selected { border-color: var(--forest); background: #f4faf7; }
.opt:has(input:checked) .opt-key, .is-selected .opt-key { background: var(--forest); color: #f4efe6; border-color: var(--forest); }
.is-correct { border-color: var(--green); }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.flag { font-size: .75rem; font-weight: 650; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 8px; }
.flag-ok { border-color: #b7dfc4; color: var(--green); background: var(--green-bg); }
.exam-nav, .section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 639px) {
  .exam-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .exam-nav button { width: 100%; }
  .exam-nav .primary { grid-column: 1 / -1; }
  .section-nav { display: flex; }
}
.palette-aside { display: none; }
.palette-aside h2 { margin-bottom: 10px; font-size: 1.2rem; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.pal, .swatch {
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  font: inherit;
  cursor: pointer;
  padding: 2px;
}
.pal { grid-template-rows: auto auto; }
.pal-glyph, .swatch { font-size: .7rem; }
.pal.is-current { outline: 2px solid var(--forest); outline-offset: 1px; }
.state-not-visited { background: #fff; }
.state-not-answered { background: var(--rose-bg); border-color: #e4b4b4; }
.state-answered { background: var(--green-bg); border-color: #b7dfc4; }
.state-marked { background: var(--mark-bg); border-color: #d5dced; }
.state-answered-marked { background: var(--green-bg); border-color: var(--mark); box-shadow: inset 0 0 0 2px var(--mark); }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: .8rem; }
.legend li { display: flex; gap: 8px; align-items: center; }
.swatch { min-height: 22px; min-width: 22px; cursor: default; }
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  max-width: calc(100vw - 2 * var(--gutter));
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(28, 25, 21, .16);
}
dialog.sheet { width: min(100%, 40rem); margin: auto auto 0; max-height: 85vh; overflow: auto; }
dialog.confirm { width: min(100% - 2 * var(--gutter), 28rem); }
dialog::backdrop { background: rgba(28, 25, 21, .45); }
dialog h2 { margin-bottom: 8px; }
dialog ul { margin: 8px 0 16px; padding-left: 1.1rem; display: grid; gap: 4px; }
dialog .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 699px) {
  dialog.sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-end-start-radius: 0;
    border-end-end-radius: 0;
  }
}
@media (min-width: 900px) {
  .palette-aside { display: block; position: sticky; top: 84px; }
  .palette-toggle { display: none; }
  .exam-grid { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
}
.pay-grid { display: grid; gap: 16px; }
.pay-copy { display: flex; flex-direction: column; gap: 8px; }
.qr { width: min(100%, 220px); height: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
@media (min-width: 800px) {
  .pay-grid { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
  .pay-grid .qr { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
}
.mono { font-family: var(--mono); word-break: break-word; font-size: .92em; }
.outcome-correct { color: var(--green); font-weight: 650; }
.outcome-wrong { color: var(--rose); font-weight: 650; }
pre.result {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--forest);
  color: #f4efe6;
  padding: 16px;
  border-radius: 14px;
  overflow: auto;
  max-width: 100%;
  margin: 0;
}
main ul:not(.legend):not(.options), main ol { margin: 0; padding-left: 1.15rem; display: grid; gap: 6px; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
