@view-transition { navigation: auto; }

:root {
  --bg: #0F0F11;
  --bg-deep: #0B0B0D;
  --card: #141417;
  --surface: #16161A;
  --rule: #26262B;
  --rule-2: #2C2C32;
  --rule-3: #34343A;
  --rule-strong: #4A4A52;
  --text-strong: #F4F2EE;
  --text: #E9E6E1;
  --text-soft: #CFCBC5;
  --muted: #A6A29C;
  --muted-2: #8C8C93;
  --faint: #6A6A72;
  --accent: #E3B04B;
  --accent-on-light: #7A5A12;
  --label: #EFEDE9;
  --ink: #0F0F11;
  --ink-soft: #33333A;
  --ink-body: #1B1B1F;
  --wrong: #E2725B;
  --wrong-tint: rgba(226, 114, 91, 0.10);
  --right: #6FBF8B;
  --right-tint: rgba(111, 191, 139, 0.10);
  --spiresen: #A9B8C6;
  --bar: #5C6B78;
  --display: "Playfair Display", Georgia, serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --fast: 180ms ease;
  --mid: 240ms ease;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
}
main { flex: 1 0 auto; }
a { color: var(--text); transition: color var(--fast), border-color var(--fast), background-color var(--fast); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.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; }

.wrap { max-width: 1280px; margin: 0 auto; padding-inline: 32px; width: 100%; }
@media (max-width: 720px) { .wrap { padding-inline: 16px; } }

.display { font-family: var(--display); font-style: italic; font-weight: 700; color: var(--text-strong); }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2); }
.label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.spiresen { font-family: var(--display); font-style: italic; color: var(--spiresen); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); view-transition-name: site-header; }
.header-inner { padding-block: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.logo { display: block; width: 38px; height: 38px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 28px; font-size: 15px; }
.main-nav a { text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--text-strong); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 8px; }
@media (min-width: 721px) {
  .header-inner { justify-content: flex-start; column-gap: 48px; }
}
.header-spiresen { margin-left: auto; display: block; text-decoration: none; transition: opacity var(--fast); }
.header-spiresen img { display: block; width: auto; height: 32px; }
.header-spiresen:hover { opacity: 0.8; }
@media (max-width: 720px) {
  .brand { order: 0; }
  .header-spiresen { order: 1; }
  .header-spiresen img { height: 28px; }
  .menu-btn { order: 2; }
  .main-nav { order: 3; }
}
.menu-btn { display: none; width: 44px; height: 44px; place-items: center; background: transparent; border: 1px solid var(--rule-3); color: var(--text); padding: 0; }
@media (max-width: 720px) {
  .header-inner { padding-block: 12px; }
      .menu-btn { display: grid; }
  .main-nav { display: none; width: 100%; flex-direction: column; gap: 0; border-top: 1px solid var(--rule); }
  .main-nav.open { display: flex; }
  .main-nav a { min-height: 48px; display: flex; align-items: center; border-bottom: 1px solid var(--rule); }
  .main-nav a:last-child { border-bottom: 0; }
}

/* Footers */
.site-footer { border-top: 1px solid var(--rule); background: var(--bg-deep); }
.site-footer .wrap { padding-block: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted-2); }
.site-footer a { color: var(--muted-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer.big .wrap { padding-block: 28px 32px; align-items: flex-end; gap: 20px 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand { gap: 10px; }
.footer-logo { display: block; width: auto; height: 34px; }
.footer-note { margin: 0; font-size: 13px; color: var(--muted-2); }
.site-footer .footer-note a, .site-footer .atelier-link { color: var(--muted); text-decoration: underline; text-decoration-color: var(--rule-3); text-underline-offset: 3px; }
.site-footer .footer-note a:hover, .site-footer .atelier-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.disclaimer { margin: 0; max-width: 40rem; font-size: 13px; line-height: 1.6; color: var(--muted-2); }
.disclaimer a { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding-inline: 18px; font-size: 15px; text-decoration: none;
  background: transparent; color: var(--text-strong); border: 1px solid var(--rule-strong);
  transition: color var(--fast), border-color var(--fast), background-color var(--fast);
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text-strong); }
.btn.primary { background: var(--text-strong); color: var(--ink); border-color: var(--text-strong); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn.quiet { color: var(--text-soft); border-color: var(--rule-3); }
.btn.small { min-height: 36px; padding-inline: 12px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.danger.armed { border-color: var(--wrong); color: var(--wrong); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.arrow { display: inline-block; transition: transform var(--mid), color var(--mid); }
a:hover .arrow { transform: translateX(4px); }

/* ---------- Front page ---------- */
.hero-band { position: relative; min-height: calc(100svh - 67px); display: flex; flex-direction: column; justify-content: center; padding-block: 40px 88px; }
.scroll-cue { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 4px 12px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); text-decoration: none; }
.scroll-cue svg { animation: cue 1.8s ease-in-out infinite; }
.scroll-cue:hover { color: var(--accent); }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.overview { border-top: 1px solid var(--rule); }
.overview .wrap { padding-block: 56px 64px; display: flex; flex-direction: column; gap: 32px; }
.overview h2 { margin: 0; font-size: 32px; line-height: 1.1; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { order: 2; font-size: 14px; color: var(--text-soft); }
.facts dd { margin: 0; }
.facts dd:not(.note) { order: 1; font-family: var(--display); font-size: 40px; line-height: 1; color: var(--text-strong); }
.facts .note { order: 3; font-size: 13px; color: var(--muted-2); }
.overview-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
.overview-cols h3 { margin: 0 0 14px; font-weight: 400; }
.domain-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.domain-bars a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; text-decoration: none; font-size: 15px; color: var(--text-soft); }
.domain-bars .dpct { font-family: var(--display); color: var(--text-strong); }
.domain-bars .dbar { grid-column: 1 / -1; height: 4px; width: calc(var(--w) / 28 * 100%); background: var(--rule-strong); transition: background-color var(--mid); }
.domain-bars a:hover .dbar { background: var(--accent); }
.rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--text-soft); }
.rules li::marker { color: var(--muted-2); }
.rules strong { color: var(--text-strong); font-weight: 600; }
.overview .more { align-self: flex-start; font-size: 14px; color: var(--muted); text-decoration: none; }
.overview .more:hover { color: var(--accent); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 64px; align-items: center; }
.hero-intro { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; color: var(--text-strong); text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin: 0; font-size: 16px; color: var(--text-soft); }
.hero .lede a { color: var(--text-soft); text-underline-offset: 4px; }
.hero .lede a:hover { color: var(--accent); }
.hero .btn-row { padding-top: 4px; }

.try { min-width: 0; background: var(--card); border-top: 1px solid var(--accent); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.try-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.try-stem { margin: 0; font-family: var(--display); font-size: 16px; line-height: 1.45; color: var(--text-strong); }
.try-opts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.try-opt { width: 100%; min-height: 40px; text-align: left; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 8px 12px; background: transparent; border: 1px solid var(--rule-2); color: var(--text-soft); transition: border-color var(--fast), background-color var(--fast), color var(--fast); }
.try-opt:hover:not(:disabled) { border-color: var(--accent); }
.try-opt:disabled { cursor: default; }
.try-key { font-family: var(--display); font-style: italic; color: var(--muted-2); }
.try.is-answered .try-opt { color: var(--muted-2); }
.try-opt.is-correct { background: var(--right-tint); border-color: var(--right); color: var(--text-strong) !important; }
.try-opt.is-correct .try-key { color: var(--right); }
.try-opt.is-wrong { border-color: var(--wrong); background: var(--wrong-tint); color: var(--text) !important; }
.try-opt.is-wrong .try-key { color: var(--wrong); }
.try-result { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-soft); }
.try-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13px; }
.try-foot a { color: var(--muted); text-decoration: none; }
.try-foot a:hover { color: var(--accent); }

.rise { animation: rise 600ms cubic-bezier(.2, .7, .2, 1) both; }
.rise-2 { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 720px) {
  .hero-band { min-height: 0; padding-block: 32px 72px; }
  .overview .wrap { padding-block: 40px 48px; gap: 24px; }
  .overview h2 { font-size: 26px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .facts dd:not(.note) { font-size: 32px; }
  .overview-cols { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero .btn-row { gap: 10px; }
  .hero .btn { flex: 1; padding-inline: 12px; }
  .try { padding: 20px 18px; }
  .site-footer.big .wrap { flex-direction: column; align-items: flex-start; }
}

/* ---------- Thoughts ---------- */
.page-title { padding-block: 48px 36px; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 20px; }
.page-title h1 { margin: 0; font-size: 40px; line-height: 1.05; text-wrap: balance; }
.page-title .lede { margin: 0; max-width: 36rem; font-family: var(--display); font-size: 18px; line-height: 1.45; color: var(--text-soft); border-right: 1px solid var(--bar); padding-right: 20px; }
.essay { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-block: 16px 72px; font-size: 16px; line-height: 1.7; }
.essay-aside { display: flex; flex-direction: column; gap: 28px; font-size: 14px; line-height: 1.55; position: sticky; top: 24px; align-self: start; }
.author { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--accent); }
.author .name { font-family: var(--display); font-style: italic; font-size: 17px; color: var(--text-strong); }
.author .passed { color: var(--muted); }
.author .org { color: var(--muted-2); }
.on-page { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--rule); }
.on-page a { text-decoration: none; color: var(--text-soft); }
.essay article { min-width: 0; max-width: 40rem; display: flex; flex-direction: column; gap: 40px; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding-block: 24px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.compare > div { display: flex; flex-direction: column; gap: 10px; }
.compare > div + div { border-left: 1px solid var(--rule-strong); padding-left: 40px; }
.compare .head { font-family: var(--display); font-style: italic; font-size: 16px; color: var(--muted-2); }
.compare .head.accent { color: var(--accent); }
.compare p { margin: 0; font-family: var(--display); font-size: 17px; line-height: 1.5; color: var(--text); }
.essay section { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 24px; }
.essay h2 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 24px; line-height: 1.2; color: var(--text-strong); }
.essay section p { margin: 0; color: var(--text-soft); }
.essay blockquote { margin: 0; padding-block: 8px; padding-inline: 28px 0; border-left: 1px solid var(--accent); font-family: var(--display); font-style: italic; font-size: 18px; line-height: 1.5; color: var(--text); }
.xref { align-self: flex-start; font-size: 14px; color: var(--muted); text-underline-offset: 5px; min-height: 44px; display: inline-flex; align-items: center; }
.essay-end { display: flex; flex-direction: column; gap: 18px; padding-top: 32px; border-top: 1px solid var(--rule); }
.essay-end p { margin: 0; font-size: 14px; color: var(--muted); }

@media (max-width: 900px) {
  .essay { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .essay-aside { position: static; }
}
@media (max-width: 720px) {
  .page-title { padding-block: 52px 36px; }
  .page-title h1 { font-size: 32px; }
  .page-title .lede { font-size: 17px; }
  .essay { padding-block: 8px 56px; }
  .essay h2 { font-size: 22px; }
  .compare > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-strong); padding-top: 28px; }
}

/* Thoughts: centered title, profile in the side, one part at a time in the window */
.page-title.centered { align-items: center; text-align: center; }
.page-title.centered .lede { border-right: 0; padding-right: 0; }
.page-title.left { align-items: flex-start; text-align: left; }
.page-title.left .lede { border-right: 0; padding-right: 0; }
.author p { margin: 6px 0 0; color: var(--text-soft); font-size: 14px; line-height: 1.6; }
.on-page a { padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; }
.on-page a.is-current { color: var(--text-strong); border-left-color: var(--accent); }
.essay-main { min-width: 0; max-width: 52rem; display: flex; flex-direction: column; gap: 28px; }
.essay-intro { display: flex; flex-direction: column; gap: 14px; color: var(--text-soft); }
.essay-intro p { margin: 0; }
.key { color: var(--accent); }
.essay article.essay-window { max-width: none; gap: 0; }
.part-tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: -8px 0 24px; border-bottom: 1px solid var(--rule); }
.part-tabs a { padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 15px; color: var(--muted); text-decoration: none; }
.part-tabs a:hover { color: var(--text-strong); }
.part-tabs a.is-current { color: var(--text-strong); border-bottom-color: var(--accent); }
.essay-window.windowed > section > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.essay-window { background: var(--card); border-top: 1px solid var(--accent); padding: 32px 40px 36px; }
.essay-window:focus { outline: none; }
.essay-window.windowed { display: grid; grid-template-columns: minmax(0, 1fr); }
.essay-window.windowed > .part-tabs { grid-row: 1; }
.essay-window.windowed > section { grid-row: 2; grid-column: 1; }
.essay-window.windowed > section:not(.is-active) { visibility: hidden; pointer-events: none; }
.essay-window.windowed > section.is-active { animation: part-in 260ms ease both; }
@keyframes part-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.part-pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--rule); }
.pp { display: inline-flex; align-items: center; gap: 14px; min-height: 52px; text-decoration: none; color: var(--text); }
.pp.next { text-align: right; margin-left: auto; }
.pp-text { display: flex; flex-direction: column; gap: 2px; }
.pp-title { font-family: var(--display); font-style: italic; font-size: 17px; color: var(--text-strong); transition: color var(--fast); }
.pp-arrow { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: 50%; color: var(--text-soft); transition: border-color var(--mid), color var(--mid), background-color var(--mid), transform var(--mid); }
.pp:hover .pp-title { color: var(--accent); }
.pp:hover .pp-arrow { border-color: var(--accent); background: var(--accent); color: var(--ink); }
.pp.next:hover .pp-arrow { transform: translateX(3px); }
.pp.prev:hover .pp-arrow { transform: translateX(-3px); }
@media (max-width: 720px) { .essay-window { padding: 22px 18px 26px; } .part-pager { min-height: 104px; align-items: flex-end; } .pp-title { font-size: 15px; } }

/* ---------- Study guide ---------- */
.guide-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 190px; gap: 48px; padding-block: 32px 72px; align-items: start; transition: grid-template-columns 260ms ease; }
.toc-hidden .guide-layout { grid-template-columns: 44px minmax(0, 1fr) 190px; }
.guide-toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; font-size: 14px; line-height: 1.45; padding-right: 8px; scrollbar-width: thin; scrollbar-color: var(--rule-3) transparent; }
.toc-full { display: flex; flex-direction: column; gap: 16px; }
.toc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toc-hide { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding-inline: 10px; background: transparent; border: 1px solid var(--rule-2); color: var(--muted); font-size: 13px; transition: color var(--fast), border-color var(--fast); }
.toc-mini { display: none; width: 44px; height: 44px; place-items: center; background: transparent; border: 1px solid var(--rule-2); color: var(--muted); padding: 0; transition: color var(--fast), border-color var(--fast); }
.toc-hide:hover, .toc-mini:hover { border-color: var(--accent); color: var(--accent); }
.toc-hidden .guide-layout .toc-mini { display: grid; }
.toc-hidden .guide-layout .toc-full { display: none; }
.toc-hidden .guide-layout .guide-toc { overflow: visible; }
.search-input { font-size: 14px; color: var(--text-strong); background: var(--surface); border: 1px solid var(--rule-2); padding: 7px 10px; min-height: 38px; width: 100%; }
.toc-details > summary { display: none; }
.toc { display: flex; flex-direction: column; gap: 16px; }
.toc-group { display: flex; flex-direction: column; gap: 4px; }
.toc a { text-decoration: none; padding-block: 3px; color: var(--muted); }
.toc a.domain { font-family: var(--display); font-style: italic; font-size: 15px; line-height: 1.35; color: var(--text-soft); padding-block: 0; }
.toc a.domain.in { color: var(--text-strong); }
.toc a.sub { padding-left: 12px; color: var(--muted-2); }
.toc a[aria-current="page"] { color: var(--accent); }
.toc a:hover { color: var(--accent); }
.search-results { display: flex; flex-direction: column; gap: 12px; }
.search-results a { text-decoration: none; color: var(--text-soft); display: flex; flex-direction: column; }
.search-results a small { color: var(--muted-2); font-size: 13px; }
.search-empty { color: var(--muted-2); margin: 0; }

.guide-article { min-width: 0; max-width: 42rem; width: 100%; display: flex; flex-direction: column; gap: 18px; line-height: 1.65; }
.toc-hidden .guide-layout .guide-article { margin-inline: auto; }
.guide-article:focus { outline: none; }
.crumbs { font-size: 13px; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { color: var(--muted-2); text-decoration: none; }
.page-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.page-num { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.page-head h1 { margin: 0; font-size: 34px; line-height: 1.1; text-wrap: balance; }
.page-head .lead { margin: 0; font-size: 17px; color: var(--text-soft); }

.g-section { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; }
.g-section:first-of-type { padding-top: 12px; }
.g-section > h2 { margin: 0; padding-top: 8px; display: flex; align-items: baseline; gap: 12px; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 24px; line-height: 1.2; color: var(--text-strong); scroll-margin-top: 24px; }
.g-section > h2 .num { font-size: 13px; font-style: normal; font-weight: 400; letter-spacing: 0.08em; color: var(--muted-2); flex-shrink: 0; }
.prose { display: flex; flex-direction: column; gap: 14px; color: var(--text-soft); }
.prose > * { margin: 0; }
.prose strong { color: var(--text-strong); font-weight: 600; }
.prose a { color: var(--text); text-underline-offset: 4px; }
.prose a:hover { color: var(--accent); }
.prose h3, .prose h4 { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 19px; color: var(--text-strong); line-height: 1.25; margin-top: 8px; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose li::marker { color: var(--muted-2); }
.prose code { font-size: 0.9em; background: var(--surface); padding: 1px 5px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); width: 100%; }
.prose blockquote { margin: 0; background: var(--label); color: var(--ink-body); padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.6; }
.prose blockquote > * { margin: 0; }
.prose blockquote strong { color: var(--ink-body); }
.prose blockquote > p:first-child > strong:first-child { display: block; font-family: var(--display); font-style: italic; font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--accent-on-light); margin-bottom: 2px; }
.prose blockquote li::marker { color: var(--accent-on-light); }
.prose blockquote a { color: var(--ink-body); }
.table-scroll { overflow-x: auto; }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.prose th { text-align: left; vertical-align: bottom; padding: 0 16px 12px 0; font-weight: 400; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); border-bottom: 1px solid var(--rule-3); }
.prose td { vertical-align: top; padding: 12px 14px 12px 0; color: var(--text-soft); border-bottom: 1px solid var(--rule); }
.prose td + td + td { font-size: 13px; color: var(--muted); }
.prose td:last-child, .prose th:last-child { padding-right: 0; }
.prose td:first-child strong { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 16px; color: var(--text-strong); }
.prose .source { font-size: 13px; color: var(--muted-2); }
.prose .source a { color: var(--muted); }
.practice-note { margin: 0; padding-top: 2px; font-size: 13px; color: var(--muted-2); }
.practice-note a { color: var(--accent); text-underline-offset: 4px; }
.practice-note a:hover { color: var(--text-strong); }
.contents-list { display: flex; flex-direction: column; gap: 24px; padding-top: 12px; }
.contents-list section { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--rule); }
.contents-list h2 { margin: 0 0 4px; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 19px; color: var(--text-strong); }
.contents-list h2 a { text-decoration: none; color: inherit; }
.contents-list ul { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 32px; }
.contents-list li { break-inside: avoid; padding-block: 2px; font-size: 14px; }
.contents-list li a { text-decoration: none; color: var(--text-soft); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; min-height: 44px; max-width: 48%; }
.pager a.next { align-items: flex-end; text-align: right; margin-left: auto; }
.pager .t { font-family: var(--display); font-style: italic; font-size: 16px; }

.guide-rail { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.4; }
.guide-rail nav { display: flex; flex-direction: column; border-left: 1px solid var(--rule-2); }
.guide-rail nav a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; color: var(--muted-2); }
.guide-rail nav a.is-current { color: var(--text-strong); border-left-color: var(--accent); }
.guide-loading { color: var(--muted-2); }

@media (max-width: 1180px) {
  .guide-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .toc-hidden .guide-layout { grid-template-columns: 44px minmax(0, 1fr); }
  .guide-rail { display: none; }
}
@media (max-width: 780px) {
  .guide-layout, .toc-hidden .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 24px 72px; }
  .guide-toc { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .toc-head, .toc-mini { display: none !important; }
  .toc-hidden .guide-layout .toc-full { display: flex; }
  .toc-full { gap: 12px; }
  .toc-details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .toc-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; list-style: none; font-size: 16px; color: var(--text-strong); }
  .toc-details > summary::-webkit-details-marker { display: none; }
  .toc-details > summary::after { content: "+"; font-size: 22px; color: var(--muted-2); }
  .toc-details[open] > summary::after { content: "−"; }
  .toc-details[open] .toc { padding-bottom: 20px; }
  .page-head h1 { font-size: 28px; }
  .page-head .lead { font-size: 16px; }
  .g-section > h2 { font-size: 21px; gap: 10px; }
  .prose blockquote { padding: 18px 18px; }
  .pager a { max-width: 100%; }
}

/* ---------- Practice ---------- */
.practice-main { padding-block: 28px 64px; display: flex; flex-direction: column; gap: 20px; }
.practice-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.practice-top .titles { display: flex; flex-direction: column; gap: 6px; }
.practice-top h1 { margin: 0; font-size: 32px; line-height: 1.1; }
.tabs { display: flex; flex-wrap: wrap; gap: 24px; font-size: 15px; border-bottom: 1px solid var(--rule); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 0; min-height: 40px; color: var(--muted); transition: color var(--fast), border-color var(--fast); }
.tab:hover { color: var(--text-strong); }
.tab[aria-selected="true"] { color: var(--text-strong); border-bottom-color: var(--accent); }
.count { font-variant-numeric: tabular-nums; color: var(--muted-2); margin-left: 4px; }
.count.wrong { color: var(--wrong); }

.setup { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 12px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.setup .field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-width: 0; max-width: 100%; }
.setup select { font-size: 14px; color: var(--text-strong); background: var(--surface); border: 1px solid var(--rule-3); padding: 7px 10px; min-height: 38px; max-width: 100%; min-width: 0; }
.setup .check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-height: 38px; }
.setup .check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.setup .btn { margin-left: auto; }
.notice { flex-basis: 100%; margin: 0; font-size: 15px; color: var(--accent); }

.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
.q-card { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.q-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted-2); }
.q-meta .num { font-variant-numeric: tabular-nums; }
.q-meta .tags { letter-spacing: 0.14em; text-transform: uppercase; }
.q-meta .tags a { color: var(--muted-2); text-decoration: none; }
.q-meta .tags a:hover { color: var(--accent); }
.stem { margin: 0; font-family: var(--display); font-size: 19px; line-height: 1.45; color: var(--text-strong); max-width: 44rem; }
.choose { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.verdict { margin: 0; padding-block: 10px; padding-inline: 16px; border: 1px solid var(--right); color: var(--text-strong); font-size: 15px; }
.verdict.ok { border-color: var(--right); background: var(--right-tint); }
.verdict.bad { border-color: var(--wrong); background: var(--wrong-tint); }
.verdict:focus { outline: none; }
.verdict strong { font-weight: 600; }

.opts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.opt { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 11px 16px; border: 1px solid var(--rule); width: 100%; text-align: left; background: transparent; color: var(--text); font-size: 15px; line-height: 1.55; transition: border-color var(--fast), background-color var(--fast); }
.opt .letter { font-family: var(--display); font-style: italic; font-size: 18px; line-height: 1.2; color: var(--muted-2); transition: color var(--fast); }
.opt .ot { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.opt .head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.opt .tag { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; padding-top: 4px; }
.opt .why { font-size: 14px; line-height: 1.55; }
button.opt:hover { border-color: var(--rule-strong); background: var(--surface); }
button.opt:hover .letter { color: var(--text-strong); }
button.opt[aria-checked="true"] { border-color: var(--accent); background: var(--surface); }
button.opt[aria-checked="true"] .letter { color: var(--accent); }
.opt.plain .otext { color: var(--muted); }
.opt.plain .why { color: var(--muted-2); }
.opt.plain .letter { color: var(--faint); }
.opt.bad { border-color: var(--wrong); background: var(--wrong-tint); }
.opt.bad .letter, .opt.bad .tag { color: var(--wrong); }
.opt.bad .otext { color: var(--text-strong); }
.opt.bad .why { color: var(--text-soft); }
.opt.ok { background: var(--right-tint); border-color: var(--right); }
.opt.ok .letter { color: var(--right); }
.opt.ok .otext { font-weight: 600; color: var(--text-strong); }
.opt.ok .tag { color: var(--right); }
.opt.ok .why { color: var(--text-soft); }

.q-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; }
.q-actions .right { display: flex; flex-wrap: wrap; gap: 12px; }
.review-link { font-size: 14px; color: var(--muted); text-underline-offset: 5px; }
.kbd { margin: 0; font-size: 12px; color: var(--muted-2); }
kbd { font-family: inherit; font-size: 13px; border: 1px solid var(--rule-3); border-bottom-width: 2px; padding: 0 6px; color: var(--text-soft); }

.progress-panel { display: flex; flex-direction: column; gap: 16px; padding-top: 14px; border-top: 2px solid var(--accent); position: sticky; top: 24px; }
.progress-panel .title { display: flex; flex-direction: column; gap: 4px; }
.progress-panel .set { font-family: var(--display); font-style: italic; font-size: 18px; line-height: 1.3; color: var(--text-strong); }
.tally { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tally dt { font-size: 12px; color: var(--muted-2); }
.tally dd { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.2; color: var(--text-strong); font-variant-numeric: lining-nums; }
.tally .wrong dd { color: var(--wrong); }
.qgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cell { display: grid; place-items: center; height: 30px; padding: 0; background: transparent; border: 1px solid var(--rule-3); color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; transition: border-color var(--fast); }
.cell:hover { border-color: var(--text-soft); }
.cell.ok { background: var(--right); border-color: var(--right); color: var(--ink); }
.cell.bad { border-color: var(--wrong); color: var(--wrong); }
.cell.cur { outline: 2px solid var(--text-strong); outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted-2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--rule-3); }
.legend i.ok { background: var(--right); border-color: var(--right); }
.legend i.bad { border-color: var(--wrong); }
.saved-note { margin: 0; font-size: 12px; line-height: 1.55; color: var(--muted-2); }

.results { display: flex; flex-direction: column; gap: 28px; }
.results h2 { margin: 0; font-size: 28px; }
.score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px; }
.score .big { font-family: var(--display); font-size: 52px; line-height: 1; color: var(--text-strong); font-variant-numeric: lining-nums; }
.score .of { color: var(--muted); }
.passline { margin: 0; color: var(--text-soft); max-width: 44rem; }
.bars { display: flex; flex-direction: column; gap: 18px; padding-block: 24px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 14px; }
.bar-row .stat { color: var(--muted-2); }
.bar-row .num { font-variant-numeric: tabular-nums; color: var(--muted); }
.track { grid-column: 1 / -1; height: 6px; background: var(--rule); position: relative; }
.track .fill { position: absolute; inset: 0 auto 0 0; background: var(--right); }
.track .mark { position: absolute; top: -4px; bottom: -4px; left: 70%; width: 2px; background: var(--text-strong); }

.panel { display: flex; flex-direction: column; gap: 24px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head h2 { margin: 0; font-size: 28px; }
.lede-muted { margin: 0; color: var(--muted); max-width: 44rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.seg button { background: none; border: 0; border-bottom: 1px solid transparent; padding: 4px 0; min-height: 34px; font-size: 14px; color: var(--muted-2); transition: color var(--fast), border-color var(--fast); }
.seg button:hover { color: var(--text-strong); }
.seg button[aria-pressed="true"] { color: var(--text-strong); border-bottom-color: var(--accent); }
.list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.item { border-bottom: 1px solid var(--rule); min-width: 0; }
.item > summary { list-style: none; cursor: pointer; padding-block: 14px; display: flex; flex-direction: column; gap: 8px; }
.item > summary::-webkit-details-marker { display: none; }
.item > summary .row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
.item > summary:hover .sum-stem { color: var(--text-strong); }
.item .qid { font-family: var(--display); font-style: italic; font-size: 16px; color: var(--accent); }
.item .tags { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.item .sum-stem { margin: 0; color: var(--text-soft); max-width: 46rem; transition: color var(--fast); }
.item .stat { font-size: 13px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.item .open-hint { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.item[open] .open-hint::after { content: " (hide)"; }
.item .body { padding-bottom: 28px; display: flex; flex-direction: column; gap: 18px; }
.item strong.when { font-weight: 400; color: var(--text-strong); }
.hist-bar { width: 120px; height: 6px; background: var(--rule); display: flex; }
.hist-bar span { height: 100%; }
.subq { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--rule); }
.subq:first-child { border-top: 0; padding-top: 0; }
.subq .stem { font-size: 17px; }
.item-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-block: 32px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.empty h3 { margin: 0; font-family: var(--display); font-style: italic; font-size: 20px; color: var(--text-strong); }
.empty p { margin: 0; color: var(--muted); max-width: 40rem; }

@media (max-width: 960px) {
  .practice-layout { grid-template-columns: minmax(0, 1fr); }
  .progress-panel { position: static; }
  .qgrid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}
@media (max-width: 720px) {
  .practice-main { padding-block: 20px 56px; gap: 18px; }
  .practice-top h1 { font-size: 26px; }
  .setup .btn { margin-left: 0; width: 100%; }
  .setup .field, .setup select { width: 100%; }
  .stem { font-size: 17px; }
  .opt { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .q-actions .right { width: 100%; }
  .q-actions .right .btn { flex: 1; }
  .q-actions .review-link { order: 3; }
  .kbd { display: none; }
  .score .big { font-size: 44px; }
  .panel-head h2, .results h2 { font-size: 24px; }
}

/* ---------- Feedback (feedback.js) ---------- */
.nav-feedback { background: none; border: 0; padding: 0; font-size: 15px; color: var(--text); text-align: left; transition: color var(--fast); }
.nav-feedback:hover { color: var(--accent); }
@media (max-width: 720px) {
  .main-nav .nav-feedback { min-height: 48px; display: flex; align-items: center; width: 100%; }
}

.feedback-band { border-top: 1px solid var(--rule); background: var(--bg-deep); }
.feedback-band .wrap { padding-block: 48px 56px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; }
.feedback-text { display: flex; flex-direction: column; gap: 12px; max-width: 40rem; }
.feedback-text h2 { margin: 0; font-size: 32px; line-height: 1.1; }
.feedback-text p { margin: 0; color: var(--text-soft); }
@media (max-width: 720px) {
  .feedback-band .wrap { padding-block: 40px 44px; }
  .feedback-text h2 { font-size: 26px; }
  .feedback-band .btn-row { width: 100%; }
  .feedback-band .btn { flex: 1 1 auto; }
}

.q-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.q-foot .kbd { margin: 0; }
.fb-link { background: none; border: 0; padding: 0; min-height: 32px; margin-left: auto; font-size: 13px; color: var(--muted-2); text-decoration: underline; text-decoration-color: var(--rule-3); text-underline-offset: 4px; transition: color var(--fast), text-decoration-color var(--fast); }
.fb-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

.fb-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; background: var(--card); color: var(--text); border: 1px solid var(--rule-2); overflow: auto; }
.fb-dialog::backdrop { background: rgba(5, 5, 7, 0.72); }
.fb-form, .fb-done { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 20px; }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.fb-dialog h2 { margin: 0; font-size: 26px; line-height: 1.15; }
.fb-done p { margin: 0; color: var(--text-soft); }
.fb-close { width: 40px; height: 40px; display: grid; place-items: center; margin-right: -10px; background: none; border: 0; color: var(--muted); }
.fb-close:hover { color: var(--accent); }
.fb-body { display: flex; flex-direction: column; gap: 18px; }
.fb-kind { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.fb-kind legend { padding: 0; margin-bottom: 8px; }
.fb-kind label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 15px; color: var(--text-soft); cursor: pointer; }
.fb-kind input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.fb-q { display: flex; flex-direction: column; gap: 18px; }
.fb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fb-field .label { letter-spacing: 0.14em; }
.fb-opt { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--faint); }
.fb-field select, .fb-field input, .fb-field textarea {
  width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; font: inherit; font-size: 15px;
  color: var(--text-strong); background: var(--surface); border: 1px solid var(--rule-3);
  transition: border-color var(--fast);
}
.fb-field textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.fb-field select:hover, .fb-field input:hover, .fb-field textarea:hover { border-color: var(--rule-strong); }
.fb-field select:focus-visible, .fb-field input:focus-visible, .fb-field textarea:focus-visible { outline: none; border-color: var(--accent); }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-status { margin: 0; min-height: 1.6em; font-size: 14px; color: var(--muted); }
.fb-status:empty { display: none; }
.fb-status.bad { color: var(--wrong); }
.fb-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
@media (max-width: 720px) {
  .fb-form, .fb-done { padding: 20px 18px 22px; }
  .fb-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
