/* PairIQ library pages (/learn, /pairings, /nutrients, /health, /supplements, /foods).
   Generated by tools/site/build.mjs; this file styles the markup contract (.lib-*). It sits on top of
   styles.css (tokens, header, footer, buttons, sticky CTA) and borrows the homepage's language: the
   eyebrow with its gradient dot, the ring-gradient accent, pine for "helps", rose for "watch".
   Mobile first. Everything is static and fully visible without JS or with reduced motion; library.js
   only adds the .lib-reveal / .is-in classes, the count-ups, the on-page jump nav and the long-table
   collapse on top. */

[hidden] { display: none !important; }

body.lib { --lib-wrap: 920px; }
.lib-main { padding: 6px 0 80px; }
.lib-wrap { max-width: var(--lib-wrap, 920px); }
.lib-article { min-width: 0; }

/* ── Breadcrumbs ───────────────────────────────────────── */
.lib-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0; margin: 2px 0 10px; font-size: 0.875rem; color: var(--ink-3); }
.lib-crumbs li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.lib-crumbs li + li::before { content: "/"; color: var(--line-strong); padding: 0 2px; }
.lib-crumbs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--ink-2); text-decoration: none; border-radius: 8px; }
.lib-crumbs a:hover { color: var(--ink); }
.lib-crumbs [aria-current] { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
/* On a phone the h1 already names the page, so the trail stops at its parent and stays on one line. */
@media (max-width: 559px) { .lib-crumbs li:last-child:not(:first-child) { display: none; } }

/* ── Page head ─────────────────────────────────────────── */
.lib-head { margin: 0 0 24px; }
.lib-kicker { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.lib-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ring); box-shadow: 0 0 14px rgba(240, 161, 94, 0.55); flex: none; }
.lib-kicker a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; color: inherit; text-decoration: none; }
.lib-kicker a:hover { color: var(--ink); }
.lib-head h1 { font-size: clamp(2.125rem, 1.4rem + 3.6vw, 3.75rem); line-height: 1.0; letter-spacing: -0.04em; font-weight: 770; max-width: 20ch; text-wrap: balance; overflow-wrap: break-word; }
.lib-head--hub h1 { max-width: 22ch; }
.lib-lede { font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.25rem); line-height: 1.5; color: var(--ink-2); margin: 16px 0 0; max-width: 60ch; text-wrap: pretty; }
.lib-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; font-size: 0.875rem; color: var(--ink-3); }
.lib-updated { white-space: nowrap; }

/* ── Badges: the word carries the meaning; colour and arrow reinforce it ── */
.lib-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 0.8125rem; font-weight: 680; line-height: 1.3; color: var(--ink-2); white-space: nowrap; }
.lib-badge--up { color: var(--up); border-color: rgba(79, 169, 122, 0.5); background: rgba(79, 169, 122, 0.1); }
.lib-badge--up::before { content: "\2191"; font-weight: 800; }
.lib-badge--down { color: var(--down); border-color: rgba(242, 122, 138, 0.5); background: rgba(242, 122, 138, 0.1); }
.lib-badge--down::before { content: "\2193"; font-weight: 800; }
.lib-badge--care { color: var(--copper); border-color: rgba(240, 161, 94, 0.55); background: rgba(240, 161, 94, 0.1); }
.lib-badge--care::before { content: "!"; font-weight: 800; }
.lib-badge--strong { color: var(--ink); border-color: var(--line-strong); }
.lib-badge--strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ring); }
.lib-badge--moderate { color: var(--ink-2); border-style: dashed; }
.lib-badge--moderate::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink-3); box-sizing: border-box; }

/* ── The short answer: the one thing a reader or an answer engine takes away ── */
.lib-answer { position: relative; margin: 0 0 32px; padding: 20px 20px 22px; border-radius: 24px; border: 1.5px solid transparent; overflow: hidden; background: linear-gradient(var(--raise-2), var(--raise-2)) padding-box, var(--ring) border-box; box-shadow: 0 28px 70px -40px rgba(199, 122, 160, 0.6); }
.lib-answer::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(240, 161, 94, 0.12), transparent 42%, rgba(124, 131, 255, 0.12)); pointer-events: none; }
.lib-answer > * { position: relative; }
.lib-answer-label { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px; padding: 5px 11px 5px 9px; border-radius: 999px; background: var(--ring); color: var(--canvas); font-size: 0.6875rem; font-weight: 780; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.2; }
.lib-answer-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--canvas); opacity: 0.85; }
.lib-answer > p { margin: 0; font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.4375rem); line-height: 1.42; font-weight: 560; letter-spacing: -0.014em; color: var(--ink); text-wrap: pretty; }
.lib-split { display: grid; gap: 18px; }
.lib-split ul { margin: 0; padding: 0; list-style: none; }
.lib-split li { position: relative; margin: 0 0 9px; padding-left: 18px; color: var(--ink); font-size: 1.0625rem; line-height: 1.45; font-weight: 520; }
.lib-split li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.lib-split-h { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 0.8125rem; font-weight: 760; letter-spacing: 0.08em; text-transform: uppercase; }
.lib-split-h--up { color: var(--up); }
.lib-split-h--up::before { content: "\2191"; }
.lib-split-h--up + ul li::before { background: var(--up); }
.lib-split-h--down { color: var(--down); }
.lib-split-h--down::before { content: "\2193"; }
.lib-split-h--down + ul li::before { background: var(--down); }
@media (min-width: 640px) {
  .lib-answer { padding: 24px 26px 26px; }
  .lib-split { grid-template-columns: 1fr 1fr; gap: 28px; }
}

/* ── Sections and prose ────────────────────────────────── */
.lib-section { margin: 46px 0; scroll-margin-top: calc(var(--head-h, 64px) + 16px); }
.lib-section > h2, .lib-faq > h2 { font-size: clamp(1.625rem, 1.2rem + 1.9vw, 2.25rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 760; margin: 0 0 16px; text-wrap: balance; }
.lib-section-blurb { color: var(--ink-2); margin: -6px 0 18px; max-width: 60ch; font-size: 1.0625rem; }
.lib-sub { font-size: 1.0625rem; font-weight: 700; color: var(--ink); margin: 24px 0 10px; letter-spacing: -0.01em; }
.lib-prose p { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.7; max-width: 66ch; text-wrap: pretty; }
.lib-prose p strong, .lib-prose li strong { color: var(--ink); font-weight: 680; }
.lib-prose ul, .lib-prose ol { color: var(--ink-2); padding-left: 1.2em; max-width: 66ch; line-height: 1.6; }
.lib-prose li { margin: 0 0 8px; }
.lib-prose li::marker { color: var(--ink-3); }
.lib-prose a { color: var(--ink); }
.lib-src { display: inline-block; font-size: 0.8125rem; color: var(--ink-3); }
.lib-prose .lib-src { display: block; margin: -8px 0 20px; }
.lib-note { font-size: 0.875rem; color: var(--ink-3); line-height: 1.55; max-width: 66ch; overflow-wrap: anywhere; }
.lib-note a { color: var(--ink-2); }
.lib-more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 680; text-decoration: none; color: var(--ink); }
.lib-more::after { content: "\2192"; transition: transform 0.2s var(--ease); }
.lib-more:hover { color: var(--copper); }
.lib-more:hover::after { transform: translateX(3px); }

/* ── Finding cards (same card language as the homepage) ── */
.lib-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.lib-card { min-width: 0; }
.lib-card-link { position: relative; display: flex; flex-direction: column; gap: 9px; height: 100%; padding: 18px 18px 16px; border-radius: 20px; background: var(--raise); border: 1px solid var(--line); text-decoration: none; color: var(--ink); overflow: hidden; transition: border-color 0.2s ease, transform 0.3s var(--ease), background 0.2s ease; }
.lib-card-link::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line-strong); opacity: 0; transition: opacity 0.2s; }
.lib-card-link:has(.lib-badge--up)::before { background: var(--up); opacity: 0.9; }
.lib-card-link:has(.lib-badge--down)::before { background: var(--down); opacity: 0.9; }
.lib-card-link:has(.lib-badge--care)::before { background: var(--copper); opacity: 0.9; }
.lib-card-link:hover { border-color: var(--line-strong); background: var(--raise-2); transform: translateY(-3px); }
.lib-card-link:active { transform: scale(0.99); }
.lib-card-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lib-card-group { font-size: 0.8125rem; color: var(--ink-3); }
.lib-card-title { font-weight: 720; font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.015em; text-wrap: pretty; }
.lib-card-text { color: var(--ink-2); font-size: 0.9688rem; line-height: 1.5; }
.lib-card-src { margin-top: auto; padding-top: 4px; font-size: 0.8125rem; color: var(--ink-3); }
.lib-card-src::before { content: "Source "; color: var(--copper); font-weight: 720; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.6875rem; margin-right: 4px; }
@media (min-width: 700px) { .lib-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* ── Food chips ────────────────────────────────────────── */
.lib-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lib-chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-size: 0.9375rem; font-weight: 560; transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.2s var(--ease); }
.lib-chips a:hover { color: var(--ink); border-color: rgba(245, 243, 238, 0.42); background: var(--raise-2); }
.lib-chips a:active { transform: scale(0.97); }
.lib-chips-more { align-self: center; color: var(--ink-3); font-size: 0.9375rem; padding: 0 6px; }

/* ── Link tiles (hub grids) ────────────────────────────── */
.lib-tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.lib-tile { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 64px; height: 100%; padding: 15px 46px 15px 18px; border-radius: 18px; background: var(--raise); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color 0.2s ease, background 0.2s ease, transform 0.3s var(--ease); }
.lib-tile::after { content: "\2192"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; transition: transform 0.2s var(--ease), color 0.2s ease; }
.lib-tile:hover { border-color: var(--line-strong); background: var(--raise-2); transform: translateY(-2px); }
.lib-tile:hover::after { transform: translate(3px, -50%); color: var(--copper); }
.lib-tile-name { font-weight: 720; letter-spacing: -0.015em; }
.lib-tile-text { color: var(--ink-3); font-size: 0.9063rem; line-height: 1.4; }
@media (min-width: 560px) { .lib-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .lib-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }

/* ── Tables: scroll inside their frame on a narrow phone, never the page ── */
.lib-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--raise); }
.lib-table { width: 100%; border-collapse: collapse; font-size: 0.9688rem; }
.lib-table caption { text-align: left; padding: 14px 16px 8px; color: var(--ink); font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; }
.lib-table th, .lib-table td { text-align: left; padding: 11px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.lib-table thead th { color: var(--ink-3); font-weight: 720; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; border-top: 0; padding-top: 12px; padding-bottom: 8px; }
.lib-table caption + thead th { padding-top: 4px; }
.lib-table tbody th { font-weight: 600; color: var(--ink); }
.lib-table tbody tr:nth-child(even) > * { background: rgba(245, 243, 238, 0.025); }
.lib-table td { color: var(--ink-2); font-variant-numeric: proportional-nums; white-space: nowrap; }
.lib-table td:last-child { white-space: normal; }
.lib-table td .lib-src { display: block; margin-top: 4px; white-space: normal; }
.lib-rank td:first-child { color: var(--ink-3); width: 2.5rem; }
.lib-rank a { color: var(--ink); }
.lib-table-more { margin: -2px 0 12px; }

/* ── Definitions (what a food brings) ──────────────────── */
.lib-defs { margin: 0; }
.lib-defs > div { padding: 16px 0; border-top: 1px solid var(--line); }
.lib-defs > div:last-child { border-bottom: 1px solid var(--line); }
.lib-defs dt { font-weight: 720; letter-spacing: -0.01em; margin-bottom: 5px; }
.lib-defs dd { margin: 0; color: var(--ink-2); line-height: 1.55; max-width: 66ch; }
.lib-defs .lib-src { display: block; margin-top: 6px; }

/* ── A single cited fact, set large ────────────────────── */
.lib-fact { position: relative; overflow: hidden; margin: 0 0 32px; padding: 22px 20px 20px; border-radius: 24px; background: var(--raise); border: 1px solid var(--line); display: grid; gap: 6px; }
.lib-fact::before { content: ""; position: absolute; left: 0; top: 0; width: 60%; height: 100%; background: radial-gradient(closest-side at 0% 0%, rgba(240, 161, 94, 0.18), transparent); pointer-events: none; }
.lib-fact > * { position: relative; }
.lib-fact p { margin: 0; color: var(--ink-2); max-width: 54ch; font-size: 1.0625rem; line-height: 1.5; }
.lib-fact .lib-fact-num { font-size: clamp(2.75rem, 2rem + 3.4vw, 4rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1; width: max-content; max-width: 100%; padding-right: 0.06em; font-variant-numeric: proportional-nums; background: var(--ring); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lib-fact .lib-fact-src { font-size: 0.8125rem; color: var(--ink-3); }
.lib-fact .lib-fact-src a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; }

/* ── Sources, references, tiers ────────────────────────── */
.lib-sources { padding-left: 1.5em; margin: 0; }
.lib-sources li { color: var(--ink-2); margin: 0 0 12px; font-size: 0.9688rem; line-height: 1.5; overflow-wrap: anywhere; }
.lib-sources li::marker { color: var(--copper); font-weight: 700; font-variant-numeric: proportional-nums; }
.lib-sources a, .lib-refs a { color: var(--ink); text-decoration-color: var(--line-strong); }
.lib-sources a:hover, .lib-refs a:hover { text-decoration-color: var(--copper); }
.lib-refs { padding-left: 1.8em; margin: 0; }
.lib-refs li { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.lib-refs li::marker { color: var(--ink-3); font-variant-numeric: proportional-nums; }
.lib-refs p { margin: 0; color: var(--ink-2); font-size: 0.9688rem; line-height: 1.5; }
.lib-refs .lib-refs-where { margin-top: 6px; font-size: 0.875rem; color: var(--ink-3); line-height: 1.9; }
.lib-refs .lib-refs-where a { color: var(--ink-2); font-weight: 520; }
.lib-tiers { padding-left: 1.5em; margin: 0; color: var(--ink-2); counter-reset: none; }
.lib-tiers li { margin: 0 0 12px; line-height: 1.55; padding-left: 4px; }
.lib-tiers li::marker { color: var(--copper); font-weight: 760; }
.lib-tiers strong { color: var(--ink); font-weight: 700; }

/* ── Supplement timing ─────────────────────────────────── */
.lib-gaps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.lib-gaps li { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: 14px; align-items: start; padding: 15px 16px; border-radius: 18px; background: var(--raise); border: 1px solid var(--line); color: var(--ink-2); line-height: 1.5; }
.lib-gap-h { font-weight: 780; font-size: 1.5rem; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: proportional-nums; background: var(--ring); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lib-int { padding: 16px 0; border-top: 1px solid var(--line); }
.lib-int:last-of-type { border-bottom: 1px solid var(--line); }
.lib-int .lib-int-trigger { display: flex; align-items: center; gap: 8px; font-weight: 720; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 6px; }
.lib-int .lib-int-trigger::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--down); flex: none; }
.lib-int p { color: var(--ink-2); margin: 0 0 6px; max-width: 66ch; line-height: 1.55; }
.lib-int .lib-int-link { margin: 0; font-size: 0.9375rem; }
.lib-int-link a { display: inline; padding: 12px 0; line-height: 1.5; color: var(--ink); font-weight: 620; text-decoration-color: var(--line-strong); }
.lib-int-link a::after { content: " \2192"; color: var(--ink-3); white-space: nowrap; }
.lib-inline-list { color: var(--ink-2); line-height: 2.1; }
.lib-inline-list a { padding: 8px 0; font-weight: 560; }

/* ── FAQ (same pattern as the homepage) ────────────────── */
.lib-faq details { border-top: 1px solid var(--line); }
.lib-faq details:last-child { border-bottom: 1px solid var(--line); }
.lib-faq summary { list-style: none; cursor: pointer; position: relative; display: flex; align-items: center; min-height: 60px; padding: 16px 44px 16px 0; font-weight: 680; font-size: 1.0625rem; line-height: 1.4; letter-spacing: -0.012em; }
.lib-faq summary::-webkit-details-marker { display: none; }
.lib-faq summary::after { content: ""; position: absolute; right: 10px; top: 50%; width: 11px; height: 11px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: translateY(-75%) rotate(45deg); transition: transform 0.25s var(--ease); }
.lib-faq details[open] summary::after { transform: translateY(-25%) rotate(225deg); }
.lib-faq-a p { color: var(--ink-2); margin: 0 0 20px; max-width: 66ch; line-height: 1.6; }
.lib-faq details[open] .lib-faq-a { animation: libFaqIn 0.35s var(--ease); }
@keyframes libFaqIn { from { opacity: 0; transform: translateY(-6px); } }

/* ── Notes and the call to action ──────────────────────── */
.lib-note-box { margin: 32px 0; padding: 16px 18px; border-left: 2px solid var(--copper); background: rgba(240, 161, 94, 0.06); border-radius: 0 16px 16px 0; }
.lib-note-box p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; }
.lib-cta { position: relative; overflow: hidden; margin: 52px 0; padding: 28px 22px 24px; border-radius: 28px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(240, 161, 94, 0.12), rgba(199, 122, 160, 0.08) 50%, rgba(124, 131, 255, 0.14)), var(--raise); }
.lib-cta::before { content: ""; position: absolute; right: -20%; top: -40%; width: 70%; height: 120%; background: radial-gradient(closest-side, rgba(124, 131, 255, 0.22), transparent 72%); pointer-events: none; }
.lib-cta > * { position: relative; }
.lib-cta-kicker { display: inline-flex; align-items: center; gap: 9px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; }
.lib-cta-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ring); box-shadow: 0 0 14px rgba(240, 161, 94, 0.55); }
.lib-cta h2 { font-size: clamp(1.75rem, 1.25rem + 2.4vw, 2.75rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 770; margin: 0 0 12px; max-width: 18ch; text-wrap: balance; }
.lib-cta p { color: var(--ink-2); max-width: 54ch; margin: 0 0 20px; font-size: 1.0625rem; line-height: 1.5; }
.lib-cta .lib-cta-btn { width: 100%; min-height: 56px; }
.lib-cta .small { margin: 12px 0 0; color: var(--ink-3); }
@media (min-width: 560px) { .lib-cta { padding: 38px 36px 32px; } .lib-cta .lib-cta-btn { width: auto; padding: 0 28px; } }

/* ── Jump links: one swipeable row on phones, wrapped on wider screens ── */
.lib-jump { margin: 0 calc(-1 * var(--gutter)) 10px; }
.lib-jump ul { list-style: none; margin: 0; padding: 2px var(--gutter) 10px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
.lib-jump ul::-webkit-scrollbar { display: none; }
.lib-jump li { scroll-snap-align: start; flex: none; }
.lib-jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 15px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); white-space: nowrap; text-decoration: none; color: var(--ink-2); font-size: 0.9375rem; font-weight: 560; transition: color 0.15s, border-color 0.15s; }
.lib-jump a:hover { color: var(--ink); border-color: var(--line-strong); }
.lib-toc { margin-top: -6px; margin-bottom: 4px; }
.lib-toc-k { display: none; }
@media (min-width: 760px) { .lib-jump { margin: 0 0 10px; } .lib-jump ul { flex-wrap: wrap; overflow: visible; padding: 2px 0 10px; } }

/* The A–Z row sticks under the header on phones so any letter is one tap away. */
.lib-az { position: sticky; top: var(--head-h, 64px); z-index: 5; margin-bottom: 4px; background: rgba(11, 14, 12, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lib-az ul { padding: 8px var(--gutter); gap: 6px; }
.lib-az a { min-width: 44px; justify-content: center; padding: 8px 0; font-weight: 680; }
@media (min-width: 760px) { .lib-az { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; } .lib-az ul { padding: 2px 0 10px; } }

/* ── Food index ────────────────────────────────────────── */
.lib-filter { margin: 0 0 14px; }
.lib-filter label { display: block; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.01em; }
.lib-filter input { width: 100%; min-height: 54px; padding: 0 18px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--raise); color: var(--ink); font: inherit; font-size: 1.0625rem; -webkit-appearance: none; appearance: none; transition: border-color 0.15s; }
.lib-filter input:hover { border-color: rgba(245, 243, 238, 0.4); }
.lib-filter input::placeholder { color: var(--ink-3); }
.lib-filter input:focus-visible { outline: 2px solid var(--indigo-soft); outline-offset: 2px; border-color: var(--indigo-soft); }
.lib-filter-count { margin: 8px 0 0; min-height: 1.5em; }
.lib-letter { margin: 22px 0; scroll-margin-top: calc(var(--head-h, 64px) + 64px); }
.lib-letter h2 { font-size: 1.75rem; margin: 0 0 4px; letter-spacing: -0.03em; font-weight: 800; background: var(--ring); -webkit-background-clip: text; background-clip: text; color: transparent; width: max-content; padding-right: 0.1em; }
.lib-food-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.lib-food-list a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink-2); line-height: 1.3; padding: 6px 0; transition: color 0.15s; }
.lib-food-list a:hover { color: var(--ink); }
@media (min-width: 700px) { .lib-food-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lib-letter { scroll-margin-top: calc(var(--head-h, 64px) + 12px); } }

/* ── Stats and the combinatorics band ──────────────────── */
.lib-stats { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lib-stats li { padding: 18px 16px; border-radius: 18px; background: var(--raise); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.lib-stat-num { display: inline-block; font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; width: max-content; max-width: 100%; padding-right: 0.06em; font-variant-numeric: proportional-nums; background: var(--ring); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lib-stat-label { color: var(--ink-2); font-size: 0.875rem; line-height: 1.35; }
@media (min-width: 760px) { .lib-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.lib-math { position: relative; overflow: hidden; padding: 26px 20px; border-radius: 26px; border: 1px solid var(--line); background: var(--raise); }
.lib-math::before { content: ""; position: absolute; left: 50%; top: 0; width: 90%; height: 70%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(124, 131, 255, 0.26), transparent 72%); pointer-events: none; }
.lib-math > * { position: relative; }
.lib-math > h2 { overflow-wrap: normal; font-variant-numeric: proportional-nums; font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.125rem); letter-spacing: -0.025em; }
.lib-bignum { background: var(--ring); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lib-math p { color: var(--ink-2); margin: 0; max-width: 60ch; font-size: 1.0625rem; line-height: 1.5; }
@media (max-width: 639px) { .lib-bignum { display: block; margin: 4px 0; } }
@media (min-width: 640px) { .lib-math { padding: 34px 32px; } }

/* ── Scroll reveals (classes added by library.js; static without it) ── */
html.js .lib-reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.7s var(--ease); }
html.js .lib-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .lib-reveal { opacity: 1; transform: none; transition: none; }
  .lib-card-link, .lib-tile, .lib-tile::after, .lib-more::after, .lib-chips a, .lib-faq summary::after, .lib-filter input { transition: none; }
  .lib-card-link:hover, .lib-tile:hover { transform: none; }
  .lib-faq details[open] .lib-faq-a { animation: none; }
}
