/* Chomp API Center — corrected preview stylesheet.
   Hand-written, self-contained: every class used in the preview
   HTML is defined in this file. No external build, no framework.
   Portal shell rule: NO fixed positioning anywhere in the portal
   shell — the Friday overlap defect cannot recur by construction.
   (The marketing header is not the portal shell: it is fixed,
   mirroring the live site's fixed header.)

   Palette: the site's REAL brand tokens, extracted from the
   production compiled stylesheet (public/assets/css/tailwind.css
   on master): brand-primary rgb(59 130 246) #3b82f6,
   brand-secondary rgb(236 72 153) #ec4899. Neutrals are the same
   slate scale the production templates use. No invented hues.
   Hover states stay in the brand blue family (--brand-dark is
   blue-600 of the same scale) — Peter's ruling: no purple hovers.

   Brand alignment (Peter, 2026-11-16 evening): the consumer
   index's design language, from views/public/index.html and
   views/template-tailwind.html on master — Inter as the typeface
   (the base template loads Inter 400–800 and sets body in it),
   slate-600 prose, slate-900 extrabold tight-tracked headlines,
   cards at rounded-2xl (1rem) with the redesign's own card
   shadow (0 1px 2px rgba(15,23,42,.05), per the base template's
   card rule), controls bordered slate-300 while cards sit on
   slate-200, and a slate-50 hero with a soft brand-blue wash.
   Tokens below carry that language; components reference them. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #0f172a;
  --body-text: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --control-line: #cbd5e1;
  --panel: #f8fafc;
  --brand: #3b82f6;
  --brand-dark: #2563eb;
  --brand-tint: #eff6ff;
  --radius-card: 1rem;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05);
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --code-key: #7dd3fc;
  --code-string: #c4b5fd;
  --code-number: #fca5a5;
  --rail-bg: #f8fafc;
  --current-bg: #dbeafe;
  /* One content measure for every block inside the portal shell:
     prose, cards, steps, lists all align to the same width. */
  --portal-measure: 52rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body-text);
  background: #ffffff;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); text-decoration: underline; }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- shared ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #ffffff; }
.btn-primary:hover { background: var(--brand-dark); color: #ffffff; transform: scale(1.02); }
.btn-secondary { background: #ffffff; color: var(--ink); border-color: var(--control-line); }
.btn-secondary:hover { background: var(--panel); border-color: #94a3b8; }
.btn-sm { min-height: 44px; padding: 0.4rem 0.8rem; font-size: 0.88rem; width: 100%; }

.section { padding: 5rem 0; }
.section-alt { background: var(--panel); }
/* Two sections in a row on the SAME background are one continuous
   band, not two: the second keeps the band's single gap (the first
   section's bottom padding) instead of stacking a second 5rem on
   top of it. Without this, plain-after-plain (licensing, before
   "The jobs a license fits") and alt-after-alt pairs opened a
   10rem dead gap. Background changes keep the full padding. */
.section:not(.section-alt) + .section:not(.section-alt),
.section-alt + .section-alt { padding-top: 0; }
.section-title { color: var(--ink); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 0.5rem; }
/* Marketing prose uses the section's full measure — the same
   width as the cards and tables under it (Peter: text wrapping
   well short of the container reads as a layout bug). */
.section-lede { margin: 0 0 1.5rem; max-width: none; }
.section-lede-full { max-width: none; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
/* "What you can build" carries six cards: a deliberate 3x2 grid
   so no card orphans into a second row alone (Peter, round 3). */
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
/* Cards are equal-height flex columns with the link pinned to
   the bottom, so links line up across a row no matter how uneven
   the card text is (Peter, home + docs guides). */
.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  display: flex; flex-direction: column; height: 100%;
}
.card-title { color: var(--ink); font-size: 1rem; font-weight: 600; margin: 0 0 0.4rem; }
.card-text { margin: 0; font-size: 0.95rem; }
.card-link { display: inline-block; margin-top: 0; padding-top: 0.75rem; font-weight: 600; font-size: 0.92rem; }
/* Only the FIRST link in a card takes the auto top margin that
   pins the link group to the card's bottom; later links follow
   at the uniform 0.75rem gap above. (With auto margins on every
   link, two-link cards split the free space between the links
   and the spacing read as inconsistent — Peter, 2026-11-17.) */
.card-link:first-of-type { margin-top: auto; }
/* Guides-by-task on the docs home: a deliberate 2x2 grid. */
.card-grid-2x2 { grid-template-columns: repeat(2, 1fr); }

/* Code panels: light text on a very dark background.
   --code-text #e2e8f0 on --code-bg #0f172a (slate-900, the
   production templates' dark) = contrast above 13:1. */
.code-panel {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  max-width: 100%;
  min-width: 0;
  position: relative;
  font-size: 0.86rem;
  line-height: 1.6;
}
.code-panel pre { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; }
.code-title {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--code-key);
  padding-right: 4.5rem;
  margin: 0 0 0.5rem;
}
.tok-key { color: var(--code-key); }
.tok-string { color: var(--code-string); }
.tok-number { color: var(--code-number); }

/* ---------- marketing header / footer ---------- */

/* The live site's header is fixed (position: fixed, top 0,
   translucent white with a blur). The marketing header mirrors
   that behaviour; the marketing pages carry top padding so the
   fixed bar never overlaps content. */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.marketing-page { padding-top: 4.3rem; }
/* The header bar's inner box is identical to .container (same
   max-width, same side padding, same auto margins), so the header
   edges and the page content edges align exactly. */
.site-header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 80rem; margin: 0 auto; padding: 0.75rem 1.25rem;
}
.brand {
  color: var(--ink); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.025em; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-api { color: var(--brand); }
/* The cookie mark: the live site's brand tile — a rounded square
   in the brand tint holding the cookie-bite glyph (Font Awesome
   Free solid, the icon set production loads) in brand blue. */
.brand-tile {
  width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
  background: var(--brand-tint); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.brand-tile svg { width: 1.5rem; height: 1.5rem; fill: currentColor; display: block; }
.brand-tile-sm { width: 2rem; height: 2rem; border-radius: 0.55rem; }
.brand-tile-sm svg { width: 1.15rem; height: 1.15rem; }
.site-nav { display: flex; gap: 1.25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-link { color: var(--body-text); text-decoration: none; font-weight: 500; font-size: 0.875rem; }
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link-current { color: var(--ink); font-weight: 700; }

/* Footer mirrors the production site's footer (fetched from
   chompthis.com): white with a top border, a branding column
   (cookie tile + wordmark, blurb, social circles) beside
   Product / Tools / Support link columns, and a bottom bar with
   the copyright line. Spacing follows production's generous
   scale (pt-20 / pb-12 / mt-20 in its Tailwind terms). */
/* No margin-top here: the last section's own bottom padding plus
   the footer's top padding set the gap. A 5rem margin on top of
   both stacked into a dead white band after the FAQ (Peter,
   round 3). */
.site-footer { border-top: 1px solid var(--line); background: #ffffff; padding: 5rem 0 3rem; margin-top: 0; }
.footer-grid {
  display: grid; gap: 3rem; margin-bottom: 4rem;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
.footer-brand-link {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--ink); font-weight: 800; font-size: 1.5rem;
  letter-spacing: -0.02em; text-decoration: none; margin-bottom: 1.5rem;
}
.footer-brand-link:hover { text-decoration: none; color: var(--ink); }
.footer-blurb { color: var(--muted); font-size: 0.88rem; line-height: 1.6; max-width: 24rem; margin: 0 0 2rem; }
.footer-social { display: flex; gap: 1rem; }
.footer-social-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 999px;
  background: var(--panel); color: #94a3b8;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.footer-social-btn svg { width: 1.05rem; height: 1.05rem; fill: currentColor; display: block; }
.footer-social-btn:hover { color: var(--brand); background: var(--brand-tint); text-decoration: none; }
.footer-col-title {
  color: var(--ink); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.09em; text-transform: uppercase; margin: 0 0 1.5rem;
}
.footer-col-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.footer-col-list a { color: var(--muted); font-size: 0.88rem; text-decoration: none; }
.footer-col-list a:hover { color: var(--brand); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid #f1f5f9; padding-top: 2rem;
  color: #94a3b8; font-size: 0.75rem;
}
.footer-bottom p { margin: 0; }

/* ---------- marketing page ---------- */

/* Masthead: headline, subhead, and calls to action centered as
   one composition (Peter, round 2 — the left-set masthead read
   as off-center against the centered page). */
/* Hero ground: the consumer index sets its hero on slate-50
   with a bottom border and soft brand-color washes in two
   corners (brand-primary at 5% bottom-left; its violet twin is
   deliberately not carried over — the preview keeps violet out
   under Peter's no-purple discipline). */
.hero {
  padding: 5.5rem 0 5rem; text-align: center;
  background-color: var(--panel);
  background-image: radial-gradient(500px 500px at -100px calc(100% + 300px), rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0) 70%);
  border-bottom: 1px solid var(--line);
}
.hero-title { color: var(--ink); font-size: 3rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; margin: 0 auto 1.5rem; max-width: 52rem; }
.hero-sub { font-size: 1.12rem; margin: 0 auto 2.25rem; max-width: 56rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.hero-note { color: var(--muted); font-size: 0.9rem; margin-top: 1.5rem; }
.hero-note-line { display: block; }

/* Proof placement (Peter's rulings — each item where it does
   its job, not one stacked block):
   - the Product Hunt credential sits in the hero, above the
     headline (.hero-badge / .proof-badge) — moved up from the
     proof band in round 2 (2026-11-17) so the credential
     introduces the page itself;
   - the two awards and the products stat form one restrained
     row in the same band (.proof-stats-band / .proof-stats);
   - the institutions strip sits lower, beside the evaluation
     material (.proof-usedat in its own section).
   All of it is carried over from the current marketing page —
   awards as text; the institutions strip is the current page's
   own logo asset, kept local. */
/* The Product Hunt chip moved into the hero, above the headline
   (Peter, 2026-11-17 round 2): the credential introduces the page,
   and the proof band below the hero keeps the three stats. */
.hero-badge { margin: 0 0 2rem; }
.proof-badge {
  color: var(--brand); font-weight: 700; font-size: 0.95rem;
  border: 1px solid var(--brand); background: var(--brand-tint);
  border-radius: 999px; padding: 0.3rem 0.85rem;
  display: inline-block;
}
.proof-stats-band { border-bottom: 1px solid var(--line); background: var(--panel); }
/* One rhythm for the band: 1.75rem above and below the stats
   (the chip that used to headline the band now sits in the
   hero); each stat is a centered column of a fixed minimum
   width so the three baselines align (Peter, round 3: the
   spacing read as off). */
.proof-stats {
  display: flex; justify-content: center; align-items: flex-start;
  gap: 3rem; flex-wrap: wrap; text-align: center;
  padding-top: 1.75rem; padding-bottom: 1.75rem;
}
.proof-stat {
  padding: 0 0.5rem; min-width: 9.5rem;
  display: flex; flex-direction: column; align-items: center;
}
.proof-stat-value { color: var(--ink); font-size: 1.6rem; font-weight: 800; margin: 0 0 0.15rem; }
.proof-stat-label {
  color: var(--body-text); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; margin: 0 0 0.3rem;
}
.proof-stat-source {
  color: var(--muted); font-size: 0.72rem; font-weight: 500;
  background: #ffffff; border: 1px solid var(--control-line);
  border-radius: 999px; padding: 0.1rem 0.55rem; margin: 0;
  display: inline-block; white-space: nowrap;
}
.proof-usedat {
  text-align: center; color: var(--muted); font-size: 0.92rem;
}
.proof-usedat-names { color: var(--body-text); font-weight: 600; }
.proof-usedat-caption {
  color: var(--muted); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; margin: 0 0 0.6rem;
}
.proof-usedat-img {
  display: block; width: 100%; max-width: 56rem; height: auto;
  margin: 0 auto;
}

.plans-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
/* Plan cards are equal-height flex columns; the Subscribe button
   is pinned to the bottom so the buttons line up across cards. */
.plan-card {
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem; display: flex; flex-direction: column; height: 100%;
}
.plan-card-featured { border-color: var(--brand); background: var(--brand-tint); }
.plan-name { color: var(--ink); font-weight: 700; margin: 0 0 0.25rem; }
.plan-price { color: var(--ink); font-size: 1.35rem; font-weight: 800; margin: 0; }
.plan-price-unit { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.plan-note { font-size: 0.9rem; margin: 0.5rem 0 1rem; }
.cell-note { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
/* Plan facts as structured label/value rows, not prose: a buyer
   scanning for ten seconds reads the price-shaping facts without
   parsing a paragraph (Peter, round 3 — the Premium card was a
   wall of text). */
.plan-facts { list-style: none; margin: 0.6rem 0 1rem; padding: 0; display: grid; font-size: 0.9rem; }
.plan-fact {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.75rem; padding: 0.45rem 0; border-top: 1px solid var(--line);
}
.plan-fact:first-child { border-top: none; padding-top: 0.15rem; }
.plan-fact-label { color: var(--muted); white-space: nowrap; }
.plan-fact-value { color: var(--ink); font-weight: 600; text-align: right; }
/* A fact row whose note belongs to the whole card, not the
   value column: the row wraps and the note takes a full-width
   line of its own under the label/value pair (the fair-use
   note under Premium's "Unlimited" — Peter, 2026-11-17). */
.plan-fact-stacked { flex-wrap: wrap; }
.plan-fact-stacked .cell-note { flex: 1 1 100%; margin-top: 0.35rem; }
.plan-subscribe { margin-top: auto; }
.plans-trial-note { margin: 0 0 1rem; font-size: 0.95rem; }
.plans-more { margin-top: 1.25rem; }

/* Two-door signup: the trial door (the current 5-day trial on
   new Standard and Premium subscriptions) sits in its own
   tinted band so it never reads as just another plan; the
   subscribe buttons live inside the plan columns. */
.trial-cta {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  justify-content: space-between;
  background: var(--brand-tint); border: 1px solid var(--brand);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem;
}
.trial-cta-title { color: var(--ink); font-weight: 700; font-size: 1.05rem; margin: 0 0 0.2rem; }
.trial-cta-sub { margin: 0; font-size: 0.94rem; max-width: 38rem; }
.subscribe-row td { vertical-align: middle; }
.subscribe-btn { white-space: nowrap; }

/* overflow-x: clip, not auto: an auto/hidden overflow makes the
   wrap a scroll container, and the comparison table's sticky
   header (round 3) would then stick inside the wrap — which
   never scrolls vertically — instead of under the page header.
   Clip keeps the sticky header on the page's own scroll. On
   narrow screens the table is wider than its container and
   horizontal scrolling matters more, so the wrap scrolls
   there (and the header sticks within the wrap instead). */
.table-wrap { overflow-x: clip; }
@media (max-width: 760px) {
  .table-wrap { overflow-x: auto; }
}
.compare-table { border-collapse: collapse; width: 100%; min-width: 44rem; background: #ffffff; }
.compare-table th, .compare-table td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.94rem;
  vertical-align: top;
}
/* The sticky header lives on the thead element, not the
   cells: Chromium does not stick table cells, and it does
   not stick anything inside an overflow:auto wrap — the two
   failure modes round 3's first attempt hit and the geometry
   probe caught. thead + the wrap's overflow-x: clip sticks
   under the fixed marketing header (offset = its height). */
.compare-table thead { position: sticky; top: 4.35rem; z-index: 5; }
.compare-table thead th {
  background: var(--panel); color: var(--ink); font-size: 1rem;
  box-shadow: inset 0 -1px 0 var(--line);
}
.compare-table tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.cell-yes { color: var(--brand); font-weight: 600; }
.cell-no { color: var(--muted); }
/* Structured mini-rows inside a comparison cell (Premium's
   per-user tiers) instead of one prose blob: a lead line, then
   aligned tier rows split by hairlines — the same presentation
   as the per-user rows on the home plan card. */
.cell-lead { margin: 0; color: var(--ink); font-weight: 600; }
.cell-facts { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; }
.cell-facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.4rem 0; border-top: 1px solid var(--line); }
.cell-facts li:first-child { border-top: none; padding-top: 0.15rem; }
.cell-facts li:last-child { padding-bottom: 0; }
.cell-fact-value { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* ---------- pricing: cost estimator ---------- */

.estimator { margin-top: 2.75rem; }
.estimator-controls {
  display: flex; flex-direction: column; align-items: stretch; gap: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--panel); padding: 1.1rem 1.25rem;
}
/* One control per row — calls on the first row, monthly active
   users on the second — instead of both sharing a wrapped flex
   row (Peter, 2026-11-17: the shared row read as clutter). */
.estimator-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.estimator-label { color: var(--ink); font-weight: 700; }
.estimator-range { flex: 1 1 16rem; min-height: 44px; accent-color: var(--brand); }
.estimator-volume { display: flex; align-items: center; gap: 0.5rem; }
.estimator-input {
  width: 8.5rem; min-height: 44px;
  border: 1px solid var(--control-line); border-radius: 0.5rem;
  padding: 0.5rem 0.7rem; font-size: 1rem; color: var(--ink); background: #ffffff;
}
.estimator-unit { color: var(--muted); font-size: 0.92rem; }
.estimator-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-top: 1rem;
}
.estimator-card {
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}
.estimator-card-cheapest { border-color: var(--brand); background: var(--brand-tint); }
.estimator-plan { color: var(--ink); font-weight: 700; margin: 0 0 0.25rem; }
.estimator-cost { color: var(--ink); font-size: 1.35rem; font-weight: 800; margin: 0; }
.estimator-cost-unit { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.estimator-detail { font-size: 0.9rem; margin: 0.5rem 0 0; }
.estimator-flag {
  display: inline-block; margin-top: 0.6rem;
  width: fit-content; max-width: 100%;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em;
  line-height: 1.35;
  border-radius: 999px; padding: 0.3rem 0.7rem;
}
.estimator-flag-best { background: var(--current-bg); color: var(--brand); }
/* The flag's own display:inline-block above defeats the
   hidden attribute the script toggles, so without this rule
   every card showed "Cheapest at this volume" at once (visible
   in Peter's 2026-11-17 screenshot). The script's state is the
   truth; the CSS now honors it. */
.estimator-flag[hidden] { display: none; }
.estimator-note { color: var(--muted); font-size: 0.92rem; margin-top: 1rem; max-width: 52rem; }
.estimator-validation { color: var(--ink); font-size: 0.95rem; font-weight: 700; margin-top: 1rem; max-width: 52rem; }

/* Diet compatibility-level key, printed wherever a diet-label
   example appears so the levels are defined at the spot. */
.level-key { margin-top: 1rem; font-size: 0.95rem; max-width: 52rem; }
.level-key p { margin: 0.3rem 0; }
.level-num { color: var(--ink); font-weight: 800; }
.rail-panel .level-key { margin-top: 0; }

.faq-item { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q { color: var(--ink); font-size: 1.05rem; margin: 0 0 0.35rem; }
.faq-a { margin: 0; max-width: none; }

/* ---------- portal shell (dedicated, no fixed positioning) ---------- */

.portal-topbar { background: var(--ink); color: #ffffff; }
.portal-topbar-inner {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  max-width: 88rem; margin: 0 auto; padding: 0.6rem 1.25rem;
}
.portal-brand {
  color: #ffffff; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.025em; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.portal-brand:hover { color: #ffffff; text-decoration: none; opacity: 0.9; }
.portal-brand-sub { color: #cbd5e1; font-weight: 500; }
.portal-crosslinks { display: flex; gap: 1.1rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.portal-crosslink { color: #e2e8f0; text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.portal-crosslink:hover { color: #ffffff; text-decoration: none; }
.portal-crosslink-cta {
  background: var(--brand); color: #ffffff; border-radius: 0.5rem;
  padding: 0.45rem 0.85rem; min-height: 44px; display: inline-flex; align-items: center;
}
.portal-crosslink-cta:hover { background: var(--brand-dark); color: #ffffff; }

/* Portal pages are a full-height column: the topbar, then the
   shell grows to fill the viewport, so the rail background reaches
   the bottom of the page even when the content is short. */
.portal-page { display: flex; flex-direction: column; min-height: 100vh; }

.portal-body {
  display: flex; align-items: stretch; gap: 0;
  max-width: 88rem; margin: 0 auto; width: 100%;
  flex: 1 0 auto;
}
/* The rail column stretches the full height of the shell (flex
   stretch on .portal-body), so its background runs to the bottom
   of the page regardless of how much navigation it holds. The
   sticky behaviour lives on the inner wrapper, so the navigation
   itself stays in view on long pages. */
.portal-rail {
  width: 280px; flex: 0 0 280px;
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
}
.rail-inner {
  position: sticky; top: 0;
  max-height: 100vh; overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 1.25rem 1rem 2rem;
}
.search-box {
  width: 100%; min-height: 44px;
  border: 1px solid var(--control-line); border-radius: 0.5rem;
  padding: 0.5rem 0.75rem; font-size: 0.92rem;
  background: #ffffff; color: var(--ink);
  margin-bottom: 1.25rem;
}
.rail-section { margin-bottom: 1.5rem; }
.rail-title {
  color: var(--muted); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  margin: 0 0 0.5rem; padding: 0 0.5rem;
}
.rail-link {
  display: block; padding: 0.5rem; border-radius: 0.45rem;
  color: var(--body-text); text-decoration: none; font-size: 0.94rem;
  min-height: 44px;
}
.rail-link:hover { background: #eef2f7; text-decoration: none; }
.rail-link-current { background: var(--current-bg); color: var(--ink); font-weight: 700; }
.rail-op-path { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.74rem; color: var(--muted); }
.rail-trial {
  background: var(--brand-tint); border: 1px solid var(--brand);
  border-radius: var(--radius-card); padding: 0.9rem 1rem; margin-top: 0.5rem;
}
.rail-trial-title { color: var(--ink); font-weight: 700; font-size: 0.98rem; margin: 0 0 0.25rem; }
.rail-trial-sub { font-size: 0.88rem; margin: 0 0 0.7rem; }
.rail-trial .btn { display: flex; align-items: center; justify-content: center; text-align: center; width: 100%; }

.portal-main { flex: 1 1 auto; min-width: 0; padding: 1.75rem 2rem 3rem; }
.portal-main h1 { color: var(--ink); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 0.75rem; line-height: 1.25; }
.portal-main h2 { color: var(--ink); font-size: 1.3rem; margin: 2rem 0 0.6rem; }
.portal-main p { max-width: var(--portal-measure); }
.portal-main .card-grid { max-width: var(--portal-measure); }

.breadcrumb { color: var(--muted); font-size: 0.88rem; margin: 0 0 1rem; }
.breadcrumb a { color: var(--muted); }
.crumb-sep { margin: 0 0.4rem; }

.base-card {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--panel); padding: 1rem 1.25rem; max-width: var(--portal-measure); position: relative;
}
.base-card-label { color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.3rem; padding-right: 4.5rem; }
.base-url {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; color: var(--ink);
  overflow-wrap: anywhere; margin: 0;
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: var(--portal-measure); }
.step { display: flex; gap: 0.9rem; min-width: 0; }
.step-num {
  flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 999px;
  background: var(--brand); color: #ffffff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-body { flex: 1 1 auto; min-width: 0; }
.step-title { color: var(--ink); font-weight: 700; margin: 0.2rem 0 0.25rem; }
.step-text { margin: 0; }
.step-action { margin: 0.8rem 0 0; }

.endpoint-list { border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; max-width: var(--portal-measure); }
/* Endpoint rows are a strict four-column grid — method, name,
   path, description start at the same position in every row
   (Peter: the flex rows were jumbled). */
.endpoint-row {
  display: grid; align-items: baseline;
  grid-template-columns: 3.2rem 12.5rem 15.5rem 1fr;
  column-gap: 1rem;
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--body-text);
}
@media (max-width: 720px) {
  .endpoint-row { grid-template-columns: 3.2rem 1fr; row-gap: 0.25rem; }
  .endpoint-row .op-path, .endpoint-row .endpoint-desc { grid-column: 2; }
}
.endpoint-row:last-child { border-bottom: none; }
.endpoint-row:hover { background: var(--panel); text-decoration: none; }
.endpoint-name { color: var(--ink); font-weight: 700; }
.endpoint-desc { font-size: 0.92rem; }
.method-pill {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; font-weight: 700;
  background: var(--current-bg); color: var(--brand);
  border-radius: 0.35rem; padding: 0.15rem 0.5rem;
}
.op-path { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- operation page: two-pane at desktop ---------- */

.op-grid { display: block; }
.op-prose { min-width: 0; }
/* Code panels in the prose flow (the error samples) need air
   between them; in the rail they sit inside their own panels. */
.op-prose .code-panel { margin-bottom: 1rem; }
.op-rail { min-width: 0; }
/* The "In context" links and the prev/next nav live in their
   own block after the rail in the markup, so the stacked
   layout can order them last (see the round-2 section at the
   end of this file). On desktop the grid areas below place
   the block under the prose column, exactly where it sat
   when it was part of the prose flow. */
.op-after { min-width: 0; }

/* The two-pane layout stacks earlier than it used to (1100px,
   up from 1024px): between 1024 and 1100 the parameter table
   and the 420px rail squeezed each other (Peter, 2026-11-17
   round 2). */
@media (min-width: 1101px) {
  .op-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    grid-template-areas: "prose rail" "after rail";
    gap: 2rem;
    align-items: start;
  }
  .op-prose { grid-area: prose; }
  .op-after { grid-area: after; }
  .op-rail {
    grid-area: rail;
    position: sticky; top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-bottom: 1.5rem;
  }
}

.rail-panel { margin-bottom: 1.5rem; min-width: 0; }
.rail-panel-title { color: var(--ink); font-size: 1.02rem; margin: 0 0 0.6rem; }

.param-table { border-collapse: collapse; width: 100%; }
.param-table th, .param-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.5rem; text-align: left; font-size: 0.93rem; vertical-align: top;
}
.param-table thead th { color: var(--ink); border-bottom: 2px solid var(--line); }
.param-name { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); font-size: 0.88rem; }
.param-type { color: var(--muted); font-size: 0.85rem; }
.req-badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: #fee2e2; color: #991b1b; border-radius: 0.3rem; padding: 0.1rem 0.4rem;
}
.opt-badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: #e2e8f0; color: #475569; border-radius: 0.3rem; padding: 0.1rem 0.4rem;
}

.tryit { border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1rem 1.1rem; background: #ffffff; }
.field-label { display: block; color: var(--ink); font-weight: 600; font-size: 0.88rem; margin: 0.7rem 0 0.3rem; }
.field-label:first-child { margin-top: 0; }
.field-input {
  width: 100%; min-height: 44px; border: 1px solid var(--control-line); border-radius: 0.5rem;
  padding: 0.5rem 0.7rem; font-size: 0.92rem; color: var(--ink); background: #ffffff;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.tryit .btn { margin-top: 1rem; width: 100%; }
.tryit-note { color: var(--muted); font-size: 0.84rem; margin: 0.7rem 0 0; }
.tryit-status { color: var(--muted); font-size: 0.82rem; margin: 0.8rem 0 0; overflow-wrap: anywhere; }
.tryit-status:empty { margin: 0; }
.tryit-alert {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 0.5rem;
  color: #991b1b; font-size: 0.88rem; line-height: 1.5;
  padding: 0.7rem 0.9rem;
}
.tryit-alert a { color: #991b1b; text-decoration: underline; }
.tryit-response { margin-top: 0.8rem; min-width: 0; max-width: 100%; }
.tryit-response pre { max-height: 60vh; overflow-y: auto; }
.btn-spinner {
  display: inline-block; width: 0.85em; height: 0.85em; margin-right: 0.45em;
  border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #ffffff;
  border-radius: 50%; vertical-align: -0.1em;
  animation: tryit-spin 0.7s linear infinite;
}
@keyframes tryit-spin { to { transform: rotate(360deg); } }

.schema-list { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.schema-row { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
.schema-row:last-child { border-bottom: none; }
/* Subfield rows: an object's fields broken out as their own
   indented rows under the parent field, instead of one prose
   paragraph per object (Peter, round 3). The left rule is a
   neutral slate nesting guide — hierarchy, not a status color
   (Peter, 2026-11-17: the blue read as an unexplained signal). */
.schema-row-sub { padding-left: 3.4rem; border-left: 3px solid var(--line); background: var(--panel); }
.schema-row-sub .schema-name { font-weight: 500; }
.schema-name { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); font-weight: 600; font-size: 0.9rem; }
.schema-type { color: var(--muted); font-size: 0.83rem; margin-left: 0.5rem; }
.schema-desc { display: block; font-size: 0.9rem; margin-top: 0.15rem; }

.error-list { max-width: var(--portal-measure); }
.error-item { display: flex; gap: 0.9rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.error-code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; color: var(--ink);
  flex: 0 0 3rem;
}
.error-body { margin: 0; }

.prevnext { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; max-width: var(--portal-measure); }
.prevnext-link { font-weight: 600; }

.guide-list { display: grid; gap: 1rem; max-width: var(--portal-measure); }
.guide-row {
  display: block; border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.25rem; text-decoration: none; color: var(--body-text); background: #ffffff;
}
.guide-row:hover { background: var(--panel); text-decoration: none; }
.guide-row-title { color: var(--ink); font-weight: 700; font-size: 1.02rem; display: block; margin-bottom: 0.25rem; }
.guide-row-text { font-size: 0.94rem; }

.note-box {
  border: 1px solid var(--line); border-left: 4px solid var(--brand);
  background: var(--brand-tint); border-radius: var(--radius-card);
  padding: 0.9rem 1.1rem; max-width: var(--portal-measure);
}
.note-box p { margin: 0; }

/* "In context" link lists: one item per row with real breathing
   room between items (Peter: the items crowded each other). */
.context-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: var(--portal-measure); }
.context-list li { margin: 0; }
.context-list a { font-weight: 600; }

/* Readability pass: long prose was restructured into short
   stacked passages. The margin-0 passage classes below get air
   between siblings; single passages are unchanged. */
.faq-a + .faq-a,
.card-text + .card-text,
.trial-cta-sub + .trial-cta-sub,
.step-text + .step-text,
.note-box p + p { margin-top: 0.6rem; }
.schema-desc + .schema-desc { margin-top: 0.5rem; }

/* Plain bulleted list for prose enumerations (the normalization
   steps on the home page, the ways to evaluate in the FAQ, the
   barcode normalizations in the docs): same rhythm as the prose
   around it, pulled up under a lead-in lede where one leads it. */
.prose-list { margin: 0; padding-left: 1.3rem; }
.prose-list li + li { margin-top: 0.4rem; }
.faq-a + .prose-list { margin-top: 0.6rem; }
.section-lede + .prose-list { margin-top: -0.9rem; margin-bottom: 1.5rem; }

/* ---------- narrow screens ---------- */

@media (max-width: 1023px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .portal-body { display: block; }
  .portal-rail {
    width: auto;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .rail-inner { position: static; max-height: none; overflow-y: visible; }
  .portal-main { padding: 1.5rem 1.25rem 2.5rem; }
  .hero-title { font-size: 2.25rem; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .card-grid-2x2 { grid-template-columns: 1fr; }
  .card-grid-3 { grid-template-columns: 1fr; }
}

/* Marketing nav at narrow widths (Peter, round 3: the fixed bar
   wrapped into a collision of links and CTA). The bar becomes
   two deliberate rows — brand on the first, the link set spread
   across the second with the CTA at its end — and the pages'
   top padding grows to match the taller bar. */
@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; gap: 0.4rem 1rem; padding: 0.6rem 1.25rem; }
  .site-nav {
    order: 3; flex: 1 1 100%; margin-left: 0;
    justify-content: space-between; gap: 0.6rem; flex-wrap: nowrap;
  }
  .marketing-page { padding-top: 7.6rem; }
}

@media (max-width: 420px) {
  .brand { font-size: 1.05rem; }
  .brand-tile { width: 2.1rem; height: 2.1rem; border-radius: 0.6rem; }
  .brand-tile svg { width: 1.25rem; height: 1.25rem; }
  .nav-link { font-size: 0.88rem; }
  .site-nav .btn { min-height: 40px; padding: 0.4rem 0.7rem; font-size: 0.88rem; }
}

/* ---------- account pages (portal shell, signed-in) ----------
   The Account Center in the portal shell: the same topbar and
   rail as the docs, with an Account section in the rail. Colors
   stay in the brand family — the production Account Center's
   emerald "Active" badge is NOT carried over (green is not a
   Chomp color); Active uses the brand tint, In Trial the amber
   the production badge already uses, Cancelled the red family
   the stylesheet's badges already use. */

.signin-wrap { max-width: 27rem; width: 100%; margin: 3rem auto; padding: 0 1.25rem; }
.signin-card { padding: 2rem; }
.signin-card h1 { color: var(--ink); font-size: 1.6rem; margin: 0 0 0.4rem; line-height: 1.25; }
.signin-sub { margin: 0 0 1.5rem; }
.signin-form .btn { width: 100%; margin-top: 1.25rem; }
.signin-help { margin: 1.25rem 0 0; font-size: 0.92rem; text-align: center; }
.field-note { color: var(--muted); font-size: 0.84rem; margin: 0.45rem 0 0; }

.acct-note { margin-bottom: 1.5rem; }
.acct-id { margin: 0 0 1.5rem; font-size: 1rem; }
.acct-id-name { color: var(--ink); font-weight: 700; }
.acct-stack { display: grid; gap: 1rem; max-width: var(--portal-measure); margin-bottom: 1.5rem; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; }
.sub-title { color: var(--ink); font-size: 1.15rem; font-weight: 700; margin: 0; }
.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 999px; padding: 0.2rem 0.65rem; white-space: nowrap;
}
.badge-active { background: var(--current-bg); color: var(--brand-dark); }
.badge-trial { background: #fef3c7; color: #92400e; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.key-panel {
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--panel);
  padding: 0.9rem 1.1rem; margin: 0.75rem 0;
}
.key-label { color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.3rem; }
.key-value {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.95rem; color: var(--ink);
  overflow-wrap: anywhere; margin: 0;
}
.acct-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.acct-actions .btn { flex: 0 1 auto; }

.log-list { border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; max-width: var(--portal-measure); }
.log-row { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: none; }
.log-url {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--ink);
  overflow-wrap: anywhere; margin: 0 0 0.35rem;
}
.log-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.log-date { color: var(--muted); font-size: 0.85rem; }
.log-replay {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--brand); font-weight: 600; font-size: 0.88rem; font-family: inherit;
}
.log-replay:hover { color: var(--brand-dark); text-decoration: underline; }

/* ---------- round 2 (Peter, 2026-11-17): first impression,
   responsive pass, portal rail collapse, key masking ---------- */

/* Hero calls to action: pill-shaped and a step larger than the
   standard button — the one borrowing from the live page's
   hero, without its pill nav or gradient headline. */
.hero-actions .btn { border-radius: 999px; padding: 0.7rem 1.5rem; }

/* The fair-use note as its OWN row in a plan card's fact list:
   a full-width line with the same hairline as every other fact
   row, not a note tucked under the "Unlimited" value (Peter,
   round 2 — as a stacked note it wrapped to two lines and read
   as part of the rate-limit row). */
.plan-fact-note { display: block; }
.plan-fact-note .cell-note { margin-top: 0; }

/* The estimator's Premium detail, decomposed into labeled
   lines so it scans instead of reading as a paragraph: each
   line leads with its label in ink. */
.est-line { display: block; margin-top: 0.35rem; }
.est-line:first-child { margin-top: 0; }
.estimator-detail strong { color: var(--ink); font-weight: 700; }

/* Responsive hardening (Peter, round 2: the plan cards clipped
   instead of resizing, "and the entire site probably has
   similar issues"). Fact labels may wrap before they squeeze;
   when a card gets narrow the value drops under its label
   instead of fighting it for the same line; grid children may
   shrink below their content's preferred width. */
.plan-card, .estimator-card { min-width: 0; }
@media (max-width: 900px) {
  .plan-fact-label { white-space: normal; }
}
@media (max-width: 560px) {
  .plan-fact { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
  .plan-fact-value { text-align: left; }
  .plan-fact-note { display: block; }
  /* Estimator rows stack fully at phone widths: label, control,
     and volume line each get the full width, and inside the
     volume line the unit note drops under the input instead of
     wrapping into a narrow column beside it. */
  .estimator-row { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .estimator-volume { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .estimator-unit { white-space: normal; }
}

/* Endpoint pages stacked (at or under the 1100px two-pane
   breakpoint): the rail's panels become items of the page
   column via display:contents, so the reading order is the
   order a phone user works in — intro and parameters, then
   the response schema, then the request example, Try it, and
   the response example, and only then "In context" and the
   prev/next nav (Peter, round 2: the stacked rail used to
   push the examples below the next-page link). */
@media (max-width: 1100px) {
  .op-grid { display: flex; flex-direction: column; }
  .op-rail { display: contents; }
  /* Long field and parameter names may break rather than
     force their panel or table wide once the panes stack;
     the desktop tables keep their exact pre-round-2 form. */
  .schema-name, .param-name { overflow-wrap: anywhere; }
  .op-prose { order: 1; }
  .rail-panel-schema { order: 2; }
  .rail-panel-request { order: 3; }
  .rail-panel-tryit { order: 4; }
  .rail-panel-response { order: 5; }
  .op-after { order: 6; }
}

/* Parameter tables on endpoint pages at phone widths: each
   parameter becomes a block — name, type, and required badge
   on one line, the description full-width beneath — instead
   of four columns crushing each other (Peter, round 2). The
   desktop table is untouched; the account pages' tables,
   which reuse .param-table outside .op-prose, are not
   affected. */
@media (max-width: 768px) {
  .op-prose .param-table thead { display: none; }
  .op-prose .param-table,
  .op-prose .param-table tbody,
  .op-prose .param-table tr { display: block; }
  .op-prose .param-table tr { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
  .op-prose .param-table td { display: inline; border-bottom: none; padding: 0 0.45rem 0 0; }
  .op-prose .param-table td:last-child { display: block; padding: 0.3rem 0 0; }
}

/* Portal rail on small screens (Peter, round 2: the stacked
   rail ate the first screenful of every portal page). At or
   under 860px the rail collapses to a compact bar — the
   current page's name and a Menu button — and the navigation
   stays hidden until the button opens it. The desktop rail is
   unchanged, and the shell still uses no fixed positioning:
   the bar is ordinary flow content at the top of the page. */
.rail-bar { display: none; }
@media (max-width: 1100px) {
  .rail-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  }
  .rail-current { color: var(--ink); font-weight: 700; font-size: 0.95rem; }
  .rail-toggle {
    font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink);
    background: #ffffff; border: 1px solid var(--control-line);
    border-radius: 0.5rem; padding: 0.45rem 0.9rem; min-height: 44px;
    cursor: pointer; flex: 0 0 auto;
  }
  .rail-toggle:hover { background: var(--panel); }
  .rail-nav { display: none; }
  .rail-nav.open { display: block; margin-top: 1rem; }
  .rail-inner { padding: 0.75rem 1rem 1rem; }
}

/* API key masking (Peter's proposal, round 2): the key shows
   a short prefix and bullets, with Reveal and Copy buttons
   beside it. The buttons are small bordered controls in the
   same family as the log's Replay link styling. */
.key-text { overflow-wrap: anywhere; }
.key-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.55rem; }
.key-btn {
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--ink);
  background: #ffffff; border: 1px solid var(--control-line);
  border-radius: 0.45rem; padding: 0.3rem 0.7rem; min-height: 36px;
  cursor: pointer;
}
.key-btn:hover { background: var(--panel); border-color: #94a3b8; }

/* ---------- round 3 (Peter, 2026-11-17): fair-use attachment,
   sticky portal chrome, live search, schema nesting ---------- */

/* The fair-use note belongs to the "Unlimited" rate limit — it
   is the same information set — so it now sits inside the rate
   fact as a smaller italic sub-note directly under the value,
   with no hairline of its own (Peter, round 3: the round-2
   dedicated row put a border between two halves of one fact). */
.fact-note {
  display: block; margin-top: 0.2rem;
  font-size: 0.85em; font-style: italic; font-weight: 400;
  color: var(--body-text); white-space: normal;
}
.compare-table .fact-note { max-width: 16rem; }

/* Estimator helper line under the users field (Peter, round 3:
   the field confused Limited/Standard readers; the label now
   says Premium only and this line says why the field exists). */
.estimator-help { color: var(--muted); font-size: 0.88rem; margin: -0.3rem 0 0; }

/* Sticky portal chrome (Peter, round 3: the header and the
   collapsed menu must stay reachable without scrolling back
   up). Sticky, not fixed: both bars stay in the flow, take
   their own space, and never overlap content. The topbar
   sticks at the viewport top; the mobile rail sticks
   directly beneath it. The topbar's height varies (the
   crosslink CTA's 44px minimum on one row; centered wrapped
   rows on small screens), so the rail's offset is the
   --topbar-h variable, measured from the rendered topbar by
   assets/search.js on load and resize, with 3.95rem (the
   one-row height) as the pre-script fallback.
   Round 5 correction: the sticky element is the rail itself,
   not the bar inside it. A sticky box can only travel within
   its parent's box; at this breakpoint .portal-body is block,
   so .rail-inner wraps the bar with no room to travel and a
   sticky bar scrolled away with the page (measured: bar top
   -443px after a 600px scroll). The rail's parent is
   .portal-body, which spans the whole page, so the rail —
   bar and menu together — now sticks, capped at the
   viewport height left under the topbar so an opened menu
   taller than the screen scrolls inside the rail. */
.portal-topbar { position: sticky; top: 0; z-index: 40; }
@media (max-width: 1100px) {
  .rail-bar {
    background: var(--rail-bg);
    padding: 0.35rem 0;
  }
  /* The rail becomes a full-width strip at the stacking
     breakpoint so content gets the whole width (the round-2
     rules switched the body to block at 1023px; round 3
     raises that to the 1100px stacking breakpoint). */
  .portal-body { display: block; }
  .portal-rail {
    width: auto; border-right: none; border-bottom: 1px solid var(--line);
    position: sticky; top: var(--topbar-h, 3.95rem); z-index: 30;
    max-height: calc(100dvh - var(--topbar-h, 3.95rem));
    overflow-y: auto;
  }
  .rail-inner { position: static; max-height: none; overflow-y: visible; }
}

/* Endpoint pages stacked: round 3 moves the response schema
   AFTER the aside panels — a phone reader works in a straight
   line: intro and parameters, the request example, Try it,
   the response example, then the schema, then In context and
   Next (Peter, round 3). Desktop two-pane layout untouched. */
@media (max-width: 1100px) {
  .rail-panel-request { order: 2; }
  .rail-panel-tryit { order: 3; }
  .rail-panel-response { order: 4; }
  .rail-panel-schema { order: 5; }
  .op-after { order: 6; }
}

/* Docs home: the Get started steps' code panels get clear air
   under their step text (Peter, round 3: "Look up one barcode:"
   sat tight against its curl panel). */
.step-body .code-panel { margin-top: 0.85rem; }

/* In-cell expandable (the user_id parameter's "More about
   user_id"): a link-weight button and a block body, mirroring
   the More-filters toggle pattern. */
.more-btn {
  display: inline-block; margin-top: 0.35rem; padding: 0;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--brand);
}
.more-btn:hover { color: var(--brand-dark); text-decoration: underline; }
.more-body { display: block; margin-top: 0.35rem; }
.more-body[hidden] { display: none; }

/* Live search miniature (Peter, round 3): typing in the portal
   search box opens a dropdown of matching pages from the
   preview's own page set. Production expands the index to all
   docs, guides, and knowledge-base articles, with Enter
   opening a full results page. */
.search-wrap { position: relative; margin-bottom: 1.25rem; }
.search-wrap .search-box { margin-bottom: 0; }
.search-results {
  position: absolute; top: calc(100% + 0.35rem); left: 0; right: 0; z-index: 60;
  background: #ffffff; border: 1px solid var(--control-line);
  border-radius: 0.5rem; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.search-results[hidden] { display: none; }
.search-result {
  display: block; padding: 0.55rem 0.75rem;
  text-decoration: none; color: var(--body-text);
  border-bottom: 1px solid var(--line);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--panel); text-decoration: none; }
.search-result-title { display: block; color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.search-result-section {
  display: block; color: var(--muted); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.search-empty { padding: 0.55rem 0.75rem; color: var(--muted); font-size: 0.9rem; }

/* Narrow navs center instead of scrunching (Peter, round 3).
   Marketing: the two rows (brand, then links) center their
   content. Portal: brand and crosslinks center and wrap
   cleanly; the rail search already takes its own full-width
   row inside the rail. */
@media (max-width: 720px) {
  .site-header-inner { justify-content: center; }
  .site-nav { justify-content: center; }
  /* Round 7: at mobile widths the comparison table gets its own
     vertical scroll — the wrap is capped and scrolls internally —
     and the header sticks at the top of that scroll area (top: 0;
     no page-header offset inside a scrolling box). Round 6 made
     the header static here because sticking against the page
     scroll had no clean anchor on a phone and the header pinned
     at a wrong offset over the rows (Peter, rounds 6–7); the
     wrap's own scroll is the anchor. Wider viewports keep the
     page-scroll sticky header exactly as before. */
  .table-wrap { max-height: 70vh; overflow-y: auto; }
  .compare-table thead { position: sticky; top: 0; }
  .portal-topbar-inner { justify-content: center; row-gap: 0.5rem; }
  /* Both topbar rows center on small screens (Peter, round 3,
     screenshot: the brand row sat left and the link row right,
     each scrunched against its own edge). The link row wraps
     centered under the centered brand. */
  .portal-crosslinks { margin-left: 0; justify-content: center; }
}

/* ---------- round 4 (Peter, 2026-11-17): plan and estimator
   cards break sooner ---------- */

/* The plan cards (home) and estimator cards (pricing) used to
   ride an auto-fit minimum of 13rem, so at tablet widths they
   stayed three-across and shrank to ~227px wide (under 180px
   of content) before any stacking happened — the fact rows
   squeezed long before the layout admitted the cards were
   narrow (Peter, round 4: "they get super small and scrunched
   before mobile layout enforced"). The grids are now an
   explicit three-across on desktop — identical arrangement
   and widths at wide viewports — that steps to two-across at
   1024px and stacks full-width at 640px, so a card is never
   narrower than ~290px while it shares a row. */
@media (max-width: 1024px) {
  .plans-strip, .estimator-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .plans-strip, .estimator-grid { grid-template-columns: 1fr; }
}

/* ---------- round 6 (Peter, 2026-11-17): enterprise closing
   block + security-basics spacing ---------- */

/* The enterprise page's closing "Paperwork, on request" section
   is a call to action, not another full-width text section
   (Peter, round 6): it sits in a narrow, centered measure so it
   reads as the end of the page's argument. */
.cta-block { max-width: 36rem; margin: 0 auto; text-align: center; }
.cta-block .section-lede { margin-left: auto; margin-right: auto; }

/* The SLA closing line in Security basics crowded the last
   bullet (the prose list carries no bottom margin): give the
   paragraph clear air above it. */
.sla-note { margin-top: 1.5rem; }

/* Included callout (QUEUE 252): a stray note becomes a styled block with
   real padding and at least 16px clear of the blocks around it. */
.included-callout {
  background: var(--brand-tint); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 1rem 1.25rem; margin: 1.5rem 0 0;
}
.included-callout p { margin: 0; }


/* Round 3 fixes (Peter's screenshot review, 2026-11-20): plan
   badges on the endpoint pages, the full-width fair-use footnote
   on Pricing, a collapsed-details style for the scanner allergen
   detail, and the spacing fixes from the renders — code panels
   and blocks that sat flush against the cards above them get
   clear air. */
.plan-badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.plan-badge {
  display: inline-block; padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--brand-tint); border: 1px solid var(--line);
  color: var(--ink); font-size: 0.85rem; font-weight: 600;
}
.plan-badge-note { background: transparent; color: var(--body-text); font-weight: 500; }
.table-note { margin: 0.75rem 0 0; font-size: 0.94rem; }
.card-grid + .code-panel { margin-top: 2rem; }
.included-callout + .code-panel { margin-top: 1.5rem; }
.card-grid + .faq-item { margin-top: 2rem; border-top: none; padding-top: 0; }
.included-callout + .section-lede { margin-top: 1.5rem; }
.card-grid + .hero-actions { margin-top: 1.5rem; }
.card-grid + .section-lede { margin-top: 1.5rem; }
.plans-more + .section-title { margin-top: 2.5rem; }
.more-details { margin-top: 0.75rem; }
.more-details summary { color: var(--brand-dark); font-weight: 600; cursor: pointer; font-size: 0.92rem; }
.more-details p { margin: 0.5rem 0 0; font-size: 1em; }
/* Round 4 (Peter, 2026-11-20): expanded text must render at the
   same size as the text above it — inside a card that is the
   card-text size, not the larger body default. */
.card .more-details { font-size: 0.95rem; }
.more-details .note-box { margin-top: 0.6rem; }
.note-box + .note-box,
.note-box + .more-details,
.more-details + .note-box { margin-top: 1rem; }
.plan-badge-note { flex-basis: 100%; }
.tok-bool { color: var(--code-number); }
.tok-comment { color: #94a3b8; font-style: italic; }
.more-body .uid-case { display: block; }
.more-body .uid-case + .uid-case { margin-top: 0.35rem; }

/* ---------- round 5 (Peter, 2026-11-23) + round 6 + round 7:
   copy button, trial banner, subscription switcher,
   plan-table columns ---------- */

/* Copy button (round 7, Peter, 2026-11-23 — supersedes
   the round-5/6 header strip: the strip lived INSIDE the
   horizontally scrolling panel, so dragging the code
   sideways dragged the button with it, and the strip left
   a tall empty band). The standard docs pattern instead:
   the button is absolutely positioned at the top-right of
   its block and is a direct child of the block itself —
   .code-panel and .base-card are position: relative and
   never scroll; only the inner element scrolls (the pre,
   overflow-x: auto above), so no scroll position can move
   the button. The block label stays in normal flow at the
   top of the block with right padding (see .code-title
   and .base-card-label), so it can never run under the
   button; on label-less blocks the code can pass beneath
   the button, whose solid background (the raised slate on
   dark panels, white on light cards) covers it. Always
   visible — no hover-only reveal. Hover is a background
   change, never an underline. */
.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  font: inherit; font-size: 0.75rem; font-weight: 600;
  padding: 0.25rem 0.6rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #ffffff; color: var(--ink);
}
.code-panel .copy-btn { background: #1e293b; color: var(--code-text); border-color: #334155; }
.copy-btn:hover { background: #e2e8f0; text-decoration: none; }
.code-panel .copy-btn:hover { background: #334155; text-decoration: none; }

/* Pricing trial banner (round 7, Peter, 2026-11-23 —
   superseded the round-6 narrowed card, whose button
   floated vertically centered in the dead space beside a
   ~55% text column; the card spans the normal content
   width, the 60rem cap is gone). Layout revised the same
   day (Peter, local retest of the production build): the
   round-7 header row is gone — the banner runs heading,
   then the two body paragraphs full width, then the
   trial button below the text, left-aligned at the
   text edge. */
.trial-cta { display: block; max-width: none; }
.trial-cta .btn { margin-top: 0.9rem; }
.trial-cta-sub { max-width: none; }

/* Pricing plan table (round 6): column targets so the
   Limited column gets real room — the label column gives
   up width and Premium, the widest content, takes the
   largest share. Short value cells never wrap mid-value;
   their no-wrap min-content floors hold the columns open
   at the widths the colgroup asks for. */
.compare-table .col-label { width: 17%; }
.compare-table .col-limited { width: 20%; }
.compare-table .col-standard { width: 25%; }
.compare-table .col-premium { width: 38%; }
.cell-nowrap { white-space: nowrap; }

/* Subscription switcher on the account pages (billing, usage,
   settings): the figures on the page belong to the selected
   subscription. */
.sub-switch { max-width: var(--portal-measure); margin-bottom: 1.5rem; }
.sub-select { font-family: inherit; }

/* ---------- round 8 (2026-11-24): spacing, measure, wrapping ----------
   Fixes from the screenshot review: plan cards with unequal rows and
   right-aligned italic notes; docs lists running the full window
   width; blocks sitting flush against the cards or lists above them;
   headings and short paragraphs leaving one-word last lines. */

/* Headings balance; body copy avoids one-word last lines. */
.hero-title, .hero-sub, .section-title, .card-title, .faq-q, .plan-name,
.trial-cta-title, .rail-trial-title, .portal-main h1, .portal-main h2,
.signin-card h1 { text-wrap: balance; }
.section-lede, .card-text, .faq-a, .trial-cta-sub, .step-text, .guide-row-text,
.note-box p, .portal-main p, .portal-main li, .prose-list li, .signin-help,
.field-note, .table-note, .included-callout p { text-wrap: pretty; }

/* Lists and tables in the portal follow the same measure as paragraphs. */
.portal-main ul, .portal-main ol { max-width: var(--portal-measure); }
.portal-main .param-table, .portal-main .plan-facts { max-width: var(--portal-measure); }
.portal-main h2 + ul, .portal-main h2 + ol { margin-top: 0.25rem; }
.portal-main ul.prose-list { margin: 0.5rem 0 1rem; }

/* Marketing prose: a readable line, not the full container. Cards,
   tables, and code still span the container; text stops at ~64rem. */
.section-lede, .faq-a, .section > .container > p { max-width: 64rem; }
.cta-block .section-lede { max-width: 36rem; }

/* Air between a block and the card grid, list, or buttons after it. */
.code-panel + .card-grid,
.prose-list + .card-grid,
.card-grid + .card-grid,
.included-callout + .card-grid { margin-top: 2rem; }
.prose-list + .hero-actions,
.prose-list + .section-lede,
.prose-list + .code-panel { margin-top: 1.5rem; }
.section-lede + .code-panel { margin-top: 0; }
.code-panel + .hero-actions, .code-panel + .faq-item { margin-top: 1.5rem; }
.plans-strip + .plans-more { margin-top: 1.5rem; }
.card-grid + .included-callout { margin-top: 1.5rem; }
.section-title + .card-grid, .section-title + .code-panel,
.section-title + .faq-item { margin-top: 1rem; }
/* The order that "Test it on your own products" and similar steps use. */
ol.prose-list { padding-left: 1.5rem; }
ol.prose-list li { padding-left: 0.2rem; }

/* Plan cards: same rows in every card, long values stack under their
   label, left-aligned, instead of squeezing against it. */
.plan-fact-long { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.plan-fact-long .plan-fact-value { text-align: left; }
.plan-fact-long .fact-note, .plan-fact .fact-note { text-align: inherit; margin-top: 0.25rem; }
.plan-card-note { margin: 0 0 1rem; font-size: 0.88rem; color: var(--body-text); }
.plan-card-note + .plan-subscribe { margin-top: auto; }
.plan-facts { margin-bottom: 1rem; flex: 0 0 auto; }
.plan-card .plan-facts { margin-bottom: 0.75rem; }
.plan-card .plan-price { margin-bottom: 0.1rem; }
.plan-card .plan-subscribe { margin-top: auto; }
.plan-fact-value a { font-weight: 600; }

/* Single-link follow-on lines (replaces one-card grids). */
.followup { margin-top: 1.25rem; }
.followup a { font-weight: 600; }

/* Sign-in: the notice sits inside the card with air around it. */
.signin-card .note-box { margin: 0 0 1.5rem; padding: 0.8rem 1rem; }
.signin-card .note-box p { font-size: 0.92rem; }
.signin-card .note-box p + p { margin-top: 0.5rem; }
.signin-card .signin-sub { text-wrap: pretty; }
.nowrap { white-space: nowrap; }

/* Phones: tighter section rhythm and stacked hero actions. */
@media (max-width: 640px) {
  .section { padding: 3rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
  .hero-title { font-size: 2rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .card { padding: 1.25rem; }
  .trial-cta { padding: 1rem; }
}

/* Code titles often hold a real request URL; uppercasing it changes
   the path and parameter names a reader will copy. */
.code-title { text-transform: none; letter-spacing: 0.01em; font-size: 0.78rem; overflow-wrap: break-word; }

/* ---------- legal and long-form pages (SLA, Terms, Attribution) ---------- */
.hero-compact { padding: 3.5rem 0 3rem; }
.hero-compact .hero-title { font-size: 2.4rem; margin-bottom: 0.75rem; }
.hero-compact .hero-sub { margin-bottom: 0; }
.legal { max-width: 52rem; margin: 0 auto; }
.legal h2 { color: var(--ink); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin: 2.75rem 0 0.75rem; }
.legal h3 { color: var(--ink); font-size: 1.1rem; font-weight: 700; margin: 2.25rem 0 0.6rem; }
.legal h2:first-child, .legal h3:first-child { margin-top: 0; }
.legal p { margin: 0 0 1rem; text-wrap: pretty; }
.legal ul { margin: 0 0 1.25rem; padding-left: 1.3rem; }
.legal li { margin: 0 0 0.6rem; text-wrap: pretty; }
.legal dl { margin: 0; }
.legal dt { color: var(--ink); font-weight: 700; margin-top: 1.25rem; }
.legal dd { margin: 0.25rem 0 0; }
.legal .legal-caps { text-transform: uppercase; font-size: 0.8rem; font-weight: 600; line-height: 1.6; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 1.1rem 1.25rem; }
.legal .table-wrap { margin: 1.25rem 0 1.5rem; }
.legal .compare-table { min-width: 0; }
.legal .compare-table thead { position: static; }
.legal .compare-table td { vertical-align: middle; }
.legal .card-grid { margin-top: 1rem; }
.legal .card .card-title { margin-bottom: 0.4rem; }
.legal hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.hero-compact + .section { padding-top: 3rem; }
.plans-strip-portal { grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); max-width: none; }
.portal-main .plans-strip { margin-top: 1rem; }
.attribution-preview { margin-top: 0.75rem; }
.attribution-example { display: block; max-width: min(100%, 40rem); height: auto; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }

/* Single-line request examples wrap instead of hiding the key and
   parameters off the right edge. */
.rail-panel-request .code-panel pre,
.step-body .code-panel pre { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; padding-left: 2ch; text-indent: -2ch; }

/* Plan comparison on phones and small tablets (the table needs about 900px): each row becomes a small card, with the
   plan name above each value, instead of a wide table that scrolls
   sideways and stretches every row to the tallest cell. */
@media (max-width: 900px) {
  #plans.table-wrap, .legal .table-wrap { max-height: none; overflow: visible; }
  .compare-table { min-width: 0; display: block; background: transparent; }
  .compare-table thead { display: none; }
  .compare-table tbody { display: block; }
  .compare-table tr { display: block; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-card); margin-bottom: 0.75rem; overflow: hidden; box-shadow: var(--shadow-card); }
  .compare-table tbody th { display: block; border: none; background: var(--panel); padding: 0.6rem 0.9rem; white-space: normal; }
  .compare-table td { display: block; border: none; border-top: 1px solid var(--line); padding: 0.6rem 0.9rem; }
  .compare-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.1rem; }
  .compare-table .cell-nowrap { white-space: normal; }
  .compare-table .fact-note { max-width: none; }
  .subscribe-btn { white-space: normal; width: 100%; }
}
.signin-card .signin-sub { text-wrap: balance; }
.row-endpoint-short { display: none; }
@media (max-width: 900px) {
  .row-endpoint { display: none; }
  .compare-table tr.row-endpoint-short { display: block; }
}

/* "In every branded record": the five fields buyers build on, then one
   line for the rest. */
.record-fields-title { color: var(--ink); font-size: 1rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.record-fields { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; }
.record-fields li { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.record-fields strong { color: var(--ink); font-size: 0.98rem; }
.record-fields span { font-size: 0.88rem; line-height: 1.45; }
.record-fields-more { margin: 1rem 0 0; font-size: 0.94rem; max-width: 64rem; }
@media (max-width: 1100px) { .record-fields { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .record-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .record-fields { grid-template-columns: 1fr; } }

/* ---------- catalog search (/api/lookup.php) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.lookup { max-width: 56rem; }
.lookup-form { display: flex; gap: 0.75rem; }
.lookup-input {
  flex: 1 1 auto; min-width: 0; min-height: 52px;
  border: 1px solid var(--control-line); border-radius: 0.6rem;
  padding: 0.6rem 1rem; font: inherit; font-size: 1.02rem; color: var(--ink); background: #ffffff;
}
.lookup-input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.lookup-form .btn { min-height: 52px; padding-left: 1.6rem; padding-right: 1.6rem; }
.lookup-hint { margin: 0.75rem 0 0; font-size: 0.92rem; color: var(--muted); }
.lookup-chip {
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-tint); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.15rem 0.7rem; margin-left: 0.25rem; cursor: pointer;
}
.lookup-chip:hover { background: var(--current-bg); }
.lookup-status { margin: 1.25rem 0 0; min-height: 1.5rem; color: var(--ink); font-weight: 600; }
.lookup-status-error { color: #991b1b; }
.lookup-results { margin-top: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; background: #ffffff; }
.lookup-table { width: 100%; border-collapse: collapse; }
.lookup-table th, .lookup-table td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.94rem; vertical-align: top; overflow-wrap: anywhere; }
.lookup-table th { background: var(--panel); color: var(--ink); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.lookup-table tbody tr:last-child td { border-bottom: none; }
.lookup-table td:first-child { width: 6.5rem; white-space: nowrap; }
.lookup-table td:nth-child(3) { color: var(--ink); font-weight: 600; }
.lookup-table td a { font-weight: 600; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 0.15rem 0.6rem; }
.tag-grocery { background: var(--current-bg); color: var(--brand-dark); }
.tag-branded { background: var(--brand-tint); color: var(--ink); border: 1px solid var(--line); }
.tag-generic { background: #e2e8f0; color: #475569; }
.lookup-next { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.lookup-actions { justify-content: flex-start; }
@media (max-width: 560px) {
  .lookup-form { flex-direction: column; }
  .lookup-table th:first-child, .lookup-table td:first-child { display: none; }
}

/* Portal search: richer results (description line, active row, footer link). */
.search-results { max-height: min(24rem, 70vh); overflow-y: auto; }
.search-result-desc { display: block; color: var(--body-text); font-size: 0.82rem; line-height: 1.35; margin-top: 0.1rem; }
.search-result-active, .search-result-active:hover { background: var(--current-bg); }
.search-more { display: block; padding: 0.55rem 0.75rem; font-size: 0.85rem; font-weight: 600; background: var(--panel); border-top: 1px solid var(--line); text-decoration: none; }
.search-more:hover { text-decoration: underline; }
.search-empty a { font-weight: 600; }
.record-excerpt { margin-top: 1rem; }

/* ---------- pricing: trial points, grouped table ---------- */
.trial-points { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem 1.5rem; }
.trial-points li { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.trial-points strong { color: var(--ink); font-size: 0.95rem; }
.trial-points span { font-size: 0.9rem; line-height: 1.45; }
.trial-cta-foot { margin: 0.9rem 0 0; font-size: 0.88rem; color: var(--muted); }
.pricing-jump { margin: -0.5rem 0 1.25rem; font-size: 0.95rem; }
.compare-table .group-row th { background: var(--panel); color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.45rem 0.85rem; white-space: normal; }
.compare-table .cell-note { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0; }
@media (max-width: 1024px) { .trial-points { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .trial-points { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .compare-table .group-row { background: transparent; border: none; box-shadow: none; margin: 1.25rem 0 0.5rem; border-radius: 0; }
  .compare-table .group-row th { background: transparent; padding: 0 0.15rem; font-size: 0.8rem; }
}

/* Text beside the example it describes. */
.feature-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.feature-split .section-lede:last-child { margin-bottom: 0; }
.feature-split .code-panel { margin: 0; }
@media (max-width: 900px) { .feature-split { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Try It: which subscription is in use, and why a call is blocked. */
.tryit-plan { margin: 0.6rem 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--body-text); }
.tryit-plan code { font-size: 0.85em; }
.tryit-plan-warn { background: #fffbeb; border: 1px solid #fde68a; border-radius: 0.5rem; color: #92400e; padding: 0.6rem 0.8rem; }
.tryit-plan-warn a { color: #92400e; font-weight: 600; }
.tryit-plan[hidden] { display: none; }
.tryit-subs { font-family: inherit; }
.tryit .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.tryit-getkey { margin-top: 0.5rem; }

/* Filter groups as chips, beside the example. */
.feature-split-top { align-items: start; }
.filter-groups { display: grid; gap: 1rem; margin: 1.25rem 0; }
.filter-group strong { display: block; color: var(--ink); font-size: 0.85rem; margin-bottom: 0.4rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips li { font-size: 0.88rem; font-weight: 600; color: var(--ink); background: #ffffff; border: 1px solid var(--control-line); border-radius: 999px; padding: 0.2rem 0.75rem; }
.record-fields-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .record-fields-3 { grid-template-columns: 1fr; } }
.card-list { margin: 0.25rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; }
.card-list li + li { margin-top: 0.4rem; }
.card-list + .card-link { margin-top: auto; }
.card-list { margin-bottom: 0.75rem; }

/* Guides: tighter rows, and a marker on the ones that open the knowledge base. */
.guide-list { gap: 0.65rem; }
.guide-row { padding: 0.85rem 1.15rem; }
.guide-row[href^="http"] .guide-row-title::after { content: " \2197"; color: var(--muted); font-weight: 500; }

/* Centered captions span the whole container, so they center on the same axis as the
   content under them (the 64rem text cap above is for left-aligned prose only). */
.section > .container > p.proof-usedat-caption { max-width: none; }

/* Endpoint list: which plans include each endpoint, as a three-chip matrix.
   Name and path stack in one cell so the description and the chips have room. */
.endpoint-row {
  grid-template-columns: 3.2rem minmax(0, 15rem) minmax(0, 1fr) auto;
  grid-template-areas: "m n d p" "m o d p";
  grid-template-rows: min-content 1fr;
  row-gap: 0.15rem; align-items: start;
}
.endpoint-row .method-pill { grid-area: m; justify-self: start; }
.endpoint-row .endpoint-name { grid-area: n; }
.endpoint-row .op-path { grid-area: o; }
.endpoint-row .endpoint-desc { grid-area: d; align-self: center; }
.endpoint-plans { grid-area: p; display: flex; gap: 0.3rem; align-self: center; flex-wrap: nowrap; }
.plan-chip { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1; padding: 0.3rem 0.55rem; border-radius: 999px; background: var(--current-bg); color: var(--brand-dark); border: 1px solid transparent; white-space: nowrap; }
.plan-chip-off { background: transparent; color: #94a3b8; border: 1px dashed var(--control-line); text-decoration: line-through; }
@media (max-width: 860px) {
  .endpoint-row { grid-template-columns: 3.2rem minmax(0, 1fr); grid-template-areas: "m n" "m o" "m d" "m p"; row-gap: 0.3rem; }
  .endpoint-row .method-pill { grid-area: m; }
  .endpoint-row .endpoint-name { grid-area: n; }
  .endpoint-row .op-path { grid-area: o; }
  .endpoint-row .endpoint-desc { grid-area: d; }
  .endpoint-row { grid-template-rows: none; }
  .endpoint-plans { grid-area: p; justify-self: start; margin-top: 0.15rem; flex-wrap: wrap; }
}

/* A row that is one big link keeps its text colour on hover (the global link hover
   color was turning the description blue). */
.endpoint-row:hover, .guide-row:hover { color: var(--body-text); }


/* Sticky rails start below the sticky page header (its height is published as
   --topbar-h by search.js), so the search box and the first panel stay visible. */
@media (min-width: 1101px) {
  .rail-inner { top: var(--topbar-h, 3.95rem); max-height: calc(100vh - var(--topbar-h, 3.95rem)); }
  .op-rail { top: calc(var(--topbar-h, 3.95rem) + 1.25rem); max-height: calc(100vh - var(--topbar-h, 3.95rem) - 2.5rem); }
}


/* ---------- foldable JSON and schema ---------- */
.code-panel.foldable pre { padding-left: 1.75rem; }
.jl-hidden { display: none; }
.jl-folded .jl-code::after { content: " \2026 " attr(data-close); color: #94a3b8; }
.jf {
  display: inline-block; width: 1.5rem; height: 1.5rem; margin: 0 0.25rem 0 -1.75rem; padding: 0;
  vertical-align: middle; background: none; border: none; border-radius: 0.25rem; color: #94a3b8; cursor: pointer; line-height: 1;
}
.jf::before { content: "\25BE"; font-size: 1.1rem; }
.jf[aria-expanded="false"]::before { content: "\25B8"; }
.jf:hover { background: #1e293b; color: #e2e8f0; }
.jf:focus-visible, .fold-all-btn:focus-visible, .sf:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.fold-all-btn {
  position: absolute; top: 0.5rem; right: 4.6rem;
  font: inherit; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 999px; cursor: pointer;
  background: #1e293b; color: var(--code-text); border: 1px solid #334155;
}
.fold-all-btn:hover { background: #334155; }
.tryit-response .code-title, .rail-panel-response .code-title { padding-right: 9rem; }

.schema-row[data-open] > dt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.35rem; }
.sf { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; padding: 0; margin-left: -0.3rem; background: none; border: none; border-radius: 0.25rem; color: var(--muted); cursor: pointer; line-height: 1; }
.sf::before { content: "\25BE"; font-size: 1.1rem; }
.sf[aria-expanded="false"]::before { content: "\25B8"; }
.sf:hover { background: var(--line); color: var(--ink); }
.schema-row-sub[hidden] { display: none; }
.fold-all-link { display: block; margin: 0 0 0.5rem auto; background: none; border: none; padding: 0; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--brand); cursor: pointer; }
.fold-all-link:hover { color: var(--brand-dark); text-decoration: underline; }


/* ---------- endpoint pages: no scroll boxes inside the page ----------
   The Response schema now sits in the main column. The right rail pins beside the
   content only when it fits in the window; when it is taller (a long Try It form
   or response), it scrolls with the page instead of becoming its own scroll box. */
@media (min-width: 1101px) {
  /* The rail spans every row. Give all of its extra height to the last row, so the prose and
     schema rows stay as tall as their content (a tall live response used to open a gap). */
  .op-grid { grid-template-areas: "prose rail" "schema rail" "after rail"; grid-template-rows: min-content min-content 1fr; }
  .op-schema { grid-area: schema; }
  .op-rail { max-height: none; overflow: visible; scrollbar-gutter: auto; padding-bottom: 0; }
  .op-rail.op-rail-static { position: static; }
  .tryit-response pre { max-height: none; }
}
.op-schema .rail-panel-title { font-size: 1.3rem; margin: 2rem 0 0.6rem; }
.op-schema .schema-list { max-width: var(--portal-measure); }

/* Short windows: the left rail trims itself to fit instead of scrolling. */
@media (min-width: 1101px) and (max-height: 860px) {
  .rail-link { min-height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem; }
  .rail-trial { display: none; }
  .rail-section { margin-bottom: 1rem; }
}

/* Jumping to a section (#authentication, #errors, #estimate, search results) must land
   with the heading visible under the sticky header, not hidden behind it. The portal
   header height is published as --topbar-h; on narrow screens the sticky menu bar sits
   below it too. The marketing header is fixed and a fixed height. */
.portal-page [id] { scroll-margin-top: calc(var(--topbar-h, 3.95rem) + 1.25rem); }
@media (max-width: 1100px) { .portal-page [id] { scroll-margin-top: calc(var(--topbar-h, 3.95rem) + 6.25rem); } }
.marketing-page [id] { scroll-margin-top: 5.75rem; }
@media (max-width: 720px) { .marketing-page [id] { scroll-margin-top: 9rem; } }

/* ---------- contact (Zoho web-to-case form in the API Center shell) ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; max-width: 64rem; margin: 0 auto; }
.contact-card { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1.75rem; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-field { margin-bottom: 1.1rem; min-width: 0; }
.contact-label { display: block; color: var(--ink); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.contact-req { color: var(--muted); font-weight: 500; font-size: 0.78rem; margin-left: 0.25rem; }
.contact-input {
  display: block; width: 100%; min-height: 46px; padding: 0.55rem 0.8rem;
  border: 1px solid var(--control-line); border-radius: 0.5rem; background: #ffffff;
  font: inherit; font-size: 1rem; color: var(--ink);
}
.contact-input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.contact-textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.contact-captcha-img { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.75rem; }
.contact-captcha-img img { display: block; height: 3.2rem; width: auto; border: 1px solid var(--line); border-radius: 0.5rem; background: #ffffff; padding: 0.15rem 0.35rem; }
.contact-refresh { font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.contact-captcha-input { max-width: 14rem; }
.contact-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.25rem; }
.contact-actions input.btn { font-family: inherit; }
.contact-aside { padding-top: 0.25rem; }
.contact-aside p { margin: 0 0 1rem; font-size: 0.95rem; text-wrap: pretty; }
.contact-aside-title { color: var(--ink); font-size: 1.05rem; font-weight: 700; margin: 0 0 0.6rem; }
.contact-points { margin: 0 0 1rem; padding-left: 1.2rem; font-size: 0.95rem; }
.contact-points li + li { margin-top: 0.4rem; }
.contact-support { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.contact-done { max-width: 36rem; margin: 0 auto; text-align: center; }
.contact-done .section-lede { margin-left: auto; margin-right: auto; }
.contact-done .contact-actions { justify-content: center; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }
@media (max-width: 560px) { .contact-row { grid-template-columns: 1fr; gap: 0; } .contact-card { padding: 1.25rem; } }

/* Centered call-to-action text balances its lines instead of leaving a short last line. */
.cta-block .section-lede, .contact-done .section-lede { text-wrap: balance; }
.contact-note { margin: -0.4rem 0 1.1rem; font-size: 0.85rem; color: var(--muted); }
select.contact-input { appearance: auto; }

/* ---------- branded selects (subscription pickers, Try It picker, support topic) ----------
   One look for every dropdown: our border, radius, and focus ring and a chevron in place of
   the browser's own control and its system-blue glow. */
select.field-input, select.contact-input, .sub-select, .tryit-subs {
  -webkit-appearance: none; appearance: none;
  font-family: inherit; color: var(--ink); background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center; background-size: 1rem;
  padding-right: 2.5rem; cursor: pointer; text-overflow: ellipsis;
  border: 1px solid var(--control-line); border-radius: 0.5rem;
}
select.field-input:hover, select.contact-input:hover, .sub-select:hover, .tryit-subs:hover { border-color: #94a3b8; }
select.field-input:focus, select.contact-input:focus, .sub-select:focus, .tryit-subs:focus {
  outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand);
}
select.field-input option, select.contact-input option, .sub-select option { font-family: inherit; color: var(--ink); }
select.contact-input { appearance: none; -webkit-appearance: none; }

/* Sign-in: wide enough that the subtitle fits on one line and the notes wrap into fewer lines. */
.signin-wrap { max-width: 30rem; }
.signin-form input.field-input[type="email"] { font-family: inherit; }
.signin-help { text-wrap: balance; }


/* Error samples are one long line of JSON: wrap them at word breaks instead of hiding the end. */
.op-prose .code-panel pre { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; }

/* Nav labels and buttons never wrap onto a second line ("Account / Center", "Get API / Key"). */
.site-nav .nav-link, .site-nav .btn, .portal-crosslink { white-space: nowrap; }

/* ---------- phones (720px and under): one compact bar ----------
   Marketing: brand, the main action, and a Menu button; links open below.
   Portal: the page header is one short row that scrolls away; only the docs Menu bar stays
   pinned, and its panel starts with the site links (Pricing, API home, Account, Sign out). */
.nav-toggle { display: none; }
.rail-site { display: none; }
@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 0 0.6rem; padding: 0.5rem 1rem; }
  .site-nav { display: contents; }
  .site-nav .nav-link { display: none; }
  .brand { order: 0; font-size: 1.1rem; }
  .site-nav .nav-cta { order: 2; margin-left: auto; min-height: 40px; padding: 0.35rem 0.85rem; font-size: 0.88rem; }
  .nav-toggle {
    display: inline-flex; align-items: center; order: 3; min-height: 40px; padding: 0.35rem 0.8rem;
    font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink); background: #ffffff;
    border: 1px solid var(--control-line); border-radius: 0.5rem; cursor: pointer;
  }
  .site-header.nav-open .site-nav .nav-link {
    display: block; order: 4; flex: 1 1 100%; padding: 0.75rem 0.25rem; font-size: 1rem;
    border-top: 1px solid var(--line); text-align: left;
  }
  .site-header.nav-open .site-nav .nav-link:first-of-type { margin-top: 0.5rem; }
  .marketing-page { padding-top: 3.75rem; }
  .marketing-page [id] { scroll-margin-top: 4.75rem; }

  .portal-topbar { position: static; }
  .portal-topbar-inner { flex-wrap: nowrap; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 1rem; row-gap: 0; }
  .portal-crosslinks { margin-left: auto; flex-wrap: nowrap; gap: 0; }
  .portal-crosslink:not(.portal-crosslink-primary) { display: none; }
  .portal-crosslink-primary { font-size: 0.88rem; font-weight: 600; }
  .portal-crosslink-primary:not(.portal-crosslink-cta) { border: 1px solid #334155; border-radius: 0.5rem; padding: 0.4rem 0.75rem; min-height: 40px; display: inline-flex; align-items: center; }
  .portal-crosslink-cta { min-height: 40px; padding: 0.35rem 0.85rem; }
  .portal-brand-sub { display: none; }
  .portal-rail { top: 0; max-height: 100dvh; }
  .rail-site { display: block; }
  .portal-page [id] { scroll-margin-top: 5.25rem; }
}

/* ---------- Try It: user_id, limits, and explained refusals ---------- */
.tryit-userid { margin-top: 0.7rem; padding: 0.15rem 0; }
.tryit-userid[hidden] { display: none; }
.tryit-userid .field-label { margin-top: 0; }
.tryit-userid-required { border-left: 3px solid #f59e0b; background: #fffbeb; border-radius: 0.5rem; padding: 0.65rem 0.8rem 0.7rem; }
.tryit-userid-required .field-label { color: #92400e; }
.tryit-userid-required .field-input { border-color: #f59e0b; background: #ffffff; }
.tryit-userid-help { margin: 0.35rem 0 0; font-size: 0.82rem; color: var(--muted); }
.tryit-userid-required .tryit-userid-help { color: #92400e; }
.tryit-userid-error { margin: 0.4rem 0 0; font-size: 0.85rem; font-weight: 600; color: #991b1b; }
.tryit-userid-error[hidden] { display: none; }
.param-userid[hidden] { display: none; }
.tryit-alert ul { margin: 0.5rem 0 0.4rem; padding-left: 1.1rem; }
.tryit-alert li + li { margin-top: 0.4rem; }
.tryit-alert a { font-weight: 600; }
.tryit-raw { display: block; margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid #fecaca; font-size: 0.8rem; opacity: 0.85; overflow-wrap: anywhere; }


/* ---------- Errors: a collapsible block (starts closed on phones) ---------- */
.op-errors { margin-top: 0.5rem; }
.op-errors-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.op-errors-summary::-webkit-details-marker { display: none; }
.op-errors-summary h2 { margin: 2rem 0 0.6rem; }
.op-errors-codes { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.op-errors-summary::after { content: "\25BE"; color: var(--muted); font-size: 1rem; margin-left: 0.25rem; }
.op-errors:not([open]) .op-errors-summary::after { content: "\25B8"; }
.op-errors:not([open]) .op-errors-summary h2 { margin-bottom: 0.4rem; }
.op-errors:not([open]) { border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.op-errors-summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 0.25rem; }
.sample-meta { margin: 0 0 0.6rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* The smallest phones: keep the compact bar on one row. */
@media (max-width: 360px) {
  .site-header-inner { padding: 0.5rem 0.75rem; gap: 0 0.4rem; }
  .brand { font-size: 1rem; gap: 0.4rem; }
  .brand-tile { width: 1.9rem; height: 1.9rem; }
  .site-nav .nav-cta { padding: 0.3rem 0.6rem; font-size: 0.82rem; }
  .nav-toggle { padding: 0.3rem 0.6rem; font-size: 0.82rem; }
}

/* Errors summary on small screens: title and codes read together, a clear chevron on the right. */
.op-errors-summary { flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 0.15rem 0.9rem; padding-right: 2rem; position: relative; }
.op-errors-summary::after { position: absolute; right: 0.25rem; top: 50%; margin: 0; transform: translateY(-50%); font-size: 1.25rem; line-height: 1; }
.op-errors-summary h2 { margin: 1.5rem 0 0.6rem; }
.op-errors:not([open]) .op-errors-summary h2 { margin-bottom: 0.6rem; }
.op-errors-codes { font-size: 0.8rem; }
.op-errors:not([open]) { margin-bottom: 1.5rem; }
.op-errors-summary { padding: 1.25rem 2rem 0.75rem 0; }
.op-errors-summary h2, .op-errors:not([open]) .op-errors-summary h2 { margin: 0; }
.op-errors-summary::after { font-size: 1.6rem; color: var(--ink, #111827); }

.error-causes { margin: 0.5rem 0 0.75rem; padding-left: 1.1rem; }
.error-causes li { margin: 0.2rem 0; }
/* Touch screens: fold arrows get a full-size tap target. */
@media (pointer: coarse) {
  .jf, .sf { width: 2rem; height: 2rem; }
  .jf { margin-left: -2.1rem; margin-top: -0.5rem; margin-bottom: -0.5rem; }
  .code-panel.foldable pre { padding-left: 2.2rem; }
}

/* Estimator on phones: the slider's flex-basis (16rem) was acting as its height once the row stacked.
   Keep it a normal-height control, with the number field and its unit on one line. */
@media (max-width: 700px) {
  .estimator-range { flex: 0 0 auto; width: 100%; height: 2rem; min-height: 0; margin: 0.1rem 0; }
  .estimator-volume { flex-direction: row; align-items: center; gap: 0.6rem; }
  .estimator-row { gap: 0.5rem; }
  .estimator-controls { gap: 1rem; }
}
