:root {
  color-scheme: dark;
  --bg: #171615;
  --bg-soft: #1b1d1c;
  --sidebar: #17120f;
  --topbar: rgba(12, 15, 20, .94);
  --surface: #24211d;
  --surface-2: #2b2722;
  --surface-3: #332d27;
  --line: #4a3a2b;
  --line-strong: #65503a;
  --text: #f0e2ca;
  --text-soft: #d8c9b2;
  --muted: #a7947b;
  --accent: #d59b4a;
  --accent-strong: #f1c376;
  --accent-soft: rgba(213, 155, 74, .11);
  --gold: #d59b4a;
  --danger: #d87878;
  --sidebar-width: 236px;
  --topbar-height: 64px;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 74% 0, rgba(61, 96, 106, .13), transparent 34%), radial-gradient(circle at 10% 100%, rgba(161, 92, 35, .11), transparent 30%), var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, input, select { color: var(--text); }
::selection { color: #071013; background: var(--accent); }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sidebar-width); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--sidebar); }
.sidebar-head { min-height: var(--topbar-height); display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line); }
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; }
.brand-sign { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(213,155,74,.38); border-radius: 9px; color: var(--accent-strong); background: linear-gradient(145deg, rgba(213,155,74,.13), rgba(213,155,74,.06)); font-weight: 800; }
.brand > span:last-child { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.sidebar-close { display: none; margin-left: auto; border: 0; color: var(--muted); background: none; font-size: 25px; cursor: pointer; }
.side-nav { padding: 20px 12px; }
.nav-label { margin: 0 9px 8px; color: #8b765e; font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 25px; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 7px 10px; margin: 2px 0; border: 1px solid transparent; border-radius: 8px; color: #c7b69e; font-size: 13px; font-weight: 650; transition: .15s ease; }
.nav-link:hover { color: var(--text); background: #2a241f; }
.nav-link.is-active { border-color: rgba(213,155,74,.18); color: var(--accent-strong); background: var(--accent-soft); }
.nav-glyph { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #4a3b2e; border-radius: 6px; color: #b3a188; background: #1d1916; font-size: 10px; font-weight: 850; }
.nav-link.is-active .nav-glyph { border-color: rgba(213,155,74,.34); color: var(--accent-strong); background: rgba(213,155,74,.08); }
.sidebar-foot { margin-top: auto; display: grid; gap: 5px; padding: 16px 20px 20px; border-top: 1px solid var(--line); color: #917d65; font-size: 10px; }
.sidebar-foot a { color: #cdbb9f; }
.sidebar-foot a:hover { color: var(--accent-strong); }

.site-frame { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-height); display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--topbar); backdrop-filter: blur(14px); }
.menu-button { display: none; width: 38px; height: 38px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.menu-button span { display: block; height: 1px; margin: 4px 0; background: var(--text-soft); }
.global-search { width: min(620px, 62vw); height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #1e1b18; transition: .15s ease; }
.global-search:focus-within { border-color: rgba(213,155,74,.48); box-shadow: 0 0 0 3px rgba(213,155,74,.07); }
.search-icon { width: 14px; height: 14px; position: relative; flex: 0 0 auto; border: 1.7px solid #a39179; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.7px; right: -5px; bottom: -2px; transform: rotate(45deg); background: #a39179; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.global-search input::placeholder { color: #917d65; }
.global-search kbd { padding: 2px 7px; border: 1px solid #5b4734; border-bottom-color: #252c36; border-radius: 5px; color: #9e8a70; background: #2a241f; font-size: 10px; }
.editor-link { margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: #d5c5ad; background: var(--surface); font-size: 11px; font-weight: 700; }
.editor-link:hover { border-color: var(--line-strong); color: var(--text); }
.site-main { min-height: calc(100vh - var(--topbar-height)); }
.content-wrap { width: min(100% - 48px, 1280px); margin: 0 auto; padding: 30px 0 58px; }

.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; color: #96836d; font-size: 11px; }
.breadcrumbs a:hover { color: var(--accent-strong); }
.breadcrumbs span:last-child { color: #d5c5ad; }

.home-intro { min-height: 184px; display: flex; align-items: flex-end; justify-content: space-between; gap: 34px; padding: 34px 38px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at 92% 10%, rgba(213,155,74,.10), transparent 28%), linear-gradient(145deg, #12171e, #1d1916); box-shadow: var(--shadow); }
.home-intro h1, .page-header h1, .source-hero h1, .article-header h1 { margin: 0; letter-spacing: -.035em; line-height: 1.05; }
.home-intro h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 760; }
.home-intro > div:first-child > p:last-child { max-width: 650px; margin: 15px 0 0; color: #bca98e; font-size: 15px; }
.home-stats { flex: 0 0 auto; display: flex; gap: 10px; }
.home-stats span { min-width: 86px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; color: #a28e74; background: rgba(24,19,15,.68); font-size: 10px; }
.home-stats strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 19px; }
.section-block { margin-top: 28px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.section-heading > a, .section-heading.compact > a { color: #ad997d; font-size: 11px; font-weight: 700; }
.section-heading > a:hover { color: var(--accent-strong); }
.section-heading.compact { min-height: 61px; align-items: center; padding: 0 18px; margin: 0; border-bottom: 1px solid var(--line); }
.section-heading.compact h2 { font-size: 15px; }
.section-heading.compact .eyebrow { margin-bottom: 3px; }
.section-number { min-width: 28px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: #b3a188; background: #1e1b18; font-size: 10px; font-weight: 800; }
.directory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.directory-card { min-height: 94px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: .16s ease; }
.directory-card:hover { transform: translateY(-2px); border-color: #6a5138; background: var(--surface-2); }
.directory-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(213,155,74,.23); border-radius: 8px; color: var(--accent-strong); background: var(--accent-soft); font-weight: 850; }
.directory-card strong, .directory-card small { display: block; }
.directory-card strong { font-size: 14px; }
.directory-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.directory-card b { color: #917c63; font-size: 12px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr); gap: 14px; margin-top: 24px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.data-list { display: grid; }
.data-row { min-height: 58px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid #3d3026; transition: .13s ease; }
.data-row:last-child { border-bottom: 0; }
.data-row:hover { background: #2b2722; }
.level-badge { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #303946; border-radius: 7px; color: var(--accent-strong); background: #1b1815; font-size: 10px; font-weight: 850; }
.item-badge { color: var(--gold); }
.data-main { min-width: 0; }
.data-main strong, .data-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-main strong { font-size: 12px; }
.data-main small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.data-meta { color: #b3a188; font-size: 10px; }
.source-code { max-width: 86px; padding: 4px 6px; overflow: hidden; border: 1px solid #4a3b2e; border-radius: 5px; color: #a8957a; background: #1d1916; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.source-list { display: grid; }
.source-row { min-height: 62px; display: grid; grid-template-columns: 3px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 10px 16px; border-bottom: 1px solid #3d3026; }
.source-row:last-child { border-bottom: 0; }
.source-row:hover { background: #2b2722; }
.source-line { width: 3px; height: 34px; border-radius: 5px; background: var(--source-accent); box-shadow: 0 0 16px color-mix(in srgb, var(--source-accent), transparent 58%); }
.source-row strong, .source-row small { display: block; }
.source-row strong { font-size: 12px; }
.source-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.source-row b { color: #917d65; font-size: 11px; }
.class-preview-panel { margin-top: 14px; }
.class-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.class-preview-card { background: var(--surface); }
.class-preview-head { min-height: 72px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 16px; }
.class-preview-head:hover { background: #2b2722; }
.class-letter { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #303946; border-radius: 8px; color: var(--gold); background: #1e1b18; font-weight: 850; }
.class-preview-head strong, .class-preview-head small { display: block; }
.class-preview-head strong { font-size: 13px; }
.class-preview-head small { color: var(--muted); font-size: 10px; }
.class-preview-head em { color: #97836a; font-size: 9px; font-style: normal; font-weight: 800; }
.subclass-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 16px 66px; }
.subclass-links a, .subclass-links span { padding: 5px 7px; border: 1px solid #4a3b2e; border-radius: 5px; color: #bba990; background: #1d1916; font-size: 9px; }
.subclass-links a:hover { border-color: rgba(213,155,74,.36); color: var(--accent-strong); }

.page-header { min-height: 128px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 0 2px 24px; border-bottom: 1px solid var(--line); }
.page-header h1 { font-size: clamp(36px, 5vw, 52px); }
.page-header p:last-child { max-width: 690px; margin: 12px 0 0; color: var(--muted); }
.result-count { min-width: 54px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #c8b79e; background: var(--surface); font-size: 13px; font-weight: 850; }
.catalog-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 14px; margin-top: 20px; align-items: start; }
.filters-panel { position: sticky; top: calc(var(--topbar-height) + 18px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.filters-panel form { display: grid; gap: 13px; padding: 16px; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.filter-heading strong { font-size: 12px; }
.filter-heading a { color: var(--muted); font-size: 9px; }
.filter-heading a:hover { color: var(--accent-strong); }
.field { display: grid; gap: 6px; }
.field > span { color: #a8957a; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #2a323d; border-radius: 7px; outline: 0; color: #eadcc6; background: #0d1116; font-size: 11px; }
.field input:focus, .field select:focus { border-color: rgba(213,155,74,.48); }
.check-field { display: flex; align-items: center; gap: 8px; color: #b9a68d; font-size: 10px; }
.check-field input { accent-color: var(--accent); }
.primary-button { height: 39px; border: 1px solid rgba(213,155,74,.38); border-radius: 7px; color: #f2d4a0; background: rgba(213,155,74,.13); font-size: 10px; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: rgba(213,155,74,.19); }
.list-panel { min-width: 0; }
.rich-row { grid-template-columns: 34px minmax(180px,1fr) 120px 80px; }

.class-catalog { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.class-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.class-card-head { min-height: 76px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #28231e; }
.class-card-head:hover { background: #302922; }
.class-card-title { min-width: 0; }
.class-card-title strong, .class-card-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-card-title strong { font-size: 15px; }
.class-card-title small { color: var(--muted); font-size: 10px; }
.class-source { color: #9e8a70; font-size: 8px; font-weight: 850; }
.class-summary { min-height: 63px; margin: 0; padding: 14px 16px; color: #b9a78e; font-size: 11px; }
.class-facts { display: grid; grid-template-columns: 1fr 1.4fr; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.class-facts div { padding: 11px 16px; border-right: 1px solid var(--line); }
.class-facts div:last-child { border-right: 0; }
.class-facts dt { color: #927d64; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.class-facts dd { margin: 3px 0 0; color: #ddcfb8; font-size: 10px; }
.subclass-block-head { display: flex; justify-content: space-between; padding: 12px 16px 8px; }
.subclass-block-head strong { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.subclass-block-head span { color: #927e67; font-size: 9px; }
.subclass-list { display: grid; padding: 0 8px 8px; }
.subclass-list > a { min-height: 49px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; }
.subclass-list > a:hover { background: #302923; }
.subclass-list strong, .subclass-list small { display: block; }
.subclass-list strong { font-size: 11px; }
.subclass-list small { color: var(--muted); font-size: 9px; }
.subclass-list em { color: #927d66; font-size: 8px; font-style: normal; font-weight: 800; }
.subclass-list > p { margin: 0; padding: 8px; color: #917d65; font-size: 10px; }

.detail-page { max-width: 1280px; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 14px; align-items: start; }
.article-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.article-header { padding: 38px 42px 32px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 100% 0, rgba(213,155,74,.08), transparent 31%), #28231e; }
.article-kicker { display: block; margin-bottom: 10px; color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.article-header h1 { font-size: clamp(38px, 5vw, 62px); }
.article-header > p { margin: 7px 0 0; color: #a7947b; font-size: 12px; }
.lead { max-width: 780px; margin-top: 20px; color: #aeb7c1; font-size: 14px; line-height: 1.7; }
.tag-line { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tag-line span { padding: 5px 8px; border: 1px solid #5b4734; border-radius: 5px; color: #bca98e; background: #1e1b18; font-size: 9px; font-weight: 750; }
.facts-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 0; border-bottom: 1px solid var(--line); }
.facts-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.facts-grid > div { padding: 15px 18px; border-right: 1px solid var(--line); }
.facts-grid > div:last-child { border-right: 0; }
.facts-grid dt { color: #8f7a62; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.facts-grid dd { margin: 5px 0 0; color: #eadcc6; font-size: 11px; font-weight: 650; }
.facts-grid dd a { color: var(--accent-strong); }
.article-section { padding: 28px 42px 34px; border-bottom: 1px solid var(--line); }
.article-section:last-child { border-bottom: 0; }
.first-section { padding-top: 24px; }
.article-section > .section-heading.compact { min-height: auto; padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.prose { color: #d9cbb5; font-size: 14px; line-height: 1.78; }
.prose h2 { margin: 0 0 18px; color: var(--text); font-size: 20px; letter-spacing: -.02em; }
.prose h2:not(:first-child) { margin-top: 34px; }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--accent-strong); }
.subclass-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.subclass-card { min-height: 98px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: start; gap: 12px; padding: 14px; border: 1px solid #4a3b2e; border-radius: 8px; background: #1e1b18; }
.subclass-card:hover { border-color: rgba(213,155,74,.35); background: #2e2822; }
.subclass-level { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(213,155,74,.28); border-radius: 7px; color: var(--gold); font-size: 10px; font-weight: 850; }
.subclass-card strong, .subclass-card small { display: block; }
.subclass-card strong { font-size: 12px; }
.subclass-card small { color: var(--muted); font-size: 9px; }
.subclass-card p { margin: 8px 0 0; color: #ad9a80; font-size: 10px; line-height: 1.45; }
.subclass-card em { color: #927e67; font-size: 8px; font-style: normal; font-weight: 800; }
.inset-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.detail-aside { position: sticky; top: calc(var(--topbar-height) + 18px); display: grid; gap: 10px; }
.aside-card { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.aside-card h2 { margin: 0 0 12px; color: #aa967a; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.source-reference { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; padding: 10px; border: 1px solid #4a3b2e; border-radius: 8px; background: #1d1916; }
.source-reference:hover { border-color: #70583e; }
.source-cover { width: 42px; height: 53px; display: grid; place-items: center; border-left: 3px solid var(--source-accent); border-radius: 3px 6px 6px 3px; color: #eadcc6; background: color-mix(in srgb, var(--source-accent), #1d1916 84%); font-size: 9px; font-weight: 900; }
.source-reference strong, .source-reference small { display: block; }
.source-reference strong { font-size: 11px; }
.source-reference small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.aside-links { display: grid; }
.aside-links a { padding: 8px 0; border-top: 1px solid #3f3126; color: #c8b79d; font-size: 10px; }
.aside-links a:first-child { border-top: 0; }
.aside-links a:hover { color: var(--accent-strong); }
.notice-strip { display: grid; gap: 4px; margin: 24px 42px 0; padding: 13px 15px; border-left: 3px solid var(--gold); color: #c7b394; background: rgba(213,155,74,.07); font-size: 11px; }
.notice-strip strong { color: #efc77f; }

.source-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 20px; }
.source-card { min-height: 170px; display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.source-card:hover { transform: translateY(-2px); border-color: #6a5138; background: var(--surface-2); }
.source-card-cover { width: 78px; height: 126px; display: grid; place-items: center; border-left: 5px solid var(--source-accent); border-radius: 4px 8px 8px 4px; color: #eadcc6; background: color-mix(in srgb, var(--source-accent), #1e1b18 82%); box-shadow: 8px 10px 22px rgba(0,0,0,.2); }
.source-card-cover b { font-size: 11px; }
.source-card-copy { min-width: 0; align-self: center; }
.source-card-copy strong, .source-card-copy small, .source-card-copy > span { display: block; }
.source-card-copy strong { font-size: 14px; }
.source-card-copy small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.source-card-copy > span { margin-top: 18px; color: #9d876d; font-size: 9px; line-height: 1.5; }
.source-hero { min-height: 280px; display: flex; align-items: center; gap: 36px; padding: 34px 40px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--source-accent), transparent 84%), transparent 35%), var(--surface); }
.source-hero-cover { width: 125px; height: 190px; flex: 0 0 auto; display: grid; place-items: center; border-left: 7px solid var(--source-accent); border-radius: 5px 12px 12px 5px; color: #eadcc6; background: color-mix(in srgb, var(--source-accent), #1e1b18 80%); box-shadow: 14px 18px 40px rgba(0,0,0,.3); font-size: 18px; font-weight: 900; }
.source-hero h1 { font-size: clamp(38px, 5vw, 58px); }
.original-title { margin: 8px 0 0; color: var(--muted); }
.source-meta { display: flex; gap: 8px; margin-top: 15px; }
.source-meta span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: #aa967d; background: #1d1916; font-size: 9px; }
.source-description { max-width: 760px; margin: 18px 0 0; color: #c2b096; }
.source-sections { display: grid; gap: 14px; margin-top: 14px; }
.source-class-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: var(--line); }
.source-class-group { padding: 16px; background: var(--surface); }
.source-class-group > a strong, .source-class-group > a small { display: block; }
.source-class-group > a strong { font-size: 13px; }
.source-class-group > a small { color: var(--muted); font-size: 9px; }
.source-class-group > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.source-class-group > div a { padding: 5px 7px; border: 1px solid #4a3b2e; border-radius: 5px; color: #baa78e; background: #1d1916; font-size: 9px; }

.search-results { display: grid; gap: 14px; margin-top: 20px; }
.empty-state { min-height: 100px; display: grid; place-items: center; padding: 20px; color: #927d66; text-align: center; font-size: 11px; }
.empty-state.large { min-height: 220px; border: 1px dashed #54412f; border-radius: var(--radius); background: rgba(18,22,29,.5); }
.muted { color: var(--muted); }
.mobile-backdrop { display: none; }

@media (max-width: 1160px) {
  .directory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .class-catalog { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; box-shadow: 22px 0 60px rgba(0,0,0,.42); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .mobile-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(3,5,8,.72); backdrop-filter: blur(2px); }
  .sidebar-close { display: block; }
  .site-frame { margin-left: 0; }
  .menu-button { display: block; }
  .global-search { width: auto; flex: 1; }
  .home-intro { align-items: flex-start; flex-direction: column; }
  .home-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  :root { --topbar-height: 58px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .global-search kbd, .editor-link { display: none; }
  .content-wrap { width: calc(100% - 24px); padding-top: 20px; }
  .home-intro { min-height: 0; padding: 26px 22px; }
  .home-intro h1 { font-size: 39px; }
  .home-stats { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); }
  .home-stats span { min-width: 0; }
  .directory-grid { grid-template-columns: 1fr; }
  .class-preview-grid { grid-template-columns: 1fr; }
  .page-header { min-height: 106px; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters-panel { position: static; }
  .rich-row { grid-template-columns: 34px minmax(0,1fr) auto; }
  .rich-row .data-meta { display: none; }
  .article-header { padding: 28px 24px 25px; }
  .article-header h1 { font-size: 39px; }
  .facts-grid, .facts-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .facts-grid > div:nth-child(2n) { border-right: 0; }
  .article-section { padding: 24px; }
  .subclass-grid { grid-template-columns: 1fr; }
  .detail-aside { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .source-hero { align-items: flex-start; padding: 25px; }
  .source-hero-cover { width: 92px; height: 145px; }
  .source-class-list { grid-template-columns: 1fr; }
  .notice-strip { margin-inline: 24px; }
}

@media (max-width: 480px) {
  .global-search input { font-size: 11px; }
  .home-stats { grid-template-columns: 1fr; }
  .home-stats span { display: flex; align-items: baseline; gap: 5px; }
  .home-stats strong { margin: 0; }
  .data-row { grid-template-columns: 32px minmax(0,1fr) auto; padding-inline: 11px; }
  .data-meta { display: none; }
  .source-code { max-width: 60px; }
  .class-card-head { grid-template-columns: 38px minmax(0,1fr); }
  .class-source { display: none; }
  .class-facts { grid-template-columns: 1fr; }
  .class-facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .class-facts div:last-child { border-bottom: 0; }
  .facts-grid, .facts-grid.two { grid-template-columns: 1fr; }
  .facts-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .source-hero-cover { display: none; }
  .source-card { grid-template-columns: 66px minmax(0,1fr); }
  .source-card-cover { width: 64px; height: 104px; }
}

/* ================================================================
   Larchik v4 — warm night library palette
   Inspired by dark wood, parchment, candlelight and muted blue magic.
   ================================================================ */
:root {
  --topbar: rgba(29, 25, 21, .94);
  --magic: #4d7d89;
  --magic-soft: rgba(77, 125, 137, .13);
  --parchment: #f0e2ca;
  --candle: #f1c376;
  --wood: #2a211a;
  --wood-deep: #1b1511;
}

html { scroll-behavior: smooth; }
body { background-attachment: fixed; }
.sidebar {
  background:
    radial-gradient(circle at 30% 0, rgba(77,125,137,.09), transparent 28%),
    linear-gradient(180deg, #1c1612 0%, #17120f 72%);
  box-shadow: 12px 0 42px rgba(0,0,0,.16);
}
.brand-sign {
  border-color: rgba(88,137,149,.42);
  color: #9dc2c8;
  background: linear-gradient(145deg, rgba(77,125,137,.22), rgba(213,155,74,.08));
  box-shadow: inset 0 0 18px rgba(77,125,137,.08), 0 0 22px rgba(77,125,137,.06);
}
.nav-label { color: #8b765e; }
.nav-link:hover { color: var(--text); background: rgba(213,155,74,.07); }
.nav-link.is-active {
  border-color: rgba(213,155,74,.23);
  color: var(--accent-strong);
  background: linear-gradient(90deg, rgba(213,155,74,.14), rgba(213,155,74,.05));
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-glyph { border-color: #4a3b2e; color: #b19d82; background: #211b17; }
.nav-link.is-active .nav-glyph { border-color: rgba(213,155,74,.42); color: #f1c376; background: rgba(213,155,74,.10); }
.topbar { background: var(--topbar); box-shadow: 0 9px 30px rgba(0,0,0,.13); }
.global-search { border-color: #4b3b2e; background: #27211c; }
.global-search:focus-within { border-color: rgba(213,155,74,.68); box-shadow: 0 0 0 3px rgba(213,155,74,.09); }
.search-icon { border-color: #ab9679; }
.search-icon::after { background: #ab9679; }
.global-search input::placeholder { color: #9b886f; }
.global-search kbd { border-color: #5b4734; border-bottom-color: #423326; color: #aa967b; background: #302820; }
.editor-link { border-color: #4b3b2e; color: #cbb99e; background: #27211c; }
.editor-link:hover { border-color: #73583b; color: #f0e2ca; background: #302820; }
.home-intro {
  background:
    radial-gradient(circle at 93% 7%, rgba(77,125,137,.18), transparent 31%),
    radial-gradient(circle at 9% 110%, rgba(184,105,43,.14), transparent 34%),
    linear-gradient(145deg, #29241f, #211d19);
}
.directory-card, .panel, .class-card, .source-card, .filters-panel, .article-card, .aside-card {
  box-shadow: 0 13px 35px rgba(0,0,0,.10);
}
.directory-card:hover, .source-card:hover { border-color: #795b3b; }
.directory-mark { border-color: rgba(213,155,74,.28); color: #f1c376; background: rgba(213,155,74,.09); }
.data-row:hover, .source-row:hover, .class-preview-head:hover { background: rgba(213,155,74,.055); }
.level-badge { border-color: #5b4734; color: #e3ad62; background: #201a16; }
.primary-button {
  border-color: rgba(213,155,74,.48);
  color: #f3d5a1;
  background: linear-gradient(180deg, rgba(213,155,74,.18), rgba(213,155,74,.10));
}
.primary-button:hover { background: rgba(213,155,74,.22); }
.field input, .field select { border-color: #4c3c2f; color: #eadcc6; background: #211c18; }
.field input:focus, .field select:focus { border-color: rgba(213,155,74,.65); box-shadow: 0 0 0 3px rgba(213,155,74,.07); }
.article-header {
  background:
    radial-gradient(circle at 100% 0, rgba(77,125,137,.13), transparent 34%),
    linear-gradient(150deg, #2b2621, #24201c);
}
.article-kicker, .eyebrow { color: #d9a356; }
.prose, .lead { color: #d3c3ab; }
.source-cover, .source-card-cover, .source-hero-cover {
  filter: saturate(.72) brightness(.92);
}

/* Class document — dense reference-page layout */
.class-page { max-width: 1420px; }
.class-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 18px;
  align-items: start;
}
.class-document {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(43,38,33,.98), rgba(35,31,27,.99));
  box-shadow: 0 24px 65px rgba(0,0,0,.19);
}
.class-hero {
  min-height: 235px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 44px 48px 38px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 93% 5%, rgba(77,125,137,.19), transparent 32%),
    radial-gradient(circle at 5% 110%, rgba(182,101,39,.16), transparent 39%),
    linear-gradient(145deg, #302a24 0%, #25211d 66%);
}
.class-hero-copy { max-width: 820px; }
.class-overline {
  margin: 0 0 12px;
  color: #d9a356;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.class-hero h1 {
  margin: 0;
  color: var(--parchment);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.class-original { margin: 10px 0 0; color: #ac987d; font-size: 13px; }
.class-lead { max-width: 760px; margin-top: 22px; color: #d0bea4; font-size: 15px; line-height: 1.72; }
.class-source-chip {
  width: 82px;
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 10px 12px;
  border: 1px solid #5c4734;
  border-radius: 10px;
  background: rgba(27,22,18,.68);
}
.class-source-chip > span {
  width: 44px;
  height: 56px;
  display: grid;
  place-items: center;
  border-left: 4px solid var(--source-accent);
  border-radius: 4px 7px 7px 4px;
  color: #eedfc6;
  background: color-mix(in srgb, var(--source-accent), #241e19 82%);
  box-shadow: 6px 8px 20px rgba(0,0,0,.22);
  font-size: 10px;
  font-weight: 900;
}
.class-source-chip small { color: #a28d72; font-size: 9px; text-align: center; }
.class-section { padding: 34px 48px 40px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--topbar-height) + 18px); }
.class-section:last-child { border-bottom: 0; }
.class-section-title { margin-bottom: 21px; }
.class-section-title > p, .class-section-title > div > p {
  margin: 0 0 5px;
  color: #b87d38;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.class-section-title h2 {
  margin: 0;
  color: #eee0c9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -.025em;
}
.class-section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.class-section-title-row > span {
  min-width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #57432f;
  border-radius: 7px;
  color: #c9b596;
  background: #211c18;
  font-size: 11px;
  font-weight: 800;
}
.class-section-title-row > a { color: #d6a154; font-size: 11px; font-weight: 750; }
.class-section-title-row > a:hover { color: #f1c376; }
.key-attributes-wrap { border: 1px solid #584532; border-radius: 9px; overflow: hidden; background: #211d19; }
.key-attributes-table { width: 100%; border-collapse: collapse; }
.key-attributes-table tr { border-bottom: 1px solid #49392b; }
.key-attributes-table tr:last-child { border-bottom: 0; }
.key-attributes-table th,
.key-attributes-table td { padding: 13px 17px; vertical-align: top; text-align: left; }
.key-attributes-table th {
  width: 31%;
  color: #b9a386;
  background: rgba(213,155,74,.045);
  font-size: 11px;
  font-weight: 800;
}
.key-attributes-table td { color: #e2d2b9; font-size: 13px; line-height: 1.55; }
.class-prose { color: #d6c7b0; font-size: 15px; line-height: 1.82; }
.class-prose > p { margin: 0 0 17px; }
.class-prose > p:last-child { margin-bottom: 0; }
.level-entry-grid { display: grid; gap: 10px; }
.level-entry-card {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr);
  gap: 17px;
  padding: 18px;
  border: 1px solid #594632;
  border-radius: 9px;
  background: #211d19;
}
.level-entry-card > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(213,155,74,.35);
  border-radius: 8px;
  color: #e6b365;
  background: rgba(213,155,74,.08);
  font-size: 11px;
  font-weight: 900;
}
.level-entry-card.secondary > span { border-color: rgba(77,125,137,.45); color: #91b5bc; background: var(--magic-soft); }
.level-entry-card h3 { margin: 1px 0 8px; color: #ebdcc3; font-size: 15px; }
.level-entry-card p { margin: 0 0 8px; color: #cbb99f; font-size: 13px; line-height: 1.65; }
.level-entry-card p:last-child { margin-bottom: 0; }
.progression-scroll { width: 100%; overflow-x: auto; border: 1px solid #594632; border-radius: 9px; background: #211d19; }
.class-progression-table { width: 100%; min-width: 690px; border-collapse: collapse; font-size: 11px; }
.class-progression-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 13px;
  border-right: 1px solid #594632;
  border-bottom: 1px solid #65503a;
  color: #d5bea0;
  background: #312921;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .035em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.class-progression-table td {
  padding: 10px 13px;
  border-right: 1px solid #443529;
  border-bottom: 1px solid #443529;
  color: #cdbb9f;
  vertical-align: top;
}
.class-progression-table th:last-child,
.class-progression-table td:last-child { border-right: 0; }
.class-progression-table tbody tr:last-child td { border-bottom: 0; }
.class-progression-table tbody tr:nth-child(even) { background: rgba(213,155,74,.026); }
.class-progression-table tbody tr:hover { background: rgba(213,155,74,.065); }
.class-progression-table td:first-child { width: 64px; color: #efc47e; text-align: center; }
.class-progression-table td:nth-child(2) { width: 116px; text-align: center; }
.progression-features-column { min-width: 245px; }
.progression-feature-links a { color: #e0ae62; }
.progression-feature-links a:hover { color: #f3cc8c; text-decoration: underline; text-underline-offset: 3px; }
.progression-feature-links span { color: #8f7b63; }
.table-dash { color: #7e6b55 !important; }
.subclass-library-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.subclass-library-card {
  min-height: 116px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 16px;
  border: 1px solid #574431;
  border-radius: 9px;
  background: #211d19;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.subclass-library-card:hover { transform: translateY(-1px); border-color: #89643f; background: #29231e; }
.subclass-library-level {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(213,155,74,.34);
  border-radius: 8px;
  color: #e5b264;
  background: rgba(213,155,74,.075);
  font-size: 10px;
  font-weight: 900;
}
.subclass-library-copy { min-width: 0; }
.subclass-library-copy strong, .subclass-library-copy small { display: block; }
.subclass-library-copy strong { color: #eadcc6; font-size: 13px; }
.subclass-library-copy small { margin-top: 1px; color: #a38f74; font-size: 9px; }
.subclass-library-copy p { margin: 9px 0 0; color: #bba88e; font-size: 11px; line-height: 1.52; }
.subclass-library-card em { color: #917b62; font-size: 8px; font-style: normal; font-weight: 850; }
.class-empty { grid-column: 1 / -1; border: 1px dashed #594632; border-radius: 9px; }
.class-feature-list { display: grid; gap: 12px; }
.class-feature {
  scroll-margin-top: calc(var(--topbar-height) + 18px);
  border: 1px solid #564330;
  border-radius: 9px;
  overflow: hidden;
  background: #211d19;
}
.class-feature-heading {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 28px;
  align-items: center;
  gap: 13px;
  padding: 14px 17px;
  border-bottom: 1px solid #4b3a2c;
  background: linear-gradient(90deg, rgba(213,155,74,.065), rgba(77,125,137,.025));
}
.class-feature-heading > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #624a32;
  border-radius: 8px;
  color: #efbd6e;
  background: #29221c;
  font-size: 10px;
  font-weight: 900;
}
.class-feature-heading small { display: block; color: #9d896f; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.class-feature-heading h3 { margin: 2px 0 0; color: #eadcc6; font-size: 17px; }
.class-feature-heading > a { color: #967f63; font-size: 17px; text-align: center; }
.class-feature-heading > a:hover { color: #efbd6e; }
.class-feature-body { padding: 19px 22px 21px; color: #d0bea5; font-size: 14px; line-height: 1.75; }
.class-feature-body p { margin: 0 0 14px; }
.class-feature-body p:last-child { margin-bottom: 0; }
.class-spell-list { border: 1px solid #584532; border-radius: 9px; overflow: hidden; }
.class-spell-list .data-row { background: #211d19; }
.class-spell-list .data-row:hover { background: #2a241f; }
.class-toc {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  display: grid;
  gap: 11px;
  max-height: calc(100vh - var(--topbar-height) - 36px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #6b5137 transparent;
}
.class-toc-card {
  display: grid;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(38,33,29,.94);
  box-shadow: 0 12px 30px rgba(0,0,0,.11);
}
.class-toc-card > p {
  margin: 0 0 10px;
  color: #a88f70;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.class-toc-card > a {
  padding: 7px 0;
  border-top: 1px solid #443529;
  color: #c8b69b;
  font-size: 10px;
  line-height: 1.35;
}
.class-toc-card > p + a { border-top: 0; }
.class-toc-card > a:hover { color: #f0bd70; }
.source-toc-card > a {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
}
.source-toc-card > a > span {
  width: 40px;
  height: 52px;
  display: grid;
  place-items: center;
  border-left: 4px solid var(--source-accent);
  border-radius: 3px 7px 7px 3px;
  color: #eadcc6;
  background: color-mix(in srgb, var(--source-accent), #251f1a 83%);
  font-size: 9px;
  font-weight: 900;
}
.source-toc-card strong, .source-toc-card small { display: block; }
.source-toc-card strong { color: #eadcc6; font-size: 11px; }
.source-toc-card small { margin-top: 3px; color: #9e896f; font-size: 9px; }
.feature-toc > a { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 7px; }
.feature-toc > a > span { color: #d49b4b; font-size: 9px; font-weight: 900; }

@media (max-width: 1040px) {
  .class-layout { grid-template-columns: 1fr; }
  .class-toc { position: static; max-height: none; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  .feature-toc { display: none; }
}

@media (max-width: 720px) {
  .class-hero { min-height: 0; align-items: flex-start; padding: 30px 24px 28px; }
  .class-hero h1 { font-size: 47px; }
  .class-source-chip { width: 70px; }
  .class-section { padding: 28px 24px 32px; }
  .key-attributes-table th, .key-attributes-table td { display: block; width: auto; }
  .key-attributes-table th { padding-bottom: 4px; border-bottom: 0; }
  .key-attributes-table td { padding-top: 3px; }
  .subclass-library-grid { grid-template-columns: 1fr; }
  .class-toc { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .class-hero { gap: 16px; }
  .class-source-chip { display: none; }
  .class-hero h1 { font-size: 42px; }
  .class-lead { font-size: 14px; }
  .class-section-title h2 { font-size: 27px; }
  .level-entry-card { grid-template-columns: 38px minmax(0,1fr); padding: 14px; }
  .level-entry-card > span { width: 34px; height: 34px; }
  .subclass-library-card { grid-template-columns: 34px minmax(0,1fr); }
  .subclass-library-card em { display: none; }
}
