/* ═══════════════════════════════════════════════════════════
   FabCare AI — styles.css
   Palette: White · Cashmere Cream · Onyx Black · Espresso · Champagne Gold
   Architecture: Custom Properties → Reset → Layout → Components → Animations
═══════════════════════════════════════════════════════════ */

/* ─── 1. Custom Properties ─────────────────────────────── */
:root {
  /* Colour Palette */
  --white:          #FFFFFF;
  --cream:          #F5EFE6;
  --onyx:           #121212;
  --espresso:       #3A2618;
  --gold:           #D4AF37;
  --gold-light:     #E8CB66;
  --gold-dark:      #A88A24;
  --cream-dark:     #E8DDD0;
  --espresso-light: #6B4A37;

  /* Semantic Accent Colours (accent use only — never solid card fills) */
  --eco-green:       #2E7D32;
  --eco-green-light: rgba(46, 125, 50, 0.08);
  --eco-green-border: rgba(46, 125, 50, 0.20);
  --alert-red:       #C62828;
  --alert-red-light: rgba(198, 40, 40, 0.06);
  --alert-red-border: rgba(198, 40, 40, 0.18);

  /* Typography */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;

  /* Spacing Scale */
  --space-xs:  0.375rem;
  --space-sm:  0.75rem;
  --space-md:  1.25rem;
  --space-lg:  2rem;
  --space-xl:  3.5rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 20px;

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 200ms;
  --duration-base: 400ms;
  --duration-slow: 700ms;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(18,18,18,0.06);
  --shadow-md:  0 4px 24px rgba(18,18,18,0.09);
  --shadow-lg:  0 12px 48px rgba(18,18,18,0.12);
  --shadow-gold: 0 4px 24px rgba(212,175,55,0.20);
}

/* ─── 2. Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--onyx);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }

/* Focus-visible ring for accessibility */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── 3. Typography Utilities ──────────────────────────── */
.section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--onyx);
  letter-spacing: -0.01em;
}

.section-title em {
  font-style: italic;
  color: var(--espresso);
}

/* ─── 4. Layout Utilities ──────────────────────────────── */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ─── 5. Buttons ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background-color: var(--gold);
  color: var(--onyx);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gold);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--gold-dark);
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary svg { flex-shrink: 0; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background-color: transparent;
  color: var(--espresso);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--cream-dark);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--espresso);
  background-color: var(--cream);
}

/* ─── 6. Site Header ───────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cream-dark);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-mark {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-dark);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--onyx);
  letter-spacing: 0.02em;
}

.logo-text em { font-style: italic; color: var(--espresso); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--espresso);
  transition: color var(--duration-fast);
}

.nav-links a:hover { color: var(--onyx); }

.nav-links .nav-cta {
  background-color: var(--onyx);
  color: var(--white);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast);
}

.nav-links .nav-cta:hover { background-color: var(--espresso); }

/* ─── 7. Hero Section ──────────────────────────────────── */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background-color: var(--white);
  overflow: hidden;
  padding: var(--space-2xl) var(--space-lg);
  gap: var(--space-2xl);
}

.hero-bg-texture {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(212,175,55,0.06) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(245,239,230,0.8) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  animation: fadeUp 0.9s var(--ease-out) both;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: var(--space-md);
  animation: fadeUp 0.9s var(--ease-out) 0.1s both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--onyx);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  animation: fadeUp 0.9s var(--ease-out) 0.15s both;
}

.hero-title em {
  font-style: italic;
  color: var(--espresso);
}

.hero-subtitle {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--espresso-light);
  line-height: 1.75;
  margin-bottom: var(--space-xl);
  max-width: 460px;
  animation: fadeUp 0.9s var(--ease-out) 0.2s both;
}

.hero-cta {
  animation: fadeUp 0.9s var(--ease-out) 0.28s both;
}

/* Hero Visual — Concentric Rings */
.hero-visual {
  position: relative;
  width: 380px;
  height: 380px;
  flex-shrink: 0;
  animation: fadeIn 1.2s var(--ease-out) 0.4s both;
}

.hero-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.25);
}

.hero-ring--outer  { width: 100%; height: 100%; animation: spinSlow 30s linear infinite; }
.hero-ring--mid    { width: 72%;  height: 72%;  border-color: rgba(212,175,55,0.18); animation: spinSlow 22s linear infinite reverse; }
.hero-ring--inner  { width: 44%;  height: 44%;  border-color: rgba(212,175,55,0.35); animation: spinSlow 15s linear infinite; }

.hero-icon-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--cream);
  border-radius: 50%;
  border: 1px solid var(--cream-dark);
}

/* ─── 8. How It Works ──────────────────────────────────── */
.how-it-works {
  background-color: var(--cream);
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--cream-dark);
  border-bottom: 1px solid var(--cream-dark);
}

.how-it-works .section-inner { text-align: center; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.step-card {
  background-color: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-lg);
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

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

.step-number {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 300;
  color: var(--cream-dark);
  line-height: 1;
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  user-select: none;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--onyx);
  margin-bottom: var(--space-sm);
}

.step-desc {
  font-size: 0.9rem;
  color: var(--espresso-light);
  line-height: 1.7;
}

/* ─── 9. Scan / Upload Section ─────────────────────────── */
.scan-section {
  padding: var(--space-2xl) 0;
  background-color: var(--white);
}

.scan-section .section-inner { text-align: center; }

.scan-subtitle {
  font-size: 0.85rem;
  color: var(--espresso-light);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xl);
  letter-spacing: 0.02em;
}

/* Upload Zone */
.upload-zone {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  min-height: 340px;
  border: 1.5px dashed var(--cream-dark);
  border-radius: var(--radius-lg);
  background-color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color var(--duration-fast),
    background-color var(--duration-fast),
    box-shadow var(--duration-fast);
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background-color: #fdf8ec;
  box-shadow: 0 0 0 4px rgba(212,175,55,0.08);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.upload-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  pointer-events: none; /* clicks pass through to zone / input */
  position: relative;
  z-index: 10;
}

/* Restore click events for both Primary (Upload) and Secondary (Camera) buttons */
.upload-idle button { 
  pointer-events: all; 
}

.upload-idle .btn-primary { pointer-events: all; }

.upload-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--white);
  border: 1px solid var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.upload-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--onyx);
}

.upload-or {
  font-size: 0.78rem;
  color: var(--espresso-light);
  letter-spacing: 0.12em;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--espresso-light);
  margin-top: var(--space-sm);
  opacity: 0.7;
}

/* Preview State */
.upload-preview {
  width: 100%;
  height: 100%;
  min-height: 340px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-image {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  display: block;
}

.preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  background: linear-gradient(to top, rgba(18,18,18,0.75) 0%, transparent 100%);
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

/* ─── 10. Loading / Scanning Section ───────────────────── */
.loading-section {
  padding: var(--space-2xl) 0;
  background-color: var(--cream);
  text-align: center;
}

/* Scan animation frame */
.scan-animation {
  max-width: 200px;
  margin: 0 auto var(--space-lg);
}

.scan-frame {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  animation: scanPass 2s var(--ease-in-out) infinite;
  border-radius: 2px;
}

.scan-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--gold);
  border-style: solid;
}

.scan-corner--tl { top: 0;    left: 0;  border-width: 2px 0 0 2px; }
.scan-corner--tr { top: 0;    right: 0; border-width: 2px 2px 0 0; }
.scan-corner--bl { bottom: 0; left: 0;  border-width: 0 0 2px 2px; }
.scan-corner--br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.loading-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--onyx);
  margin-bottom: var(--space-xs);
}

.loading-sub {
  font-size: 0.85rem;
  color: var(--espresso-light);
  max-width: 400px;
  margin: 0 auto var(--space-xl);
}

/* Skeleton Loaders */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.skeleton-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border: 1px solid var(--cream-dark);
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--cream-dark) 25%, #ede7dc 50%, var(--cream-dark) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.6s infinite;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--mid   { width: 70%; }

/* ─── 11. Results Section ───────────────────────────────── */
.results-section {
  padding: var(--space-2xl) 0;
  background-color: var(--white);
}

/* Detection Banner */
.detection-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--cream-dark);
  animation: fadeUp 0.6s var(--ease-out) both;
}

.detection-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 300;
  color: var(--onyx);
  line-height: 1.2;
}

.detection-title em {
  font-style: italic;
  color: var(--gold-dark);
}

.confidence-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  background-color: rgba(212,175,55,0.05);
  white-space: nowrap;
  flex-shrink: 0;
}

.confidence-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--gold-dark);
  line-height: 1;
}

.confidence-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--espresso-light);
  margin-top: var(--space-xs);
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* Result Cards */
.result-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--cream-dark);
  background-color: var(--cream);
  animation: fadeUp 0.6s var(--ease-out) both;
  display: flex;
  flex-direction: column;
}

.result-card:nth-child(2) { animation-delay: 0.08s; }
.result-card:nth-child(3) { animation-delay: 0.16s; }

/* Semantic card tints — hairline border + barely-there background wash */
.result-card--worst {
  border-color: var(--alert-red-border);
  background-color: var(--alert-red-light);
}

.result-card--best {
  border-color: var(--eco-green-border);
  background-color: var(--eco-green-light);
}

.card-header {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--cream-dark);
  background-color: var(--white);
}

.card-badge {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  display: block;
}

.card-badge--gold  { color: var(--gold); }
.card-badge--eco   { color: var(--eco-green); }
.card-badge--alert { color: var(--alert-red); }
.card-badge--dark  { color: var(--espresso); }
.card-badge--cream { color: var(--espresso-light); }

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--onyx);
  margin-bottom: var(--space-xs);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--espresso-light);
  letter-spacing: 0.02em;
}

.card-body {
  padding: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  align-items: stretch;
  border-bottom: 1px solid var(--cream-dark);
}

.durability-stat { flex: 1; }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--onyx);
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--espresso-light);
}

/* Semantic stat value accents */
.stat-value--eco   { color: var(--eco-green); }
.stat-value--alert { color: var(--alert-red); }

.stat-divider {
  width: 1px;
  background-color: var(--cream-dark);
  flex-shrink: 0;
}

/* Care Instructions */
.care-instructions,
.consequence-list,
.eol-methods {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
}

/* Care instruction items (created by JS) */
.care-item {
  padding: var(--space-sm) var(--space-md);
  background-color: var(--white);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}

.care-item-instruction {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--onyx);
  margin-bottom: var(--space-xs);
}

.care-item-reason {
  font-size: 0.78rem;
  color: var(--espresso-light);
  line-height: 1.5;
}

/* Worst case items */
.consequence-item {
  padding: var(--space-sm) var(--space-md);
  background-color: var(--white);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--espresso);
  font-size: 0.85rem;
  color: var(--espresso);
  line-height: 1.5;
}

/* EOL items */
.eol-item {
  padding: var(--space-sm) var(--space-md);
  background-color: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-dark);
}

.eol-method-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--onyx);
  margin-bottom: var(--space-xs);
}

.eol-method-desc {
  font-size: 0.78rem;
  color: var(--espresso-light);
  line-height: 1.5;
}

.results-footer {
  display: flex;
  justify-content: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--cream-dark);
}

/* ─── 12. Error Toast ──────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background-color: var(--onyx);
  color: var(--white);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid rgba(212,175,55,0.3);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  max-width: 480px;
  width: calc(100% - 2 * var(--space-lg));
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: transform var(--duration-base) var(--ease-out);
}

.error-toast.visible {
  transform: translateX(-50%) translateY(0);
}

.error-toast p {
  font-size: 0.88rem;
  flex: 1;
  color: rgba(255,255,255,0.85);
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  cursor: pointer;
  padding: var(--space-xs);
  transition: color var(--duration-fast);
}

.toast-close:hover { color: var(--white); }

/* ─── 13. Mission / SDG Section ────────────────────────── */
.mission-section {
  background-color: var(--cream);
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--cream-dark);
}

.mission-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.mission-body {
  font-size: 0.95rem;
  color: var(--espresso-light);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.sdg-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-sm);
  background-color: rgba(212,175,55,0.06);
}

.sdg-number {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.sdg-label {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--gold-dark);
  line-height: 1;
}

.sdg-desc {
  font-size: 0.78rem;
  color: var(--espresso);
  border-left: 1px solid var(--cream-dark);
  padding-left: var(--space-sm);
}

.mission-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.stat-block {
  padding: var(--space-lg);
  background-color: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--cream-dark);
  transition: box-shadow var(--duration-base) var(--ease-out);
}

.stat-block:hover { box-shadow: var(--shadow-md); }

.big-stat {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  color: var(--onyx);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.big-stat-label {
  font-size: 0.82rem;
  color: var(--espresso-light);
  letter-spacing: 0.02em;
}

/* ─── 14. Site Footer ──────────────────────────────────── */
.site-footer {
  background-color: var(--onyx);
  padding: var(--space-xl) 0;
  border-top: 1px solid rgba(212,175,55,0.2);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-brand .logo-mark {
  border-color: rgba(212,175,55,0.4);
  color: var(--gold);
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--white);
}

.footer-name em { font-style: italic; color: rgba(212,175,55,0.7); }

.footer-tagline {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
  flex: 1;
  text-align: center;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.04em;
}

/* ─── 15. Utility: Hidden ───────────────────────────────── */
[hidden] { display: none !important; }

/* ─── 16. Keyframe Animations ──────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spinSlow {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes scanPass {
  0%   { top: 5%;  opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 95%; opacity: 0; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(120%); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

/* ─── 17. Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-card:last-child {
    grid-column: 1 / -1;
  }

  .mission-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .mission-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .stat-block { flex: 1; min-width: 200px; }
}

@media (max-width: 768px) {
  :root {
    --space-2xl: 4rem;
    --space-xl:  2.5rem;
  }

  .hero {
    flex-direction: column;
    min-height: auto;
    padding-top: 4rem;
    padding-bottom: 4rem;
    text-align: center;
  }

  .hero-visual {
    width: 240px;
    height: 240px;
  }

  .hero-subtitle { margin: 0 auto var(--space-xl); }

  .nav-links { display: none; }

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

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

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

  .result-card:last-child { grid-column: auto; }

  .detection-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-tagline { text-align: center; }
}

@media (max-width: 480px) {
  .section-inner { padding: 0 var(--space-md); }

  .upload-zone { min-height: 260px; }

  .preview-overlay {
    flex-direction: column;
    align-items: center;
  }
}

/* ═══════════════════════════════════════════════════════════
   NEW: Camera / Viewfinder Additions (index.html)
═══════════════════════════════════════════════════════════ */

/* Reformat the idle state actions for two buttons */
.upload-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

/* Camera State Container */
.upload-camera {
  width: 100%;
  height: 100%;
  min-height: 340px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--onyx); /* Black background while camera loads */
}

/* Live Video Feed */
/* Live Video Feed */
/* Live Video Feed (Always Mirrored for UX) */
.camera-feed {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  display: block;
  /* Flip the video feed horizontally for a natural viewfinder feel. 
     The JS canvas capture will naturally ignore this and save the unmirrored image for the AI. */
  transform: scaleX(-1); 
  -webkit-transform: scaleX(-1);
}

/* Adjust transform if it's the rear camera */
@media (hover: none) and (pointer: coarse) {
  .camera-feed { transform: none; } /* Mobile devices usually use the back camera, which shouldn't be mirrored */
}

/* ═══════════════════════════════════════════════════════════
   NEW: ai.html Specific Styles
═══════════════════════════════════════════════════════════ */

/* Mobile Nav CTA (Visible only on small screens) */
.nav-mobile-cta {
  display: none;
}

@media (max-width: 768px) {
  .nav-mobile-cta {
    display: inline-flex;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
}

/* Context / Status Bar */
.ai-context-bar {
  background-color: var(--onyx);
  color: var(--white);
  padding: var(--space-xs) 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ai-context-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.ai-context-eyebrow { color: var(--gold); font-weight: 500; }
.ai-context-divider { color: rgba(255,255,255,0.3); }
.ai-context-label { color: rgba(255,255,255,0.8); }

/* Pulse Animation for Status Bar */
.ai-context-pulse {
  display: flex;
  gap: 3px;
  align-items: center;
}
.ai-context-pulse span {
  width: 4px;
  height: 4px;
  background-color: var(--gold);
  border-radius: 50%;
  animation: pulse 1.4s infinite ease-in-out both;
}
.ai-context-pulse span:nth-child(1) { animation-delay: -0.32s; }
.ai-context-pulse span:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Loading Section Enhancements ─── */
.ai-loading-section {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.loading-image-frame {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--cream-dark);
}

.loading-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.2);
  opacity: 0.5;
}

.loading-image-frame .scan-animation {
  position: absolute;
  inset: 0;
  margin: 0;
  max-width: none;
}

.loading-image-frame .scan-frame {
  width: 100%;
  height: 100%;
}

/* Loading Steps List */
.loading-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: 300px;
  margin: var(--space-md) auto var(--space-xl);
  text-align: left;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--espresso-light);
  opacity: 0.5;
  transition: opacity var(--duration-base);
}

.loading-step--active {
  opacity: 1;
  color: var(--onyx);
}

.loading-step--complete {
  opacity: 0.7;
  color: var(--espresso);
}

.lstep-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

.loading-step--active .lstep-dot {
  background-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
}

/* ─── Results Banner Adjustments ─── */
.detection-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.detection-thumb-wrap {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--cream-dark);
  flex-shrink: 0;
}

.detection-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .detection-left { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
}

/* ─── No Image / Fallback Section ─── */
.no-image-section {
  padding: var(--space-2xl) 0;
  background-color: var(--white);
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.no-image-inner {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.no-image-icon {
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: center;
}

.no-image-body {
  color: var(--espresso-light);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   NEW: Card Footer Action Buttons (Guide Triggers)
═══════════════════════════════════════════════════════════ */

.card-footer-action {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--white);
  border-top: 1px solid var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
}

.btn-guide {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.btn-guide:hover {
  transform: translateY(-1px);
}

.btn-guide svg {
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.btn-guide:hover svg {
  transform: translateX(3px);
}

.btn-guide--gold {
  background-color: rgba(212,175,55,0.08);
  border-color: var(--gold);
  color: var(--gold-dark);
}

.btn-guide--gold:hover {
  background-color: var(--gold);
  color: var(--onyx);
  box-shadow: var(--shadow-gold);
}

/* Eco green variant for Best Case card */
.btn-guide--eco {
  background-color: var(--eco-green-light);
  border-color: var(--eco-green-border);
  color: var(--eco-green);
}

.btn-guide--eco:hover {
  background-color: var(--eco-green);
  border-color: var(--eco-green);
  color: var(--white);
  box-shadow: 0 4px 24px rgba(46, 125, 50, 0.22);
}

.btn-guide--cream {
  background-color: var(--cream);
  border-color: var(--cream-dark);
  color: var(--espresso);
}

.btn-guide--cream:hover {
  background-color: var(--espresso);
  border-color: var(--espresso);
  color: var(--white);
}

.btn-guide-icon {
  font-size: 0.9em;
}

/* EOL Preview (top of EOL card before the button) */
.eol-preview {
  padding: var(--space-md) var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.eol-preview-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--espresso-light);
}

.eol-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--espresso-light);
  flex-shrink: 0;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════
   NEW: Guide Panel Overlay (full-screen slide-up)
═══════════════════════════════════════════════════════════ */

.guide-panel-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(18, 18, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

.guide-panel-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.guide-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 210;
  background-color: var(--white);
  border-top: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 60px rgba(18,18,18,0.14);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Start off-screen */
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  /* Scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: var(--cream-dark) transparent;
}

.guide-panel.is-open {
  transform: translateY(0);
}

.guide-panel-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Drag handle visual affordance */
.guide-panel::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background-color: var(--cream-dark);
  border-radius: 4px;
  margin: var(--space-md) auto 0;
}

/* Guide Panel Header */
.guide-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
}

.guide-panel-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 300;
  color: var(--onyx);
  line-height: 1.2;
  margin-top: var(--space-xs);
}

.guide-panel-title em {
  font-style: italic;
  color: var(--gold-dark);
}

.guide-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--cream-dark);
  color: var(--espresso);
  flex-shrink: 0;
  margin-top: var(--space-sm);
  transition:
    border-color var(--duration-fast),
    background-color var(--duration-fast),
    color var(--duration-fast);
}

.guide-close-btn:hover {
  border-color: var(--onyx);
  background-color: var(--onyx);
  color: var(--white);
}

/* ─── Do's & Don'ts Grid ─────────────────────────────── */
.dos-donts-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 var(--space-xl);
  align-items: start;
}

.dos-donts-divider {
  background-color: var(--cream-dark);
  align-self: stretch;
}

/* Column headers */
.column-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
  border-bottom: 2px solid var(--cream-dark);
}

.column-header--do { border-bottom-color: var(--gold); }
.column-header--dont { border-bottom-color: var(--espresso); }

.column-header-icon {
  font-size: 1.4rem;
}

.column-header--do .column-header-icon { color: var(--gold); }
.column-header--dont .column-header-icon { color: var(--espresso); }

.column-header-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--onyx);
}

.column-header-sub {
  font-size: 0.78rem;
  color: var(--espresso-light);
  letter-spacing: 0.02em;
}

/* Instruction List Items */
.instruction-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  list-style: none;
}

.instruction-item {
  border-radius: var(--radius-sm);
  background-color: var(--cream);
  border: 1px solid var(--cream-dark);
  overflow: hidden;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  cursor: default;
}

/* Hover / Expanded state */
.instruction-item:hover,
.instruction-item.expanded {
  box-shadow: var(--shadow-sm);
}

.instruction-item--do:hover,
.instruction-item--do.expanded {
  border-color: var(--gold);
}

.instruction-item--dont:hover,
.instruction-item--dont.expanded {
  border-color: var(--espresso);
}

.instruction-main {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

.instruction-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.instruction-item--do .instruction-indicator {
  background-color: rgba(212,175,55,0.15);
  color: var(--gold-dark);
}

.instruction-item--dont .instruction-indicator {
  background-color: rgba(58,38,24,0.1);
  color: var(--espresso);
}

.instruction-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--onyx);
  line-height: 1.45;
  flex: 1;
}

/* Expand toggle (mobile tap) */
.instruction-toggle {
  margin-left: auto;
  color: var(--espresso-light);
  font-size: 0.7rem;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast);
  display: none; /* hidden on desktop — hover handles it */
}

/* Science reason reveal */
.instruction-reason {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height var(--duration-base) var(--ease-out),
    opacity var(--duration-base) var(--ease-out),
    padding var(--duration-base) var(--ease-out);
  opacity: 0;
  padding: 0 var(--space-md);
  border-top: 0px solid transparent;
}

/* Desktop: reveal on hover */
@media (hover: hover) {
  .instruction-item:hover .instruction-reason {
    max-height: 120px;
    opacity: 1;
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--cream-dark);
  }
}

/* Mobile: reveal via .expanded class (JS-toggled) */
@media (hover: none) {
  .instruction-toggle { display: block; }

  .instruction-item.expanded .instruction-reason {
    max-height: 120px;
    opacity: 1;
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--cream-dark);
  }

  .instruction-item.expanded .instruction-toggle {
    transform: rotate(180deg);
  }
}

.instruction-reason-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: var(--space-xs);
}

.instruction-reason-text {
  font-size: 0.8rem;
  color: var(--espresso-light);
  line-height: 1.6;
  padding-bottom: var(--space-sm);
}

/* ─── Care Panel Tip ──────────────────────────────────── */
.guide-panel-tip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background-color: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
}

.tip-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.tip-text {
  font-size: 0.84rem;
  color: var(--espresso);
  line-height: 1.65;
}

/* ─── EOL Methods Grid ────────────────────────────────── */
.eol-panel-intro {
  font-size: 0.9rem;
  color: var(--espresso-light);
  line-height: 1.75;
  margin-bottom: var(--space-lg);
}

.eol-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
}

.eol-method-card {
  background-color: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.eol-method-card:hover {
  border-color: var(--espresso-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.eol-method-card-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.eol-method-card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--onyx);
}

.eol-method-card-desc {
  font-size: 0.82rem;
  color: var(--espresso-light);
  line-height: 1.6;
}

.eol-method-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  margin-top: auto;
  width: fit-content;
}

.eol-method-card-tag--bio {
  background-color: rgba(58,38,24,0.08);
  color: var(--espresso);
}

.eol-method-card-tag--recycle {
  background-color: rgba(212,175,55,0.12);
  color: var(--gold-dark);
}

.eol-method-card-tag--donate {
  background-color: rgba(18,18,18,0.06);
  color: var(--espresso-light);
}

/* Guide Panel Footer */
.guide-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--cream-dark);
  flex-wrap: wrap;
}

.guide-panel-hint {
  font-size: 0.78rem;
  color: var(--espresso-light);
  letter-spacing: 0.02em;
  font-style: italic;
}

/* ─── Responsive: Dos/Donts panels ────────────────────── */
@media (max-width: 720px) {
  .dos-donts-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl) 0;
  }

  .dos-donts-divider {
    height: 1px;
    width: auto;
    align-self: auto;
  }

  .guide-panel-inner {
    padding: var(--space-lg) var(--space-md);
    gap: var(--space-lg);
  }

  .guide-panel-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .guide-panel {
    max-height: 95vh;
  }
}
/* ═══════════════════════════════════════════════════════════
   NEW: Live Scan — Camera Hint Overlay
═══════════════════════════════════════════════════════════ */

.camera-scan-hint {
  position: absolute;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background-color: rgba(18, 18, 18, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.camera-scan-hint-icon {
  color: var(--gold);
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════
   NEW: Live Scan — Capture Button Scanning State
═══════════════════════════════════════════════════════════ */

/* The capture button when scanning is in progress */
#capture-btn.is-scanning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 1.5rem;
  min-width: 160px;
  cursor: not-allowed;
  background-color: var(--onyx);
  border-color: var(--onyx);
  color: var(--white);
  /* Subtle pulsing glow to signal active processing */
  animation: scanGlow 1.2s ease-in-out infinite;
}

@keyframes scanGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  50%       { box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.18); }
}

.scan-btn-text {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Progress bar track */
.scan-btn-progress {
  display: block;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

/* Animated fill bar — JS sets transform: scaleX(0→1) */
.scan-btn-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, var(--gold-dark), var(--gold));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 80ms linear; /* smooth per-RAF update */
}

/* Frame counter label */
.scan-btn-counter {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   NEW: Unknown Fabric — Muted results styling
═══════════════════════════════════════════════════════════ */

/* hint pill rendered below the confidence badge for unknown fabrics */
.unknown-hint {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--espresso-light);
  background-color: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 100px;
  padding: 0.3rem 0.75rem;
  text-align: center;
  margin-top: var(--space-xs);
  white-space: nowrap;
}

/* When fabric is unknown, mute the stat values on the cards */
[data-fabric="unknown"] .stat-value--eco,
[data-fabric="unknown"] .stat-value--alert {
  color: var(--espresso-light);
  font-size: 1.2rem;
}

/* Unknown fabric: desaturate card tints */
[data-fabric="unknown"] .result-card--best {
  border-color: var(--cream-dark);
  background-color: var(--cream);
}

[data-fabric="unknown"] .result-card--worst {
  border-color: var(--cream-dark);
  background-color: var(--cream);
}

/* Unknown fabric: mute the guide button */
[data-fabric="unknown"] .btn-guide--eco {
  background-color: var(--cream);
  border-color: var(--cream-dark);
  color: var(--espresso-light);
  pointer-events: none;
  opacity: 0.6;
}