:root {
  --ink: #1c2430;
  --muted: #5c6b7a;
  --line: #d7dfd8;
  --paper: #f3f6f2;
  --card: #ffffff;
  --pine: #1f4d3a;
  --pine-dark: #163828;
  --focus: #0f6e56;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 "Segoe UI", "Palatino Linotype", Georgia, sans-serif;
}

a { color: var(--pine); }

.site-header {
  background: var(--pine-dark);
  color: #f4f7f4;
}

.header-inner,
main {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 650;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #d8efe3;
  color: var(--pine-dark);
  font-size: 13px;
}

.sign-out {
  display: flex;
  align-items: center;
  gap: 12px;
}

.signed-in { color: #d5e6dc; font-size: 14px; }

main { padding: 28px 0 64px; }

.panel,
.sample-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.panel + .panel,
.stats,
.notice,
.banner { margin-top: 16px; }

.narrow { width: min(460px, 100%); margin: 24px auto 0; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--focus);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.2; }
h2 { margin: 0; font-size: 20px; }

.lede { color: var(--muted); }

label { display: grid; gap: 6px; font-weight: 600; }

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

button,
.button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: #e7eee9;
  color: var(--pine-dark);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

button.primary,
.button {
  background: var(--pine);
  color: white;
}

.stack { display: grid; gap: 14px; margin-top: 18px; }

.sample-box { margin-top: 18px; background: #f7faf8; }
.sample-box h2 { font-size: 16px; }
.sample-box ul { margin: 8px 0 0; padding-left: 18px; }
code { font-family: Consolas, "Courier New", monospace; font-size: 14px; }

.notice,
.banner {
  border-radius: 12px;
  padding: 12px 14px;
}

.notice { background: #e7f2ea; color: var(--pine-dark); }
.banner.error { background: #fde8e4; color: #8a2e24; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.facts div { margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 2px 0 0; font-weight: 650; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stats article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}

.stats p,
.stats span { margin: 0; color: var(--muted); }
.stats strong { display: block; margin: 4px 0; font-size: 28px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.text-link { font-weight: 650; }

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.category {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.category.selected { border-color: var(--pine); background: #f3faf6; }
.category strong { font-size: 24px; }
.category small { color: var(--muted); }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 650; }

.risk {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2f4;
  font-size: 14px;
}

.risk-high-risk { background: #f8d7d2; color: #8a2e24; }
.risk-moderate-risk { background: #f8e7c8; color: #7a4b10; }
.risk-low-risk { background: #e7eef8; color: #23406e; }
.risk-protective { background: #d9f0e3; color: #1d5c3b; }
.risk-neutral { background: #eceff1; }

td small { display: block; color: var(--muted); }

@media (max-width: 720px) {
  .facts,
  .stats { grid-template-columns: 1fr 1fr; }
  .header-inner { align-items: flex-start; padding: 12px 0; }
  .sign-out { flex-direction: column; align-items: flex-end; }
}
