:root {
  color-scheme: light;
  --ink: #16201a;
  --muted: #5b665f;
  --line: #d9dfd7;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --green: #1f7a4d;
  --blue: #245a92;
  --gold: #b9831f;
  --shadow: 0 18px 40px rgba(26, 34, 28, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.96);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--muted); font-weight: 650; text-decoration: none; }
nav a[aria-current="page"] { color: var(--green); }

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 28px;
}

.page {
  width: min(980px, calc(100% - 40px));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
}

h1, h2 { margin: 0; line-height: 1.08; }
h1 { max-width: 920px; font-size: clamp(2.2rem, 4vw, 4.9rem); }
h2 { font-size: 1.35rem; }

.lede {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  color: var(--green);
  font-size: 2rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 650;
}

.compact .metric { min-height: 100px; box-shadow: none; }

.panel, .card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel { padding: 24px; margin-top: 24px; }
.section-heading { margin-bottom: 20px; }

.bars { display: grid; gap: 14px; }

.bar-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1fr) 50px;
  gap: 14px;
  align-items: center;
  min-height: 28px;
}

.bar-row span, .bar-row em { color: var(--muted); font-style: normal; font-weight: 700; }
.track { height: 14px; border-radius: 999px; background: #e8ede7; overflow: hidden; }
.track b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold)); }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.sidecar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.sidecar {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf6;
  color: var(--ink);
  text-decoration: none;
}

.sidecar strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
}

.sidecar span {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.card { padding: 22px; }
li { margin: 10px 0; color: var(--muted); line-height: 1.45; }
.link-list { padding-left: 20px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--green); font-size: 0.82rem; text-transform: uppercase; }
td { color: var(--muted); }

.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.definition {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.definition strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.definition span {
  color: var(--muted);
  line-height: 1.45;
}

.code-block {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2eb;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

.callout {
  margin-top: 20px;
  padding: 18px;
  border-left: 4px solid var(--gold);
  background: #fff9ec;
  color: var(--muted);
  line-height: 1.55;
}

footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 20px; }
  main, .page { width: min(100% - 28px, 980px); padding-top: 28px; }
  .overview, .split { grid-template-columns: 1fr; }
  .sidecar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .definition-list { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 88px minmax(80px, 1fr) 42px; gap: 10px; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr; }
  .sidecar-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  footer { flex-direction: column; align-items: center; }
}
