:root {
  color-scheme: light;

  /* Apple-like palette */
  --bg: #f2f2f7;
  --ink: #1d1d1f;
  --ink-secondary: #6e6e73;
  --muted: #86868b;

  --green: #34c759;
  --green-pressed: #2db14e;
  --green-dark: #248a3d;
  --green-glass: rgba(52,199,89,0.12);

  --tomato: #ff6b4a;
  --tomato-pressed: #e55d3e;
  --tomato-glass: rgba(255,107,74,0.1);

  --gold: #ff9f0a;
  --gold-glass: rgba(255,159,10,0.12);

  --blue: #007aff;
  --blue-glass: rgba(0,122,255,0.1);

  /* Glass tokens */
  --glass-bg: rgba(255,255,255,0.64);
  --glass-bg-strong: rgba(255,255,255,0.78);
  --glass-bg-light: rgba(255,255,255,0.38);
  --glass-border: rgba(0,0,0,0.04);
  --glass-border-highlight: rgba(255,255,255,0.7);
  --blur-card: blur(28px);
  --blur-element: blur(14px);

  /* Shadows — layered for depth */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-button: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-button-hover: 0 4px 16px rgba(0,0,0,0.1);

  /* Spacing scale — fluid, scales with viewport */
  --space-xs: clamp(6px, 1vw, 8px);
  --space-sm: clamp(8px, 1.5vw, 12px);
  --space-md: clamp(14px, 2.5vw, 20px);
  --space-lg: clamp(18px, 3vw, 28px);
  --space-xl: clamp(22px, 4vw, 36px);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: clamp(12px, 2vw, 16px);
  --radius-lg: clamp(16px, 3vw, 24px);
  --radius-xl: clamp(18px, 3.5vw, 28px);
  --radius-pill: 999px;

  /* Touch target minimum */
  --touch-min: 44px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 30% 0%, rgba(52,199,89,0.05), transparent),
    radial-gradient(ellipse 60% 40% at 70% 100%, rgba(255,107,74,0.04), transparent),
    radial-gradient(ellipse 50% 30% at 50% 50%, rgba(0,122,255,0.03), transparent),
    var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: var(--space-lg);
  width: min(1200px, calc(100vw - var(--space-xl) * 1.5));
  max-width: 100%;
  min-height: calc(100dvh - 56px);
  margin: var(--space-lg) auto;
  padding: 0 var(--space-sm);
}

.app-shell.single-col {
  grid-template-columns: minmax(320px, 440px);
  place-content: center;
}

/* ── Panels ── */

.capture-panel,
.result-panel {
  border: 0.5px solid var(--glass-border);
  border-top: 0.5px solid var(--glass-border-highlight);
  background: var(--glass-bg);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  box-shadow: var(--shadow-lg);
  transition: box-shadow 0.4s var(--spring-soft);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

.capture-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-height: clamp(480px, 80dvh, 640px);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
}

.result-panel {
  position: relative;
  min-height: clamp(480px, 80dvh, 640px);
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
}

.result-panel[hidden] {
  display: none;
}

/* ── Brand ── */

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  border: 0.5px solid rgba(255,255,255,0.2);
  box-shadow:
    0 0 0 4px var(--green-glass),
    0 2px 8px rgba(52,199,89,0.2);
}

/* ── Typography ── */

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.brand-row p,
.result-empty p,
.fine-print,
#specificType {
  color: var(--ink-secondary);
  line-height: 1.5;
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* ── Upload area ── */

.upload-area {
  display: grid;
  gap: var(--space-sm);
}

#imageInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0.5px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-light);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  box-shadow:
    0 1px 0 var(--glass-border-highlight) inset,
    var(--shadow-sm);
  transition: all 0.35s var(--spring-soft);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.preview-frame.drag-over {
  border-color: var(--green);
  background: rgba(52,199,89,0.06);
  box-shadow:
    0 1px 0 var(--glass-border-highlight) inset,
    0 0 0 3px rgba(52,199,89,0.12);
}

#previewImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 1px);
}

.empty-preview {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-glass);
  border: 0.5px solid rgba(52,199,89,0.15);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  transition: all 0.35s var(--spring-soft);
}

/* ── Buttons ── */

.upload-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xs);
}

.primary-button,
.ghost-button,
.analyze-button {
  min-height: 46px;
  border: 0.5px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.3s var(--spring-soft);
  position: relative;
  overflow: hidden;
}

.primary-button::after,
.analyze-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  pointer-events: none;
}

.primary-button:hover,
.ghost-button:hover:not(:disabled),
.analyze-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:active,
.ghost-button:active:not(:disabled),
.analyze-button:active:not(:disabled) {
  transform: scale(0.96);
}

.primary-button {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  box-shadow:
    var(--shadow-button),
    0 0 0 2px var(--green-glass);
}

.primary-button:hover {
  box-shadow:
    var(--shadow-button-hover),
    0 0 0 4px var(--green-glass);
}

.ghost-button {
  padding: 0 22px;
  color: var(--ink);
  background: rgba(0,0,0,0.04);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
}

.ghost-button:hover:not(:disabled) {
  background: rgba(0,0,0,0.07);
}

.ghost-button:disabled,
.analyze-button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
  filter: saturate(0.4);
}

/* ── Form ── */

.field-label {
  margin-bottom: -12px;
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.serving-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
}

#servingQty,
#servingUnit {
  width: 100%;
  min-height: 46px;
  border: 0.5px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  color: var(--ink);
  background: var(--glass-bg-light);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  outline: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 0 var(--glass-border-highlight) inset,
    var(--shadow-sm);
  transition: all 0.3s var(--spring-soft);
  -webkit-appearance: none;
  appearance: none;
}

#servingQty {
  text-align: center;
}

#servingUnit {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2386868B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}

#servingQty:focus,
#servingUnit:focus {
  border-color: var(--green);
  background: var(--glass-bg-strong);
  box-shadow:
    0 1px 0 var(--glass-border-highlight) inset,
    0 0 0 4px var(--green-glass);
}

/* ── Analyze button ── */

.analyze-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 50px;
  color: #fff;
  background: var(--tomato);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  box-shadow:
    var(--shadow-button),
    0 0 0 2px var(--tomato-glass);
}

.analyze-button:hover:not(:disabled) {
  box-shadow:
    var(--shadow-button-hover),
    0 0 0 4px var(--tomato-glass);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fine-print {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
}

.icp-record {
  margin: 0;
  font-size: 11px;
}

.icp-record a {
  color: var(--muted);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.icp-record a:hover {
  opacity: 1;
}

.record-sep {
  color: var(--muted);
  opacity: 0.3;
  margin: 0 4px;
}

.terms-link {
  cursor: pointer;
}

.terms-content {
  margin-top: var(--space-xs);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-light);
  border: 0.5px solid rgba(0,0,0,0.04);
  font-size: 11px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.terms-content p {
  margin: 0;
}

.terms-content p + p {
  margin-top: 6px;
}

.terms-content[hidden] {
  display: none;
}

/* ── Result panel ── */

.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 200px;
  text-align: center;
}

.result-empty[hidden] {
  display: none;
}

.result-empty h2 {
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.result-content {
  display: grid;
  gap: var(--space-lg);
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
}

.eyebrow {
  margin-bottom: var(--space-xs);
  color: var(--tomato);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.result-header h2 {
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.confidence-pill {
  align-self: start;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: #fff;
  background: rgba(0,122,255,0.72);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 0.5px solid rgba(255,255,255,0.2);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    var(--shadow-sm);
}

/* ── Calorie band ── */

.calorie-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-md);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%),
    linear-gradient(150deg, rgba(52,199,89,0.7), rgba(29,122,53,0.82));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgba(255,255,255,0.18);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 -1px 0 rgba(0,0,0,0.06) inset,
    var(--shadow-md);
}

.metric-label {
  display: block;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.calorie-band strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
}

#calorieRange {
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  letter-spacing: -0.01em;
}

/* ── Macro grid ── */

/* ── Macro donut chart ── */

.macro-chart {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-lg);
  align-items: center;
  margin: 0 auto;
}

.donut-ring {
  width: clamp(160px, 22vw, 210px);
  height: clamp(160px, 22vw, 210px);
  position: relative;
  border-radius: 50%;
  overflow: hidden;
}

.donut-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.65) 0%, transparent 40%);
  pointer-events: none;
  z-index: 2;
}

.donut-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08));
}

.macro-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-light);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  border: 0.5px solid rgba(0,0,0,0.04);
  box-shadow:
    0 1px 0 var(--glass-border-highlight) inset,
    var(--shadow-sm);
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--dot-color);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.legend-item em {
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  letter-spacing: -0.01em;
}

.legend-item b {
  margin-left: auto;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* ── Detail grid & list columns ── */

.detail-grid,
.list-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

article,
.list-columns section {
  border: 0.5px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--glass-bg-light);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  box-shadow:
    0 1px 0 var(--glass-border-highlight) inset,
    var(--shadow-sm);
  transition: transform 0.3s var(--spring-soft), box-shadow 0.3s var(--spring-soft);
}

article:hover,
.list-columns section:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 var(--glass-border-highlight) inset,
    var(--shadow-md);
}

h3 {
  margin-bottom: var(--space-xs);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

article p,
li {
  color: var(--ink-secondary);
  line-height: 1.55;
  font-size: 14px;
  letter-spacing: -0.01em;
}

ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

li::marker {
  color: #c0c0c5;
}

/* ── Error ── */

.error-box {
  margin-top: var(--space-md);
  border: 0.5px solid rgba(255,107,74,0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #b8341e;
  background: rgba(255,107,74,0.06);
  backdrop-filter: var(--blur-element);
  -webkit-backdrop-filter: var(--blur-element);
  line-height: 1.5;
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* ── Spring animation curves ── */

:root {
  --spring-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.result-content > * {
  animation: fadeIn 0.45s var(--spring-bounce) both;
}

.result-content > *:nth-child(1) { animation-delay: 0s; }
.result-content > *:nth-child(2) { animation-delay: 0.05s; }
.result-content > *:nth-child(3) { animation-delay: 0.1s; }
.result-content > *:nth-child(4) { animation-delay: 0.15s; }
.result-content > *:nth-child(5) { animation-delay: 0.2s; }
.result-content > *:nth-child(6) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  .result-content > * {
    animation: none;
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ── */

/* ── Tablet (≤900px): single column ── */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(calc(100vw - var(--space-lg)), 680px);
    margin: var(--space-md) auto;
    padding: 0;
    gap: var(--space-md);
  }

  .capture-panel,
  .result-panel {
    min-height: auto;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .result-empty {
    min-height: clamp(180px, 40dvh, 260px);
  }

  .calorie-band strong {
    font-size: clamp(36px, 10vw, 64px);
  }
}

/* ── Large phones (≤640px): tighter spacing + iOS glass fix ── */
@media (max-width: 640px) {
  :root {
    --blur-card: blur(16px);
    --blur-element: blur(8px);
    --glass-bg: rgba(255,255,255,0.78);
    --glass-bg-strong: rgba(255,255,255,0.88);
    --glass-bg-light: rgba(255,255,255,0.55);
  }

  .app-shell {
    width: 100%;
    margin: 0;
    gap: var(--space-sm);
  }

  .capture-panel,
  .result-panel {
    padding: var(--space-sm);
    border-radius: 0;
    border-left: none;
    border-right: none;
    backdrop-filter: var(--blur-card);
    -webkit-backdrop-filter: var(--blur-card);
  }

  .brand-row {
    gap: var(--space-sm);
  }

  h1 {
    font-size: clamp(22px, 6vw, 30px);
    line-height: 1.12;
  }

  .brand-row p {
    font-size: 13px;
    line-height: 1.45;
  }

  .brand-mark {
    width: var(--touch-min);
    height: var(--touch-min);
    flex: 0 0 var(--touch-min);
    font-size: 10px;
  }

  .macro-chart {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    justify-items: center;
  }

  .donut-ring {
    width: 160px;
    height: 160px;
  }

  .macro-legend {
    width: 100%;
  }

  .detail-grid,
  .list-columns {
    grid-template-columns: 1fr;
  }

  .calorie-band {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  #calorieRange {
    text-align: left;
    font-size: 13px;
  }

  .primary-button,
  .ghost-button,
  .analyze-button {
    min-height: var(--touch-min);
    font-size: 16px;
    font-weight: 600;
  }

  .primary-button {
    background: #2db14e;
  }

  .preview-frame {
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.55);
  }

  .result-header h2 {
    font-size: clamp(24px, 7vw, 40px);
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .confidence-pill {
    align-self: flex-start;
  }

  .calorie-band {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  article,
  .list-columns section {
    padding: var(--space-sm);
  }

  h3 {
    font-size: 14px;
  }

  #servingQty,
  #servingUnit {
    min-height: var(--touch-min);
  }
}

/* ── Small phones (≤440px): single-column cards ── */
@media (max-width: 440px) {
  .capture-panel,
  .result-panel {
    padding: var(--space-sm);
  }

  .macro-chart {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    justify-items: center;
  }

  .donut-ring {
    width: 150px;
    height: 150px;
  }

  .macro-legend {
    width: 100%;
  }

  .calorie-band {
    padding: var(--space-md);
  }

  .calorie-band strong {
    font-size: clamp(36px, 14vw, 56px);
  }

  .upload-actions {
    grid-template-columns: 1fr;
  }

  .ghost-button {
    order: 1;
  }

  .brand-row {
    align-items: flex-start;
  }

  .result-empty h2 {
    font-size: clamp(24px, 7vw, 40px);
  }
}

/* ── Ensure nothing overflows ── */
img, canvas, video, iframe, pre, code, table {
  max-width: 100%;
  height: auto;
}

/* ── iOS Safari backdrop-filter compatibility ── */
@supports (-webkit-touch-callout: none) {
  .capture-panel,
  .result-panel,
  .preview-frame {
    -webkit-backdrop-filter: var(--blur-card);
  }

  .primary-button,
  .ghost-button,
  .analyze-button,
  #servingQty,
  #servingUnit,
  article,
  .list-columns section,
  .donut-ring,
  .calorie-band,
  .confidence-pill,
  .error-box,
  .brand-mark,
  .empty-preview {
    -webkit-backdrop-filter: var(--blur-element);
  }
}

/* ── Graceful fallback if backdrop-filter is unsupported ── */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .capture-panel,
  .result-panel {
    background: rgba(255,255,255,0.88);
  }

  .preview-frame {
    background: rgba(255,255,255,0.78);
  }

  #servingQty,
  #servingUnit {
    background: rgba(255,255,255,0.85);
  }

  article,
  .list-columns section {
    background: rgba(255,255,255,0.78);
  }
}
