/**
 * PawSizer — styles.css
 * Design system, wizard, results, mobile breakpoints
 *
 * Copyright (c) 2026-present PawSizer. All rights reserved.
 * Proprietary and confidential. Unauthorised copying, modification,
 * distribution, or use of this file, via any medium, is strictly
 * prohibited without explicit written permission.
 * Contact: feedback@pawsizer.com
 *
 * v2.1.35
 */

/* ===== DESIGN SYSTEM ===== */
:root {
  --radius: 10px;
  --radius-lg: 16px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Nunito', 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* === Phase 5.1 UI Reset — warm earthy palette (PR 1 of 4) ===
     Added alongside legacy tokens above. Landing surfaces (body, hero,
     features, story) reference these directly; wizard/forms/tables/results
     migrate progressively in PR 2-4. */

  /* Warm earthy backgrounds */
  --bg-parchment: #fcfaf8;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f3efe8;

  /* Warm charcoal text (avoiding stark black) */
  --text-primary: #3d3935;
  --text-secondary: #706a63;
  --text-muted: #9e968d;

  /* Brand accents */
  --brand-primary: #cd6b35;
  --brand-primary-hover: #b35a2a;
  --brand-primary-light: #e8a87c;
  /* Lighter accent for dark surfaces (hero, chart) */
  --bg-brand-primary: #fbeee4;
  /* Pale tint background for primary highlight states */
  --brand-secondary: #6b8262;
  --brand-secondary-hover: #5a7253;
  /* Darker sage paired with .btn-success:hover */

  /* State / feedback tokens (per design plan §2) — destructive actions and
     validation errors use the error tier; non-blocking notices use warn;
     informational/explanatory surfaces use info. Hover variants deferred. */
  --color-error: #8b3a2a;
  --bg-error: #fbeae8;
  --color-warn: #b85c00;
  --bg-warn: #fff3e0;
  --color-info: #455c40;
  /* Deeper sage — decoupled from --brand-secondary-hover
                                 (#5a7253) to land ~6.3:1 contrast against
                                 --color-info-bg #eaefe6 (was 4.53:1 at #5a7253,
                                 borderline AA). The decoupling principle stays:
                                 tokens defined directly so retuning either does
                                 not propagate across families. */
  --color-info-bg: #eaefe6;

  /* Dark-surface text (design plan §2.2) — pair with §1.1 dark-surface
     exceptions (.wizard-sidebar, .result-hero) on --text-primary bg. */
  --text-on-dark: rgba(255, 255, 255, 0.92);
  /* WCAG AAA on #3d3935 */
  --text-on-dark-muted: rgba(255, 255, 255, 0.6);
  /* WCAG AA  on #3d3935 */

  /* UI elements */
  --border-color: #e6dfd5;
  --shadow-warm: 0 4px 12px rgba(61, 57, 53, 0.06);
  --shadow-warm-hover: 0 8px 24px rgba(61, 57, 53, 0.1);
  --radius-soft: 12px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* iOS Safari ignores child overflow-x: hidden for page-level sideways scroll;
   the guard must be on html/body themselves. overflow-x: clip on body avoids
   creating a scroll container (preserves position: sticky on nav). */
html {
  overflow-x: hidden;
}

body {
  overflow-x: clip;
}

body {
  background: var(--bg-parchment);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

/* ===== NAV ===== */
nav {
  background: var(--text-primary);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--brand-primary-light);
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 1;
  gap: 0.5rem;
}

.nav-brand span {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* .nav-btn / .nav-btn.primary — Retained (PR-2 Path A).
   Role: ghost button on dark nav surface; .primary modifier is the filled
   CTA variant (modifier defined, no current call site in index.html or
   app.js). Context: top nav only.
   Not collapsed into .btn-secondary — canonical .btn-secondary targets
   light surfaces (--bg-surface-alt) and would render wrong on dark nav.
   Token status — color (0.75), border (0.2), hover-bg (0.1), hover-border
   (0.4) use raw rgba(255,255,255,*) literals; intentional. No substitution
   performed: existing --text-on-dark / --text-on-dark-muted are calibrated
   for text WCAG contrast, not ghost borders or 10%-opacity hover backdrops.
   Deferred pending dedicated dark-surface-UI tokens (--border-on-dark,
   --bg-on-dark-hover) if introduced in a future PR. */
.nav-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-body);
  transition: all 0.2s;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.nav-btn.primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  font-weight: 500;
}

.nav-btn.primary:hover {
  background: var(--brand-primary-hover);
}

/* ===== STATIC PAGES (About, Privacy, Terms) ===== */
.page-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-header-nav {
  margin-bottom: 2rem;
}

.info-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  background: var(--bg-surface-alt);
  border-radius: 8px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.callout-block {
  padding: 0.7rem 1rem;
  background: var(--bg-surface-alt);
  border-radius: 8px;
  border-left: 3px solid var(--brand-primary);
}

/* ===== LANDING ===== */
.hero {
  background: var(--bg-surface-alt);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-paw {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
  animation: sway 3s ease-in-out infinite;
}

@keyframes sway {

  0%,
  100% {
    transform: rotate(-5deg)
  }

  50% {
    transform: rotate(5deg)
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero h1 em {
  color: var(--brand-primary);
  font-style: italic;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 0.6rem;
  line-height: 1.7;
}

.hero-sub-detail {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

/* .hero-cta — Retained (PR-2 Path A).
   Role: oversized primary landing CTA (0.9rem 2.2rem padding, radius 12,
   font 1.05rem/600, translateY(-2px) hover). Context: landing hero only.
   Not collapsed into .btn .btn-primary — canonical .btn is sized for wizard
   footers (0.7rem 1.6rem, radius 8, 0.92rem). Collapsing would require a
   new .btn-lg modifier; deferred indefinitely.
   Token status: modern (--brand-primary, --radius-soft, --shadow-warm). */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--brand-primary);
  color: #fff;
  padding: 0.9rem 2.2rem;
  border-radius: var(--radius-soft);
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-warm);
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}

.hero-cta:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm-hover);
}

/* .hero-cta-secondary — Retained (PR-2 Path A).
   Role: oversized outline-primary CTA paired with .hero-cta (transparent bg,
   brand-primary border and text). Context: landing hero + story section.
   No canonical equivalent — .btn-secondary is solid surface-alt, not
   outline-in-brand. Collapsing would require a new .btn-outline-primary
   modifier; deferred indefinitely.
   Token status: modern (--brand-primary, --bg-surface-alt, --radius-soft). */
.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--brand-primary);
  color: var(--brand-primary);
  padding: 0.85rem 2.2rem;
  border-radius: var(--radius-soft);
  font-size: 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.hero-cta-secondary:hover {
  background: var(--bg-surface-alt);
  color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

/* Trust bar — landing hero "Free / No account needed / No ads" row */
.trust-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.trust-bar-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.trust-bar-item .check {
  color: var(--brand-secondary);
}

/* Beta disclaimer — "PUBLIC BETA · Algorithm under active validation" notice */
.beta-disclaimer {
  margin: 0 auto 1rem auto;
  padding: 0.45rem 0.9rem;
  background: var(--bg-brand-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-width: fit-content;
  text-align: center;
}

.beta-disclaimer-label {
  color: var(--brand-primary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.beta-disclaimer-text {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

/* .landing-resume-btn — Retained (PR-2 Path A).
   Role: text-link, not a button (underlined, no bg/border). Used on both
   <button> and <label> elements. Context: landing resume row only.
   Not in canonical .btn system by design — text-link affordance, no shape.
   Token status: modern (--text-muted, --border-color). */
.landing-resume-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-color);
}

.section {
  padding: 4rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-soft);
  padding: 1.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-warm);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-warm-hover);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.story-section {
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 4rem 2rem;
}

.story-inner {
  max-width: 800px;
  margin: 0 auto;
}

.story-section h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.story-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.ace-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--brand-secondary);
  color: var(--bg-surface);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 0 2rem;
}

/* ===== WIZARD ===== */
.wizard-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.alert-warn {
  background: #fff8e1;
  border: 1.5px solid #ffb74d;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.84rem;
  color: #5d4037;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.quick-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.wizard-form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.step-help-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.step-section-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.chart-card-tight {
  margin-bottom: 1.5rem;
}
.wizard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
}

/* Dark surface — design plan §1.1 exception (navigation rail).
   Uses --text-primary (warm charcoal, matching .result-hero), not --ink. */
.wizard-sidebar {
  background: var(--text-primary);
  padding: 2rem 1.2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.wizard-sidebar-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  padding-left: 0.5rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
  color: var(--text-on-dark-muted);
  font-size: 0.88rem;
}

.step-item.active {
  background: rgba(205, 107, 53, 0.18);
  color: var(--brand-primary);
}

.step-item.done {
  color: rgba(255, 255, 255, 0.7);
}

.step-item.done .step-num {
  background: var(--brand-secondary);
  color: #fff;
}

.step-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s;
}

.step-item.active .step-num {
  background: var(--brand-primary);
  color: #fff;
}

.step-label {
  line-height: 1.2;
}

.wizard-content {
  padding: 2.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-parchment);
}

.wizard-header {
  max-width: 800px;
  margin: 0 auto 2rem;
}

.wizard-header h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.wizard-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

label .hint {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-surface);
  font-size: 0.92rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(205, 107, 53, 0.15);
}

.select-dark {
  background: #2a2218;
  color: #e8d9b0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.select-dark:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

input[type="range"] {
  flex: 1;
  height: 6px;
  appearance: none;
  background: var(--border-color);
  border-radius: 3px;
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]:focus {
  box-shadow: none;
  border: none;
}

.range-val {
  min-width: 45px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.breed-block {
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  position: relative;
}

.breed-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.breed-block-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* .remove-btn — Retained (PR-2 Path A).
   Role: icon-only circular ghost (26×26, 50% radius), destructive on hover.
   Context: breed-block header only.
   No canonical equivalent — .btn padding/shape can't produce a 26px round.
   Collapsing would require a new .btn-icon-circle modifier; deferred.
   Token status: modern (--border-color, --text-muted, --bg-error,
   --color-error). */
.remove-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.remove-btn:hover {
  background: var(--bg-error);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* .add-btn — Retained (PR-2 Path A).
   Role: full-width dashed-outline "add row" affordance.
   Context: wizard (breed-add, weight-row-add, height-row-add).
   No canonical equivalent — dashed border + width:100% are not in .btn.
   Collapsing would require a new .btn-add modifier; deferred indefinitely.
   Token status: modern (--border-color, --text-muted, --brand-primary,
   --bg-surface-alt). */
.add-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1.5px dashed var(--border-color);
  color: var(--text-muted);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font-body);
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.add-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--bg-surface-alt);
}

.percent-sum {
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  margin-top: 0.8rem;
  font-family: var(--font-mono);
}

.percent-sum.ok {
  background: #e8f5e9;
  color: var(--brand-secondary);
}

.percent-sum.warn {
  background: var(--bg-warn);
  color: var(--color-warn);
}

/* Dental log */
.dental-log {
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 0.5rem;
}

.dental-log-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 130px) minmax(0, 1fr) 30px;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dental-log-row {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 0.8fr) minmax(0, 1fr) 30px;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-color);
  align-items: center;
  /* font-size: 0.88rem; */
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.dental-log-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.5);
}

.log-tag {
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* .del-log-btn — Retained (PR-2 Path A).
   Role: tiny icon-only ghost (🗑), no border/bg, opacity 0.6 → 1 on hover,
   color → --color-error on hover.
   Context: dental log + measurement (weight/height) log rows.
   No canonical equivalent — bare icon-only with opacity-based emphasis.
   Distinct primitive from .remove-btn (different size + bordered shape).
   Token status: modern (--text-muted, --color-error). */
.del-log-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: all 0.2s;
  padding: 0.2rem;
}

.del-log-btn:hover {
  color: var(--color-error);
  opacity: 1;
}

.dental-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border-color);
  align-items: end;
  background: var(--bg-surface);
}

.dental-add-row input,
.dental-add-row select {
  font-size: 0.86rem;
  padding: 0.5rem 0.7rem;
}

/* .add-log-btn — Retained (PR-2 Path A).
   Role: small solid charcoal submit button ("+ Add Entry") — uses
   --text-primary bg, not --brand-primary, echoing the wizard sidebar dark
   surface as a deliberate "neutral submit" affordance.
   Context: dental log add-row only.
   Not collapsed into .btn .btn-primary .btn-sm — would recolor charcoal →
   terracotta and change visual character. A canonical .btn-neutral-dark
   modifier could fit; deferred indefinitely.
   Token status: modern (--text-primary, --text-secondary). */
.add-log-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1.5px dashed var(--border-color);
  color: var(--text-muted);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font-body);
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.add-log-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--bg-surface-alt);
}

/* measurement log */
.measurement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.measurement-table th {
  background: var(--border-color);
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.measurement-table td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.measurement-table tr:nth-child(even) td {
  background: var(--bg-surface-alt);
}

.measurement-table input {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Info card */
.info-card {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  gap: 0.8rem;
  font-size: 0.88rem;
  color: var(--color-info);
  margin-bottom: 1.5rem;
}

.info-card-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.source-list {
  margin-top: 1rem;
}

.source-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.source-item:last-child {
  border-bottom: none;
}

.source-item a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.2s;
}

.source-item a:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.source-breed-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--border-color);
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Wizard nav */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.btn {
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(205, 107, 53, 0.3);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  background: var(--border-color);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.footer-legal-link {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  border-radius: 2px;
}

.footer-legal-link:hover,
.footer-legal-link:focus-visible {
  color: rgba(255, 255, 255, 0.75);
}

.footer-legal-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.btn-success {
  background: var(--brand-secondary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(107, 130, 98, 0.3);
}

.btn-success:hover {
  background: var(--brand-secondary-hover);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.84rem;
}

.btn-danger {
  background: var(--bg-error);
  border: 1px solid var(--color-error);
  color: var(--color-error);
}

.btn-danger:hover {
  background: #fcc;
}

/* Results page */
.results-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

.result-hero {
  background: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.result-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(205, 107, 53, 0.18) 0%, transparent 50%);
  pointer-events: none;
}

.result-hero h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-on-dark);
  font-weight: 400;
  margin-bottom: 0.3rem;
}

/* Tracker Mode marker — sage accent + small badge. Applied via the
   .result-hero--tracker modifier when result.mode === 'tracker'.
   Rescue branch keeps the default .result-hero appearance. */
.result-hero--tracker {
  border-left: 4px solid var(--brand-secondary);
}

.result-hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  background: rgba(107, 130, 98, 0.16);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.6rem;
}

.result-dob {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--brand-primary-light);
  margin-bottom: 0.5rem;
}

.result-range {
  font-size: 0.9rem;
  color: var(--text-on-dark-muted);
  font-family: var(--font-mono);
}

.confidence-bar-wrap {
  margin-top: 1.5rem;
}

.confidence-label {
  font-size: 0.8rem;
  color: var(--text-on-dark-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-soft);
  padding: 1.3rem;
  box-shadow: var(--shadow-warm);
}

.metric-card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.metric-card-value {
  font-size: 1.4rem;
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.metric-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metric-card.primary {
  border-color: var(--brand-primary);
  background: var(--bg-brand-primary);
}

.metric-card.primary .metric-card-value {
  color: var(--brand-primary);
}

.chart-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-warm);
}

.chart-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.chart-card .chart-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.chart-wrap {
  position: relative;
}

.export-bar {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-soft);
  margin-bottom: 2rem;
  align-items: center;
}

.export-bar-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 500;
  font-family: var(--font-mono);
}

.badge-gold {
  background: var(--bg-brand-primary);
  color: var(--brand-primary);
}

.badge-navy {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge-sage {
  background: #eaefe6;
  color: var(--brand-secondary);
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.checkbox-item label {
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
  margin: 0;
}

.radio-group {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.radio-item input {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.radio-item label {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin: 0;
  cursor: pointer;
}

/* Tooltip */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}

.tooltip-icon {
  cursor: help;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-bottom: 1px dotted var(--text-muted);
}

.tooltip-text {
  display: none;
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-parchment);
  font-size: 0.78rem;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  box-shadow: var(--shadow-warm-hover);
}

.tooltip-wrap:hover .tooltip-text {
  display: block;
}

/* Weight accuracy badge */
.weight-accuracy {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.acc-badge {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.acc-high {
  background: #eaefe6;
  color: var(--brand-secondary);
}

.acc-med {
  background: var(--bg-warn);
  color: var(--color-warn);
}

.acc-low {
  background: var(--bg-error);
  color: var(--color-error);
}

/* Restore banner */
.restore-banner {
  background: var(--bg-warn);
  border: 1.5px solid var(--color-warn);
  border-radius: var(--radius-soft);
  padding: 1rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.restore-banner-text {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.restore-banner-text strong {
  color: var(--color-warn);
}


/* ── Breed searchable combobox ── */
.breed-combo {
  position: relative;
}

.breed-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.breed-search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(205, 107, 53, 0.12);
}

.breed-search-input::placeholder {
  color: var(--text-muted);
}

.breed-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-warm-hover);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.breed-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 0;
}

.breed-option:first-child {
  border-radius: 6px 6px 0 0;
}

.breed-option:last-child {
  border-radius: 0 0 6px 6px;
}

.breed-option:only-child {
  border-radius: 6px;
}

.breed-option:hover,
.breed-option.active {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
}

.breed-option.selected {
  font-weight: 600;
  color: var(--brand-primary);
}

.breed-option.selected::after {
  content: ' ✓';
  opacity: 0.7;
}

/* ===== RESULTS COMPONENTS ===== */

/* Confidence bar — rendered inside .result-hero (dark warm-charcoal bg),
   so the translucent-white track is intentional and design-plan-compliant.
   The fill uses the brand-primary terracotta gradient (cool→warm shift
   from the legacy --gold pair). Transition timing preserved for app.js
   width-percentage animation. */
.confidence-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0 0.25rem;
}

.confidence-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
  transition: width 0.8s ease;
}

/* ===== DENTAL DIAGRAM ===== */

/* Tooth groups in SVG diagram */
.tooth-g {
  cursor: pointer;
  transition: opacity 0.15s;
}

.tooth-g:hover>path,
.tooth-g:hover>rect,
.tooth-g:hover>ellipse,
.tooth-g:hover>polygon {
  opacity: 0.7;
  filter: brightness(1.25);
}

.tooth-g.selected>path,
.tooth-g.selected>rect,
.tooth-g.selected>ellipse,
.tooth-g.selected>polygon {
  stroke: var(--brand-primary);
  stroke-width: 2px;
}

/* ===== ACCORDIONS & CHEVRONS ===== */

/* Breed source accordion chevron */
.toggle-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.breed-src-header.open .toggle-arrow,
.toggle-arrow.open {
  transform: rotate(180deg);
}

/* Generic collapse/expand chevron */
.g-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.g-arrow.open {
  transform: rotate(180deg);
}

/* PDF meta line (also used in print styles) */
.meta {
  font-size: 0.8rem;
  color: #8a7f72;
  margin-bottom: 1rem;
}


/* ── Mobile wizard step pills ── */
.wizard-step-nav-mobile {
  display: none;
  /* hidden on desktop — sidebar handles step nav there */
}

.wizard-step-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-step-pill--visited {
  border-color: var(--brand-primary);
  color: var(--text-primary);
  background: var(--bg-surface-alt);
}

.wizard-step-pill--active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* Faded but still clickable so phone users can jump forward to any step */
.wizard-step-pill:not(.wizard-step-pill--visited):not(.wizard-step-pill--active) {
  opacity: 0.4;
}

.results-page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-primary);
}

/* ===== RESPONSIVE / MOBILE ===== */
@media (max-width: 768px) {

  /* iOS Safari auto-zooms any field whose font-size is < 16px on focus;
     -webkit-appearance: none normalizes native chrome on selects;
     44px is Apple HIG's minimum touch target. */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px;
    -webkit-appearance: none;
    min-height: 44px;
  }

  /* width/max-width/min-width/box-sizing constrain the field on iOS Safari,
     which otherwise renders date inputs at their intrinsic content width.
     min-width:0 defeats the flex/grid min-width:auto default that lets the
     native date picker's content size override width:100% inside form-row
     grid tracks and flex containers. appearance reset is applied in the
     base rule alongside the other text inputs. */
  input[type="date"] {
    display: block;
    font-size: 16px;
    min-height: 44px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* compact rows in dense measurement tables override the 44px floor */
  .measurement-table input,
  .measurement-table input[type="date"],
  .measurement-table select {
    min-height: unset;
  }

  /* Nav — two-row stacked layout so brand never collides with buttons */
  nav {
    padding: 0.6rem 1rem;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .nav-brand {
    font-size: 1.05rem;
    justify-content: center;
  }

  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .nav-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
  }

  /* Hero */
  .hero {
    padding: 3rem 1.2rem 2.5rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .hero-cta {
    padding: 0.8rem 1.6rem;
    font-size: 0.95rem;
  }

  .hero-cta-secondary {
    margin-left: 0;
    margin-top: 0;
  }

  /* Sections */
  .section {
    padding: 2.5rem 1.2rem;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .story-section {
    padding: 2.5rem 1.2rem;
  }

  /* Wizard layout */
  .wizard-layout {
    grid-template-columns: 1fr;
  }

  .wizard-sidebar {
    display: none;
  }

  .wizard-content {
    padding: 1.2rem;
  }

  .wizard-header h2 {
    font-size: 1.4rem;
  }

  /* Mobile step pill nav */
  .wizard-step-nav-mobile {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    padding: 0.6rem 1rem 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .wizard-step-nav-mobile::-webkit-scrollbar {
    display: none;
  }

  /* Forms */
  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  /* constrain the grid track so width:100% on the date input resolves
     against the available width rather than the input's intrinsic
     min-content size */
  .form-group {
    min-width: 0;
  }

  /* Metric grid */
  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .metric-card-value {
    font-size: 1.1rem;
  }

  /* Results layout */
  .results-layout {
    padding: 1rem;
  }

  .result-hero {
    padding: 1.5rem 1rem;
  }

  .result-dob {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
  }

  /* Export bar */
  .export-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .export-bar .btn {
    text-align: center;
  }

  /* Chart panel */
  #autofit-panel {
    flex-direction: column;
    gap: 0.8rem;
  }

  #autofit-panel>div {
    min-width: unset;
  }

  /* Results page title */
  .results-page-title {
    font-size: 1.35rem;
  }

  /* Signal breakdown — keep detail tables from pushing the page sideways */
  #signal-breakdown [id^="sig-detail-"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #signal-breakdown [id^="sig-detail-"] table {
    min-width: 100%;
  }

  /* About page sources */
  .source-item {
    flex-direction: column;
    gap: 0.3rem;
  }

  .source-breed-tag {
    align-self: flex-start;
  }

  /* Dental log add row */
  .dental-add-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .dental-add-row .add-log-btn {
    grid-column: 1 / -1;
  }

  /* Measurement table — fixed layout + percentage columns prevent the
     weight/height log rows from overflowing iPhone-class viewports. The
     inline px widths that previously beat any CSS class rule were removed
     from app.js; sizing is now CSS-only. */
  .measurement-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.8rem;
  }

  .measurement-table th,
  .measurement-table td {
    padding: 0.4rem;
    overflow: hidden;
  }

  .measurement-table td:first-child,
  .measurement-table th:first-child {
    width: 30%;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .measurement-table td:nth-child(2),
  .measurement-table th:nth-child(2) {
    width: 22%;
  }

  .measurement-table td:nth-child(3),
  .measurement-table th:nth-child(3) {
    width: 20%;
  }

  .measurement-table td:nth-child(4),
  .measurement-table th:nth-child(4) {
    width: 14%;
  }

  .measurement-table td:nth-child(5),
  .measurement-table th:nth-child(5) {
    width: 14%;
  }

  .measurement-table input,
  .measurement-table select {
    width: 100%;
    min-width: 0;
  }

  /* Wizard footer */
  .wizard-footer {
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
  }

  .wizard-footer>div {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
  }

  /* QE rows */
  #qe-weight-rows>div,
  #qe-height-rows>div {
    grid-template-columns: 1fr 80px 60px 28px;
  }

  /* Footer */
  #site-footer {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {

  /* Extra small phones */
  .hero h1 {
    font-size: 1.9rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dental-log-header,
  .dental-log-row {
    grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr) 26px;
    gap: 0.35rem;
    padding: 0.45rem 0.6rem;
  }

  .dental-log-row .log-tag {
    font-size: 0.72rem;
  }

  /* nav-links gap already handled in 768px block */

  /* About sources: hide breed tag on very small screens */
  .source-breed-tag {
    display: none;
  }

  /* SVG dental chart: allow horizontal scroll */
  #dental-svg {
    width: auto;
  }

  /* Landing resume — stack resume/CSV options vertically on phones */
  #landing-resume {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  #landing-resume span {
    display: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease;
}

/* ===== TRACK 3 ADDITIONS — do not remove legacy classes above ===== */

/* Typographic scale — 6 utility classes for canonical headings/body/label/mono.
   Landing hero h1 is intentionally NOT migrated (singular surface, retains its
   own clamp). PR D will apply .t-* to about/privacy/terms heros, wizard step
   headers, section titles, and card headings. */
.t-display {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.1;
  color: var(--text-primary);
}

.t-h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--text-primary);
}

.t-h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.t-h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.t-body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.t-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.t-mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Card base + modifiers — additive. Legacy .chart-card, .metric-card,
   .feature-card, .info-card remain untouched above; PR D may migrate markup
   to .card / .card--* but is not required to. */
.card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-soft);
  padding: 1.5rem;
  box-shadow: var(--shadow-warm);
}

.card--lg {
  border-radius: var(--radius-lg);
}

.card--compact {
  padding: 1.2rem;
}

.card--feature {
  padding: 1.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card--feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-warm-hover);
}

.card--info {
  background: var(--color-info-bg);
  border-color: var(--color-info);
  color: var(--color-info);
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  font-size: 0.88rem;
}

.card--primary {
  border-color: var(--brand-primary);
  background: var(--bg-brand-primary);
}

/* Badge AA contrast overrides — standalone classes to be swapped in by PR D.
   Existing .badge-gold (3.23:1) and .badge-sage (3.62:1) fail WCAG AA 4.5:1
   on their pale backgrounds; deeper foreground colors restore compliance.
   .badge-navy already passes at 6.29:1 and needs no AA variant. */
.badge-aa-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--bg-brand-primary);
  color: #9c4a1e;
  /* 5.44:1 on #fbeee4 */
}

.badge-aa-sage {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: #eaefe6;
  color: #3f5538;
  /* 7.04:1 on #eaefe6 */
}

/* Wizard inner container — applied to inner content of each wizard step in
   PR D. Caps content width on wide viewports without affecting current layout
   (no consumer yet). */
.wizard-form-inner {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Callout panel — replaces dense inline-style callout blocks in index.html
   (e.g. landing "Puppies are the sweet spot" box). Uses only design-system
   tokens; no legacy --cream/--tan/--border. */
.panel-callout {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-soft);
  padding: 1.2rem 1.4rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.panel-callout strong {
  color: var(--text-primary);
}

/* Toggle switches */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-color);
  border-radius: 11px;
  cursor: pointer;
  transition: 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle input:checked+.toggle-slider {
  background: var(--brand-primary);
}

.toggle input:checked+.toggle-slider::after {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.step-progress {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Breed source accordion */
.breed-sources {
  margin-top: 1.5rem;
}

.breed-src-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s;
}

.breed-src-header:hover {
  background: var(--border-color);
}

.breed-src-body {
  display: none;
  border: 1.5px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem;
  background: #fff;
}

.breed-src-body.open {
  display: block;
}

/* ── Consent banner (privacy) ── */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  padding: 1.2rem 1.5rem;
  transform: translateY(110%);
  transition: transform 0.3s ease;
}

.consent-banner.is-open {
  transform: translateY(0);
}

.consent-banner-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.consent-banner h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
}

.consent-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.consent-status {
  align-self: flex-start;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.02em;
}

.consent-banner-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

/* .consent-btn — Already collapsed; marker class only (PR-2 Path A).
   Markup is class="btn btn-secondary consent-btn"; the class itself has no
   own CSS — only this contextual rule sets flex sizing inside the consent
   banner. Also used as a JS query hook (app.js querySelectorAll('.consent-btn'),
   data-consent="granted" selector), so the class cannot be removed without
   rewriting the JS. Decoupling deferred. Token status: n/a. */
.consent-banner-actions .consent-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.consent-banner-link {
  font-size: 0.8rem;
  color: var(--brand-primary);
  text-decoration: none;
  text-align: center;
  margin-top: 0.2rem;
}

.consent-banner-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .consent-banner {
    padding: 1rem 1.2rem;
  }

  .consent-banner-inner {
    gap: 0.5rem;
  }
}