/* ─────────────────────────────────────────────────────────────────────────────
   FitsAmerica Android Prototype — Styles
   © 2026 NSTAR Solution LLP · Confidential
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── CSS CUSTOM PROPERTIES ─── */
:root {
  /* Primary Palette */
  --color-cyan: #2AC3E0;
  --color-cyan-dark: #00BCD4;
  --color-cyan-light: #4DD0E1;
  --color-cyan-glow: rgba(42, 195, 224, 0.4);

  /* Accent Colors */
  --color-orange: #FF7043;
  --color-orange-dark: #E64A19;
  --color-green: #4CAF50;
  --color-green-light: #66BB6A;
  --color-red: #F44336;
  --color-yellow: #FFEB3B;

  /* Heatmap Gradient */
  --gradient-heatmap: linear-gradient(180deg, #4CAF50 0%, #FFEB3B 33%, #FF9800 66%, #F44336 100%);

  /* Neutrals */
  --color-bg-dark: #0a0e1a;
  --color-bg-darker: #060810;
  --color-bg-card: #141926;
  --color-bg-elevated: #1a2033;
  --color-text-primary: #FFFFFF;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: rgba(255, 255, 255, 0.5);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-shadow: rgba(0, 0, 0, 0.12);
  --color-shadow-heavy: rgba(0, 0, 0, 0.3);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Sizing */
  --phone-width: 400px;
  --phone-height: 860px;
  --phone-radius: 48px;
  --phone-bezel: 12px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-pill: 100px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg-dark);
  color: var(--color-text-primary);
  line-height: 1.5;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

canvas {
  display: block;
}

/* ─── SPLASH SCREEN ─── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity var(--duration-slow) var(--ease-out-expo);
}

.splash.splash--hidden {
  opacity: 0;
  pointer-events: none;
}

.splash__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: splashFadeIn 0.8s var(--ease-out-expo);
}

.splash__logo {
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-cyan-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px var(--color-cyan-glow);
  animation: splashLogoPulse 2s ease-in-out infinite;
}

.splash__logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.splash__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.splash__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--color-text-primary) 0%, var(--color-cyan-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash__subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.splash__loader {
  width: 200px;
  height: 3px;
  background: var(--color-border);
  border-radius: var(--border-radius-pill);
  overflow: hidden;
  margin-top: 16px;
}

.splash__loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-cyan) 0%, var(--color-cyan-light) 100%);
  border-radius: var(--border-radius-pill);
  animation: splashLoaderFill 1.5s var(--ease-out-expo) forwards;
}

.splash__status {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

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

@keyframes splashLogoPulse {
  0%, 100% {
    box-shadow: 0 20px 60px var(--color-cyan-glow);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 30px 80px var(--color-cyan-glow);
    transform: scale(1.02);
  }
}

@keyframes splashLoaderFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ─── DESKTOP BACKGROUND ─── */
.desktop-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #0a0e1a 0%, #141926 50%, #0d1220 100%);
  overflow: hidden;
}

.desktop-bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.desktop-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at center, rgba(42, 195, 224, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 0%, transparent 100%);
}

.desktop-watermark {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 1;
}

/* ─── PHONE FRAME ─── */
.phone-frame {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--phone-width);
  height: var(--phone-height);
  background: linear-gradient(145deg, #2a2f3d 0%, #1a1e2a 100%);
  border-radius: var(--phone-radius);
  padding: var(--phone-bezel);
  box-shadow:
    0 50px 100px -20px rgba(0, 0, 0, 0.5),
    0 30px 60px -30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.phone-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--phone-radius) + 2px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

.phone-frame__notch {
  position: absolute;
  top: var(--phone-bezel);
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #0a0e1a;
  border-radius: 0 0 16px 16px;
  z-index: 100;
}

.phone-frame__notch::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #1a2033;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(42, 195, 224, 0.3);
}

.phone-frame__screen {
  width: 100%;
  height: 100%;
  background: var(--color-bg-dark);
  border-radius: calc(var(--phone-radius) - var(--phone-bezel));
  overflow: hidden;
  position: relative;
}

/* ─── APP CONTAINER ─── */
.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-dark);
}

/* ─── NAVIGATION ─── */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0 16px;
  padding-top: 32px;
  display: flex;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}

.nav__back,
.nav__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  transition: all var(--duration-fast) var(--ease-out-quart);
  pointer-events: auto;
}

.nav__back:hover,
.nav__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.nav__back:active,
.nav__close:active {
  transform: scale(0.95);
}

.nav__back.nav__back--hidden {
  opacity: 0;
  pointer-events: none;
}

.nav__spacer {
  flex: 1;
}

/* ─── SCREENS CONTAINER ─── */
.screens {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

.screen {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ─── SCREEN HEADER ─── */
.screen__header {
  padding: 80px 24px 32px;
  position: relative;
}

.screen__header--cyan {
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-cyan-dark) 100%);
}

.screen__logo {
  position: absolute;
  top: 44px;
  right: 24px;
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.screen__title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.screen__subtitle {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  max-width: 320px;
}

/* ─── SCREEN FOOTER ─── */
.screen__footer {
  padding: 24px;
  margin-top: auto;
}

.screen__footer--dual {
  display: flex;
  gap: 12px;
}

.screen__footer--dual .btn {
  flex: 1;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--border-radius-pill);
  transition: all var(--duration-fast) var(--ease-out-quart);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: all var(--duration-normal) var(--ease-out-expo);
}

.btn:active::before {
  opacity: 1;
  transform: scale(2);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-cyan-dark) 100%);
  color: var(--color-text-primary);
  box-shadow: 0 8px 24px -4px var(--color-cyan-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -4px var(--color-cyan-glow);
}

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

.btn--ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.btn--large {
  padding: 18px 36px;
  font-size: 17px;
  width: 100%;
}

/* ─── INTRO ANIMATION ─── */
.intro-animation {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px 24px;
}

.intro-animation__phone {
  width: 100px;
  height: 180px;
  background: linear-gradient(145deg, #2a2f3d 0%, #1a1e2a 100%);
  border-radius: 16px;
  padding: 8px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.intro-animation__phone-screen {
  width: 100%;
  height: 100%;
  background: var(--color-bg-dark);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-animation__camera {
  width: 16px;
  height: 16px;
  background: radial-gradient(circle, var(--color-cyan) 30%, var(--color-cyan-dark) 100%);
  border-radius: 50%;
  box-shadow:
    0 0 20px var(--color-cyan-glow),
    0 0 40px var(--color-cyan-glow);
  animation: cameraPulse 2s ease-in-out infinite;
}

.intro-animation__foot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -75%);
  width: 120px;
  height: 200px;
  z-index: 2;
  animation: footFloat 3s ease-in-out infinite;
}

.intro-animation__foot-svg {
  width: 100%;
  height: 100%;
}

.intro-animation__foot-path {
  fill: none;
  stroke: var(--color-cyan);
  stroke-width: 2;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: footDraw 2s var(--ease-out-expo) forwards, footGlow 2s ease-in-out infinite 2s;
  filter: drop-shadow(0 0 8px var(--color-cyan-glow));
}

.intro-animation__rays {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 10%);
  width: 200px;
  height: 300px;
  z-index: 0;
}

.intro-animation__ray {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 0;
  background: linear-gradient(to top, var(--color-cyan) 0%, transparent 100%);
  transform-origin: bottom center;
  animation: rayShoot 2s ease-in-out infinite;
}

.intro-animation__ray:nth-child(1) { transform: translateX(-50%) rotate(-20deg); animation-delay: 0s; }
.intro-animation__ray:nth-child(2) { transform: translateX(-50%) rotate(-10deg); animation-delay: 0.2s; }
.intro-animation__ray:nth-child(3) { transform: translateX(-50%) rotate(0deg); animation-delay: 0.4s; }
.intro-animation__ray:nth-child(4) { transform: translateX(-50%) rotate(10deg); animation-delay: 0.2s; }
.intro-animation__ray:nth-child(5) { transform: translateX(-50%) rotate(20deg); animation-delay: 0s; }

@keyframes cameraPulse {
  0%, 100% { box-shadow: 0 0 20px var(--color-cyan-glow), 0 0 40px var(--color-cyan-glow); }
  50% { box-shadow: 0 0 30px var(--color-cyan-glow), 0 0 60px var(--color-cyan-glow); }
}

@keyframes footFloat {
  0%, 100% { transform: translate(-50%, -75%); }
  50% { transform: translate(-50%, -78%); }
}

@keyframes footDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes footGlow {
  0%, 100% { filter: drop-shadow(0 0 8px var(--color-cyan-glow)); }
  50% { filter: drop-shadow(0 0 16px var(--color-cyan-glow)); }
}

@keyframes rayShoot {
  0%, 100% { height: 0; opacity: 0; }
  50% { height: 150px; opacity: 0.6; }
}

/* ─── SCAN SCREEN ─── */
.scan-viewport {
  position: absolute;
  inset: 0;
  background: var(--color-bg-darker);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-canvas {
  width: 100%;
  height: 100%;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--color-green) 20%, var(--color-green) 80%, transparent 100%);
  box-shadow: 0 0 20px var(--color-green), 0 0 40px var(--color-green);
  animation: scanLineMove 2s ease-in-out infinite;
  opacity: 0;
}

.scan-line.scan-line--active {
  opacity: 1;
}

@keyframes scanLineMove {
  0% { top: 15%; }
  50% { top: 85%; }
  100% { top: 15%; }
}

.scan-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-cyan-glow) 0%, transparent 70%);
  animation: scanGlowPulse 2s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
}

.scan-glow.scan-glow--active {
  opacity: 1;
}

@keyframes scanGlowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
}

/* ─── SCAN HUD ─── */
.scan-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 70px 16px 24px;
  display: flex;
  flex-direction: column;
}

.scan-hud__top {
  display: flex;
  justify-content: flex-start;
}

.scan-counter {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-counter__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scan-counter__value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-cyan);
  letter-spacing: 0.02em;
}

.scan-hud__right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.scan-progress {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scan-progress__item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity var(--duration-normal) var(--ease-out-quart);
}

.scan-progress__item.scan-progress__item--active {
  opacity: 1;
}

.scan-progress__item.scan-progress__item--complete {
  opacity: 1;
}

.scan-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: all var(--duration-normal) var(--ease-out-quart);
}

.scan-progress__item--active .scan-progress__dot {
  background: var(--color-cyan);
  box-shadow: 0 0 12px var(--color-cyan-glow);
  animation: dotPulse 1s ease-in-out infinite;
}

.scan-progress__item--complete .scan-progress__dot {
  background: var(--color-green);
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.scan-progress__label {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── RESULTS SCREEN ─── */
.results-header {
  padding: 70px 24px 16px;
  text-align: center;
}

.results-header__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.results-viewport {
  flex: 1;
  position: relative;
  margin: 0 24px;
  background: var(--color-bg-darker);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  min-height: 280px;
}

.results-canvas {
  width: 100%;
  height: 100%;
}

.results-viewport__label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: var(--border-radius-pill);
}

.results-stats {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
}

.stat-card {
  flex: 1;
  background: var(--color-bg-elevated);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card__value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text-primary);
}

.stat-card--foot .stat-card__value {
  color: var(--color-cyan);
}

.stat-card__unit {
  font-size: 9px;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-card--arch {
  align-items: flex-start;
}

.stat-card--arch .stat-card__value {
  color: var(--color-orange);
  font-size: 16px;
}

.stat-card__angle {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-orange);
}

.results-toggles {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  justify-content: center;
}

.toggle-chip {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-elevated);
  border-radius: var(--border-radius-pill);
  transition: all var(--duration-fast) var(--ease-out-quart);
}

.toggle-chip:hover {
  background: var(--color-bg-card);
}

.toggle-chip--active {
  background: var(--color-cyan);
  color: var(--color-text-primary);
}

/* ─── GAIT ANALYSIS SCREEN ─── */
.gait-header {
  position: absolute;
  top: 36px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.gait-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: var(--border-radius-pill);
}

.gait-header__icon {
  color: var(--color-cyan);
}

.gait-header__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gait-header__rec {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--border-radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-red);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out-quart);
}

.gait-header__rec.gait-header__rec--visible {
  opacity: 1;
}

.gait-header__rec-dot {
  width: 8px;
  height: 8px;
  background: var(--color-red);
  border-radius: 50%;
  animation: recPulse 1s ease-in-out infinite;
}

@keyframes recPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.gait-metrics {
  position: absolute;
  top: 80px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.gait-metric {
  flex: 1;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gait-metric__value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text-primary);
}

.gait-metric__label {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
}

.gait-viewport {
  position: absolute;
  inset: 0;
  background: var(--color-bg-darker);
}

.gait-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.gait-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

/* ─── GAIT CALLOUTS ─── */
.gait-callouts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out-quart);
}

.gait-callouts.gait-callouts--visible {
  opacity: 1;
}

.gait-callout {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border-radius: var(--border-radius-sm);
  border-left: 3px solid var(--color-cyan);
}

.gait-callout--head { top: 18%; left: 5%; }
.gait-callout--shoulders { top: 28%; right: 5%; }
.gait-callout--hips { top: 48%; left: 5%; }
.gait-callout--back { top: 38%; right: 5%; }
.gait-callout--left-leg { top: 72%; left: 5%; }
.gait-callout--right-leg { top: 62%; right: 5%; }

.gait-callout__label {
  font-size: 8px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gait-callout__value {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text-primary);
}

/* ─── GAIT DEMO SKELETON ─── */
.gait-demo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-bg-darker) 0%, #1a2030 100%);
}

.gait-demo.gait-demo--hidden {
  display: none;
}

.gait-demo__skeleton {
  width: 120px;
  height: 300px;
  position: relative;
  animation: skeletonSway 3s ease-in-out infinite;
}

.gait-demo__head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 40px;
  background: var(--color-cyan);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--color-cyan-glow);
}

.gait-demo__torso {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 100px;
  background: linear-gradient(180deg, var(--color-cyan) 0%, var(--color-green) 100%);
  border-radius: 3px;
}

.gait-demo__arm {
  position: absolute;
  top: 50px;
  width: 4px;
  height: 80px;
  background: var(--color-cyan);
  border-radius: 2px;
  transform-origin: top center;
}

.gait-demo__arm--left {
  left: 20px;
  animation: armSwingLeft 1.5s ease-in-out infinite;
}

.gait-demo__arm--right {
  right: 20px;
  animation: armSwingRight 1.5s ease-in-out infinite;
}

.gait-demo__leg {
  position: absolute;
  top: 140px;
  width: 5px;
  height: 120px;
  background: linear-gradient(180deg, var(--color-green) 0%, var(--color-yellow) 100%);
  border-radius: 3px;
  transform-origin: top center;
}

.gait-demo__leg--left {
  left: 35px;
  animation: legSwingLeft 1.5s ease-in-out infinite;
}

.gait-demo__leg--right {
  right: 35px;
  animation: legSwingRight 1.5s ease-in-out infinite;
}

.gait-demo__badge {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--color-orange);
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: var(--border-radius-pill);
  text-transform: uppercase;
}

@keyframes skeletonSway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

@keyframes armSwingLeft {
  0%, 100% { transform: rotate(15deg); }
  50% { transform: rotate(-15deg); }
}

@keyframes armSwingRight {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
}

@keyframes legSwingLeft {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

@keyframes legSwingRight {
  0%, 100% { transform: rotate(10deg); }
  50% { transform: rotate(-10deg); }
}

/* ─── GAIT PERMISSION CARD ─── */
.gait-permission {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-bg-elevated);
  border-radius: var(--border-radius-xl);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  z-index: 30;
}

.gait-permission.gait-permission--hidden {
  display: none;
}

.gait-permission__icon {
  color: var(--color-cyan);
  opacity: 0.8;
}

.gait-permission__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.gait-permission__text {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ─── PROGRESS BAR ─── */
.progress-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border-radius: var(--border-radius-pill);
  z-index: 40;
}

.progress-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: all var(--duration-normal) var(--ease-out-quart);
}

.progress-bar__dot--active {
  background: var(--color-cyan);
  box-shadow: 0 0 8px var(--color-cyan-glow);
}

.progress-bar__dot--complete {
  background: var(--color-green);
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── MOBILE STYLES ─── */
@media (max-width: 767px) {
  .desktop-bg,
  .desktop-watermark {
    display: none;
  }

  .phone-frame {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
    top: 0;
    left: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .phone-frame::before {
    display: none;
  }

  .phone-frame__notch {
    display: none;
  }

  .phone-frame__screen {
    border-radius: 0;
  }

  .nav {
    padding-top: env(safe-area-inset-top, 16px);
  }

  .progress-bar {
    bottom: calc(env(safe-area-inset-bottom, 16px) + 12px);
  }
}

/* ─── DESKTOP ENHANCEMENTS ─── */
@media (min-width: 768px) {
  .phone-frame {
    animation: phoneFloatIn 1s var(--ease-out-expo) forwards;
    animation-delay: 1.5s;
    opacity: 0;
  }

  @keyframes phoneFloatIn {
    from {
      opacity: 0;
      transform: translate(-50%, -48%) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
}

/* ─── HIGH DPI SCREENS ─── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .desktop-bg__noise {
    opacity: 0.02;
  }
}

/* ─── EXTRA POLISH ANIMATIONS ─── */

/* Screen entrance animations */
.screen {
  will-change: transform;
}

.screen__header--cyan {
  position: relative;
  overflow: hidden;
}

.screen__header--cyan::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(50%); }
}

/* Button hover micro-interactions */
.btn--primary::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--color-cyan-light) 0%, var(--color-cyan) 100%);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--duration-fast) var(--ease-out-quart);
}

.btn--primary:hover::after {
  opacity: 0.3;
}

/* Card hover effects */
.stat-card {
  transition: transform var(--duration-fast) var(--ease-out-quart),
              box-shadow var(--duration-fast) var(--ease-out-quart);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Scan viewport particles effect */
.scan-viewport::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, var(--color-cyan) 50%, transparent 50%),
    radial-gradient(2px 2px at 40% 70%, var(--color-green) 50%, transparent 50%),
    radial-gradient(1px 1px at 60% 40%, var(--color-cyan-light) 50%, transparent 50%),
    radial-gradient(2px 2px at 80% 60%, var(--color-green-light) 50%, transparent 50%);
  animation: particles 20s linear infinite;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

@keyframes particles {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

/* Gait callout connector lines */
.gait-callout::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 20px;
  height: 1px;
  background: var(--color-cyan);
  opacity: 0.5;
}

.gait-callout--head::before,
.gait-callout--hips::before,
.gait-callout--left-leg::before {
  right: -20px;
}

.gait-callout--shoulders::before,
.gait-callout--back::before,
.gait-callout--right-leg::before {
  left: -20px;
}

/* Phone frame inner glow */
.phone-frame__screen::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 60px rgba(42, 195, 224, 0.05);
  pointer-events: none;
  z-index: 100;
}

/* Results canvas glow effect */
.results-viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 50% at 50% 50%,
    transparent 0%,
    rgba(42, 195, 224, 0.08) 50%,
    transparent 100%
  );
  pointer-events: none;
  animation: resultGlow 4s ease-in-out infinite;
}

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

/* Toggle chip active state enhancement */
.toggle-chip--active {
  box-shadow: 0 4px 16px var(--color-cyan-glow);
}

/* Scan counter number animation */
.scan-counter__value {
  text-shadow: 0 0 20px var(--color-cyan-glow);
}

/* Nav button ripple effect */
.nav__back,
.nav__close {
  position: relative;
  overflow: hidden;
}

.nav__back::after,
.nav__close::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: all var(--duration-normal) var(--ease-out-expo);
}

.nav__back:active::after,
.nav__close:active::after {
  opacity: 1;
  transform: scale(2);
}

/* Focus states for accessibility */
.btn:focus-visible,
.toggle-chip:focus-visible,
.nav__back:focus-visible,
.nav__close:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
}

/* Progress dot hover states */
.progress-bar__dot {
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-quart);
}

.progress-bar__dot:hover {
  transform: scale(1.3);
}

/* Intro animation extra depth */
.intro-animation__phone::after {
  content: '';
  position: absolute;
  inset: -10px;
  background: radial-gradient(
    ellipse 80% 60% at 50% 100%,
    rgba(42, 195, 224, 0.2) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* Gait metric pulse animation */
.gait-metric__value {
  position: relative;
}

#fpsValue::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--color-green);
  border-radius: 50%;
  animation: livePulse 1s ease-in-out infinite;
  opacity: 0;
}

.gait-header__rec--visible ~ .gait-metrics #fpsValue::after {
  opacity: 1;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.5; transform: translateY(-50%) scale(0.8); }
}

/* Desktop corner logo */
@media (min-width: 768px) {
  .desktop-bg::after {
    content: '';
    position: fixed;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: url('./assets/nstar-logo.png') center/contain no-repeat;
    opacity: 0.15;
    filter: grayscale(100%);
    pointer-events: none;
  }
}

/* ═════════════════════════════════════════════════════════════════════
   V2 REBUILD — correct scan flow
   © 2026 NSTAR Solution LLP · Confidential
   ═════════════════════════════════════════════════════════════════════ */

/* ─── WELCOME VISUAL (Screen 1) ─── */
.welcome-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  min-height: 0;
}

.welcome-svg {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.welcome-svg__rays {
  animation: welcome-pulse 2.6s ease-in-out infinite;
  transform-origin: 150px 215px;
}

.welcome-svg__dots circle {
  animation: welcome-dot-fade 2.6s ease-in-out infinite;
}
.welcome-svg__dots circle:nth-child(1) { animation-delay: 0.0s; }
.welcome-svg__dots circle:nth-child(2) { animation-delay: 0.4s; }
.welcome-svg__dots circle:nth-child(3) { animation-delay: 0.8s; }
.welcome-svg__dots circle:nth-child(4) { animation-delay: 1.2s; }
.welcome-svg__dots circle:nth-child(5) { animation-delay: 1.6s; }

@keyframes welcome-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.85; }
}
@keyframes welcome-dot-fade {
  0%, 100% { opacity: 0.25; r: 1.5; }
  50%      { opacity: 1;    r: 2.8; }
}

/* ─── ENVIRONMENT CHECKLIST (Screen 1) ─── */
.checklist {
  padding: 0 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checklist__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(42, 195, 224, 0.07);
  border: 1px solid rgba(42, 195, 224, 0.18);
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}
.checklist__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cyan);
  color: #06141b;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.screen__footer-note {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 10px;
  letter-spacing: 0.3px;
}

/* ─── CAMERA VIEWPORT (Screens 2 & 3) ─── */
.screen--position,
.screen--scan {
  background: #000;
}

.camera-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  background: #000;
  min-height: 0;
}
.camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #06090f;
  transform: scaleX(1);
}
.camera-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ─── POSITION GUIDE OVERLAY (Screen 2) ─── */
.position-guide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.position-guide__svg {
  width: 68%;
  height: 86%;
  opacity: 0;
  animation: position-fade-in 500ms ease-out 300ms forwards;
}
.position-guide__path {
  animation: guide-dash 6s linear infinite;
}
@keyframes position-fade-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes guide-dash {
  to { stroke-dashoffset: -56; }
}

/* ─── QUALITY HUD PILLS (Screen 2) ─── */
.quality-hud {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  transition: opacity 400ms var(--ease-out-expo);
  pointer-events: none;
  z-index: 3;
}
.quality-hud--hidden {
  opacity: 0;
  pointer-events: none;
}
.quality-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--color-text-secondary);
}
.quality-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
  animation: pill-pulse 1.8s ease-in-out infinite;
}
@keyframes pill-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.quality-pill--good { border-color: rgba(76, 175, 80, 0.4); }

/* ─── PERMISSION CARD (Screen 2, before camera granted) ─── */
.permission-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: linear-gradient(180deg, rgba(10, 20, 30, 0.92) 0%, rgba(6, 10, 18, 0.98) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  transition: opacity 400ms var(--ease-out-expo);
  z-index: 5;
}
.permission-card--hidden {
  opacity: 0;
  pointer-events: none;
}
.permission-card__icon {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--color-cyan);
  background: rgba(42, 195, 224, 0.08);
  border: 1px solid rgba(42, 195, 224, 0.3);
  border-radius: 50%;
}
.permission-card__title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}
.permission-card__text {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  max-width: 280px;
  margin-bottom: 24px;
}
.permission-card__note {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 14px;
  letter-spacing: 0.2px;
}

/* ─── CAPTURE BUTTON (Screen 2) ─── */
.screen__footer--overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 24px 22px;
  background: linear-gradient(0deg, rgba(6, 10, 18, 0.85) 0%, rgba(6, 10, 18, 0) 100%);
  z-index: 4;
  pointer-events: none;
}
.screen__footer--overlay > * { pointer-events: auto; }

.btn--capture {
  width: 100%;
  background: var(--color-cyan);
  color: #06141b;
  padding: 16px 24px;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(42, 195, 224, 0.35);
  transition: all 250ms var(--ease-out-expo);
}
.btn--capture:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: not-allowed;
}
.btn--capture.btn--ready {
  animation: capture-ready 2.2s ease-in-out infinite;
}
.btn--capture .btn__inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #E53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}
@keyframes capture-ready {
  0%, 100% { box-shadow: 0 10px 30px rgba(42, 195, 224, 0.35); transform: scale(1); }
  50%      { box-shadow: 0 12px 40px rgba(42, 195, 224, 0.55); transform: scale(1.02); }
}

/* ─── SCAN OVERLAYS (Screen 3 — overrides earlier scan-hud position) ─── */
.screen--scan .scan-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  pointer-events: none;
  z-index: 3;
}
.screen--scan .scan-counter {
  align-self: flex-start;
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(42, 195, 224, 0.35);
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.screen--scan .scan-counter__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.screen--scan .scan-counter__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-cyan);
  letter-spacing: -0.01em;
  text-shadow: 0 0 16px rgba(42, 195, 224, 0.5);
}
.screen--scan .scan-progress {
  margin-top: auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.screen--scan .scan-progress__item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity 300ms;
}
.screen--scan .scan-progress__item--active,
.screen--scan .scan-progress__item--complete {
  opacity: 1;
}
.screen--scan .scan-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  transition: all 300ms;
}
.screen--scan .scan-progress__item--active .scan-progress__dot {
  background: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan);
  animation: dot-pulse 1s ease-in-out infinite;
}
.screen--scan .scan-progress__item--complete .scan-progress__dot {
  background: var(--color-green);
}
.screen--scan .scan-progress__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.1px;
  color: var(--color-text-secondary);
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.35); }
}

/* Scan line sweeping over the camera feed */
.screen--scan .scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(42, 195, 224, 0.2) 20%,
    var(--color-cyan) 50%,
    rgba(42, 195, 224, 0.2) 80%,
    transparent 100%);
  box-shadow: 0 0 24px var(--color-cyan), 0 0 50px rgba(42, 195, 224, 0.5);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}
.screen--scan .scan-line--active {
  animation: scan-sweep 2.4s ease-in-out infinite;
  opacity: 1;
}
@keyframes scan-sweep {
  0%   { top: 0;    opacity: 0; }
  10%  {            opacity: 1; }
  90%  {            opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.screen--scan .scan-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(42, 195, 224, 0.12) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
}

/* ─── RESULT HEADER SUB ─── */
.results-header__sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 4px;
  letter-spacing: 0.2px;
}

/* Ensure results-viewport has a sensible fixed height so canvas sizes correctly */
.screen--results .results-viewport {
  height: 260px;
  min-height: 260px;
  position: relative;
}
.screen--results .results-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--border-radius-lg);
}

/* ─── ACTIVE SCREEN STATE ─── */
.screen--active {
  /* Allows per-screen hooks when active; no layout changes needed */
}

/* ─── WELCOME SCREEN LAYOUT FIX ─── */
.screen--welcome {
  background: var(--color-bg-dark);
}
.screen--welcome .screen__header {
  padding: 62px 24px 26px;
}
.screen--welcome .screen__title { font-size: 26px; }
.screen--welcome .screen__subtitle { font-size: 14px; }

/* ─── MEDIA QUERIES ─── */
@media (max-width: 768px) {
  .welcome-svg { max-width: 220px; }
  .screen--results .results-viewport { height: 240px; min-height: 240px; }
}
