:root {
  --ink: #172033;
  --muted: #5f6b7a;
  --line: #dce3eb;
  --paper: #ffffff;
  --wash: #f5f7fa;
  --accent: #175cd3;
  --accent-dark: #123f8c;
  --warm: #b45309;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(23, 32, 51, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.research-page { margin: 0; color: var(--ink); background: var(--wash); font-family: Arial, Helvetica, sans-serif; line-height: 1.7; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-160%); padding: 10px 14px; color: #fff; background: #111827; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: grid; color: var(--ink); text-decoration: none; line-height: 1.25; }
.brand strong { font-size: 1.05rem; }
.brand span { color: var(--muted); font-size: .76rem; }
.header-inner nav { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.header-inner nav > a, .nav-dropdown summary { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 11px; color: var(--ink); text-decoration: none; border-radius: 8px; cursor: pointer; }
.header-inner nav > a:hover, .nav-dropdown summary:hover { background: #edf3ff; color: var(--accent-dark); }
.nav-submenu { min-width: 290px; }
.nav-submenu a { white-space: normal; }
.nav-submenu a.active { color: var(--accent-dark); background: #edf3ff; font-weight: 700; }
.research-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; padding-block: 38px 70px; }
.research-layout--single { grid-template-columns: minmax(0, 1fr); max-width: 1040px; }
.article-toolbar { position: sticky; top: 110px; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 12px; color: var(--accent-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pdf-download { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 10px 15px; color: #fff; background: var(--accent); border-radius: 10px; font-weight: 800; text-decoration: none; }
.research-article .pdf-download { color: #fff; }
.pdf-download:hover { background: var(--accent-dark); }
.article-top-actions { display: flex; justify-content: flex-end; margin: 0 0 28px; }
.pdf-download--top { width: auto; min-width: 180px; }
.provenance { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .82rem; }
.provenance a, .research-article a { color: var(--accent-dark); overflow-wrap: anywhere; }
.merge-note { margin: 16px 0 0; padding: 12px; color: #6d3b08; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; font-size: .78rem; }
.research-article { min-width: 0; padding: clamp(25px, 5vw, 64px); background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.research-article h1 { margin: 0 0 1em; font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.08; letter-spacing: -.035em; }
.research-article h2 { margin: 2.2em 0 .65em; padding-top: .25em; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.2; letter-spacing: -.018em; }
.research-article h3 { margin: 1.7em 0 .55em; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.3; }
.research-article h4 { margin: 1.4em 0 .45em; font-size: 1.04rem; }
.research-article p { max-width: 82ch; margin: 0 0 1.05em; }
.research-article > p:not(.article-subtitle):not(.print-original-link):not(.reference-entry) {
  max-width: none;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.ai-disclaimer {
  margin: 1.25rem 0 2rem;
  padding: 16px 18px;
  color: #4a2a05;
  background: #fff8e8;
  border: 1px solid #e8bd69;
  border-left: 5px solid #b7791f;
  border-radius: 10px;
}
.ai-disclaimer strong { display: block; margin-bottom: 4px; color: #713f12; }
.ai-disclaimer p { margin: 0; max-width: none; font-size: .92rem; line-height: 1.55; }
.print-original-link { display: none; }
.source-module > section:first-child .ai-disclaimer {
  color: #fff7df;
  background: rgba(120, 67, 7, .36);
  border-color: #e7b95d;
}
.source-module > section:first-child .ai-disclaimer strong { color: #fde7ad; }
.research-article ul, .research-article ol { padding-left: 1.4em; }
.research-article li + li { margin-top: .45em; }
.citation { font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.reference-list {
  display: grid;
  gap: 10px;
  margin: 1rem 0 2rem;
  padding: 0;
  list-style: none;
}
.reference-list li {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.reference-number { color: var(--accent-dark); font-weight: 800; }
.reference-entry { min-width: 0; overflow-wrap: anywhere; }
.reference-section [class*="grid-cols"] { display: grid; grid-template-columns: 1fr; gap: 10px; }
.reference-section .reference-row { margin: 0; }
.research-article blockquote { margin: 1.5em 0; padding: 16px 20px; background: #f4f8ff; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: #fff; background: #243b63; }
tr:last-child td { border-bottom: 0; }
pre { max-width: 100%; overflow: auto; padding: 20px; color: #e5edf7; background: #111827; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.55; }
.source-module > section { margin: 0 0 30px; padding: clamp(18px, 3vw, 30px); background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.source-module > section:first-child { color: #fff; background: linear-gradient(135deg, #172033, #263f78); border: 0; }
.source-module > section:first-child h2, .source-module > section:first-child p { color: inherit; }
.source-module > section:first-child a { color: #dbeafe; }
.source-module [class*="grid-cols"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.source-module [class*="lg:grid-cols-3"], .source-module [class*="md:grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.source-module .reference-section [class*="grid-cols"] { grid-template-columns: 1fr !important; }
.source-module [class*="bg-white"], .source-module [class*="bg-slate-50"], .source-module [class*="bg-slate-800"] { padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.source-module input, .source-module select { width: 100%; min-height: 44px; margin-top: 5px; padding: 8px 10px; color: var(--ink); background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 7px; opacity: 1; }
.source-control-label { display: inline-flex; margin: 4px; padding: 7px 10px; color: #334155; background: #e9eef5; border-radius: 7px; font-size: .8rem; }
.module-divider { margin: 58px 0; border: 0; border-top: 4px solid var(--accent); }
.research-article :target { scroll-margin-top: 105px; }
a:focus-visible, summary:focus-visible, .table-scroll:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }
footer { padding: 25px 0; color: #dbe5f4; background: #172033; }
footer .shell { display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 900px) {
  .header-inner { align-items: flex-start; padding-block: 14px; }
  .header-inner nav { flex-wrap: wrap; }
  .research-layout { grid-template-columns: 1fr; }
  .article-toolbar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .article-toolbar .eyebrow { grid-column: 1 / -1; }
  .provenance { margin: 0; padding: 0; border: 0; }
  .merge-note { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { position: static; }
  .header-inner { display: block; }
  .brand { margin-bottom: 12px; }
  .header-inner nav { justify-content: flex-start; }
  .nav-submenu { min-width: min(290px, calc(100vw - 34px)); }
  .research-layout { padding-top: 20px; gap: 18px; }
  .article-toolbar { grid-template-columns: 1fr; }
  .article-toolbar .eyebrow, .merge-note { grid-column: auto; }
  .article-top-actions { justify-content: stretch; margin-bottom: 22px; }
  .pdf-download--top { width: 100%; }
  .research-article { padding: 22px 17px; border-radius: 14px; }
  .research-article > p:not(.article-subtitle):not(.print-original-link):not(.reference-entry) {
    text-align: left;
    hyphens: manual;
  }
  .source-module > section { padding: 16px 12px; }
  .source-module [class*="grid-cols"] { grid-template-columns: 1fr; }
  footer .shell { flex-direction: column; }
}

@media print {
  @page { size: A4; margin: 16mm; }
  body.research-page { color: #111; background: #fff; font-size: 10.5pt; }
  .skip-link, .site-header, .article-toolbar, .article-top-actions, footer, .source-control-label,
  .global-home-link, .global-top-button, .global-bottom-button,
  .global-analytics-preferences, #codex-browser-sidebar-comments-root { display: none !important; }
  .shell, .research-layout { width: 100%; display: block; padding: 0; }
  .research-article { padding: 0; border: 0; box-shadow: none; overflow: visible; }
  .research-article h1 { font-size: 23pt; }
  .research-article h2 { font-size: 16pt; break-after: avoid; }
  .research-article h3 { font-size: 13pt; break-after: avoid; }
  .ai-disclaimer { color: #111; background: #fff8e8; border-color: #b7791f; break-inside: avoid; }
  .print-original-link { display: block; margin: -1rem 0 2rem; font-size: 9pt; break-inside: avoid; }
  .research-article > .print-original-link:last-child { margin: 2rem 0 0; padding-top: .75rem; border-top: 1px solid #999; }
  .reference-list li { break-inside: avoid; }
  .source-module > section { break-inside: auto; box-shadow: none; }
  .source-module [class*="grid-cols"] { display: block; }
  .source-module [class*="grid-cols"] > * { margin-bottom: 10px; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; font-size: 8pt; }
  a { color: inherit; text-decoration: none; }
  pre { color: #111; background: #f1f3f5; border: 1px solid #bbb; font-size: 7.5pt; }
}
