/* ────────────────────────────────────────────────────────────────────────
   Design system (Phase 12-E) — "Clean Corporate".
   Navy primary, green accent, generous whitespace, 1080px content column,
   8px radii, subtle shadows, 1px borders. No gradients, no dark sections
   except the footer. Allergen-yellow tokens are PRODUCT SEMANTICS — never
   change them for branding reasons.
   ──────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Package review and immutable correction history (default-off PR6). */
.package-review-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #d9d9d4);
  border-radius: 12px;
  background: var(--surface-subtle, #f8f8f5);
}

.package-review-heading,
.review-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* The panel is a <details>: its heading is the clickable summary. */
summary.package-review-heading {
  cursor: pointer;
  list-style: none;
}

summary.package-review-heading::-webkit-details-marker {
  display: none;
}

summary.package-review-heading::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted, #6b6b63);
  transition: transform 0.15s ease;
}

details[open] > summary.package-review-heading::after {
  transform: rotate(180deg);
}

.package-review-body {
  margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  summary.package-review-heading::after {
    transition: none;
  }
}

.review-feedback-form {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.review-feedback-form textarea {
  width: 100%;
  resize: vertical;
}

.review-queue-list {
  display: grid;
  gap: 0.7rem;
}

.review-queue-item {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border, #d9d9d4);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.review-queue-item > span:first-child {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.review-confirmed {
  background: #dff3e5;
  color: #185c32;
}

.review-active {
  background: #fff0c7;
  color: #725400;
}

.review-awaiting {
  background: #e8edf5;
  color: #34445f;
}

.review-blocked {
  background: #f8dddd;
  color: #7a2623;
}

.revision-state {
  margin-block: 1rem;
}

.revision-state-error {
  border-color: #c75b57;
}

/* Feedback we could not act on is guidance, not a defect: warn, don't alarm. */
.revision-state-rejected {
  border-color: #d9a441;
}

.review-history {
  margin-top: 1rem;
}

.review-history-item {
  padding-block: 1rem;
  border-top: 1px solid var(--border, #d9d9d4);
}

.review-history-item:first-of-type {
  border-top: 0;
}

.review-history-item h3 {
  margin: 0;
}

.review-history-item blockquote {
  margin: 0.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--border-strong, #bcc9d7);
  background: var(--surface-soft, #f8fafc);
  white-space: pre-wrap;
}

/* Verified translation-memory oversight (schema 13). The trust-chain rail is
   the one distinctive element: it makes immutable provenance readable before
   an operator reaches the destructive-looking suspension control. */
.memory-heading,
.memory-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.memory-filters {
  display: grid;
  grid-template-columns: minmax(13rem, 2fr) minmax(10rem, 1fr) minmax(12rem, 1fr) auto;
  align-items: end;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.memory-filters label,
.memory-danger-zone label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.memory-filters input,
.memory-filters select,
.memory-danger-zone select,
.memory-danger-zone textarea {
  width: 100%;
}

.memory-label-link {
  display: block;
  color: var(--navy);
  text-decoration: none;
}

.memory-label-link:hover { text-decoration: underline; }
.memory-id { display: block; overflow-wrap: anywhere; }
.memory-kind { margin: 0.1rem 0.15rem 0.1rem 0; background: #edf3f8; color: #34445f; }
.memory-status-active { background: #dff3e5; color: #185c32; }
.memory-status-suspended { background: #f8dddd; color: #7a2623; }
.memory-status-superseded { background: #e8edf5; color: #34445f; }

.memory-empty { padding: 2rem 0.5rem 1rem; text-align: center; }
.memory-empty p { margin-bottom: 0; }
.memory-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; }

.memory-provenance ol {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.memory-provenance li {
  position: relative;
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.8rem;
  min-height: 3.25rem;
  padding-bottom: 0.8rem;
}

.memory-provenance li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.48rem;
  top: 1rem;
  bottom: -0.1rem;
  width: 2px;
  background: #cdd8e3;
}

.memory-node {
  position: relative;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 1px #9fb0c2;
}

.memory-chain-active .memory-node { background: var(--green); }
.memory-chain-suspended .memory-node { background: #a43834; }
.memory-chain-superseded .memory-node { background: #66778c; }
.memory-provenance li div { display: grid; gap: 0.15rem; }
.memory-provenance li span:last-child { color: var(--muted); font-size: 0.88rem; }

.memory-allergens { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.memory-term { display: inline-block; margin: 0.15rem 0.7rem 0.15rem 0; }
.memory-actions { margin-top: 1rem; }
.memory-role-note { padding: 0.75rem; border-left: 3px solid var(--navy); background: var(--bg-alt); }
.memory-danger-zone { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.memory-danger-zone summary { cursor: pointer; color: #7a2623; font-weight: 700; }
.memory-danger-zone form { display: grid; gap: 0.75rem; max-width: 42rem; margin-top: 0.8rem; }
.memory-suspension-evidence { border-left: 4px solid #a43834; }

@media (max-width: 760px) {
  .memory-filters { grid-template-columns: 1fr; }
  .memory-heading, .memory-detail-heading { display: grid; }
}

.review-language-diffs {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.review-language-diff {
  display: grid;
  grid-template-columns: minmax(3rem, auto) 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
}

.review-language-diff div {
  display: grid;
  gap: 0.2rem;
}

.review-language-diff del,
.review-language-diff ins {
  padding: 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  white-space: pre-wrap;
}

.review-language-diff del {
  background: #fbe9e7;
}

.review-language-diff ins {
  background: #dff3e5;
}

@media (max-width: 700px) {
  .review-language-diff {
    grid-template-columns: 1fr;
  }
}

/* Display serif for headlines (self-hosted — GDPR, no CDN). Variable
   optical-size axis: browsers pick the right cut per font-size. */
@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/FrauncesVariable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette */
  --navy: #12315c;
  --green: #1a7f5a;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --text: #1a2332;
  --muted: #5a6b7f;
  --border: #d5dee8;
  --border-strong: #bcc9d7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-glass: rgb(255 255 255 / .78);

  /* Back-compat aliases (pre-12-E rules reference these) */
  --fg: var(--text);
  --accent: var(--navy);

  /* Product semantics — allergen highlighting. DO NOT rebrand. */
  --highlight-bg: #fff3a8;
  --highlight-border: #d4a800;

  --error-bg: #fff0f0;
  --error-fg: #a40000;
  --escalated-bg: #fef3c7;
  --escalated-fg: #92400e;
  --disclaimer-bg: #f0f6ff;

  --shadow: 0 1px 2px rgb(18 49 92 / .05), 0 8px 24px -18px rgb(18 49 92 / .28);
  --shadow-card: 0 1px 2px rgb(18 49 92 / .04), 0 14px 34px -24px rgb(18 49 92 / .3);
  --shadow-card-hover: 0 3px 8px rgb(18 49 92 / .06), 0 22px 42px -24px rgb(18 49 92 / .34);
  --focus-ring: 0 0 0 3px rgb(26 127 90 / .16);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  /* Landing v3 ("Regulatory Editorial") tokens */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --paper: #f7f6f2;          /* warm paper canvas, landing + public pages */
  --lp-border: #e7e4db;      /* warm hairline that sits on --paper */
  --shadow-lift:
    0 2px 6px rgb(18 49 92 / .05),
    0 18px 40px -18px rgb(18 49 92 / .18);
  --shadow-lift-hover:
    0 6px 14px rgb(18 49 92 / .07),
    0 26px 48px -18px rgb(18 49 92 / .24);
  /* Film grain (inline SVG turbulence) for the dark hero / CTA bands */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.55;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

/* ── Header (both variants) ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 255 255 / .86);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgb(18 49 92 / .08);
}
.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.wordmark {
  color: var(--navy);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 0.55rem;
}
.wordmark-mark {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  filter: drop-shadow(0 2px 4px rgb(18 49 92 / .16));
}
.site-nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--navy); }
.site-header-cta { margin-left: auto; }

/* Buttons */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
  transition: background .18s ease, border-color .18s ease,
              box-shadow .18s ease, translate .18s ease;
}
.btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.btn-lg { font-size: 1.05rem; padding: 0.7rem 1.5rem; }
.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: #1b4179; border-color: #1b4179; }
.btn-secondary {
  background: var(--bg);
  color: var(--green);
  border-color: var(--green);
}
.btn-secondary:hover { background: #ecf6f1; }
.btn-on-dark {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}
.btn-on-dark:hover { background: var(--bg-alt); }

/* ── Main column ─────────────────────────────────────────────────────── */
main { flex: 1 0 auto; width: 100%; }
.site-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}
/* Landing is full-bleed; each section manages its own content column. */
.landing { width: 100%; padding: 0; }

.page-heading { padding-top: 1.5rem; margin-bottom: 0.5rem; }
.page-heading h1 { margin: 0 0 0.2rem; font-size: 1.4rem; letter-spacing: -0.01em; }
.page-heading .tagline { margin: 0; color: var(--muted); font-size: 0.9rem; }

.page-intro { padding-top: 2.5rem; margin-bottom: 1rem; }
.page-intro h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 2.1rem;
  letter-spacing: -0.015em;
  color: var(--navy);
}
.page-sub { color: var(--muted); font-size: 1.1rem; max-width: 46rem; margin: 0 0 0.6rem; }

/* ── Footer (navy — the only dark section) ───────────────────────────── */
.site-footer {
  background: var(--navy);
  color: #c8d4e4;
  margin-top: 3rem;
}
.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 2rem 1.6rem;
}
.site-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.wordmark-footer { color: #fff; font-weight: 600; display: inline-flex; align-items: center; }
.site-footer-copy { margin: 0.4rem 0 0; font-size: 0.85rem; color: #93a5bf; }
.site-footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-footer-links a { color: #c8d4e4; text-decoration: none; font-size: 0.9rem; }
.site-footer-links a:hover { color: #fff; }
.site-footer-disclaimer {
  margin: 1.4rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgb(255 255 255 / .12);
  font-size: 0.82rem;
  color: #93a5bf;
  max-width: 56rem;
}
.site-footer-disclaimer strong { color: #c8d4e4; }

/* ────────────────────────────────────────────────────────────────────────
   Landing v3 — "Regulatory Editorial" (2026 refresh).
   Fraunces display serif, warm paper canvas, atmospheric full-bleed hero
   (aurora gradient + contour lines + film grain), glass pipeline panel,
   stat band, scroll reveals. Landing-scoped — app pages untouched.
   ──────────────────────────────────────────────────────────────────────── */

/* Warm paper canvas + paper-tinted glass header, landing only */
html:has(main.landing),
body:has(main.landing) { background: var(--paper); }
body:has(main.landing) .site-header { background: rgb(247 246 242 / .86); }
/* CTA band sits flush on the navy footer — hairline separates them */
body:has(main.landing) .site-footer {
  margin-top: 0;
  border-top: 1px solid rgb(255 255 255 / .14);
}

.lp-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 0.6rem;
}
.landing h2 {
  font-family: var(--font-display);
  font-weight: 540;
  font-size: clamp(1.65rem, 2.6vw, 2.15rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 1.2rem;
  color: var(--navy);
}

/* ── Hero v3 ─────────────────────────────────────────────────────────── */
.hero3 {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 4.6rem 2rem 3rem;
  background:
    radial-gradient(56rem 30rem at 82% -12%, rgb(26 127 90 / .42), transparent 62%),
    radial-gradient(44rem 26rem at -8% 108%, rgb(64 116 183 / .35), transparent 60%),
    radial-gradient(30rem 18rem at 55% 118%, rgb(31 156 106 / .18), transparent 70%),
    linear-gradient(163deg, #0b1e3d 0%, #12315c 52%, #0e2748 100%);
}
/* Contour-line artwork + fine survey grid, fading toward the bottom */
.hero3::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("/static/img/hero-topo.svg") right -8rem top -3rem / 1150px auto no-repeat,
    linear-gradient(rgb(255 255 255 / .033) 1px, transparent 1px) 0 0 / 100% 72px,
    linear-gradient(90deg, rgb(255 255 255 / .033) 1px, transparent 1px) 0 0 / 72px 100%;
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0 / .95), rgb(0 0 0 / .3) 82%, transparent);
          mask-image: linear-gradient(to bottom, rgb(0 0 0 / .95), rgb(0 0 0 / .3) 82%, transparent);
  pointer-events: none;
}
/* Film grain: kills flat-gradient banding, adds tactility */
.hero3::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--noise);
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.hero3-inner {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 3.5rem;
  align-items: center;
}
.hero3-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #a9dcc3;
  border: 1px solid rgb(255 255 255 / .16);
  background: rgb(255 255 255 / .06);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  margin: 0 0 1.5rem;
}
.hero3-eyebrow-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #35c98e;
  animation: hero3-pulse 2.6s ease-out infinite;
}
@keyframes hero3-pulse {
  0% { box-shadow: 0 0 0 0 rgb(53 201 142 / .5); }
  70%, 100% { box-shadow: 0 0 0 9px rgb(53 201 142 / 0); }
}
.hero3 h1 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.5rem, 4.6vw, 3.45rem);
  line-height: 1.07;
  letter-spacing: -0.012em;
  margin: 0 0 1.1rem;
  color: #fff;
}
.hero3-accent {
  background: linear-gradient(92deg, #8be0b6, #4db98a);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero3 .hero-sub {
  color: #c3d2e4;
  font-size: 1.12rem;
  line-height: 1.65;
  max-width: 33rem;
  margin: 0 0 2rem;
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.hero3 .btn { border-radius: 999px; }
.hero3 .btn-primary {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 10px 30px -8px rgb(26 127 90 / .55);
}
.hero3 .btn-primary:hover {
  background: #1e9067;
  border-color: #1e9067;
  translate: 0 -1px;
}
.hero3 .btn-secondary {
  background: rgb(255 255 255 / .04);
  color: #fff;
  border: 1px solid rgb(255 255 255 / .38);
}
.hero3 .btn-secondary:hover {
  border-color: #fff;
  background: rgb(255 255 255 / .1);
}

/* Glass pipeline panel — the hero "image" */
.hero3-visual { position: relative; }
.hero3-glow {
  position: absolute;
  inset: -10% -6%;
  background: radial-gradient(closest-side, rgb(38 168 118 / .38), transparent 72%);
  filter: blur(34px);
  pointer-events: none;
}
.hero3-panel {
  position: relative;
  border-radius: 20px;
  padding: 1.35rem 1.35rem 1.6rem;
  background: linear-gradient(152deg, rgb(255 255 255 / .11), rgb(255 255 255 / .04) 58%);
  border: 1px solid rgb(255 255 255 / .17);
  box-shadow:
    0 32px 70px -20px rgb(2 10 24 / .65),
    inset 0 1px 0 rgb(255 255 255 / .14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hero3-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.hero3-input-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgb(7 20 41 / .55);
  border: 1px solid rgb(255 255 255 / .14);
  color: #ecf3fb;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 0.36rem 0.55rem 0.36rem 0.95rem;
}
.hero3-input-lang {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  background: rgb(255 255 255 / .13);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  color: #cfe0f2;
}
.hero3-stages { list-style: none; display: flex; gap: 0.3rem; margin: 0; padding: 0; }
.hero3-stage {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgb(255 255 255 / .55);
  border: 1px solid rgb(255 255 255 / .14);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  white-space: nowrap;
}
.hero3-stage.is-done { color: #9ad9bb; border-color: rgb(75 185 138 / .45); }
.hero3-stage.is-done::before { content: "\2713 "; }
.hero3-stage.is-active {
  color: #fff;
  border-color: rgb(255 255 255 / .5);
  background: rgb(255 255 255 / .1);
  animation: hero3-stage-glow 2.2s ease-in-out infinite;
}
@keyframes hero3-stage-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgb(139 224 182 / 0); }
  50% { box-shadow: 0 0 14px 0 rgb(139 224 182 / .35); }
}
.hero3-card {
  position: relative;
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 0.85rem 1.05rem;
  box-shadow: 0 20px 45px -12px rgb(2 10 24 / .55);
}
.hero3-card .region-label { margin-bottom: 0.3rem; }
.hero3-card .ingredients,
.hero3-card .contains-statement { margin: 0.12rem 0; }
.hero3-card-a { rotate: -1.4deg; z-index: 2; animation: hero-float 7s ease-in-out infinite; }
.hero3-card-b { rotate: 1.1deg; margin: 0.8rem 0 0 2rem; animation: hero-float 7s ease-in-out 1.1s infinite; }
.hero3-chip {
  position: absolute;
  right: 1.1rem;
  bottom: -0.85rem;
  background: linear-gradient(135deg, #22996d, #157a53);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 12px 26px -6px rgb(9 61 41 / .65);
  animation: hero-float 7s ease-in-out 0.5s infinite;
}
@keyframes hero-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

/* Stat band at the hero's lower edge */
.hero3-stats {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 3.4rem auto 0;
  padding-top: 1.9rem;
  border-top: 1px solid rgb(255 255 255 / .14);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem 2rem;
}
.hero3-stat dt {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 540;
  line-height: 1.1;
  color: #fff;
  margin: 0;
}
.hero3-stat dd {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9fb2ca;
}

/* Hero load-in: staggered rise (motion-safe only) */
@media (prefers-reduced-motion: no-preference) {
  .hero3-copy > * { animation: lp-rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .hero3-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero3-copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero3-copy > :nth-child(4) { animation-delay: 0.24s; }
  .hero3-visual { animation: lp-rise-panel 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
  .hero3-stats { animation: lp-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both; }
}
@keyframes lp-rise {
  from { opacity: 0; translate: 0 22px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes lp-rise-panel {
  from { opacity: 0; translate: 0 26px; scale: 0.975; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero3-card-a, .hero3-card-b, .hero3-chip,
  .hero3-eyebrow-dot, .hero3-stage.is-active { animation: none; }
}

/* Scroll reveal — .reveal-on is set by JS; without it nothing hides */
.reveal-on [data-reveal] {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.75s ease, translate 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-on [data-reveal].is-in { opacity: 1; translate: 0 0; }

/* ── Demo section ────────────────────────────────────────────────────── */
.demo {
  max-width: calc(1080px + 4rem);
  margin: 4.8rem auto 0;
  padding: 0 2rem;
  text-align: center;
}
.demo-input {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.7rem;
}
.demo-input-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.demo-chip {
  background: #fff;
  border: 1px solid var(--lp-border);
  border-radius: 999px;
  padding: 0.45rem 1.15rem;
  font-size: 1.05rem;
  box-shadow: var(--shadow-lift);
}
.demo-chip-lang {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--lp-border);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.4rem;
  color: var(--muted);
}
.demo-arrow { color: #b9b4a6; font-size: 1.25rem; margin: 0.7rem 0; }
.demo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
  text-align: left;
}
.demo-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  padding: 1.05rem 1.2rem 1.1rem;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  transition: translate 0.22s ease, box-shadow 0.22s ease;
}
.demo-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), rgb(26 127 90 / .2));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.demo-card:hover { translate: 0 -4px; box-shadow: var(--shadow-lift-hover); }
.demo-card:hover::before { opacity: 1; }
.demo-caption {
  color: var(--muted);
  font-size: 0.93rem;
  max-width: 44rem;
  margin: 1.6rem auto 0;
}

/* ── How it works (editorial, open layout) ───────────────────────────── */
.how-it-works {
  max-width: calc(1080px + 4rem);
  margin: 5.2rem auto 0;
  padding: 0 2rem;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.4rem;
}
.step {
  position: relative;
  border-top: 1px solid var(--lp-border);
  padding-top: 1.15rem;
}
.step::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 3.4rem;
  height: 3px;
  background: var(--green);
  border-radius: 0 2px 2px 0;
}
.step-num {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 500;
  line-height: 1;
  color: rgb(18 49 92 / .28);
}
.step h3 { margin: 0.7rem 0 0.45rem; font-size: 1.05rem; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }

/* ── Trust cards ─────────────────────────────────────────────────────── */
.trust {
  max-width: calc(1080px + 4rem);
  margin: 5.2rem auto 0;
  padding: 0 2rem;
  text-align: center;
}
.trust-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  margin-top: 1.9rem;
  text-align: left;
}
.trust-card {
  background: #fff;
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  padding: 1.5rem 1.4rem 1.35rem;
  box-shadow: var(--shadow-lift);
  transition: translate 0.22s ease, box-shadow 0.22s ease;
}
.trust-card:hover { translate: 0 -4px; box-shadow: var(--shadow-lift-hover); }
.trust-card h3 { margin: 0.95rem 0 0.4rem; font-size: 1.02rem; }
.trust-card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.trust-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #eaf6f0, #dcefe6);
  border: 1px solid rgb(26 127 90 / .16);
}
.trust-icon {
  display: inline-block;
  width: 1.6rem; height: 1.6rem;
  border: 2px solid var(--green);
  border-radius: 5px;
  position: relative;
}
/* Minimal CSS glyphs — no icon font, no SVG assets. */
.trust-icon-audit::after {
  content: "";
  position: absolute; inset: 4px 5px;
  border-top: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
}
.trust-icon-shield { border-radius: 5px 5px 50% 50%; }
.trust-icon-shield::after {
  content: "✓";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--green); font-size: 0.85rem; font-weight: 700;
}
.trust-icon-globe { border-radius: 50%; }
.trust-icon-globe::after {
  content: "";
  position: absolute; inset: 2px 30%;
  border: 2px solid var(--green);
  border-radius: 50%;
  border-top: none; border-bottom: none;
}
.trust-icon-lock::after {
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 0.7rem; height: 0.55rem;
  border: 2px solid var(--green);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
}

/* ── Pricing teaser (split card: navy price panel + copy) ────────────── */
.pricing-teaser {
  width: min(1000px, calc(100% - 4rem));
  margin: 5.2rem auto 0;
  display: grid;
  grid-template-columns: minmax(15rem, 0.85fr) 1.15fr;
  background: #fff;
  border: 1px solid var(--lp-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.pricing-teaser-price {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 2.4rem 2.2rem;
  color: #fff;
  background:
    radial-gradient(24rem 16rem at 90% -20%, rgb(26 127 90 / .5), transparent 65%),
    linear-gradient(160deg, #0c2144, #143767);
  overflow: hidden;
}
.pricing-teaser-price::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--noise);
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.pricing-teaser-amount {
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 5.4vw, 4rem);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.01em;
}
.pricing-teaser-unit {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #b4c5db;
  line-height: 1.55;
}
.pricing-teaser-body { padding: 2.2rem 2.4rem; text-align: left; }
.landing .pricing-teaser-body h2 { font-size: 1.55rem; margin: 0 0 0.5rem; }
.pricing-teaser-line { font-size: 1.02rem; margin: 0 0 1rem; color: var(--muted); }
.pricing-teaser-line strong { color: var(--navy); }
.pricing-teaser-points { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.pricing-teaser-points li {
  position: relative;
  padding-left: 1.5rem;
  margin: 0.45rem 0;
  font-size: 0.95rem;
}
.pricing-teaser-points li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* ── Final CTA band (full-bleed navy — bookends the hero) ────────────── */
.cta-banner {
  position: relative;
  overflow: hidden;
  margin: 5.5rem 0 0;
  padding: 4.4rem 2rem 4.8rem;
  background:
    radial-gradient(48rem 26rem at 18% -20%, rgb(26 127 90 / .38), transparent 62%),
    radial-gradient(40rem 22rem at 100% 120%, rgb(64 116 183 / .3), transparent 62%),
    linear-gradient(200deg, #0b1e3d, #12315c 60%, #0e2748);
}
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/img/hero-topo.svg") left -10rem bottom -14rem / 1100px auto no-repeat;
  pointer-events: none;
}
.cta-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--noise);
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.cta-banner-inner {
  position: relative;
  text-align: center;
  color: #fff;
  max-width: 1080px;
  margin: 0 auto;
}
.landing .cta-banner h2 { margin: 0 0 0.6rem; color: #fff; }
.cta-banner p { margin: 0 auto 1.6rem; color: #c3d2e4; max-width: 36rem; }
.cta-banner .btn { border-radius: 999px; }

/* ── Landing responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero3-inner { grid-template-columns: 1fr; gap: 2.6rem; }
  .hero3-visual { width: 100%; max-width: 28rem; margin: 0 auto; }
  .hero3-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .pricing-teaser { grid-template-columns: 1fr; }
  .pricing-teaser-price { padding: 1.9rem 2rem; }
}
@media (max-width: 720px) {
  .hero3 { padding: 3.2rem 1.2rem 2.4rem; }
  .demo, .how-it-works, .trust { padding: 0 1.2rem; margin-top: 3.6rem; }
  .pricing-teaser { width: calc(100% - 2.4rem); margin-top: 3.6rem; }
  .cta-banner { margin-top: 3.8rem; padding: 3.4rem 1.2rem 3.8rem; }
}

/* ── Pricing page ────────────────────────────────────────────────────── */
.table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95rem;
  background: var(--bg);
}
.table th, .table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  text-align: left;
  vertical-align: top;
}
.table th { background: var(--bg-alt); font-weight: 600; }

.pricing-unit, .pricing-packages, .faq { margin: 2.2rem 0; }
.package-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.package-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.3rem;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.package-card-featured { border-color: var(--navy); border-width: 2px; }
.package-card h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.package-price { font-size: 1.9rem; font-weight: 600; color: var(--navy); margin: 0 0 0.8rem; }
.package-card ul { margin: 0 0 1.2rem; padding-left: 1.2rem; color: var(--muted); font-size: 0.93rem; flex: 1; }
.package-card li { margin: 0.25rem 0; }
.package-card .btn { align-self: flex-start; }

.faq-list dt { font-weight: 600; margin: 1.1rem 0 0.25rem; }
.faq-list dd { margin: 0 0 0.6rem; color: var(--muted); max-width: 52rem; }
.pricing-footnote { font-size: 0.88rem; margin-top: 2rem; }

/* ── Docs page ───────────────────────────────────────────────────────── */
.docs-section { margin: 2.2rem 0; }
.docs-section h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
.docs-section h3 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }
.code-block {
  background: #0f2340;
  color: #dce6f5;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
}
.code-block code { background: none; padding: 0; color: inherit; font-size: inherit; }
.c-cmd { color: #7fd1ab; font-weight: 600; }
.c-str { color: #ffd479; }
.c-key { color: #8ab8f5; }
.c-num { color: #d6a5e8; }

/* ── Contact page ────────────────────────────────────────────────────── */
.contact-form-wrap { max-width: 34rem; }
.contact-form .form-field { margin: 0 0 1.1rem; }
.contact-form label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.25rem; }
.contact-form .req { color: var(--error-fg); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  font: inherit;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgb(18 49 92 / .12);
}
.field-error { color: var(--error-fg); font-size: 0.85rem; margin: 0.25rem 0 0; }
/* Honeypot: invisible to humans, still submittable by naive bots. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}
.contact-success {
  max-width: 34rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 2rem;
  margin-top: 1rem;
}
.contact-success h2 { margin: 0.6rem 0 0.4rem; }
.contact-success-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
}

/* ── Legal pages ─────────────────────────────────────────────────────── */
.page-legal .legal-section { margin: 1.8rem 0; max-width: 46rem; }
.page-legal h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.legal-note-de {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

/* ── Shared admin components (team / admin pages) ────────────────────── */
table.admin { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.9rem; background: var(--bg); }
table.admin th, table.admin td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: middle;
}
table.admin th { background: var(--bg-alt); font-size: 0.8rem; }
.inline-form { display: inline-flex; gap: 0.3rem; align-items: center; margin: 0; }
.inline-form select, .inline-form input {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
}
.msg-banner {
  background: #e8f6ec;
  color: #0a5a1f;
  border: 1px solid #6dbf86;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  margin: 0.6rem 0;
  font-size: 0.9rem;
}
.err-banner {
  background: #fbeaea;
  color: #7a1212;
  border: 1px solid #d88;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  margin: 0.6rem 0;
  font-size: 0.9rem;
}
/* One-time plain-token reveal (Phase 12-F: green — it's a success state). */
.token-banner {
  background: #e8f6ec;
  color: #0a5a1f;
  border: 2px solid var(--green);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin: 0.6rem 0;
  font-size: 0.95rem;
}
.token-banner code {
  display: block;
  margin-top: 0.4rem;
  padding: 0.5rem 0.7rem;
  background: #fff;
  border: 1px dashed var(--green);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  user-select: all;
  word-break: break-all;
}
.token-revoked { color: #999; }

/* ── App: disclaimer + translate form ────────────────────────────────── */
.disclaimer {
  background: var(--disclaimer-bg);
  border-left: 4px solid var(--accent);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

#translate-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem auto auto;
  gap: 0.6rem;
  align-items: end;
  background: var(--bg);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#translate-form .field {
  display: flex;
  flex-direction: column;
}
#translate-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
#translate-form input,
#translate-form select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
}
#translate-form .field-ingredient input {
  font-size: 1.05rem;
  padding: 0.7rem 0.85rem;
}
.app-footnote { margin-top: 2rem; }

/* Import from… dropdown */
.import-from {
  position: relative;
  display: inline-block;
}
.import-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 12rem;
  list-style: none;
  padding: 0.3rem 0;
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  z-index: 10;
}
.import-menu-item {
  padding: 0.5rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.import-menu-item.disabled {
  color: var(--muted);
  cursor: not-allowed;
}
.coming-soon {
  font-size: 0.7rem;
  padding: 0.05rem 0.4rem;
  background: var(--bg-alt);
  border-radius: 99px;
  color: var(--muted);
}
.caret {
  font-size: 0.7rem;
  margin-left: 0.25rem;
}

@media (max-width: 640px) {
  #translate-form { grid-template-columns: 1fr; }
}

#result-panel { margin-top: 1.5rem; }

.polling {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
}
.spinner {
  width: 18px; height: 18px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
code {
  background: var(--bg-alt);
  padding: 0 0.3em;
  border-radius: 3px;
  font-size: 0.85em;
}

.error {
  background: var(--error-bg);
  color: var(--error-fg);
  border: 1px solid var(--error-fg);
  padding: 1rem;
  border-radius: var(--radius);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
}
.badge.escalated {
  background: var(--escalated-bg);
  color: var(--escalated-fg);
}

.allergens-summary h3 { margin: 0.5rem 0; font-size: 1rem; }
.allergen-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  background: var(--highlight-bg);
  border: 1px solid var(--highlight-border);
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.85rem;
}

.language-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.lang-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.lang-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0;
  border-bottom: none;
  margin-bottom: 0.5rem;
  background: none;
}
.lang-card h3 { margin: 0; font-size: 1.05rem; }
.lang-code {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  background: var(--bg-alt);
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
}
.translation {
  font-size: 1.05rem;
  margin: 0 0 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--border);
}

.region-tabs { display: flex; flex-direction: column; gap: 0.5rem; }
.region-block {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
  background: var(--bg-alt);
}
.region-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.region-output p.ingredients { margin: 0; }
.region-output p.contains-statement { margin: 0.3rem 0 0; font-size: 0.95rem; }

mark.allergen {
  background: var(--highlight-bg);
  border-bottom: 2px solid var(--highlight-border);
  padding: 0 0.05em;
}

/* Italic for Latin binomial nomenclature, per scientific convention
   (Linné, ICN, ICZN) and most food-audit style guides.
   The italic alone is too subtle when the binomial is embedded next to
   diacritic-heavy text (HU/SL/ES) at small region-block font size, so we
   also lift the color and weight slightly. This is presentation-only;
   the semantic markup (em.latin) stays canonical for downstream PLMs
   that consume the JSON span list. */
em.latin {
  font-style: italic;
  color: #2a4a7f;
  font-weight: 500;
}

/* ── Highlighting legend ─────────────────────────────────────────────── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 1.2rem 0 0.4rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 2px;
  vertical-align: middle;
}
.swatch-allergen { background: var(--highlight-bg); border: 1px solid var(--highlight-border); }

/* ── Result summary line ─────────────────────────────────────────────── */
.result-summary { margin: 0.4rem 0 1rem; font-size: 0.95rem; }

/* ── Flag-issue link ─────────────────────────────────────────────────── */
.flag-link-wrap { margin: 0.2rem 0 0.8rem; }
.flag-link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}
.flag-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Region filter pills ─────────────────────────────────────────────── */
.region-filter { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 1rem; }
.region-pill {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg);
  cursor: pointer;
  color: var(--text);
}
.region-pill:hover { border-color: var(--accent); color: var(--accent); }
.region-pill.pill-active { background: var(--accent); color: white; border-color: var(--accent); }
.region-hidden { display: none !important; }

/* ── Copy-to-clipboard per region ────────────────────────────────────── */
.region-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.copy-btn {
  font-size: 0.7rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
  color: var(--muted);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }
.copy-btn.copy-failed { color: var(--error-fg); border-color: var(--error-fg); background: var(--error-bg); }

/* ── Send-to-PLM button + toast ──────────────────────────────────────── */
.plm-zone {
  margin: 1.5rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.plm-hint { margin: 0; max-width: 42rem; }
.send-to-plm {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
}
.send-to-plm:hover { filter: brightness(1.15); }
.plm-toast {
  padding: 0.5rem 0.8rem;
  background: var(--escalated-bg);
  color: var(--escalated-fg);
  border: 1px solid var(--escalated-fg);
  border-radius: 4px;
  font-size: 0.9rem;
}
.plm-toast.fade-out { transition: opacity 0.4s ease; opacity: 0; }

/* ── Top-right user nav (app header) ─────────────────────────────────── */
.user-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.user-nav form { margin: 0; display: inline; }

/* ── Login pages ─────────────────────────────────────────────────────── */
.login-shell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1rem;
  max-width: 1080px;
  margin: 0 auto;
}
.login-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  width: 100%;
  max-width: 28rem;
  box-shadow: 0 6px 20px rgb(18 49 92 / .06);
  text-align: center;
}
.login-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
}
.login-card p.subtitle {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0;
}
.login-card label {
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
}
.login-card input[type="email"] {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  width: 100%;
}
.login-card input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(18 49 92 / .12);
}
.login-footnote {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.login-status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 0.8rem;
  color: white;
  font-weight: 700;
}
.login-status-icon.success { background: var(--green); }
.login-status-icon.warning { background: #c97a16; }
.login-card .back-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.login-card .back-link:hover { color: var(--accent); }

/* ── SSO buttons on the login page ───────────────────────────────────── */
.sso-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sso-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
}
.sso-button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(18 49 92 / .08);
}
.sso-glyph {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex: none;
}
/* Microsoft: the four-square logo colours as a 2×2 conic gradient. */
.sso-glyph-microsoft {
  background: conic-gradient(
    #7fba00 0 90deg,
    #ffb900 90deg 180deg,
    #00a4ef 180deg 270deg,
    #f25022 270deg 360deg
  );
}
/* Google: brand blue square (no logo assets needed). */
.sso-glyph-google { background: #4285f4; border-radius: 50%; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-header-inner { padding: 0.8rem 1.2rem; gap: 0.8rem 1.2rem; }
  .site-nav { order: 3; width: 100%; gap: 1rem; }
  .site-main { padding: 0 1.2rem 2rem; }
  .site-footer-inner { padding: 1.6rem 1.2rem 1.4rem; }
  .user-nav { width: 100%; row-gap: 0.3rem; }
}

@media (max-width: 480px) {
  .login-card { padding: 1.4rem 1.2rem; }
  .login-card h2 { font-size: 1.2rem; }
}

/* ────────────────────────────────────────────────────────────────────────
   Phase 12-F — app-UI components: cards, toasts, dashboard, polling.
   ──────────────────────────────────────────────────────────────────────── */

/* ── Card shell (all app pages) ──────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
  margin: 1.2rem 0;
}
.card > .card-title:first-child,
.card > .card-head-row:first-child .card-title { margin-top: 0; }
.card-title {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.8rem;
}
.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.card-head-row .card-title { margin: 0; }
.card-sub { margin-top: 1.2rem; font-size: 0.98rem; }
.count-pill {
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.05rem 0.5rem;
  vertical-align: 0.15em;
}

/* ── Unified toast banners (flash / error / warning) ─────────────────── */
.toast {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin: 0.6rem 0;
  font-size: 0.92rem;
}
.toast a { color: inherit; font-weight: 600; }
.toast-success { background: #e8f6ec; color: #0a5a1f; border-color: #6dbf86; }
.toast-error { background: var(--error-bg); color: var(--error-fg); border-color: #d88; }
.toast-warning { background: #fef3c7; color: #92400e; border-color: #d4a800; }

/* Inline status pill (admin stats OK / CAP EXCEEDED) */
.status-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 99px;
  border: 1px solid;
  padding: 0.1rem 0.6rem;
  margin-left: 0.4rem;
  vertical-align: 0.1em;
}
.status-pill-ok { background: #e8f6ec; color: #0a5a1f; border-color: #6dbf86; }
.status-pill-error { background: var(--error-bg); color: var(--error-fg); border-color: #d88; }

/* ── Buttons: small + danger-outline variants ────────────────────────── */
.btn-sm { font-size: 0.82rem; padding: 0.25rem 0.7rem; }
.inline-form button.danger,
.btn-danger-outline {
  background: transparent;
  color: var(--error-fg);
  border: 1px solid var(--error-fg);
}
.inline-form button.danger:hover,
.btn-danger-outline:hover { background: var(--error-bg); }

/* ── Dashboard ───────────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  gap: 1.2rem;
  align-items: stretch;
}
.dash-grid .card { margin: 0; }
@media (max-width: 820px) { .dash-grid { grid-template-columns: 1fr; } }

.credit-balance {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}
.credit-balance-label {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.credit-meta { margin: 0.8rem 0 0; font-size: 0.92rem; }
.credit-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border);
}
.credit-meta dt { color: var(--muted); margin: 0; }
.credit-meta dd { margin: 0; text-align: right; }

/* Pure-CSS 30-day bar chart. Bars scale against the busiest day. */
.usage-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding: 0.4rem 0.2rem 0;
  border-bottom: 1px solid var(--border);
  overflow: clip;
}
.usage-day {
  flex: 1 1 0;
  min-width: 4px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.usage-day:hover { background: var(--bg-alt); }
.usage-day::after {
  content: attr(data-tooltip);
  position: absolute;
  top: .35rem;
  left: 50%;
  z-index: 3;
  translate: -50% -4px;
  width: max-content;
  max-width: 11rem;
  padding: .28rem .48rem;
  border-radius: 5px;
  background: var(--navy);
  color: #fff;
  font-size: .7rem;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, translate .14s ease;
}
.usage-day:hover::after { opacity: 1; translate: -50% 0; }
.usage-day:first-child::after { left: 0; translate: 0 -4px; }
.usage-day:first-child:hover::after { translate: 0 0; }
.usage-day:last-child::after { left: auto; right: 0; translate: 0 -4px; }
.usage-day:last-child:hover::after { translate: 0 0; }
.usage-bar {
  display: block;
  width: 100%;
  min-height: 2px;
  background: var(--green);
  border-radius: 2px 2px 0 0;
}
.usage-bar-zero { background: var(--border); }
.usage-chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* Recent-jobs table details */
.badge-api {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  background: var(--disclaimer-bg);
  border: 1px solid var(--navy);
  border-radius: 3px;
  padding: 0.05rem 0.4rem;
}
.pager {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.pager a {
  color: var(--navy);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.7rem;
}
.pager a:hover { border-color: var(--navy); }
.pager .pager-disabled {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.7rem;
  opacity: 0.45;
}

/* ── Polling stages + indeterminate progress (Phase 12-F) ────────────── */
.polling { gap: 0.55rem; }
.polling-head { display: flex; align-items: center; gap: 0.6rem; }
.polling-head p { margin: 0; }
.stages {
  list-style: none;
  display: flex;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.stage {
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.15rem 0.7rem;
  background: var(--bg-alt);
}
.stage:not(:last-child)::after { content: " →"; color: var(--border); }
.stage.stage-active {
  color: var(--navy);
  border-color: var(--navy);
  background: var(--disclaimer-bg);
  font-weight: 600;
}
.progress-track {
  width: 100%;
  max-width: 26rem;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.progress-indeterminate {
  position: absolute;
  top: 0; bottom: 0;
  width: 35%;
  border-radius: 99px;
  background: var(--green);
  animation: indeterminate 1.4s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { left: -35%; }
  100% { left: 100%; }
}

/* ── Failed fragment ─────────────────────────────────────────────────── */
.failed-card h2 { margin-top: 0; font-size: 1.15rem; }
.error-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.8rem 0 0.2rem;
}

/* ── Result frame (card wrapper only — inner markup untouched) ───────── */
.result > .card { margin: 0 0 1.2rem; }
.result-header-card .result-header { margin-bottom: 0.8rem; }
.result-input { margin: 0 0 0.8rem; font-size: 0.95rem; }
.result-input code { font-size: 0.9em; }
.result .plm-card .plm-zone { margin: 0; }

/* ── Profile (moved out of the _profile.html inline block) ───────────── */
.profile-wrap { max-width: 36rem; margin: 0 auto; }
.field-row { margin: 0.6rem 0; }
.field-row label { font-size: 0.85rem; color: var(--muted); }
.lang-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  margin: 0.6rem 0 1rem;
}
.lang-checkboxes label {
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.billing-note { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; }

/* ── Admin console tab bar (Phase 13-A follow-up) ──────────────────────
   Segmented control: grouped track, clearly separated segments, solid
   navy active state. */
.admin-nav {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 1.1rem;
  padding: 0.28rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.admin-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.34rem 1.05rem;
}
.admin-nav a:hover {
  color: var(--navy);
  background: var(--bg);
  border-color: var(--border);
}
.admin-nav a.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 1px 3px rgb(18 49 92 / .25);
}

/* ── Shared table polish (admin/team/dashboard tables) ───────────────── */
table.admin td .inline-form { flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.back-row { margin: 1.6rem 0 0; }
.back-row a { color: var(--muted); text-decoration: none; }
.back-row a:hover { color: var(--navy); }

/* (Landing hero v2 removed in the v3 refresh — see "Landing v3" section.) */

/* ────────────────────────────────────────────────────────────────────────
   LabelNorm UI polish — shared finish layer.
   Keeps the Regulatory Editorial structure intact while bringing legacy
   app/admin controls onto the same component language.
   ──────────────────────────────────────────────────────────────────────── */

html { scroll-behavior: smooth; }
body:not(:has(main.landing)) {
  background:
    radial-gradient(circle at 85% -10%, rgb(26 127 90 / .055), transparent 30rem),
    linear-gradient(180deg, #fff 0, var(--surface-soft) 42rem);
}

::selection { background: rgb(26 127 90 / .2); color: var(--navy); }

a { text-underline-offset: 0.16em; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.site-header {
  box-shadow: 0 1px 0 rgb(255 255 255 / .65), 0 8px 26px -24px rgb(18 49 92 / .65);
}
.site-header-inner { min-height: 4.15rem; }
.site-nav a {
  position: relative;
  padding: 0.35rem 0;
  transition: color .18s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0.05rem;
  height: 2px;
  border-radius: 99px;
  background: var(--green);
  transition: right .2s ease;
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after { right: 0; }
.site-nav a.active { color: var(--navy); font-weight: 650; }
.site-nav a.active::after { right: 0; }
.wordmark { font-weight: 650; letter-spacing: -0.025em; }
.wordmark-footer .wordmark-mark {
  padding: 1px;
  border-radius: 5px;
  background: #fff;
  filter: none;
}

/* Unified buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: 9px;
  font-weight: 620;
  letter-spacing: -0.005em;
  box-shadow: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease,
              box-shadow .18s ease, translate .18s ease;
}
.btn:hover { translate: 0 -1px; }
.btn:active { translate: 0; }
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 8px 18px -12px rgb(18 49 92 / .75);
}
.btn-primary:hover {
  background: #183d6d;
  border-color: #183d6d;
  box-shadow: 0 12px 22px -14px rgb(18 49 92 / .85);
}
.btn-secondary {
  background: rgb(255 255 255 / .74);
  color: var(--navy);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: #fff;
  color: var(--green);
  border-color: rgb(26 127 90 / .55);
  box-shadow: 0 8px 18px -16px rgb(18 49 92 / .8);
}
.btn-danger-outline { font-weight: 600; }
.btn-sm { min-height: 2rem; padding: 0.32rem 0.72rem; font-size: 0.8rem; }
.btn-lg { min-height: 3rem; padding: 0.72rem 1.45rem; }
.btn-block { width: 100%; }
.btn[disabled],
button[disabled] { opacity: .52; cursor: not-allowed; translate: 0; box-shadow: none; }

/* Unified form controls */
:where(input[type="text"], input[type="email"], input[type="number"], select, textarea) {
  font: inherit;
  color: var(--text);
  background: rgb(255 255 255 / .9);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
:where(input[type="text"], input[type="email"], input[type="number"], select, textarea):hover {
  border-color: #9eafc1;
}
:where(input[type="text"], input[type="email"], input[type="number"], select, textarea):focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
  box-shadow: var(--focus-ring);
}
::placeholder { color: #8493a4; opacity: 1; }
label { font-weight: 560; }

/* Public subpages */
.page-intro { padding-top: 3rem; margin-bottom: 1.5rem; }
.page-intro h1 { font-size: clamp(2rem, 4vw, 2.55rem); line-height: 1.08; }
.page-sub { line-height: 1.65; }
.page-pricing .pricing-unit,
.page-pricing .pricing-packages,
.page-pricing .faq,
.page-docs .docs-section,
.page-contact .contact-form-wrap,
.page-legal .legal-section {
  scroll-margin-top: 6rem;
}
.package-card,
.contact-success {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.package-card {
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, translate .2s ease;
}
.package-card:hover { translate: 0 -3px; border-color: var(--border-strong); box-shadow: var(--shadow-card-hover); }
.package-card-featured {
  border-color: rgb(26 127 90 / .7);
  border-width: 1px;
  box-shadow: inset 0 3px 0 var(--green), var(--shadow-card);
}
.code-block {
  border: 1px solid rgb(127 209 171 / .14);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px -24px rgb(2 10 24 / .9);
}

/* Cards and data surfaces */
.card {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-card);
}
.card-title { color: var(--navy); font-weight: 660; }
.count-pill { background: #fff; border-color: var(--border-strong); }
.toast, .msg-banner, .err-banner, .token-banner { border-radius: var(--radius); }

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: #fff;
  box-shadow: 0 8px 24px -24px rgb(18 49 92 / .7);
}
.table,
table.admin {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-wrap .table,
.table-wrap table.admin { margin: 0; border: 0; border-radius: 0; }
.public-table-wrap { margin: 1rem 0; }
.table th, .table td,
table.admin th, table.admin td {
  border: 0;
  border-bottom: 1px solid #e8edf2;
  padding: 0.72rem 0.8rem;
}
.table th + th, .table td + td,
table.admin th + th, table.admin td + td { border-left: 1px solid #edf1f5; }
.table th,
table.admin th {
  background: #f3f6f9;
  color: #43546a;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody tr:last-child td,
table.admin tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:nth-child(even),
table.admin tbody tr:nth-child(even) { background: #fbfcfd; }
.table tbody tr,
table.admin tbody tr { transition: background .14s ease; }
.table tbody tr:hover,
table.admin tbody tr:hover { background: #f2f8f5; }
table.admin code.snip { white-space: normal; overflow-wrap: anywhere; }
.table-wrap table.admin thead th { position: sticky; top: 0; z-index: 2; }

.inline-form { gap: 0.45rem; flex-wrap: wrap; max-width: 100%; }
.inline-form select,
.inline-form input {
  min-width: 0;
  max-width: 100%;
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
}
.inline-form .btn.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  border-radius: var(--radius-sm);
}
.inline-form .btn.btn-secondary { background: #fff; color: var(--navy); border-color: var(--border-strong); }
.inline-form .btn.btn-danger-outline { background: #fff; color: var(--error-fg); border-color: rgb(164 0 0 / .45); }

/* App workspace */
.page-heading { padding-top: 2rem; margin-bottom: 1rem; }
.page-heading h1 {
  color: var(--navy);
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  font-weight: 680;
  letter-spacing: -.025em;
}
.page-heading .tagline { font-size: .92rem; }
.disclaimer {
  background: rgb(240 246 255 / .78);
  border: 1px solid #cdddf1;
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  box-shadow: 0 8px 22px -22px rgb(18 49 92 / .7);
}
#translate-form {
  gap: .75rem;
  padding: 1.25rem;
  border-color: var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--shadow-card);
}
#translate-form label { margin-bottom: .35rem; color: #495d74; font-weight: 620; }
#translate-form input,
#translate-form select { min-height: 2.75rem; border-color: var(--border-strong); border-radius: var(--radius-sm); }
#translate-form .field-ingredient input { min-height: 3rem; }
#translate-form .btn { min-height: 2.75rem; border-radius: var(--radius-sm); }
#translate-form .btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
#translate-form .btn-secondary { background: #fff; color: var(--navy); border-color: var(--border-strong); }
.import-menu {
  padding: .4rem;
  border-color: var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -22px rgb(18 49 92 / .5);
}
.import-menu-item { border-radius: var(--radius-sm); }
.coming-soon { border: 1px solid var(--border); background: #fff; }

.polling { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.stage { background: #fff; }
.stage.stage-active { border-color: rgb(26 127 90 / .45); color: #116342; background: #edf8f3; }
.progress-track { height: 7px; border: 0; background: #e6edf2; }

.language-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 1.1rem;
}
.lang-card {
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
}
.lang-card header { padding-bottom: .65rem; border-bottom: 1px solid #edf1f5; }
.lang-code { color: var(--navy); border: 1px solid var(--border); border-radius: 5px; background: #fff; }
.translation { line-height: 1.65; border-bottom-style: solid; }
.translation,
.region-output,
.result-input,
.result-header { overflow-wrap: anywhere; }
.region-output { min-width: 0; line-height: 1.6; }
.region-block { border-radius: var(--radius); padding: .7rem .8rem; background: #fafbfd; }
.region-pill, .copy-btn {
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.region-pill { min-height: 2rem; padding: .32rem .78rem; font-weight: 600; }
.region-pill:hover { background: #fff; box-shadow: 0 4px 12px -10px rgb(18 49 92 / .8); }
.region-pill.pill-active { background: var(--navy); border-color: var(--navy); }
.copy-btn { border-radius: 5px; padding: .18rem .55rem; }
.copy-btn:hover { background: #fff; }
.send-to-plm {
  min-height: 2.5rem;
  padding: .55rem 1.05rem;
  border-radius: 9px;
  background: var(--navy);
  border-color: var(--navy);
  font-weight: 620;
  box-shadow: 0 8px 18px -12px rgb(18 49 92 / .75);
}
.send-to-plm:hover { filter: none; background: #183d6d; }
.legend { border-radius: var(--radius); background: #fff; }

.user-nav { position: relative; gap: .35rem; }
.user-nav-primary { display: flex; align-items: center; gap: .2rem; }
.user-nav-primary a {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  padding: .3rem .62rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 560;
  text-decoration: none;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.user-nav-primary a:hover,
.user-nav-primary a.active {
  color: var(--navy);
  background: #fff;
  border-color: var(--border);
}
.user-nav-primary a.active { box-shadow: inset 0 -2px 0 var(--green); }

.account-menu { position: relative; }
.account-menu summary {
  min-height: 2.15rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .45rem .25rem .3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(255 255 255 / .75);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover,
.account-menu[open] summary {
  color: var(--navy);
  background: #fff;
  border-color: var(--border-strong);
  box-shadow: 0 8px 18px -16px rgb(18 49 92 / .7);
}
.account-avatar {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: .72rem;
  font-weight: 750;
}
.account-email {
  max-width: 12.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
}
.account-caret { font-size: .68rem; transition: rotate .16s ease; }
.account-menu[open] .account-caret { rotate: 180deg; }
.account-popover {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  z-index: 60;
  min-width: 13rem;
  padding: .45rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgb(255 255 255 / .96);
  box-shadow: 0 20px 46px -24px rgb(18 49 92 / .55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.account-popover form { margin: 0; }
.account-menu-action,
.account-menu-mobile-links a {
  width: 100%;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  padding: .45rem .65rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu-action:hover,
.account-menu-mobile-links a:hover { background: var(--surface-soft); color: var(--navy); }
.account-menu-action { color: var(--error-fg); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.account-menu-mobile-links { display: none; }

/* Login and account entry */
.login-shell { padding: 4rem 1rem; }
.login-card {
  position: relative;
  overflow: hidden;
  border-color: var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 24px 60px -38px rgb(18 49 92 / .58);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green);
}
.login-card h2 { color: var(--navy); font-size: 1.55rem; letter-spacing: -.02em; }
.login-card input[type="email"] { border-color: var(--border-strong); border-radius: var(--radius-sm); }
.login-card button[type="submit"].btn { border-radius: 9px; background: var(--navy); }
.sso-button { border-color: var(--border-strong); border-radius: 9px; font-weight: 580; }
.sso-button:hover { border-color: rgb(26 127 90 / .55); box-shadow: var(--focus-ring); }

/* Landing v3 finish pass — no structural changes */
body:has(main.landing) .site-header { border-bottom-color: rgb(18 49 92 / .1); }
.hero3-panel { border-color: rgb(255 255 255 / .2); }
.hero3 .btn-primary { border-color: rgb(139 224 182 / .45); }
.hero3 .btn-secondary { border-color: rgb(255 255 255 / .3); }
.demo-card, .trust-card, .pricing-teaser { border-color: #dedbd2; }
.demo-card:hover, .trust-card:hover { border-color: #ccc7bc; }
.landing .section-intro { max-width: 48rem; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header, #translate-form, .login-card { background: #fff; }
  body:has(main.landing) .site-header { background: var(--paper); }
}

@media (max-width: 720px) {
  body:not(:has(main.landing)) { background: var(--surface-soft); }
  .site-header-inner { min-height: 3.75rem; }
  .site-header-cta .btn { min-height: 2.25rem; padding: .42rem .75rem; }
  .site-main { padding-bottom: 2.5rem; }
  .page-heading { padding-top: 1.4rem; }
  .card { padding: 1.1rem; }
  #translate-form { padding: 1rem; }
  .language-cards { grid-template-columns: 1fr; }
  .result-header { align-items: flex-start; flex-direction: column; gap: .4rem; }
  .pager { justify-content: space-between; flex-wrap: wrap; }
  .pager > span:nth-child(2) { order: 3; width: 100%; }
  .inline-form { align-items: stretch; }
  .table-secondary { display: none; }
  .app-header .site-header-inner { flex-wrap: nowrap; }
  .user-nav { width: auto; margin-left: auto; }
  .user-nav-primary { display: none; }
  .account-menu-mobile-links { display: grid; }
  .account-popover { min-width: min(17rem, calc(100vw - 2.4rem)); }
  .account-email { max-width: min(11rem, 38vw); }
}

@media (max-width: 480px) {
  .site-header-cta { margin-left: 0; }
  .site-nav { gap: .85rem; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
  .site-nav a { white-space: nowrap; }
  .login-shell { padding: 2rem .85rem; }
  .login-card { padding: 1.55rem 1.15rem; }
  .table th, .table td, table.admin th, table.admin td { padding: .62rem .65rem; }
  .region-filter { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .3rem; }
  .region-pill { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
