/* Tokens ---------------------------------------------------------------- */
:root {
  --paper: #FAF7F0;
  --surface: #FFFFFF;
  --sunk: #F2EDE0;
  --ink: #18261F;
  --muted: #55625A;
  --line: #DED8C8;
  --pine: #1C4A38;
  --on-pine: #F5F2E7;
  --on-pine-soft: #C5D4CA;
  --accent: #B3401C;
  --butter: #F7EDCC;
  --butter-line: #E6D69C;
  --rose: #FBEAE3;
  --rose-line: #EBC2B1;
  --sage: #E6EFE7;
  --sage-line: #BED2C2;
  --plate-veg: #BFD9B4;
  --plate-pro: #EDB8A0;
  --plate-carb: #EFD98F;
  --plate-ink: #18261F;
  --shadow: 0 10px 30px rgba(24, 38, 31, .1);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111713; --surface: #18201B; --sunk: #1E2822; --ink: #ECE9DE; --muted: #A6B1A9;
    --line: #2E3A33; --pine: #143628; --on-pine: #ECE9DE; --on-pine-soft: #A9BDB0; --accent: #F0875F;
    --butter: #2C2813; --butter-line: #4D4520; --rose: #2E1C15; --rose-line: #55352A;
    --sage: #1B2A21; --sage-line: #33493B; --shadow: 0 10px 30px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111713; --surface: #18201B; --sunk: #1E2822; --ink: #ECE9DE; --muted: #A6B1A9;
  --line: #2E3A33; --pine: #143628; --on-pine: #ECE9DE; --on-pine-soft: #A9BDB0; --accent: #F0875F;
  --butter: #2C2813; --butter-line: #4D4520; --rose: #2E1C15; --rose-line: #55352A;
  --sage: #1B2A21; --sage-line: #33493B; --shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.55 var(--sans); overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.14; margin: 0; font-optical-sizing: auto; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 1.25em; height: 1.25em; flex: none; }
.ico-lg { width: 44px; height: 44px; color: var(--accent); }

/* Header ---------------------------------------------------------------- */
.site-head { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 22px; min-height: 66px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; font: 600 1.6rem/1 var(--serif); text-decoration: none; color: var(--pine); letter-spacing: -.01em; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand { color: var(--ink); } }
:root[data-theme="dark"] .brand { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 20px; font-size: 1rem; }
.nav a, .nav summary { text-decoration: none; cursor: pointer; padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover, .nav summary:hover, .nav a[aria-current] { border-bottom-color: var(--accent); }
.topics { position: relative; }
.topics summary { list-style: none; }
.topics summary::-webkit-details-marker { display: none; }
.topics summary::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.topics-panel { position: absolute; top: calc(100% + 10px); left: -14px; width: 300px; list-style: none; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.topics-panel a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 0; border-radius: 6px; white-space: normal; }
.topics-panel a:hover { background: var(--sunk); }
.topics-panel .ico { color: var(--accent); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 5px 12px; cursor: pointer; }

/* Search ---------------------------------------------------------------- */
.search { position: relative; display: flex; align-items: center; gap: 8px; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; width: 210px; color: var(--muted); }
.search input { border: 0; background: none; outline: none; padding: 8px 0; width: 100%; min-width: 0; color: var(--ink); }
.search:focus-within { border-color: var(--pine); box-shadow: 0 0 0 1px var(--pine); }
.search-hero { margin: 26px 0 0; width: 100%; max-width: 560px; padding: 4px 4px 4px 14px; box-shadow: var(--shadow); }
.search-hero input { padding: 10px 0; }
.search-hero button { background: var(--pine); color: var(--on-pine); border: 0; border-radius: 6px; padding: 10px 18px; cursor: pointer; }
.search-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 40; overflow: hidden; color: var(--ink); }
.site-head .search-pop { left: auto; width: 380px; }
.search-pop a { display: block; padding: 10px 14px; text-decoration: none; border-bottom: 1px solid var(--line); }
.search-pop a:last-child { border-bottom: 0; }
.search-pop a:hover, .search-pop a.sel { background: var(--sunk); }
.search-pop strong { display: block; font-weight: 700; }
.search-pop small { color: var(--muted); }

/* Hero ------------------------------------------------------------------ */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding-block: clamp(36px, 6vw, 76px) clamp(28px, 4vw, 48px); align-items: start; }
.hero h1 { font-size: clamp(2.35rem, 5.4vw, 4.1rem); letter-spacing: -.02em; line-height: 1.04; color: var(--pine); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero h1 { color: var(--ink); } }
:root[data-theme="dark"] .hero h1 { color: var(--ink); }
.hero-sub { margin-top: 20px; font-size: clamp(1.06rem, 1.5vw, 1.22rem); color: var(--muted); max-width: 54ch; }
.hero-paths { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 8px 10px; }
.hero-paths h2 { font-size: 1.3rem; padding: 0 14px 12px; }
.hero-paths ol { list-style: none; }
.hero-paths a { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: baseline; padding: 11px 14px; text-decoration: none; border-top: 1px solid var(--line); }
.hero-paths a:hover { background: var(--sunk); }
.pn { font: 500 1.1rem/1 var(--serif); color: var(--accent); }
.pt { font-weight: 700; }
.pc { font-size: .85rem; color: var(--muted); white-space: nowrap; }

.stats { display: flex; flex-wrap: wrap; gap: 8px clamp(22px, 5vw, 56px); padding-block: 16px; border-block: 1px solid var(--line); margin-bottom: clamp(36px, 5vw, 60px); color: var(--muted); }
.stats b { font: 500 1.5rem/1 var(--serif); color: var(--ink); margin-right: 4px; }

.sec-title { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.01em; margin-bottom: 18px; }

/* Directory ------------------------------------------------------------- */
.directory { margin-bottom: clamp(44px, 6vw, 76px); }
.dir-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 30px; }
.dir-sec { border-top: 2px solid var(--ink); padding-top: 12px; display: flex; flex-direction: column; }
.dir-sec h3 { font-size: 1.22rem; }
.dir-sec h3 a { display: flex; gap: 8px; align-items: flex-start; text-decoration: none; }
.dir-sec h3 a:hover { color: var(--accent); }
.dir-sec h3 .ico { color: var(--accent); margin-top: 1px; }
.dir-sec > p { color: var(--muted); font-size: .94rem; margin: 8px 0 12px; }
.dir-sec ul { list-style: none; margin-bottom: 12px; }
.dir-sec li { padding: 5px 0; border-top: 1px solid var(--line); font-size: .97rem; line-height: 1.32; }
.dir-sec li a { text-decoration: none; }
.dir-sec li a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.dir-all { margin-top: auto; color: var(--accent); font-weight: 700; font-size: .95rem; text-decoration: none; }
.dir-all:hover { text-decoration: underline; }

/* Myths band ------------------------------------------------------------ */
.myths-band { background: var(--pine); color: var(--on-pine); padding-block: clamp(40px, 6vw, 68px); margin-bottom: clamp(44px, 6vw, 76px); }
.myth-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-bottom: 24px; }
.myth p { color: var(--on-pine-soft); }
.myth .myth-heard { font: 400 1.4rem/1.22 var(--serif); color: var(--on-pine); margin-bottom: 10px; }
.on-dark { color: var(--on-pine); font-weight: 700; }

/* Split ----------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(30px, 5vw, 64px); margin-bottom: clamp(44px, 6vw, 76px); }
.lede { color: var(--muted); margin-bottom: 18px; max-width: 58ch; }
.more { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 700; text-decoration: none; }
.more:hover { text-decoration: underline; }
.tool-teaser { background: var(--butter); border: 1px solid var(--butter-line); border-radius: 14px; padding: 26px; align-self: start; }
.tool-teaser .lede { color: var(--ink); }
.btn { display: inline-block; background: var(--pine); color: var(--on-pine); text-decoration: none; padding: 11px 20px; border-radius: 8px; font-weight: 700; }
.btn:hover { filter: brightness(1.15); }
table.mini { width: 100%; border-collapse: collapse; }
table.mini th, table.mini td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: .98rem; }
table.mini thead th { font-size: .82rem; color: var(--muted); font-weight: 700; }
table.mini tbody th { font-weight: 700; }
table.mini a { text-decoration: none; }
table.mini a:hover { text-decoration: underline; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.4px solid var(--muted); }
.dots i.on { background: var(--accent); border-color: var(--accent); }

.promise { margin-bottom: clamp(50px, 7vw, 86px); }
.promise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.promise h3 { font-size: 1.2rem; margin-bottom: 6px; }
.promise p { color: var(--muted); }

/* Hubs ------------------------------------------------------------------ */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .92rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: inherit; }
.hub-head { padding-block: clamp(30px, 5vw, 56px) clamp(18px, 3vw, 30px); }
.hub-head h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -.02em; }
.hub-title { display: flex; gap: 14px; align-items: center; }
.dek { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--muted); max-width: 62ch; margin-top: 12px; line-height: 1.45; }
.dek a { color: var(--accent); }
.byline { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; color: var(--muted); margin-top: 14px; align-items: center; }
.draft-tag { background: var(--butter); border: 1px solid var(--butter-line); color: var(--ink); padding: 1px 9px; border-radius: 99px; text-decoration: none; font-size: .86rem; }
.band-link { display: block; margin-top: 22px; background: var(--butter); border: 1px solid var(--butter-line); border-radius: 12px; padding: 14px 18px; text-decoration: none; max-width: 640px; }
.band-link strong { display: block; }
.band-link:hover { border-color: var(--ink); }
.guide-list { list-style: none; border-top: 2px solid var(--ink); }
.guide-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; border-bottom: 1px solid var(--line); padding: 14px 0; }
.guide-row a { text-decoration: none; }
.guide-row a:hover strong { color: var(--accent); }
.guide-row strong { display: block; font: 500 1.2rem/1.25 var(--serif); }
.guide-row span:not(.row-num) { display: block; color: var(--muted); font-size: .97rem; margin-top: 3px; max-width: 78ch; }
.guide-row em { font-style: normal; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.row-num { font: 500 1.05rem/1.4 var(--serif); color: var(--accent); }
.guide-row.is-read .row-num { font-size: 0; }
.guide-row.is-read .row-num::before { content: "\2713"; font-size: 1.05rem; color: var(--pine); font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .guide-row.is-read .row-num::before { color: var(--accent); } }
:root[data-theme="dark"] .guide-row.is-read .row-num::before { color: var(--accent); }
.hub-others { padding-block: 40px 70px; }
.hub-others h2 { font-size: 1.3rem; margin-bottom: 14px; }
.chip-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links a { display: inline-flex; gap: 8px; align-items: center; padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; background: var(--surface); font-size: .96rem; }
.chip-links a:hover { border-color: var(--ink); }
.chip-links .ico { color: var(--accent); }

/* Paths ----------------------------------------------------------------- */
.paths { padding-bottom: 70px; display: grid; gap: 46px; }
.path { scroll-margin-top: 90px; }
.path header { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-bottom: 14px; }
.path h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
.path header p { color: var(--muted); margin-top: 4px; max-width: 66ch; }
.path .pn { font-size: 1.6rem; }
.path-progress { font-size: .9rem; white-space: nowrap; background: var(--sage); border: 1px solid var(--sage-line); color: var(--ink) !important; padding: 2px 10px; border-radius: 99px; margin: 0 !important; }

/* Guide ----------------------------------------------------------------- */
.guide-head { padding-block: clamp(26px, 4vw, 48px) clamp(18px, 3vw, 30px); }
.guide-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -.02em; max-width: 22ch; }
.guide-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(26px, 5vw, 64px); align-items: start; }
.toc { position: sticky; top: 88px; font-size: .94rem; max-height: calc(100vh - 110px); overflow: auto; }
.toc summary { font-weight: 700; cursor: pointer; margin-bottom: 8px; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 12px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); line-height: 1.3; }
.toc li a:hover { color: var(--ink); }
.toc li a.on { color: var(--ink); border-left-color: var(--accent); font-weight: 700; }

.prose { max-width: 70ch; font-size: 1.125rem; line-height: 1.62; }
.prose-solo { padding-bottom: 70px; }
.prose > p, .prose > ul, .prose > ol, .prose > blockquote { margin-bottom: 1.05em; }
.prose h2 { font-size: clamp(1.55rem, 2.6vw, 1.95rem); margin: 1.9em 0 .55em; scroll-margin-top: 88px; }
.prose h3 { font-size: 1.28rem; margin: 1.5em 0 .4em; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .42em; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent); text-underline-offset: 2px; }
.prose blockquote { margin-inline: 0; border-left: 3px solid var(--accent); padding-left: 16px; font-family: var(--serif); font-size: 1.2rem; }
.takeaways { background: var(--sage); border: 1px solid var(--sage-line); border-radius: 12px; padding: 18px 22px; margin-bottom: 1.5em; }
.takeaways h2 { font-size: 1.2rem; margin: 0 0 8px; }
.takeaways ul { margin: 0; }
.takeaways li { margin-bottom: .35em; }
.takeaways li:last-child { margin-bottom: 0; }
.callout { border-radius: 12px; padding: 16px 20px; margin: 1.4em 0; border: 1px solid var(--line); background: var(--surface); }
.callout > :last-child { margin-bottom: 0; }
.callout p { margin-bottom: .6em; }
.callout ul { margin: .3em 0; }
.callout-title { font-weight: 700; margin-bottom: .35em; }
.callout-doctor, .callout-warn { background: var(--rose); border-color: var(--rose-line); }
.callout-tip { background: var(--butter); border-color: var(--butter-line); }
.glance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; margin: 0 0 8px; font-size: 1rem; }
.glance div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.glance dt { font-size: .84rem; color: var(--muted); }
.glance dd { margin: 0; font-weight: 700; line-height: 1.35; }
.compare-link { font-size: 1rem; margin-bottom: 1.4em; }
/* Shadows appear at an edge only when there's more table to scroll to */
.table-wrap {
  overflow-x: auto; margin: 1.2em 0;
  background:
    linear-gradient(to right, var(--paper) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 30%, transparent) right / 28px 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, .22), transparent) left / 12px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0, 0, 0, .22), transparent) right / 12px 100% no-repeat scroll;
}
.prose table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 1rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { border-bottom: 2px solid var(--ink); font-weight: 700; font-size: .92rem; }
.sources { margin-top: 2.6em; border-top: 2px solid var(--ink); }
.sources h2 { font-size: 1.25rem; margin: .8em 0 .5em; }
.sources ol { font-size: .95rem; line-height: 1.4; }
.guide-disclaimer { margin-top: 1.5em; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.guide-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 44px 0 0; }
.path-card { background: var(--pine); color: var(--on-pine); border-radius: 12px; padding: 18px 20px; }
.path-card p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: .94rem; color: var(--on-pine-soft); margin-bottom: 8px; }
.path-card p a { color: inherit; }
.path-next { display: block; color: inherit; text-decoration: none; font: 500 1.22rem/1.25 var(--serif); }
.path-next:hover { text-decoration: underline; }
.path-next small { display: block; font: 400 .84rem var(--sans); color: var(--on-pine-soft); }
.related { margin: 44px 0 70px; }
.related h2 { font-size: 1.45rem; margin-bottom: 14px; }
.related ul { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.related a { display: block; height: 100%; border-top: 2px solid var(--ink); padding-top: 10px; text-decoration: none; font: 500 1.1rem/1.25 var(--serif); }
.related a:hover { color: var(--accent); }
.related small { display: block; font: 400 .84rem var(--sans); color: var(--muted); margin-bottom: 3px; }

/* Email signup ---------------------------------------------------------- */
.signup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 48px); align-items: center; background: var(--sage); border: 1px solid var(--sage-line); border-radius: 14px; padding: clamp(20px, 3vw, 30px); margin-top: 44px; }
.signup h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.signup-copy p { color: var(--muted); margin-top: 6px; line-height: 1.45; }
.signup form { position: relative; min-width: 0; }
.signup-row { display: flex; gap: 8px; }
.signup-row[hidden] { display: none; }
.signup input[type="email"] { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--sage-line); border-radius: 8px; background: var(--surface); }
.signup button { background: var(--pine); color: var(--on-pine); border: 1px solid var(--sage-line); border-radius: 8px; padding: 10px 18px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.signup button:hover { filter: brightness(1.15); }
.signup button:disabled { opacity: .6; cursor: default; }
.signup-msg { font-weight: 700; margin-top: 8px; }
.signup-msg:empty { display: none; }
.signup-fine { font-size: .86rem; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.signup-fine a { color: inherit; }
/* Spam trap: bots fill this in, people never see it */
.signup-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.home-signup { margin-bottom: clamp(50px, 7vw, 86px); }
.home-signup .signup { margin-top: 0; }

/* Meal tracker. Neutral colors only: no red or green judging anyone's numbers. */
.tracker { padding-bottom: 70px; }
.tracker [hidden] { display: none !important; }
button.btn { border: 0; cursor: pointer; }
button.btn:disabled { opacity: .6; cursor: default; }
.tool-teaser .more { display: block; margin-top: 14px; }
.tk-notice { background: var(--butter); border: 1px solid var(--butter-line); border-radius: 12px; padding: 14px 18px; max-width: 640px; }
.tk-gate { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.tk-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.tk-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tk-tab { flex: 1; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; }
.tk-tab[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.tk-msg { font-weight: 700; margin-bottom: 12px; }
.tk-msg:empty { display: none; }
.tk-form { display: grid; gap: 12px; }
.tk-form label { display: block; font-size: .94rem; font-weight: 700; }
.tk-form input:not([type="checkbox"]), .tk-form select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font-weight: 400; }
.tk-form label.tk-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; line-height: 1.4; }
.tk-check input { margin-top: 3px; flex: none; }
.tk-check a, .tk-about a, .tk-foot a { color: var(--accent); }
.tk-link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; justify-self: start; }
.tk-about h2 { font-size: 1.4rem; margin-bottom: 10px; }
.tk-about ul { padding-left: 1.2em; margin-bottom: 18px; }
.tk-about li { margin-bottom: 6px; }
.tk-about li::marker { color: var(--accent); }
.tk-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.tk-bar strong { overflow-wrap: anywhere; }
.tk-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 28px); align-items: start; }
.tk-cal, .tk-day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(12px, 2vw, 20px); }
.tk-cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.tk-cal-head h2 { flex: 1; font-size: clamp(1.15rem, 2.4vw, 1.4rem); min-width: 0; }
.tk-nav { min-height: 36px; min-width: 36px; padding: 4px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.tk-nav:hover { border-color: var(--ink); }
.tk-dow, .tk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tk-dow span { text-align: center; font-size: .78rem; color: var(--muted); padding-bottom: 4px; }
.tk-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; min-height: 52px; padding: 6px 1px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.tk-cell:hover { border-color: var(--ink); }
.tk-cell[aria-current="date"] .tk-num { color: var(--accent); font-weight: 700; }
.tk-cell[aria-pressed="true"] { background: var(--pine); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--on-pine); }
.tk-cell[aria-pressed="true"] .tk-num { color: inherit; }
.tk-sum { font-size: .72rem; line-height: 1.15; color: var(--muted); }
.tk-cell[aria-pressed="true"] .tk-sum { color: var(--on-pine-soft); }
.tk-day h2 { font-size: clamp(1.2rem, 2.4vw, 1.4rem); }
.tk-total { color: var(--muted); margin-top: 2px; }
.tk-total:empty { display: none; }
.tk-list { list-style: none; margin: 12px 0 0; }
.tk-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.tk-entry small { display: block; font-size: .8rem; color: var(--muted); }
.tk-desc { overflow-wrap: anywhere; }
.tk-remove { font-size: .85rem; color: var(--muted); }
.tk-empty { color: var(--muted); margin-top: 12px; }
.tk-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--line); }
.tk-add-desc, .tk-add-btn { grid-column: 1 / -1; }
.tk-foot { margin-top: 26px; color: var(--muted); font-size: .96rem; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: var(--ink); }
.tk-confirm { margin-top: 12px; padding: 14px 16px; color: var(--ink); background: var(--rose); border: 1px solid var(--rose-line); border-radius: 10px; max-width: 560px; }
.tk-confirm p { margin-bottom: 10px; }
.tk-danger { min-height: 36px; padding: 4px 12px; margin-right: 6px; background: var(--accent); color: var(--paper); border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* Plate ----------------------------------------------------------------- */
.plate { margin: 1.4em 0; max-width: 360px; }
.plate svg { width: 100%; height: auto; display: block; }
.plate figcaption { font-size: .95rem; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.plate-rim { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.plate-veg { fill: var(--plate-veg); }
.plate-pro { fill: var(--plate-pro); }
.plate-carb { fill: var(--plate-carb); }
.plate text { fill: var(--plate-ink); font-family: var(--sans); }
.plate-big { font: 500 21px var(--serif); }
.plate-small { font-size: 14px; }

/* Compare --------------------------------------------------------------- */
.cmp-wrap { padding-bottom: 70px; }
.cmp-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px; cursor: pointer; font-size: .95rem; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.cmp-sort { display: inline-flex; gap: 8px; align-items: center; font-size: .95rem; color: var(--muted); }
.cmp-sort select { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.cmp-count { color: var(--muted); font-size: .94rem; margin: 6px 0 12px; }
.cmp { width: 100%; border-collapse: collapse; font-size: .97rem; line-height: 1.38; }
.cmp thead th { position: sticky; top: 66px; background: var(--paper); text-align: left; font-size: .82rem; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 8px 12px 8px 0; z-index: 2; }
.cmp tbody th, .cmp td { text-align: left; vertical-align: top; padding: 13px 14px 13px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.cmp tbody th { width: 27%; }
.cmp tbody th a { display: block; font: 500 1.14rem/1.25 var(--serif); text-decoration: none; }
.cmp tbody th a:hover { color: var(--accent); }
.cmp tbody th span { display: block; color: var(--muted); font-size: .92rem; margin-top: 3px; }
.ev { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .86rem; border: 1px solid var(--line); white-space: nowrap; }
.ev-4 { background: var(--sage); border-color: var(--sage-line); }
.ev-3 { background: var(--sage); border-color: var(--sage-line); }
.ev-2 { background: var(--butter); border-color: var(--butter-line); }
.ev-1 { background: var(--rose); border-color: var(--rose-line); }
.cmp-note { margin-top: 20px; color: var(--muted); font-size: .94rem; max-width: 80ch; }

/* Tools ----------------------------------------------------------------- */
.tools { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); padding-bottom: 70px; align-items: start; }
.tool-form { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 14px; position: sticky; top: 84px; }
.tool-form label { display: block; font-size: .94rem; font-weight: 700; }
.tool-form input[type="number"], .tool-form select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row[hidden], [data-units][hidden] { display: none; }
.units { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.units legend { font-size: .94rem; font-weight: 700; padding: 0; margin-bottom: 4px; }
.units label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.form-note { font-size: .88rem; color: var(--muted); line-height: 1.4; }
.tool-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-content: start; }
.tool-guard { grid-column: 1 / -1; background: var(--rose); border: 1px solid var(--rose-line); border-radius: 12px; padding: 14px 18px; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; scroll-margin-top: 90px; }
.tool-card h2 { font-size: 1.15rem; }
.tool-card .big { font: 500 2.5rem/1.1 var(--serif); margin: 8px 0 4px; color: var(--pine); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool-card .big { color: var(--ink); } }
:root[data-theme="dark"] .tool-card .big { color: var(--ink); }
.tool-card .sub { color: var(--muted); font-size: .96rem; line-height: 1.42; margin-bottom: 10px; }
.tool-card a { margin-top: auto; color: var(--accent); font-size: .95rem; font-weight: 700; text-decoration: none; }
.tool-card a:hover { text-decoration: underline; }
.tool-list { list-style: none; margin-bottom: 12px; font-size: .96rem; }
.tool-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.tool-list b { white-space: nowrap; }

/* All guides ------------------------------------------------------------ */
.all-filter input { width: 100%; max-width: 460px; margin-top: 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.all-list { list-style: none; border-top: 2px solid var(--ink); margin-bottom: 70px; }
.all-list li { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.all-list li[hidden] { display: none; }
.all-list a { text-decoration: none; }
.all-list a:hover strong { color: var(--accent); }
.all-list strong { display: block; font: 500 1.12rem/1.28 var(--serif); }
.all-list span { display: block; color: var(--muted); font-size: .95rem; }
.all-list em { font-style: normal; font-size: .88rem; color: var(--muted); text-align: right; }
#search-count { color: var(--muted); margin-bottom: 12px; }

/* Footer ---------------------------------------------------------------- */
.site-foot { background: var(--sunk); border-top: 1px solid var(--line); padding-block: 44px 26px; font-size: .96rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr 1.2fr; gap: 30px; }
.foot-grid p { color: var(--muted); margin-top: 10px; max-width: 30ch; }
.foot-grid h2 { font: 700 .86rem var(--sans); color: var(--muted); margin-bottom: 10px; }
.foot-grid ul { list-style: none; }
.foot-grid li { padding: 3px 0; }
.foot-grid li a { text-decoration: none; }
.foot-grid li a:hover { text-decoration: underline; }
.foot-note { margin-top: 28px; padding-top: 16px; }
.foot-note p { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: .9rem; max-width: 90ch; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .search:not(.search-hero) { width: 170px; }
}
@media (max-width: 1180px) {
  .head-row { gap: 12px; }
  .brand { font-size: 1.35rem; }
  .nav { gap: 12px; font-size: .96rem; }
  .search:not(.search-hero) { width: 110px; }
}
@media (max-width: 920px) {
  .head-row { gap: 10px; padding-block: 10px; }
  .nav-toggle { display: inline-block; }
  .nav { display: none; order: 5; width: 100%; flex-direction: column; align-items: stretch; gap: 0; }
  .nav.open { display: flex; }
  .nav a, .nav summary { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .topics-panel { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 6px; background: none; }
  .topics-panel a { border-bottom: 0; padding: 8px 4px; }
  .search:not(.search-hero) { order: 4; width: 100%; margin-left: 0; }
  .home .site-head .search { display: none; } /* the hero already has one */
  .site-head .search-pop { left: 0; right: 0; width: auto; min-width: 0; }
  .site-head { position: static; }
  html { scroll-padding-top: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .myth-grid, .promise-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
  .toc summary { margin-bottom: 0; }
  .toc details[open] summary { margin-bottom: 8px; }
  .prose { max-width: none; }
  .tk-gate, .tk-grid { grid-template-columns: minmax(0, 1fr); }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tool-form { position: static; }

  /* comparison table becomes cards */
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cmp, .cmp tbody, .cmp tr { display: block; width: 100%; }
  .cmp tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
  .cmp tr[hidden] { display: none; }
  .cmp tbody th { display: block; width: auto; border: 0; padding: 0 0 8px; }
  .cmp td { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); border-bottom: 0; }
  .cmp td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
  .cmp td .ev { justify-self: start; }
}
@media (max-width: 620px) {
  .signup { grid-template-columns: minmax(0, 1fr); }
  .dir-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-results { grid-template-columns: minmax(0, 1fr); }
  .glance { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-row { grid-template-columns: 26px minmax(0, 1fr); }
  .guide-row em { display: none; }
  .all-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .all-list em { text-align: left; }
  .path header { grid-template-columns: 26px minmax(0, 1fr); }
  .path-progress { grid-column: 2; justify-self: start; }
  .search-pop { min-width: 0; }
  .search-hero button { padding-inline: 12px; }
}
@media print {
  .site-head, .site-foot, .toc, .guide-paths, .related { display: none; }
  .guide-grid { display: block; }
}
