/* Protein Calculator and the "Protein in Indian foods" pages. Built on the ClearLab AI stylesheet
   (same tool base and guide layout); calculator-only styles are at the end. */
:root {
  --bg: #f7f3ec;
  --bg-elev: #fdfbf6;
  --surface: #fff;
  --ink: #1a1714;
  --ink-soft: #3e3933;
  --ink-muted: #655e55;
  --line: #e6ddcf;
  --line-strong: #d6ccbb;
  --accent: #c96442;
  --accent-deep: #a64d2e;
  --accent-ink: #8d3d24;
  --accent-soft: #f4e2d8;
  --mint: #d8e6d5;
  --mint-ink: #2d5c3d;
  --butter: #f4e5b8;
  --butter-ink: #6b4e0f;
  --rose: #f0d4cb;
  --font-sans: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --nav-h: 64px;
  --shadow: 0 1px 2px rgba(26, 23, 20, .04), 0 12px 40px rgba(26, 23, 20, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; color: var(--ink-soft); text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
section[id], #upload { scroll-margin-top: calc(var(--nav-h) + 16px); }

.shell { width: min(100% - 48px, 1200px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 70; top: 8px; left: 8px; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--r-sm); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.label {
  display: inline-block;
  color: var(--accent-deep);
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .1s ease;
}
.button:active { transform: scale(.98); }
.button-primary { background: var(--ink); color: var(--bg); }
.button-primary:hover { background: var(--accent-deep); color: #fff; }
.button-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.button-ghost:hover { border-color: var(--ink); background: var(--bg-elev); }
.small-button {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
}
.small-button:hover { border-color: var(--ink); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--nav-h); display: flex; align-items: center; gap: 16px; }
.header-brands, .header-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-tools { margin-left: auto; }
.nc-wordmark, .tool-wordmark { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; line-height: 1; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.nc-wordmark img { display: block; width: 30px; height: 30px; border-radius: 8px; }
.tool-wordmark img { display: block; width: 26px; height: 26px; }
.nc-wordmark em, .tool-wordmark em { color: var(--accent); font-style: normal; font-weight: 400; }
.brand-divider { width: 1px; height: 24px; background: var(--line-strong); }
.header-nav { display: flex; gap: 2px; margin-left: auto; }
.header-nav a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-soft); font-size: 14px; font-weight: 500; white-space: nowrap; }
.header-nav a:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); color: var(--ink); }
.header-action { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.header-action:hover { background: var(--accent-deep); color: #fff; }
.header-tools .header-action { margin-left: 4px; }
.header-menu { display: none; position: relative; }
.header-menu summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; }
.header-menu summary::-webkit-details-marker { display: none; }
.header-menu summary svg { width: 20px; height: 20px; }
.header-menu .close-icon, .header-menu[open] .menu-icon { display: none; }
.header-menu[open] .close-icon { display: block; }
.header-menu[open] summary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.header-menu nav { position: absolute; top: calc(100% + 10px); right: 0; display: flex; flex-direction: column; gap: 2px; width: min(300px, calc(100vw - 32px)); padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
.header-menu nav a { display: flex; align-items: center; min-height: 44px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink-soft); font-size: 15px; }
.header-menu nav a:hover { background: var(--bg-elev); color: var(--ink); }

/* Hero: copy on the left, the upload card on the right */
.hero {
  padding: 56px 0 88px;
  background:
    radial-gradient(800px 380px at 90% -10%, color-mix(in oklab, var(--accent-soft) 75%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-elev), var(--bg) 70%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; align-items: start; }
.hero-copy { padding-top: 28px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; color: var(--ink-muted); font: 400 12px/1.4 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.crumbs a:hover { color: var(--accent-deep); }
.hero h1 { margin: 16px 0 24px; font-size: clamp(44px, 5.6vw, 74px); line-height: 1.02; letter-spacing: -.035em; max-width: 13ch; }
.hero h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--accent-deep); }
.lede { max-width: 52ch; font-size: clamp(17px, 1.45vw, 19px); line-height: 1.55; }
.lede-small { margin-top: 14px; font-size: 16px; color: var(--ink-muted); }
.facts { display: grid; gap: 10px; margin: 32px 0 0; padding: 24px 0 0; list-style: none; border-top: 1px solid var(--line); }
.facts li { position: relative; padding-left: 28px; color: var(--ink-soft); font-size: 15px; }
.facts li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%232d5c3d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.facts strong { color: var(--ink); font-weight: 600; }

.upload-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.upload-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.upload-card-head h2 { font-size: 22px; letter-spacing: -.02em; }
.pill { padding: 4px 10px; border-radius: var(--r-pill); background: var(--bg); color: var(--ink-muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: .04em; white-space: nowrap; }
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 176px;
  padding: 20px;
  text-align: center;
  background: var(--bg-elev);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.dropzone:hover, .dropzone.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--accent-deep); }
.dropzone strong { font-size: 16px; font-weight: 600; }
.dropzone > span:last-child { color: var(--ink-muted); font-size: 14px; }
.upload-message { min-height: 22px; margin-top: 12px; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.upload-message.error { color: #a3341b; }
.privacy-note { display: flex; gap: 8px; margin: 6px 0 16px; color: var(--ink-muted); font-size: 13px; line-height: 1.5; }
.privacy-note svg { flex: 0 0 15px; margin-top: 2px; color: var(--mint-ink); }
.consent { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); color: var(--ink-soft); font-size: 13px; line-height: 1.5; cursor: pointer; }
.consent input { flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent-deep); }
.analyze-btn { width: 100%; margin-top: 14px; }
.analyze-btn:disabled, .analyze-btn:disabled:hover { background: var(--line); color: var(--ink-muted); cursor: not-allowed; transform: none; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.button-ghost { width: 100%; }
.fine-print { margin-top: 14px; color: var(--ink-muted); font-size: 12.5px; line-height: 1.5; }

/* Section scaffolding */
.report-section, .markers-section, .how-section, .guides-section, .faq-section { padding: 96px 0; }
.guides-section { background: var(--bg-elev); border-top: 1px solid var(--line); }
.inline-link { color: var(--accent-deep); font-weight: 500; white-space: nowrap; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin-bottom: 40px; }
.section-head h2 { margin-top: 12px; font-size: clamp(32px, 4vw, 50px); line-height: 1.05; max-width: 18ch; }
.section-head > p { max-width: 44ch; font-size: 17px; line-height: 1.55; }

/* Readout */
.disclaimer { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 14px 18px; color: #4a3a12; background: #f8efda; border: 1px solid #e3d19c; border-radius: var(--r-sm); }
.disclaimer svg { flex: 0 0 20px; margin-top: 2px; }
.disclaimer p { color: inherit; font-size: 14px; line-height: 1.55; }
.disclaimer strong { font-weight: 600; }

.report-app { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(26, 23, 20, .04); }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 32px; border-bottom: 1px solid var(--line); }
.report-toolbar h3 { margin: 6px 0 4px; font-size: 22px; }
.report-toolbar p { font-size: 14px; color: var(--ink-muted); }
.report-toolbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--bg-elev); border-bottom: 1px solid var(--line); }
.summary-item { padding: 18px 32px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-item strong { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.summary-item span { color: var(--ink-muted); font-size: 13px; }
.summary-item.attention strong { color: var(--accent-deep); }
.report-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.report-aside { padding: 24px 16px; background: var(--bg-elev); border-right: 1px solid var(--line); }
.report-aside h4 { margin: 0 0 10px; padding: 0 12px; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.category-button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 500; text-align: left; }
.category-button span { color: var(--ink-muted); font: 400 12px var(--font-mono); }
.category-button:hover { background: var(--surface); color: var(--ink); }
.category-button.active { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 var(--accent); }
.aside-help { margin: 24px 12px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.aside-help strong { font-size: 13px; font-weight: 600; }
.aside-help p { margin-top: 6px; color: var(--ink-muted); font-size: 13px; line-height: 1.5; }
.report-main { min-width: 0; padding: 20px 32px 28px; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.filter-group { display: flex; gap: 4px; }
.filter { min-height: 36px; padding: 6px 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.filter:hover { background: var(--bg-elev); }
.filter.active { background: var(--ink); color: var(--bg); }
.result-bar > span { color: var(--ink-muted); font-size: 13px; }

.result-row { padding: 28px 0; border-bottom: 1px solid var(--line); }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.result-identity { min-width: 0; }
.result-title { font-size: 20px; font-weight: 500; }
.result-plain { margin-top: 4px; color: var(--ink-muted); font-size: 14px; }
.badge { flex: 0 0 auto; padding: 5px 11px; border-radius: var(--r-pill); font: 500 11px/1.4 var(--font-mono); letter-spacing: .02em; white-space: nowrap; }
.badge.in-range { background: var(--mint); color: var(--mint-ink); }
.badge.out-of-range { background: var(--butter); color: var(--butter-ink); }
.badge.unverified { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.result-measure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.result-measure > div { min-width: 0; padding: 12px 16px; }
.result-measure > div + div { border-left: 1px solid var(--line); }
.result-kicker { display: block; margin-bottom: 4px; color: var(--ink-muted); font: 500 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.result-value { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.result-value small { color: var(--ink-muted); font-size: 14px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.result-range { display: block; font-size: 15px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }

/* Where the value sits against the lab's range */
.range-meter { position: relative; height: 8px; margin: 18px 0 6px; border-radius: var(--r-pill); background: var(--rose); }
.range-meter .band { position: absolute; top: 0; bottom: 0; background: var(--mint); }
.range-meter .marker { position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--ink); transform: translateY(-50%); }
.range-meter.out .marker { background: var(--accent-deep); box-shadow: 0 0 0 1px var(--accent-deep); }
.range-scale { position: relative; height: 16px; color: var(--mint-ink); font: 500 11px/16px var(--font-mono); }
.range-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }

.result-explanation { margin-top: 12px; color: var(--ink-soft); font-size: 14px; }
.result-questions { margin-top: 14px; padding: 12px 16px; background: var(--bg-elev); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-sm); }
.result-questions strong { display: block; color: var(--accent-deep); font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.result-questions p { margin-top: 4px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.result-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; color: var(--ink-muted); font-size: 12.5px; }
.result-foot a { color: var(--accent-deep); font-weight: 500; white-space: nowrap; }
.result-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

.report-empty { padding: 28px 0; }
.report-empty p { margin-top: 4px; font-size: 14px; }
.add-result { width: 100%; min-height: 44px; margin-top: 18px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: transparent; color: var(--accent-deep); font-size: 14px; font-weight: 500; }
.add-result:hover { border-color: var(--accent); background: var(--accent-soft); }
.manual-entry { margin-top: 20px; padding: 20px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); }
.manual-entry h4 { font-size: 17px; }
.manual-entry > p { margin: 4px 0 16px; font-size: 14px; color: var(--ink-muted); }
.manual-entry form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.manual-entry label { display: grid; gap: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.manual-entry input, .manual-entry select { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 15px; }
.manual-entry .button { align-self: end; min-height: 42px; }

.doctor-questions { padding: 32px; background: var(--bg-elev); border-top: 1px solid var(--line); }
.doctor-questions-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.doctor-questions h3 { margin-top: 6px; font-size: 24px; }
.doctor-questions-heading p { max-width: 36ch; font-size: 14px; color: var(--ink-muted); }
.doctor-questions ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: q; }
.doctor-questions li { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); counter-increment: q; }
.doctor-questions li::before { content: counter(q, decimal-leading-zero); display: block; margin-bottom: 12px; color: var(--accent-deep); font: 500 11px var(--font-mono); }
.doctor-questions li strong { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.doctor-questions li span { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.report-caption { margin-top: 14px; color: var(--ink-muted); font-size: 13px; }

/* What it reads */
.markers-section { background: var(--bg-elev); border-block: 1px solid var(--line); }
.markers-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.marker-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.marker-card h3 { margin-bottom: 14px; font-size: 19px; }
.marker-card ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.marker-card li a { display: inline-block; color: var(--ink); font-weight: 600; font-size: 15px; border-bottom: 1px solid var(--line-strong); }
.marker-card li a::after { content: " ↗"; color: var(--ink-muted); font-weight: 400; font-size: 12px; }
.marker-card li a:hover { color: var(--accent-deep); border-color: var(--accent); }
.marker-card li span { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 13.5px; line-height: 1.45; }
.marker-card-limits { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.plain-list li { position: relative; padding-left: 20px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.45; }
.plain-list li::before { content: "×"; position: absolute; left: 0; top: -1px; color: var(--accent-deep); font-weight: 600; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; }
.steps li { padding-top: 20px; border-top: 1px solid var(--ink); }
.step-num { color: var(--accent-deep); font: 500 13px var(--font-mono); }
.steps h3 { margin: 28px 0 10px; font-size: 21px; }
.steps p { font-size: 15.5px; max-width: 34ch; }

/* FAQ */
.faq-section { border-top: 1px solid var(--line); }
.faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.faq-grid h2 { margin-top: 12px; font-size: clamp(32px, 4vw, 50px); line-height: 1.05; }
.faq-intro { margin-top: 18px; font-size: 16px; }
.faq-intro a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.faq-list { border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { position: relative; display: block; padding: 22px 44px 22px 0; font-size: 18px; font-weight: 500; letter-spacing: -.01em; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border: 1px solid var(--line-strong); border-radius: 50%; background: linear-gradient(var(--ink), var(--ink)) center/10px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center/1.5px 10px no-repeat; transition: transform .2s ease; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:hover { color: var(--accent-deep); }
.faq-list details p { max-width: 62ch; padding: 0 44px 22px 0; font-size: 16px; line-height: 1.6; }

/* Footer */
.footer { padding-top: 64px; background: var(--bg-elev); border-top: 1px solid var(--line); }
.footer-top { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.8fr); gap: 64px; padding-bottom: 48px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-brand > strong { margin-top: 10px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.footer-brand p { max-width: 38ch; font-size: 14px; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-links > div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-links h2 { margin-bottom: 4px; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.footer-links a { color: var(--ink-soft); font-size: 14px; }
.footer-links a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.footer-note { padding: 16px 0; border-block: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.footer-note strong { color: var(--ink); font-weight: 600; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding: 20px 0 32px; color: var(--ink-muted); font-size: 12.5px; }

/* Tablet */
@media (max-width: 1100px) {
  .header-nav { display: none; }
  .header-menu { display: block; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-copy { padding-top: 0; }
  .crumbs { margin-bottom: 28px; }
  .hero h1 { max-width: 15ch; }
  .upload-card { max-width: 620px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .report-aside { padding: 16px 0 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .report-aside h4 { padding: 0 24px; }
  #category-list { display: flex; gap: 6px; overflow-x: auto; padding: 0 24px 8px; scrollbar-width: none; }
  #category-list::-webkit-scrollbar { display: none; }
  .category-button { flex: 0 0 auto; width: auto; gap: 10px; min-height: 40px; border: 1px solid var(--line); white-space: nowrap; }
  .category-button.active { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: none; }
  .category-button.active span { color: inherit; }
  .aside-help { display: none; }
  .markers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { gap: 24px; }
  .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .footer-top { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --nav-h: 60px; }
  .shell { width: calc(100% - 32px); }
  .header-action { display: none; }
  .nc-wordmark { font-size: 15px; }
  .tool-wordmark { font-size: 16px; }
  .tool-wordmark img { display: none; }
  .header-brands { gap: 10px; }
  .hero { padding: 32px 0 48px; }
  .crumbs { margin-bottom: 20px; }
  .hero h1 { margin: 12px 0 16px; font-size: clamp(38px, 11vw, 50px); }
  .lede { font-size: 16.5px; }
  .lede-small { display: none; }
  .facts { margin-top: 22px; padding-top: 18px; }
  .upload-card { padding: 16px; border-radius: var(--r-md); }
  .upload-card-head h2 { font-size: 19px; }
  .dropzone { min-height: 150px; }
  .report-section, .markers-section, .how-section, .guides-section, .faq-section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }
  .section-head > p { font-size: 16px; }
  .disclaimer { padding: 12px 14px; }
  .disclaimer p { font-size: 13px; }
  .report-toolbar { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px; }
  .report-toolbar h3 { font-size: 19px; }
  .report-toolbar-actions .small-button { flex: 1; min-height: 44px; }
  .summary-item { padding: 14px 12px; }
  .summary-item strong { font-size: 23px; }
  .summary-item span { display: block; font-size: 11.5px; line-height: 1.3; }
  .report-aside h4 { padding: 0 16px; }
  #category-list { padding: 0 16px 8px; }
  .category-button { min-height: 44px; }
  .report-main { padding: 14px 16px 20px; }
  .result-bar { flex-wrap: wrap; }
  .filter { min-height: 44px; }
  .result-row { padding: 22px 0; }
  .result-head { flex-direction: column; gap: 8px; }
  .result-title { font-size: 18px; }
  .result-measure { grid-template-columns: minmax(0, 1fr); }
  .result-measure > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .result-value { font-size: 26px; }
  .result-foot { flex-direction: column; gap: 6px; }
  .manual-entry { padding: 16px; }
  .manual-entry form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-entry label:first-child, .manual-entry .button { grid-column: 1 / -1; }
  .manual-entry input, .manual-entry select { min-height: 44px; font-size: 16px; }
  .doctor-questions { padding: 22px 16px; }
  .doctor-questions-heading { flex-direction: column; align-items: flex-start; gap: 8px; }
  .doctor-questions h3 { font-size: 21px; }
  .doctor-questions ol { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .markers-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .marker-card { padding: 20px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .steps h3 { margin: 14px 0 8px; }
  .faq-list summary { font-size: 16.5px; padding: 18px 40px 18px 0; }
  .faq-list details p { padding-right: 0; font-size: 15px; }
  .footer { padding-top: 48px; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
}
@media (max-width: 400px) {
  .nc-wordmark span { display: none; }
}

@media print {
  .site-header, .hero, .markers-section, .how-section, .faq-section, .footer,
  .filter-group, .small-button, .add-result, .manual-entry, .report-aside, .skip-link { display: none !important; }
  body { background: #fff; }
  .report-section { padding: 0; }
  .report-app { border: 0; box-shadow: none; }
  .report-layout { display: block; }
  .result-row { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Lab guides (/tools/clearlab-ai/guides) ---------- */
.guide-hero { padding: 48px 0 56px; background: radial-gradient(800px 360px at 90% -10%, color-mix(in oklab, var(--accent-soft) 70%, transparent), transparent 70%), linear-gradient(180deg, var(--bg-elev), var(--bg) 80%); border-bottom: 1px solid var(--line); }
.guide-hero h1 { margin: 14px 0 20px; font-size: clamp(38px, 5vw, 64px); line-height: 1.04; letter-spacing: -.035em; max-width: 20ch; }
.guide-hero h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-deep); }
.guide-hero .lede { max-width: 60ch; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 24px; color: var(--ink-muted); font: 400 12.5px/1.5 var(--font-mono); letter-spacing: .02em; }
.byline a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 68ch) minmax(220px, 260px); justify-content: space-between; gap: 64px; padding: 56px 0 96px; }
.guide-body > * + * { margin-top: 18px; }
.guide-body h2 { margin-top: 56px; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.12; scroll-margin-top: calc(var(--nav-h) + 20px); }
.guide-body h3 { margin-top: 32px; font-size: 20px; }
.guide-body p, .guide-body li { color: var(--ink-soft); font-size: 17px; line-height: 1.7; }
.guide-body ul, .guide-body ol { padding-left: 22px; }
.guide-body li + li { margin-top: 8px; }
.guide-body a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.guide-body strong { color: var(--ink); font-weight: 600; }
.guide-body sup a { text-decoration: none; font: 500 11px var(--font-mono); padding: 0 1px; }
.answer-box { margin: 0 0 8px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md); }
.answer-box .label { margin-bottom: 8px; }
.answer-box p { color: var(--ink); font-size: 17.5px; line-height: 1.6; }
.answer-box p.label { color: var(--accent-deep); font: 500 12px/1.4 var(--font-mono); letter-spacing: .08em; }
.guide-table-wrap { overflow-x: auto; margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.guide-table { width: 100%; min-width: 440px; border-collapse: collapse; }
.guide-table caption { padding: 14px 18px 0; color: var(--ink-muted); font-size: 13px; text-align: left; caption-side: bottom; padding-bottom: 14px; }
.guide-table th, .guide-table td { padding: 13px 18px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; vertical-align: top; }
.guide-table th { color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; background: var(--bg-elev); }
.guide-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.guide-table tr:last-child td { border-bottom: 0; }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.dot-ok { background: #7fa98a; } .dot-mid { background: #d4b04f; } .dot-high { background: var(--accent); } .dot-vhigh { background: #8d3d24; }
.note { padding: 16px 20px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-sm); }
.note p { font-size: 15.5px; line-height: 1.6; }
.note-warn { background: #f8efda; border-color: #e3d19c; }
.note-warn p { color: #4a3a12; }
.ask-list { list-style: none; padding: 0 !important; counter-reset: ask; }
.ask-list li { position: relative; padding: 14px 16px 14px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); counter-increment: ask; color: var(--ink) !important; }
.ask-list li::before { content: counter(ask, decimal-leading-zero); position: absolute; left: 16px; top: 15px; color: var(--accent-deep); font: 500 12px var(--font-mono); }
.guide-faq { border-top: 1px solid var(--line-strong); }
.guide-faq details { border-bottom: 1px solid var(--line); }
.guide-faq summary { position: relative; display: block; padding: 18px 40px 18px 0; color: var(--ink); font-size: 17px; font-weight: 500; cursor: pointer; list-style: none; }
.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq summary::after { content: "+"; position: absolute; right: 6px; top: 15px; color: var(--ink-muted); font: 400 22px/1 var(--font-sans); transition: transform .2s ease; }
.guide-faq details[open] summary::after { transform: rotate(45deg); }
.guide-faq details p { padding: 0 0 18px; font-size: 16px; }
.references { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-strong); }
.references h2 { margin-top: 0; font-size: 20px; }
.references ol { padding-left: 20px; }
.references li { font-size: 14px !important; line-height: 1.55 !important; scroll-margin-top: calc(var(--nav-h) + 20px); }
.references li:target { background: var(--accent-soft); border-radius: 4px; }
.guide-end { margin-top: 32px; color: var(--ink-muted) !important; font-size: 14px !important; }
.guide-aside { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; display: grid; gap: 20px; }
.toc { padding-top: 14px; border-top: 2px solid var(--ink); }
.toc .label { color: var(--ink-muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.toc a:hover { color: var(--accent-deep); }
.cta-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
.cta-card strong { display: block; font-size: 16px; font-weight: 600; }
.cta-card p { margin: 6px 0 14px; font-size: 14px; }
.cta-card .button { width: 100%; min-height: 44px; font-size: 14px; }
.related { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related a, .guide-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none !important; transition: border-color .18s ease, transform .18s ease; }
.related a:hover, .guide-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related .label, .guide-card .label { font-size: 11px; }
.related strong, .guide-card strong { color: var(--ink); font-size: 17px; font-weight: 500; line-height: 1.3; }
.guides-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.guide-card { min-height: 230px; padding: 24px; }
.guide-card strong { margin-top: 18px; font-size: 21px; }
.guide-card p { font-size: 14.5px; }
.guide-card .more { margin-top: auto; padding-top: 14px; color: var(--accent-deep); font-size: 14px; font-weight: 500; }
@media (max-width: 960px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; }
  .guide-aside { position: static; order: -1; grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .guides-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .guide-hero { padding: 28px 0 40px; }
  .guide-hero h1 { font-size: clamp(34px, 9.5vw, 44px); }
  .guide-layout { padding: 28px 0 64px; }
  .guide-body p, .guide-body li { font-size: 16.5px; }
  .guide-body h2 { margin-top: 44px; }
  .answer-box { padding: 18px; }
  .related { grid-template-columns: minmax(0, 1fr); }
  .guide-card { min-height: 0; }
}
@media print { .guide-aside, .related { display: none !important; } .guide-layout { display: block; } }

/* ── Protein Calculator ─────────────────────────────────────────────────── */
.calc-field { display: block; margin-bottom: 18px; padding: 0; border: 0; }
.calc-field > label, .calc-field > legend { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.input-unit { display: flex; gap: 8px; }
.input-unit input, .calc-input, .calc-select { min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font-size: 17px; }
.input-unit input { flex: 1; min-width: 0; }
.input-unit select { min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); font-size: 15px; }
.input-unit input:focus-visible, .calc-input:focus-visible, .calc-select:focus-visible, .input-unit select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.goal-list { display: grid; gap: 8px; }
.goal { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); cursor: pointer; }
.goal:hover { border-color: var(--line-strong); }
.goal input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.goal strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.goal small { display: block; color: var(--ink-muted); font-size: 13px; line-height: 1.4; }
.goal:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.pc-result { margin-top: 18px; padding: 20px; border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--line); }
.pc-result .label { margin-bottom: 6px; }
.pc-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; color: var(--ink); }
.pc-big strong { font-size: clamp(40px, 6vw, 56px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.pc-big span { color: var(--ink-soft); font-size: 17px; }
.pc-basis { margin-top: 10px; font-size: 14.5px; line-height: 1.55; }
.pc-basis a, .pc-note a, .plate-note a, .cost-note a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }
.pc-meals { margin-top: 10px; color: var(--ink); font-size: 14.5px; }
.pc-note { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--butter); color: var(--butter-ink); font-size: 14px; line-height: 1.5; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pc-actions .small-button { display: inline-flex; align-items: center; }

/* Plate builder */
.plate-app { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 1px 2px rgba(26, 23, 20, .04); }
.plate-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.plate-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.plate-presets button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.plate-total { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.plate-total-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.plate-total-row strong { color: var(--ink); font-size: 32px; font-weight: 500; letter-spacing: -.03em; }
.plate-total-row span { color: var(--ink-soft); font-size: 15px; }
.meter { position: relative; height: 12px; margin-top: 12px; overflow: hidden; border-radius: var(--r-pill); background: var(--bg); border: 1px solid var(--line); }
.meter span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: var(--r-pill); background: var(--mint-ink); transition: width .25s ease; }
.meter.over span { background: var(--accent); }
.plate-table-wrap { overflow-x: auto; }
.plate-table { width: 100%; min-width: 520px; border-collapse: collapse; }
.plate-table th, .plate-table td { padding: 12px 24px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.plate-table th { color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; background: var(--bg-elev); }
.plate-table td.num, .plate-table th.num { text-align: right; white-space: nowrap; }
.plate-table td:first-child a { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.plate-table input { width: 84px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); text-align: right; font-size: 15px; }
.plate-table .remove { min-width: 38px; min-height: 38px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--ink-muted); font-size: 18px; line-height: 1; }
.plate-table .remove:hover { border-color: var(--ink); color: var(--ink); }
.plate-empty { padding: 24px; color: var(--ink-muted); font-size: 15px; }
.plate-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 20px 24px; background: var(--bg-elev); }
.plate-add label { display: block; margin-bottom: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.plate-add .grow { flex: 1 1 260px; }
.plate-add .calc-input { width: 100%; }
.plate-add .grams { width: 110px; }
.plate-note { margin-top: 14px; color: var(--ink-muted); font-size: 13.5px; line-height: 1.55; }

/* Cost of protein */
.cost-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 24px; align-items: start; }
.cost-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.cost-card h3 { margin-bottom: 6px; font-size: 20px; }
.cost-card > p { font-size: 14.5px; }
.cost-table-wrap { margin-top: 16px; overflow-x: auto; }
.cost-table { width: 100%; min-width: 440px; border-collapse: collapse; }
.cost-table th, .cost-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14.5px; vertical-align: top; }
.cost-table th { color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.cost-table td.num, .cost-table th.num { text-align: right; white-space: nowrap; }
.cost-table td small { display: block; color: var(--ink-muted); font-size: 12.5px; }
.cost-table a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.cost-form { display: grid; gap: 12px; margin-top: 16px; }
.cost-form label { display: block; margin-bottom: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.cost-form .calc-input { width: 100%; }
.cost-out { margin-top: 16px; padding: 16px; border-radius: var(--r-sm); background: var(--bg-elev); border: 1px solid var(--line); color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.cost-out strong { display: block; color: var(--ink); font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.cost-note { margin-top: 12px; color: var(--ink-muted); font-size: 13px; line-height: 1.5; }

/* Food finder and food index */
.food-search { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.food-search .calc-input { flex: 1 1 280px; }
.food-search .calc-select { flex: 0 1 200px; }
.food-results { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.food-results table { width: 100%; border-collapse: collapse; }
.food-results th, .food-results td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14.5px; }
.food-results th { position: sticky; top: 0; z-index: 1; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; background: var(--bg-elev); }
.food-results td.num, .food-results th.num { text-align: right; white-space: nowrap; }
.food-results a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.food-results small { color: var(--ink-muted); }
.food-count { margin-top: 10px; color: var(--ink-muted); font-size: 13px; }
.food-index { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; margin-top: 40px; }
.food-index h3 { margin-bottom: 10px; color: var(--ink-muted); font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.food-index ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.food-index a { color: var(--ink-soft); font-size: 14.5px; }
.food-index a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.food-index a span { color: var(--ink-muted); font: 400 12px var(--font-mono); }
.diet-tag { display: inline-block; padding: 1px 7px; border-radius: var(--r-pill); font: 500 10.5px/1.6 var(--font-mono); letter-spacing: .04em; white-space: nowrap; }
.diet-veg { background: var(--mint); color: var(--mint-ink); }
.diet-egg { background: var(--butter); color: var(--butter-ink); }
.diet-non-veg { background: var(--rose); color: var(--accent-ink); }

/* Food pages */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.stat { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.stat strong { display: block; color: var(--ink); font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.stat span { display: block; color: var(--ink-muted); font-size: 12.5px; line-height: 1.35; }
.guide-table tr[aria-current] td { background: var(--accent-soft); }
.names-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.names-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.names-list dt { color: var(--ink-muted); font-size: 14px; }
.names-list dd { margin: 0; color: var(--ink); font-size: 15px; font-weight: 500; text-align: right; }
.chart-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chart-filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

@media (max-width: 960px) {
  .cost-grid { grid-template-columns: minmax(0, 1fr); }
  .food-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .plate-toolbar, .plate-total, .plate-add { padding-inline: 16px; }
  .plate-table { min-width: 0; }
  .plate-table th, .plate-table td { padding-inline: 8px; }
  .plate-table th:nth-child(4), .plate-table td:nth-child(4) { display: none; }
  .plate-table input { width: 64px; }
  .names-list { grid-template-columns: minmax(0, 1fr); }
  .food-index { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .plate-add, .plate-presets, .pc-actions, .food-search { display: none; }
}
.ref-list { display: grid; gap: 8px; margin: 40px 0 0; padding: 24px 0 0 20px; border-top: 1px solid var(--line); }
.ref-list li { color: var(--ink-muted); font-size: 13.5px; line-height: 1.5; }
.ref-list a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.calc-card .analyze-btn { width: 100%; }
