:root {
  --ink: #14243b;
  --ink-soft: #263a54;
  --muted: #66758a;
  --line: #d9e1ea;
  --line-strong: #c4d0dd;
  --paper: #f7f9fb;
  --panel: #ffffff;
  --accent: #1f5d85;
  --accent-soft: #e9f0f6;
  --max: 1220px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html[data-theme="analytical-ledger"] {
  --ink: #edf2f6; --ink-soft: #c4d0da; --muted: #9eacb8; --line: #334553; --line-strong: #526a79;
  --paper: #101820; --panel: #182630; --accent: #d5a25d; --accent-soft: #342e28;
}
html[data-theme="enterprise-research"] {
  --ink: #354a5f; --ink-soft: #4f6b82; --muted: #6a7f90; --line: #d6e0e8; --line-strong: #a9bac8;
  --paper: #f5f7fa; --panel: #ffffff; --accent: #0070f2; --accent-soft: #e5f3ff;
}
html[data-theme="enterprise-research"] .site-header {
  background: #354a5f;
  border-bottom-color: #526b80;
  color: #ffffff;
}
html[data-theme="enterprise-research"] .brand-mark { border-color: #c6d4df; }
html[data-theme="enterprise-research"] .brand small,
html[data-theme="enterprise-research"] .main-nav,
html[data-theme="enterprise-research"] .site-controls,
html[data-theme="enterprise-research"] .theme-switcher { color: #d7e3eb; }
html[data-theme="enterprise-research"] .main-nav a,
html[data-theme="enterprise-research"] .language-switcher a { color: #e5eef4; }
html[data-theme="enterprise-research"] .main-nav a:hover,
html[data-theme="enterprise-research"] .language-switcher a.active,
html[data-theme="enterprise-research"] .language-switcher a:hover { color: #ffffff; }
html[data-theme="enterprise-research"] .theme-switcher select { background: #ffffff; color: #354a5f; border-color: #c6d4df; }
html[data-theme="systems-monograph"] {
  --ink: #241f1c; --ink-soft: #4b413b; --muted: #766e68; --line: #d7d0c9; --line-strong: #b9aaa0;
  --paper: #f6f3ee; --panel: #fffdfa; --accent: #8e4034; --accent-soft: #f1e4df;
  --max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.65; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8db5cf; outline-offset: 3px; }
.site-header, .site-footer { max-width: var(--max); margin: auto; padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; }
.site-header { border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--ink); font-size: 11px; letter-spacing: .08em; font-weight: 700; flex: 0 0 auto; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.main-nav { display: flex; gap: 26px; font-size: 13px; color: var(--muted); }
.site-controls { display: flex; align-items: center; gap: 18px; margin-left: 18px; }
.language-switcher { display: flex; gap: 8px; font-size: 11px; letter-spacing: .08em; }
.language-switcher a { color: var(--muted); }
.language-switcher a.active, .language-switcher a:hover { color: var(--accent); font-weight: 700; }
.theme-switcher { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.theme-switcher select { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 5px 7px; font: inherit; font-size: 10px; text-transform: none; letter-spacing: 0; }
.main-nav a, .text-link, .site-footer a { transition: color .18s ease; }
.main-nav a:hover, .text-link:hover, .site-footer a:hover { color: var(--accent); }
.home-shell, .content-shell { max-width: var(--max); margin: auto; padding: 0 32px; }
.hero { padding: 112px 0 124px; max-width: 900px; }
.kicker, .eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.kicker-rule { display: inline-block; width: 28px; height: 1px; margin: 0 8px 3px; background: var(--line-strong); }
.hero h1, .page-heading h1, .article-shell h1, .section-intro h2, .principles-section h2, .method-grid h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.035em; line-height: 1.08; }
.hero h1, .page-heading h1, .article-shell h1, .section-intro h2, .principles-section h2, .method-grid h2, .article-card h3, .article-row h2 { text-align: justify; text-justify: inter-word; }
.article-card h3 a, .article-row h2 a { display: block; text-align: justify; text-justify: inter-word; }
.hero h1 { font-size: clamp(48px, 7vw, 86px); margin: 0 0 28px; max-width: 900px; }
.hero-lead { max-width: 680px; font-size: 20px; color: var(--muted); }
.hero-lead, .section-intro > p:last-child, .principles-grid p, .method-grid p, .page-heading > p:last-child, .field-detail p:not(.field-index), .article-card p:not(.eyebrow), .article-row p:not(.eyebrow), .article-summary, .article-body p { text-align: justify; }
.hero-actions { display: flex; gap: 26px; align-items: center; margin-top: 38px; }
.button { border: 0; padding: 12px 18px; font: inherit; font-size: 13px; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover { background: var(--accent); }
.text-link { color: var(--accent); font-size: 13px; font-weight: 700; }
.map-grid { display: grid; grid-template-columns: 1fr 1.45fr; gap: 52px; padding: 42px 0; border-top: 1px solid var(--line); }
.section-intro h2 { font-size: 30px; margin: 0 0 14px; }
.section-intro h2 span { color: var(--accent); font-family: Inter, sans-serif; font-size: .55em; vertical-align: middle; }
.section-intro > p:last-child { color: var(--muted); max-width: 390px; }
.field-list { border-top: 1px solid var(--line); }
.field-card { display: flex; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); transition: padding .18s ease; }
.field-card:hover { padding-left: 7px; }
.field-card:hover strong { color: var(--accent); }
.field-index, .principle-number { color: var(--accent); font-size: 12px; font-weight: 700; }
.field-card strong, .field-card small { display: block; }
.field-card small { color: var(--muted); font-size: 13px; margin-top: 3px; }
.principles-section { display: grid; grid-template-columns: .8fr 1.6fr; gap: 70px; padding: 78px 0; border-top: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(233,240,246,.5)); }
.principles-section h2 { font-size: 36px; margin: 0; max-width: 380px; }
.principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.principles-grid > div { border-top: 1px solid var(--line-strong); padding-top: 15px; }
.principles-grid h3 { font-size: 16px; margin: 24px 0 10px; }
.principles-grid p, .method-grid p { color: var(--muted); font-size: 14px; margin: 0; }
.featured-section { padding: 78px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card { background: var(--panel); border: 1px solid var(--line); padding: 26px; min-height: 260px; transition: border-color .18s ease, transform .18s ease; }
.article-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.article-card h3 { font: 400 24px/1.2 Georgia, serif; margin: 0 0 16px; }
.article-card p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.card-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 24px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 80px; color: var(--muted); font-size: 11px; gap: 12px; }
.site-contacts { display: flex; gap: 14px; }
.content-shell { padding-top: 76px; }
.page-heading { max-width: 740px; padding-bottom: 58px; }
.page-heading h1 { font-size: 64px; margin: 0 0 20px; }
.page-heading > p:last-child { color: var(--muted); font-size: 18px; }
.filter-bar { display: flex; gap: 14px; align-items: end; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; margin-bottom: 28px; }
.filter-bar label { display: flex; flex: 1; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.filter-bar input, .filter-bar select { border: 1px solid var(--line); background: var(--panel); padding: 11px; font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); }
.article-list { background: var(--panel); border: 1px solid var(--line); }
.article-row { display: flex; justify-content: space-between; gap: 30px; padding: 28px 32px; border-bottom: 1px solid var(--line); }
.article-row:last-child { border: 0; }
.article-row h2 { font: 400 28px/1.2 Georgia, serif; margin: 0 0 8px; }
.article-row h2 a:hover { color: var(--accent); }
.article-row p:not(.eyebrow) { margin: 0; color: var(--muted); max-width: 760px; }
.article-shell { max-width: var(--max); margin: auto; padding: 62px 32px 82px; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 64px; }
.article-shell h1 { font-size: clamp(44px, 5.2vw, 60px); max-width: 900px; margin: 0 0 22px; }
.article-summary { font-size: 20px; line-height: 1.58; color: var(--muted); max-width: 780px; }
.article-meta { display: flex; gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin: 28px 0 42px; color: var(--muted); font-size: 11px; flex-wrap: wrap; }
.article-language-switcher { display: flex; align-items: center; gap: 10px; margin: -28px 0 36px; }
.article-language-switcher .kicker { margin: 0 8px 0 0; }
.article-language-switcher a { border: 1px solid var(--line); color: var(--accent); padding: 4px 8px; font-size: 11px; letter-spacing: .08em; }
.article-language-switcher a:hover { background: var(--accent-soft); }
.preview-banner { border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--accent); padding: 10px 14px; font-size: 12px; margin: 0 0 20px; }
.article-body { font-family: Georgia, serif; font-size: 19px; line-height: 1.8; }
.article-body h1, .article-body h2, .article-body h3 { font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.25; }
.article-body h2 { margin-top: 52px; }
.article-body p { margin: 0 0 22px; }
.article-body li { text-align: justify; }
.article-body table { width: 100%; border-collapse: collapse; font-family: Inter, sans-serif; font-size: 14px; line-height: 1.45; margin: 30px 0; }
.article-body table { display: block; overflow-x: auto; }
.article-body th, .article-body td { text-align: left; vertical-align: top; border: 1px solid var(--line); padding: 12px 14px; }
.article-body th { background: var(--accent-soft); font-weight: 700; }
.article-body pre { overflow-x: auto; background: var(--ink); color: #f7f9fb; padding: 18px 20px; border-radius: 2px; font: 14px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: left; }
.article-body code { background: var(--accent-soft); padding: .12em .3em; font: .86em ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-body pre code { background: transparent; padding: 0; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 58px; }
.evidence-card { background: var(--panel); border: 1px solid var(--line); padding: 22px; }
.evidence-card h2 { font: 400 25px/1.2 Georgia, serif; margin: 0 0 14px; }
.evidence-card p, .evidence-card li { font-size: 14px; text-align: justify; }
.evidence-card ul { padding-left: 20px; margin: 0; }
.source-link { display: block; color: var(--accent); font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.source-link:last-child { border-bottom: 0; }
.source-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.source-meta small { color: var(--muted); font-size: 11px; }
.source-meta small + small { border-left: 1px solid var(--line-strong); padding-left: 8px; }
.evidence-card h3 { font: 600 16px/1.3 Inter, ui-sans-serif, system-ui, sans-serif; margin: 20px 0 5px; }
.evidence-card h3:first-child { margin-top: 0; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.related-grid a { border-top: 1px solid var(--line-strong); padding-top: 12px; font: 400 18px/1.25 Georgia, serif; }
.article-aside { position: sticky; top: 28px; align-self: start; border-top: 1px solid var(--line); padding-top: 15px; }
.article-aside a { display: block; color: var(--accent); font-size: 13px; padding: 7px 0; }
.article-aside .aside-back { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.field-directory { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field-detail { background: var(--panel); border: 1px solid var(--line); padding: 30px; min-height: 240px; transition: border-color .18s ease, transform .18s ease; }
.field-detail:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.field-detail h2 { font: 400 31px/1.15 Georgia, serif; margin: 26px 0 15px; }
.field-detail p:not(.field-index) { color: var(--muted); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; border-top: 1px solid var(--line); padding-top: 28px; }
.method-grid > div { border-top: 2px solid var(--ink); padding-top: 15px; }
.method-grid h2 { font-size: 29px; margin: 28px 0 14px; }
.workspace-table { background: var(--panel); border: 1px solid var(--line); }
.workspace-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 13px; }
.workspace-link { color: inherit; transition: background .18s ease, padding .18s ease; }
.workspace-link:hover { background: var(--accent-soft); padding-left: 29px; }
.workspace-row:last-child { border: 0; }
.workspace-head { background: var(--accent-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.workspace-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 28px; background: var(--line); border: 1px solid var(--line); }
.workspace-summary > div { background: var(--panel); padding: 20px; min-height: 92px; }
.workspace-label, .cost-grid span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.workspace-summary strong { display: block; font-size: 18px; }
.workspace-summary code { font-size: 11px; color: var(--muted); word-break: break-all; }
.workspace-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 28px; margin-bottom: 42px; }
.workspace-link-inline { color: var(--accent); font-size: 13px; font-weight: 700; }
.button-light { background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); }
.workspace-actions output { color: var(--muted); font-size: 13px; }
.workspace-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.workspace-section { margin-top: 42px; }
.workspace h2 { font: 400 28px/1.2 Georgia, serif; margin: 0 0 14px; }
.workspace-card { background: var(--panel); border: 1px solid var(--line); padding: 20px; }
.cost-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cost-grid strong { font-size: 18px; }
.workspace-source { display: block; padding: 8px 0; color: var(--accent); border-bottom: 1px solid var(--line); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-source:last-child { border-bottom: 0; }
.workspace-source-entry { padding: 4px 0 10px; border-bottom: 1px solid var(--line); }
.workspace-source-entry:last-child { border-bottom: 0; }
.workspace-source-entry .workspace-source { border-bottom: 0; padding-bottom: 3px; }
.workspace-source-entry small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.workspace-audit { padding: 14px 0; border-bottom: 1px solid var(--line); }
.workspace-audit:last-child { border-bottom: 0; }
.workspace-audit > div { display: flex; gap: 14px; font-size: 13px; }
.workspace-audit > div span { color: var(--accent); }
.workspace-audit p { margin: 6px 0; color: var(--muted); font-size: 13px; }
.workspace-audit small { color: var(--muted); font-size: 11px; }
.workspace-log { display: grid; grid-template-columns: 150px 80px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.workspace-log:last-child { border-bottom: 0; }
.workspace-log time, .workspace-log strong { color: var(--muted); }
.history-row { grid-template-columns: 1.2fr 1.5fr 1fr 1fr; }
.history-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; }
.reliability-row { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
.queue-row { grid-template-columns: minmax(180px, 2fr) 1fr 1.15fr .85fr auto minmax(80px, .7fr); align-items: center; }
.queue-control input, .queue-control select { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px; font: inherit; font-size: 12px; }
.queue-result { color: var(--muted); font-size: 11px; }
.queue-table { overflow-x: auto; }
.queue-table .queue-row { min-width: 900px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 30px 0; color: var(--muted); font-size: 13px; }
.pagination a { color: var(--accent); }
.topic-prepare { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 28px 0; }
.topic-prepare h2 { margin: 8px 0; }
.topic-prepare p.muted { max-width: 720px; color: var(--muted); margin-bottom: 0; }
.topic-prepare-actions { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.topic-prepare-actions label, .topic-search label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.form-select, .topic-search input, .topic-position { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); padding: 9px 11px; font: inherit; }
.topic-prepare-actions output { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.topic-search { display: flex; align-items: end; gap: 12px; margin: 28px 0 16px; }
.topic-search input { min-width: min(360px, 50vw); }
.topic-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
.topic-table { width: 100%; border-collapse: collapse; min-width: 980px; font-size: 13px; }
.topic-table th, .topic-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.topic-table th { background: var(--accent-soft); color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.topic-table tbody tr:last-child td { border-bottom: 0; }
.topic-table td:first-child { min-width: 290px; max-width: 450px; }
.topic-table td:first-child strong, .topic-table td:first-child small { display: block; }
.topic-table td:first-child small { margin-top: 7px; color: var(--muted); line-height: 1.45; }
.topic-position { width: 100px; }
.topic-table td:last-child { min-width: 130px; }
.topic-table .queue-result { display: block; margin-top: 6px; }
.status-pill { display: inline-block; padding: 4px 7px; background: var(--accent-soft); font-size: 10px; }
.topic-prepare-actions .button:disabled { opacity: .6; cursor: wait; }
.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; }
.empty-state { padding: 28px; color: var(--muted); }
@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; }
  .site-controls { width: 100%; justify-content: space-between; margin-left: 0; }
  .evidence-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .site-header, .site-footer { padding: 18px 20px; }
  .site-header { align-items: flex-start; gap: 18px; }
  .main-nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .home-shell, .content-shell { padding: 0 20px; }
  .hero { padding: 75px 0 85px; }
  .hero h1, .article-shell h1 { font-size: 48px; }
  .map-grid, .article-shell, .principles-section { display: block; }
  .field-list, .principles-grid { margin-top: 42px; }
  .article-aside { margin-top: 60px; }
  .article-grid, .field-directory, .method-grid { grid-template-columns: 1fr; }
  .filter-bar { display: block; }
  .filter-bar label { margin-bottom: 12px; }
  .filter-bar .button { width: 100%; }
  .workspace-row { grid-template-columns: 1.5fr 1fr; gap: 8px; }
  .workspace-head span:nth-child(n+3), .workspace-row span:nth-child(n+3) { display: none; }
  .workspace-summary, .workspace-columns { grid-template-columns: 1fr; }
  .cost-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace-log { grid-template-columns: 1fr; gap: 2px; }
  .reliability-row { grid-template-columns: 1.5fr 1fr; }
  .queue-row { grid-template-columns: 1.5fr 1fr; }
  .topic-prepare { align-items: stretch; flex-direction: column; }
  .topic-search { align-items: stretch; flex-wrap: wrap; }
  .topic-search input { min-width: 0; flex: 1 1 180px; }
  .queue-row > :nth-child(n+3) { margin-top: 6px; }
  .queue-table .queue-row { grid-template-columns: minmax(180px, 2fr) 1fr 1.15fr .85fr auto minmax(80px, .7fr); }
  .queue-table .queue-row > * { display: block; }
  .site-footer { display: block; }
  .site-footer span { display: block; margin: 4px 0; }
}
