:root {
  --background: 218 41% 97%;
  --foreground: 224 38% 12%;
  --primary: 198 88% 39%;
  --primary-foreground: 0 0% 100%;
  --secondary: 267 79% 61%;
  --secondary-foreground: 0 0% 100%;
  --muted: 217 22% 90%;
  --muted-foreground: 220 14% 43%;
  --destructive: 352 79% 52%;
  --destructive-foreground: 0 0% 100%;
  --border: 217 24% 84%;
  --card: 0 0% 100%;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.18);
  --transition-fast: 150ms ease;
  --transition-smooth: 280ms cubic-bezier(.2,.8,.2,1);
  --radius-sm: 0.75rem;
  --radius-md: 1.15rem;
  --radius-lg: 1.75rem;
}

.dark {
  --background: 225 39% 8%;
  --foreground: 210 36% 96%;
  --primary: 193 95% 55%;
  --primary-foreground: 224 40% 8%;
  --secondary: 270 88% 70%;
  --secondary-foreground: 224 40% 8%;
  --muted: 224 26% 18%;
  --muted-foreground: 218 18% 72%;
  --destructive: 352 86% 62%;
  --destructive-foreground: 0 0% 100%;
  --border: 224 24% 24%;
  --card: 224 35% 12%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, hsl(var(--primary) / 0.14), transparent 34rem),
    radial-gradient(circle at 90% 10%, hsl(var(--secondary) / 0.12), transparent 28rem),
    hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
input, textarea, select { font-size: max(16px, 1rem); }
button { min-height: 44px; }

.bg-1 { background: hsl(var(--background)); }
.bg-2 { background: hsl(var(--card)); }
.bg-3 { background: hsl(var(--muted)); }
.bg-4 { background: hsl(var(--primary) / 0.1); }
.text-primary { color: hsl(var(--foreground)); }
.text-secondary { color: hsl(var(--muted-foreground)); }
.text-tertiary { color: hsl(var(--foreground) / 0.62); }
.accent { color: hsl(var(--primary)); }

.glass-card {
  background: hsl(var(--card) / 0.84);
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.phone-shell {
  background: linear-gradient(155deg, hsl(224 38% 12%), hsl(224 30% 18%));
  box-shadow: var(--shadow-lg);
}

.message-bubble { animation: riseIn 260ms ease both; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.safe-bottom { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
.safe-top { padding-top: calc(0.75rem + env(safe-area-inset-top)); }

.focus-ring:focus {
  outline: 3px solid hsl(var(--primary) / 0.32);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
}