:root {
  --bg: #eef3f6;
  --paper: #ffffff;
  --ink: #15212c;
  --muted: #60717c;
  --line: #d6e0e5;
  --blue: #064f97;
  --yellow: #ffea00;
  --red: #c9362f;
  --teal: #167c68;
  --amber: #b56c16;
  --violet: #6457a6;
  --shadow: 0 18px 60px rgba(25, 38, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(6, 79, 151, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 79, 151, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(201, 54, 47, 0.1), transparent 34%),
    linear-gradient(115deg, rgba(22, 124, 104, 0.13), transparent 56%),
    #fbfdfe;
}

.hero__inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 315px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 42px;
  align-items: center;
  padding: 34px 0 42px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 66px;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.hero__meta {
  max-width: 520px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.report-facts {
  margin: 0;
  display: grid;
  gap: 10px;
}

.report-facts div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.report-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-facts dd {
  margin: 0;
  font-weight: 700;
}

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

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card,
.mini-panel,
.metric-card,
.insight-card,
.plan-card,
.medical-note,
.faq-card,
.comparison-note,
.comparison-table-wrap {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 126px;
  padding: 18px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--accent, var(--blue));
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  line-height: 1;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.insight-board,
.action-plan,
.faq-section,
.comparison-section {
  margin-bottom: 30px;
}

.section-lead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
}

.section-lead h2 {
  max-width: 780px;
  margin-bottom: 0;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 14px;
}

.insight-card,
.plan-card {
  border-radius: 8px;
  padding: 18px;
}

.insight-card {
  min-height: 242px;
}

.insight-card.is-priority {
  border-color: rgba(201, 54, 47, 0.42);
  background:
    linear-gradient(135deg, rgba(201, 54, 47, 0.09), transparent 54%),
    rgba(255, 255, 255, 0.96);
}

.insight-card span,
.plan-card span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-card.is-priority span {
  background: var(--red);
}

.insight-card h3,
.plan-card h3 {
  margin: 14px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.08;
}

.insight-card p,
.plan-card li,
.medical-note {
  color: var(--muted);
  line-height: 1.5;
}

.signal-list,
.plan-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.signal-list li + li,
.plan-card li + li {
  margin-top: 8px;
}

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

.plan-card {
  min-height: 328px;
}

.plan-card:nth-child(1) span {
  background: var(--red);
}

.plan-card:nth-child(2) span {
  background: var(--teal);
}

.plan-card:nth-child(3) span {
  background: var(--violet);
}

.medical-note {
  margin: 14px 0 0;
  border-radius: 8px;
  padding: 14px 16px;
  border-left: 6px solid var(--amber);
}

.faq-card {
  border-radius: 8px;
  overflow: hidden;
}

.faq-card + .faq-card {
  margin-top: 14px;
}

.faq-card summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.faq-card summary::after {
  content: "+";
  width: 30px;
  height: 30px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1;
}

.faq-card[open] summary::after {
  content: "-";
}

.faq-answer {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.supplement-verdict {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 8px;
  background: rgba(22, 124, 104, 0.09);
}

.supplement-verdict span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.food-verdict {
  background: rgba(181, 108, 22, 0.1);
}

.food-verdict span {
  background: var(--amber);
}

.exercise-verdict {
  background: rgba(100, 87, 166, 0.1);
}

.exercise-verdict span {
  background: var(--violet);
}

.food-grid article {
  min-height: 250px;
}

.exercise-grid article {
  min-height: 250px;
}

.supplement-verdict p,
.faq-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.dose-grid article {
  min-height: 270px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dose-grid h3 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.dose-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.dose-grid li + li {
  margin-top: 8px;
}

.faq-note {
  border-left: 6px solid var(--blue);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f3f7f8;
}

.focus {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.comparison-note {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 14px;
}

.comparison-note span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.comparison-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.comparison-table-wrap {
  border-radius: 8px;
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: #fff;
}

.comparison-table caption {
  padding: 14px 16px;
  caption-side: top;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.comparison-table th,
.comparison-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.35;
}

.comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--ink);
  background: #f5f9fb;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.comparison-table tbody th {
  width: 190px;
  font-weight: 900;
}

.comparison-table code {
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.comparison-table tbody tr:hover {
  background: rgba(6, 79, 151, 0.04);
}

.table-index {
  width: 46px;
  color: var(--muted);
  font-weight: 900;
}

.result-cell {
  font-weight: 900;
}

.result-cell.is-flagged {
  color: var(--red);
}

.table-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #fff;
  background: var(--teal);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.table-status.high,
.table-status.abnormal {
  background: var(--red);
}

.table-status.low {
  background: var(--amber);
}

.focus__copy {
  padding: 20px 0;
}

.focus__copy p:last-child {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.focus__charts {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
}

.mini-panel {
  min-height: 310px;
  border-radius: 8px;
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cluster-chart {
  display: grid;
  gap: 12px;
  padding-top: 18px;
}

.cluster-row {
  display: grid;
  grid-template-columns: 86px 1fr 24px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.cluster-track,
.lipid-track,
.range-track {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef2;
}

.cluster-track {
  height: 12px;
}

.cluster-fill {
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: var(--accent);
}

.lipid-chart {
  display: grid;
  gap: 13px;
  padding-top: 18px;
}

.lipid-row {
  display: grid;
  grid-template-columns: 130px 1fr 54px;
  gap: 10px;
  align-items: center;
}

.lipid-row strong {
  font-size: 13px;
}

.lipid-row span {
  text-align: right;
  font-weight: 800;
}

.lipid-track {
  height: 15px;
}

.lipid-fill {
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: var(--accent);
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-bottom: 20px;
  padding: 14px 0;
  backdrop-filter: blur(14px);
  background: rgba(238, 243, 246, 0.84);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.tab-button,
.tool-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tab-button {
  padding: 0 14px;
}

.tab-button[aria-selected="true"] {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.tab-button .badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  border-radius: 999px;
  color: var(--red);
  background: rgba(201, 54, 47, 0.12);
}

.tab-button[aria-selected="true"] .badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.search {
  min-width: 280px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.search svg,
.tool-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.tool-button.is-active {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.results {
  display: grid;
  gap: 28px;
}

.category-block {
  scroll-margin-top: 150px;
}

.category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.category-heading h2 {
  margin-bottom: 0;
  font-size: 28px;
}

.category-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.metric-card {
  position: relative;
  min-height: 228px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 8px;
  padding: 16px;
}

.metric-card.is-flagged {
  border-color: rgba(201, 54, 47, 0.48);
  box-shadow: 0 18px 50px rgba(201, 54, 47, 0.14);
}

.metric-card.is-flagged:hover,
.metric-card.is-flagged:focus-within {
  z-index: 20;
}

.metric-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.metric-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill {
  height: 25px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #fff;
  background: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.high,
.status-pill.abnormal {
  background: var(--red);
}

.status-pill.low {
  background: var(--amber);
}

.status-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flag-info {
  position: relative;
  display: inline-flex;
}

.flag-help {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(201, 54, 47, 0.24);
  border-radius: 999px;
  color: var(--red);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.flag-help:focus-visible {
  outline: 3px solid rgba(6, 79, 151, 0.24);
  outline-offset: 2px;
}

.flag-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 44px));
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(21, 33, 44, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 22px 70px rgba(25, 38, 48, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 30;
}

.flag-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 12px;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(21, 33, 44, 0.16);
  border-top: 1px solid rgba(21, 33, 44, 0.16);
  background: #fff;
  transform: rotate(45deg);
}

.flag-popover strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.12;
}

.flag-popover span,
.flag-popover em,
.flag-popover li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.flag-popover em {
  display: block;
  font-style: normal;
  color: var(--ink);
  font-weight: 900;
}

.flag-popover ul {
  margin: -2px 0 0;
  padding-left: 17px;
}

.flag-popover li + li {
  margin-top: 4px;
}

.metric-card.is-flagged:hover .flag-popover,
.metric-card.is-flagged:focus-within .flag-popover,
.flag-info:hover .flag-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.metric-name {
  min-height: 44px;
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-value strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 0.95;
}

.metric-value span {
  color: var(--muted);
  font-weight: 800;
}

.metric-ref {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.range-wrap {
  margin-top: auto;
}

.range-track {
  height: 18px;
}

.range-normal {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--normal-left);
  width: var(--normal-width);
  background: rgba(22, 124, 104, 0.28);
}

.range-marker {
  position: absolute;
  top: -4px;
  left: var(--marker);
  width: 4px;
  height: 26px;
  border-radius: 999px;
  background: var(--marker-color, var(--ink));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.qualitative-result {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f3f7f8;
}

.qualitative-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qualitative-result strong {
  font-size: 18px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-weight: 800;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.footer a {
  color: var(--blue);
  text-decoration-thickness: 2px;
}

@media (max-width: 1020px) {
  .hero__inner,
  .focus {
    grid-template-columns: 1fr;
  }

  .hero__inner {
    min-height: auto;
  }

  .summary,
  .focus__charts,
  .metrics-grid,
  .insight-grid,
  .plan-grid,
  .dose-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .hero__inner,
  main,
  .footer {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: 43px;
  }

  h2 {
    font-size: 26px;
  }

  .summary,
  .focus__charts,
  .metrics-grid,
  .insight-grid,
  .plan-grid,
  .dose-grid {
    grid-template-columns: 1fr;
  }

  .faq-card summary {
    align-items: start;
    padding: 16px;
    font-size: 20px;
  }

  .supplement-verdict {
    grid-template-columns: 1fr;
  }

  .comparison-note {
    grid-template-columns: 1fr;
  }

  .section-lead {
    align-items: start;
    flex-direction: column;
  }

  .report-facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search {
    min-width: 100%;
  }

  .tool-button {
    flex: 1;
    justify-content: center;
  }

  .category-heading {
    align-items: start;
    flex-direction: column;
  }

  .footer {
    flex-direction: column;
  }
}

@media print {
  body {
    background: #fff;
  }

  .controls,
  .footer {
    display: none;
  }

  .hero__inner,
  main {
    width: 100%;
  }

  .hero__inner {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 20px 0;
  }

  .report-facts {
    display: none;
  }

  .summary,
  .metrics-grid,
  .insight-grid,
  .plan-grid,
  .dose-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card,
  .mini-panel,
  .metric-card,
  .insight-card,
  .plan-card,
  .medical-note,
  .faq-card,
  .comparison-note,
  .comparison-table-wrap {
    break-inside: avoid;
    box-shadow: none;
  }
}
