:root {
  --ground: #F4F5F1;
  --surface: #FFFFFF;
  --surface-2: #FAFBF7;
  --ink: #151A16;
  --ink-2: #4C5450;
  --ink-3: #6A716C;
  --hair: #DDE1D8;
  --hair-2: #EDEFE8;

  --accent: #0B6B58;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2EFEA;
  --accent-2: #C85F1F;

  --pro: #0B8266;
  --carb: #C85F1F;
  --fat: #5C5BB0;

  --warn: #9A5A12;
  --warn-soft: #F6EBD9;
  --crit: #983127;
  --crit-soft: #F6E3E0;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;

  --r-sm: 7px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --dur: 180ms;
  --dur-lg: 340ms;
  --ease: cubic-bezier(.22,.7,.32,1);

  --shadow-sm: 0 1px 2px rgba(20,28,22,.05);
  --shadow: 0 1px 2px rgba(20,28,22,.05), 0 8px 24px -18px rgba(20,28,22,.35);
  --shadow-lg: 0 1px 2px rgba(20,28,22,.06), 0 24px 64px -28px rgba(20,28,22,.4);
  --shadow-focus: 0 0 0 4px var(--accent-soft);

  --header-h: 60px;
  --subnav-h: 0px;
}

@media (max-width: 560px) {
  :root { --header-h: 96px; }
}

/* pages with a secondary on-page-sections bar (jersey-mikes, chipotle) set
   data-subnav on <html> so sticky/scroll-margin math elsewhere accounts for
   the extra bar's height */
:root[data-subnav] { --subnav-h: 45px; }
@media (max-width: 560px) {
  :root[data-subnav] { --subnav-h: 41px; }
}

/* Light is the only theme shown by default — it no longer follows the OS
   dark-mode preference. The rule below stays as a manual opt-in
   (set data-theme="dark" on <html>) if a theme toggle is ever added. */
:root[data-theme="dark"] {
  --ground: #101310;
  --surface: #181C18;
  --surface-2: #1E231E;
  --ink: #E9EDE6;
  --ink-2: #A8B0A8;
  --ink-3: #79817A;
  --hair: #2C322C;
  --hair-2: #232823;
  --accent: #3FA98C;
  --accent-ink: #0B1210;
  --accent-soft: #1B2A25;
  --accent-2: #D4763B;
  --pro: #34A183;
  --carb: #D4763B;
  --fat: #8681CE;
  --warn: #D2984F;
  --warn-soft: #2C2317;
  --crit: #D67C6E;
  --crit-soft: #2E1D1A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -20px rgba(0,0,0,.9);
  --shadow-lg: 0 1px 2px rgba(0,0,0,.4), 0 28px 72px -28px rgba(0,0,0,.85);
  --shadow-focus: 0 0 0 4px var(--accent-soft);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1060px;
  margin-inline: auto;
  padding-inline: 20px;
}

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; z-index: 50; border-radius: 0 0 8px 0;
  font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }

img, svg { max-width: 100%; }

/* ---------- header ---------- */

.site {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
  transition: box-shadow var(--dur) var(--ease);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; min-height: 60px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 20px; height: 20px; border-radius: 6px;
  background: linear-gradient(155deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2) 30%));
  box-shadow: inset 0 0 0 3.5px var(--surface), inset 0 0 0 5px var(--accent);
  transition: transform var(--dur) var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -0.03em; }
.brand-name em { font-style: normal; font-weight: 600; color: var(--ink-2); }

.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  position: relative;
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 7px 11px; border-radius: 7px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--hair-2); }
.nav a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur-lg) var(--ease);
}
.nav a.active { color: var(--ink); }
.nav a.active::after { transform: scaleX(1); }
@media (max-width: 560px) { .nav a { padding: 6px 7px; font-size: 13px; } .brand-name { font-size: 15px; } }

/* ---------- sub-nav (on-page sections, sits below the main header) ---------- */

.subnav {
  position: sticky; top: var(--header-h); z-index: 29;
  background: var(--surface);
  border-bottom: 1px solid var(--hair);
  box-shadow: 0 1px 0 rgba(20,28,22,.02);
}
.subnav-inner {
  display: flex; gap: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-block: 7px;
}
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a {
  position: relative; flex-shrink: 0;
  color: var(--ink-3); text-decoration: none;
  font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.subnav a:hover { color: var(--ink); background: var(--hair-2); }
.subnav a.active { color: var(--accent-ink); background: var(--accent); font-weight: 600; }

/* ---------- hero ---------- */

.hero { position: relative; padding-block: 52px 34px; overflow: hidden; }
.hero:has(.hero-media) { display: grid; grid-template-columns: 1fr; gap: 30px; align-items: center; }
@media (min-width: 860px) { .hero:has(.hero-media) { grid-template-columns: 1.05fr 1fr; } }
.hero-glow {
  position: absolute; z-index: -1; inset: -140px -10% auto -10%; height: 460px;
  background:
    radial-gradient(420px 260px at 12% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(360px 240px at 78% 10%, color-mix(in srgb, var(--carb) 16%, transparent), transparent 70%),
    radial-gradient(320px 220px at 55% 55%, color-mix(in srgb, var(--fat) 12%, transparent), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}
.kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
  animation: rise .6s var(--ease) both;
}
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
h1 { font-size: clamp(30px, 5.4vw, 48px); line-height: 1.04; font-weight: 800; animation: rise .6s .05s var(--ease) both; }
.lede { font-size: clamp(16px, 2.2vw, 19px); color: var(--ink-2); max-width: 62ch; margin: 16px 0 0; animation: rise .6s .1s var(--ease) both; }
.lede strong { color: var(--ink); font-weight: 600; }

.hero-facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px;
  padding: 0; margin: 26px 0 0;
  animation: rise .6s .16s var(--ease) both;
}
.hero-facts li {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r);
  padding: 10px 14px; display: flex; flex-direction: column; min-width: 96px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.hero-facts li:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--hair)); }
.hero-facts b { font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-facts span { font-size: 12px; color: var(--ink-3); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hero-media {
  margin: 0; animation: rise .6s .2s var(--ease) both;
}
.hero-media img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: calc(var(--r) + 6px); border: 1px solid var(--hair); box-shadow: var(--shadow-lg);
}
.hero-media figcaption {
  margin-top: 6px; font-size: 11px; color: var(--ink-3); text-align: right;
}

/* ---------- sections ---------- */

section { margin-bottom: 56px; scroll-margin-top: calc(var(--header-h) + var(--subnav-h) + 16px); }
.guide { scroll-margin-top: calc(var(--header-h) + var(--subnav-h) + 16px); }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: clamp(22px, 3.4vw, 30px); }
.section-head p { color: var(--ink-2); margin: 8px 0 0; max-width: 64ch; font-size: 15px; }
.section-head.tight { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head.tight h3 { font-size: 18px; }

.panel {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow);
  transition: box-shadow var(--dur-lg) var(--ease);
}

.tool-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .tool-grid { grid-template-columns: 1fr; } }

/* ---------- form ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.field.compact { margin-bottom: 0; }
.field.grow { flex: 1; min-width: 140px; }

label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}

select, input[type="search"] {
  font-family: var(--body); font-size: 15px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--hair);
  border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
select:hover, input[type="search"]:hover { border-color: var(--ink-3); }
select:focus-visible, input[type="search"]:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.itemlist {
  max-height: 190px; overflow-y: auto; border: 1px solid var(--hair);
  border-radius: 8px; background: var(--surface-2); margin-top: 2px;
}
.itemlist button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--hair-2); padding: 8px 11px;
  font-family: var(--body); font-size: 14px; color: var(--ink-2); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}
.itemlist button:last-child { border-bottom: 0; }
.itemlist button:hover { background: var(--hair-2); color: var(--ink); padding-left: 15px; }
.itemlist button[aria-selected="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.itemlist .empty { padding: 12px; font-size: 14px; color: var(--ink-3); }

.quickrow, .chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }

.chip-btn {
  font-family: var(--body); font-size: 13px; font-weight: 500;
  border: 1px solid var(--hair); background: var(--surface-2); color: var(--ink-2);
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.chip-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.chip-btn:active { transform: scale(.96); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-btn.ghost { background: transparent; }
.chip-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ingredient groups */

.groups { display: flex; flex-direction: column; gap: 14px; }
.group h4 {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
  padding-bottom: 6px; border-bottom: 1px solid var(--hair); margin-bottom: 10px;
}
.opts { display: flex; flex-wrap: wrap; gap: 7px; }

.opt {
  display: inline-flex; align-items: baseline; gap: 7px;
  border: 1px solid var(--hair); background: var(--surface-2);
  border-radius: 8px; padding: 7px 10px 7px 26px; cursor: pointer;
  font-size: 13.5px; color: var(--ink-2); user-select: none;
  position: relative;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.opt:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.opt:active { transform: translateY(0) scale(.98); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt::before {
  content: ""; position: absolute; left: 9px; top: 50%; translate: 0 -50%;
  width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--ink-3);
  background: var(--surface); transition: all var(--dur) var(--ease);
}
.opt:has(input[type="radio"])::before { border-radius: 50%; }
.opt .kcal { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.opt:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 500;
}
.opt:has(input:checked)::before {
  border-color: var(--accent); background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 10px;
}
.opt:has(input:checked) .kcal { color: var(--accent); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- results ---------- */

.results { position: sticky; top: calc(var(--header-h) + var(--subnav-h) + 16px); overflow: hidden; }
.results::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--pro), var(--carb), var(--fat));
}
@media (max-width: 860px) { .results { position: static; } }

.res-head { border-bottom: 1px solid var(--hair); padding-bottom: 12px; margin-bottom: 14px; }
.res-name { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 0; line-height: 1.2; }
.res-sub { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }

.cal-block { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cal-figure b {
  display: block; font-family: var(--display); font-weight: 800;
  font-size: 46px; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.cal-figure span { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.donut-wrap { width: 104px; height: 104px; flex-shrink: 0; filter: drop-shadow(0 6px 14px rgba(20,28,22,.12)); }
#donut { width: 100%; height: 100%; }
.donut-track { stroke: var(--hair-2); }
.arc { transition: stroke-dasharray .5s var(--ease), opacity var(--dur) var(--ease); }
#arc-p { stroke: var(--pro); }
#arc-c { stroke: var(--carb); }
#arc-f { stroke: var(--fat); }
.donut-wrap.dim-p #arc-c, .donut-wrap.dim-p #arc-f,
.donut-wrap.dim-c #arc-p, .donut-wrap.dim-c #arc-f,
.donut-wrap.dim-f #arc-p, .donut-wrap.dim-f #arc-c { opacity: .25; }

.legend { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 2px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); padding: 4px 6px; margin: 0 -6px; border-radius: 6px; cursor: default; transition: background var(--dur) var(--ease); }
.legend li:hover { background: var(--surface-2); }
.legend b { margin-left: auto; font-family: var(--mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); width: 38px; text-align: right; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sw-p { background: var(--pro); }
.sw-c { background: var(--carb); }
.sw-f { background: var(--fat); }

.flag {
  margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  font-size: 13px; line-height: 1.45;
  background: var(--warn-soft); color: var(--warn);
  border-left: 3px solid currentColor;
  animation: rise .3s var(--ease) both;
}
.flag.is-crit { background: var(--crit-soft); color: var(--crit); }

.nutri { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13.5px; }
.nutri td { padding: 7px 0; border-bottom: 1px solid var(--hair-2); color: var(--ink-2); }
.nutri tr:last-child td { border-bottom: 0; }
.nutri tr:hover td { color: var(--ink); }
.nutri td:nth-child(2) { text-align: right; font-family: var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nutri td:nth-child(3) { text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); width: 52px; white-space: nowrap; }
.nutri tr.major td { font-weight: 600; color: var(--ink); }

.allergen-line { font-size: 12.5px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.5; }

.res-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--body); font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 8px; padding: 9px 13px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--hair); font-weight: 500; }
.btn.ghost:hover { border-color: var(--ink-3); color: var(--ink); box-shadow: none; }
.toast { font-size: 12.5px; color: var(--accent); margin: 8px 0 0; min-height: 1.2em; }
.toast:not(:empty) { animation: rise .25s var(--ease) both; }

.linkish { background: none; border: 0; color: var(--ink-3); font-family: var(--body); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.linkish:hover { color: var(--ink); }

/* ---------- compare ---------- */

.compare { margin-top: 22px; border-top: 1px solid var(--hair); padding-top: 20px; animation: rise .3s var(--ease) both; }
.cmp-scroll { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 420px; }
.cmp th, .cmp td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--hair-2); text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp th:first-child, .cmp td:first-child { text-align: left; font-family: var(--body); white-space: normal; min-width: 110px; }
.cmp thead th { font-family: var(--display); font-weight: 700; font-size: 13px; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.cmp .best { color: var(--accent); font-weight: 600; }
.cmp .rm { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 6px; border-radius: 4px; transition: color var(--dur) var(--ease); }
.cmp .rm:hover { color: var(--crit); }

/* ---------- menu table ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 12px; }
.filters .field { margin-bottom: 0; }

.table-scroll { overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
table.menu { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
table.menu th, table.menu td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--hair-2); }
table.menu thead th {
  position: sticky; top: calc(var(--header-h) + var(--subnav-h)); background: var(--surface); z-index: 2;
  font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 2px solid var(--hair); white-space: nowrap;
}
table.menu th.num, table.menu td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a horizontally-scrolling ancestor is also forced into a vertical scroll
   context (CSS overflow computed-value rule), which breaks position:sticky's
   offset math against the page — only keep the sticky header where the table
   actually fits without horizontal scroll. */
@media (max-width: 700px) {
  table.menu thead th { position: static; top: auto; }
}
table.menu th.sortable { cursor: pointer; user-select: none; transition: color var(--dur) var(--ease); }
table.menu th.sortable:hover { color: var(--ink); }
table.menu th[aria-sort] { color: var(--accent); }
table.menu th[aria-sort]::after { content: " \2193"; }
table.menu th[aria-sort="ascending"]::after { content: " \2191"; }
table.menu tbody tr { transition: background var(--dur) var(--ease); }
table.menu tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.menu tbody tr:hover { background: var(--accent-soft); }
table.menu td:first-child { font-weight: 500; }
table.menu .cat { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
table.menu .hi { color: var(--crit); font-weight: 600; }
.tablenote { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; }

/* ---------- guides ---------- */

.guides { display: flex; flex-direction: column; gap: 34px; }
.guide h3 { font-size: clamp(19px, 2.8vw, 24px); margin-bottom: 10px; }
.guide p { color: var(--ink-2); max-width: 66ch; margin: 0 0 14px; }
.guide p strong { color: var(--ink); font-weight: 600; }
.guide .takeaway {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 12px 14px; border-radius: 0 8px 8px 0; color: var(--ink);
}

.guide.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.guide.reveal.in { opacity: 1; transform: translateY(0); }

.guide .table-scroll { max-width: 680px; margin-bottom: 16px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 400px; }
table.mini th, table.mini td { padding: 8px 14px 8px 0; border-bottom: 1px solid var(--hair-2); text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.mini th:first-child, table.mini td:first-child { text-align: left; font-family: var(--body); white-space: normal; }
table.mini thead th { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); border-bottom: 2px solid var(--hair); }
table.mini .em { color: var(--accent); font-weight: 600; }

.bars { display: flex; flex-direction: column; gap: 9px; margin: 6px 0 16px; }
.bar-row { display: grid; grid-template-columns: minmax(0,1fr) 74px; gap: 10px; align-items: center; }
.bar-name { font-size: 13px; color: var(--ink-2); }
.bar-track { height: 12px; background: var(--hair-2); border-radius: 0 3px 3px 0; position: relative; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2) 30%)); border-radius: 0 3px 3px 0; width: 0; transition: width .8s var(--ease); }
.bar-fill.over { background: linear-gradient(90deg, var(--crit), color-mix(in srgb, var(--crit) 70%, var(--warn) 30%)); }
.bar-val { font-family: var(--mono); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-dv { border-top: 1px dashed var(--hair); padding-top: 8px; font-size: 12px; color: var(--ink-3); font-family: var(--mono); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; max-width: 66ch; }
.steps li { counter-increment: s; position: relative; padding: 12px 0 12px 38px; border-bottom: 1px solid var(--hair-2); color: var(--ink-2); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 13px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 12px; font-weight: 600; display: grid; place-items: center;
}
.steps b { color: var(--ink); font-weight: 600; }

/* ---------- faq ---------- */

.faq { border-top: 1px solid var(--hair); }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary {
  cursor: pointer; padding: 16px 30px 16px 0; position: relative;
  font-family: var(--display); font-weight: 600; font-size: 16.5px; list-style: none;
  transition: color var(--dur) var(--ease);
}
.faq summary:hover { color: var(--accent); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 12px;
  font-size: 20px; color: var(--ink-3); font-weight: 400;
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.faq details[open] summary::after { content: "+"; transform: rotate(135deg); color: var(--accent); }
.faq details[open] summary { color: var(--ink); }
.faq p { color: var(--ink-2); margin: 0 0 16px; max-width: 66ch; font-size: 15px; animation: rise .3s var(--ease) both; }

/* ---------- method + footer ---------- */

.method p { color: var(--ink-2); max-width: 68ch; font-size: 14.5px; }
.method h2 { font-size: 20px; margin-bottom: 12px; }
.disclaim {
  margin-top: 18px; padding: 14px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--hair);
  font-size: 13px; color: var(--ink-3); line-height: 1.6;
}
.disclaim strong { color: var(--ink-2); }

.site-foot {
  position: relative;
  margin-top: 64px;
  padding-block: 46px 28px;
  background: var(--surface-2);
}
.site-foot::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--pro), var(--carb), var(--fat));
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
}
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
}

.foot-brand-col .brand { margin-bottom: 10px; }
.foot-tag { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; max-width: 34ch; margin: 0; }

.foot-col h3 {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.foot-col a {
  color: var(--ink-2); text-decoration: none; font-size: 14px;
  transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}
.foot-col a:hover { color: var(--accent); padding-left: 3px; }
.foot-soon { color: var(--ink-3); font-size: 13px; font-style: italic; }
.foot-legal { color: var(--ink-3); font-size: 12.5px; line-height: 1.6; margin: 0; max-width: 40ch; }

.foot-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--hair);
}
.foot-bottom p { color: var(--ink-3); font-size: 12.5px; margin: 0; }
.totop { color: var(--ink-2); font-size: 13.5px; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; transition: color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.totop:hover { color: var(--accent); transform: translateY(-1px); }

.fab-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--hair);
  box-shadow: var(--shadow-lg); cursor: pointer; font-size: 16px;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity var(--dur-lg) var(--ease), transform var(--dur-lg) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.fab-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fab-top:hover { color: var(--accent); border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .guide.reveal { opacity: 1; transform: none; }
}
