@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f5f4ee;
  --surface: #fffefa;
  --surface-soft: #eeefe6;
  --ink: #173d34;
  --text: #263e35;
  --muted: #5f6d61;
  --line: #d7ddd1;
  --line-soft: #e6e9e0;
  --teal: #235447;
  --gold: #856425;
  --gold-pale: #f2eddf;
  --sidebar-width: 240px;
  --sans: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --serif: "Noto Serif KR", "Batang", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
button, input, select { border-radius: 5px; }
button:disabled { cursor: default; }
svg { display: block; flex: 0 0 auto; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); word-break: keep-all; }
h1 { margin-bottom: 12px; font-size: clamp(30px, 3.5vw, 42px); font-weight: 750; line-height: 1.3; letter-spacing: -1.2px; }
h2 { font-size: 23px; line-height: 1.4; letter-spacing: -.6px; }
h3 { font-size: 18px; line-height: 1.5; letter-spacing: -.3px; }
::selection { background: #dae5ce; color: #153b30; }
:focus-visible { outline: 3px solid #a7772c; outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 200; top: 10px; left: 10px; min-height: 44px; padding: 10px 18px; background: var(--teal); color: #fff; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; }

/* Category navigation and the current article's contents have distinct roles. */
.sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); overflow-y: auto; overscroll-behavior: contain; background: #173d34; color: #e3eade; border-right: 1px solid #15382f; scrollbar-width: thin; scrollbar-color: #6c8371 #173d34; }
.brand { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; margin: 0 22px; padding: 27px 0 24px; border-bottom: 1px solid #476256; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 46px; border: 1px solid #b5a16d; color: #e2c68a; font: 24px/1 Georgia, serif; clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { display: block; color: #fffdf3; font-size: 22px; font-weight: 750; line-height: 1.4; letter-spacing: -.7px; }
.brand-caption { display: block; margin-top: 3px; color: #c2d0bc; font-size: 12px; line-height: 1.5; letter-spacing: 1px; }
.sidebar-search { display: flex; align-items: center; gap: 9px; min-height: 44px; margin: 18px 18px 0; padding: 9px 12px; border: 1px solid #5c7767; border-radius: 5px; color: #eff2e9; font-size: 14px; }
.sidebar-search svg { width: 18px; height: 18px; }
.sidebar-search kbd { margin-left: auto; color: #c3d3bb; font: 13px var(--sans); }
.sidebar-search:hover { background: #2a5143; border-color: #90a18b; }
.side-nav { display: flex; flex-direction: column; gap: 4px; padding: 18px 13px 25px; }
.nav-group { margin-top: 15px; }
.nav-group-title, .nav-label { display: block; margin: 0 0 6px; padding: 0 13px; color: #bdcdb6; font-size: 13px; font-weight: 650; line-height: 1.6; letter-spacing: .15px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 8px 13px; border-radius: 5px; color: #e0e8d9; font-size: 14px; line-height: 1.6; transition: background 120ms ease; }
.nav-link:hover { background: #295244; color: #fffdf3; }
.nav-link[aria-current="page"] { background: #345d4c; color: #fffdf3; font-weight: 700; }
.nav-link[aria-current="page"]::before { position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: 2px; background: #ddbf7b; content: ""; }
.nav-icon { display: grid; place-items: center; width: 21px; height: 24px; color: #b9cdb2; }
.nav-icon svg { width: 20px; height: 20px; }
.nav-link[aria-current="page"] .nav-icon { color: #eed59e; }
.nav-count { margin-left: auto; color: #c5d4bd; font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.sidebar-foot { margin: auto 24px 25px; padding-top: 20px; border-top: 1px solid #476256; color: #bdcdb5; font-size: 12px; line-height: 1.7; }
.sidebar-foot strong { display: block; color: #edf2e5; font-size: 13px; font-weight: 650; }
.sidebar-foot > span:last-child { display: block; }
.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 13px 36px; border-bottom: 1px solid var(--line); background: #fffefaf5; backdrop-filter: blur(10px); }
.crumbs { display: flex; flex: 1; min-width: 0; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.crumbs a { color: var(--ink); }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs span[aria-hidden] { color: #8a9989; }
.global-search { display: flex; flex: 0 1 390px; align-items: center; gap: 10px; min-width: 200px; min-height: 46px; padding: 0 5px 0 13px; border: 1px solid #bcc9b7; border-radius: 6px; background: var(--paper); }
.global-search .search-icon svg, .global-search > svg { width: 19px; height: 19px; color: var(--muted); }
.global-search input { width: 100%; min-width: 0; height: 44px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.global-search input::placeholder { color: #687564; }
.global-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px #23544718; }
.global-search button { display: grid; flex: 0 0 auto; place-items: center; width: 36px; min-height: 36px; padding: 6px; border: 0; border-radius: 4px; background: var(--teal); color: #fffdf4; }
.global-search button svg { width: 18px; height: 18px; }
.global-search button:hover { background: #173e31; }
.menu-toggle, .sidebar-close { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); background: var(--surface); }
.menu-toggle svg, .sidebar-close svg { width: 22px; height: 22px; }
.mobile-overlay { display: none; }
main { width: min(100%, 1380px); min-height: calc(100vh - 190px); margin: 0 auto; padding: 38px 36px 0; }
.page-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; width: min(calc(100% - 72px), 1308px); margin: 64px auto 0; padding: 23px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }

/* Search and grouped categories are the first choices on the home page. */
.dictionary-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 24px; }
.dictionary-heading h1 { margin: 0; font-size: clamp(30px, 3vw, 40px); }
.heading-label { display: block; margin-bottom: 8px; color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.heading-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; margin-top: 9px; color: var(--muted); font-size: 14px; }
.record-count { display: block; color: var(--muted); font-size: 14px; }
.heading-count { display: inline-block; margin-left: 12px; color: #5f735d; font-size: .62em; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0; vertical-align: .12em; }
.ruleset { display: inline-flex; flex-shrink: 0; align-items: center; min-height: 28px; padding: 3px 9px; border: 1px solid #d3c8a5; border-radius: 4px; background: var(--gold-pale); color: #725721; font-size: 12px; font-weight: 500; line-height: 1.7; }
.index-search { margin: 0 0 32px; }
.search-form { display: flex; align-items: center; gap: 13px; min-width: 0; min-height: 58px; padding: 6px 7px 6px 18px; border: 1px solid #9bb092; border-radius: 6px; background: var(--surface); box-shadow: 0 2px 0 #25463308; }
.search-form:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px #23544718; }
.search-icon { flex: 0 0 auto; color: #526c52; }
.search-icon svg { width: 22px; height: 22px; }
.search-form input { flex: 1; width: 100%; min-width: 0; height: 44px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-form input::placeholder { color: #677460; }
.search-form input:focus-visible { outline: 0; }
.search-submit { flex: 0 0 auto; align-self: stretch; min-width: 76px; min-height: 44px; padding: 9px 19px; border: 1px solid var(--teal); border-radius: 4px; background: var(--teal); color: #fffdf3; font-size: 14px; font-weight: 700; }
.search-submit:hover { background: #173f32; }
.search-shortcut { display: grid; flex: 0 0 auto; place-items: center; width: 25px; height: 27px; border: 1px solid #cdd5c6; border-radius: 4px; background: #f5f6ed; color: #60725b; font-size: 13px; }
.search-help { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 18px; margin: 0 0 15px; }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 750; }
.section-head a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; color: var(--teal); font-size: 13px; }
.section-head h2 a { font-size: inherit; font-weight: inherit; }
.section-head a:hover { text-decoration: underline; text-underline-offset: 4px; }
.section-head svg { width: 18px; height: 18px; }
.group-count { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0 0 38px; }
.directory-group { min-width: 0; padding: 20px 20px 12px; border: 1px solid var(--line); border-top: 3px solid #78906d; border-radius: 6px; background: var(--surface); }
.directory-group h2, .directory-group h3 { margin: 0 0 13px; font-size: 18px; line-height: 1.5; }
.directory-links { display: grid; grid-template-columns: 1fr; }
.directory-links a { display: grid; grid-template-columns: 21px minmax(0, 1fr) auto 14px; align-items: center; gap: 9px; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); font-size: 15px; line-height: 1.5; }
.directory-links a:last-child { border-bottom: 0; }
.directory-links a:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
.directory-icon { color: #6a7c56; }
.directory-icon svg { width: 20px; height: 20px; }
.directory-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.directory-links a > svg { width: 14px; height: 14px; color: #8b9d80; }
.home-section-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 17px 0; border-block: 1px solid var(--line); }
.home-section-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--teal); font-size: 14px; line-height: 1.6; }
.home-section-nav a:hover { border-color: #899e7d; background: #eaf0e2; }
.index-group { margin-bottom: 38px; }
.index-tiles, .related-index { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 5px; background: var(--line); }
.index-tile { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 82px; padding: 13px 14px; background: var(--surface); color: var(--ink); font-size: 15px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.index-tile:hover { background: #eaf0e2; }
.index-tile > span:last-child { min-width: 0; }
.index-tile .entity-picture { width: 49px; height: 49px; }
.index-tile .entity-picture[data-category='civilizations'] { padding: 6px; }
.index-more { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 15px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 5px 5px; background: #eaf0e2; color: var(--teal); font-size: 14px; }
.index-more:hover { background: #dfe9d6; }
.index-more svg { width: 16px; height: 16px; }
.tile-civilization { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tile-civilization img { width: 19px; height: 19px; padding: 2px; border-radius: 50%; background: #355747; object-fit: contain; }

/* Lists expose identity, a few comparable values and one bounded effect. */
.browse-layout { margin: 0; }
.browse-search { margin-bottom: 18px; }
.filter-panel { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.filter-panel > summary { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 11px 17px; color: var(--ink); font-size: 14px; font-weight: 700; list-style: none; }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary > span { color: var(--muted); font-size: 13px; font-weight: 400; }
.filter-panel > summary svg { width: 17px; height: 17px; margin-left: auto; }
.filter-panel[open] > summary { border-bottom: 1px solid var(--line-soft); }
.filter-panel[open] > summary svg { transform: rotate(90deg); }
.filter-bar { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 16px 17px; }
.filter-group { display: flex; align-items: flex-start; gap: 16px; }
.filter-label { flex: 0 0 36px; margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.filter-options { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { min-height: 44px; padding: 8px 13px; border: 1px solid #ced7c7; border-radius: 5px; background: #fffefa; color: #425e42; font-size: 13px; line-height: 1.6; }
.filter-chip:hover { border-color: #718d66; background: #eef3e7; }
.filter-chip[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: #fffdf4; font-weight: 650; }
.filter-category-select { width: min(100%, 320px); min-height: 44px; padding: 8px 12px; border: 1px solid #c2cdbb; background: var(--surface); color: var(--ink); font-size: 14px; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; min-height: 74px; padding: 14px 0; color: var(--muted); font-size: 14px; }
.results-summary { display: flex; align-items: center; flex: 1; flex-wrap: wrap; gap: 10px 16px; min-width: 0; }
.results-count { margin: 0; }
.results-count strong { color: var(--ink); font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.active-filters:empty { display: none; }
.active-filter { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid #bbcdb0; border-radius: 20px; background: #e8f0df; color: #2a5038; font-size: 13px; line-height: 1.5; }
.active-filter:hover { border-color: #6d8c60; background: #dce9d1; }
.active-filter svg { width: 14px; height: 14px; }
.sort-select { display: flex; align-items: center; flex: 0 0 auto; gap: 9px; color: var(--muted); font-size: 13px; }
.sort-select select { min-height: 44px; max-width: 160px; padding: 8px 10px; border: 1px solid #c2cdbb; background: var(--surface); color: var(--ink); font-size: 14px; }
.listing-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 13px; padding: 12px 0 18px; color: var(--muted); font-size: 13px; }
.pagination-slot:last-of-type .listing-pagination { padding: 19px 0 0; }
.page-numbers { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 11px; border: 1px solid #ccd5c5; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
a.page-link:hover { border-color: #6e8a62; background: #e7efde; }
.page-link[aria-current='page'] { border-color: var(--teal); background: var(--teal); color: #fffdf4; font-weight: 700; }
.page-direction { min-width: 56px; }
.page-gap { padding: 0 3px; }
.page-range { margin-left: auto; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.listing-caption { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; padding: 10px 20px; border-top: 2px solid #6f8866; border-bottom: 1px solid var(--line); border-radius: 5px 5px 0 0; background: #e9ede0; color: #4a6345; font-size: 13px; font-weight: 650; }
.entry-list, .data-list { display: block; border: 1px solid var(--line); border-top: 2px solid #6f8866; border-radius: 5px; background: var(--surface); }
.listing-caption + .entry-list { border-top: 0; border-radius: 0 0 5px 5px; }
.entry-group-heading { display: flex; align-items: baseline; gap: 9px; margin: 0; padding: 13px 20px; border-bottom: 1px solid var(--line); background: #eef2e8; color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: 0; }
.entry-row + .entry-group-heading { border-top: 2px solid #6f8866; }
.entry-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: center; gap: 22px; min-height: 110px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.entry-row:last-child { border-bottom: 0; }
.entry-row:nth-child(even) { background: #f7f8f2; }
.entry-row:hover { background: #f0f4e9; }
.entry-identity { min-width: 0; }
.entry-name-link { display: flex; align-items: center; gap: 13px; min-width: 0; min-height: 60px; border-radius: 3px; }
.entry-name-link:hover .entry-title { color: #194d37; text-decoration: underline; text-underline-offset: 4px; }
.entry-identity .entity-picture { width: 60px; height: 60px; }
.entry-title { display: block; min-width: 0; margin: 0; color: var(--ink); font-size: 17px; font-weight: 750; line-height: 1.5; letter-spacing: -.25px; word-break: keep-all; overflow-wrap: anywhere; }
.entry-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: 0; }
.entry-era { display: block; margin-top: 4px; color: #656c52; font-size: 12px; font-weight: 400; line-height: 1.5; }
.entry-identity > .civ-badge { margin: 8px 0 0 73px; }
.entry-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 13px 21px; min-width: 0; padding-left: 22px; border-left: 1px solid var(--line); }
.entry-metric { display: block; min-width: 0; }
.metric-label { display: block; margin-bottom: 4px; color: #5d6e58; font-size: 13px; line-height: 1.55; font-weight: 500; }
.metric-value { display: block; color: #203d2e; font-size: 15px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.entry-effect { grid-column: 1 / -1; }
.entry-effect .metric-value { max-width: 86ch; font-size: 15px; }
.entry-metric .civ-badge { margin-left: 3px; }
#search-results:focus { outline: 0; }
.empty-state { margin-top: 20px; padding: 52px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-align: center; }
.empty-state h2 { margin-bottom: 14px; font-size: 23px; }
.reset-search { min-height: 44px; padding: 9px 18px; border: 1px solid #8ea383; border-radius: 5px; background: #eaf1e2; color: var(--teal); font-size: 14px; }
.reset-search:hover { background: #dae7ce; }
.notice { margin: 20px 0; padding: 16px 19px; border: 1px solid #d4c39a; border-radius: 5px; background: #f7f1df; color: #654e23; font-size: 14px; }

/* Values appear first, while complete facts remain comfortably readable. */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -5px 0 24px; color: var(--muted); font-size: 14px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; color: var(--teal); }
.breadcrumb a svg { width: 16px; height: 16px; transform: rotate(180deg); }
.breadcrumb a:hover { text-decoration: underline; text-underline-offset: 4px; }
.detail-layout { display: block; }
.detail-layout > article { min-width: 0; }
.record-header { display: flex; align-items: center; gap: 23px; padding-bottom: 28px; border-bottom: 2px solid #6f8866; }
.record-art { display: grid; flex: 0 0 114px; place-items: center; width: 114px; height: 114px; }
.record-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.record-heading { min-width: 0; }
.record-header h1 { margin: 0; font-size: clamp(32px, 3vw, 40px); font-weight: 800; line-height: 1.3; letter-spacing: -.9px; }
.detail-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 9px; color: #665e3e; font-size: 13px; line-height: 1.5; }
.detail-kicker a:hover { text-decoration: underline; text-underline-offset: 3px; }
.english-name { display: block; margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.record-header .ruleset { align-self: flex-start; margin-left: auto; }
.record-connections { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; margin-top: 13px; font-size: 13px; line-height: 1.7; }
.record-connections:empty { display: none; }
.record-connections .civ-badge { margin: 0; }
.classification-link { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 9px; border: 1px solid #c3d0b8; border-radius: 4px; background: #eff3e7; color: #355b37; font-size: 13px; line-height: 1.6; }
.classification-link:hover { border-color: #8da17d; background: #e4edda; }
.replacement-link { color: var(--muted); }
.record-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 28px; }
.highlight { min-width: 0; margin: 0; padding: 15px 18px; border: 1px solid #d6dec9; border-radius: 5px; background: #eef2e6; }
.highlight dt { margin: 0 0 6px; color: #566e4e; font-size: 13px; line-height: 1.5; }
.highlight dd { margin: 0; color: var(--ink); font-size: 19px; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums; word-break: keep-all; overflow-wrap: anywhere; }
.highlight dd .term-link { font-weight: 650; }
.article-jumpbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; margin: 24px 0; padding: 12px 0; border-block: 1px solid var(--line); }
.article-jumpbar a { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--teal); font-size: 13px; line-height: 1.6; }
.article-jumpbar a:hover { border-color: #8aa17a; background: #e9f0df; }
.mobile-toc { margin: 24px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.mobile-toc > summary { min-height: 48px; padding: 11px 16px; color: var(--ink); font-size: 14px; font-weight: 700; }
.mobile-toc > summary span { margin-left: 9px; color: var(--muted); font-size: 13px; font-weight: 400; }
.mobile-toc > nav { padding: 8px 16px 15px; }
.mobile-toc .toc-link { margin-left: 0; padding-left: 10px; }
.data-section { margin: 35px 0; }
.shared-civilization { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0 0 20px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--ink); }
.shared-civilization .entity-picture { width: 40px; height: 40px; }
.shared-civilization strong { font-size: 17px; }
.shared-civilization > span:last-child { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-left: auto; color: var(--muted); font-size: 13px; }
.shared-civilization > span:last-child svg { width: 16px; height: 16px; }
.shared-civilization:hover { border-color: #8da17d; background: #e4edda; }
.common-section-title { margin: 22px 0 12px; font-size: 17px; }
.data-section > h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 15px; color: var(--ink); font-size: 23px; font-weight: 750; line-height: 1.4; letter-spacing: -.5px; }
.data-section > h2 .group-count { margin-left: 0; }
.section-permalink { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; color: #687e5f; font-size: 17px; font-weight: 500; text-decoration: none; }
.section-permalink:hover { color: var(--teal); text-decoration: underline; }
.data-rows { display: block; margin: 0; border: 1px solid var(--line); border-top: 2px solid #a2b197; border-radius: 5px; background: var(--surface); }
.data-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.75; }
.data-row:last-child { border-bottom: 0; }
.data-row dt { min-width: 0; padding: 14px 17px; border-right: 1px solid var(--line); background: #eef1e7; color: #496343; font-size: 13px; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.data-row dd { min-width: 0; margin: 0; padding: 13px 19px; color: #223e2e; word-break: keep-all; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.data-row:nth-child(even) dd { background: #fbfcf6; }
.data-row dt .term-link { text-decoration-color: #8fa17e; }
.record-facts { display: block; }
.related-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.related-index .index-tile { min-height: 78px; padding: 12px 14px; font-size: 14px; }
.related-index .entity-picture { width: 46px; height: 46px; }
.more-references { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 5px 5px; background: var(--surface); }
.more-references summary { min-height: 44px; padding: 10px 15px; background: #eaf0e2; color: var(--teal); font-size: 14px; line-height: 1.7; }
.more-references summary:hover { background: #e0eada; }
.more-references .related-index, .more-references .data-list { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.upgrade-chain { padding: 22px; border: 1px solid #d4ddca; border-radius: 6px; background: #edf2e6; }
.upgrade-current { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; color: var(--ink); font-size: 18px; }
.upgrade-current .entity-picture { width: 50px; height: 50px; }
.upgrade-direction + .upgrade-direction { margin-top: 22px; }
.upgrade-direction h3 { margin: 0 0 12px; color: #45613e; font-size: 15px; font-weight: 700; }
.detail-aside { display: none; min-width: 0; }
.toc { padding: 0 0 0 18px; border-left: 1px solid var(--line); }
.toc > p { margin: 0 0 14px; color: var(--ink); font-size: 14px; font-weight: 750; line-height: 1.5; }
.toc-link { display: block; margin-left: -19px; padding: 9px 8px 9px 18px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; line-height: 1.6; word-break: keep-all; }
.toc-link:hover { background: #eaf0e2; color: var(--teal); }
.toc-link[aria-current="location"] { border-left-color: var(--teal); background: #e6eedb; color: var(--ink); font-weight: 700; }
.toc-top { display: inline-flex; align-items: center; min-height: 44px; margin-top: 13px; color: var(--teal); font-size: 13px; }
.toc-top:hover { text-decoration: underline; }
.game-scene { margin: 16px 0 26px; }
.game-scene img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 5px; }
.game-scene figcaption { padding-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--teal); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; }
.text-link svg { width: 17px; height: 17px; }

/* All actual game art, white glyphs and keyword links share one readable system. */
.entity-picture { display: grid; flex: 0 0 auto; place-items: center; width: 60px; height: 60px; }
.entity-picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.entity-picture.scene-picture { border-radius: 4px; }
.entity-picture.scene-picture img { object-fit: cover; }
.entity-picture[data-category='units'], .entity-picture[data-category='civilizations'], .entity-picture[data-category='great-people'], .entity-picture[data-monochrome='true'] { padding: 7px; border-radius: 50%; background: #355747; }
.entity-picture[data-category='research'] { padding: 3px; }
.record-art[data-category='units'], .record-art[data-category='civilizations'], .record-art[data-category='great-people'], .record-art[data-monochrome='true'] { padding: 15px; border-radius: 50%; background: #355747; }
.record-art[data-image-kind='symbol'] img { max-width: 56px; max-height: 56px; image-rendering: auto; }
.category-picture { border: 1px solid #c4d3b6; border-radius: 7px; background: #e4edd8; color: #426f3e; }
.category-picture svg { width: 60%; height: 60%; }
.term-icon { display: inline-block; width: 21px; height: 21px; margin: 0 3px 0 0; vertical-align: -.3em; object-fit: contain; }
.term-icon[data-category='units'], .term-icon[data-category='civilizations'], .term-icon[data-category='great-people'], .term-icon[data-monochrome='true'] { padding: 2px; border-radius: 50%; background: #355747; }
.metric-label .term-icon, .data-row dt .term-icon, .highlight dt .term-icon { width: 17px; height: 17px; margin-right: 3px; vertical-align: -.3em; }
.game-term { white-space: nowrap; }
.term-link { color: #205d3c; text-decoration: underline; text-decoration-color: #82a171; text-decoration-thickness: 1px; text-underline-offset: 3px; white-space: normal; word-break: keep-all; }
.term-link:hover { color: #694d19; text-decoration-color: #96763a; background: #f1edda; }
.term-reference { display: inline; max-width: 100%; vertical-align: baseline; }
.term-category-icon { display: inline-flex; width: 19px; height: 19px; margin-right: 3px; vertical-align: -.25em; color: #466b40; }
.term-category-icon svg { width: 19px; height: 19px; }
.civ-badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 28px; margin-left: 5px; padding: 3px 8px 3px 4px; border: 1px solid #c0d0b3; border-radius: 4px; background: #edf3e4; color: #365a34; font-size: 12px; font-weight: 500; line-height: 1.6; text-decoration: none; vertical-align: middle; white-space: normal; }
.civ-badge img, .preview-owner img { flex: 0 0 auto; width: 20px; height: 20px; padding: 2px; border-radius: 50%; background: #355747; object-fit: contain; }
.civ-badge:hover { border-color: #849e71; background: #dfeccd; color: #244923; }
.term-preview { position: fixed; z-index: 150; width: 360px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; padding: 19px; border: 1px solid #aabf9b; border-top: 3px solid #567f49; border-radius: 7px; background: #fffef8; color: var(--text); box-shadow: 0 10px 35px #183e3229; }
.preview-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.preview-heading .entity-picture { width: 57px; height: 57px; }
.preview-heading small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.preview-heading strong { display: block; margin: 3px 0 4px; color: var(--ink); font-size: 20px; font-weight: 750; line-height: 1.4; }
.preview-heading span[lang] { color: var(--muted); font-size: 12px; line-height: 1.5; }
.preview-owner { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: #526c49; font-size: 13px; line-height: 1.5; }
.term-preview dl { margin: 0; border-top: 1px solid var(--line); }
.term-preview dl > div { display: grid; grid-template-columns: 98px minmax(0, 1fr); gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; line-height: 1.7; }
.term-preview dt { color: #566c4e; }
.term-preview dd { min-width: 0; margin: 0; color: var(--text); word-break: keep-all; overflow-wrap: anywhere; }

@media (min-width: 1280px) {
  .detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; align-items: start; gap: 35px; }
  .detail-aside { display: block; align-self: stretch; }
  .detail-aside .toc { position: sticky; top: 105px; max-height: calc(100dvh - 132px); overflow: auto; scrollbar-width: thin; }
  .mobile-toc { display: none; }
  .detail-layout .entry-row { grid-template-columns: 215px minmax(0, 1fr); gap: 18px; padding-inline: 16px; }
  .detail-layout .entry-metrics { gap: 12px 16px; padding-left: 18px; }
}
@media (max-width: 1279px) {
  .article-jumpbar { display: none; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry-row, .listing-caption { grid-template-columns: 215px minmax(0, 1fr); gap: 18px; }
  .entry-row { padding: 17px 16px; }
  .entry-metrics { gap: 12px 17px; padding-left: 18px; }
  .related-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .global-search { flex-basis: 320px; }
}
@media (max-width: 1000px) {
  .workspace { margin-left: 0; }
  .sidebar { z-index: 80; width: min(300px, calc(100vw - 48px)); visibility: hidden; transform: translateX(-100%); transition: transform 160ms ease, visibility 160ms; }
  body.menu-open .sidebar, .app-shell.menu-open .sidebar, .sidebar.is-open { visibility: visible; transform: translateX(0); }
  body.menu-open { overflow: hidden; }
  .sidebar .brand { margin-top: 26px; }
  .sidebar-close { position: absolute; top: 9px; right: 11px; display: flex; border-color: #66816c; background: #244d3e; color: #f6f6e8; }
  .menu-toggle { display: flex; flex: 0 0 44px; }
  .mobile-overlay { position: fixed; z-index: 70; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: #0a2219a6; }
  body.menu-open .mobile-overlay, .app-shell.menu-open .mobile-overlay, .mobile-overlay.is-open { display: block; }
  .topbar { gap: 16px; padding-inline: 28px; }
  .global-search { flex-basis: 340px; }
  main { padding: 30px 28px 0; }
  .page-footer { width: calc(100% - 56px); }
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .directory-group { padding-inline: 16px; }
  .directory-group h2, .directory-group h3 { font-size: 17px; }
  .directory-links a { font-size: 14px; }
}
@media (max-width: 800px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-row, .listing-caption { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
  .entry-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 16px; padding-left: 16px; }
  .record-header { gap: 18px; }
  .record-art { flex-basis: 102px; width: 102px; height: 102px; }
  .record-highlights { gap: 10px; }
  .highlight { padding: 14px 15px; }
  .related-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-header .ruleset { margin-left: 0; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 165px; }
  .topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 11px 12px; min-height: 0; padding: 12px 20px; }
  .topbar .crumbs { font-size: 13px; gap: 5px 8px; }
  .global-search { grid-column: 1 / -1; min-width: 0; min-height: 46px; padding-left: 12px; }
  .global-search input { font-size: 16px; }
  .global-search button { width: 44px; min-height: 44px; }
  main { padding: 26px 20px 0; }
  .page-footer { width: calc(100% - 40px); margin-top: 45px; padding: 20px 0 25px; }
  .dictionary-heading { align-items: flex-start; gap: 10px 15px; margin-bottom: 22px; }
  .dictionary-heading h1 { font-size: 30px; }
  .heading-label { margin-bottom: 6px; font-size: 13px; }
  .heading-meta, .record-count { font-size: 13px; }
  .dictionary-heading .ruleset { margin-top: 6px; }
  .search-form { gap: 9px; padding-left: 12px; }
  .search-form input { font-size: 16px; }
  .search-submit { min-width: 62px; padding-inline: 12px; }
  .search-shortcut { display: none; }
  .index-search { margin-bottom: 28px; }
  .directory-grid { grid-template-columns: 1fr; gap: 14px; margin-bottom: 28px; }
  .directory-group { padding: 18px 18px 10px; }
  .directory-group h2, .directory-group h3 { margin-bottom: 10px; font-size: 18px; }
  .directory-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .directory-links a { grid-template-columns: 20px minmax(0, 1fr) auto; font-size: 14px; gap: 7px; }
  .directory-links a > svg { display: none; }
  .directory-links a:last-child { border-bottom: 1px solid var(--line-soft); }
  .home-section-nav { gap: 7px; margin-bottom: 26px; padding-block: 14px; }
  .home-section-nav a { padding-inline: 11px; font-size: 13px; }
  .section-head { align-items: center; }
  .section-head h2 { font-size: 21px; }
  .section-head > a { font-size: 13px; }
  .index-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-group { margin-bottom: 30px; }
  .index-tile { gap: 9px; min-height: 79px; padding: 11px; font-size: 14px; }
  .index-tile .entity-picture { width: 44px; height: 44px; }
  .tile-civilization { flex-wrap: wrap; gap: 3px; font-size: 12px; }
  .filter-panel { margin-top: 14px; }
  .filter-bar { padding: 14px; }
  .filter-group { flex-direction: column; gap: 9px; }
  .filter-label { flex-basis: auto; margin: 0; }
  .filter-options { gap: 6px; }
  .filter-chip { padding-inline: 11px; }
  .results-toolbar { gap: 10px 14px; padding: 15px 0 10px; }
  .results-summary { align-items: flex-start; gap: 8px; }
  .active-filters { flex-basis: 100%; }
  .active-filter { min-height: 44px; padding-block: 9px; }
  .listing-pagination { gap: 10px; padding-bottom: 15px; }
  .page-numbers { gap: 4px; }
  .page-link { min-width: 44px; padding-inline: 10px; }
  .page-direction { min-width: 51px; }
  .page-range { flex-basis: 100%; margin-left: 0; font-size: 12px; }
  .listing-caption { display: flex; justify-content: space-between; padding: 10px 15px; font-size: 13px; }
  .listing-caption span:last-child { color: var(--muted); font-weight: 400; }
  .entry-row { grid-template-columns: minmax(0, 1fr); gap: 15px; padding: 19px 15px; }
  .entry-name-link { gap: 13px; min-height: 60px; }
  .entry-identity .entity-picture { width: 60px; height: 60px; }
  .entry-title { font-size: 18px; }
  .entry-title small, .entry-era { font-size: 12px; }
  .entry-identity > .civ-badge { margin-top: 7px; margin-left: 73px; }
  .entry-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 16px; padding: 13px 0 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .metric-label { font-size: 13px; }
  .metric-value, .entry-effect .metric-value { font-size: 15px; line-height: 1.7; }
  .breadcrumb { margin-bottom: 18px; font-size: 13px; }
  .record-header { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 13px 16px; padding-bottom: 23px; }
  .record-art { grid-row: 1 / span 2; width: 88px; height: 88px; }
  .record-heading { flex: 1; min-width: 0; }
  .record-heading:first-child { grid-column: 1 / -1; }
  .record-header h1 { font-size: 32px; overflow-wrap: anywhere; }
  .detail-kicker { gap: 5px; margin-bottom: 7px; font-size: 13px; }
  .english-name { margin-top: 6px; font-size: 13px; }
  .record-header .ruleset { grid-column: 2; justify-self: start; margin-left: 0; }
  .record-heading:first-child ~ .ruleset { grid-column: 1 / -1; }
  .record-connections { gap: 6px; margin-top: 10px; font-size: 13px; }
  .record-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
  .highlight { padding: 13px 14px; }
  .highlight dd { font-size: 18px; }
  .article-jumpbar { gap: 7px; margin: 22px 0; }
  .article-jumpbar a { min-height: 44px; padding-inline: 10px; }
  .mobile-toc { margin: 22px 0; }
  .mobile-toc .toc-link { min-height: 44px; }
  .data-section { margin: 30px 0; }
  .data-section > h2 { font-size: 21px; }
  .data-row { grid-template-columns: minmax(0, 1fr); }
  .data-row dt { padding: 10px 15px 5px; border-right: 0; background: #eef1e7; font-size: 13px; line-height: 1.6; }
  .data-row dd { padding: 8px 15px 14px; font-size: 16px; line-height: 1.75; }
  .data-row:nth-child(even) dd { background: var(--surface); }
  .related-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-index .index-tile { gap: 9px; min-height: 78px; padding: 10px; font-size: 14px; }
  .related-index .entity-picture { width: 41px; height: 41px; }
  .upgrade-chain { padding: 16px; }
  .upgrade-chain .related-index { grid-template-columns: 1fr; }
  .term-preview { width: 350px; padding: 16px; }
  .preview-heading { gap: 11px; }
  .term-preview dl > div { grid-template-columns: 91px minmax(0, 1fr); }
}
@media (max-width: 380px) {
  main { padding-inline: 15px; }
  .topbar { padding-inline: 15px; }
  .page-footer { width: calc(100% - 30px); }
  .entry-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-links { gap: 0 15px; }
  .directory-links a { gap: 6px; }
  .index-tile { flex-direction: column; align-items: flex-start; gap: 8px; }
  .related-index .index-tile { flex-direction: row; }
  .record-art { flex-basis: 78px; width: 78px; height: 78px; }
  .record-header h1 { font-size: 29px; }
  .record-header { grid-template-columns: 78px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  html { scroll-padding-top: 0; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .sidebar, .topbar, .mobile-overlay, .menu-toggle, .sidebar-close, .detail-aside, .mobile-toc, .article-jumpbar, .term-preview, .filter-panel, .search-form, .listing-pagination, .skip-link, .section-permalink { display: none !important; }
  .workspace { margin-left: 0; }
  main { width: 100%; padding: 0; }
  .detail-layout { display: block; }
  .record-header, .data-section > h2 { break-after: avoid; }
  .data-row, .entry-row, .highlight { break-inside: avoid; }
  .record-header h1 { font-size: 26pt; }
  .data-row { grid-template-columns: 140px minmax(0, 1fr); font-size: 11pt; }
  .data-row dt { border-right: 1px solid #ddd; }
  .data-row dd { font-size: 11pt; }
  .page-footer { width: 100%; margin-top: 25px; }
  .more-references:not([open]) > :not(summary) { display: block; }
  .term-link { color: #163d2c; }
}

