@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Inter:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ─── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --void:    #080611;
  --bg-0:    #0C0A1C;
  --bg-1:    #131028;
  --bg-2:    #1C1935;
  --bg-3:    #242142;
  --bg-4:    #2E2A52;

  /* Brand */
  --lavender:       #D0C8F0;
  --lavender-dim:   rgba(208, 200, 240, 0.12);
  --lavender-glow:  rgba(208, 200, 240, 0.18);
  --coral:          #F09080;
  --coral-dark:     #F08078;
  --coral-light:    #F0A080;
  --coral-glow:     rgba(240, 144, 128, 0.20);
  --amber:          #F8C880;
  --amber-dark:     #E87058;
  --purple:         #8B5CF6;
  --purple-light:   #A78BFA;
  --purple-dim:     rgba(139, 92, 246, 0.15);

  /* Glass */
  --glass-bg:       rgba(255, 255, 255, 0.035);
  --glass-border:   rgba(255, 255, 255, 0.07);
  --glass-lavender: rgba(208, 200, 240, 0.06);
  --glass-coral:    rgba(240, 144, 128, 0.08);

  /* Text */
  --text-primary:   #F2EEF8;
  --text-secondary: #A89EC4;
  --text-muted:     #6B6088;
  --text-disabled:  #3D3858;

  /* Semantic */
  --success:  #52D48A;
  --warning:  #F5A030;
  --error:    #F06060;
  --info:     #7088E8;

  /* Spacing */
  --safe-top:    44px;
  --safe-bottom: 34px;

  /* Radius */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 999px;

  /* Easing */
  --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-sin: cubic-bezier(0.37, 0, 0.63, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Shadows */
  --shadow-card:    0 2px 20px rgba(0,0,0,0.40), 0 1px 3px rgba(0,0,0,0.30);
  --shadow-float:   0 8px 40px rgba(0,0,0,0.50), 0 2px 8px rgba(0,0,0,0.30);
  --shadow-orb-idle:    0 0 60px rgba(208,200,240,0.12), 0 0 120px rgba(208,200,240,0.06);
  --shadow-orb-listen:  0 0 80px rgba(240,144,128,0.30), 0 0 160px rgba(240,144,128,0.12);
  --shadow-orb-think:   0 0 80px rgba(139, 92,246,0.28), 0 0 160px rgba(139, 92,246,0.10);
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #04030A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}

/* ─── DEVICE FRAME ───────────────────────────────────────── */
.device-frame {
  position: relative;
  width: 393px;
  height: 852px;
  background: var(--void);
  border-radius: 54px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 10px #0A0A10,
    0 0 0 11px rgba(255,255,255,0.04),
    0 30px 80px rgba(0,0,0,0.8),
    0 10px 30px rgba(0,0,0,0.6);
  flex-shrink: 0;
}

/* Dynamic island */
.device-frame::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 20px;
  z-index: 1000;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}

/* Home indicator */
.device-frame::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(255,255,255,0.28);
  border-radius: 3px;
  z-index: 1000;
}

/* ─── SCREEN SYSTEM ──────────────────────────────────────── */
.screen-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.45s var(--ease-out-expo),
    opacity 0.30s ease;
  will-change: transform, opacity;
  overflow: hidden;
}

.screen.active {
  transform: translateX(0);
  opacity: 1;
  z-index: 10;
  pointer-events: auto;
}

.screen.leaving {
  transform: translateX(-28px);
  opacity: 0;
  z-index: 5;
  transition:
    transform 0.40s var(--ease-in-out-sin),
    opacity 0.30s ease;
}

.screen.entering-back {
  transform: translateX(-100%);
}

/* ─── STATUS BAR ─────────────────────────────────────────── */
.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
  pointer-events: none;
}

.status-bar .time {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.status-bar .status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-bar .status-icons svg {
  color: var(--text-primary);
  opacity: 0.9;
}

/* ─── NOISE TEXTURE ──────────────────────────────────────── */
.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 1;
}

/* ─── SCREEN: SPLASH ─────────────────────────────────────── */
#screen-splash {
  background: var(--void);
  align-items: center;
  justify-content: center;
}

.splash-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(139, 92, 246, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 30% 70%, rgba(208, 200, 240, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 30% 25% at 75% 65%, rgba(240, 144, 128, 0.06) 0%, transparent 60%);
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 0 40px;
}

.splash-logo-wrap {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.splash-logo-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 32px rgba(139, 92, 246, 0.40));
  animation: lightningFast 2s infinite ease-in-out;
  transform-origin: bottom center;
}

.splash-wordmark {
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(240, 144, 128, 0.18));
}

@keyframes lightningFast {
  0%, 100% {
    transform: translateY(0) scale(1) rotate(0deg);
    filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.35)) drop-shadow(0 0 8px rgba(240, 144, 128, 0.15));
  }
  /* Snappy high-frequency electric shake/vibration */
  4% {
    transform: translateY(-1px) scale(1.03) rotate(-1deg);
    filter: drop-shadow(0 0 36px rgba(240, 144, 128, 0.6)) drop-shadow(0 0 12px rgba(139, 92, 246, 0.4));
  }
  6% {
    transform: translateY(1px) scale(0.97) rotate(1deg);
    filter: drop-shadow(0 0 28px rgba(139, 92, 246, 0.5)) drop-shadow(0 0 10px rgba(240, 144, 128, 0.3));
  }
  8% {
    transform: translateY(-1px) scale(1) rotate(0deg);
  }
  10% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  /* Sudden vertical speed surge ("lightning launch") */
  28% {
    transform: translateY(-20px) scaleY(1.14) scaleX(0.86);
    filter: drop-shadow(0 0 48px rgba(139, 92, 246, 0.75)) drop-shadow(0 0 22px rgba(240, 144, 128, 0.55));
  }
  /* Ultra-snappy descent and bounce settlement */
  33% {
    transform: translateY(0) scaleY(0.92) scaleX(1.08);
  }
  37% {
    transform: translateY(-5px) scaleY(1.03) scaleX(0.97);
  }
  40% {
    transform: translateY(0) scale(1);
  }
  /* Secondary high-frequency electric pulse */
  62% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.35));
  }
  64% {
    transform: translateY(-1px) scale(1.02) rotate(0.5deg);
    filter: drop-shadow(0 0 32px rgba(240, 144, 128, 0.5)) drop-shadow(0 0 12px rgba(139, 92, 246, 0.4));
  }
  66% {
    transform: translateY(0) scale(0.98) rotate(-0.5deg);
  }
  68% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.splash-tagline {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 64px;
  letter-spacing: 0.1px;
}

.splash-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  border-radius: var(--r-full);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition:
    transform 0.14s var(--ease-spring),
    box-shadow 0.2s ease,
    opacity 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
  border-radius: inherit;
}

.btn:active::after { background: rgba(255,255,255,0.08); }
.btn:active         { transform: scale(0.97); }

.btn-primary {
  height: 56px;
  padding: 0 28px;
  font-size: 16px;
  background: linear-gradient(135deg, var(--coral-dark) 0%, var(--coral) 50%, var(--coral-light) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(240,144,128,0.35), 0 1px 4px rgba(0,0,0,0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(240,144,128,0.45), 0 2px 6px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  height: 52px;
  padding: 0 28px;
  font-size: 15px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #8170E2;
  backdrop-filter: blur(12px);
}

#screen-onboarding {
  background: var(--bg-0);
}

.onboarding-header {
  padding: 64px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.onboarding-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, opacity 0.3s, visibility 0.3s;
  opacity: 0;
  visibility: hidden;
}

.onboarding-back:hover {
  color: var(--text-secondary);
}

.onboarding-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 73px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.onboarding-dot {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-3);
  transition: width 0.4s var(--ease-out-expo), background 0.3s;
}

.onboarding-dot.active {
  width: 24px;
  background: var(--coral);
}

.onboarding-dot:not(.active) { width: 6px; }

.onboarding-skip {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.onboarding-skip:hover { color: var(--text-secondary); }

.onboarding-illustration-viewport {
  width: 100%;
  height: 280px;
  overflow: hidden;
  position: relative;
  margin-top: 10px;
  flex-shrink: 0;
}

.onboarding-illustration-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.62s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.onboarding-illustration-slide {
  width: 33.3333%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.onboarding-illustration-slide img {
  height: 220px;
  width: auto;
  max-width: 85%;
  object-fit: contain;
}

.onboarding-slides {
  flex: 1;
  overflow: hidden;
  position: relative;
  margin-top: 8px;
}

.onboarding-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 32px 0;
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.4s ease,
    transform 0.4s var(--ease-out-expo);
  pointer-events: none;
}

.onboarding-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.onboarding-slide.leaving {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.3s ease,
    transform 0.3s var(--ease-in-out-sin);
}

.onboarding-title {
  font-family: 'Nunito', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.24;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.onboarding-body {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  font-weight: 400;
  max-width: 290px;
}

.onboarding-features {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
}

.feature-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-dot.coral { background: var(--glass-coral); }
.feature-dot.lavender { background: var(--lavender-dim); }
.feature-dot.purple { background: var(--purple-dim); }

.feature-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.35;
}

.onboarding-footer {
  padding: 16px 28px 36px;
  flex-shrink: 0;
}

/* ─── SCREEN: PROVIDER PREVIEW ───────────────────────────── */
#screen-preview {
  background: var(--bg-0);
  align-items: center;
}

.preview-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(139,92,246,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 30% at 50% 100%, rgba(240,144,128,0.10) 0%, transparent 60%);
}

.preview-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 28px 0;
  flex: 1;
  width: 100%;
}

.preview-icon-wrap {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.preview-icon-wrap img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(208,200,240,0.3));
}

.preview-title {
  font-family: 'Nunito', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
}

.preview-sub {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
  max-width: 260px;
  margin-bottom: 36px;
}

.doctor-avatars {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.doctor-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.doctor-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.08);
  overflow: hidden;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
}

.doctor-avatar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.doctor-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-count {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.preview-count span {
  color: var(--coral);
  font-weight: 600;
}

.preview-footer {
  padding: 20px 28px 50px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── SCREEN: HOME ───────────────────────────────────────── */
#screen-home {
  background: var(--bg-0);
}

.home-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 25%, rgba(139, 92, 246, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 15% 75%, rgba(208, 200, 240, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 85% 60%, rgba(240, 144, 128, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.home-header {
  padding: 60px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-brand img {
  height: 28px;
  object-fit: contain;
}

.home-greeting {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.1px;
}

.home-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple) 0%, var(--coral) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(139,92,246,0.3);
  letter-spacing: -0.3px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.16);
}

.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 24px 0;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

/* ─── AI ORB ─────────────────────────────────────────────── */
.orb-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 32px;
  cursor: pointer;
  flex-shrink: 0;
}

.orb-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(208,200,240,0.12) 0%, transparent 70%);
  animation: orbBreath 4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  pointer-events: none;
}

.orb-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(208,200,240,0.3) 20%,
    rgba(240,144,128,0.2) 50%,
    rgba(208,200,240,0.3) 80%,
    transparent 100%
  );
  animation: orbSpin 8s linear infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(235, 225, 255, 0.16) 30%,
    rgba(139, 92, 246, 0.06) 65%,
    rgba(139, 92, 246, 0.18) 100%
  );
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 35px rgba(139, 92, 246, 0.15),
    inset 0 4px 12px rgba(255,255,255,0.25),
    inset 0 -4px 12px rgba(0,0,0,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: orbBreath 4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes orbBreath {
  0%, 100% { transform: scale(1.000); }
  50%       { transform: scale(1.035); }
}

@keyframes orbSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Waveform inside orb */
.orb-waveform {
  display: flex;
  gap: 3.5px;
  align-items: center;
  height: 48px;
  opacity: 0.9;
}

.wv-bar {
  width: 3.5px;
  border-radius: 3px;
  background: linear-gradient(to top, var(--coral-dark), var(--coral-light));
  animation: wvIdle 2.2s ease-in-out infinite;
}

/* Perfect Symmetrical heights and delays around center child (6) */
.wv-bar:nth-child(2) { height: 8px;  animation-delay: 0.4s; }
.wv-bar:nth-child(3) { height: 14px; animation-delay: 0.3s; }
.wv-bar:nth-child(4) { height: 22px; animation-delay: 0.2s; }
.wv-bar:nth-child(5) { height: 30px; animation-delay: 0.1s; }
.wv-bar:nth-child(6) { height: 38px; animation-delay: 0.0s; } /* Center child */
.wv-bar:nth-child(7) { height: 30px; animation-delay: 0.1s; }
.wv-bar:nth-child(8) { height: 22px; animation-delay: 0.2s; }
.wv-bar:nth-child(9) { height: 14px; animation-delay: 0.3s; }
.wv-bar:nth-child(10) { height: 8px;  animation-delay: 0.4s; }

/* Left/right dots like the logo */
.wv-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.wv-dot:first-of-type {
  background: var(--coral-dark);
  margin-right: -1px; /* Pull closer to eliminate visible gap */
}

.wv-dot:last-of-type {
  background: var(--coral-light); /* Matches the peach gradient end of the waveform */
  margin-left: -1px; /* Pull closer to eliminate visible gap */
}

@keyframes wvIdle {
  0%, 100% { transform: scaleY(0.65); opacity: 0.75; }
  50%       { transform: scaleY(1.00); opacity: 1.00; }
}

/* Conic gradient reverse swirling secondary ring */
.orb-ring-2 {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    transparent 0%,
    rgba(240,144,128,0.35) 25%,
    rgba(208,200,240,0.08) 50%,
    rgba(240,144,128,0.35) 75%,
    transparent 100%
  );
  animation: orbSpin 4.5s linear infinite reverse;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

/* Sparkling AI Stars */
.ai-star {
  position: absolute;
  color: rgba(255, 255, 255, 0.95);
  font-size: 11px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px var(--lavender);
  pointer-events: none;
  opacity: 0;
  scale: 0;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.star-1 { top: 12%; left: 16%; }
.star-2 { top: 22%; right: 12%; }
.star-3 { bottom: 18%; left: 14%; }
.star-4 { bottom: 26%; right: 16%; }

/* Listening state — orb + bars animate to audio */
.orb-container.state-listening .orb-glow {
  background: radial-gradient(circle, rgba(240,144,128,0.25) 0%, transparent 70%);
  animation-duration: 1.2s;
}

.orb-container.state-listening .orb-ring {
  opacity: 1;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(240,144,128,0.5) 25%,
    rgba(240,160,128,0.3) 50%,
    rgba(240,144,128,0.5) 75%,
    transparent 100%
  );
  animation-duration: 2.2s;
}

.orb-container.state-listening .orb-ring-2 {
  opacity: 1;
}

.orb-container.state-listening .orb-core {
  background: radial-gradient(circle at 35% 30%,
    rgba(255, 235, 230, 0.35) 0%,
    rgba(255, 200, 185, 0.22) 30%,
    rgba(240, 144, 128, 0.12) 65%,
    rgba(240, 144, 128, 0.28) 100%
  );
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 0 45px rgba(240, 144, 128, 0.35),
    inset 0 4px 12px rgba(255,255,255,0.40),
    inset 0 -4px 12px rgba(0,0,0,0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  animation-duration: 0.8s;
}

.orb-container.state-listening .wv-bar {
  background: linear-gradient(to top, #FF7B60, #FFAE99);
  animation-name: wvListen;
  animation-duration: 0.5s;
}

.orb-container.state-listening .wv-dot:first-of-type {
  background: #FF7B60;
}

.orb-container.state-listening .wv-dot:last-of-type {
  background: #FFAE99;
}

.orb-container.state-listening .ai-star {
  opacity: 1;
  scale: 1;
}

.orb-container.state-listening .star-1 { animation: starSparkle1 2s ease-in-out infinite alternate; }
.orb-container.state-listening .star-2 { animation: starSparkle2 2.4s ease-in-out infinite alternate; }
.orb-container.state-listening .star-3 { animation: starSparkle3 1.8s ease-in-out infinite alternate; }
.orb-container.state-listening .star-4 { animation: starSparkle4 2.2s ease-in-out infinite alternate; }

@keyframes starSparkle1 {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0.3; }
  50%  { transform: translate(-10px, -15px) scale(1.4); opacity: 1.0; }
  100% { transform: translate(-5px, -8px) scale(0.9); opacity: 0.6; }
}
@keyframes starSparkle2 {
  0%   { transform: translate(0, 0) scale(0.8); opacity: 0.5; }
  50%  { transform: translate(15px, -10px) scale(1.5); opacity: 1.0; }
  100% { transform: translate(7px, -5px) scale(0.8); opacity: 0.4; }
}
@keyframes starSparkle3 {
  0%   { transform: translate(0, 0) scale(0.7); opacity: 0.4; }
  50%  { transform: translate(-12px, 12px) scale(1.3); opacity: 1.0; }
  100% { transform: translate(-6px, 6px) scale(0.9); opacity: 0.5; }
}
@keyframes starSparkle4 {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0.3; }
  50%  { transform: translate(10px, 15px) scale(1.6); opacity: 1.0; }
  100% { transform: translate(5px, 8px) scale(0.7); opacity: 0.4; }
}

@keyframes wvListen {
  0%, 100% { transform: scaleY(0.40); }
  50%       { transform: scaleY(1.35); }
}

/* Thinking state */
.orb-container.state-thinking .orb-glow {
  background: radial-gradient(circle, rgba(139,92,246,0.20) 0%, transparent 70%);
  animation-duration: 2s;
}

.orb-container.state-thinking .orb-ring {
  opacity: 1;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(139,92,246,0.5) 25%,
    rgba(167,139,250,0.4) 60%,
    transparent 100%
  );
  animation-duration: 1.5s;
}

.orb-container.state-thinking .orb-core {
  background: radial-gradient(circle at 38% 32%,
    rgba(220, 210, 255, 0.98) 0%,
    rgba(180, 160, 240, 0.95) 28%,
    rgba(140, 115, 220, 0.90) 58%,
    rgba(100, 80, 190, 0.85) 82%,
    rgba(80, 60, 175, 0.80) 100%
  );
  box-shadow: var(--shadow-orb-think),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 8px rgba(0,0,0,0.2);
}

.orb-container.state-thinking .wv-bar {
  animation-name: wvThink;
  animation-duration: 1.4s;
}

@keyframes wvThink {
  0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
  50%       { transform: scaleY(0.9); opacity: 0.8; }
}

/* ─── HOME: AI TEXT + PROMPT ─────────────────────────────── */
.ai-greeting-text {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 600; /* Reduced font weight so the query card dominates */
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: none; /* No shadow/glow competing with the query card */
  transition: opacity 0.3s ease;
}

.ai-sub-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 28px;
  transition: opacity 0.3s ease;
  max-width: 240px;
}

/* ─── TRANSCRIPT DISPLAY ─────────────────────────────────── */
.transcript-area {
  min-height: 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 300px;
}

.transcript-text {
  font-size: 18px; /* Increased size for visual prominence */
  font-weight: 600; /* Increased weight */
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4), 0 0 24px var(--lavender); /* Glowing live transcript */
  text-align: center;
  line-height: 1.5;
  font-style: normal;
  letter-spacing: -0.2px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(6px);
}

.transcript-text.visible { 
  opacity: 1; 
  transform: translateY(0);
}

/* ─── LIVE INTERPRETED KEYWORD HIGHLIGHT ─────────── */
.highlight-keyword {
  color: var(--coral-light) !important;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(240, 144, 128, 0.6); /* Glowing coral keyword */
  animation: keywordPulse 1.2s ease-in-out infinite alternate;
  display: inline-block;
}

@keyframes keywordPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* ─── DYNAMIC SEMANTIC EXTRACTION TAGS ───────────── */
.extraction-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
  max-width: 320px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.extraction-chips-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.extraction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(129, 112, 226, 0.12);
  border: 1px solid rgba(129, 112, 226, 0.3);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-full);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: chipArrival 0.4s var(--ease-spring) forwards;
}

.extraction-chip svg {
  color: var(--coral-light);
  flex-shrink: 0;
}

@keyframes chipArrival {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.transcript-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--coral);
  border-radius: 1px;
  margin-left: 2px;
  animation: cursorBlink 0.8s step-end infinite;
  vertical-align: middle;
}

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

/* ─── QUICK CHIPS ────────────────────────────────────────── */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  padding: 0 4px;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              margin-top 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              margin-bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              padding-top 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              padding-bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  transform: translateY(0);
  max-height: 120px;
  pointer-events: auto;
  visibility: visible;
  overflow: visible;
}

.chip-row.not-idle {
  opacity: 0 !important;
  transform: translateY(12px) !important;
  max-height: 0px !important;
  margin-top: 0px !important;
  margin-bottom: 0px !important;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
  pointer-events: none !important;
  visibility: hidden !important;
  overflow: hidden !important;
}

.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.chip:hover {
  border-color: rgba(208, 200, 240, 0.25);
  color: var(--lavender);
  background: var(--lavender-dim);
}

.chip:active { transform: scale(0.95); }

.chip-icon-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: #8170E2;
  transition: stroke 0.18s ease;
}

.chip:hover .chip-icon-svg {
  stroke: var(--lavender);
}

/* ─── CHAT INPUT BAR ─────────────────────────────────────── */
.input-bar {
  width: 100%;
  padding: 0 16px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.input-field-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 0 16px;
  height: 50px;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.input-field-wrap:focus-within {
  border-color: rgba(208,200,240,0.3);
}

.input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  caret-color: var(--coral);
}

.input-field::placeholder { color: var(--text-muted); }

.mic-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--coral-dark), var(--coral-light));
  box-shadow: 0 4px 16px rgba(240,144,128,0.4);
  transition: all 0.18s var(--ease-spring);
  flex-shrink: 0;
}

.mic-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 22px rgba(240,144,128,0.5);
}

.mic-btn:active { transform: scale(0.94); }

.mic-btn.recording {
  background: linear-gradient(135deg, #F06060, #F09080);
  animation: micPulse 1.2s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(240,96,96,0.4), 0 0 0 0 rgba(240,96,96,0.3); }
  50%       { box-shadow: 0 6px 22px rgba(240,96,96,0.5), 0 0 0 12px rgba(240,96,96,0); }
}

/* ─── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  align-items: center;
  padding: 10px 8px 32px;
  background: linear-gradient(to top, var(--bg-0) 70%, transparent);
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: var(--r-lg);
  transition: all 0.18s ease;
}

.nav-item:active { transform: scale(0.92); }

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-disabled);
  transition: color 0.2s, transform 0.2s var(--ease-spring);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  color: var(--text-disabled);
  transition: color 0.2s;
  letter-spacing: 0.2px;
}

.nav-item.active .nav-icon {
  color: var(--coral);
  transform: scale(1.1);
}

.nav-item.active .nav-label { color: var(--coral); }

/* ─── PROVIDER CARDS ─────────────────────────────────────── */
.results-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.results-container::-webkit-scrollbar { display: none; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 4px;
  flex-shrink: 0;
}

.results-title {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1px;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
}

.provider-card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-spring),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: var(--shadow-card);
  transform: translateY(24px);
  opacity: 0;
  animation: cardIn 0.5s var(--ease-out-expo) forwards;
}

.provider-card:hover {
  border-color: rgba(208, 200, 240, 0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(208,200,240,0.08);
}

.provider-card:active { transform: scale(0.985); }

@keyframes cardIn {
  to { transform: translateY(0); opacity: 1; }
}

/* ─── TRUST LAYER MICRO-SIGNALS ──────────────────── */
.verified-icon {
  display: inline-block;
  color: var(--teal-light);
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.4));
  vertical-align: middle;
}

.card-trust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 7px;
  border-radius: var(--r-full);
  letter-spacing: 0.1px;
}

.trust-pill.speed {
  background: rgba(129, 112, 226, 0.08);
  border: 1px solid rgba(129, 112, 226, 0.15);
  color: var(--lavender);
}

.trust-pill.avail {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.15);
  color: var(--teal-light);
}

.pulse-dot-green {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-light);
  box-shadow: 0 0 6px var(--teal-light);
  animation: pulseTealDot 1.5s infinite ease-in-out;
  display: inline-block;
}

@keyframes pulseTealDot {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 4px var(--teal-light); }
  50% { transform: scale(1.4); opacity: 0.6; box-shadow: 0 0 8px var(--teal-light); }
}

/* ─── DYNAMIC CONFIDENCE EVOLUTION BADGES ────────── */
.ai-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.ai-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(129, 112, 226, 0.2) 0%, rgba(240, 144, 128, 0.15) 100%);
  border: 1px solid rgba(129, 112, 226, 0.35);
  color: var(--lavender);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(129, 112, 226, 0.15);
}

.ai-badge-tag .pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral-light);
  animation: badgeDotPulse 1.5s infinite ease-in-out;
}

@keyframes badgeDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 4px var(--coral-light); }
  50% { transform: scale(1.4); opacity: 0.6; box-shadow: 0 0 8px var(--coral-light); }
}

.ai-badge-confidence {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* ─── RECOMMENDATION HIERARCHY & STREAMING ARRIVAL ─ */
/* Best Match Card differentiation */
.provider-card.best-match-card {
  background: linear-gradient(135deg, rgba(20, 18, 30, 0.95) 0%, rgba(30, 24, 52, 0.95) 100%);
  border: 1px solid rgba(129, 112, 226, 0.35);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(129, 112, 226, 0.18);
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Secondary Cards emphasis reduction */
.provider-card.secondary-card {
  background: rgba(20, 18, 30, 0.58) !important;
  border: 1px solid rgba(255, 255, 255, 0.02) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
  opacity: 0.8 !important;
}

.provider-card.secondary-card:hover {
  opacity: 1 !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3) !important;
}

@keyframes streamCardArrivalBest {
  0% {
    border-color: rgba(129, 112, 226, 0.9);
    box-shadow: 0 0 24px rgba(129, 112, 226, 0.5), 0 0 0 1px rgba(129, 112, 226, 0.4);
    transform: translateY(12px) scale(0.99);
    opacity: 0;
  }
  15% {
    border-color: rgba(129, 112, 226, 0.9);
    box-shadow: 0 0 24px rgba(129, 112, 226, 0.5), 0 0 0 1px rgba(129, 112, 226, 0.4);
    transform: translateY(-4px) scale(1.03);
    opacity: 1;
  }
  100% {
    border-color: rgba(129, 112, 226, 0.35);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(129, 112, 226, 0.18);
    transform: translateY(-4px) scale(1.025);
    opacity: 1;
  }
}

@keyframes streamCardArrivalSecondary {
  0% {
    border-color: rgba(255,255,255,0.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(12px) scale(0.95);
    opacity: 0;
  }
  15% {
    border-color: rgba(255,255,255,0.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(0) scale(0.975);
    opacity: 0.8;
  }
  100% {
    border-color: rgba(255, 255, 255, 0.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(0) scale(0.975);
    opacity: 0.8;
  }
}

.provider-card.best-match-card.streaming-arrival {
  animation: streamCardArrivalBest 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.provider-card.secondary-card.streaming-arrival {
  animation: streamCardArrivalSecondary 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* AI Rationale Box Styling */
.ai-rationale-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(240, 144, 128, 0.08);
  border: 1px dashed rgba(240, 144, 128, 0.22);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin: 12px 0 16px;
  box-shadow: 0 0 12px rgba(240, 144, 128, 0.03);
}

.ai-rationale-text {
  font-size: 11.5px;
  color: #FFAE99;
  line-height: 1.45;
  font-weight: 500;
  text-align: left;
}

.ai-rationale-text strong {
  color: var(--coral-light);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(240, 144, 128, 0.2);
}

/* Pulsing Best Match tag accentuation */
.best-match-card .ai-badge-tag {
  background: linear-gradient(135deg, rgba(240, 144, 128, 0.28) 0%, rgba(129, 112, 226, 0.22) 100%);
  border: 1px solid rgba(240, 144, 128, 0.45);
  color: var(--coral-light) !important;
  box-shadow: 0 0 12px rgba(240, 144, 128, 0.28);
}
.best-match-card .ai-badge-tag .pulse-dot {
  background: var(--coral-light) !important;
  box-shadow: 0 0 8px var(--coral-light) !important;
}

.card-top {
  display: flex;
  gap: 13px;
  margin-bottom: 12px;
}

.card-avatar-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.card-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.avatar-avail-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-1);
}

.card-info { flex: 1; }

.card-name {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}

.card-specialty {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 400;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--amber);
}

.card-distance {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-disabled);
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tag {
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
}

.tag.teal {
  background: rgba(82, 212, 138, 0.1);
  color: var(--success);
  border: 1px solid rgba(82, 212, 138, 0.2);
}

.tag.lavender {
  background: var(--lavender-dim);
  color: var(--lavender);
  border: 1px solid rgba(208, 200, 240, 0.15);
}

.tag.coral {
  background: var(--glass-coral);
  color: var(--coral);
  border: 1px solid rgba(240,144,128,0.2);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-btn {
  flex: 1;
  height: 40px;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.16s var(--ease-spring);
}

.card-btn:active { transform: scale(0.95); }

.card-btn.call {
  background: linear-gradient(135deg, var(--coral-dark), var(--coral-light));
  color: #fff;
  box-shadow: 0 3px 12px rgba(240,144,128,0.3);
}

.card-btn.book {
  background: var(--bg-3);
  color: #8170E2;
  border: 1px solid rgba(129, 112, 226, 0.2);
}

.card-btn.call:hover {
  box-shadow: 0 4px 18px rgba(240,144,128,0.45);
  transform: translateY(-1px);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-2) 0%,
    var(--bg-3) 50%,
    var(--bg-2) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

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

.skeleton-card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--r-lg);
  padding: 16px;
  animation: cardIn 0.4s var(--ease-out-expo) forwards;
}

/* ─── SCREEN: PROVIDER DETAIL ────────────────────────────── */
#screen-detail {
  background: var(--bg-0);
}

.detail-hero {
  position: relative;
  padding: 60px 24px 24px;
  background: linear-gradient(180deg, rgba(139,92,246,0.12) 0%, transparent 100%);
  flex-shrink: 0;
}

.detail-back {
  position: absolute;
  top: 62px;
  left: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.detail-back:hover { background: var(--bg-3); color: var(--text-primary); }
.detail-back:active { transform: scale(0.9); }

.detail-provider-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-left: 44px;
}

.detail-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.07);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  overflow: hidden;
}

.detail-name {
  font-family: 'Nunito', sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.15;
  margin-bottom: 4px;
}

.detail-specialty {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rating-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(248, 200, 128, 0.12);
  border: 1px solid rgba(248, 200, 128, 0.2);
  border-radius: 8px;
  padding: 3px 8px;
}

.rating-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
}

.rating-count {
  font-size: 12px;
  color: var(--text-muted);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 16px;
  scrollbar-width: none;
}

.detail-body::-webkit-scrollbar { display: none; }

.detail-section {
  margin-bottom: 16px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.detail-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-md);
  margin-bottom: 6px;
}

.detail-info-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.detail-info-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.detail-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
}

.detail-slot-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.slot-chip {
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
  background: var(--bg-1);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.slot-chip.selected {
  border-color: var(--coral);
  background: var(--glass-coral);
  color: var(--coral);
}

.slot-chip:hover { border-color: rgba(208,200,240,0.3); }

.detail-actions {
  padding: 12px 20px 40px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── SCREEN: CALLING ────────────────────────────────────── */
#screen-calling {
  background: var(--void);
  align-items: center;
  justify-content: flex-start;
}

.calling-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(240,144,128,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 80%, rgba(139,92,246,0.10) 0%, transparent 60%);
}

.calling-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 40px 0;
  flex: 1;
  width: 100%;
}

.calling-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  margin-bottom: 24px;
  border: 2px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-float);
  position: relative;
  overflow: hidden;
}

.calling-pulse-ring {
  position: absolute;
  inset: -16px;
  border-radius: 56px;
  border: 1.5px solid rgba(240,144,128,0.3);
  animation: pulseRing 2s ease-out infinite;
}

.calling-pulse-ring-2 {
  animation-delay: 0.7s;
}

.calling-pulse-ring-3 {
  animation-delay: 1.4s;
}

@keyframes pulseRing {
  0%   { transform: scale(1.00); opacity: 0.6; }
  100% { transform: scale(1.50); opacity: 0.0; }
}

.calling-name {
  font-family: 'Nunito', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.calling-specialty {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
}

.calling-status {
  font-size: 14px;
  color: var(--coral-light);
  text-align: center;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.calling-dots span {
  display: inline-block;
  animation: dotBounce 1.4s ease-in-out infinite;
}

.calling-dots span:nth-child(1) { animation-delay: 0.0s; }
.calling-dots span:nth-child(2) { animation-delay: 0.2s; }
.calling-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%            { transform: translateY(-4px); }
}

.calling-timer {
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 4px;
}

.call-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding: 40px 40px 120px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.call-ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.call-ctrl-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ease-spring);
}

.call-ctrl-icon:active { transform: scale(0.9); }

.call-ctrl-icon.mute {
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.call-ctrl-icon.speaker {
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.call-ctrl-icon.end {
  width: 72px;
  height: 72px;
  background: #E85858;
  color: #fff;
  box-shadow: 0 4px 20px rgba(232, 88, 88, 0.4);
}

.call-ctrl-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ─── SCREEN: CONFIRMATION ───────────────────────────────── */
#screen-confirm {
  background: var(--bg-0);
  align-items: center;
}

.confirm-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(82,212,138,0.12) 0%, transparent 70%);
}

.confirm-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 28px 0;
  flex: 1;
  width: 100%;
}

.confirm-check {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(82, 212, 138, 0.12);
  border: 2px solid rgba(82, 212, 138, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  animation: checkPop 0.5s var(--ease-spring) forwards;
}

@keyframes checkPop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1.0); opacity: 1; }
}

.confirm-title {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.confirm-sub {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.55;
  max-width: 260px;
  margin-bottom: 40px;
}

.confirm-card {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.confirm-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.confirm-card-row:last-child { margin-bottom: 0; }

.confirm-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.confirm-item-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.confirm-item-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
}

.confirm-footer {
  padding: 0 28px 50px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── SCREEN: APPOINTMENTS ───────────────────────────────── */
#screen-appointments {
  background: var(--bg-0);
}

.appointments-header {
  padding: 60px 24px 16px;
  flex-shrink: 0;
}

.page-title {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tab-row {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}

.tab-pill {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
}

.tab-pill.active {
  background: var(--glass-coral);
  border-color: rgba(240,144,128,0.3);
  color: var(--coral);
}

.appt-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}

.appt-list::-webkit-scrollbar { display: none; }

.appt-card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.18s ease;
}

.appt-card:hover { border-color: rgba(208,200,240,0.15); }

.appt-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.appt-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.appt-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.appt-status.upcoming .appt-status-dot { background: var(--success); }
.appt-status.upcoming { color: var(--success); }
.appt-status.past .appt-status-dot { background: var(--text-muted); }
.appt-status.past { color: var(--text-muted); }

.appt-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
}

.appt-card-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.appt-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}

.appt-name {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.appt-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.appt-time-badge {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--lavender-dim);
  border: 1px solid rgba(208,200,240,0.15);
  font-size: 12px;
  font-weight: 600;
  color: var(--lavender);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── SCREEN: SETTINGS ───────────────────────────────────── */
#screen-settings {
  background: var(--bg-0);
}

.settings-header {
  padding: 60px 24px 24px;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-xl);
  margin-bottom: 24px;
  margin: 0 16px 24px;
}

.settings-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple) 0%, var(--coral) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.18);
}

.settings-user-name {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.settings-user-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.settings-section {
  padding: 0 16px;
  margin-bottom: 20px;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.settings-row {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  background: var(--bg-1);
  border-bottom: 1px solid rgba(255,255,255,0.035);
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}

.settings-row:first-of-type { border-radius: var(--r-md) var(--r-md) 0 0; }
.settings-row:last-of-type {
  border-bottom: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.settings-row:only-of-type { border-radius: var(--r-md); border-bottom: none; }

.settings-row:hover { background: var(--bg-2); }
.settings-row:active { background: var(--bg-3); }

.settings-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.settings-row-icon.coral { background: var(--glass-coral); }
.settings-row-icon.lavender { background: var(--lavender-dim); }
.settings-row-icon.purple { background: var(--purple-dim); }
.settings-row-icon.teal { background: rgba(82,212,138,0.08); }

.settings-row-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-row-value {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.toggle {
  width: 44px;
  height: 26px;
  border-radius: var(--r-full);
  background: var(--bg-3);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--coral); }

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.25s var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle.on::after { transform: translateX(18px); }

/* ─── LOADING STATE ──────────────────────────────────────── */
.ai-thinking-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 16px;
}

.think-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--purple-light);
  animation: thinkPulse 1.4s ease-in-out infinite;
}

.think-dot:nth-child(2) { animation-delay: 0.2s; }
.think-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%            { opacity: 1.0; transform: scale(1.2); }
}

/* ─── SCROLLABLE HOME BODY ───────────────────────────────── */
.home-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}

.home-scroll-body::-webkit-scrollbar { display: none; }

/* ─── SEARCH RESULTS SECTION ─────────────────────────────── */
.result-ai-bubble {
  background: linear-gradient(135deg, rgba(129, 112, 226, 0.18) 0%, rgba(20, 20, 25, 0.8) 100%);
  border: 1.5px solid rgba(129, 112, 226, 0.38); /* Lavender border for heavy query card emphasis */
  box-shadow: 0 8px 32px 0 rgba(129, 112, 226, 0.2), 0 0 16px 0 rgba(129, 112, 226, 0.15); /* Stronger glow & emphasis */
  backdrop-filter: blur(12px);
  border-radius: 20px 20px 20px 6px;
  padding: 16px 20px;
  margin: 0 16px 20px;
  font-size: 14.5px;
  color: var(--text-primary); /* High contrast text to make query card dominate */
  line-height: 1.55;
  font-weight: 500;
  position: relative;
}

.result-ai-bubble::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  background: rgba(129, 112, 226, 0.18);
  border-left: 1.5px solid rgba(129, 112, 226, 0.38);
  border-bottom: 1.5px solid rgba(129, 112, 226, 0.38);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

/* ─── HOME ORB SECTION ───────────────────────────────────── */
.orb-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px 0;
  flex-shrink: 0;
}

/* ─── MISC ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 0 16px;
  flex-shrink: 0;
}

.section-label {
  padding: 16px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* Responsive: scale down on smaller screens */
@media (max-height: 880px) {
  .device-frame {
    height: calc(100vh - 40px);
    width: calc((100vh - 40px) * 393 / 852);
  }
}

@media (max-width: 440px) {
  .device-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .device-frame::before, .device-frame::after { display: none; }

  /* Hide simulated status bar on actual mobile devices */
  .status-bar {
    display: none !important;
  }

  /* Safe-area insets padding adjustments for all headers on real mobile devices */
  .onboarding-header {
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
  }
  .auth-header {
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
  }
  .home-header {
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
  }
  .detail-hero {
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
  }
  .detail-back {
    top: calc(14px + env(safe-area-inset-top)) !important;
  }
  .appointments-header {
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
  }
  .settings-header {
    padding-top: calc(16px + env(safe-area-inset-top)) !important;
  }
  .preview-content {
    padding-top: calc(36px + env(safe-area-inset-top)) !important;
  }
  .calling-content {
    padding-top: calc(56px + env(safe-area-inset-top)) !important;
  }
  .confirm-content {
    padding-top: calc(56px + env(safe-area-inset-top)) !important;
  }
}

/* ─── SCREEN: AUTHENTICATION & PERMISSIONS ──────────────── */
.auth-bg, .permissions-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 65% 55% at 50% 15%, rgba(131, 112, 226, 0.20) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 80% 80%, rgba(240, 144, 128, 0.05) 0%, transparent 60%);
}

.auth-header {
  padding: 64px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.auth-header .btn-icon {
  position: absolute;
  left: 24px;
  bottom: 12px;
  color: var(--text-muted);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
}

.auth-header .btn-icon:hover {
  color: var(--text-secondary);
}

.auth-header-title {
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.auth-content-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 10px 28px 40px;
}

.auth-logo-section {
  text-align: center;
  margin-top: 15px;
  margin-bottom: 30px;
}

.auth-logo-section img {
  height: 48px;
  object-fit: contain;
  margin-bottom: 16px;
}

.auth-logo-section h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.auth-logo-section p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 0 10px;
}

.auth-card {
  background: var(--bg-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 24px 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(8, 6, 17, 0.25);
  position: relative;
}

.input-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.phone-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  height: 48px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.phone-input-wrapper:focus-within {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.country-picker-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 15px;
  user-select: none;
  background: rgba(255, 255, 255, 0.015);
}

.phone-input-divider {
  width: 1px;
  height: 20px;
  background: var(--glass-border);
  flex-shrink: 0;
}

.phone-input-field-container {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
  padding: 0 14px;
  gap: 6px;
}

.country-code-prefix {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
}

.phone-input-actual {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  height: 100%;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
}

.phone-input-actual::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* OTP Sizing */
.otp-sub-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 20px;
}

.otp-box-container {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
}

.otp-box {
  width: calc(25% - 9px);
  height: 56px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  font-family: 'Nunito', sans-serif;
  transition: all 0.2s var(--ease-out-expo);
}

.otp-box:focus {
  outline: none;
  border-color: var(--purple-light);
  background: var(--bg-3);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
}

.resend-text {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Social Buttons */
.social-login-section {
  margin-top: 10px;
}

.social-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}

.social-divider::before, .social-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.social-divider:not(:empty)::before {
  margin-right: 16px;
}

.social-divider:not(:empty)::after {
  margin-left: 16px;
}

.social-buttons {
  display: flex;
  gap: 12px;
}

.social-btn {
  flex: 1;
  height: 48px;
  background: var(--bg-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.social-btn:hover {
  background: var(--bg-2);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Permission Cards styling */
.permission-icon-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--lavender-dim);
  border: 1.5px solid var(--lavender-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.permission-card {
  background: var(--bg-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 4px 16px rgba(8, 6, 17, 0.15);
}

.permission-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.perm-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perm-card-content {
  flex: 1;
  text-align: left;
}

.perm-card-content h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  letter-spacing: -0.1px;
}

.perm-card-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.perm-card-switch {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* iOS Toggle Switches */
.perm-card-switch input[type="checkbox"] {
  display: none;
}

.ios-switch {
  display: inline-block;
  width: 46px;
  height: 26px;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.ios-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #FFF;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.perm-card-switch input[type="checkbox"]:checked + .ios-switch {
  background: var(--success);
  border-color: var(--success);
}

.perm-card-switch input[type="checkbox"]:checked + .ios-switch::after {
  transform: translateX(20px);
}

/* ─── ADDITIONAL INTERACTIVE USER FLOWS ───────────────────── */
/* Card Heart Bookmarks */
.provider-card {
  position: relative;
}

.heart-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(13, 10, 31, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  color: var(--text-secondary);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.heart-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: scale(1.08);
}

.heart-btn:active {
  transform: scale(0.92);
}

.heart-btn.active {
  background: rgba(240, 144, 128, 0.12);
  border-color: rgba(240, 144, 128, 0.35);
  color: var(--coral);
  animation: heartPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Detail Screen Heart Bookmark */
.detail-heart {
  position: absolute;
  top: 62px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.detail-heart:hover {
  background: var(--bg-3);
  color: var(--text-primary);
  transform: scale(1.08);
}

.detail-heart:active {
  transform: scale(0.92);
}

.detail-heart.active {
  background: rgba(240, 144, 128, 0.12);
  border-color: rgba(240, 144, 128, 0.35);
  color: var(--coral);
  animation: heartPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes heartPulse {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* Custom Bottom Sheet Modals */
.custom-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 17, 0.45);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease, backdrop-filter 0.32s ease;
}

.custom-modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.custom-sheet {
  background: rgba(19, 16, 40, 0.94);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px 20px 0 0;
  padding: 16px 24px 34px;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  max-height: 85%;
  display: flex;
  flex-direction: column;
}

.sheet-drag-handle {
  width: 36px;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2.5px;
  margin: 0 auto 16px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sheet-title {
  font-family: 'Nunito', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sheet-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.sheet-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.sheet-body {
  overflow-y: auto;
  scrollbar-width: none;
}

.sheet-body::-webkit-scrollbar {
  display: none;
}

/* Custom Select Preference Lists (Language, Location) */
.preference-select-row {
  transition: background 0.15s;
}

.preference-select-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.preference-select-row:active {
  background: rgba(255, 255, 255, 0.045);
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s ease;
}

.custom-checkbox.checked {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 0 10px rgba(129, 112, 226, 0.4);
}

.custom-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s ease;
}

.custom-radio.selected {
  border-color: var(--purple);
  box-shadow: 0 0 10px rgba(129, 112, 226, 0.4);
}

.custom-radio.selected .radio-dot {
  background: var(--purple);
}

/* History logs list */
.history-item-row {
  transition: all 0.2s;
}

.history-item-row:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

.history-item-row:active {
  background: rgba(255, 255, 255, 0.045) !important;
}

.delete-history-btn {
  transition: all 0.15s;
}

.delete-history-btn:hover {
  color: var(--coral) !important;
  transform: scale(1.1);
}

.delete-history-btn:active {
  transform: scale(0.9);
}

/* Dynamic Appointments tab list empty/completed/saved */
.empty-tab-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: var(--r-lg);
  font-family: 'Inter', sans-serif;
  margin-bottom: 16px;
}

.appt-card.past-card {
  border-color: rgba(255, 255, 255, 0.04);
}

.appt-card.past-card:hover {
  background: var(--bg-2);
}

.saved-doctor-card:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 112, 226, 0.3) !important;
  box-shadow: 0 8px 24px rgba(129, 112, 226, 0.08);
}

