:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --paper: #fffefa;
  --ink: #1e2528;
  --muted: #667176;
  --line: #d8ddd8;
  --accent: #255f68;
  --accent-soft: #e1eff0;
  --warn: #7a4b18;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
}

body::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, #255f68, #7a4b18, #3f6f48);
}

main,
.page {
  width: min(920px, calc(100vw - 32px));
  margin: 0 auto;
}

.page {
  padding: 36px 0 72px;
}

.notice {
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  background: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.notice strong {
  color: var(--accent);
}

.toplinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.toplinks a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-soft);
  color: #123b42;
  text-decoration: none;
  font-size: 14px;
}

article {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 48px);
  box-shadow: 0 18px 40px rgb(30 37 40 / 0.07);
}

h1,
h2,
h3 {
  line-height: 1.18;
  color: #172022;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(38px, 7vw, 72px);
  letter-spacing: 0;
}

h2 {
  margin-top: 46px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: clamp(25px, 4vw, 36px);
  letter-spacing: 0;
}

h1 + h2 {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
  color: var(--accent);
}

h3 {
  margin-top: 30px;
  font-size: 23px;
}

p {
  margin: 0 0 1.05em;
}

ul,
ol {
  padding-left: 1.35em;
}

li {
  margin: 0.35em 0;
}

a {
  color: var(--accent);
}

blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--accent);
  color: #334044;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}

th {
  background: #edf2ef;
  text-align: left;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f0f1ec;
  padding: 0.12em 0.28em;
  border-radius: 4px;
}

.source-note {
  padding: 11px 13px;
  border-left: 4px solid #8f5bbd;
  background: #f8f1ff;
  color: #38234f;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92em;
  line-height: 1.5;
}

.provenance-legend {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 28px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fbfbf7;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.provenance-legend strong {
  display: block;
  margin-bottom: 4px;
}

.legend-article strong,
.origin-article .origin-label {
  color: #9b1c1c;
}

.legend-kg strong,
.origin-kg .origin-label {
  color: #6d28d9;
}

.legend-synthesis strong,
.origin-synthesis .origin-label {
  color: #1d4ed8;
}

.origin-block {
  position: relative;
  margin: 0 0 1.05em;
  padding: 12px 14px 12px 16px;
  border-left: 5px solid transparent;
}

.origin-block p:last-child,
.origin-block ul:last-child,
.origin-block ol:last-child,
.origin-block table:last-child {
  margin-bottom: 0;
}

.origin-label {
  display: block;
  margin-bottom: 6px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.origin-article {
  border-left-color: #dc2626;
  background: #fff1f2;
}

.origin-kg {
  border-left-color: #7c3aed;
  background: #f6efff;
}

.origin-synthesis {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.origin-meta {
  border-left-color: #7a4b18;
  background: #fff7ed;
}

.foot {
  margin-top: 22px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  article {
    padding: 20px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }

  .provenance-legend {
    grid-template-columns: 1fr;
  }
}
