/* ================================================================
   HemoLens Web Demo — Styles
   ================================================================ */

:root {
  /* Brand palette */
  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-400: #f87171;
  --red-100: #fee2e2;
  --red-50:  #fef2f2;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --orange-500: #f97316;
  --yellow-500: #eab308;
  --green-500:  #22c55e;
  --green-600:  #16a34a;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.15);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--slate-900);
  color: var(--slate-100);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ─── Splash Screen ─── */

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--slate-900) 0%, #1a1225 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-inner {
  text-align: center;
  padding: 2rem;
}

.logo-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.08);
  animation: pulse-ring 2s ease-in-out infinite;
  margin-bottom: 1.5rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  color: var(--red-500);
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.3); }
  50%      { box-shadow: 0 0 0 20px rgba(220,38,38,0); }
}

.splash-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--red-400), var(--red-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.splash-sub {
  font-size: 0.95rem;
  color: var(--slate-400);
  font-weight: 400;
  margin-bottom: 1rem;
}

.splash-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--green-500);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.18);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.splash-privacy svg {
  flex-shrink: 0;
  color: var(--green-500);
}

.loader {
  width: 200px;
  height: 3px;
  background: var(--slate-700);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 1rem;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-500), var(--red-400));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.splash-status {
  font-size: 0.8rem;
  color: var(--slate-500);
  font-weight: 400;
}


/* ─── App Layout ─── */

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--slate-900);
}


/* ─── Header ─── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 10;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo {
  width: 28px;
  height: 28px;
  color: var(--red-500);
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--slate-50);
}

.header-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange-500);
  background: rgba(249, 115, 22, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--green-500);
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.22);
}
.badge-privacy svg {
  flex-shrink: 0;
}


/* ─── Scan Debug Thumbnails ─── */

.scan-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 320px;
  margin: 0.5rem auto 0;
  padding: 0.35rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scan-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.scan-thumb canvas {
  width: 100%;
  height: auto;
  display: block;
}

.scan-thumb .scan-thumb-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.65));
}

.scan-thumb.invalid {
  filter: grayscale(1);
  opacity: 0.6;
}

.scan-thumb.outlier {
  border-color: rgba(239, 68, 68, 0.7);
}


/* ─── Debug Panel (Result Card) ─── */

.debug-details {
  margin-top: 0.9rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.debug-details summary {
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-200);
  outline: none;
}

.debug-controls {
  display: grid;
  gap: 0.45rem;
  margin: 0.7rem 0 0.6rem;
}

.debug-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--slate-300);
}

.debug-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--red-500);
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.debug-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.debug-frame canvas {
  width: 100%;
  height: auto;
  display: block;
}

.debug-frame .debug-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.70));
}

.debug-frame.invalid {
  filter: grayscale(1);
  opacity: 0.55;
}

.debug-frame.outlier {
  border-color: rgba(239, 68, 68, 0.75);
}

.debug-hint {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--slate-500);
}


/* ─── Camera Section ─── */

.camera-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.camera-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.guide-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Animated nail dash border */
.nail-dash {
  animation: dashScroll 1.2s linear infinite;
}
@keyframes dashScroll {
  to { stroke-dashoffset: -30; }
}

/* Instruction chip above controls */
.instruction-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  color: var(--slate-300);
  letter-spacing: 0.01em;
  line-height: 1.4;
  text-align: center;
  flex-shrink: 0;
}
.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-500);
  flex-shrink: 0;
  animation: chipPulse 2s ease-in-out infinite;
}
@keyframes chipPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Scan line animation */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-400), transparent);
  box-shadow: 0 0 12px var(--red-500);
  z-index: 3;
  animation: scan 1.2s ease-in-out infinite;
}
@keyframes scan {
  0%   { top: 30%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 70%; opacity: 0; }
}


/* ─── Camera Controls ─── */

.camera-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--slate-600);
  background: transparent;
  color: var(--slate-300);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ctrl-btn:hover {
  background: var(--slate-700);
  border-color: var(--slate-500);
  color: #fff;
}
.ctrl-btn svg { width: 20px; height: 20px; }

/* Flash button active state */
.ctrl-btn.flash-on {
  background: var(--yellow-500);
  border-color: var(--yellow-500);
  color: var(--slate-900);
}
.ctrl-btn.flash-on:hover {
  background: #facc15;
  border-color: #facc15;
  color: var(--slate-900);
}
.ctrl-btn.flash-unsupported {
  opacity: 0.35;
  pointer-events: none;
}

.capture-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}
.capture-btn:hover { border-color: #fff; }
.capture-btn:active { transform: scale(0.92); }

.capture-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.capture-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  transition: all 0.15s ease;
}

.capture-btn:active .capture-dot {
  background: var(--red-500);
  width: 52px;
  height: 52px;
}


/* ─── Result Section ─── */

.result-section {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.result-card {
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--slate-800);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.result-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-100);
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--slate-700);
  color: var(--slate-300);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.close-btn:hover { background: var(--slate-600); color: #fff; }
.close-btn svg { width: 18px; height: 18px; }


/* Preview */
.result-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #000;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-preview canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* Hb Value */
.result-value-wrap {
  text-align: center;
  margin-bottom: 1.25rem;
}
.result-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-400);
  margin-bottom: 0.25rem;
  display: block;
}
.result-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
}
.hb-number {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hb-unit {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--slate-400);
}


/* Severity Gauge */
.gauge-container {
  position: relative;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}
.gauge-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}
.gauge-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.gauge-zone span {
  font-size: 0;
}
.gauge-zone.severe   { background: var(--red-600); }
.gauge-zone.moderate { background: var(--orange-500); }
.gauge-zone.mild     { background: var(--yellow-500); }
.gauge-zone.normal   { background: var(--green-500); }

.gauge-marker {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gauge-needle {
  width: 4px;
  height: 18px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--slate-500);
  margin-top: 0.3rem;
  padding: 0 1px;
}


/* Severity Badge */
.severity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  padding: 0.35rem 1.25rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  width: fit-content;
  text-align: center;
}
.result-value-wrap + .gauge-container + .severity-badge {
  display: block;
  text-align: center;
}
.severity-badge.severe   { background: rgba(220,38,38,0.15); color: var(--red-400); border: 1px solid rgba(220,38,38,0.3); }
.severity-badge.moderate { background: rgba(249,115,22,0.15); color: var(--orange-500); border: 1px solid rgba(249,115,22,0.3); }
.severity-badge.mild     { background: rgba(234,179,8,0.15); color: var(--yellow-500); border: 1px solid rgba(234,179,8,0.3); }
.severity-badge.normal   { background: rgba(34,197,94,0.15); color: var(--green-500); border: 1px solid rgba(34,197,94,0.3); }
.severity-badge.unreliable { background: rgba(234,179,8,0.20); color: var(--yellow-500); border: 1px solid rgba(234,179,8,0.5); animation: pulse-warn 1.5s infinite; }

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Unreliable result warning */
.unreliable-warning {
  background: rgba(234,179,8,0.12);
  border: 1px solid rgba(234,179,8,0.4);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  text-align: center;
  color: var(--yellow-500, #eab308);
  font-size: 0.8rem;
  line-height: 1.5;
}
.unreliable-warning strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.unreliable-warning p {
  margin: 0;
  color: var(--slate-400, #94a3b8);
}


/* Result note */
.result-note {
  font-size: 0.75rem;
  color: var(--slate-500);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}


/* Actions */
.result-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-outline {
  border: 1.5px solid var(--slate-600);
  background: transparent;
  color: var(--slate-200);
}
.btn-outline:hover {
  background: var(--slate-700);
  border-color: var(--slate-500);
}
.btn-primary {
  border: none;
  background: var(--red-600);
  color: #fff;
}
.btn-primary:hover { background: var(--red-500); }


/* ─── Disclaimer Footer ─── */

.disclaimer {
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.65rem;
  color: var(--slate-600);
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.disclaimer strong { color: var(--orange-500); }
.disclaimer a {
  color: var(--slate-500);
  text-decoration: none;
}
.disclaimer a:hover { color: var(--slate-300); }

.footer-sep {
  margin: 0 0.25rem;
  color: var(--slate-700);
}
.footer-offline {
  color: var(--green-500);
  opacity: 0.8;
}


/* ─── Flash Animation (capture feedback) ─── */

.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 5;
  animation: flash 0.3s ease-out forwards;
}
@keyframes flash {
  0%   { opacity: 0.8; }
  100% { opacity: 0; }
}

/* Mini flash for multi-frame */
.mini-flash {
  position: absolute;
  inset: 0;
  background: rgba(248,113,113,0.12);
  z-index: 5;
  animation: miniFlash 0.15s ease-out forwards;
  pointer-events: none;
}
@keyframes miniFlash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}


/* ─── Multi-frame Scan Overlay ─── */

.scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s ease;
}

.scan-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
}

.scan-ring {
  width: 110px;
  height: 110px;
  filter: drop-shadow(0 0 12px rgba(248,113,113,0.3));
}

.scan-ring circle:last-of-type {
  transition: stroke-dashoffset 0.15s ease;
}

.scan-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -72%);
  display: flex;
  align-items: baseline;
  gap: 1px;
  pointer-events: none;
}

.scan-frame-num {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.scan-frame-total {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate-400);
}

.scan-label {
  font-size: 0.8rem;
  color: var(--slate-300);
  font-weight: 500;
  letter-spacing: 0.01em;
  animation: scanPulseText 1.5s ease-in-out infinite;
}

@keyframes scanPulseText {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* Live prediction dots */
.scan-dots {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 32px;
  padding: 0 0.25rem;
}

.scan-dot {
  width: 5px;
  border-radius: 2px;
  background: var(--red-400);
  opacity: 0.7;
  animation: dotAppear 0.2s ease;
  transition: height 0.15s ease;
}

.scan-dot.outlier {
  background: var(--slate-600);
  opacity: 0.35;
}

@keyframes dotAppear {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 0.7; }
}

.scan-cancel-btn {
  margin-top: 0.25rem;
  padding: 0.35rem 1.25rem;
  border-radius: 100px;
  border: 1px solid var(--slate-600);
  background: transparent;
  color: var(--slate-400);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.scan-cancel-btn:hover {
  border-color: var(--slate-400);
  color: var(--slate-200);
  background: rgba(255,255,255,0.05);
}


/* ─── Multi-frame Stats Row ─── */

.multi-frame-stats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--slate-700);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  min-width: 72px;
}

.stat-label {
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-100);
  font-variant-numeric: tabular-nums;
}


/* ─── Low-Light Warning Banner ─── */

.low-light-banner {
  position: absolute;
  bottom: 100px;          /* sit above the controls bar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(234, 179, 8, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 100px;
  padding: 0.45rem 0.65rem 0.45rem 0.85rem;
  max-width: calc(100% - 2rem);
  white-space: nowrap;
  animation: lowLightSlideIn 0.35s ease-out;
  pointer-events: auto;
}

.low-light-banner.hidden {
  display: none !important;
}

@keyframes lowLightSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.low-light-banner svg {
  flex-shrink: 0;
  color: var(--yellow-500);
}

.low-light-text {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
}

.low-light-flash-btn {
  flex-shrink: 0;
  background: var(--yellow-500);
  color: var(--slate-900);
  border: none;
  border-radius: 100px;
  padding: 0.25rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.low-light-flash-btn:hover {
  background: #facc15;
}

.low-light-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}
.low-light-dismiss:hover {
  color: rgba(255, 255, 255, 0.9);
}


/* ─── Desktop Responsive ─── */

@media (min-width: 640px) {
  .camera-container {
    max-height: 70dvh;
    border-radius: var(--radius-lg);
    margin: 0.5rem;
  }
  .result-section {
    align-items: center;
  }
  .result-card {
    border-radius: var(--radius-xl);
    max-width: 420px;
    max-height: 85dvh;
  }
}
