/* DramaCN — rice-paper, ink and vermilion.
   One stylesheet, no external fonts, no third-party CSS. */

:root {
  --bg: #f8f2e7;
  --bg-soft: #efe6d6;
  --surface: #fffdf8;
  --ink: #1d1a17;
  --ink-soft: #5d544a;
  --line: #ded1bd;
  --accent: #b23a2c;
  --accent-ink: #8f2a1f;
  --accent-wash: #f6e3dc;
  --gold: #a8802f;
  --jade: #2f6b58;
  --radius: 12px;
  --shadow: 0 1px 1px rgba(29, 26, 23, .04), 0 10px 26px rgba(70, 46, 20, .06);
  --wrap: 1080px;
  --font-display: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

[data-theme="dark"] {
  --bg: #16120f;
  --bg-soft: #1f1915;
  --surface: #241d18;
  --ink: #f2e9dd;
  --ink-soft: #b8a998;
  --line: #3a2f26;
  --accent: #e0674f;
  --accent-ink: #f0a08e;
  --accent-wash: #33211b;
  --gold: #d0a556;
  --jade: #7bbdaa;
  --shadow: 0 1px 1px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .28);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.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;
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--surface); color: var(--ink); padding: .6rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.15rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-top { display: flex; align-items: center; gap: 1rem; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; background: var(--accent); color: #fff8ef;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: .01em; }
.brand-sub { font-size: .7rem; color: var(--ink-soft); }
.header-right { margin-left: auto; display: flex; gap: .35rem; align-items: center; }

.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 必须写在 .icon-btn 之后，否则同特异性下会被 .icon-btn 的 display:grid 覆盖 */
.nav-toggle { display: none; }

/* ---------- grouped nav ---------- */
.nav-scroll { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 45%, transparent); }
/* 注意：不要在这里加 overflow（哪怕是 overflow-x），否则绝对定位的下拉会被裁剪 */
.nav-inner {
  display: flex; flex-wrap: wrap; gap: .15rem;
  padding-top: .3rem; padding-bottom: .3rem;
}
.nav-inner a {
  flex: 0 0 auto; color: var(--ink-soft); text-decoration: none;
  font-size: .82rem; padding: .42rem .6rem; border-radius: 7px; white-space: nowrap;
}
.nav-inner a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-inner a[aria-current="page"] { background: var(--accent-wash); color: var(--accent); font-weight: 650; }

.nav-group {
  position: relative; flex: 0 0 auto;
  padding-top: .3rem; margin-top: -.3rem;
  padding-bottom: .35rem; margin-bottom: -.35rem;
}
.nav-group > a { display: inline-flex; align-items: center; gap: .15rem; }
.nav-caret { font-size: .65rem; opacity: .7; transition: transform .15s ease; }
.nav-group.open > a .nav-caret { transform: rotate(180deg); }
.nav-submenu {
  position: absolute; top: 100%; left: 0; z-index: 70;
  display: none; flex-direction: column; gap: 0; min-width: 170px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: .35rem;
  animation: submenu-in .15s ease;
}
/* 只由 .open 控制显隐，避免 :hover 与点击开关互相冲突 */
.nav-group.open .nav-submenu { display: flex; }
.nav-submenu a {
  flex: none; display: block; font-size: .8rem; padding: .45rem .75rem; border-radius: 6px;
}
.nav-submenu a[aria-current="page"] { font-weight: 650; }

@keyframes submenu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- mobile drawer ---------- */
.nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55;
  animation: overlay-in .2s ease;
}
body.nav-open { overflow: hidden; }
body.nav-open .nav-scroll {
  position: fixed; top: 0; right: 0; bottom: 0; left: auto; z-index: 60;
  width: min(82vw, 320px); height: 100vh;
  background: var(--surface); border: 0; border-left: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  transform: translateX(0); animation: drawer-in .22s ease;
  -webkit-overflow-scrolling: touch;
}
body.nav-open .nav-inner {
  flex-direction: column; align-items: stretch; gap: .15rem;
  padding: 1.1rem .75rem 2rem; overflow: visible;
}
body.nav-open .nav-inner > a,
body.nav-open .nav-group { width: 100%; }
body.nav-open .nav-submenu {
  position: static; display: flex !important; box-shadow: none;
  border: 0; padding: 0 0 .25rem .85rem; background: transparent;
  animation: none;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- hero / headings ---------- */
.hero { padding: 3.1rem 0 1.2rem; max-width: 780px; }
.eyebrow {
  display: inline-block; margin: 0 0 .75rem; padding: .18rem .6rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft);
  color: var(--ink-soft); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase;
}
h1, h2, h3, h4 { line-height: 1.28; letter-spacing: -.005em; }
h1 { font-family: var(--font-display); font-size: clamp(1.85rem, 4.2vw, 2.55rem); margin: 0 0 .8rem; }
h2 { font-size: 1.3rem; margin: 0 0 .9rem; }
h3 { font-size: 1.02rem; margin: 0 0 .3rem; }
.lede { font-size: 1.06rem; color: var(--ink-soft); margin: 0 0 1rem; }

.btn {
  display: inline-block; padding: .55rem 1rem; border: 1px solid var(--accent);
  border-radius: 8px; background: var(--accent); color: #fff8f0;
  text-decoration: none; font-weight: 650; font-size: .9rem; line-height: 1.3;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff8f0; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-wash); color: var(--accent-ink); }
.btn-small { padding: .35rem .7rem; font-size: .82rem; }

/* ---------- cards ---------- */
.card-group { padding: 1.7rem 0; border-top: 1px solid var(--line); }
.card-group > h2 { font-family: var(--font-display); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: .9rem; }
.card {
  display: flex; flex-direction: column; padding: 1.05rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-media {
  display: block; width: calc(100% + 2.2rem); height: auto; margin: -1.05rem -1.1rem .8rem;
  object-fit: cover;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--bg-soft);
}
.card-media.is-poster { aspect-ratio: 2 / 3; object-position: center 26%; }
.card-media.is-banner { aspect-ratio: 16 / 9; object-position: center 50%; }
.card p { margin: 0; color: var(--ink-soft); font-size: .89rem; }
.card-tag {
  align-self: flex-start; margin-bottom: .5rem; padding: .1rem .5rem;
  border-radius: 999px; background: var(--accent-wash); color: var(--accent);
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.card[hidden] { display: none; }

/* ---------- hub pages ---------- */
.hub-head { padding: 2rem 0 .8rem; max-width: 820px; }
.hub-intro { padding-bottom: .4rem; }
.year-tabs { display: flex; gap: .4rem; margin: 1.2rem 0; }
.year-tab {
  padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-soft); font-size: .84rem; cursor: pointer;
}
.year-tab.is-active { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); font-weight: 650; }

/* ---------- article ---------- */
.breadcrumb { padding-top: .9rem; font-size: .8rem; color: var(--ink-soft); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .35rem; color: var(--line); }
.breadcrumb a { color: var(--ink-soft); }
.article-head { padding: 1.6rem 0 1rem; max-width: 820px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--ink-soft); font-size: .8rem; margin: .2rem 0 0; }
.badge { padding: .1rem .5rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); font-size: .72rem; font-weight: 650; }

.page-figure { margin: 1rem 0 1.4rem; }
.page-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.page-figure figcaption { margin-top: .4rem; color: var(--ink-soft); font-size: .78rem; }

.keybox {
  margin: 1.1rem 0 1.4rem; padding: 1rem 1.15rem;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--surface);
}
.keybox h2 { font-size: .78rem; margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-soft); }
.keybox dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; font-size: .9rem; }
.keybox dt { color: var(--ink-soft); }
.keybox dd { margin: 0; }

.prose { max-width: 800px; }
.prose h2 { font-family: var(--font-display); margin-top: 2rem; padding-top: .3rem; }
.prose h3 { margin-top: 1.3rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: .3rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .88rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); }
.prose blockquote {
  margin: 1.2rem 0; padding: .7rem 1rem; border-left: 3px solid var(--gold);
  background: var(--bg-soft); color: var(--ink); border-radius: 0 8px 8px 0;
}
.prose code { padding: .08rem .3rem; border-radius: 4px; background: var(--bg-soft); font-size: .88em; }

.watch-box {
  max-width: 800px; margin: 1.6rem 0; padding: 1.1rem 1.2rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
}
.watch-box h2 { font-family: var(--font-display); margin: 0 0 .5rem; font-size: 1.2rem; }
.watch-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.watch-note { margin: 0; font-size: .8rem; color: var(--ink-soft); }

.related { max-width: 800px; margin: 2rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.related h2 { font-size: 1rem; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.related li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.related li a { text-decoration: none; font-weight: 600; }
.related li span { color: var(--ink-soft); font-size: .78rem; }
.related li.viewer-guide-link { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.related li.viewer-guide-link a { color: var(--accent); }

/* ---------- ads (reserved, hidden until filled) ---------- */
.ad-slot {
  display: none; place-items: center; margin: 1.4rem 0; min-height: 90px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--ink-soft); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
}
.ad-slot.is-filled { display: grid; }
.ad-slot--rectangle { max-width: 336px; min-height: 280px; margin-left: auto; margin-right: auto; }

/* ---------- subscribe ---------- */
.subscribe { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 2.5rem; }
.subscribe-inner { display: flex; flex-wrap: wrap; gap: 1.6rem; justify-content: space-between; padding-top: 1.8rem; padding-bottom: 1.8rem; }
.subscribe-inner > div:first-child { max-width: 520px; }
.subscribe h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 .4rem; }
.subscribe p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.subscribe-col { min-width: 290px; flex: 1 1 300px; max-width: 400px; }
.subscribe-form { display: flex; gap: .45rem; flex-wrap: wrap; }
.subscribe-form input[type="email"] {
  flex: 1 1 170px; min-width: 0; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: .9rem;
}
.subscribe-note { margin-top: .5rem !important; font-size: .76rem !important; }
.subscribe-status { margin-top: .5rem; font-size: .84rem; color: var(--jade); }
.subscribe-status[data-state="error"] { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; padding-top: 2rem; padding-bottom: 1.4rem; }
.footer-brand { max-width: 380px; }
.footer-note { color: var(--ink-soft); font-size: .84rem; margin: .5rem 0 .4rem; }
.footer-legal { font-size: .8rem; color: var(--ink); margin: .4rem 0; padding-left: .6rem; border-left: 2px solid var(--accent); }
.footer-contact { font-size: .8rem; color: var(--ink-soft); margin: .4rem 0 0; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 2rem; }
.footer-cols a { display: block; color: var(--ink-soft); text-decoration: none; font-size: .84rem; padding: .1rem 0; }
.footer-cols a:hover { color: var(--accent); }
.footer-head { margin: 0 0 .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.footer-base { padding-top: .9rem; padding-bottom: 1.4rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .76rem; }
.footer-base p { margin: 0; }

/* ---------- cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(29, 26, 23, .12);
}
.cookie-banner[hidden] { display: none; }
.cookie-inner {
  max-width: var(--wrap); margin: 0 auto; padding: .75rem 1.15rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.2rem;
}
.cookie-inner p { margin: 0; flex: 1 1 420px; font-size: .82rem; color: var(--ink-soft); }
.cookie-actions { display: flex; gap: .45rem; }
body.has-cookie-banner { padding-bottom: 0; }

/* ---------- home page helpers ---------- */
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; }
.section-note { max-width: 800px; margin: -.35rem 0 1.1rem; color: var(--ink-soft); font-size: .88rem; }
.more-link { margin: .9rem 0 0; font-size: .86rem; font-weight: 600; }
.more-link a { text-decoration: none; }
.update-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; max-width: 820px; }
.update-list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .8rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-size: .86rem;
}
.update-list li a { text-decoration: none; font-weight: 600; }
.update-list li span { color: var(--ink-soft); font-size: .76rem; }

/* ---------- misc ---------- */
.not-found { padding-bottom: .5rem; }
.faq-list { max-width: 820px; }
.faq-list details {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: .8rem 1rem; margin: 0 0 .6rem;
}
.faq-list summary { cursor: pointer; font-weight: 650; }
.faq-list details[open] summary { margin-bottom: .5rem; color: var(--accent); }
.faq-list p { margin: .3rem 0; }

/* Viewer guide multi-column compact lists */
.prose ul.two-col {
  list-style: none; padding: 0; margin: .5rem 0 0;
  display: grid; gap: .9rem 1.6rem;
}
.prose ul.two-col li {
  padding: .7rem .9rem; border-left: 3px solid var(--accent-wash);
  background: var(--surface); border-radius: 0 8px 8px 0;
  font-size: .86rem; line-height: 1.55;
}
.prose ul.two-col li strong, .prose ul.two-col li em { color: var(--ink); }
@media (min-width: 820px) { .prose ul.two-col { grid-template-columns: repeat(2, 1fr); } }

/* ---------- glossary search ---------- */
.glossary-search {
  position: relative;
  margin: 1.2rem 0 .6rem;
}
.glossary-search input[type="search"] {
  width: 100%; max-width: 480px;
  padding: .6rem .85rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface);
  font-size: .9rem;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.glossary-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.glossary-search input[type="search"]::placeholder {
  color: var(--ink-soft);
}
.glossary-search-status {
  font-size: .82rem; color: var(--ink-soft);
  margin: .3rem 0 0;
}
.glossary-search-status[data-state="empty"] {
  color: var(--ink-soft);
  opacity: .7;
  font-style: italic;
}
.glossary-group.is-empty { display: none; }

/* ---------- glossary (cultural terms hub) ---------- */
.glossary-nav {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); margin: 1.1rem 0 1.4rem;
}
.glossary-nav-item {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .32rem .65rem; font-size: .78rem; font-weight: 550;
  border-radius: 18px; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; background: var(--surface);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.glossary-nav-item:hover {
  background: var(--accent-wash); border-color: var(--accent); color: var(--accent);
}
.glossary-nav-item:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.glossary-nav-item.is-active {
  background: var(--accent-wash); border-color: var(--accent); color: var(--accent);
}
.glossary-nav-item.is-active .glossary-nav-count {
  background: var(--accent); color: #fff;
}
.glossary-nav-count {
  display: inline-grid; place-items: center;
  min-width: 1.25rem; height: 1.25rem;
  font-size: .68rem; font-weight: 650; line-height: 1;
  border-radius: 999px; background: var(--bg-soft); color: var(--ink-soft);
  padding: 0 .28rem;
}

.glossary-sections { display: grid; gap: 1.8rem; }
.glossary-group {
  padding: 1.1rem 1.2rem 1.25rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
}
.glossary-group-title {
  display: inline-flex; align-items: baseline; gap: .5rem;
  font-family: var(--font-display); font-size: .95rem; font-weight: 700;
  letter-spacing: .01em; margin: 0 0 .6rem;
}
.glossary-group-count {
  display: inline-grid; place-items: center;
  min-width: 1.4rem; height: 1.4rem;
  font-size: .7rem; font-weight: 650; line-height: 1;
  border-radius: 999px; background: var(--accent-wash); color: var(--accent);
  padding: 0 .32rem;
}
.glossary-list {
  display: grid; grid-template-columns: 1fr; gap: 0; margin: 0;
}
.glossary-list dt {
  font-size: .88rem; font-weight: 650; padding-top: .65rem;
}
.glossary-list dt + dt { border-top: 1px dashed var(--line); padding-top: .7rem; }
.glossary-list dt:first-child { padding-top: .2rem; }
.glossary-list dt a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--accent) 55%, transparent);
}
.glossary-list dt a:hover { color: var(--ink); border-bottom-style: solid; }
.glossary-list dd {
  margin: .15rem 0 .35rem; font-size: .82rem; line-height: 1.55;
  color: var(--ink-soft);
}

@media (min-width: 720px) {
  .glossary-list { grid-template-columns: repeat(2, 1fr); column-gap: 1.8rem; }
  .glossary-list dt + dt { border-top-color: transparent; }
}

@media (max-width: 560px) {
  .hero { padding-top: 2.2rem; }
  .keybox dl { grid-template-columns: 1fr; gap: .1rem; }
  .keybox dd { margin-bottom: .55rem; }
  .prose table { display: block; overflow-x: auto; }
  .brand-sub { display: none; }
  .footer-cols { gap: 1.4rem; }
  .subscribe-inner { padding-top: 1.4rem; padding-bottom: 1.4rem; }
  .nav-toggle { display: grid; }
  .nav-scroll {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto; z-index: 60;
    width: min(82vw, 320px); height: 100vh;
    background: var(--surface); border: 0; border-left: 1px solid var(--line);
    overflow-y: auto; overflow-x: hidden;
    transform: translateX(105%); transition: transform .22s ease;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open .nav-scroll { transform: translateX(0); }
  .nav-inner {
    flex-direction: column; align-items: stretch; gap: .15rem;
    padding: 1.1rem .75rem 2rem; overflow: visible;
  }
  .nav-inner > a,
  .nav-group { width: 100%; }
  .nav-submenu {
    position: static; display: flex !important; box-shadow: none;
    border: 0; padding: 0 0 .25rem .85rem; background: transparent;
    animation: none;
  }
  .brand-mark { width: 30px; height: 30px; border-radius: 7px; }
  .brand-mark svg { width: 17px; height: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
