/* Simple Insulin & Diabetes Care Guide — local stylesheet */
:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --ink: #15212e;
  --ink-soft: #4a5b6b;
  --muted: #6c7d8c;
  --line: #e2eaf1;
  --brand: #0f7d6b;
  --brand-dark: #0a5a4d;
  --brand-soft: #e6f4f1;
  --accent: #2563a8;
  --accent-soft: #e8f0fa;
  --warn: #b4541a;
  --warn-soft: #fdf1e7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,40,60,.06), 0 8px 24px rgba(16,40,60,.06);
  --shadow-sm: 0 1px 2px rgba(16,40,60,.05), 0 4px 12px rgba(16,40,60,.05);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.22; color: var(--ink); font-weight: 700; }
h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 .5em; }
h3 { font-size: clamp(18px, 2.4vw, 21px); margin: 0 0 .4em; }
p { margin: 0 0 1em; color: var(--ink-soft); }
ul, ol { color: var(--ink-soft); padding-left: 1.25em; }
li { margin-bottom: .4em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 64px 0; }
.section--tight { padding: 44px 0; }

/* Skip link */
.skip {
  position: absolute; left: -999px; top: 0; background: var(--brand);
  color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; }

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; color: var(--ink); font-size: 18px; letter-spacing: -.2px; }
.brand:hover { text-decoration: none; }
.brand .mark { flex: none; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); }

/* Disclaimer banner */
.disclaimer-bar {
  background: var(--warn-soft);
  border-bottom: 1px solid #f1ddc9;
  color: #7a3f12;
  font-size: 14px;
}
.disclaimer-bar .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.disclaimer-bar svg { flex: none; }
.disclaimer-bar strong { color: #6a3710; }

/* Hero */
.hero { position: relative; background:
    radial-gradient(900px 500px at 88% -10%, var(--brand-soft) 0%, rgba(230,244,241,0) 60%),
    radial-gradient(700px 400px at 0% 110%, var(--accent-soft) 0%, rgba(232,240,250,0) 55%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 72px 0 64px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.8px; margin: 0 0 .45em; }
.hero .lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-soft); max-width: 36ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; font-size: 13px; letter-spacing: .4px; text-transform: uppercase; padding: 6px 13px; border-radius: 999px; margin-bottom: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15.5px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--surface); color: var(--brand-dark); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }

/* Hero illustration card */
.hero-art { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 26px; }
.hero-art h3 { font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 18px; }
.glucose-chart { width: 100%; height: auto; border-radius: 12px; background: linear-gradient(180deg, #fbfdff, #f3f8fc); }

/* Generic cards grid */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .14s ease, box-shadow .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.ico--brand { background: var(--brand-soft); color: var(--brand-dark); }
.ico--accent { background: var(--accent-soft); color: var(--accent); }
.ico--warn { background: var(--warn-soft); color: var(--warn); }
.card h3 a { color: var(--ink); }
.card p:last-child { margin-bottom: 0; }
.card .more { font-weight: 600; font-size: 14.5px; color: var(--brand-dark); display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; }

.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head p { font-size: 18px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Insulin types table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table.info { width: 100%; border-collapse: collapse; min-width: 560px; }
table.info th, table.info td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
table.info thead th { background: var(--brand-soft); color: var(--brand-dark); font-size: 13.5px; text-transform: uppercase; letter-spacing: .4px; }
table.info tbody tr:last-child td { border-bottom: none; }
table.info td:first-child { font-weight: 600; color: var(--ink); }

/* Steps / care team */
.steps { display: grid; gap: 18px; counter-reset: step; }
.step { display: grid; grid-template-columns: 46px 1fr; gap: 18px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.step .num { counter-increment: step; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.step h3 { margin-bottom: .25em; }
.step p { margin-bottom: 0; }

/* Safety callouts */
.flag-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.flag-list li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); margin: 0; color: var(--ink-soft); }
.flag-list .x { color: var(--warn); font-weight: 700; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); margin: 0; color: var(--ink-soft); }
.check-list .v { color: var(--brand); font-weight: 700; }

/* CTA / verify pharmacy band */
.band { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #eafdf8; border-radius: 22px; padding: 44px; box-shadow: var(--shadow); }
.band h2 { color: #fff; }
.band p { color: #cdeee7; }
.band .btn-primary { background: #fff; color: var(--brand-dark); }
.band .btn-primary:hover { background: #eafdf8; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 22px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; color: var(--ink); padding: 18px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; color: var(--brand); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .answer { padding: 16px 0 20px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* Prose pages */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(26px, 4vw, 48px); box-shadow: var(--shadow-sm); }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.3em; }
.prose ul { margin-bottom: 1.2em; }
.page-hero { padding: 52px 0 8px; }
.page-hero .eyebrow { margin-bottom: 14px; }
.page-hero h1 { font-size: clamp(28px, 4.4vw, 40px); letter-spacing: -.6px; margin: 0 0 .4em; }
.page-hero .lead { font-size: 19px; color: var(--ink-soft); max-width: 60ch; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.callout { background: var(--accent-soft); border: 1px solid #d4e3f4; border-radius: var(--radius-sm); padding: 18px 22px; margin: 1.4em 0; }
.callout p { margin: 0; color: #244b73; }
.callout strong { color: #1b3a5b; }
.note-warn { background: var(--warn-soft); border: 1px solid #f1ddc9; border-radius: var(--radius-sm); padding: 18px 22px; margin: 1.4em 0; }
.note-warn p { margin: 0; color: #7a3f12; }

/* Sources */
.sources { font-size: 14.5px; color: var(--muted); }
.sources li { margin-bottom: .5em; }

/* ============ ENRICHMENT COMPONENTS ============ */

/* In-page sticky table of contents */
.layout { display: grid; grid-template-columns: 232px 1fr; gap: 44px; align-items: start; }
.toc { position: sticky; top: 84px; align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 20px; box-shadow: var(--shadow-sm); font-size: 14px; max-height: calc(100vh - 104px); overflow-y: auto; }
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 12px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a { display: block; color: var(--ink-soft); padding: 6px 10px; border-radius: 7px; border-left: 2px solid transparent; line-height: 1.35; font-weight: 500; }
.toc a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.toc a.active { background: var(--brand-soft); color: var(--brand-dark); border-left-color: var(--brand); font-weight: 600; }
.toc .toc-note { margin: 14px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Anchored content sections so the sticky header doesn't hide titles */
.content-section { scroll-margin-top: 86px; padding: 0 0 48px; }
.content-section + .content-section { border-top: 1px solid var(--line); padding-top: 44px; }
.content-section > h2 { font-size: clamp(23px, 3vw, 30px); display: flex; align-items: center; gap: 12px; margin-bottom: .35em; }
.content-section > h2 .kicker { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.content-section .lead-p { font-size: 18px; color: var(--ink-soft); max-width: 68ch; }
.content-section h3 { margin-top: 1.4em; }

/* Strong medical alert box (red) */
.alert { background: #fdeceb; border: 1px solid #f4c6c2; border-left: 4px solid #c0392b; border-radius: var(--radius-sm); padding: 18px 20px; margin: 1.4em 0; }
.alert p { margin: 0 0 .5em; color: #7d251c; }
.alert p:last-child { margin-bottom: 0; }
.alert strong { color: #6a1f17; }
.alert .alert-title { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #8e271d; margin-bottom: .5em; }
.alert .alert-title svg { flex: none; }

/* Stat strip "at a glance" */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 6px 0 4px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 18px; box-shadow: var(--shadow-sm); }
.stat .n { font-size: 26px; font-weight: 700; color: var(--brand-dark); line-height: 1.1; letter-spacing: -.5px; }
.stat .l { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* Comparison/data tables (extends table.info) */
table.info.compact th, table.info.compact td { padding: 11px 14px; font-size: 14.5px; }
table.info td .brands { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
table.info .rowhead { background: var(--brand-soft); }
table.info caption { caption-side: bottom; text-align: left; font-size: 13px; color: var(--muted); padding: 12px 4px 0; line-height: 1.5; }
.tbl-min-720 { min-width: 720px; }
.tbl-min-640 { min-width: 640px; }

/* Two-up panels (e.g. hypo vs hyper, pros/cons) */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.panel.is-low { border-top: 4px solid var(--accent); }
.panel.is-high { border-top: 4px solid var(--warn); }
.panel h3 { margin-top: 0; display: flex; align-items: center; gap: 9px; }
.panel ul { margin: 0; }
.panel ul li { margin-bottom: .45em; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.tag.low { background: var(--accent-soft); color: var(--accent); }
.tag.high { background: var(--warn-soft); color: var(--warn); }

/* Pros/cons list */
.pc { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.pc li { display: grid; grid-template-columns: 20px 1fr; gap: 9px; margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.pc .pro { color: var(--brand); font-weight: 700; }
.pc .con { color: var(--warn); font-weight: 700; }

/* Definition / key-value rows (storage, etc.) */
.deflist { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.deflist > div { display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.deflist > div:last-child { border-bottom: none; }
.deflist dt { font-weight: 600; color: var(--ink); margin: 0; }
.deflist dd { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* Rule of 15 steps (horizontal) */
.r15 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 0; counter-reset: r; }
.r15 .s { background: var(--accent-soft); border: 1px solid #d4e3f4; border-radius: var(--radius-sm); padding: 18px 16px; position: relative; }
.r15 .s b { display: block; color: var(--accent); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.r15 .s p { margin: 0; font-size: 14.5px; color: #244b73; }

/* Glossary */
.glossary { columns: 2; column-gap: 36px; }
.glossary dl { margin: 0; }
.glossary div { break-inside: avoid; margin-bottom: 16px; }
.glossary dt { font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.glossary dd { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* Cost cards */
.cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Mini chips list */
.chips { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { margin: 0; background: var(--brand-soft); color: var(--brand-dark); font-size: 13.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }

/* Source references grid */
.ref-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; list-style: none; padding: 0; margin: 18px 0 0; }
.ref-grid li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); font-size: 14.5px; color: var(--ink-soft); }
.ref-grid b { color: var(--ink); display: block; margin-bottom: 2px; }

/* Footer */
.site-footer { background: #0e1a22; color: #aec2cd; padding: 56px 0 28px; margin-top: 8px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.site-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 16px; }
.site-footer a { color: #aec2cd; }
.site-footer a:hover { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand .brand small { color: #7e93a0; }
.footer-brand p { color: #91a6b2; font-size: 15px; max-width: 42ch; }
.footer-disclaimer { font-size: 13.5px; color: #7e93a0; border-top: 1px solid #1c2c36; padding-top: 22px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13.5px; color: #7e93a0; margin-top: 22px; }

/* Responsive */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; padding: 48px 0; }
  .hero-art { order: -1; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .nav-links { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 18px 16px; box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .22s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 13px 8px; border-radius: 8px; font-size: 16px; }
  .nav-toggle { display: inline-flex; }
  .band { padding: 32px 26px; }
  /* enrichment responsive */
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; margin-bottom: 30px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .duo { grid-template-columns: 1fr; }
  .r15 { grid-template-columns: 1fr 1fr; }
  .glossary { columns: 1; }
  .cost-grid { grid-template-columns: 1fr; }
  .ref-grid { grid-template-columns: 1fr; }
  .deflist > div { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .section { padding: 48px 0; }
  .brand small { display: none; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .r15 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
