/* ============================================
   Anita · AI Психолог · Твоя поддержка
   Design System v2.0 — Softer, Richer
   ============================================ */

/* --- CSS Tokens --- */
:root {
  /* Softened brand palette */
  --night:      #0e1a2e;
  --ocean:      #142840;
  --ocean-soft: #1a3050;
  --wave:       #1a5a9a;
  --horizon:    #5ba8e0;
  --foam:       #c8e8ff;
  --light:      #dff0ff;
  --white:      #f4f9ff;

  /* Functional */
  --bg-main:    #111e32;
  --bg-sidebar: #0f1926;
  --bg-card:    #182b42;
  --bg-input:   #162236;
  --border:     rgba(26, 90, 154, 0.2);
  --border-active: rgba(91, 168, 224, 0.4);
  --text-primary: #dff0ff;
  --text-secondary: rgba(200, 232, 255, 0.55);
  --text-muted: rgba(200, 232, 255, 0.3);

  /* Bubbles */
  --bubble-anita-bg:   #182b42;
  --bubble-anita-text:  #dff0ff;
  --bubble-user-bg:     #1a5a9a;
  --bubble-user-text:   #f4f9ff;

  /* Typography */
  --font-brand: Georgia, 'Times New Roman', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  /* Radii */
  --r-card:    16px;
  --r-element: 12px;
  --r-pill:    50px;
  --r-bubble:  18px;

  /* Transitions */
  --t-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-w: 300px;
  --header-h: 64px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-ui);
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
textarea { font-family: inherit; }

/* =============================================
   SPLASH SCREEN
   ============================================= */
.splash {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--night);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.splash.done { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-icon {
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0; transform: scale(0.7);
  animation: splashIn 0.8s 0.3s ease forwards;
  box-shadow: 0 0 50px rgba(91,168,224,0.2);
}
.splash-title {
  font-family: var(--font-brand); font-size: 32px; font-weight: 700;
  color: var(--foam); margin-top: 20px;
  opacity: 0; animation: splashIn 0.7s 0.6s ease forwards;
}
.splash-divider {
  width: 50px; height: 1.5px; margin-top: 14px;
  background: linear-gradient(90deg, transparent, var(--wave), transparent);
  opacity: 0; animation: splashIn 0.7s 0.9s ease forwards;
}
.splash-tagline {
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--horizon); margin-top: 12px;
  opacity: 0; animation: splashIn 0.7s 1.2s ease forwards;
}
@keyframes splashIn {
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =============================================
   WELCOME SCREEN (Creative)
   ============================================= */
.welcome {
  position: absolute; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-main);
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.welcome.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* Animated ocean waves at bottom */
.welcome-ocean {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 35%;
  overflow: hidden; pointer-events: none;
}
.welcome-wave {
  position: absolute; bottom: -10px; width: 200%; height: 100%;
  background-repeat: repeat-x;
  animation: waveSlide 12s linear infinite;
}
.welcome-wave:nth-child(1) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,60 C200,10 400,100 600,60 C800,20 1000,90 1200,60 L1200,120 L0,120Z' fill='%23142840' fill-opacity='0.4'/%3E%3C/svg%3E");
  background-size: 1200px 120px;
  opacity: 0.6;
  animation-duration: 14s;
}
.welcome-wave:nth-child(2) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,80 C300,30 500,100 700,50 C900,10 1100,80 1200,40 L1200,120 L0,120Z' fill='%231a3050' fill-opacity='0.5'/%3E%3C/svg%3E");
  background-size: 1200px 120px;
  opacity: 0.5;
  animation-duration: 10s;
  animation-direction: reverse;
  bottom: -5px;
}
.welcome-wave:nth-child(3) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,40 C150,80 350,20 600,70 C850,110 1050,30 1200,60 L1200,120 L0,120Z' fill='%23182b42' fill-opacity='0.6'/%3E%3C/svg%3E");
  background-size: 1200px 120px;
  opacity: 0.4;
  animation-duration: 18s;
}
@keyframes waveSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Floating particles */
.welcome-particles {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--horizon);
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}
.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 9s; }
.particle:nth-child(2) { left: 25%; top: 50%; animation-delay: 1s; animation-duration: 11s; width: 2px; height: 2px; }
.particle:nth-child(3) { left: 45%; top: 15%; animation-delay: 2s; animation-duration: 8s; }
.particle:nth-child(4) { left: 60%; top: 60%; animation-delay: 3s; animation-duration: 10s; width: 4px; height: 4px; }
.particle:nth-child(5) { left: 75%; top: 30%; animation-delay: 4s; animation-duration: 12s; width: 2px; height: 2px; }
.particle:nth-child(6) { left: 85%; top: 70%; animation-delay: 5s; animation-duration: 9s; }
.particle:nth-child(7) { left: 35%; top: 75%; animation-delay: 1.5s; animation-duration: 13s; width: 2px; height: 2px;}
.particle:nth-child(8) { left: 55%; top: 40%; animation-delay: 3.5s; animation-duration: 7s; }
@keyframes particleFloat {
  0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
  25% { opacity: 0.6; }
  50% { opacity: 0.3; transform: translateY(-40px) scale(1.5); }
  75% { opacity: 0.5; }
}

/* Welcome content */
.welcome-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 0 32px;
  max-width: 560px;
}

.welcome-icon {
  width: 96px; height: 96px; border-radius: 50%;
  box-shadow: 0 0 60px rgba(91,168,224,0.2), 0 0 120px rgba(26,90,154,0.1);
  animation: iconBreathe 4s ease-in-out infinite;
  margin-bottom: 24px;
}
@keyframes iconBreathe {
  0%, 100% { box-shadow: 0 0 40px rgba(91,168,224,0.15), 0 0 80px rgba(26,90,154,0.08); }
  50% { box-shadow: 0 0 60px rgba(91,168,224,0.3), 0 0 120px rgba(26,90,154,0.15); }
}

.welcome-brand {
  font-family: var(--font-brand);
  font-size: 36px; font-weight: 700;
  color: var(--foam);
  margin-bottom: 6px;
}
.welcome-subtitle {
  font-family: var(--font-brand);
  font-size: 18px; color: var(--horizon);
  margin-bottom: 28px;
}
.welcome-quote {
  font-size: 15px; line-height: 1.6;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 36px;
  min-height: 48px;
  transition: opacity 0.5s ease;
}

.welcome-start-btn {
  background: var(--wave);
  color: var(--white);
  font-size: 15px; font-weight: 500;
  padding: 14px 36px;
  border-radius: var(--r-pill);
  transition: background var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  box-shadow: 0 4px 24px rgba(26,90,154,0.3);
}
.welcome-start-btn:hover {
  background: var(--horizon);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(91,168,224,0.3);
}
.welcome-start-btn:active { transform: scale(0.97); }

/* Recent chats on welcome */
.welcome-recent {
  margin-top: 40px; width: 100%; max-width: 480px;
}
.welcome-recent-title {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-muted);
  margin-bottom: 14px;
}
.welcome-recent-list {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.welcome-recent-list::-webkit-scrollbar { display: none; }

.recent-card {
  flex-shrink: 0; width: 200px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px 16px;
  text-align: left;
  transition: border-color var(--t-base), transform var(--t-base);
}
.recent-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}
.recent-card-date {
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 6px;
}
.recent-card-preview {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.recent-card-count {
  font-size: 11px; color: var(--text-muted);
  margin-top: 8px;
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.app-layout {
  display: flex;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.app-layout.visible { opacity: 1; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--t-base);
  z-index: 50;
}

.sidebar-header {
  padding: 20px;
  display: flex; align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--border);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo {
  width: 36px; height: 36px; border-radius: 50%;
}
.sidebar-brand-name {
  font-family: var(--font-brand);
  font-size: 20px; font-weight: 700;
  color: var(--foam);
}
.sidebar-close {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: background var(--t-fast);
}
.sidebar-close:hover { background: rgba(255,255,255,0.06); }

.sidebar-new-btn {
  margin: 16px 16px 8px;
  background: var(--wave);
  color: var(--white);
  font-size: 14px; font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--r-element);
  display: flex; align-items: center; gap: 8px;
  transition: background var(--t-base);
}
.sidebar-new-btn:hover { background: var(--horizon); }
.sidebar-new-btn svg { width: 18px; height: 18px; }

.sidebar-chats {
  flex: 1; overflow-y: auto;
  padding: 8px 12px;
}
.sidebar-chats::-webkit-scrollbar { width: 3px; }
.sidebar-chats::-webkit-scrollbar-thumb { background: rgba(26,90,154,0.2); border-radius: 3px; }

.sidebar-section-title {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted);
  padding: 12px 8px 6px;
}

.chat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-element);
  transition: background var(--t-fast);
  position: relative;
}
.chat-item:hover { background: rgba(255,255,255,0.04); }
.chat-item.active { background: rgba(26,90,154,0.15); }

.chat-item-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.chat-item-info { flex: 1; min-width: 0; }
.chat-item-title {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item-date {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

.chat-item-delete {
  opacity: 0; width: 28px; height: 28px;
  border-radius: 6px; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.chat-item:hover .chat-item-delete { opacity: 1; }
.chat-item-delete:hover { background: rgba(255,80,80,0.15); color: #ff6b6b; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 0.5px solid var(--border);
}

.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--r-element);
  transition: background var(--t-fast);
}
.sidebar-profile:hover { background: rgba(255,255,255,0.04); }

.sidebar-profile-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--horizon); font-size: 16px;
}
.sidebar-profile-info { flex: 1; }
.sidebar-profile-name {
  font-size: 13px; color: var(--text-primary); font-weight: 500;
}
.sidebar-profile-sessions {
  font-size: 11px; color: var(--text-muted);
}

.sidebar-settings-btn {
  width: 32px; height: 32px;
  border-radius: 8px; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-settings-btn:hover {
  background: rgba(255,255,255,0.06); color: var(--text-primary);
}

/* =============================================
   MAIN PANEL
   ============================================= */
.main-panel {
  flex: 1; display: flex; flex-direction: column;
  height: 100vh; position: relative;
  min-width: 0;
}

/* Header */
.chat-header {
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: var(--ocean);
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}

.menu-btn {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background var(--t-fast);
}
.menu-btn:hover { background: rgba(255,255,255,0.06); }

.header-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  box-shadow: 0 0 16px rgba(91,168,224,0.12);
}
.header-info { display: flex; flex-direction: column; gap: 1px; }
.header-name {
  font-family: var(--font-brand);
  font-size: 18px; font-weight: 700; color: var(--foam); line-height: 1.2;
}
.header-status {
  font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34c759; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.session-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.1);
  color: var(--horizon);
  font-weight: 500;
  transition: opacity 0.3s ease;
}
.progress-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--horizon);
  box-shadow: 0 0 8px var(--horizon);
}

/* Chat area */
.chat-area {
  flex: 1; overflow-y: auto;
  padding: 24px 20px;
  display: flex; flex-direction: column;
  gap: 14px; scroll-behavior: smooth;
}
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: rgba(26,90,154,0.2); border-radius: 4px; }

/* Messages */
.message {
  display: flex; gap: 10px; max-width: 78%;
  animation: msgIn 0.35s ease forwards;
  opacity: 0; transform: translateY(6px);
}
.message.anita { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}
.message.user .msg-avatar { display: none; }

.bubble {
  padding: 12px 16px;
  font-size: 15px; line-height: 1.6;
  word-wrap: break-word;
}
.message.anita .bubble {
  background: var(--bubble-anita-bg);
  color: var(--bubble-anita-text);
  border-radius: var(--r-bubble) var(--r-bubble) var(--r-bubble) 4px;
}
.message.user .bubble {
  background: var(--bubble-user-bg);
  color: var(--bubble-user-text);
  border-radius: var(--r-bubble) var(--r-bubble) 4px var(--r-bubble);
}

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

/* Typing indicator */
.typing {
  display: flex; align-items: center; gap: 10px;
  align-self: flex-start; max-width: 78%;
  opacity: 0; animation: msgIn 0.3s ease forwards;
}
.typing .bubble {
  background: var(--bubble-anita-bg);
  border-radius: var(--r-bubble) var(--r-bubble) var(--r-bubble) 4px;
  padding: 14px 20px;
  display: flex; gap: 5px; align-items: center;
}
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--horizon); opacity: 0.4;
  animation: bounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick chips */
.quick-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 4px 0;
  animation: msgIn 0.5s 0.3s ease forwards; opacity: 0;
}
.chip {
  background: rgba(26,90,154,0.15);
  color: var(--horizon);
  border: 0.5px solid rgba(91,168,224,0.2);
  font-size: 13px; padding: 8px 16px;
  border-radius: var(--r-pill);
  transition: background var(--t-base), transform var(--t-base), border-color var(--t-base);
}
.chip:hover {
  background: rgba(26,90,154,0.25);
  border-color: var(--horizon);
  transform: translateY(-1px);
}

/* Input area */
.input-area {
  padding: 12px 20px 20px;
  background: var(--ocean);
  border-top: 0.5px solid var(--border);
  display: flex; align-items: flex-end; gap: 10px;
  flex-shrink: 0;
}
.input-wrap {
  flex: 1; display: flex; align-items: flex-end;
  background: var(--bg-input);
  border: 0.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px 6px 4px 18px;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.input-wrap:focus-within {
  border-color: var(--wave);
  box-shadow: 0 0 0 2px rgba(26,90,154,0.12);
}
#msg-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--foam); font-size: 15px; line-height: 1.4;
  padding: 10px 0; resize: none;
  max-height: 120px; min-height: 22px;
}
#msg-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--wave); color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-base), transform var(--t-base), opacity var(--t-base);
  opacity: 0.4;
}
.send-btn:hover { background: var(--horizon); transform: scale(1.05); }
.send-btn.active { opacity: 1; }
.send-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* Disclaimer */
.disclaimer {
  text-align: center; font-size: 11px;
  color: var(--text-muted); padding: 6px 16px;
  line-height: 1.4;
}

/* =============================================
   SETTINGS MODAL
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(7,22,42,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
  background: var(--ocean);
  border: 0.5px solid var(--border);
  border-radius: var(--r-card);
  width: 420px; max-width: 90vw;
  padding: 28px;
  transform: translateY(10px);
  transition: transform var(--t-base);
}
.modal-overlay.show .modal { transform: translateY(0); }

.modal-title {
  font-family: var(--font-brand);
  font-size: 20px; font-weight: 700;
  color: var(--foam); margin-bottom: 20px;
}
.modal-field { margin-bottom: 16px; }
.modal-label {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-secondary);
  margin-bottom: 6px; display: block;
}
.modal-input {
  width: 100%; background: var(--bg-input);
  border: 0.5px solid var(--border);
  border-radius: var(--r-element);
  padding: 10px 14px; color: var(--foam);
  font-size: 14px; outline: none;
  transition: border-color var(--t-base);
}
.modal-input:focus { border-color: var(--wave); }

.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px;
}
.modal-btn {
  padding: 10px 20px; border-radius: var(--r-element);
  font-size: 14px; font-weight: 500;
  transition: background var(--t-base);
}
.modal-btn.primary { background: var(--wave); color: var(--white); }
.modal-btn.primary:hover { background: var(--horizon); }
.modal-btn.secondary { color: var(--text-secondary); }
.modal-btn.secondary:hover { background: rgba(255,255,255,0.06); }

/* Toggle Switch */
.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-secondary);
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--wave);
  border-color: var(--horizon);
}
input:checked + .slider:before {
  transform: translateX(20px);
  background-color: white;
}

/* =============================================
   AMBIENT BACKGROUND
   ============================================= */
.ambient {
  position: fixed; top: -30%; left: -20%;
  width: 140%; height: 60%;
  background: radial-gradient(ellipse at center, rgba(26,90,154,0.04) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
  animation: ambientMove 20s ease-in-out infinite alternate;
}
@keyframes ambientMove {
  0% { transform: translate(0,0) scale(1); }
  100% { transform: translate(5%,10%) scale(1.1); }
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .menu-btn { display: flex; }

  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 190;
    background: rgba(0,0,0,0.4);
    opacity: 0; visibility: hidden;
    transition: opacity var(--t-base), visibility var(--t-base);
  }
  .sidebar-overlay.show { opacity: 1; visibility: visible; }
}
