/* ============================================================
   SPATIAL AI EXPLORER — WORLD-CLASS STYLESHEET 2026
   Fixes: crossorigin preload warning (handled in HTML)
   Adds: richer animations, device-specific responsive breakpoints,
         micro-interactions, safe-area support, dark/reduced-motion,
         improved accessibility focus styles, structural comments
   ============================================================ */

/* ─────────────────────────────────────────
   1. DESIGN TOKENS
───────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-deep:        #060c1a;
  --bg-surface:     #0d1526;
  --bg-card:        rgba(13, 21, 38, 0.72);
  --bg-card-hover:  rgba(20, 32, 56, 0.85);
  --glass:          rgba(255, 255, 255, 0.04);
  --glass-strong:   rgba(255, 255, 255, 0.08);
  --glass-border:   rgba(255, 255, 255, 0.09);
  --glass-border-active: rgba(0, 212, 255, 0.45);

  /* Text */
  --text-primary:   #f0f6ff;
  --text-secondary: rgba(240, 246, 255, 0.72);
  --text-muted:     rgba(240, 246, 255, 0.38);
  --text-inverse:   #060c1a;

  /* Brand palette */
  --accent-cyan:    #00d4ff;
  --accent-purple:  #7b2ff7;
  --accent-coral:   #ff5f6d;
  --accent-mint:    #4ecdc4;
  --accent-amber:   #ffb347;
  --accent-green:   #2ecc71;

  /* Gradients */
  --grad-brand:     linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  --grad-warm:      linear-gradient(135deg, var(--accent-coral), var(--accent-amber));
  --grad-cool:      linear-gradient(135deg, var(--accent-mint), var(--accent-cyan));

  /* Glows */
  --glow-cyan:      0 0 24px rgba(0, 212, 255, 0.35);
  --glow-purple:    0 0 24px rgba(123, 47, 247, 0.35);
  --glow-coral:     0 0 18px rgba(255, 95, 109, 0.4);
  --glow-mint:      0 0 16px rgba(78, 205, 196, 0.35);

  /* Radius scale */
  --r-xs:   8px;
  --r-sm:   14px;
  --r-md:   22px;
  --r-lg:   32px;
  --r-xl:   44px;
  --r-pill: 9999px;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Motion */
  --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring:     cubic-bezier(0.2, 0.9, 0.4, 1.2);
  --dur-fast:   160ms;
  --dur-mid:    320ms;
  --dur-slow:   560ms;

  /* Layout */
  --status-h:   64px;
  --nav-h:      72px;
  --nav-bottom: 20px;
  --safe-top:   env(safe-area-inset-top, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
  --safe-left:  env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ─────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: -webkit-fill-available;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'Segoe UI Variable', Roboto, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  height: -webkit-fill-available;
  width: 100vw;
  position: fixed; /* prevent iOS overscroll bounce */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  line-height: 1;
}

input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Global focus ring — visible only via keyboard */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Scrollbar suppression */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar { display: none; }

/* ─────────────────────────────────────────
   3. BACKGROUND CANVAS
───────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.65;
  pointer-events: none;
  will-change: transform;
}

/* ─────────────────────────────────────────
   4. SPLASH SCREEN
───────────────────────────────────────── */
#splash-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-slow) var(--ease-out-expo),
              visibility var(--dur-slow);
}

#splash-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, rgba(0,212,255,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 70% 60%, rgba(123,47,247,0.08) 0%, transparent 70%);
  animation: bgBreath 6s ease-in-out infinite alternate;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  transform: translateY(-6%);
  position: relative;
  z-index: 1;
}

.splash-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
}

.logo-icon {
  width: 88px;
  height: 88px;
  position: relative;
}

.logo-icon::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.15) 0%, transparent 70%);
  animation: logoPing 2s ease-out 1.4s infinite;
}

.logo-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(var(--glow-cyan));
}

.splash-title {
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

.splash-title .accent {
  font-weight: 900;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-sub {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.6px;
  opacity: 0;
  animation: fadeSlideUp 0.7s var(--ease-out-expo) 0.6s forwards;
}

/* Splash loading dots */
.splash-dots {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  margin-top: var(--sp-6);
  opacity: 0;
  animation: fadeSlideUp 0.5s var(--ease-out-expo) 1s forwards;
}

.splash-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: dotBounce 1.2s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.15s; background: var(--accent-purple); }
.splash-dots span:nth-child(3) { animation-delay: 0.3s;  background: var(--accent-mint); }

/* ─────────────────────────────────────────
   5. APP CONTAINER
───────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity var(--dur-slow) var(--ease-out-expo);
  z-index: 1;
}

/* ─────────────────────────────────────────
   6. STATUS BAR
───────────────────────────────────────── */
.status-bar {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: calc(16px + var(--safe-left));
  right: calc(16px + var(--safe-right));
  height: var(--status-h);
  background: rgba(8, 14, 28, 0.7);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-radius: var(--r-pill);
  padding: 0 var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: statusBarDrop 0.6s var(--ease-out-expo) 0.2s both;
}

.status-left,
.status-center,
.status-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.status-right {
  gap: var(--sp-1);
}

#clock {
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 160px;
  overflow: hidden;
}

#status-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  background: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-mint);
  animation: dotPulse 2.2s ease-in-out infinite;
  transition: background var(--dur-fast), box-shadow var(--dur-fast);
}

.status-badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.055);
  border: 0.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: background var(--dur-fast), color var(--dur-fast);
}

.status-badge.online {
  color: var(--accent-mint);
  background: rgba(78, 205, 196, 0.1);
  border-color: rgba(78, 205, 196, 0.25);
}

/* Hide less-critical badges on very small screens */
@media (max-width: 360px) {
  #gps-badge, #compass-badge { display: none; }
}

/* ─────────────────────────────────────────
   7. MAIN CONTENT & PAGE SYSTEM
───────────────────────────────────────── */
.main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.page {
  position: absolute;
  inset: 0;
  transform: translateX(100%) scale(0.94);
  opacity: 0;
  visibility: hidden;
  transition:
    transform var(--dur-slow) var(--ease-bounce),
    opacity var(--dur-mid) ease,
    visibility 0s var(--dur-mid);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding:
    calc(var(--status-h) + 24px + var(--safe-top))
    calc(var(--sp-4) + var(--safe-right))
    calc(var(--nav-h) + var(--nav-bottom) + 32px + var(--safe-bottom))
    calc(var(--sp-4) + var(--safe-left));
  background: rgba(8, 14, 28, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  will-change: transform, opacity;
}

.page.active {
  transform: translateX(0) scale(1);
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--dur-slow) var(--ease-bounce),
    opacity var(--dur-mid) ease;
}

/* Slide direction variants — previous page slides left */
.page.page-exit {
  transform: translateX(-30%) scale(0.96);
  opacity: 0;
}

/* ─────────────────────────────────────────
   8. CAMERA PAGE
───────────────────────────────────────── */
#camera-page {
  padding: 0;
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: hidden;
}

.camera-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  transform-origin: center;
  transition: transform var(--dur-mid) ease;
}

/* Subtle vignette over camera feed */
.camera-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, transparent 25%, transparent 70%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 1;
}

#overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ── Scan reticle (always visible on camera page) ── */
.scan-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.7;
}

.scan-reticle::before,
.scan-reticle::after {
  content: '';
  position: absolute;
  width: 36px;
  height: 36px;
  border-color: rgba(0,212,255,0.8);
  border-style: solid;
  border-width: 0;
}

.scan-reticle::before {
  top: 0; left: 0;
  border-top-width: 2.5px;
  border-left-width: 2.5px;
  border-radius: var(--r-xs) 0 0 0;
}

.scan-reticle::after {
  bottom: 0; right: 0;
  border-bottom-width: 2.5px;
  border-right-width: 2.5px;
  border-radius: 0 0 var(--r-xs) 0;
}

/* ── AR Detection Box ── */
.detection-box {
  position: absolute;
  border: 2px solid var(--accent-cyan);
  border-radius: var(--r-md);
  box-shadow: var(--glow-cyan), inset 0 0 30px rgba(0,212,255,0.12);
  padding: var(--sp-3);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  z-index: 5;
  min-width: 100px;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
  animation: detectionPop 0.35s var(--ease-bounce) both;
  pointer-events: auto;
}

.detection-box::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), transparent 60%);
  pointer-events: none;
}

.detection-box.hidden {
  opacity: 0;
  transform: scale(0.75);
  pointer-events: none;
  animation: none;
}

.detection-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  letter-spacing: 0.3px;
}

.detection-distance {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.detection-buy-btn {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-inverse);
  background: var(--accent-cyan);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  box-shadow: var(--glow-cyan);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
  letter-spacing: 0.3px;
  align-self: flex-start;
}

.detection-buy-btn:hover { transform: scale(1.04); }
.detection-buy-btn:active { transform: scale(0.93); }

/* ── Compass Ring ── */
.compass-ring {
  position: absolute;
  bottom: calc(var(--nav-h) + var(--nav-bottom) + 90px + var(--safe-bottom));
  right: calc(20px + var(--safe-right));
  width: 96px;
  height: 96px;
  pointer-events: none;
  z-index: 4;
  transition: opacity var(--dur-mid) ease, transform var(--dur-mid) var(--ease-out-expo);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

.compass-ring.hidden {
  opacity: 0;
  transform: scale(0.8);
}

.compass-svg {
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* ── Voice Command Bar ── */
.voice-command-bar {
  position: absolute;
  bottom: calc(var(--nav-h) + var(--nav-bottom) + 12px + var(--safe-bottom));
  left: calc(20px + var(--safe-left));
  right: calc(20px + var(--safe-right));
  background: rgba(12, 20, 38, 0.82);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border-radius: var(--r-pill);
  padding: 10px var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  z-index: 20;
  transition: border-color var(--dur-mid) ease, box-shadow var(--dur-mid) ease;
  animation: voiceBarRise 0.5s var(--ease-out-expo) 0.4s both;
}

.voice-command-bar.listening {
  border-color: rgba(0,212,255,0.5);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 28px rgba(0,212,255,0.2),
              inset 0 1px 0 rgba(0,212,255,0.15);
}

.voice-input-container {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}

.mic-btn {
  flex-shrink: 0;
  background: var(--grad-warm);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--glow-coral);
  transition: transform var(--dur-fast) var(--ease-bounce),
              box-shadow var(--dur-fast) ease;
  position: relative;
}

.mic-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.mic-btn:hover::after { opacity: 1; }
.mic-btn:active { transform: scale(0.88); }

.mic-btn.listening {
  animation: micRipple 1.4s ease-in-out infinite;
  box-shadow: var(--glow-coral), 0 0 0 0 rgba(255,95,109,0.4);
}

[aria-pressed="true"].mic-btn {
  background: var(--grad-cool);
  box-shadow: var(--glow-mint);
}

.voice-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--dur-fast);
}

.voice-command-bar.listening .voice-text {
  color: var(--text-primary);
}

.voice-wave {
  display: flex;
  gap: 2.5px;
  align-items: center;
  height: 22px;
  flex-shrink: 0;
}

.voice-wave span {
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 3px;
  height: 4px;
  transition: height var(--dur-fast) ease;
}

.voice-wave.listening span {
  animation: waveBar 1s ease-in-out infinite;
}

.voice-wave span:nth-child(1) { animation-delay: 0.00s; }
.voice-wave span:nth-child(2) { animation-delay: 0.12s; }
.voice-wave span:nth-child(3) { animation-delay: 0.24s; }
.voice-wave span:nth-child(4) { animation-delay: 0.36s; }
.voice-wave span:nth-child(5) { animation-delay: 0.48s; }

/* ── Quick Actions ── */
.quick-actions {
  position: absolute;
  bottom: calc(var(--nav-h) + var(--nav-bottom) + 80px + var(--safe-bottom));
  left: calc(20px + var(--safe-left));
  display: flex;
  gap: var(--sp-2);
  z-index: 15;
  animation: quickActionsRise 0.5s var(--ease-out-expo) 0.5s both;
}

.quick-action-btn {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  transition:
    background var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-bounce),
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

.quick-action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.quick-action-btn:hover::before { opacity: 0.12; }
.quick-action-btn:hover { border-color: rgba(0,212,255,0.3); }

.quick-action-btn:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.14);
}

.quick-action-btn.mode-active {
  border-color: var(--accent-cyan);
  background: rgba(0,212,255,0.1);
  box-shadow: 0 0 16px rgba(0,212,255,0.25);
  color: var(--accent-cyan);
}

/* ─────────────────────────────────────────
   9. PAGE HEADER
───────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  position: sticky;
  top: 0;
  z-index: 5;
  background: transparent;
}

.page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.back-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 0.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-primary);
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-bounce);
  flex-shrink: 0;
}

.back-btn:hover  { background: rgba(255,255,255,0.12); }
.back-btn:active { transform: scale(0.88); }

/* ─────────────────────────────────────────
   10. EXPLORE PAGE
───────────────────────────────────────── */
.explore-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.search-box {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.search-input {
  flex: 1;
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--r-pill);
  padding: 14px var(--sp-5);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  backdrop-filter: blur(10px);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--glass-border-active);
  box-shadow: 0 0 16px rgba(0,212,255,0.18);
}

.search-btn {
  flex-shrink: 0;
  background: var(--accent-cyan);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  box-shadow: var(--glow-cyan);
  transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast);
}

.search-btn:hover { box-shadow: 0 0 30px rgba(0,212,255,0.5); }
.search-btn:active { transform: scale(0.88); }

.map-container {
  width: 100%;
  height: 220px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(0,0,0,0.45);
  border: 0.5px solid var(--glass-border);
  position: relative;
}

.map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(0,212,255,0.12);
  pointer-events: none;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.map-pin {
  font-size: 2.8rem;
  animation: pinBounce 2.2s var(--ease-bounce) infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.poi-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 60px;
}

.poi-item {
  background: var(--bg-card);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  transition: transform var(--dur-fast), background var(--dur-fast);
  cursor: pointer;
  animation: fadeSlideUp var(--dur-mid) var(--ease-out-expo) both;
}

.poi-item:active { transform: scale(0.97); }
.poi-item:hover  { background: var(--bg-card-hover); }

/* ─────────────────────────────────────────
   11. PROFILE & SETTINGS PAGES
───────────────────────────────────────── */
.profile-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.card:active { transform: scale(0.985); }

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.2px;
}

/* Templates list */
.templates-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-3);
  background: rgba(255,255,255,0.04);
  border-radius: var(--r-sm);
  border: 0.5px solid var(--glass-border);
  font-size: 0.88rem;
  color: var(--text-secondary);
  animation: fadeSlideUp var(--dur-mid) var(--ease-out-expo) both;
  transition: background var(--dur-fast);
}

.template-item:hover { background: rgba(0,212,255,0.06); }

.placeholder-text {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
  padding: var(--sp-2) 0;
}

/* Setting item */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4) 0;
  border-bottom: 0.5px solid var(--glass-border);
  gap: var(--sp-4);
}

.setting-item:last-child { border-bottom: none; padding-bottom: 0; }
.setting-item:first-child { padding-top: 0; }

.setting-item > label:first-child,
.setting-item > span {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 29px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: var(--r-pill);
  border: 0.5px solid var(--glass-border);
  transition: background var(--dur-mid) ease, border-color var(--dur-mid);
  cursor: pointer;
}

.slider::before {
  content: '';
  position: absolute;
  height: 23px;
  width: 23px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border-radius: 50%;
  transition: transform var(--dur-mid) var(--ease-bounce),
              box-shadow var(--dur-mid);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

input:checked + .slider {
  background: var(--accent-cyan);
  border-color: rgba(0,212,255,0.4);
  box-shadow: 0 0 12px rgba(0,212,255,0.3);
}

input:checked + .slider::before {
  transform: translateY(-50%) translateX(21px);
  box-shadow: 0 2px 8px rgba(0,212,255,0.4);
}

/* Stats grid */
.stats-grid {
  display: flex;
  gap: var(--sp-3);
}

.stat {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.stat:hover { background: rgba(0,212,255,0.06); transform: translateY(-2px); }

.stat strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  transition: filter var(--dur-fast);
}

.stat:hover strong { filter: brightness(1.2); }

.stat span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  display: block;
  margin-top: 4px;
}

/* Form controls */
select {
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  -webkit-appearance: none;
  appearance: none;
}

select:focus {
  border-color: var(--glass-border-active);
  box-shadow: 0 0 12px rgba(0,212,255,0.18);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 4px;
  background: var(--glass-strong);
  border-radius: var(--r-pill);
  outline: none;
  accent-color: var(--accent-cyan);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-bounce);
}

input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.3); }

/* ─────────────────────────────────────────
   12. BOTTOM NAVIGATION
───────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: calc(var(--nav-bottom) + var(--safe-bottom));
  left: calc(20px + var(--safe-left));
  right: calc(20px + var(--safe-right));
  height: var(--nav-h);
  background: rgba(10, 18, 34, 0.78);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border-radius: var(--r-pill);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 var(--sp-3);
  z-index: 40;
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 12px 36px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: navBarRise 0.6s var(--ease-out-expo) 0.3s both;
}

.nav-btn {
  flex: 1;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: 40px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  transition:
    color var(--dur-mid) ease,
    background var(--dur-mid) ease;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--accent-cyan);
  transition: transform var(--dur-mid) var(--ease-bounce);
}

.nav-btn.active-nav {
  color: var(--text-primary);
  background: rgba(255,255,255,0.07);
}

.nav-btn.active-nav::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-icon {
  font-size: 1.25rem;
  transition: transform var(--dur-mid) var(--ease-bounce);
}

.nav-btn.active-nav .nav-icon {
  transform: translateY(-2px) scale(1.12);
}

.nav-btn:active .nav-icon { transform: scale(0.88); }

.nav-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0,212,255,0.18);
  transform: scale(0);
  pointer-events: none;
  width: 0; height: 0;
}

@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

/* ─────────────────────────────────────────
   13. FLOATING ACTION BUTTON
───────────────────────────────────────── */
.fab-container {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--nav-bottom) + 18px + var(--safe-bottom));
  right: calc(24px + var(--safe-right));
  z-index: 35;
}

.fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 6px 24px rgba(123,47,247,0.5), 0 0 0 0 rgba(123,47,247,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  transition: transform var(--dur-fast) var(--ease-bounce),
              box-shadow var(--dur-fast) ease;
  animation: fabPulse 3s ease-in-out infinite;
  position: relative;
}

.fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.fab:hover::before { opacity: 1; }
.fab:hover { box-shadow: 0 8px 32px rgba(123,47,247,0.7); }
.fab:active { transform: scale(0.88); }

/* ─────────────────────────────────────────
   14. TOAST NOTIFICATIONS
───────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--status-h) + 18px + var(--safe-top));
  left: calc(20px + var(--safe-left));
  right: calc(20px + var(--safe-right));
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  background: rgba(8, 14, 28, 0.88);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  color: var(--text-primary);
  padding: 13px var(--sp-5);
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toastIn var(--dur-mid) var(--ease-out-expo) both;
  pointer-events: auto;
  border-left: 3.5px solid var(--accent-cyan);
  border: 0.5px solid var(--glass-border);
  border-left-width: 3.5px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ─────────────────────────────────────────
   15. MODAL
───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
  display: flex;
  align-items: flex-end;    /* sheet-style on mobile */
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-mid) ease, visibility 0s var(--dur-mid);
  padding: 0 var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
}

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-mid) ease;
}

.modal-overlay[aria-hidden="false"] { pointer-events: auto; }

.modal-content {
  background: rgba(13, 21, 38, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--r-lg) var(--r-lg) var(--r-md) var(--r-md);
  padding: var(--sp-5);
  width: 100%;
  max-width: 420px;
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 -4px 40px rgba(0,0,0,0.6), 0 0 0 0.5px rgba(255,255,255,0.05);
  animation: sheetUp var(--dur-slow) var(--ease-out-expo) both;
  position: relative;
  overflow: hidden;
}

@media (min-width: 600px) {
  .modal-content {
    border-radius: var(--r-lg);
    animation: modalPop var(--dur-slow) var(--ease-bounce) both;
  }
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.3), transparent);
}

/* Drag handle for sheet */
.modal-content::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--r-pill);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
  margin-top: var(--sp-4); /* space for drag handle */
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-bounce);
}

.modal-close:hover  { background: rgba(255,255,255,0.14); }
.modal-close:active { transform: scale(0.85); }

.modal-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.modal-body p { margin-bottom: var(--sp-2); }

.affiliate-btn {
  margin-top: var(--sp-3);
  width: 100%;
  padding: 14px var(--sp-5);
  background: var(--grad-brand);
  border-radius: var(--r-pill);
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  text-align: center;
  box-shadow: var(--glow-purple);
  transition: transform var(--dur-fast) var(--ease-bounce),
              box-shadow var(--dur-fast) ease;
  letter-spacing: 0.3px;
}

.affiliate-btn:hover { box-shadow: 0 0 30px rgba(123,47,247,0.5); }
.affiliate-btn:active { transform: scale(0.95); }

/* ─────────────────────────────────────────
   16. KEYFRAME ANIMATIONS
───────────────────────────────────────── */
@keyframes bgBreath {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

@keyframes titleGlow {
  0%   { filter: drop-shadow(0 0 8px rgba(0,212,255,0.3)); }
  100% { filter: drop-shadow(0 0 18px rgba(123,47,247,0.5)); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40%            { transform: scale(1);   opacity: 1; }
}

@keyframes logoPing {
  0%   { transform: scale(0.9); opacity: 0.6; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { opacity: 0; }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.25); }
}

@keyframes statusBarDrop {
  from { transform: translateY(-110%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes navBarRise {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes voiceBarRise {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes quickActionsRise {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes detectionPop {
  from { opacity: 0; transform: scale(0.65); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes waveBar {
  0%, 100% { height: 5px; }
  50%       { height: 22px; }
}

@keyframes micRipple {
  0%   { box-shadow: var(--glow-coral), 0 0 0 0 rgba(255,95,109,0.5); }
  70%  { box-shadow: var(--glow-coral), 0 0 0 16px rgba(255,95,109,0); }
  100% { box-shadow: var(--glow-coral), 0 0 0 0 rgba(255,95,109,0); }
}

@keyframes pinBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30%       { transform: translateY(-10px) rotate(-5deg); }
  60%       { transform: translateY(-4px) rotate(3deg); }
}

@keyframes fabPulse {
  0%   { box-shadow: 0 6px 24px rgba(123,47,247,0.5), 0 0 0 0 rgba(123,47,247,0.35); }
  60%  { box-shadow: 0 6px 24px rgba(123,47,247,0.6), 0 0 0 16px rgba(123,47,247,0); }
  100% { box-shadow: 0 6px 24px rgba(123,47,247,0.5), 0 0 0 0 rgba(123,47,247,0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-24px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(80px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}

/* Skeleton / loading shimmer utility */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ─────────────────────────────────────────
   17. RESPONSIVE BREAKPOINTS
───────────────────────────────────────── */

/* ── Extra-small: smartwatches / fold outer < 320px ── */
@media (max-width: 319px) {
  :root { --status-h: 52px; --nav-h: 58px; }
  .status-badge { display: none; }
  .splash-title { font-size: 2rem; letter-spacing: -1px; }
  .quick-action-btn { padding: 8px 10px; font-size: 0.72rem; }
  .voice-command-bar { padding: 8px 10px; }
  .mic-btn { width: 38px; height: 38px; font-size: 1.1rem; }
}

/* ── Small phones: 320–480px ── */
@media (max-width: 480px) {
  .status-right { gap: 2px; }
  .status-badge { padding: 3px 7px; font-size: 0.65rem; }
  #gps-badge { display: none; }

  .voice-command-bar {
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    padding: 9px 12px;
    gap: var(--sp-2);
  }

  .quick-actions {
    left: calc(12px + var(--safe-left));
    gap: var(--sp-1);
  }

  .quick-action-btn { padding: 9px 12px; font-size: 0.78rem; }

  .bottom-nav {
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    height: 62px;
    bottom: calc(10px + var(--safe-bottom));
  }

  .nav-btn { font-size: 0.65rem; padding: var(--sp-2) var(--sp-2); }
  .nav-icon { font-size: 1.15rem; }

  .fab { width: 52px; height: 52px; font-size: 1.3rem; }

  .stats-grid { gap: var(--sp-2); }
  .stat strong { font-size: 1.5rem; }
}

/* ── Medium phones: 481–767px (most Android / iPhone) ── */
@media (min-width: 481px) and (max-width: 767px) {
  .status-badge { padding: 4px 10px; }
}

/* ── Large phones / small tablets: 600–767px ── */
@media (min-width: 600px) and (max-width: 767px) {
  .quick-actions { gap: var(--sp-3); }
  .quick-action-btn { font-size: 0.88rem; }
}

/* ── Tablets portrait: 768–1023px ── */
@media (min-width: 768px) {
  :root {
    --status-h: 68px;
    --nav-h: 76px;
    --nav-bottom: 24px;
  }

  .page {
    padding-left: calc(var(--sp-8) + var(--safe-left));
    padding-right: calc(var(--sp-8) + var(--safe-right));
  }

  .status-bar {
    left: calc(24px + var(--safe-left));
    right: calc(24px + var(--safe-right));
  }

  .bottom-nav {
    left: 15%;
    right: 15%;
    border-radius: var(--r-pill);
  }

  .fab {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
  }

  .fab-container {
    right: calc(36px + var(--safe-right));
  }

  .profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
  }

  .profile-grid > .card:first-child {
    grid-column: 1 / -1;
  }

  .map-container { height: 280px; }

  .voice-command-bar {
    left: calc(32px + var(--safe-left));
    right: calc(32px + var(--safe-right));
    padding: 12px var(--sp-5);
  }

  .quick-actions {
    left: calc(32px + var(--safe-left));
    gap: var(--sp-3);
  }

  .modal-content { border-radius: var(--r-lg); }
}

/* ── Tablets landscape + small desktops: 1024–1279px ── */
@media (min-width: 1024px) {
  :root {
    --nav-bottom: 28px;
  }

  .page {
    max-width: 540px;
    margin: 0 auto;
    border-radius: var(--r-lg);
    padding-left: var(--sp-8);
    padding-right: var(--sp-8);
  }

  .bottom-nav {
    max-width: 500px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .status-bar {
    max-width: 760px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .fab-container {
    right: calc(50% - 310px);
  }

  .voice-command-bar {
    max-width: 540px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .quick-actions {
    max-width: 540px;
    left: 50%;
    transform: translateX(-50%);
  }

  .toast-container {
    max-width: 480px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

/* ── Large desktop: 1280px+ ── */
@media (min-width: 1280px) {
  .page { max-width: 580px; }
  .bottom-nav { max-width: 520px; }
}

/* ── Landscape phone (height < 500px) ── */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --status-h: 48px;
    --nav-h: 56px;
    --nav-bottom: 8px;
  }

  .status-bar {
    top: calc(6px + var(--safe-top));
    height: var(--status-h);
  }

  .status-badge { display: none; }
  #clock, .status-indicator { font-size: 0.78rem; }

  .voice-command-bar {
    bottom: calc(var(--nav-h) + var(--nav-bottom) + 8px + var(--safe-bottom));
    padding: 8px 14px;
  }

  .mic-btn { width: 38px; height: 38px; font-size: 1rem; }
  .quick-actions { display: none; } /* too cluttered in landscape */

  .compass-ring { width: 72px; height: 72px; }

  .fab {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
}

/* ── High-DPI / Retina ── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .status-bar,
  .bottom-nav,
  .voice-command-bar {
    border-width: 0.5px;
  }
}

/* ─────────────────────────────────────────
   18. REDUCED MOTION
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .splash-title { animation: none; }
  .status-dot   { animation: none; }
  .fab          { animation: none; }
  .map-pin      { animation: none; }
  .voice-wave span { animation: none !important; }
  .mic-btn.listening { animation: none; }
  .logo-icon::after { animation: none; }
}

/* ─────────────────────────────────────────
   19. PRINT (safety)
───────────────────────────────────────── */
@media print {
  .bottom-nav,
  .fab-container,
  #bg-canvas,
  #splash-screen,
  .voice-command-bar,
  .quick-actions { display: none !important; }

  #app { position: static; height: auto; overflow: visible; }
  .page { position: static; transform: none; opacity: 1; visibility: visible; }
}