/* ==== shared: nine element marks (original artwork) ====
   Markup contract: <i class="sig" data-el="fire|water|wood|wind|earth|ice|lightning|light|dark" aria-hidden="true"></i>
   Size: set --sig (default 1.5rem). Color comes from --el-fg (set by [data-el] rules in 30-catalog.css) or currentColor.
   Variants: .sig.is-solid = filled diamond with white glyph (for selected states / dark backgrounds). */
.sig { --sig: 1.5rem; position: relative; display: inline-block; flex: none; width: var(--sig); height: var(--sig); color: var(--el-fg, currentColor); vertical-align: middle; }
.sig::before { content: ""; position: absolute; inset: 15.6%; border: max(1px, calc(var(--sig) * .055)) solid currentColor; border-radius: 12%; transform: rotate(45deg); background: color-mix(in srgb, currentColor 13%, transparent); }
.sig::after { content: ""; position: absolute; inset: 0; background: currentColor; -webkit-mask: var(--glyph) center / 100% 100% no-repeat; mask: var(--glyph) center / 100% 100% no-repeat; }
.sig.is-solid::before { background: currentColor; }
.sig.is-solid::after { background: #fff; }

.sig[data-el="fire"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23000' d='M16 8c3 3.5 5 6 5 9a5 5 0 0 1-10 0c0-1.6.7-2.8 1.8-3.8.2 1.6 1 2.6 2.2 2.8-.6-2.8 0-5.4 1-8z'/></svg>"); }
.sig[data-el="water"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23000' d='M16 8c3 4 5 6.8 5 9.4a5 5 0 0 1-10 0C11 14.8 13 12 16 8z'/></svg>"); }
.sig[data-el="wood"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23000' d='M10 22c0-7 5-12 12-12 0 7-5 12-12 12z'/></svg>"); }
.sig[data-el="wind"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='M9 13h9a2.5 2.5 0 1 0-2.5-2.5M9 17h12a2.5 2.5 0 1 1-2.5 2.5M9 21h6'/></svg>"); }
.sig[data-el="earth"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23000' d='M8 22l5.5-9 3 4.5 2-3L24 22z'/></svg>"); }
.sig[data-el="ice"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' d='M16 8v16M9 12l14 8M23 12L9 20'/></svg>"); }
.sig[data-el="lightning"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23000' d='M17.5 7L10 17.5h5L13.5 25 22 14h-5.2z'/></svg>"); }
.sig[data-el="light"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle fill='%23000' cx='16' cy='16' r='3.6'/><path fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' d='M16 8v3M16 21v3M8 16h3M21 16h3M10.3 10.3l2 2M19.7 19.7l2 2M21.7 10.3l-2 2M12.3 19.7l-2 2'/></svg>"); }
.sig[data-el="dark"] { --glyph: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23000' d='M19 8.5a7.5 7.5 0 1 0 4.5 13.3A8.5 8.5 0 0 1 19 8.5z'/></svg>"); }

/* ==== shell: tokens, base, header, crumbs, search, picker, footer ==== */
:root {
  color-scheme: light;
  /* ---- v2 design tokens (shared contract; see docs/plan-2026-11-25-frontend-redesign.md §3, §4.1.1) ---- */
  --bg: #F7F9F6;
  --surface: #FFFFFF;
  --text: #1F3439;
  --muted: #5A6F74;
  --primary: #2E6B66;
  --primary-press: #245652;
  --gold: #C9963F;          /* deep gold: rules, kicker, diamond ornament */
  --gold-ink: #8A6420;      /* gold text on light backgrounds (AA) */
  --plum: #6E3B5C;            /* character-section accent (matches the rose tile wash) */
  --gold-soft: #F2D9AC;     /* light gold fills, hairline inside primary buttons */
  --mist: #E6F1EF;          /* hover fill for segmented buttons */
  --line: rgb(31 52 57 / .12);
  --line-strong: rgb(31 52 57 / .26);
  --r-ctl: 4px;             /* buttons, inputs, segmented groups */
  --r-card: 6px;            /* cards */
  --r-tile: 8px;            /* large tiles / feature cards */
  --t: 120ms ease;          /* the only transition */
  --shadow-pop: 0 12px 32px rgb(31 52 57 / .16);  /* popovers/flyouts only */
  --serif: "Noto Serif JP", "Noto Serif SC", "Noto Serif TC", "Noto Serif KR", "Yu Mincho", "Songti SC", Georgia, serif;
  --sans: "Noto Sans JP", "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Hiragino Kaku Gothic ProN", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --num: "Outfit", system-ui, sans-serif;  /* numbers + latin brand only */
  --mast-h: 64px;           /* header height (home hero sits under it) */
  --btn-hairline: inset 0 0 0 3px var(--primary), inset 0 0 0 4px rgb(242 217 172 / .55);  /* primary button double border */

  /* ---- legacy aliases (keep until every section is migrated; do not use in new rules) ---- */
  --ink: var(--text);
  --sage: #85B7A7;
  --surface-soft: #DDEFEF;
  --accent: var(--gold-soft);
  --accent-ink: var(--gold-ink);
  --surface-tint: color-mix(in srgb, var(--surface-soft) 35%, var(--surface));
  --primary-deep: var(--primary-press);
  --accent-soft: color-mix(in srgb, var(--gold-soft) 45%, var(--surface));
  --border: var(--line);
  --border-strong: var(--line-strong);
  --image-overlay: color-mix(in srgb, var(--text) 88%, transparent);
  --shadow-sm: none;
  --shadow-md: var(--shadow-pop);
  --shadow-primary: none;
  --radius: var(--r-card);
  --display: var(--serif);
  --element-fire: #C9382B;
  --element-water: #2C6FB8;
  --element-wood: #1D6F32;
  --element-wind: #2F8A78;
  --element-earth: #8A5A2B;
  --element-ice: #0C748A;
  --element-lightning: #5D35C9;
  --element-light: #A87110;
  --element-dark: #43345E;
  --gutter: clamp(1rem, 3.6vw, 2.5rem);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* Per-language font order so each script gets its native glyph forms. */
html:lang(ja) { --serif: "Noto Serif JP", "Yu Mincho", serif; --sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }
html:lang(zh-CN) { --serif: "Noto Serif SC", "Songti SC", serif; --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
html:lang(zh-TW) { --serif: "Noto Serif TC", "Songti TC", serif; --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
html:lang(ko) { --serif: "Noto Serif KR", serif; --sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
:where(:not(html)[lang="ja"]) { font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }
:where(:not(html)[lang="zh-CN"]) { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
:where(:not(html)[lang="zh-TW"]) { font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.wrap { width: min(100% - 2 * var(--gutter), 75rem); margin-inline: auto; }
.main { flex: 1; min-width: 0; padding-block: clamp(1.25rem, 2.8vw, 2.25rem) clamp(3rem, 6vw, 5rem); }
.view-home .main { padding-top: 0; }

:where(h1, h2, h3, p, dl, dd, ul, ol, figure) { margin: 0; }
:where(h1, h2, h3) { font-family: var(--serif); font-weight: 700; line-height: 1.2; text-wrap: balance; color: var(--text); }
h1 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 2.2vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }

a { color: var(--primary); text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
img { max-width: 100%; display: block; }
a, p, h1, h2, h3, dt, dd, input, li { overflow-wrap: anywhere; }

:where(a, button, input, select, summary, [tabindex]):focus-visible,
.search-box:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.search-box:has(input:focus-visible) input:focus-visible { outline: 0; }

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip:focus {
  position: fixed; top: .75rem; left: 1rem; z-index: 50;
  padding: .75rem 1rem; background: var(--surface); border: 2px solid var(--primary);
  border-radius: var(--r-ctl); box-shadow: var(--shadow-pop);
}

/* ---------- Header: text nav + one light utility strip ---------- */
.mast {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.mast-row, .utilities, .brand, .section-nav, .utility { display: flex; align-items: center; }
.mast-row { min-height: var(--mast-h); gap: clamp(1rem, 3vw, 2.25rem); }
.brand, .section-nav a, .utility, .foot-col a { text-decoration: none; color: inherit; }
.brand {
  gap: .55rem; min-height: 44px; flex-shrink: 0; color: var(--text);
  font-family: var(--num); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand b { color: var(--primary); font-weight: 600; }
.wordmark { object-fit: contain; object-position: left center; height: 30px; width: auto; }

.section-nav { gap: clamp(1.1rem, 2.4vw, 1.9rem); }
.section-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: var(--mast-h);
  font-size: .95rem; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color var(--t);
}
.section-nav a:hover { color: var(--text); text-decoration: none; }
.section-nav a[aria-current="page"] { color: var(--text); }
.section-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 2px; background: var(--gold);
}

.utilities {
  gap: 2px; margin-left: auto; padding: 2px;
  background: rgb(247 249 246 / .9); border: 1px solid var(--line); border-radius: var(--r-ctl);
}
.utility {
  gap: .4rem; min-height: 36px; min-width: 36px; padding: 0 .6rem; justify-content: center;
  border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--text);
  list-style: none; font-size: .875rem; font-weight: 500; white-space: nowrap; transition: background var(--t);
}
.utility::-webkit-details-marker { display: none; }
.utility:hover, .disclosure[open] > summary, .mast-menu:not([hidden])[aria-expanded="true"] { background: rgb(31 52 57 / .07); }
.head-search .utility > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.caret { width: 0; height: 0; border-inline: 4px solid transparent; border-top: 5px solid var(--muted); margin-left: .1rem; }
.disclosure { position: relative; }
@media (scripting: enabled) {
  .head-search[hidden], .hero-stage .site-search[hidden] { display: block !important; visibility: hidden; }
}
.flyout {
  position: absolute; right: 0; top: calc(100% + .5rem); width: min(25rem, 92vw);
  padding: .75rem; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop); z-index: 40;
}
.language-links { width: max-content; max-width: 90vw; min-width: 11rem; display: grid; gap: 2px; padding: .35rem; }
.language-links a {
  display: flex; align-items: center; min-height: 40px; padding: .3rem .75rem;
  border-radius: var(--r-ctl); color: var(--text); text-decoration: none; transition: background var(--t);
}
.language-links a:hover { background: var(--mist); }
.language-links a[aria-current="page"] { background: var(--mist); color: var(--primary); font-weight: 700; }

/* Home: header sits on the hero; turns solid once the page scrolls (scroll-driven, CSS only). */
.view-home .mast { margin-bottom: calc(-1 * var(--mast-h) - 1px); }
/* Transparent only where the scroll timeline can turn it solid again; other browsers keep the solid sticky bar. */
@supports (animation-timeline: scroll()) {
  @keyframes mast-solid { from { background: transparent; border-bottom-color: transparent; } to { background: var(--surface); border-bottom-color: var(--line); } }
  .view-home .mast { animation: mast-solid linear both; animation-timeline: scroll(root); animation-range: 0 220px; }
  .view-home .mast:has(.mast-menu:not([hidden])[aria-expanded="true"]) { animation: none; background: var(--surface); border-bottom-color: var(--line); }
}

/* Icons */
.glyph { position: relative; display: inline-block; flex: 0 0 auto; width: .95rem; height: .95rem; }
.search-glyph { border: 1.8px solid currentColor; border-radius: 50%; width: .8rem; height: .8rem; margin: -.14rem .12rem 0 0; }
.search-glyph::after { content: ""; position: absolute; width: .42rem; height: 2px; background: currentColor; top: 100%; left: 82%; transform: rotate(45deg); border-radius: 2px; }
.globe-glyph { border: 1.6px solid currentColor; border-radius: 50%; }
.globe-glyph::before { content: ""; position: absolute; inset: -1px 3px; border-inline: 1.3px solid currentColor; border-radius: 50%; }
.globe-glyph::after { content: ""; position: absolute; inset: 46% 0 auto; border-top: 1.3px solid currentColor; }
.menu-glyph { height: .68rem; border-block: 1.8px solid; }
.menu-glyph::after { content: ""; position: absolute; top: 44%; left: 0; right: 0; border-top: 1.8px solid; }

/* ---------- Breadcrumbs ---------- */
.crumbs ol, .choices, .cards, .search-results, .link-list, .alias-list, .citations, .name-strip { list-style: none; padding: 0; }
.crumbs { margin-bottom: 1.25rem; font-size: .85rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.crumbs li { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; max-width: 100%; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; color: inherit; transition: color var(--t); }
.crumbs a:hover { color: var(--primary); }
.crumbs [aria-current] { color: var(--text); font-weight: 500; text-decoration: none; }

/* ---------- Shared text bits ---------- */
.eyebrow {
  display: block; margin-bottom: .6rem;
  color: var(--gold-ink); font-size: .85rem; font-weight: 700; letter-spacing: .02em;
}
.kicker { font-size: .875rem; color: var(--muted); letter-spacing: .04em; }
.kicker b { color: var(--gold-ink); font-weight: 700; margin-right: .5rem; letter-spacing: .02em; }
.star-dot, .shelf-mark { display: none; }
.lead { max-width: 36em; font-size: clamp(1rem, 1.3vw, 1.0625rem); color: var(--muted); line-height: 1.7; margin-top: 1rem; }
.sep { margin-inline: .5rem; color: var(--line-strong); }

/* Section head: serif H2 + 1px line with a small gold diamond at its start. Shared with other views. */
.sec-head {
  position: relative; display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem 1rem;
  padding-bottom: .75rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line);
}
.sec-head::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 7px; height: 7px;
  background: var(--gold); transform: rotate(45deg);
}
.sec-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.sec-more { margin-left: auto; font-size: .875rem; color: var(--primary); white-space: nowrap; }
.sec-more b { font: 600 .875rem var(--num); margin-left: .15rem; }

/* Primary button: solid, inner 1px gold-soft hairline, one per screen. */
.action, .search-go {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.6rem; border: 0; border-radius: var(--r-ctl);
  background: var(--primary); color: #fff; font-weight: 700; letter-spacing: .06em; text-decoration: none;
  box-shadow: var(--btn-hairline); transition: background var(--t);
}
.action:hover, .search-box:hover .search-go {
  background: var(--primary-press); text-decoration: none;
  box-shadow: inset 0 0 0 3px var(--primary-press), inset 0 0 0 4px rgb(242 217 172 / .8);
}
.action { margin-top: 1.5rem; width: fit-content; }

/* ---------- Language suggestion (root home) ---------- */
.lang-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  margin-bottom: 1.25rem; padding: .55rem .5rem .55rem .9rem;
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  background: var(--surface); color: var(--text); font-size: .875rem; line-height: 1.45;
}
.lang-banner-copy { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.lang-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; max-width: 100%; }
.lang-banner-cta, .lang-banner-close {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface);
  transition: background var(--t), border-color var(--t);
}
.lang-banner-cta { padding: 0 .8rem; color: var(--primary); font-weight: 700; }
.lang-banner-close { min-width: 36px; padding: 0; color: var(--muted); font-size: 1.2rem; }
.lang-banner-cta:hover, .lang-banner-close:hover { background: var(--mist); text-decoration: none; }

/* ---------- Search (live site search; header flyout + home hero) ---------- */
.site-search { position: relative; }
.search-box {
  display: flex; align-items: center; gap: .65rem; padding-left: .9rem; min-height: 46px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-ctl);
  overflow: hidden; cursor: text; transition: border-color var(--t);
}
.search-box:hover { border-color: rgb(31 52 57 / .42); }
.search-box:focus-within { border-color: var(--primary); }
.search-box .search-glyph { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; width: 100%; height: 44px; padding: 0 .9rem 0 0; border: 0; outline: 0; background: transparent; font-size: 1rem; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-go { display: none; cursor: pointer; }
.search-output {
  padding: .6rem; border: 1px solid var(--line-strong); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-pop);
}
.hero-stage .search-output { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + .4rem); text-align: left; }
.head-search .search-output { margin-top: .5rem; border: 0; box-shadow: none; padding: .25rem 0 0; }
.count { font-size: .82rem; color: var(--muted); font-weight: 500; padding-inline: .4rem; }
.search-results { max-height: min(38vh, 21rem); overflow-y: auto; overscroll-behavior: contain; margin-top: .4rem; }
.search-results li + li { border-top: 1px solid var(--line); }
.search-results a {
  display: grid; gap: .1rem; padding: .5rem .6rem; border-radius: var(--r-ctl);
  min-height: 44px; text-decoration: none; color: var(--text); transition: background var(--t);
}
.search-results a:hover { background: var(--mist); }
.search-results a:focus-visible { outline-offset: -2px; }
.search-results strong { font-weight: 500; }
.search-results small { color: var(--muted); font-size: .78rem; }

/* ---------- Language picker (/privacy/) ---------- */
.picker-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding-block: clamp(1rem, 3vw, 2.5rem);
}
.picker-copy { min-width: 0; }
.picker-copy h1 { margin-top: .75rem; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.18; }
.choices { margin-top: 2rem; border-top: 1px solid var(--line); }
.choices li { border-bottom: 1px solid var(--line); }
.choices a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .1rem 1rem;
  padding: .9rem .25rem; min-height: 56px; color: var(--text); text-decoration: none;
}
.choices strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; transition: color var(--t); }
.choices small { grid-row: 2; font-size: .85rem; color: var(--muted); }
.choice-code { grid-column: 2; grid-row: 1 / span 2; font: 600 .8rem var(--num); color: var(--muted); letter-spacing: .04em; }
.choices a:hover strong { color: var(--primary); }
.picker-visual { min-width: 0; }
.picker-stage:not(:has(.picker-visual)) { grid-template-columns: minmax(0, 44rem); }
.picker-art { border-radius: var(--r-tile); overflow: hidden; aspect-ratio: 4 / 3; background: var(--mist); }
.picker-art img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; }
.picker-note { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); max-width: 68ch; }

/* ---------- 404 ---------- */
.recovery { padding-block: clamp(2rem, 8vw, 6rem); max-width: 40rem; }
.recovery h1 { margin-top: .75rem; }

/* Fallback art when no key visual is available */
.landscape { width: 100%; height: 100%; min-height: 12rem; background: linear-gradient(160deg, var(--mist), var(--bg) 70%); }
.landscape .plate { display: none; }

.tool-page > .prose, .index-prose, .home-prose { margin-top: 2rem; }

/* ---------- Footer ---------- */
.foot { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .875rem; }
.foot-grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2rem; padding-block: 2.5rem 1.75rem;
}
.foot-copy { display: grid; align-content: start; gap: .6rem; max-width: 34em; }
.foot-copy .brand { font-size: 1.15rem; min-height: 32px; width: fit-content; }
.foot-copy p { line-height: 1.65; }
.foot-h { color: var(--text); font-weight: 700; font-size: .85rem; margin-bottom: .5rem; }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: grid; }
.foot-col a { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); transition: color var(--t); }
.foot-col a:hover { color: var(--primary); text-decoration: underline; }
.foot-legal { padding-block: 1rem 1.5rem; border-top: 1px solid var(--line); font: 500 .8rem var(--num); }

/* ---------- Tablet ---------- */
@media (max-width: 60rem) {
  .picker-stage { grid-template-columns: 1fr; }
  .picker-visual { order: -1; }
  .picker-art { aspect-ratio: 16 / 9; }
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-copy { grid-column: 1 / -1; }
}
/* Menu toggle breakpoint matches theme/script.js (56rem). */
@media (max-width: 56rem) {
  .mast-row { position: relative; flex-wrap: wrap; gap: 0 .5rem; }
  .mast .brand { order: 1; }
  /* menu toggle + utilities read as one strip */
  .mast-menu {
    order: 2; margin-left: auto; min-height: 42px; padding: 0 .65rem;
    border: 1px solid var(--line); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl);
    background: rgb(247 249 246 / .9) padding-box;
  }
  .utilities { order: 3; }
  .mast-menu:not([hidden]) ~ .utilities { margin-left: -.5rem; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
  .section-nav {
    order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0;
    border-top: 1px solid var(--line); padding-block: .25rem .5rem;
  }
  .section-nav a { min-height: 48px; padding-inline: .25rem; font-size: 1rem; }
  .section-nav a + a { border-top: 1px solid var(--line); }
  .section-nav a[aria-current="page"] { padding-left: .9rem; }
  .section-nav a[aria-current="page"]::after { left: 0; right: auto; top: 14px; bottom: 14px; width: 2px; height: auto; }
  .head-search { position: static; }
  .head-search .flyout { right: 0; top: calc(100% + 1px); width: 100%; }
}
@media (max-width: 56rem) and (scripting: enabled) {
  .mast-menu[hidden] { display: flex !important; visibility: hidden; }
  .mast-menu[hidden] + .section-nav { display: none; }
}
/* ---------- Phone ---------- */
@media (max-width: 40rem) {
  :root { --mast-h: 56px; --gutter: 1rem; }
  .brand { font-size: 1.15rem; }
  .wordmark { height: 26px; }
  .utility > span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  .utility { padding: 0; min-width: 40px; min-height: 40px; }
  .caret { display: none; }
  .mast-menu { padding: 0; min-width: 44px; min-height: 46px; }
  .choices a { padding-block: .8rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; padding-block: 2rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .view-home .mast { background: var(--surface); border-bottom-color: var(--line); }
}
@media (forced-colors: active) {
  .search-box:focus-within { outline: 2px solid Highlight; }
  .utilities, .action, .search-go { border: 1px solid ButtonText; }
}

/* ==== home: hero, notice, bento portals, shelves, FAQ ==== */

/* ---------- Hero: full-bleed key art, copy fades in from the left ---------- */
.home-hero {
  position: relative; isolation: isolate;
  min-height: 700px; display: flex; flex-direction: column; justify-content: flex-end;
}
.home-hero:has(.search-output:not([hidden])) { z-index: 15; }
.hero-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: var(--mist); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }
/* Hero motion: slow camera drift on the key visual, drifting petals and glints, pointer parallax
   (script sets --px/--py in -1..1). Transform-only, so it stays on the compositor; reduced motion turns it off. */
.home-hero { --px: 0; --py: 0; --fall: 760px; }
.hero-art img {
  transform-origin: 70% 30%; will-change: transform;
  translate: calc(var(--px) * -14px) calc(var(--py) * -10px); transition: translate .8s cubic-bezier(.2, .7, .2, 1);
  animation: hero-drift 32s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: scale(1.04) translate(0, 0); }
  to { transform: scale(1.12) translate(-1.6%, -1.2%); }
}
.hero-fx {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  translate: calc(var(--px) * -30px) calc(var(--py) * -20px); transition: translate .8s cubic-bezier(.2, .7, .2, 1);
}
.hero-fx i {
  position: absolute; top: -24px; left: var(--x); width: var(--s); height: calc(var(--s) * .62);
  border-radius: 100% 0 100% 0; opacity: 0;
  background: linear-gradient(135deg, #fff 0%, #F4C4D6 75%); box-shadow: 0 0 6px rgb(255 255 255 / .5);
  animation: petal-fall var(--t) linear var(--d) infinite;
}
@keyframes petal-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .9; }
  50% { transform: translate3d(calc(var(--dx) * -.4), calc(var(--fall) * .5), 0) rotate(calc(var(--r) * .5)); }
  88% { opacity: .75; }
  100% { transform: translate3d(var(--dx), var(--fall), 0) rotate(var(--r)); opacity: 0; }
}
.hero-fx b {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); opacity: 0;
  background: radial-gradient(circle, #fff 0 22%, rgb(255 255 255 / .55) 38%, rgb(255 255 255 / 0) 70%);
  animation: glint var(--t) ease-in-out var(--d) infinite;
}
.hero-fx b::before {
  content: ""; position: absolute; inset: 45% -60%; border-radius: 50%;
  background: linear-gradient(90deg, rgb(255 255 255 / 0), #fff, rgb(255 255 255 / 0));
}
@keyframes glint {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  50% { opacity: .95; transform: scale(1) rotate(45deg); }
}
.home-hero.is-still .hero-art img, .home-hero.is-still .hero-fx :is(i, b) { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .hero-fx { display: none; } .hero-art img { transform: none; } }
.home-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgb(247 249 246 / .96) 30%, rgb(247 249 246 / .55) 50%, rgb(247 249 246 / 0) 66%),
    linear-gradient(0deg, var(--bg) 0%, rgb(247 249 246 / 0) 24%),
    linear-gradient(180deg, rgb(247 249 246 / .55) 0, rgb(247 249 246 / 0) 96px);
}
.hero-inner { padding-top: calc(var(--mast-h) + 3.5rem); padding-bottom: 3.25rem; }
.hero-copy { width: min(37.5rem, 100%); }
.hero-copy .lang-banner { background: rgb(255 255 255 / .92); }
.home-hero h1 {
  margin-top: .9rem; font-size: clamp(2.25rem, 4.1vw, 3.625rem); line-height: 1.16; letter-spacing: -.02em;
}
.home-hero h1:lang(ja) { word-break: auto-phrase; }
.home-hero h1:is(:lang(zh), :lang(ko)) { word-break: keep-all; }
.home-hero h1:lang(en) { font-size: clamp(2.1rem, 3.6vw, 3.1rem); line-height: 1.14; }
.home-hero .lead { margin-top: 1rem; max-width: 33em; font-size: 1.0625rem; }

/* Joined search bar: input + primary button flush; the button is a label hit-area for the input */
.hero-search { margin-top: 1.75rem; }
.hero-search .search-box { min-height: 54px; padding-right: 0; gap: .7rem; padding-left: 1rem; }
.hero-search .search-box input { height: 52px; font-size: 1rem; }
.hero-search .search-go {
  display: inline-flex; align-self: stretch; min-height: 0; border-radius: 0; padding: 0 1.65rem;
  font-size: .95rem; letter-spacing: .08em; flex: none;
}

.quick-terms { margin-top: .9rem; font-size: .875rem; color: var(--muted); line-height: 1.9; }
.quick-label::after { content: "："; }
.quick-terms:lang(en) .quick-label::after { content: ":"; margin-right: .35rem; }
.quick-term { white-space: nowrap; }
.quick-chip {
  color: var(--text); border-bottom: 1px solid var(--line-strong);
  transition: border-color var(--t), color var(--t);
}
.quick-chip:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

.hero-stats { display: flex; margin-top: 2.5rem; }
.hero-stats > div { display: flex; flex-direction: column-reverse; padding: 0 1.9rem; border-left: 1px solid var(--line-strong); }
.hero-stats > div:first-child { padding-left: 0; border-left: 0; }
.hero-stats dd { font: 600 1.875rem/1 var(--num); font-variant-numeric: tabular-nums; color: var(--text); }
.hero-stats dt { margin-top: .4rem; font-size: .8125rem; color: var(--muted); }

/* ---------- Body ---------- */
.home-body { padding-bottom: 1rem; }
.block { margin-top: 5.5rem; }

/* Launch notice: left gold rule, not a pill */
.notice {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .5rem;
  padding: .8rem 1.1rem; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  font-size: .9rem;
}
.notice-label { font-family: var(--sans); font-size: .9rem; font-weight: 700; color: var(--gold-ink); letter-spacing: 0; }
.notice-text { flex: 1 1 20rem; min-width: 0; }
.notice-text small { color: var(--muted); font-size: .8rem; }
.notice-link { margin-left: auto; font-weight: 500; border-bottom: 1px solid currentColor; }
.notice-link:hover { text-decoration: none; color: var(--primary-press); }

/* ---------- Bento portals ---------- */
.bento { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 196px 196px; gap: 14px; }
.bento-ko { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0;
  padding: 22px; border-radius: var(--r-tile); overflow: hidden; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); transition: border-color var(--t);
}
a.tile:hover, .tile:has(a:hover) { border-color: var(--line-strong); text-decoration: none; }
.tile h3 { font-size: 1.45rem; line-height: 1.2; transition: color var(--t); }
.tile h3 a { color: inherit; }
.tile h3 b { font: 600 .875rem var(--num); color: var(--muted); margin-left: .5rem; }
a.tile:hover h3, .tile h3 a:hover { color: var(--primary); text-decoration: none; }
.tile-txt { position: relative; }
.tile-txt p { margin-top: .35rem; color: var(--muted); font-size: .875rem; line-height: 1.55; }

.tile-characters { grid-row: span 2; background: linear-gradient(160deg, #F3E9EE 0%, #E8EEF6 100%); }
/* Portraits fill the whole tile edge to edge; the title sits on a soft wash at the bottom. */
.tile-characters .tile-art { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.tile-characters .tile-art img {
  width: 100%; height: 100%; object-fit: cover; background: rgb(255 255 255 / .5); transition: filter var(--t);
}
.tile-characters::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgb(243 236 241 / .97) 0%, rgb(243 236 241 / .9) 22%, rgb(243 236 241 / 0) 48%);
}
.tile-characters .tile-txt { z-index: 1; }
.tile-characters:hover .tile-art img { filter: saturate(1.1) brightness(1.03); }
.tile-characters h3 { font-size: 1.875rem; }

.tile-kibo { grid-row: span 2; background: linear-gradient(180deg, #E3F1EC 0%, var(--bg) 100%); }
.tile-kibo .tile-art { position: absolute; inset: 22px 12px auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tile-kibo .tile-art img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: contain !important; object-position: 50% 50% !important;
  filter: drop-shadow(0 8px 12px rgb(31 52 57 / .16));
}

.tile-guides, .tile-tools { justify-content: space-between; gap: .75rem; }
.tile-guides .tile-txt p, div.tile-tools .tile-txt p { display: none; }
.tile-list { list-style: none; padding: 0; font-size: .875rem; }
.tile-list li { padding: .3rem 0; border-bottom: 1px dashed var(--line-strong); }
.tile-list li:last-child { border-bottom: 0; }
.tile-list a { display: block; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--t); }
.tile-list a:hover { color: var(--primary); text-decoration: none; }

.bento-ko .tile { min-height: 0; justify-content: flex-start; }

/* ---------- Typographic accents: heading colour follows the section, palette tokens only ---------- */
.sec-head h2, .home-faq-title h2 { color: var(--primary-press); }
.tile h3 b, .sec-more b { color: var(--gold-ink); }
.tile-characters h3 { color: var(--plum); }
.tile-kibo h3 { color: var(--primary); }
.tile-tools h3 { color: var(--gold-ink); }
a.tile:hover h3, .tile h3 a:hover { color: var(--primary-press); }
.hero-stats dd { color: var(--primary); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .home-hero h1 {
    background: linear-gradient(100deg, var(--text) 0%, var(--text) 38%, var(--primary) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
@media (forced-colors: active) { .home-hero h1 { background: none; color: CanvasText; } }

/* ---------- Shelves ---------- */
.shelf .seg { position: relative; margin-bottom: 1.1rem; width: fit-content; max-width: 100%; }
.shelf-character .cards, .shelf-kibo .cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.shelf .cards > li { min-width: 0; }

/* Guides: feature card + compact rows */
.guides-split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; }
.guides-split > * { min-width: 0; }
.guide-feature {
  position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 360px; padding: 26px; border-radius: var(--r-tile); overflow: hidden; color: #fff; background: #23383d;
}
.guide-feature img {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%;
  transition: transform 300ms ease;
}
.guide-feature::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgb(18 34 38 / .92) 0, rgb(18 34 38 / .4) 55%, rgb(18 34 38 / 0) 100%);
}
.guide-feature:hover { text-decoration: none; }
.guide-feature:hover img { transform: scale(1.02); }
.guide-feature h3 { color: #fff; font-size: clamp(1.35rem, 2.1vw, 1.75rem); line-height: 1.3; }
.guide-feature .guide-desc { margin-top: .6rem; max-width: 34em; color: rgb(255 255 255 / .84); font-size: .9375rem; line-height: 1.65; }
.guide-feature .guide-meta { margin-top: .85rem; color: rgb(255 255 255 / .72); font-size: .8125rem; }
.guide-rows { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.guide-rows li { padding: 1rem 2px; border-bottom: 1px solid var(--line); }
.guide-rows h3 { font-size: 1.0625rem; line-height: 1.45; }
.guide-rows h3 a { color: var(--text); transition: color var(--t); }
.guide-rows li:hover h3 a { color: var(--primary); text-decoration: none; }
.guide-rows p { margin-top: .2rem; font-size: .875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-rows .guide-meta { font-size: .78rem; }
.guide-meta time { font-family: var(--num); }

/* Updates: dated timeline */
.timeline { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; padding: 1rem 2px; border-bottom: 1px solid var(--line); }
.timeline time { position: relative; padding-left: 1.1rem; font: 500 .9rem/1.6 var(--num); color: var(--muted); }
.timeline time::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px;
  background: var(--gold); transform: rotate(45deg);
}
.timeline h3 { font-size: 1.0625rem; line-height: 1.45; }
.timeline h3 a { color: var(--text); transition: color var(--t); }
.timeline h3 a:hover { color: var(--primary); text-decoration: none; }
.timeline p { margin-top: .2rem; font-size: .875rem; color: var(--muted); }

/* Korean pilot: other-language catalog links */
.lang-rows { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.lang-rows li { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: .85rem 2px; border-bottom: 1px solid var(--line); }
.lang-rows strong { min-width: 7rem; font-weight: 700; }

/* ---------- FAQ: sticky title left, details list right ---------- */
.home-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2.5rem; align-items: start; }
.home-faq-title { position: sticky; top: calc(var(--mast-h) + 1.5rem); }
.home-faq-title h2 {
  position: relative; padding-bottom: .75rem; font-size: clamp(1.5rem, 2.4vw, 2rem);
  border-bottom: 1px solid var(--line);
}
.home-faq-title h2::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.home-faq .faq-list { border-top: 1px solid var(--line); }
.home-faq .faq-item { border-bottom: 1px solid var(--line); }
.home-faq summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 2px; list-style: none;
}
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq summary h3 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 1.0625rem; line-height: 1.5; color: var(--text); transition: color var(--t); }
.home-faq summary:hover h3 { color: var(--primary); }
.home-faq summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-3px) rotate(45deg);
}
.home-faq details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.home-faq .faq-item p { padding: 0 2px 1.15rem; max-width: 68ch; color: var(--muted); line-height: 1.75; }

/* ---------- Tablet ---------- */
@media (max-width: 60rem) {
  .home-hero { min-height: 620px; }
  .home-hero::before {
    background:
      linear-gradient(90deg, var(--bg) 0%, rgb(247 249 246 / .95) 52%, rgb(247 249 246 / .6) 74%, rgb(247 249 246 / .15) 92%),
      linear-gradient(0deg, var(--bg) 0%, rgb(247 249 246 / 0) 24%),
      linear-gradient(180deg, rgb(247 249 246 / .6) 0, rgb(247 249 246 / 0) 96px);
  }
  .bento { grid-template-columns: 1fr 1fr; grid-template-rows: 240px 190px 190px; }
  .tile-characters { grid-column: span 2; grid-row: auto; }
  .tile-kibo { grid-row: span 2; }
  .bento-ko { grid-template-rows: auto; }
  .shelf-character .cards, .shelf-kibo .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guides-split { grid-template-columns: 1fr; }
  .home-faq { grid-template-columns: 1fr; gap: 0; }
  .home-faq-title { position: static; margin-bottom: 1.5rem; }
}

/* ---------- Phone ---------- */
@media (max-width: 40rem) {
  .home-hero { min-height: 0; display: block; }
  .hero-art { position: relative; inset: auto; height: 290px; }
  .hero-art img { object-position: 62% 20%; }
  .home-hero { --fall: 330px; }
  .home-hero::before {
    bottom: auto; height: 290px;
    background: linear-gradient(180deg, rgb(247 249 246 / .55) 0, rgb(247 249 246 / 0) 72px, rgb(247 249 246 / 0) 160px, var(--bg) 286px);
  }
  .hero-inner { position: relative; padding-top: 0; margin-top: -1.25rem; padding-bottom: .5rem; }
  .kicker { font-size: .78rem; }
  .home-hero h1 { margin-top: .6rem; font-size: 2.05rem; line-height: 1.22; }
  .home-hero h1:lang(en) { font-size: 1.85rem; }
  .home-hero .lead { font-size: .9375rem; margin-top: .75rem; }
  .hero-search { margin-top: 1.25rem; }
  .hero-search .search-box { min-height: 50px; padding-left: .8rem; }
  .hero-search .search-box input { height: 48px; font-size: 1rem; }
  .hero-search .search-go { padding: 0 1.1rem; font-size: .875rem; }
  .quick-terms { font-size: .84rem; }
  .hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1.5rem; }
  .hero-stats > div { padding: 0 0 0 .75rem; }
  .hero-stats > div:first-child { padding: 0; }
  .hero-stats dd { font-size: 1.375rem; }
  .hero-stats dt { font-size: .72rem; line-height: 1.35; }

  .notice { margin-top: 1.5rem; font-size: .85rem; }
  .notice-link { margin-left: 0; }
  .block { margin-top: 3.5rem; }
  .sec-head h2, .home-faq-title h2 { font-size: 1.5rem; }

  .bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 10px; }
  .bento-ko { grid-template-rows: auto; }
  .bento-ko .tile { grid-column: span 2; min-height: 0; }
  .tile { padding: 16px; }
  .tile h3 { font-size: 1.2rem; }
  .tile-characters .tile-art { position: static; gap: 6px; margin-bottom: 14px; }
  .tile-characters .tile-art img { height: auto; aspect-ratio: 4 / 5; border-radius: var(--r-card); }
  .tile-characters::after { display: none; }
  .tile-characters .tile-txt { max-width: 100%; }
  .tile-characters h3 { font-size: 1.5rem; }
  .tile-kibo { grid-column: span 2; grid-row: auto; min-height: 200px; }
  .tile-kibo .tile-art { position: static; margin: -4px -4px 10px; grid-template-columns: repeat(4, 1fr); }
  .tile-guides { display: none; }
  .tile-tools { grid-column: span 2; }

  .shelf .seg { overflow-x: auto; scrollbar-width: none; }
  .shelf-character .cards {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
    margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .shelf-character .cards > li { flex: 0 0 40%; scroll-snap-align: start; }
  .shelf-kibo .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .shelf-kibo .cards > li:nth-child(n+5) { display: none; }

  .guide-feature { min-height: 290px; padding: 20px; }
  .guide-feature h3 { font-size: 1.3rem; }
  .guide-feature .guide-desc { font-size: .875rem; }
  .guide-rows h3, .timeline h3 { font-size: 1rem; }
  .timeline li { grid-template-columns: 1fr; gap: .25rem; }
  .home-faq summary h3 { font-size: 1rem; }
}

/* ==== catalog: element colors, cards, list filters ==== */
/* v2 rules (plan §4.1.1): no pills, radius tokens only, hover never lifts or adds shadow. */

/* ---- Element colour system (9 elements): sets --el-fg for .sig and tints ---- */
[data-el="fire"], .el-fire           { --el-fg: var(--element-fire); }
[data-el="water"], .el-water         { --el-fg: var(--element-water); }
[data-el="wood"], .el-wood           { --el-fg: var(--element-wood); }
[data-el="wind"], .el-wind           { --el-fg: var(--element-wind); }
[data-el="earth"], .el-earth         { --el-fg: var(--element-earth); }
[data-el="ice"], .el-ice             { --el-fg: var(--element-ice); }
[data-el="lightning"], .el-lightning { --el-fg: var(--element-lightning); }
[data-el="light"], .el-light         { --el-fg: var(--element-light); }
[data-el="dark"], .el-dark           { --el-fg: var(--element-dark); }

/* Legacy inline element label (still used by detail.html and the elemental-marks tool):
   plain "mark + label" text, no pill. */
.el-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .86rem; font-weight: 700; line-height: 1.3; white-space: nowrap;
  color: var(--el-fg, var(--text));
}
.el-dot {
  flex: none; width: .55rem; height: .55rem; border-radius: 1px;
  background: currentColor; transform: rotate(45deg);
}

/* Element tint behind art (cards and detail art stage); also the loading placeholder. */
:is(.el-fire, .el-water, .el-wood, .el-wind, .el-earth, .el-ice, .el-lightning, .el-light, .el-dark) :is(.card-media, .art-stage) {
  background-color: color-mix(in srgb, var(--el-fg) 9%, var(--surface));
}
:is(.el-fire, .el-water, .el-wood, .el-wind, .el-earth, .el-ice, .el-lightning, .el-light, .el-dark) .art-stage,
.entry-kibo:is(.el-fire, .el-water, .el-wood, .el-wind, .el-earth, .el-ice, .el-lightning, .el-light, .el-dark) .card-media {
  background-image: radial-gradient(circle at 50% 48%,
    color-mix(in srgb, var(--el-fg) 18%, var(--surface)) 0%,
    color-mix(in srgb, var(--el-fg) 7%, var(--surface)) 62%,
    color-mix(in srgb, var(--el-fg) 12%, var(--surface)) 100%);
}

/* ---- Card grids ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); gap: 14px; list-style: none; padding: 0; }
.cards-character, .cards-kibo { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cards-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.cards-update { grid-template-columns: minmax(0, 1fr); gap: 0; }
.cards-index { grid-template-columns: minmax(0, 1fr); gap: 0; }
.cards-index:has(> .entry-tool, > .entry-lookup) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 16px; }
@media (max-width: 74.9375rem) { .cards-character, .cards-kibo { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 68.75rem) { .cards-character, .cards-kibo { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 60rem) { .cards-character, .cards-kibo { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Card base ---- */
.entry {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
  transition: border-color var(--t);
}
.entry:hover, .entry:focus-within { border-color: var(--line-strong); }
.entry:focus-within:has(.card-title:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.cards-kibo .entry { content-visibility: auto; contain-intrinsic-size: auto 330px; }

.card-media {
  position: relative; flex: none; width: 100%; overflow: hidden;
  background-color: color-mix(in srgb, var(--sage) 12%, var(--surface));
}
.entry-character .card-media { aspect-ratio: 3 / 4; }
.entry-kibo .card-media { aspect-ratio: 1 / 1; }
.card-media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transition: transform 200ms ease;
}
.card-media.fit-cover img { object-fit: cover; object-position: 50% 15%; }
.card-media.fit-contain img {
  object-fit: contain; object-position: 50% 50%; padding: 12%;
  filter: drop-shadow(0 8px 10px rgb(31 52 57 / .14));
}
.entry:hover .card-media img { transform: scale(1.03); }
/* No art yet: element tint with one large mark, so the grid row keeps its rhythm. */
.card-media-empty { display: grid; place-items: center; }
.card-media-empty .sig { --sig: 3.5rem; opacity: .55; }

/* Element marks on art: small white square backing, top-left. */
.card-sigs {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  display: flex; gap: 3px;
}
.card-sig { display: inline-flex; }
.card-sigs .card-sig { padding: 2px; border-radius: 3px; background: rgb(255 255 255 / .92); }
.card-sigs .sig { --sig: 1.25rem; }
.card-sigs-inline { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.card-sigs-inline .card-sig { align-items: center; gap: .3rem; font-size: .82rem; font-weight: 700; color: var(--el-fg); }
.card-sigs-inline .sig { --sig: 1.1rem; }

.card-body {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px 12px; flex: 1; min-width: 0;
}
.card-title {
  display: block; color: var(--text); text-decoration: none;
  font-family: var(--serif); font-size: 1.0625rem; font-weight: 700; line-height: 1.3;
  transition: color var(--t);
}
.card-title:hover { text-decoration: none; }
.card-title:focus-visible { outline: 0; }
.card-title > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.entry:hover .card-title, .entry:focus-within .card-title { color: var(--primary); }

.card-meta {
  font-size: .78rem; line-height: 1.45; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta b { color: var(--text); font-weight: 500; }
.card-meta b + .card-alt::before { content: " · "; }
.card-submeta {
  font-size: .75rem; line-height: 1.45; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-desc {
  font-size: .875rem; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.entry-date, .card-cat {
  font-size: .75rem; font-weight: 600; line-height: 1.4; color: var(--gold-ink);
  font-variant-numeric: tabular-nums;
}
.entry-date { font-family: var(--num); letter-spacing: .02em; }
.pending-val { color: var(--muted); font-weight: 400; }

/* ---- Character card: 3:4 portrait, primary element bottom rule ---- */
.entry-character { border-bottom: 3px solid var(--el-fg, var(--line-strong)); }
.entry-character:hover, .entry-character:focus-within { border-bottom-color: var(--el-fg, var(--line-strong)); }

/* ---- Kibo card: square art on element tint, compact facts ---- */
.entry-kibo .card-sigs .card-sig { background: transparent; padding: 0; }
.entry-kibo .card-sigs .sig { --sig: 1.375rem; }
.card-facts {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 10px;
  margin-top: 6px; font-size: .75rem; line-height: 1.45;
}
.card-facts > div { display: contents; }
.card-facts dt { color: var(--muted); white-space: nowrap; }
.card-facts dd { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-facts dd.is-ride { color: var(--primary); font-weight: 500; }

/* ---- Text cards (guides, updates, directory rows): compact rows, no box ---- */
:is(.cards-guide, .cards-update, .cards-index) > :is(.entry-article, .entry-basic) {
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; overflow: visible;
}
:is(.cards-guide, .cards-update, .cards-index) > :is(.entry-article, .entry-basic) .card-body { padding: 14px 0; gap: 4px; }
:is(.cards-guide, .cards-update, .cards-index) > :is(.entry-article, .entry-basic):hover { border-color: var(--line-strong); }
:is(.cards-guide, .cards-update) > .entry:first-child,
.cards-index > :is(.entry-article, .entry-basic):first-child { border-top: 1px solid var(--line); }
.cards-guide > .entry:nth-child(2) { border-top: 1px solid var(--line); }
.cards-guide .card-desc, .cards-update .card-desc { -webkit-line-clamp: 1; }
.cards-index > :is(.entry-article, .entry-basic) .card-title { font-size: 1.1875rem; }
.cards-index > :is(.entry-article, .entry-basic) .card-desc { max-width: 72ch; }
.cards-update > .entry .card-body {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: 16px; align-items: baseline;
}
.cards-update > .entry .card-body > :not(.entry-date) { grid-column: 2; }
.cards-update > .entry .entry-date { grid-row: 1 / span 3; font-size: .875rem; }

/* ---- Tool cards: large app-like cards with a static example ---- */
.entry-tool, .entry-lookup {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center;
  border-radius: var(--r-tile); min-height: 9.5rem;
}
.card-art {
  align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 8px; background: var(--mist); border-right: 1px solid var(--line);
  font-size: .8rem; line-height: 1.2; color: var(--muted); text-align: center;
}
.entry-tool .card-art { flex-direction: row; flex-wrap: wrap; align-content: center; gap: 2px; }
.entry-tool .card-art .sig { --sig: 1.625rem; }
.card-art .demo-in { color: var(--muted); }
.card-art .demo-to { width: 1px; height: 14px; background: var(--line-strong); }
.card-art .demo-out { font-family: var(--serif); font-size: 1.125rem; font-weight: 700; color: var(--primary); }
.entry-tool .card-body, .entry-lookup .card-body { padding: 16px 18px; gap: 6px; }
.entry-tool .card-title, .entry-lookup .card-title { font-size: 1.1875rem; }
.entry-tool .card-desc, .entry-lookup .card-desc { -webkit-line-clamp: 3; }
.entry:hover .card-art .sig, .entry:hover .card-art .demo-out { transform: none; }

/* ---- List / directory banner ---- */
.catalog-banner {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: clamp(.5rem, 2vw, 1.5rem) 0 clamp(1.25rem, 2.4vw, 1.75rem);
}
.catalog-banner h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; }
.catalog-banner .lead { margin-top: 10px; }
.catalog-total {
  display: flex; align-items: baseline; gap: 6px; flex: none; margin: 0;
  color: var(--muted); font-size: .875rem; white-space: nowrap;
}
.catalog-total b { font-family: var(--num); font-size: clamp(2rem, 3.4vw, 2.75rem); font-weight: 600; line-height: 1; color: var(--text); }

/* ---- Sticky filter bar ---- */
.catalog-controls {
  position: sticky; top: var(--mast-h, 4.1rem); z-index: 20;
  display: grid; gap: 10px;
  margin: 0 calc(-1 * var(--gutter)) 20px; padding: 12px var(--gutter);
  background: var(--surface); border-block: 1px solid var(--line);
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-width: 0; }
.catalog-controls label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .8125rem; color: var(--muted); }
.catalog-controls .query-control { flex: 1 1 16rem; }
.filter-search {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--muted);
  transition: border-color var(--t);
}
.filter-search:hover { border-color: var(--muted); }
.filter-search:focus-within { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: -1px; }
.filter-search input {
  flex: 1; min-width: 0; height: 36px; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: .9375rem;
}
.filter-search input::placeholder { color: var(--muted); opacity: .85; }
.catalog-controls select {
  height: 38px; padding: 0 30px 0 10px; max-width: 13rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background-color: var(--surface);
  color: var(--text); font-size: .875rem; transition: border-color var(--t);
}
.catalog-controls select:hover { border-color: var(--muted); }
.catalog-controls select:disabled, .catalog-controls input:disabled, .seg button:disabled { cursor: default; }
.filter-lbl { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.seg-field { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }

.reset {
  height: 38px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  color: var(--primary); font-size: .875rem; font-weight: 500;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); text-underline-offset: .25em;
  transition: color var(--t);
}
.reset:hover { color: var(--primary-press); text-decoration-color: currentColor; }
.reset:disabled { color: var(--muted); text-decoration: none; }
.catalog-controls:not([data-filtered]) .filter-facets .reset { color: var(--muted); text-decoration-color: var(--line-strong); }
.filter-count { margin: 0 0 0 auto; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.filter-count b { font-family: var(--num); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- Segmented button group (list pages + homepage shelves) ---- */
.seg {
  display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface);
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 38px; margin: 0; padding: 0 10px;
  border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent;
  color: var(--text); font-size: .875rem; font-weight: 500; line-height: 1; cursor: pointer;
  transition: background-color var(--t), color var(--t);
}
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--mist); }
.seg button[aria-pressed="true"] { background: var(--text); color: #fff; }
.seg button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.seg .sig { --sig: 1.375rem; }
.seg button[aria-pressed="true"] .sig { color: color-mix(in srgb, var(--el-fg) 45%, #fff); }
.seg button[aria-pressed="true"] .sig::before { background: currentColor; border-color: currentColor; }
.seg button[aria-pressed="true"] .sig::after { background: var(--text); }

/* ---- Empty states ---- */
.section-empty, .empty {
  margin: 24px 0; padding: 28px 16px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r-card); color: var(--muted);
}
.empty { display: grid; justify-items: center; gap: 6px; }
.empty-active { color: var(--text); font-weight: 500; }
.entries:has(> li) + .section-empty { display: none; }

/* ---- Small screens ---- */
@media (max-width: 40rem) {
  .cards-character, .cards-kibo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cards-kibo .entry { contain-intrinsic-size: auto calc(46vw + 6.5rem); }
  .cards-guide { grid-template-columns: 1fr; }
  .cards-guide > .entry:nth-child(2) { border-top: 0; }
  .card-title { font-size: 1rem; }
  .card-body { padding: 8px 10px 10px; }
  .cards-update > .entry .card-body { grid-template-columns: 1fr; }
  .cards-update > .entry .card-body > :not(.entry-date) { grid-column: 1; }
  .cards-update > .entry .entry-date { grid-row: auto; }
  .entry-tool, .entry-lookup { grid-template-columns: 5rem minmax(0, 1fr); min-height: 0; }
  .entry-tool .card-art .sig { --sig: 1.25rem; }

  .catalog-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .catalog-total b { font-size: 1.75rem; }
  /* A tall sticky bar would cover most of a phone screen. */
  .catalog-controls { position: static; }
  .filter-main, .filter-facets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .catalog-controls .query-control, .seg-field { grid-column: 1 / -1; }
  .seg-field .filter-lbl { display: none; }
  .seg-field .seg { flex: 1; }
  .seg button { min-width: 44px; height: 44px; }
  .catalog-controls .select-control { display: grid; gap: 4px; }
  .catalog-controls select { width: 100%; max-width: none; height: 44px; }
  .filter-search { height: 44px; }
  .reset { height: 44px; }
  .filter-facets .reset { justify-self: start; }
  .filter-count { align-self: center; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  .entry:hover .card-media img { transform: none; }
}
@media (forced-colors: active) {
  .seg button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .card-sigs .card-sig { forced-color-adjust: none; }
}

/* ==== detail: dossier (character/kibo), guides/prose, tool + basic shells ==== */
/* Shared contract read from 10-shell.css :root (--serif --num --line --gold --r-* --t --shadow-pop) and 05-sigil.css (.sig).
   Element colour comes from [data-el] / .el-* in 30-catalog.css (--el-fg). */

.dossier, .article-shell, .reading, .tool-page {
  --stick: calc(var(--mast-h, 4.1rem) + 1px);   /* sticky offset below the site header */
  --anchor-gap: calc(var(--stick) + 3.5rem);    /* scroll-margin: header + in-page nav */
  min-width: 0;
}
.dossier :is(ul, ol), .article-shell :is(.toc ol, .link-list, .citations), .reading :is(.link-list, .citations), .tool-page :is(.link-list, .citations) {
  list-style: none; padding: 0; margin: 0;
}

/* ---------- Section head: serif H2 + hairline that starts with a small gold diamond ---------- */
.sec-head {
  position: relative; display: flex; align-items: baseline; gap: 1rem;
  padding-bottom: .65rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.sec-head::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 7px; height: 7px;
  background: var(--gold); transform: rotate(45deg);
}
.sec-head h2 { font: 700 clamp(1.3rem, 1.9vw, 1.6rem)/1.25 var(--serif); letter-spacing: -.01em; }
.sec-head h3 { font: 700 1.15rem/1.3 var(--serif); }

.type-label {
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--gold-ink);
}
.fact-scope { color: var(--muted); font-size: .8rem; font-weight: 400; }
.pending-val { color: var(--muted); }

/* ---------- Dossier hero ---------- */
.dossier { counter-reset: cite; }
.dossier-hero {
  display: grid; grid-template-columns: minmax(16rem, 23rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 3.5vw, 3rem); align-items: start;
  scroll-margin-top: var(--anchor-gap);
}
.dossier-hero:not(:has(.dossier-art)) { grid-template-columns: minmax(0, 1fr); }
.dossier-art { margin: 0; display: grid; gap: .5rem; min-width: 0; }
.dossier .art-stage {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 3 / 4; border-radius: var(--r-tile);
  border: 1px solid color-mix(in srgb, var(--el-fg, var(--primary)) 18%, var(--line));
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--el-fg, var(--primary)) 16%, var(--surface)) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--el-fg, var(--primary)) 9%, var(--surface)) 0%, color-mix(in srgb, var(--el-fg, var(--primary)) 20%, var(--surface)) 100%);
}
.dossier-kibo .art-stage { aspect-ratio: 4 / 5; }
.art-watermark.sig {
  --sig: 86%; position: absolute; z-index: -1; right: -24%; bottom: -14%;
  opacity: .14; width: var(--sig); height: auto; aspect-ratio: 1;
}
.dossier .art-stage img { width: 100%; height: 100%; }
.dossier .art-stage img.fit-cover { object-fit: cover; object-position: 50% 20%; }
.dossier .art-stage img:not(.fit-cover) {
  object-fit: contain; padding: 8%;
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--text) 16%, transparent));
}
.art-credit { font-size: .75rem; color: var(--muted); }

.dossier-head { display: flex; flex-direction: column; gap: 1rem; min-width: 0; padding-top: .25rem; }
.dossier-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; }
.el-mark {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .9rem; font-weight: 600; color: var(--el-fg, var(--text));
}
.el-mark .sig { --sig: 1.35rem; }
.dossier-head h1 {
  font: 700 clamp(2.1rem, 4.2vw, 3.4rem)/1.12 var(--serif); letter-spacing: -.02em;
  word-break: auto-phrase;
}

/* five-language names as one compact definition row */
.name-strip { display: flex; flex-wrap: wrap; gap: .35rem 0; margin: 0; font-size: .95rem; }
.name-strip > div { display: flex; align-items: baseline; gap: .4rem; padding-inline: .85rem; border-left: 1px solid var(--line); }
.name-strip > div:first-child { padding-left: 0; border-left: 0; }
.name-strip dt { font: 600 .7rem/1 var(--num); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.name-strip dd { margin: 0; font-weight: 500; }

.dossier-summary { max-width: 60ch; font-size: 1.02rem; line-height: 1.75; color: var(--text); }

/* key facts: compact table with 1px row lines */
.key-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem;
  margin: .25rem 0 0; border-bottom: 1px solid var(--line);
}
.key-facts > div {
  display: grid; grid-template-columns: minmax(5rem, 7.5rem) minmax(0, 1fr); gap: .75rem;
  padding-block: .6rem; border-top: 1px solid var(--line); align-items: baseline;
}
.key-facts dt { font-size: .85rem; color: var(--muted); }
.key-facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .95rem; }
.kf-val strong { font-weight: 600; }
.kf-val .fact-scope { margin-left: .25rem; }
.key-facts .el-mark { font-size: .95rem; }
.key-facts .el-mark .sig { --sig: 1.15rem; }

/* ---------- In-page anchor nav (sticky under the site header) ---------- */
.anchor-nav {
  position: sticky; top: var(--stick); z-index: 20;
  margin: 2rem 0 0; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.anchor-nav ul {
  display: flex; gap: 1.75rem; overflow-x: auto; scrollbar-width: none;
}
.anchor-nav ul::-webkit-scrollbar { display: none; }
.anchor-nav a {
  position: relative; display: block; padding: .8rem 0 .7rem; white-space: nowrap;
  font-size: .92rem; font-weight: 500; color: var(--muted); text-decoration: none;
  transition: color var(--t);
}
.anchor-nav a:hover { color: var(--text); }
.anchor-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: transparent; transition: background-color var(--t);
}
.anchor-nav a[aria-current="true"], .anchor-nav a[aria-current="location"] { color: var(--text); }
.anchor-nav a[aria-current="true"]::after, .anchor-nav a[aria-current="location"]::after { background: var(--gold); }
/* pure-CSS current state: the clicked anchor (:target), else the first link */
.dossier:not(:has(:target)) .anchor-nav li:first-child a,
.dossier:has(#overview:target) .anchor-nav a[href="#overview"],
.dossier:has(#field-guide:target) .anchor-nav a[href="#field-guide"],
.dossier:has(#uses:target) .anchor-nav a[href="#uses"],
.dossier:has(#skills:target) .anchor-nav a[href="#skills"],
.dossier:has(#profile:target) .anchor-nav a[href="#profile"],
.dossier:has(#names:target) .anchor-nav a[href="#names"],
.dossier:has(#sources:target) .anchor-nav a[href="#sources"],
.dossier:has(#related:target) .anchor-nav a[href="#related"] { color: var(--text); }
.dossier:not(:has(:target)) .anchor-nav li:first-child a::after,
.dossier:has(#overview:target) .anchor-nav a[href="#overview"]::after,
.dossier:has(#field-guide:target) .anchor-nav a[href="#field-guide"]::after,
.dossier:has(#uses:target) .anchor-nav a[href="#uses"]::after,
.dossier:has(#skills:target) .anchor-nav a[href="#skills"]::after,
.dossier:has(#profile:target) .anchor-nav a[href="#profile"]::after,
.dossier:has(#names:target) .anchor-nav a[href="#names"]::after,
.dossier:has(#sources:target) .anchor-nav a[href="#sources"]::after,
.dossier:has(#related:target) .anchor-nav a[href="#related"]::after { background: var(--gold); }
.anchor-nav:has(a[aria-current]) a:not([aria-current])::after { background: transparent !important; }

.dossier-sec, .dossier .evidence, .dossier .related, .detail-grid { margin-top: clamp(2.25rem, 4vw, 3.25rem); }
.dossier-sec, .dossier :is(.evidence, .related, .names-grid) { scroll-margin-top: var(--anchor-gap); }
.dossier-prose { max-inline-size: 72ch; overflow-wrap: anywhere; }

/* ---------- Inline source marker: numbered [n], opens the same citations ---------- */
.cite-mark { display: inline-block; vertical-align: baseline; margin-left: .2rem; }
.cite-mark > summary {
  display: inline-block; list-style: none; cursor: pointer;
  padding: .3rem .2rem; margin: -.3rem -.05rem;
  font: 600 .68rem/1 var(--num); color: var(--primary);
  vertical-align: super; border-radius: var(--r-ctl);
  transition: color var(--t), background-color var(--t);
}
.cite-mark > summary::-webkit-details-marker { display: none; }
.cite-mark > summary::after { counter-increment: cite; content: "[" counter(cite) "]"; }
.cite-mark > summary:hover, .cite-mark[open] > summary { background: var(--mist); color: var(--primary-press); }
.cite-pop {
  position: absolute; z-index: 25; left: 0; right: 0;
  margin-top: .35rem; padding: .6rem .85rem .5rem;
  max-height: 22rem; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
  font-size: .84rem; line-height: 1.5; font-weight: 400; color: var(--text); text-align: start;
}
.cite-pop > .fact-scope { display: block; padding-bottom: .35rem; }

/* citation entries (popover + page sources list) */
.citations li { padding-block: .45rem; border-top: 1px solid var(--line); }
.citations li:first-child { border-top: 0; }
.cite-pop .citations li:first-child { padding-top: 0; }
.citations a { font-weight: 600; color: var(--primary); text-decoration: none; }
.citations a:hover { text-decoration: underline; }
.citation-url { display: block; font-size: .76rem; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.citations small { display: block; color: var(--muted); font-size: .76rem; }

/* ---------- Kibo: combat + production side by side ---------- */
.uses-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.use-card {
  --use: var(--element-fire);
  position: relative; min-width: 0; padding: 1rem 1.15rem .6rem;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--use);
  border-radius: var(--r-card);
}
.use-production-use { --use: var(--element-wood); }
.use-card h3 { display: flex; align-items: center; gap: .5rem; font: 700 1.1rem/1.3 var(--serif); margin-bottom: .4rem; }
.use-ico { flex: none; width: .55rem; height: .55rem; background: var(--use, var(--gold)); transform: rotate(45deg); }
.use-card:not(:has(.use-vals li)) { display: none; }
.uses-grid:not(:has(.use-production-use .use-vals li)) { grid-template-columns: minmax(0, 1fr); }
.use-vals > li { padding-block: .55rem; border-top: 1px solid var(--line); }
.use-vals > li:first-child { border-top: 0; }
.use-vals .fv { font-weight: 600; }
.use-vals .fact-scope { display: inline; margin-left: .35rem; }

.use-strips {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem;
  margin: 1rem 0 0; border-bottom: 1px solid var(--line);
}
.use-strip {
  position: relative; display: grid; grid-template-columns: minmax(5rem, 7.5rem) minmax(0, 1fr); gap: .75rem;
  padding-block: .6rem; border-top: 1px solid var(--line); align-items: baseline;
}
.use-strip dt { display: flex; align-items: center; gap: .45rem; font-size: .88rem; color: var(--muted); }
.use-strip dd { margin: 0; min-width: 0; }
.strip-mount { --use: var(--primary); }
.strip-evo { --use: var(--gold); }
.use-strip .use-vals > li { padding-block: 0 .3rem; border: 0; }
.use-strip:not(:has(li)) { display: none; }
.use-strips:not(:has(li)) { display: none; }
.use-strips:not(:has(.strip-mount li)), .use-strips:not(:has(.strip-evo li)) { grid-template-columns: minmax(0, 1fr); }
/* evolution chain (structured steps when the payload provides content.evolution) */
.evo-chain { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 0; margin-bottom: .35rem; }
.evo-chain li { display: flex; align-items: center; }
.evo-chain li + li::before {
  content: ""; width: 1.4rem; height: 1px; margin-inline: .5rem; background: var(--line-strong);
}
.evo-chain a, .evo-chain strong, .evo-chain span {
  display: inline-block; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: var(--r-ctl);
  font-weight: 600; text-decoration: none; color: var(--text); transition: border-color var(--t), color var(--t);
}
.evo-chain a:hover { border-color: var(--line-strong); color: var(--primary); }
.evo-chain strong { border-color: var(--gold); }
.evo-chain + .evo-text .fv { font-weight: 400; color: var(--muted); }
/* mount-use / evolution live in the uses strips (with their sources); don't list them twice */
.dossier:has(#uses .use-strip li) .fact-row:is([data-key="mount-use"], [data-key="evolution"]) { display: none; }

/* ---------- Skills ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.skill-card {
  position: relative; min-width: 0; padding: 1rem 1.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
}
.skill-card h3 { font: 700 1.1rem/1.3 var(--serif); }
.skill-card h3 small { font-family: var(--sans); font-weight: 400; font-size: .85rem; color: var(--muted); }
.skill-marks { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .55rem; }
.mark-act { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 600; color: var(--el-fg, var(--text)); }
.mark-act .sig { --sig: 1.3rem; }
.skill-sum { margin-top: .55rem; }
.skill-sum > p { display: inline; }
.skill-scope { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

/* ---------- Profile facts + names: compact two-column tables ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 2.75rem); align-items: start; }
.detail-grid > .dossier-sec, .names-grid > .dossier-sec { margin-top: 0; }
.detail-grid:not(:has(.profile-panel)), .detail-grid:not(:has(.names-grid)) { grid-template-columns: minmax(0, 1fr); }
.names-grid { display: grid; gap: clamp(1.75rem, 3vw, 2.5rem); }

.fact-rows, .data-table { position: relative; margin: 0; border-bottom: 1px solid var(--line); }
.fact-rows { display: flex; flex-wrap: wrap; }
.fact-row, .dt-row {
  flex: 1 1 100%; display: grid; grid-template-columns: minmax(5rem, 7.5rem) minmax(0, 1fr); gap: .75rem;
  align-items: baseline; padding-block: .55rem; border-top: 1px solid var(--line);
}
.fact-rows dt, .data-table dt { font-size: .85rem; color: var(--muted); }
.fact-rows dd, .data-table dd { margin: 0; min-width: 0; font-size: .95rem; }
.fact-rows .fv { font-weight: 600; }
.data-table dd strong { font-weight: 600; }
.alias-list dt { font: 600 .72rem/1.6 var(--num); letter-spacing: .06em; text-transform: uppercase; }
.fact-rows .fact-scope, .data-table .fact-scope { margin-left: .3rem; }

/* conflicting values for the same fact (consecutive rows with the same key): shown side by side,
   each value keeps its own region/version scope and source marker. Keys listed explicitly (CSS cannot compare attributes). */
:is(.fact-row[data-key="element"]:has(+ .fact-row[data-key="element"]), .fact-row[data-key="role"]:has(+ .fact-row[data-key="role"]), .fact-row[data-key="faction"]:has(+ .fact-row[data-key="faction"]), .fact-row[data-key="race"]:has(+ .fact-row[data-key="race"]), .fact-row[data-key="occupation"]:has(+ .fact-row[data-key="occupation"]), .fact-row[data-key="weapon"]:has(+ .fact-row[data-key="weapon"]), .fact-row[data-key="cv"]:has(+ .fact-row[data-key="cv"]), .fact-row[data-key="anatomy"]:has(+ .fact-row[data-key="anatomy"]), .fact-row[data-key="behavior"]:has(+ .fact-row[data-key="behavior"]), .fact-row[data-key="combat-style"]:has(+ .fact-row[data-key="combat-style"]), .fact-row[data-key="habitat"]:has(+ .fact-row[data-key="habitat"]), .fact-row[data-key="mount-use"]:has(+ .fact-row[data-key="mount-use"]), .fact-row[data-key="evolution"]:has(+ .fact-row[data-key="evolution"])) { flex: 1 1 0; min-width: min(100%, 16rem); }
:is(.fact-row[data-key="element"] + .fact-row[data-key="element"], .fact-row[data-key="role"] + .fact-row[data-key="role"], .fact-row[data-key="faction"] + .fact-row[data-key="faction"], .fact-row[data-key="race"] + .fact-row[data-key="race"], .fact-row[data-key="occupation"] + .fact-row[data-key="occupation"], .fact-row[data-key="weapon"] + .fact-row[data-key="weapon"], .fact-row[data-key="cv"] + .fact-row[data-key="cv"], .fact-row[data-key="anatomy"] + .fact-row[data-key="anatomy"], .fact-row[data-key="behavior"] + .fact-row[data-key="behavior"], .fact-row[data-key="combat-style"] + .fact-row[data-key="combat-style"], .fact-row[data-key="habitat"] + .fact-row[data-key="habitat"], .fact-row[data-key="mount-use"] + .fact-row[data-key="mount-use"], .fact-row[data-key="evolution"] + .fact-row[data-key="evolution"]) {
  flex: 1 1 0; min-width: min(100%, 12rem); grid-template-columns: minmax(0, 1fr);
  margin-block: .55rem; padding-block: 0; padding-left: 1rem; border-top: 0; border-left: 1px solid var(--line);
}
:is(.fact-row[data-key="element"] + .fact-row[data-key="element"], .fact-row[data-key="role"] + .fact-row[data-key="role"], .fact-row[data-key="faction"] + .fact-row[data-key="faction"], .fact-row[data-key="race"] + .fact-row[data-key="race"], .fact-row[data-key="occupation"] + .fact-row[data-key="occupation"], .fact-row[data-key="weapon"] + .fact-row[data-key="weapon"], .fact-row[data-key="cv"] + .fact-row[data-key="cv"], .fact-row[data-key="anatomy"] + .fact-row[data-key="anatomy"], .fact-row[data-key="behavior"] + .fact-row[data-key="behavior"], .fact-row[data-key="combat-style"] + .fact-row[data-key="combat-style"], .fact-row[data-key="habitat"] + .fact-row[data-key="habitat"], .fact-row[data-key="mount-use"] + .fact-row[data-key="mount-use"], .fact-row[data-key="evolution"] + .fact-row[data-key="evolution"]) > dt {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
:is(.fact-row[data-key="element"]:has(+ .fact-row[data-key="element"]), .fact-row[data-key="role"]:has(+ .fact-row[data-key="role"]), .fact-row[data-key="faction"]:has(+ .fact-row[data-key="faction"]), .fact-row[data-key="race"]:has(+ .fact-row[data-key="race"]), .fact-row[data-key="occupation"]:has(+ .fact-row[data-key="occupation"]), .fact-row[data-key="weapon"]:has(+ .fact-row[data-key="weapon"]), .fact-row[data-key="cv"]:has(+ .fact-row[data-key="cv"]), .fact-row[data-key="anatomy"]:has(+ .fact-row[data-key="anatomy"]), .fact-row[data-key="behavior"]:has(+ .fact-row[data-key="behavior"]), .fact-row[data-key="combat-style"]:has(+ .fact-row[data-key="combat-style"]), .fact-row[data-key="habitat"]:has(+ .fact-row[data-key="habitat"]), .fact-row[data-key="mount-use"]:has(+ .fact-row[data-key="mount-use"]), .fact-row[data-key="evolution"]:has(+ .fact-row[data-key="evolution"]), .fact-row[data-key="element"] + .fact-row[data-key="element"], .fact-row[data-key="role"] + .fact-row[data-key="role"], .fact-row[data-key="faction"] + .fact-row[data-key="faction"], .fact-row[data-key="race"] + .fact-row[data-key="race"], .fact-row[data-key="occupation"] + .fact-row[data-key="occupation"], .fact-row[data-key="weapon"] + .fact-row[data-key="weapon"], .fact-row[data-key="cv"] + .fact-row[data-key="cv"], .fact-row[data-key="anatomy"] + .fact-row[data-key="anatomy"], .fact-row[data-key="behavior"] + .fact-row[data-key="behavior"], .fact-row[data-key="combat-style"] + .fact-row[data-key="combat-style"], .fact-row[data-key="habitat"] + .fact-row[data-key="habitat"], .fact-row[data-key="mount-use"] + .fact-row[data-key="mount-use"], .fact-row[data-key="evolution"] + .fact-row[data-key="evolution"]) > dd { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .1rem; }
:is(.fact-row[data-key="element"]:has(+ .fact-row[data-key="element"]), .fact-row[data-key="role"]:has(+ .fact-row[data-key="role"]), .fact-row[data-key="faction"]:has(+ .fact-row[data-key="faction"]), .fact-row[data-key="race"]:has(+ .fact-row[data-key="race"]), .fact-row[data-key="occupation"]:has(+ .fact-row[data-key="occupation"]), .fact-row[data-key="weapon"]:has(+ .fact-row[data-key="weapon"]), .fact-row[data-key="cv"]:has(+ .fact-row[data-key="cv"]), .fact-row[data-key="anatomy"]:has(+ .fact-row[data-key="anatomy"]), .fact-row[data-key="behavior"]:has(+ .fact-row[data-key="behavior"]), .fact-row[data-key="combat-style"]:has(+ .fact-row[data-key="combat-style"]), .fact-row[data-key="habitat"]:has(+ .fact-row[data-key="habitat"]), .fact-row[data-key="mount-use"]:has(+ .fact-row[data-key="mount-use"]), .fact-row[data-key="evolution"]:has(+ .fact-row[data-key="evolution"]), .fact-row[data-key="element"] + .fact-row[data-key="element"], .fact-row[data-key="role"] + .fact-row[data-key="role"], .fact-row[data-key="faction"] + .fact-row[data-key="faction"], .fact-row[data-key="race"] + .fact-row[data-key="race"], .fact-row[data-key="occupation"] + .fact-row[data-key="occupation"], .fact-row[data-key="weapon"] + .fact-row[data-key="weapon"], .fact-row[data-key="cv"] + .fact-row[data-key="cv"], .fact-row[data-key="anatomy"] + .fact-row[data-key="anatomy"], .fact-row[data-key="behavior"] + .fact-row[data-key="behavior"], .fact-row[data-key="combat-style"] + .fact-row[data-key="combat-style"], .fact-row[data-key="habitat"] + .fact-row[data-key="habitat"], .fact-row[data-key="mount-use"] + .fact-row[data-key="mount-use"], .fact-row[data-key="evolution"] + .fact-row[data-key="evolution"]) .fact-scope { order: 3; flex-basis: 100%; margin-left: 0; }

/* ---------- Page-level sources & related ---------- */
.evidence { margin-top: clamp(2.25rem, 4vw, 3.25rem); }
.evidence-updated { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.evidence-drawer > summary {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px;
  font-size: .88rem; font-weight: 600; color: var(--primary); list-style: none;
}
.evidence-drawer > summary::-webkit-details-marker { display: none; }
.evidence-drawer > summary::before {
  content: ""; width: .45rem; height: .45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--t);
}
.evidence-drawer[open] > summary::before { transform: rotate(45deg); }
.evidence .citations {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); column-gap: 2rem;
  border-bottom: 1px solid var(--line); font-size: .86rem;
}
.evidence .citations li, .evidence .citations li:first-child { padding-block: .6rem; border-top: 1px solid var(--line); }

.related { margin-top: clamp(2.25rem, 4vw, 3.25rem); }
.link-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); column-gap: 2rem;
  border-bottom: 1px solid var(--line);
}
.link-list li { border-top: 1px solid var(--line); }
.link-list a {
  display: flex; align-items: center; gap: .6rem; min-height: 48px; padding-block: .6rem;
  font-size: .93rem; font-weight: 500; color: var(--text); text-decoration: none;
  transition: color var(--t);
}
.link-list a::before {
  content: ""; flex: none; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg);
}
.link-list a:hover { color: var(--primary); }
.rel-label { min-width: 0; }

/* ---------- Guides / article ---------- */
.article-hero { max-width: 52rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.article-kicker { margin-bottom: .6rem; }
.article-hero h1, .intro h1 {
  font: 700 clamp(1.95rem, 3.8vw, 3rem)/1.18 var(--serif); letter-spacing: -.02em; word-break: auto-phrase;
}
.article-hero .lead, .intro .lead { max-width: 62ch; margin-top: .85rem; font-size: 1.05rem; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: .25rem 0; margin-top: 1rem; font-size: .84rem; color: var(--muted);
}
.article-meta > span + span::before { content: "·"; margin-inline: .6rem; color: var(--line-strong); }
.meta-k { color: var(--muted); opacity: .85; margin-right: .3rem; }
.article-meta > span { color: var(--text); }

.article-tldr {
  margin-bottom: 1.75rem; padding: .9rem 1.15rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}
.tldr-label { font: 700 .82rem/1.4 var(--sans); letter-spacing: .04em; color: var(--gold-ink); margin-bottom: .3rem; }
.article-tldr p { line-height: 1.8; }

.article-layout {
  display: grid; grid-template-columns: minmax(0, 46rem) minmax(12rem, 1fr);
  gap: clamp(2rem, 4vw, 4rem); align-items: start;
}
.article-layout:not(:has(.toc li)) { grid-template-columns: minmax(0, 46rem); }
.article-main { grid-column: 1; grid-row: 1; min-width: 0; }
.toc {
  grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--stick) + 1.5rem);
  max-width: 17rem; padding-left: 1.1rem; border-left: 1px solid var(--line);
}
.toc h2 { font: 700 .8rem/1.4 var(--sans); letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.toc ol { display: grid; gap: .1rem; font-size: .88rem; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: .5rem; padding-block: .3rem; color: var(--muted); text-decoration: none; transition: color var(--t);
}
.toc a::before { flex: none; content: counter(toc, decimal-leading-zero); font: 500 .75rem/1.6 var(--num); color: var(--gold-ink); }
.toc a:hover { color: var(--primary); }
.toc:not(:has(li)) { display: none; }
.article-shell .prose :is(h2, h3, h4), .reading .prose :is(h2, h3, h4) { scroll-margin-top: calc(var(--stick) + 1rem); }
.article-card { min-width: 0; max-width: 100%; }
.article-main > .faq-panel, .article-main > .evidence, .article-main > .related { margin-top: clamp(2.25rem, 4vw, 3rem); }

/* ---------- Prose ---------- */
.prose { line-height: 1.85; font-size: 1.02rem; color: var(--text); }
.prose:lang(en) { line-height: 1.75; }
.prose > * + * { margin-top: 1.05rem; }
.prose > :first-child { margin-top: 0; }
.prose a {
  color: var(--primary); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); text-underline-offset: .22em;
  transition: text-decoration-color var(--t), color var(--t);
}
.prose a:hover { color: var(--primary-press); text-decoration-color: currentColor; }
.prose h2 {
  position: relative; margin-top: 2.4rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line);
  font: 700 clamp(1.3rem, 1.9vw, 1.55rem)/1.3 var(--serif);
}
.prose h2::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg);
}
.prose h3 { margin-top: 1.8rem; font: 700 1.15rem/1.35 var(--serif); }
.prose h2 + *, .prose h3 + * { margin-top: .85rem; }
.prose :is(ul, ol) { padding-inline-start: 1.4em; }
.prose li + li { margin-top: .4rem; }
.prose li::marker { color: var(--gold-ink); }
.prose blockquote {
  margin-inline: 0; padding: .7rem 1.1rem; border-left: 3px solid var(--line-strong);
  background: var(--surface); color: var(--muted);
}
.prose table {
  width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.6;
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.prose :is(th, td) { padding: .6rem .8rem; text-align: start; vertical-align: top; border-top: 1px solid var(--line); }
.prose th { font-weight: 600; }
.prose thead th {
  vertical-align: bottom; font-weight: 700; font-size: .84rem; color: var(--muted);
  border-top: 0; border-bottom: 1px solid var(--line-strong);
}
.prose tbody tr:first-child > * { border-top: 0; }
.prose code {
  padding: .1rem .35rem; border-radius: var(--r-ctl); background: var(--mist);
  color: var(--primary-press); font-size: .88em;
}
.prose pre { max-width: 100%; overflow: auto; padding: 1rem; border-radius: var(--r-card); background: var(--text); color: var(--surface); }
.prose pre code { background: transparent; color: inherit; padding: 0; }
.prose img { border-radius: var(--r-card); }

/* codes page helpers (created by script.js initCodes) */
.code-actions { display: grid; justify-items: start; gap: .35rem; margin-top: .4rem; }
.code-actions button {
  min-height: 44px; padding: .3rem .85rem; border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl); background: var(--surface); color: var(--primary); font: inherit;
  cursor: pointer; transition: background-color var(--t);
}
.code-actions button:hover { background: var(--mist); }
.code-actions label { display: flex; gap: .45rem; align-items: center; min-height: 44px; font-size: .85em; cursor: pointer; }
.code-actions input { margin: 0; accent-color: var(--primary); }
[data-code-tracker] [role=status]:empty { margin: 0; }

/* ---------- FAQ (guides / basic pages) ---------- */
.faq-panel h2 {
  position: relative; padding-bottom: .65rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line);
  font: 700 clamp(1.3rem, 1.9vw, 1.6rem)/1.25 var(--serif);
}
.faq-panel h2::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg);
}
.faq-panel .faq-item { padding-block: .9rem; border-bottom: 1px solid var(--line); }
.faq-panel .faq-item h3 { font: 700 1.02rem/1.45 var(--sans); }
.faq-panel .faq-item p { margin-top: .35rem; color: var(--muted); line-height: 1.75; max-width: 68ch; }

/* ---------- Basic pages & tool page shell ---------- */
.intro { max-width: 52rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.reading { max-width: 46rem; }
.reading > .faq-panel, .reading > .evidence, .reading > .related { margin-top: clamp(2.25rem, 4vw, 3rem); }
.tool-page > .prose { max-width: 46rem; }
.tool-page > .related { margin-top: clamp(2.25rem, 4vw, 3rem); }

/* ---------- Tablet ≤960px ---------- */
@media (max-width: 60rem) {
  .dossier-hero { grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); }
  .key-facts { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc {
    grid-column: 1; grid-row: auto; position: static; margin-bottom: 1.75rem;
    padding: .75rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
    border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--surface);
  }
  .article-main { grid-row: auto; }
}

/* ---------- Mobile ≤640px ---------- */
@media (max-width: 40rem) {
  .dossier-hero { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .dossier-art { max-width: 22rem; width: 100%; margin-inline: auto; }
  .dossier-character .art-stage { aspect-ratio: 4 / 4.4; }
  .dossier-kibo .art-stage { aspect-ratio: 1 / 1; }
  .dossier-head h1 { font-size: clamp(1.9rem, 8.5vw, 2.4rem); }
  .anchor-nav { margin-top: 1.5rem; margin-inline: calc(-1 * var(--gutter, 1rem)); padding-inline: var(--gutter, 1rem); }
  .anchor-nav ul { gap: 1.25rem; }
  .uses-grid, .use-strips { grid-template-columns: minmax(0, 1fr); }
  .evo-chain { flex-direction: column; align-items: flex-start; }
  .evo-chain li { flex-direction: column; align-items: flex-start; }
  .evo-chain li + li::before { width: 1px; height: .9rem; margin: .2rem 0 .2rem 1rem; }
  .fact-row, .dt-row, .key-facts > div, .use-strip { grid-template-columns: minmax(4.5rem, 6rem) minmax(0, 1fr); gap: .6rem; }
  .prose table:not(.azp-marks-table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prose table:not(.azp-marks-table) td { min-width: 6rem; }
  .article-meta { flex-direction: column; gap: .15rem; }
  .article-meta > span + span::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dossier *, .article-shell *, .reading * { transition: none !important; }
}
