/*
 * Imperium Wiki — parchment theme after the approved concepts
 * (assets/raw/batch17/wiki-home-01.png, wiki-article-02.png). The :root
 * colour/font tokens are copied at build time from
 * apps/client-web/src/theme.css (decision #27), so the wiki always matches
 * the game. Placeholder below is replaced by build.ts.
 */
:root {
  /* Surfaces */
  --imp-parchment: #f1e4c3;
  --imp-parchment-deep: #e2cd9f;
  --imp-parchment-edge: #cdb07a;
  --imp-surface: #fbf5e6;
  --imp-surface-alt: #f3e8cd;
  --imp-overlay: rgba(241, 228, 195, 0.97);

  /* Ink */
  --imp-ink: #33241a;
  --imp-ink-soft: #5a4430;
  --imp-ink-muted: #85704f;
  --imp-on-dark: #fbf3e2;

  /* Lines */
  --imp-border: #c4a46e;
  --imp-border-strong: #5b4026;
  --imp-divider: rgba(91, 64, 38, 0.22);

  /* Heraldic accents */
  --imp-crimson: #962620;
  --imp-crimson-dark: #5e1410;
  --imp-crimson-light: #c4473b;
  --imp-navy: #24395c;
  --imp-navy-dark: #172743;
  --imp-gold: #c59a3c;
  --imp-gold-soft: #e8cf8e;

  /* Frame materials (minimap frame, round map tools) */
  --imp-wood: #4a3220;
  --imp-wood-dark: #2b1c10;
  --imp-brass: #c9a24a;
  --imp-brass-dark: #8a6a2a;

  /* Status */
  --imp-ok: #3f7a2a;
  --imp-ok-dark: #2f5c1f;
  --imp-bad: #a3352b;
  --imp-warn: #a8701c;

  /* Bars — the top bar is light parchment (concept A), not dark wood. */
  --imp-topbar: #ecdcb4;
  --imp-topbar-edge: #5b4026;

  /* Type */
  --imp-font-display: "Cinzel", "Times New Roman", serif;
  --imp-font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape */
  --imp-radius: 6px;
  --imp-radius-sm: 4px;
  --imp-shadow: 0 6px 20px rgba(43, 28, 16, 0.35);
  --imp-shadow-sm: 0 2px 8px rgba(43, 28, 16, 0.22);
  --imp-topbar-height: 64px;
  --imp-bottomnav-height: 60px;
}

:root {
  --wiki-topbar-h: 64px;
  --wiki-gutter: clamp(16px, 2.6vw, 40px);
  --wiki-paper: #f4ead3;
  --wiki-paper-light: #f9f2e1;
  --wiki-paper-dark: #e9dbb8;
  --wiki-frame: #c9ac74;
  --wiki-navy-deep: #16233d;
  --wiki-gold-text: linear-gradient(180deg, #fbe7a6 0%, #e8c25e 45%, #b8862c 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--wiki-topbar-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--imp-font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--imp-ink);
  background: var(--imp-parchment-deep) url(/art/ui-background-texture.png) repeat;
  -webkit-font-smoothing: antialiased;
}
/* Footer at the bottom of short pages. */
body.page-home, body.page-article { min-height: 100vh; display: flex; flex-direction: column; }
body.page-home > .home, body.page-article > .layout { flex: 1 0 auto; }
h1, h2, h3, h4 { font-family: var(--imp-font-display); font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; color: var(--imp-ink); }
a { color: var(--imp-crimson); text-underline-offset: 2px; }
a:hover { color: var(--imp-crimson-dark); }
:focus-visible { outline: 2px solid var(--imp-navy); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(232, 207, 142, 0.9); border-radius: 3px; }
img { max-width: 100%; }
.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; }
.wiki-glyph { display: inline-block; vertical-align: middle; flex: none; }

/* Thin, themed scrollbars everywhere (no white system boxes). */
* { scrollbar-width: thin; scrollbar-color: rgba(91, 64, 38, 0.45) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(91, 64, 38, 0.38); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(91, 64, 38, 0.6); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--imp-surface); padding: 6px 12px; z-index: 80; }
.skip-link:focus { left: 8px; }

/* ── Top bar: light parchment strip with a gold edge and the hanging crest ── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: var(--wiki-topbar-h); padding: 0 var(--wiki-gutter) 0 calc(var(--wiki-gutter) + 6px);
  background: linear-gradient(180deg, #f8efd8 0%, #efe2c0 60%, #e4d1a4 100%);
  border-bottom: 1px solid #a9844a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 0 #e9d49b, 0 2px 0 #b8954f, 0 4px 12px rgba(43, 28, 16, 0.28);
}
.topbar::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, #f3d98d, #b8862c); border: 1px solid #8a6a2a; box-shadow: 0 1px 2px rgba(43, 28, 16, 0.4);
}
.page-article .topbar::after { display: none; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--imp-ink); align-self: stretch; flex: none; }
.brand:hover { color: var(--imp-ink); }
.brand-crest { position: relative; width: 66px; align-self: flex-start; height: 86px; margin-top: -8px; overflow: hidden; filter: drop-shadow(0 3px 4px rgba(43, 28, 16, 0.45)); }
.brand-crest img { width: 66px; height: auto; display: block; margin-top: -4px; }
.brand-name { font-family: var(--imp-font-display); font-weight: 700; font-size: clamp(22px, 1.75vw, 30px); letter-spacing: 0.04em; white-space: nowrap; }

.topnav { display: flex; align-items: center; margin: 0 auto; min-width: 0; overflow: hidden; }
.topnav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px clamp(8px, 0.95vw, 18px); text-decoration: none; color: var(--imp-ink);
  font-family: var(--imp-font-display); font-weight: 700; font-size: clamp(12px, 0.9vw, 14px); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
}
.topnav a + a { border-left: 1px solid rgba(91, 64, 38, 0.35); }
.topnav a:hover { color: var(--imp-crimson); }
.topnav-icon { width: 24px; height: 24px; color: #6a4a2a; flex: none; }
.topnav a:hover .topnav-icon { color: var(--imp-crimson); }

.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.topnav + .topbar-actions { margin-left: 0; }

/* Search (top bar + hero). */
.search { position: relative; display: flex; align-items: center; }
.search--top { flex: 1; max-width: 700px; margin: 0 auto; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #4b3420; pointer-events: none; }
.search input {
  width: 100%; font: inherit; font-size: 16px; color: var(--imp-ink);
  padding: 0.55rem 0.9rem 0.55rem 44px; height: 42px;
  border: 1px solid #b89a63; border-radius: 4px;
  background: linear-gradient(180deg, #fffaf0, #f8eedb);
  box-shadow: inset 0 1px 3px rgba(43, 28, 16, 0.15);
}
.search input::placeholder { color: #6e5a41; opacity: 1; }
.search input:focus { outline: none; border-color: var(--imp-border-strong); box-shadow: 0 0 0 3px rgba(197, 154, 60, 0.45); }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 4px; list-style: none; z-index: 60; text-align: left;
  background: var(--imp-overlay); border: 1px solid var(--imp-border-strong); border-radius: var(--imp-radius);
  box-shadow: var(--imp-shadow); max-height: 70vh; overflow-y: auto;
}
.search-results a { display: block; padding: 8px 10px; border-radius: var(--imp-radius-sm); text-decoration: none; color: var(--imp-ink); }
.search-results a:hover, .search-results a:focus { background: rgba(91, 64, 38, 0.1); }
.search-results strong { display: block; font-family: var(--imp-font-display); color: var(--imp-crimson); }
.search-results span { display: block; font-size: 14px; color: var(--imp-ink-soft); }
.search-empty { padding: 8px 10px; color: var(--imp-ink-muted); }

/* Language dropdown with flags. */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px;
  font-family: var(--imp-font-display); font-weight: 700; font-size: 15px; color: var(--imp-ink);
  border: 1px solid #b89a63; border-radius: 4px; background: linear-gradient(180deg, #fffaf0, #f3e7cc);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(43, 28, 16, 0.15);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { border-color: var(--imp-border-strong); }
.wiki-flag { width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(43, 28, 16, 0.25); flex: none; }
.lang-chevron { width: 14px; height: 14px; color: var(--imp-ink-soft); transition: transform 0.15s; }
.lang-menu[open] .lang-chevron { transform: rotate(180deg); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; min-width: 190px; z-index: 60;
  background: var(--imp-overlay); border: 1px solid var(--imp-border-strong); border-radius: var(--imp-radius); box-shadow: var(--imp-shadow);
}
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; text-decoration: none; color: var(--imp-ink); border-radius: var(--imp-radius-sm); }
.lang-menu a:hover, .lang-menu a:focus { background: rgba(91, 64, 38, 0.1); }
.lang-menu a[aria-current] { color: var(--imp-crimson); font-weight: 700; }

/* Crimson primary button ("Play now"). */
.play-button {
  display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; text-decoration: none; height: 46px; padding: 0 20px 0 26px;
  font-family: var(--imp-font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fbf3e2; background: linear-gradient(180deg, #b8382d 0%, #962620 50%, #6e1712 100%);
  border: 1px solid #4f0f0b; border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, 0.35), inset 0 0 0 1px rgba(232, 160, 120, 0.25), 0 2px 6px rgba(43, 28, 16, 0.4);
}
.play-button:hover { color: #fff; filter: brightness(1.08); }
.play-chevron { width: 16px; height: 16px; }
.menu-button {
  display: none; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border: 1px solid #b89a63; border-radius: 4px; background: rgba(255, 250, 240, 0.7); color: var(--imp-ink); cursor: pointer;
}

/* ── Home ── */
.page-home { background-color: #efe3c6; }
.hero { position: relative; min-height: clamp(280px, 19.5vw, 400px); display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 3px solid #b8954f; box-shadow: 0 1px 0 #f3dc97, 0 3px 8px rgba(43, 28, 16, 0.35); }
.hero picture, .hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art { object-fit: cover; object-position: 50% 24%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse 42% 78% at 50% 52%, rgba(18, 28, 52, 0.58) 0%, rgba(18, 28, 52, 0.32) 52%, rgba(18, 28, 52, 0) 82%),
    linear-gradient(180deg, rgba(14, 22, 40, 0.3) 0%, rgba(14, 22, 40, 0) 28%);
}
.hero-inner { position: relative; z-index: 2; width: min(760px, 100% - 32px); text-align: center; padding: 26px 0 22px; }
.hero h1 {
  margin: 0; font-size: clamp(30px, 3.6vw, 56px); letter-spacing: 0.04em; line-height: 1.1;
  color: #f0cd6e; background: var(--wiki-gold-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(40, 20, 6, 0.85)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}
.hero-sub { margin: 8px 0 18px; font-size: clamp(15px, 1.25vw, 19px); color: #fbf3e2; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.6); }
.search--hero { width: min(560px, 100%); margin: 0 auto; padding: 4px; background: linear-gradient(180deg, #e7c978, #b8862c); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.search--hero .search-icon { left: 18px; width: 22px; height: 22px; }
.search--hero input { height: 50px; font-size: 18px; padding-left: 52px; border-radius: 4px 0 0 4px; border-color: #8a6a2a; border-right: 0; }
.search-submit {
  flex: none; height: 50px; padding: 0 26px; cursor: pointer; border-radius: 0 4px 4px 0;
  font-family: var(--imp-font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.05em; text-transform: uppercase;
  color: #fbf3e2; background: linear-gradient(180deg, #b8382d, #962620 55%, #6e1712); border: 1px solid #4f0f0b;
}
.search-submit:hover { filter: brightness(1.08); }
.hero-topics { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin: 16px 0 0; font-size: 14px; color: #fbf3e2; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.hero-topics > span { margin-right: 4px; }
.topic-chip {
  display: inline-block; padding: 5px 16px; border-radius: 6px; text-decoration: none; font-size: 14px; text-shadow: none;
  color: #fbf3e2; background: linear-gradient(180deg, rgba(44, 70, 115, 0.95), rgba(23, 39, 67, 0.95));
  border: 1px solid rgba(232, 207, 142, 0.85); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.topic-chip:hover { color: #fff; border-color: #f3d98d; filter: brightness(1.15); }

.home-sections { max-width: 1760px; margin: 0 auto; padding: 0 var(--wiki-gutter) 34px; }
.cat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.2vw, 20px); margin-top: -8px; position: relative; z-index: 3; }
.cat-card {
  display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: calc(var(--wiki-topbar-h) + 12px);
  background: linear-gradient(180deg, var(--wiki-paper-light), var(--wiki-paper));
  border: 1px solid #b3945d; border-radius: 6px;
  box-shadow: inset 0 0 0 3px var(--wiki-paper-light), inset 0 0 0 4px rgba(184, 149, 79, 0.65), 0 3px 10px rgba(43, 28, 16, 0.25);
}
.cat-card-art { display: block; width: 100%; aspect-ratio: 2.35; height: auto; object-fit: cover; border-bottom: 2px solid #b8954f; }
.cat-card-body { position: relative; display: flex; flex-direction: column; padding: 10px 20px 12px 98px; flex: 1; }
.cat-card-emblem { position: absolute; left: 20px; top: -36px; width: 62px; height: 74px; filter: drop-shadow(0 3px 3px rgba(43, 28, 16, 0.45)); }
.cat-card h2 { margin: 0 0 2px; font-size: clamp(18px, 1.45vw, 23px); }
.cat-card h2 a { color: var(--imp-ink); text-decoration: none; }
.cat-card h2 a:hover { color: var(--imp-crimson); }
.cat-card p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.35; color: var(--imp-ink-soft); }
.cat-card ul { list-style: none; margin: auto 0 0 -78px; padding: 0; }
.cat-card li + li { border-top: 1px solid rgba(91, 64, 38, 0.2); }
.cat-card li a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px; font-size: 15.5px; line-height: 1.3; text-decoration: none; color: var(--imp-crimson); }
.cat-card li a:hover { color: var(--imp-crimson-dark); text-decoration: underline; }
.cat-chevron { width: 16px; height: 16px; color: var(--imp-ink); flex: none; }

.home-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(12px, 1.2vw, 20px); margin-top: clamp(14px, 1.2vw, 20px); }
.panel {
  background: linear-gradient(180deg, var(--wiki-paper-light), var(--wiki-paper));
  border: 1px solid #b3945d; border-radius: 6px; padding: 0 14px 14px;
  box-shadow: inset 0 0 0 3px var(--wiki-paper-light), inset 0 0 0 4px rgba(184, 149, 79, 0.55), 0 3px 10px rgba(43, 28, 16, 0.22);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px 10px; margin-bottom: 12px; border-bottom: 1px solid rgba(184, 149, 79, 0.7); }
.panel-head h2 { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-size: 19px; text-transform: uppercase; letter-spacing: 0.05em; }
.panel-icon { width: 24px; height: 24px; color: var(--imp-ink); }
.panel-aside { font-size: 15px; color: var(--imp-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
a.panel-aside:hover { color: var(--imp-crimson); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 6px; }
.steps > li:not(.step-arrow) { flex: 1; min-width: 0; }
.step-arrow { display: flex; align-items: center; color: #b8862c; }
.step {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%;
  padding: 10px 10px 12px; text-decoration: none; color: var(--imp-ink);
  background: rgba(255, 251, 240, 0.7); border: 1px solid rgba(184, 149, 79, 0.6); border-radius: 5px;
}
.step:hover { background: #fffaf0; border-color: #b8954f; color: var(--imp-ink); }
.medal {
  position: absolute; left: 8px; top: 8px; width: 42px; height: 42px; display: grid; place-items: center;
  font-family: var(--imp-font-display); font-weight: 700; font-size: 22px; color: #fbf3e2;
  background: radial-gradient(circle at 38% 32%, #d4544a, #962620 55%, #5e1410); border-radius: 50%;
  box-shadow: 0 0 0 2px #e2bd62, 0 0 0 3px #8a6a2a, 0 2px 4px rgba(43, 28, 16, 0.5); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
.step-art { display: grid; place-items: center; height: 88px; width: 100%; }
.step-art img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(43, 28, 16, 0.35)); }
.step-swords { width: 70px; height: 70px; color: #7d8590; filter: drop-shadow(0 1px 0 #3d434b) drop-shadow(0 2px 3px rgba(43, 28, 16, 0.4)); }
.step strong { font-family: var(--imp-font-display); font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.step span:last-child { font-size: 14px; line-height: 1.35; color: var(--imp-ink-soft); }

.unit-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.unit-card {
  display: flex; flex-direction: column; align-items: center; height: 100%; text-decoration: none; color: var(--imp-ink); overflow: hidden;
  background: rgba(255, 251, 240, 0.7); border: 1px solid rgba(184, 149, 79, 0.6); border-radius: 5px;
}
.unit-card:hover { border-color: #b8954f; background: #fffaf0; color: var(--imp-ink); }
.unit-card-art { width: 100%; height: 108px; display: grid; place-items: end center; background: radial-gradient(ellipse at 50% 60%, #f6ecd2, #e6d3a8); border-bottom: 1px solid rgba(184, 149, 79, 0.5); }
.unit-card-art img { width: 112px; height: 112px; object-fit: contain; object-position: bottom; }
.unit-card strong { font-family: var(--imp-font-display); font-size: 15px; margin: 6px 4px 2px; text-align: center; }
.unit-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; padding: 0 6px 8px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.unit-stats > span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.stat-icon { width: 15px; height: 15px; color: #4b3420; }

/* ── Footer: navy with a gold crest ── */
.footer { margin-top: 0; background: linear-gradient(180deg, #1d2e4f, var(--wiki-navy-deep)); color: #e8dcc0; border-top: 3px solid #b8954f; box-shadow: inset 0 1px 0 #f3dc97; position: relative; }
.footer::before {
  content: ""; position: absolute; left: 50%; top: -9px; width: 16px; height: 16px; transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, #f3d98d, #b8862c); border: 1px solid #8a6a2a;
}
.footer-inner { max-width: 1760px; margin: 0 auto; padding: 20px var(--wiki-gutter) 10px; display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 24px; }
.footer-brand { display: flex; flex-direction: column; }
.footer-brand strong { font-family: var(--imp-font-display); font-size: 19px; color: #f0cd6e; letter-spacing: 0.04em; }
.footer-brand span, .footer-play span { font-size: 13px; color: #c9bc9f; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.footer a { color: #e8dcc0; text-decoration: none; font-size: 15px; }
.footer a:hover { color: #f3d98d; text-decoration: underline; }
.footer-crest {
  width: 46px; height: 46px; justify-self: center;
  background: linear-gradient(180deg, #fbe7a6, #c99a3c);
  -webkit-mask: url(/art/thumb-heraldry-charge-lion.webp) center / contain no-repeat; mask: url(/art/thumb-heraldry-charge-lion.webp) center / contain no-repeat;
}
.footer-play { grid-column: 5; display: flex; flex-direction: column; align-items: flex-end; padding-left: 24px; border-left: 1px solid rgba(232, 207, 142, 0.35); }
.footer-play strong { font-family: var(--imp-font-display); font-size: 17px; color: #fbf3e2; }
.footer-note { max-width: 1760px; margin: 0 auto; padding: 0 var(--wiki-gutter) 16px; font-size: 12px; color: #9f957f; text-align: center; }

/* ── Article layout: navigation tree | content ── */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - var(--wiki-topbar-h)); }
.nav-collapsed .layout { grid-template-columns: 64px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: var(--wiki-topbar-h); align-self: start; height: calc(100vh - var(--wiki-topbar-h));
  display: flex; flex-direction: column; z-index: 20;
  background: linear-gradient(90deg, rgba(232, 216, 178, 0.92), rgba(238, 225, 192, 0.92));
  border-right: 1px solid #b8954f; box-shadow: inset -1px 0 0 #f3e5c4, 2px 0 6px rgba(43, 28, 16, 0.12);
}
.sidebar-tools { display: flex; justify-content: flex-end; padding: 10px 12px 0; }
.sidebar-collapse, .sidebar-close {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; cursor: pointer; color: var(--imp-ink);
  background: transparent; border: 0; border-left: 2px solid rgba(91, 64, 38, 0.45); border-radius: 0;
}
.sidebar-collapse:hover, .sidebar-close:hover { color: var(--imp-crimson); }
.sidebar-close { display: none; }
.sidebar-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 24px 18px; }
.nav-group { margin-bottom: 16px; }
.nav-group h2 {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 6px; padding: 0 0 6px;
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--imp-ink);
  border-bottom: 1px solid rgba(91, 64, 38, 0.3);
}
.nav-group-icon { width: 22px; height: 22px; color: #5a3d22; flex: none; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group li > a {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px; margin: 1px 0; border-radius: 3px;
  color: var(--imp-ink); text-decoration: none; font-size: 15.5px; line-height: 1.3;
}
.nav-group li > a:hover { background: rgba(91, 64, 38, 0.09); color: var(--imp-crimson-dark); }
.nav-group li > a[aria-current="page"] {
  color: #fbf3e2; font-weight: 600;
  background: linear-gradient(180deg, #a7302a, #84201b); box-shadow: inset 0 0 0 1px #5e1410, 0 1px 3px rgba(43, 28, 16, 0.3);
}
.nav-icon { width: 22px; height: 22px; object-fit: contain; flex: none; }
.nav-icon--glyph { color: #5a3d22; }
[aria-current="page"] .nav-icon--glyph { color: #fbf3e2; }
.nav-label { min-width: 0; }
.nav-sections { list-style: none; margin: 4px 0 6px 18px; padding: 0 0 0 14px; border-left: 2px solid rgba(150, 38, 32, 0.35); }
.nav-sections a { display: block; padding: 2px 6px; font-size: 14.5px; color: var(--imp-ink-soft); text-decoration: none; border-radius: 3px; }
.nav-sections a:hover { color: var(--imp-crimson); background: rgba(91, 64, 38, 0.07); }
.badge { display: inline-block; vertical-align: middle; margin-left: auto; font-family: var(--imp-font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; padding: 0 5px; border: 1px solid currentColor; border-radius: 3px; opacity: 0.8; }

/* Collapsed rail: icons only. */
.nav-collapsed .sidebar-tools { justify-content: center; padding: 10px 0 4px; }
.nav-collapsed .sidebar-collapse { transform: scaleX(-1); border-left: 0; border-right: 2px solid rgba(91, 64, 38, 0.45); }
.nav-collapsed .sidebar-scroll { padding: 0 6px 20px; }
.nav-collapsed .nav-label, .nav-collapsed .nav-sections, .nav-collapsed .sidebar .badge { display: none; }
.nav-collapsed .nav-group h2 { justify-content: center; padding-bottom: 6px; }
.nav-collapsed .nav-group li > a { justify-content: center; padding: 5px 0; }

.drawer-backdrop { display: none; }

.content { min-width: 0; background: linear-gradient(90deg, rgba(246, 237, 216, 0.96), rgba(249, 242, 225, 0.96)); }

/* Article page: head + body | rail; then prev/next. */
.page { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: clamp(24px, 2.6vw, 44px); max-width: 1400px; padding: 18px clamp(18px, 3.2vw, 52px) 40px; }
.page.has-rail { grid-template-columns: minmax(0, 1fr) clamp(300px, 25vw, 390px); }
.page.has-rail > .article-head { grid-column: 1; grid-row: 1; }
.page.has-rail > .article-body { grid-column: 1; grid-row: 2; }
.page.has-rail > .pager { grid-column: 1; grid-row: 3; }
.page.has-rail > .rail { grid-column: 2; grid-row: 1 / span 3; }
.rail { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }

.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0 0 4px; padding: 0; font-size: 14.5px; color: var(--imp-ink-soft); }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "›"; margin: 0 10px; color: var(--imp-ink-muted); font-size: 18px; line-height: 1; }
.crumbs a { color: var(--imp-ink-soft); text-decoration: none; display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--imp-crimson); text-decoration: underline; }
.crumbs li[aria-current] { color: var(--imp-ink); font-weight: 600; }
.crumbs-home { width: 18px; height: 18px; color: #4b3420; }

.article-titlebar { display: flex; gap: 20px; align-items: flex-start; }
.article-titletext { flex: 1; min-width: 0; }
.article-head h1 { font-size: clamp(30px, 2.9vw, 46px); margin: 6px 0 12px; letter-spacing: 0.03em; }
.lead { font-size: clamp(17px, 1.25vw, 19px); line-height: 1.55; color: var(--imp-ink); margin: 0 0 6px; max-width: 760px; }
.article-art { flex: none; width: clamp(180px, 18vw, 270px); margin: -6px 0 0; aspect-ratio: 4 / 5; position: relative; }
.article-art img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 52%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 52%, transparent 100%);
}
.wiki-divider { display: flex; align-items: center; gap: 12px; max-width: 460px; margin: 14px 0 10px; color: #b8862c; }
.wiki-divider::before, .wiki-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #b8954f 30%, #b8954f 70%, transparent); }
.wiki-divider-fleur { width: 22px; height: 22px; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6)); }
.notice { padding: 10px 14px; border-left: 4px solid var(--imp-warn); background: rgba(168, 112, 28, 0.1); border-radius: var(--imp-radius-sm); }
.badge-data { font-size: 13px; color: var(--imp-navy); border-color: var(--imp-navy); margin-left: 10px; opacity: 1; vertical-align: 0.4em; }

/* Article body. */
.wiki-article { font-size: 17px; line-height: 1.65; }
.wiki-article > :first-child { margin-top: 6px; }
.wiki-article h2 { font-size: clamp(22px, 1.8vw, 27px); margin: 30px 0 10px; text-transform: uppercase; letter-spacing: 0.04em; font-variant: small-caps; }
.wiki-article h3 { font-size: 19px; margin: 22px 0 8px; }
.wiki-article p, .wiki-article ul, .wiki-article ol { max-width: 820px; }
.wiki-article li { margin: 3px 0; }
.wiki-article li::marker { color: #9a7a3e; }
code { font-size: 0.92em; background: rgba(91, 64, 38, 0.1); padding: 1px 5px; border-radius: 3px; }
pre { overflow-x: auto; background: rgba(91, 64, 38, 0.08); padding: 12px; border-radius: var(--imp-radius-sm); }
hr { border: 0; border-top: 1px solid var(--imp-divider); margin: 28px 0; }
.wiki-figure { float: right; margin: 0 0 12px 18px; text-align: center; }
.wiki-figure img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(43, 28, 16, 0.35)); }
.wiki-figure figcaption { font-size: 13px; color: var(--imp-ink-muted); }
p img, li img, td img, th img { height: 1.6em; width: auto; vertical-align: middle; margin-right: 4px; }
.footnote { margin-top: 28px; font-size: 14px; color: var(--imp-ink-muted); font-style: italic; }

/* Wax-seal callouts (`> [!TIP]`, `> [!WARNING]`, `> [!NOTE]`, plain quotes). */
.wiki-callout {
  position: relative; display: flex; align-items: center; gap: 18px; max-width: 860px; margin: 20px 0; padding: 14px 20px 14px 16px;
  background: linear-gradient(180deg, #f6ead0, #efdfbd); border: 1px solid #c3a46a; border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(255, 250, 236, 0.75), inset 0 0 0 4px rgba(184, 149, 79, 0.5), 0 2px 5px rgba(43, 28, 16, 0.15);
}
.wiki-callout-seal {
  flex: none; position: relative; width: 70px; height: 68px; display: grid; place-items: center;
  background: url(/art/ui-wax-seal.png) center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(43, 28, 16, 0.35));
}
.wiki-callout-glyph { width: 28px; height: 28px; color: #f2cf7a; filter: drop-shadow(0 1px 0 rgba(60, 8, 4, 0.8)); }
.wiki-callout-body { min-width: 0; }
.wiki-callout-body > :first-child { margin-top: 0; }
.wiki-callout-body > :last-child { margin-bottom: 0; }
.wiki-callout-body p { margin: 4px 0; }
.wiki-callout-title { font-family: var(--imp-font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--imp-crimson); margin: 0 0 2px !important; }
.wiki-callout--warning { background: linear-gradient(180deg, #f6dcd2, #efcdbf); border-color: #c98f7c; }
.wiki-callout--important { background: linear-gradient(180deg, #f7dccf, #f0cdb8); border-color: #c98f7c; }
.wiki-callout--note { background: linear-gradient(180deg, #e9ead9, #dfe1cc); border-color: #a6ab88; }
.wiki-callout--note .wiki-callout-title { color: var(--imp-navy); }

/* Data tables: parchment frame, icon column headers. */
.wiki-table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid #c3a46a; border-radius: 6px; background: var(--wiki-paper-light); box-shadow: 0 1px 4px rgba(43, 28, 16, 0.12); clear: both; }
.wiki-table-wrap table { border-collapse: collapse; width: 100%; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.wiki-table-wrap caption { caption-side: top; text-align: left; padding: 10px 12px 4px; font-family: var(--imp-font-display); font-weight: 700; }
.wiki-table-wrap th, .wiki-table-wrap td { padding: 8px 12px; border-bottom: 1px solid rgba(91, 64, 38, 0.16); text-align: left; vertical-align: middle; }
.wiki-table-wrap th + th, .wiki-table-wrap td + td, .wiki-table-wrap th + td { border-left: 1px solid rgba(91, 64, 38, 0.12); }
.wiki-table-wrap thead th { background: linear-gradient(180deg, #f1e4c5, #e8d6ae); font-size: 13.5px; font-weight: 600; color: var(--imp-ink); border-bottom: 1px solid #c3a46a; white-space: nowrap; }
.wiki-th-icon { width: 20px !important; height: 20px !important; margin: 0 6px 0 0 !important; vertical-align: -5px; object-fit: contain; color: #4b3420; }
.wiki-table-wrap tbody th { font-weight: 600; white-space: nowrap; }
.wiki-table-wrap td { min-width: 4.5em; }
.wiki-table-wrap td:last-child:not(.wiki-right):not(.wiki-center) { min-width: 13em; }
.wiki-table-wrap tbody tr:nth-child(even) { background: rgba(240, 228, 200, 0.45); }
.wiki-table-wrap tbody tr:hover { background: rgba(232, 207, 142, 0.3); }
.wiki-table-wrap tbody tr:last-child > * { border-bottom: 0; }
.wiki-right { text-align: right !important; }
.wiki-center { text-align: center !important; }
.wiki-muted { color: var(--imp-ink-muted); }
.wiki-icon { height: 26px !important; width: 26px !important; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.wiki-section-icon { height: 40px; width: 40px; object-fit: contain; vertical-align: middle; margin-right: 10px; }
.wiki-notes { font-size: 15px; color: var(--imp-ink-soft); }
.wiki-embed { margin: 18px 0; padding: 4px 16px 4px; border: 1px solid rgba(184, 149, 79, 0.7); border-radius: 6px; background: rgba(255, 251, 240, 0.5); }
.wiki-embed h3 { margin-top: 12px; }
.wiki-embed-more { font-size: 14px; text-align: right; }
.wiki-data-section { scroll-margin-top: calc(var(--wiki-topbar-h) + 16px); }

/* ── Right rail: infobox + "On this page" ── */
.wiki-infobox {
  position: relative; padding: 18px 18px 16px;
  background: linear-gradient(180deg, #faf3e3, #f2e6c9);
  border: 1px solid #b3945d; border-radius: 6px;
  box-shadow: inset 0 0 0 4px #faf3e3, inset 0 0 0 5px rgba(184, 149, 79, 0.6), 0 4px 12px rgba(43, 28, 16, 0.22);
}
.wiki-ribbon { position: absolute; right: 16px; top: -2px; width: 58px; height: 80px; filter: drop-shadow(0 3px 3px rgba(43, 28, 16, 0.4)); pointer-events: none; z-index: 2; }
.wiki-ib-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.wiki-ib-picker { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 0; }
.wiki-ib-picker .wiki-ib-heading { flex-basis: 100%; margin-top: 0; }
.wiki-ib-picker label {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fbf5e6, #e4d1a4); border: 1px solid #c3a46a;
}
.wiki-ib-picker label:hover { border-color: var(--imp-border-strong); }
.wiki-ib-picker img { width: 34px; height: 34px; object-fit: contain; }
.wiki-ib-cards > .wiki-ib-card { display: none; }
.wiki-infobox--single .wiki-ib-card,
.wiki-ib-radio:nth-of-type(1):checked ~ .wiki-ib-cards > :nth-child(1),
.wiki-ib-radio:nth-of-type(2):checked ~ .wiki-ib-cards > :nth-child(2),
.wiki-ib-radio:nth-of-type(3):checked ~ .wiki-ib-cards > :nth-child(3),
.wiki-ib-radio:nth-of-type(4):checked ~ .wiki-ib-cards > :nth-child(4),
.wiki-ib-radio:nth-of-type(5):checked ~ .wiki-ib-cards > :nth-child(5),
.wiki-ib-radio:nth-of-type(6):checked ~ .wiki-ib-cards > :nth-child(6),
.wiki-ib-radio:nth-of-type(7):checked ~ .wiki-ib-cards > :nth-child(7),
.wiki-ib-radio:nth-of-type(8):checked ~ .wiki-ib-cards > :nth-child(8),
.wiki-ib-radio:nth-of-type(9):checked ~ .wiki-ib-cards > :nth-child(9),
.wiki-ib-radio:nth-of-type(10):checked ~ .wiki-ib-cards > :nth-child(10),
.wiki-ib-radio:nth-of-type(11):checked ~ .wiki-ib-cards > :nth-child(11),
.wiki-ib-radio:nth-of-type(12):checked ~ .wiki-ib-cards > :nth-child(12) { display: block; }
.wiki-ib-radio:nth-of-type(1):checked ~ .wiki-ib-picker > label:nth-of-type(1),
.wiki-ib-radio:nth-of-type(2):checked ~ .wiki-ib-picker > label:nth-of-type(2),
.wiki-ib-radio:nth-of-type(3):checked ~ .wiki-ib-picker > label:nth-of-type(3),
.wiki-ib-radio:nth-of-type(4):checked ~ .wiki-ib-picker > label:nth-of-type(4),
.wiki-ib-radio:nth-of-type(5):checked ~ .wiki-ib-picker > label:nth-of-type(5),
.wiki-ib-radio:nth-of-type(6):checked ~ .wiki-ib-picker > label:nth-of-type(6),
.wiki-ib-radio:nth-of-type(7):checked ~ .wiki-ib-picker > label:nth-of-type(7),
.wiki-ib-radio:nth-of-type(8):checked ~ .wiki-ib-picker > label:nth-of-type(8),
.wiki-ib-radio:nth-of-type(9):checked ~ .wiki-ib-picker > label:nth-of-type(9),
.wiki-ib-radio:nth-of-type(10):checked ~ .wiki-ib-picker > label:nth-of-type(10),
.wiki-ib-radio:nth-of-type(11):checked ~ .wiki-ib-picker > label:nth-of-type(11),
.wiki-ib-radio:nth-of-type(12):checked ~ .wiki-ib-picker > label:nth-of-type(12) {
  background: radial-gradient(circle at 50% 40%, #fff, #f0dfb4); border: 2px solid var(--imp-crimson); box-shadow: 0 0 0 2px rgba(150, 38, 32, 0.2);
}
.wiki-ib-radio:nth-of-type(1):focus-visible ~ .wiki-ib-picker > label:nth-of-type(1),
.wiki-ib-radio:nth-of-type(2):focus-visible ~ .wiki-ib-picker > label:nth-of-type(2),
.wiki-ib-radio:nth-of-type(3):focus-visible ~ .wiki-ib-picker > label:nth-of-type(3),
.wiki-ib-radio:nth-of-type(4):focus-visible ~ .wiki-ib-picker > label:nth-of-type(4),
.wiki-ib-radio:nth-of-type(5):focus-visible ~ .wiki-ib-picker > label:nth-of-type(5),
.wiki-ib-radio:nth-of-type(6):focus-visible ~ .wiki-ib-picker > label:nth-of-type(6),
.wiki-ib-radio:nth-of-type(7):focus-visible ~ .wiki-ib-picker > label:nth-of-type(7),
.wiki-ib-radio:nth-of-type(8):focus-visible ~ .wiki-ib-picker > label:nth-of-type(8),
.wiki-ib-radio:nth-of-type(9):focus-visible ~ .wiki-ib-picker > label:nth-of-type(9),
.wiki-ib-radio:nth-of-type(10):focus-visible ~ .wiki-ib-picker > label:nth-of-type(10),
.wiki-ib-radio:nth-of-type(11):focus-visible ~ .wiki-ib-picker > label:nth-of-type(11),
.wiki-ib-radio:nth-of-type(12):focus-visible ~ .wiki-ib-picker > label:nth-of-type(12) { outline: 2px solid var(--imp-navy); outline-offset: 2px; }

.wiki-ib-title { margin: 0 70px 10px 0; font-size: 28px; letter-spacing: 0.02em; text-transform: none; }
.wiki-ib-head { display: grid; grid-template-columns: 46% minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 6px; }
.wiki-ib-portrait {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 4px;
  background: radial-gradient(ellipse at 50% 55%, #f8eed6, #e2cd9f); border: 1px solid #c3a46a; box-shadow: inset 0 0 12px rgba(91, 64, 38, 0.18);
}
.wiki-ib-facts { margin: 0; display: grid; gap: 10px; font-size: 14.5px; }
.wiki-ib-facts dt { color: var(--imp-ink-soft); font-size: 14px; }
.wiki-ib-facts dd { margin: 2px 0 0; display: flex; align-items: flex-start; gap: 7px; color: var(--imp-ink); line-height: 1.3; }
.wiki-ib-icon { width: 20px; height: 20px; flex: none; object-fit: contain; color: #4b3420; }
.wiki-ib-heading {
  margin: 14px 0 6px; padding-bottom: 5px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(184, 149, 79, 0.7);
}
.wiki-ib-stats { margin: 0; }
.wiki-ib-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 2px; border-bottom: 1px solid rgba(91, 64, 38, 0.12); }
.wiki-ib-stats > div:last-child { border-bottom: 0; }
.wiki-ib-stats dt { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.wiki-ib-stats dd { margin: 0; font-weight: 700; font-size: 15.5px; text-align: right; font-variant-numeric: tabular-nums; }
.wiki-ib-cost { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.wiki-ib-cost li { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; }
.wiki-ib-cost img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(43, 28, 16, 0.3)); }
.wiki-ib-cost span { font-size: 13.5px; color: var(--imp-ink-soft); }
.wiki-ib-cost strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.wiki-ib-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0 14px; }
.wiki-ib-chipgroup ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wiki-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 5px; font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.wiki-chip img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.wiki-chip--good { background: linear-gradient(180deg, #e3e8cd, #d3dcb6); border: 1px solid #a9b783; color: #2f4a1c; }
.wiki-chip--bad { background: linear-gradient(180deg, #f3d9cf, #ebc7b9); border: 1px solid #cf9d8c; color: #6e1d16; }
.wiki-chip--neutral { background: linear-gradient(180deg, #f5ead0, #ead9b3); border: 1px solid #c3a46a; color: var(--imp-ink); }
.wiki-chip--empty { color: var(--imp-ink-muted); font-weight: 400; background: transparent; padding-left: 2px; }
.wiki-ib-chipgroup .wiki-ib-heading { color: var(--imp-ink); }
.wiki-ib-more { margin: 12px 0 0; font-size: 14px; text-align: right; }

.toc {
  position: sticky; top: calc(var(--wiki-topbar-h) + 18px); max-height: calc(100vh - var(--wiki-topbar-h) - 36px); overflow-y: auto;
  padding: 16px 20px 14px; font-size: 15px;
  background: linear-gradient(180deg, #faf3e3, #f3e8cd); border: 1px solid #b3945d; border-radius: 6px;
  box-shadow: inset 0 0 0 4px #faf3e3, inset 0 0 0 5px rgba(184, 149, 79, 0.5), 0 3px 8px rgba(43, 28, 16, 0.16);
}
.toc h2 { margin: 0 0 8px; padding-bottom: 8px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid rgba(184, 149, 79, 0.7); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 4px 0 4px 18px; color: var(--imp-ink); text-decoration: none; border-left: 4px solid transparent; line-height: 1.35; }
.toc a:hover { color: var(--imp-crimson); }
.toc a[aria-current] { border-left-color: var(--imp-crimson); color: var(--imp-ink); font-weight: 600; }
.no-js .toc li:first-child a { border-left-color: var(--imp-crimson); }

/* Previous / next cards. */
.pager {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 36px; padding: 10px 14px;
  background: linear-gradient(180deg, #faf3e3, #f3e8cd); border: 1px solid #b3945d; border-radius: 6px;
  box-shadow: inset 0 0 0 3px #faf3e3, inset 0 0 0 4px rgba(184, 149, 79, 0.45), 0 2px 6px rgba(43, 28, 16, 0.14);
}
.pager-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 6px; text-decoration: none; color: var(--imp-ink); border-radius: 4px; }
.pager-card:hover { background: rgba(232, 207, 142, 0.3); color: var(--imp-ink); }
.pager-next { justify-content: flex-end; text-align: right; }
.pager-chevron { width: 26px; height: 26px; flex: none; color: var(--imp-ink); }
.pager-portrait { width: 56px; height: 56px; flex: none; object-fit: contain; border-radius: 4px; background: radial-gradient(circle, #fbf5e6, #e4d1a4); border: 1px solid #c3a46a; display: grid; place-items: center; color: #5a3d22; }
.pager-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pager-label { font-family: var(--imp-font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--imp-ink-soft); }
.pager-text strong { font-family: var(--imp-font-display); font-size: 18px; color: var(--imp-ink); }
.pager-desc { font-size: 14px; color: var(--imp-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager-fleur { display: flex; align-items: center; gap: 10px; color: #b8862c; }
.pager-fleur::before, .pager-fleur::after { content: ""; width: 40px; height: 1px; background: #b8954f; }

.not-found { min-height: 50vh; }

/* ── Root language picker ── */
.root-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
.language-picker {
  text-align: center; max-width: 620px; width: 100%; padding: 28px clamp(18px, 4vw, 44px) 32px;
  background: linear-gradient(180deg, #faf3e3, #f2e6c9); border: 1px solid #b3945d; border-radius: 6px;
  box-shadow: inset 0 0 0 4px #faf3e3, inset 0 0 0 5px rgba(184, 149, 79, 0.6), var(--imp-shadow);
}
.picker-crest { width: 90px; height: auto; }
.languages { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.languages a { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; border: 1px solid var(--imp-border); border-radius: var(--imp-radius); background: var(--imp-surface); text-decoration: none; font-family: var(--imp-font-display); font-weight: 700; }
.languages a:hover { background: var(--imp-gold-soft); }

/* ── Medium screens ── */
@media (max-width: 1360px) {
  .topnav a { padding: 6px 12px; font-size: 13px; gap: 8px; }
  .cat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-art { display: none; }
}
@media (max-width: 1180px) {
  .topnav { display: none; }
  .topbar-actions { margin-left: auto; }
  .home-row { grid-template-columns: 1fr; }
  .page.has-rail { grid-template-columns: minmax(0, 1fr) 300px; }
  .layout { grid-template-columns: 250px minmax(0, 1fr); }
}

/* ── Phones and tablets: drawer navigation, infobox above the body ── */
@media (max-width: 899px) {
  :root { --wiki-topbar-h: 56px; }
  body { font-size: 16px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-crest { width: 44px; height: 62px; margin-top: -6px; }
  .brand-crest img { width: 44px; }
  .brand-name { font-size: 20px; }
  .page-article .brand-name { display: none; }
  .menu-button { display: inline-flex; }
  .search--top { min-width: 0; }
  .search--top input { height: 40px; }
  .lang-menu summary { height: 40px; padding: 0 10px; gap: 6px; }
  .lang-menu summary > span { display: none; }
  .play-button { height: 40px; padding: 0 14px; font-size: 14px; gap: 6px; }
  .page-article .play-button { display: none; }

  .layout, .nav-collapsed .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: auto; height: 100vh; height: 100dvh; align-self: stretch; width: min(320px, 86vw); z-index: 70;
    transform: translateX(-102%); transition: transform 0.22s ease; visibility: hidden;
    background: #eadcb8; box-shadow: 4px 0 18px rgba(43, 28, 16, 0.4);
  }
  .menu-open .sidebar { transform: none; visibility: visible; }
  .no-js .sidebar { position: static; transform: none; visibility: visible; width: auto; height: auto; box-shadow: none; }
  .sidebar-collapse { display: none; }
  .sidebar-close { display: inline-grid; }
  .nav-collapsed .nav-label, .nav-collapsed .nav-sections, .nav-collapsed .sidebar .badge { display: revert; }
  .nav-collapsed .nav-group li > a { justify-content: flex-start; padding: 4px 8px; }
  .nav-collapsed .nav-group h2 { justify-content: flex-start; }
  .nav-collapsed .sidebar-scroll { padding: 0 14px 24px 18px; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(23, 16, 9, 0.5); }
  .drawer-backdrop[hidden] { display: none; }

  .page, .page.has-rail { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 28px; }
  .page.has-rail > .article-head, .page.has-rail > .rail, .page.has-rail > .article-body, .page.has-rail > .pager { grid-column: 1; grid-row: auto; }
  .rail { margin: 12px 0 4px; }
  .toc { position: static; max-height: none; }
  .wiki-figure { float: none; }
  .wiki-callout { gap: 12px; padding: 12px 14px 12px 10px; }
  .wiki-callout-seal { width: 52px; height: 50px; }
  .wiki-callout-glyph { width: 22px; height: 22px; }

  .hero { min-height: 300px; }
  .cat-cards { margin-top: 14px; }
  .steps { flex-direction: column; }
  .step-arrow { justify-content: center; transform: rotate(90deg); }
  .unit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { grid-template-columns: 1fr; }
  .pager-fleur { justify-content: center; }
  .pager-next { justify-content: flex-end; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer-links { justify-content: center; }
  .footer-play { grid-column: auto; align-items: center; padding-left: 0; border-left: 0; }
}
@media (max-width: 600px) {
  .cat-cards { grid-template-columns: 1fr; }
  .page-home .play-button > span { display: none; }
  .page-home .play-button { padding: 0 12px; }
  .search--hero input { font-size: 16px; padding-left: 44px; }
  .search--hero .search-icon { left: 14px; }
  .search-submit { padding: 0 14px; font-size: 15px; }
  .wiki-ib-head { grid-template-columns: 38% minmax(0, 1fr); }
}

/* Without JavaScript the drawer and the collapse toggle cannot work: show the plain tree. */
.no-js .sidebar-collapse, .no-js .menu-button, .no-js .sidebar-close { display: none !important; }
