:root {
  --ink: #17211d;
  --muted: #5d6963;
  --paper: #fbfbf7;
  --wash: #f1f4ed;
  --line: #dfe5da;
  --accent: #0f766e;
  --accent-dark: #0b4f4a;
  --amber: #b7791f;
  --blue: #1d4f91;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(23, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.42);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

section[id],
footer[id] {
  scroll-margin-top: 92px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 28px;
  align-items: stretch;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.09), transparent 48%),
    var(--white);
  box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.6rem, 7vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

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

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--white);
  background: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.button--secondary {
  color: var(--accent-dark);
  background: var(--white);
}

.page-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  margin: 14px 0 30px;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 251, 247, 0.92);
  box-shadow: 0 10px 28px rgba(23, 33, 29, 0.08);
  backdrop-filter: blur(14px);
  scrollbar-color: rgba(15, 118, 110, 0.32) transparent;
  scrollbar-width: thin;
}

.page-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.page-nav a:hover,
.page-nav a:focus-visible {
  background: var(--wash);
}

.nowrap {
  white-space: nowrap;
}

.metric-panel {
  display: grid;
  gap: 14px;
}

.metric-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
}

.metric-card--strong {
  border-color: rgba(183, 121, 31, 0.36);
  background: #fff7e8;
}

.metric-card__label,
.metric-card__unit,
.metric-card__status {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.metric-card strong {
  grid-column: 1 / -1;
  margin-top: 10px;
  font-size: clamp(3rem, 8vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.metric-card__status {
  justify-self: end;
  align-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
}

.action-strip {
  margin: 0 0 16px;
}

.action-strip h2,
.swap-section h2 {
  margin-bottom: 0;
}

.swap-section {
  margin: 36px 0 0;
}

.swap-section .swap-table {
  margin-top: 16px;
}

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

.action-card,
.explainer-card,
.meal-card,
.target-card,
.breakfast-card,
.visual-card,
.clinician-box {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.05);
}

.action-card {
  padding: 22px;
}

.action-card__number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 999px;
  color: var(--white);
  background: var(--accent);
  font-weight: 900;
}

.action-card p,
.explainer-card p,
.meal-card p,
.target-card p,
.visual-card p,
.clinician-box p {
  margin-bottom: 0;
  color: var(--muted);
}

.breakfast-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.breakfast-card,
.visual-card {
  padding: 26px;
}

.recipe-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.recipe-list div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.recipe-list dt {
  color: var(--accent-dark);
  font-size: 1.05rem;
  font-weight: 900;
}

.recipe-list dd {
  margin: 0;
}

.note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  color: #5a3c0b;
  background: #fff7e8;
}

.visual-card {
  display: grid;
  align-content: center;
  gap: 14px;
  background: var(--wash);
}

.explainer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.explainer-intro {
  padding: 18px 0;
}

.explainer-intro p {
  margin-bottom: 0;
  color: var(--muted);
}

.explainer-card {
  padding: 22px;
}

.explainer-card strong {
  color: var(--ink);
}

.explainer-card .formula {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--accent-dark);
  font-weight: 700;
}

.recipe-section {
  margin-top: 36px;
}

.recipe-section__intro,
.shopping-section__intro,
.target-section__intro {
  max-width: 760px;
  margin-bottom: 16px;
}

.recipe-section__intro p,
.shopping-section__intro p,
.target-section__intro p {
  margin-bottom: 0;
  color: var(--muted);
}

.shopping-section,
.target-section {
  margin-top: 36px;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.shopping-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.1fr) minmax(260px, 0.82fr);
  gap: 16px;
}

.meal-card {
  display: flex;
  min-height: 290px;
  flex-direction: column;
  padding: 20px;
}

.meal-card__tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--wash);
  font-size: 0.78rem;
  font-weight: 900;
}

.meal-card ul {
  display: grid;
  gap: 8px;
  margin: 6px 0 18px;
  padding-left: 18px;
  color: var(--muted);
}

.meal-card a {
  margin-top: auto;
  font-weight: 800;
}

.shopping-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.05);
}

.shopping-card--caution {
  background: #fff7e8;
  border-color: rgba(183, 121, 31, 0.28);
}

.product-list {
  display: grid;
  gap: 11px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.product-list strong {
  color: var(--ink);
}

.bowl-visual {
  position: relative;
  width: min(240px, 100%);
  height: 170px;
  margin: 4px auto 10px;
}

.bowl-visual__rim {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 28px;
  height: 74px;
  border: 12px solid #dfcda9;
  border-radius: 50%;
  background: #f6ead2;
}

.bowl-visual__body {
  position: absolute;
  left: 17%;
  right: 17%;
  bottom: 12px;
  height: 86px;
  border-radius: 0 0 82px 82px;
  background: linear-gradient(180deg, #f3f5f0, #dfe7df);
  border: 1px solid rgba(23, 33, 29, 0.14);
  overflow: hidden;
}

.bowl-visual__body span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #255f95;
}

.bowl-visual__body span:nth-child(1) {
  left: 26px;
  top: 20px;
}

.bowl-visual__body span:nth-child(2) {
  left: 72px;
  top: 28px;
  background: #8b2f4b;
}

.bowl-visual__body span:nth-child(3) {
  right: 34px;
  top: 18px;
}

.bowl-visual__body span:nth-child(4) {
  right: 70px;
  bottom: 26px;
  background: #8b2f4b;
}

.bowl-visual__body span:nth-child(5) {
  left: 50%;
  bottom: 18px;
  background: #255f95;
}

.swap-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
}

.swap-table table {
  width: 100%;
  border-collapse: collapse;
}

.swap-table th,
.swap-table td {
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.swap-table thead th {
  border-top: 0;
  color: var(--white);
  background: var(--ink);
  font-weight: 900;
}

.swap-table td:first-child {
  color: var(--muted);
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.target-card {
  padding: 20px;
}

.target-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.target-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 1.55rem;
  line-height: 1;
}

.clinician-box {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-top: 16px;
  padding: 26px;
  background: #eef5fb;
}

.clinician-box ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.source-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.source-footer h2 {
  margin: 18px 0 10px;
  color: var(--ink);
  font-size: 1rem;
}

.source-groups {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 32px;
}

.source-footer ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
}

.source-footer li {
  break-inside: avoid;
  margin-bottom: 7px;
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 22px, 720px);
    padding-top: 12px;
  }

  .hero,
  .breakfast-layout,
  .explainer-grid,
  .recipe-grid,
  .shopping-grid,
  .source-groups,
  .clinician-box {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
    border-radius: 22px;
  }

  .action-grid,
  .target-grid {
    grid-template-columns: 1fr;
  }

  .metric-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: auto;
    padding: 14px;
    border-radius: 16px;
  }

  .metric-card strong {
    font-size: clamp(2.4rem, 14vw, 3.3rem);
  }

  .metric-card__status {
    padding: 4px 7px;
    font-size: 0.72rem;
  }

  .page-nav {
    margin-bottom: 20px;
    border-radius: 18px;
  }

  .swap-table th,
  .swap-table td {
    padding: 12px;
  }

  .source-footer ul {
    columns: 1;
  }
}

@media print {
  :root {
    --paper: #ffffff;
    --shadow: none;
  }

  body {
    background: #ffffff;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .hero,
  .action-card,
  .meal-card,
  .shopping-card,
  .target-card,
  .breakfast-card,
  .visual-card,
  .clinician-box,
  .swap-table {
    box-shadow: none;
  }

  .hero,
  .action-grid,
  .breakfast-layout,
  .recipe-grid,
  .shopping-grid,
  .target-grid,
  .clinician-box {
    break-inside: avoid;
  }

  a {
    color: #000000;
    text-decoration: none;
  }
}
