:root {
  --bg: #0d111c;
  --bg-elevated: #131a29;
  --panel: #161f31;
  --border: #26314a;
  --border-strong: #384664;
  --text: #e8edf7;
  --muted: #93a1bc;
  --muted-dim: #6d7c99;
  --accent: #f5a524;
  --accent-strong: #ffb43d;
  --accent-ink: #21160a;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 50% -20%, #18223a 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 20px 72px;
}

/* Header */
.app-header { margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.app-header h1 {
  margin: 0;
  min-height: 2.44em;
  font-size: clamp(24px, 5vw, 31px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 680;
}

/* Mode switch */
.mode-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
  padding: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.mode-btn {
  flex: 1;
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 620;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease;
}
.mode-btn:hover { color: var(--text); }
.mode-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-btn.is-active {
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
}

.mode-pane[hidden] { display: none !important; }

/* Upload panel */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.upload-panel { padding: 10px; }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 260px;
  padding: 40px 24px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.dropzone:hover { border-color: var(--accent); background: #162034; }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dropzone.is-dragging { border-color: var(--accent-strong); background: #1a2440; }
.dropzone.has-image { padding: 10px; cursor: default; border-style: solid; border-color: var(--border); }

.dropzone-icon { color: var(--accent); margin-bottom: 8px; }
.dropzone-empty h2 { margin: 0; font-size: 19px; font-weight: 620; color: var(--text); }
.dropzone-empty p { margin: 6px 0 0; font-size: 14px; }
.formats {
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.photo-btn {
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.06s ease;
}
.photo-btn:hover { background: var(--accent-strong); }
.photo-btn:active { transform: scale(0.98); }

.photo-btn-secondary {
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}
.photo-btn-secondary:hover { border-color: var(--accent); background: #1d2740; }

.preview {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 9px;
  display: block;
}

.change-photo {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  color: var(--text);
  background: rgba(13, 17, 28, 0.78);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.change-photo:hover { border-color: var(--accent); background: rgba(13, 17, 28, 0.92); }

/* Primary action */
.action-zone { margin-top: 18px; }

.primary-cta {
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.06s ease, opacity 0.18s ease;
}
.primary-cta:hover:not(:disabled) { filter: brightness(1.06); }
.primary-cta:active:not(:disabled) { transform: translateY(1px); }
.primary-cta:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.primary-cta:disabled { cursor: not-allowed; opacity: 0.45; filter: grayscale(0.15); }
.primary-cta.is-loading { opacity: 0.85; cursor: progress; }

.notice {
  min-height: 20px;
  margin: 12px 2px 0;
  font-size: 13.5px;
  color: var(--muted);
}
.notice.is-error { color: var(--danger); }

/* Detected / possible ingredients */
.ingredients { margin-top: 26px; }

.ingredients-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  padding: 5px 11px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* Recipe cards */
.results { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.card.is-winner { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(245, 165, 36, 0.35); }

.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.ordinal {
  flex: none;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
}

.card-name {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.minutes {
  flex: none;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--muted);
  white-space: nowrap;
}

.card h4 {
  margin: 14px 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.card h4:first-of-type { margin-top: 0; }

.card ul, .card ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.card li { margin: 2px 0; }
.card li::marker { color: var(--muted-dim); }

.winner-badge {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  vertical-align: middle;
}

.vote-btn {
  width: 100%;
  margin-top: 16px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}
.vote-btn:hover:not(:disabled) { border-color: var(--accent); }
.vote-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vote-btn.is-voted { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.vote-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.vote-btn.is-voted:disabled { opacity: 1; }

.results-footer {
  margin: 4px 2px 0;
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 560;
}

/* ============ Food Scanner ============ */

/* Scan result */

.scan-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.photo-card { padding: 8px; }
.result-photo {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 11px;
}

.detected-card .section-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.detected-name {
  margin: 0;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.detected-card .chips { margin-top: 2px; }

.hero-block { padding: 0 2px; }

.hero-name {
  margin: 0;
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-serving {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.calorie-card {
  text-align: center;
  padding: 20px 18px;
}

.calorie-sublabel {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.calorie-value {
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.calorie-num {
  font-size: clamp(46px, 13vw, 64px);
  color: var(--accent);
}

.calorie-unit {
  font-size: clamp(19px, 5vw, 24px);
  color: var(--muted);
  font-weight: 620;
}

.calorie-serving {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Nutrition cards */

.nutrition-card {
  padding: 16px 18px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.nutrient-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.nutrient-row:last-child { border-bottom: 0; }

.nutrient-name {
  font-size: 14px;
  color: var(--muted);
}

.nutrient-right {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: none;
}

.nutrient-amount {
  font-size: 14px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
}

.nutrient-dv {
  min-width: 40px;
  font-size: 12px;
  font-weight: 620;
  color: var(--accent);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ingredient-status {
  flex: none;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: capitalize;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.ingredient-status.is-visible { color: var(--accent-strong); border-color: rgba(245, 165, 36, 0.4); }
.ingredient-status.is-likely { color: var(--text); border-color: var(--border-strong); }
.ingredient-status.is-possible { color: var(--muted); border-color: var(--border); }
.ingredient-status.is-unknown { color: var(--muted-dim); border-color: var(--border); opacity: 0.8; }

/* Nutrition source pill */

.nutrition-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.nutrition-source-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.nutrition-source-value {
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--bg-elevated);
  border: 1px solid rgba(245, 165, 36, 0.4);
  border-radius: 999px;
}

/* Pros / Cons */

.point-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.point-row:last-of-type { border-bottom: 0; }
.point-row .section-title { margin: 0; }
.point-mark {
  flex: none;
  width: 16px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.point-mark.is-pros { color: var(--accent-strong); }
.point-mark.is-cons { color: var(--muted-dim); }
.point-text { font-size: 13.5px; color: var(--muted); }

/* What to Eat With It */

.pairing-label {
  margin: 14px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.pairing-label:first-child { margin-top: 2px; }
.pairing-why {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Collapsible cards */

.collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.collapse-head .section-title { margin: 0; }

.chevron {
  color: var(--muted-dim);
  font-size: 12px;
  transition: transform 0.18s ease;
}
.chevron.is-open { transform: rotate(180deg); }

.collapse-body { margin-top: 8px; }

/* Serving control */

.serving-card { padding: 16px 18px; }

.serving-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

.serving-btn {
  width: 42px;
  height: 42px;
  font-size: 20px;
  font-weight: 650;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.serving-btn:hover { border-color: var(--accent); }
.serving-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.serving-value {
  min-width: 96px;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.serving-grams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.serving-grams input {
  width: 88px;
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.serving-grams input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.portion-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted-dim);
}

.est-note {
  margin: 4px 2px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-dim);
}

.secondary-btn {
  padding: 11px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.secondary-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Meal breakdown */

.meal-item {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.meal-item summary {
  padding: 11px 15px;
  font-size: 14.5px;
  font-weight: 620;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  background: var(--bg-elevated);
  transition: color 0.16s ease;
}
.meal-item summary::-webkit-details-marker { display: none; }
.meal-item summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 9px;
  color: var(--accent);
  transition: transform 0.18s ease;
}
.meal-item[open] summary::before { transform: rotate(90deg); }
.meal-item summary:hover { color: var(--accent); }

.meal-body {
  padding: 4px 15px 14px;
}

.meal-body .nutrition-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 6px 0 0;
  box-shadow: none;
}

/* ============ Analysis screen ============ */

.analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(245, 165, 36, 0.07), transparent 60%),
    radial-gradient(1100px 600px at 50% -20%, #18223a 0%, transparent 60%),
    rgba(9, 12, 20, 0.92);
  backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 0.28s ease;
}
.analysis-overlay.is-exiting { opacity: 0; }

.analysis-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.analysis-kicker {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.analysis-figure {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0a0f1b;
  box-shadow: 0 24px 70px -32px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(245, 165, 36, 0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.analysis-figure.is-done {
  border-color: rgba(245, 165, 36, 0.5);
  box-shadow: 0 24px 70px -32px rgba(0, 0, 0, 0.95), 0 0 26px -6px rgba(245, 165, 36, 0.45);
}

.analysis-img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.analysis-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 84px;
  pointer-events: none;
  opacity: 0;
  animation: scanSweep 2.2s linear infinite;
}
.analysis-scan::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 165, 36, 0) 0%, rgba(245, 165, 36, 0.1) 40%, rgba(245, 165, 36, 0.14) 100%);
}
.analysis-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 208, 138, 0.4) 30%, var(--accent-strong) 50%, rgba(255, 208, 138, 0.4) 70%, transparent 100%);
  box-shadow: 0 0 18px 3px rgba(245, 165, 36, 0.55);
}
.analysis-overlay.is-done .analysis-scan { animation: none; opacity: 0; }

@keyframes scanSweep {
  0% { top: -84px; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.analysis-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 12px 2px rgba(245, 165, 36, 0.7);
  opacity: 0;
  animation: scanDot 3.4s ease-in-out infinite;
}
.analysis-dot.d1 { top: 20%; left: 4%; animation-delay: 0.6s; }
.analysis-dot.d2 { top: 66%; right: 3%; animation-delay: 1.7s; }
.analysis-dot.d3 { bottom: 16%; left: 12%; animation-delay: 2.9s; }
.analysis-dot.d4 { top: 34%; right: 8%; animation-delay: 4.1s; }

@keyframes scanDot {
  0%, 100% { opacity: 0; transform: scale(0.3); }
  10% { opacity: 1; transform: scale(1); }
  22% { opacity: 0; transform: scale(1.5); }
}

.analysis-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 80px;
  justify-content: center;
}

.analysis-statusword {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.analysis-statusdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(245, 165, 36, 0.55);
  animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.12); }
}

.analysis-message {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.analysis-message.is-driving { animation: riseIn 0.35s ease both; }

.analysis-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: riseIn 0.4s ease both;
}

.analysis-check {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 26px -2px rgba(245, 165, 36, 0.6);
}

.analysis-done-main {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  color: var(--text);
}

.analysis-done-sub {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.analysis-bar {
  width: 100%;
  max-width: 320px;
}

.analysis-segments {
  display: flex;
  gap: 6px;
}

.analysis-seg {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.35s ease;
}
.analysis-seg.is-fill {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(245, 165, 36, 0.35);
}
.analysis-seg.is-active {
  background: var(--accent);
  opacity: 0.55;
  animation: segGlow 1.3s ease-in-out infinite;
}
.analysis-seg.is-pulse {
  animation: segGlow 1.5s ease-in-out infinite;
}

@keyframes segGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.analysis-stages {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.analysis-stage {
  flex: 1;
  text-align: center;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dim);
  transition: color 0.3s ease;
}
.analysis-stage.is-on { color: var(--accent); }

/* Results entrance */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.scan-result { animation: riseIn 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.results .card { animation: riseIn 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.results .card:nth-child(2) { animation-delay: 0.05s; }
.results .card:nth-child(3) { animation-delay: 0.1s; }

/* Mobile */
@media (max-width: 560px) {
  .analysis-img { max-height: 230px; }
  .analysis-scene { gap: 16px; }
  .analysis-overlay { padding: 22px 16px; }
  .analysis-status { min-height: 72px; }
  .app { padding: 34px 14px 56px; }
  .upload-panel { padding: 8px; }
  .dropzone { min-height: 210px; padding: 30px 18px; }
  .preview { max-height: 240px; }
  .card { padding: 16px 15px 14px; }
  .change-photo { right: 14px; bottom: 14px; }
  .mode-switch { gap: 4px; padding: 4px; }
  .mode-btn { padding: 9px 8px; font-size: 12.5px; }
  .result-photo { max-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .analysis-scan, .analysis-dot { opacity: 0 !important; }
}