/* ================================================================
   DoZoro — style.css
   Aesthetic: Dark Cinematic · Obsidian & Ember · Gamified Mastery
   Fonts: Syne (display) + DM Sans (body) + JetBrains Mono (code/numbers)
   ================================================================ */

/* ── 1. CSS CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  /* Core palette — Dark */
  --bg:           #06060b;
  --bg-2:         #0c0c14;
  --surface-1:    #111119;
  --surface-2:    #18181f;
  --surface-3:    #1f1f2a;
  --surface-4:    #27273a;
  --border:       rgba(255,255,255,0.07);
  --border-2:     rgba(255,255,255,0.12);

  /* Accent system */
  --accent-1:     #8b5cf6;   /* violet */
  --accent-2:     #ec4899;   /* pink */
  --accent-3:     #06b6d4;   /* cyan */
  --accent-glow:  rgba(139,92,246,0.35);
  --accent-glow2: rgba(236,72,153,0.25);

  /* Semantic */
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #06b6d4;

  /* Priority */
  --prio-low:     #10b981;
  --prio-med:     #f59e0b;
  --prio-high:    #ef4444;

  /* Text */
  --text-1:       #f0f0f5;
  --text-2:       #a0a0b8;
  --text-3:       #606078;
  --text-inv:     #06060b;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Sizing */
  --nav-h:        68px;
  --topbar-h:     56px;
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;
  --radius-full:  9999px;

  /* Transitions */
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:     120ms;
  --dur-med:      240ms;
  --dur-slow:     400ms;

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:    0 24px 64px rgba(0,0,0,0.6);
  --shadow-glow:  0 0 40px var(--accent-glow);

  /* Safe areas */
  --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);
}

/* Light theme overrides */
.theme-light {
  --bg:           #f4f4f8;
  --bg-2:         #ebebf0;
  --surface-1:    #ffffff;
  --surface-2:    #f8f8fc;
  --surface-3:    #eeeef5;
  --surface-4:    #e4e4ed;
  --border:       rgba(0,0,0,0.07);
  --border-2:     rgba(0,0,0,0.12);
  --text-1:       #12121a;
  --text-2:       #50505e;
  --text-3:       #90909e;
  --text-inv:     #f0f0f5;
  --accent-glow:  rgba(139,92,246,0.15);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg:    0 24px 64px rgba(0,0,0,0.16);
}

/* ── 2. RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.55;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  /* Subtle noise grain overlay */
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.5;
}

.theme-light body::before { opacity: 0.2; }

button, input, textarea, select {
  font-family: var(--font-body);
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
}

input, textarea, select {
  cursor: text;
}

button { cursor: pointer; }
a { color: var(--accent-1); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── 3. SPLASH SCREEN ─────────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.splash.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

#splash-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.splash-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: orbFloat 8s ease-in-out infinite;
}

.splash-orb--1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 70%);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.splash-orb--2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(236,72,153,0.3), transparent 70%);
  bottom: -80px; right: -80px;
  animation-delay: -3s;
}
.splash-orb--3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(6,182,212,0.25), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.95); }
}

.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.splash-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.splash-sword {
  font-size: 48px;
  animation: swordPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(139,92,246,0.8));
}

@keyframes swordPulse {
  0%, 100% { transform: scale(1) rotate(-5deg); filter: drop-shadow(0 0 20px rgba(139,92,246,0.8)); }
  50%       { transform: scale(1.1) rotate(5deg); filter: drop-shadow(0 0 35px rgba(236,72,153,0.9)); }
}

.splash-wordmark {
  display: flex;
  font-family: var(--font-display);
  font-size: clamp(40px, 10vw, 64px);
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-letter {
  display: inline-block;
  animation: letterDrop 0.6s var(--ease-spring) both;
  animation-delay: calc(var(--i) * 80ms + 200ms);
}

@keyframes letterDrop {
  0% { transform: translateY(-40px) rotate(-15deg); opacity: 0; }
  100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}

.splash-tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-3);
  animation: fadeIn 0.6s ease 1s both;
}

.splash-bar-wrap {
  width: min(280px, 70vw);
  height: 3px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  animation: fadeIn 0.4s ease 0.8s both;
}

.splash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  border-radius: var(--radius-full);
  animation: barFill 2s var(--ease-out) 0.5s both;
  background-size: 200% 100%;
  animation: barFill 2s var(--ease-out) 0.5s both, shimmer 1.5s linear 0.5s infinite;
}

@keyframes barFill {
  from { width: 0%; }
  to   { width: 100%; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.splash-status {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  animation: fadeIn 0.4s ease 1.2s both;
  min-height: 18px;
}

/* ── 4. ONBOARDING ────────────────────────────────────────────── */
.onboarding {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.onboarding-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.onboarding-card {
  position: relative;
  z-index: 1;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 6vw, 48px);
  width: min(480px, 100%);
  box-shadow: var(--shadow-lg), 0 0 80px var(--accent-glow);
  animation: cardReveal 0.6s var(--ease-spring);
}

@keyframes cardReveal {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.onboard-step { animation: stepIn 0.4s var(--ease-spring); }
.onboard-step.hidden { display: none !important; }

@keyframes stepIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.onboard-step-indicator {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface-4);
  transition: all var(--dur-med) var(--ease-spring);
}
.step-dot.active {
  width: 24px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
}
.step-dot.done { background: var(--accent-1); }

.onboard-icon {
  font-size: 52px;
  text-align: center;
  margin-bottom: 16px;
  animation: iconBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 16px var(--accent-glow));
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.onboard-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  text-align: center;
  color: var(--text-1);
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-1) 40%, var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.onboard-sub {
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.onboard-input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 20px;
  transition: border-color var(--dur-med), box-shadow var(--dur-med);
  text-align: center;
}

.onboard-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.onboard-input::placeholder { color: var(--text-3); font-weight: 400; }

.onboard-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-med), opacity var(--dur-fast);
  box-shadow: 0 4px 20px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.onboard-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  opacity: 0;
  transition: opacity var(--dur-med);
}

.onboard-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px var(--accent-glow); }
.onboard-btn:hover::before { opacity: 1; }
.onboard-btn:active { transform: translateY(0) scale(0.98); }
.onboard-btn span { position: relative; z-index: 1; }

.onboard-avatars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (max-width: 380px) {
  .onboard-avatars { grid-template-columns: repeat(4, 1fr); }
}

.avatar-pick {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 2px solid transparent;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-med) var(--ease-spring);
  cursor: pointer;
}

.avatar-pick:hover {
  transform: scale(1.12) rotate(5deg);
  border-color: var(--accent-1);
  background: var(--surface-3);
}

.avatar-pick.active {
  border-color: var(--accent-2);
  background: rgba(236,72,153,0.15);
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(236,72,153,0.4);
}

.onboard-goal-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.goal-pick {
  padding: 16px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 2px solid transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  line-height: 1.6;
}

.goal-pick small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }
.goal-pick:hover { border-color: var(--border-2); transform: translateY(-2px); }
.goal-pick.active {
  border-color: var(--accent-1);
  background: rgba(139,92,246,0.15);
  color: var(--text-1);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

/* ── 5. AUTH MODAL ────────────────────────────────────────────── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-modal-card {
  position: relative;
  z-index: 1;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: clamp(32px, 7vw, 52px);
  width: min(420px, 100%);
  text-align: center;
  overflow: hidden;
  animation: cardReveal 0.5s var(--ease-spring);
  box-shadow: var(--shadow-lg), 0 0 80px var(--accent-glow);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: orbFloat 6s ease-in-out infinite;
}
.auth-orb--1 { width:200px;height:200px; background:rgba(139,92,246,0.3); top:-60px; left:-60px; }
.auth-orb--2 { width:180px;height:180px; background:rgba(236,72,153,0.25); bottom:-50px; right:-50px; animation-delay:-3s; }
.auth-orb--3 { width:150px;height:150px; background:rgba(6,182,212,0.2); top:50%; right:-30px; animation-delay:-5s; }

.auth-logo { font-size: 48px; margin-bottom: 12px; filter: drop-shadow(0 0 16px var(--accent-glow)); }
.auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-1), var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.auth-sub { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  text-align: left;
}

.auth-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.auth-feat span { font-size: 18px; }

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 24px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  margin-bottom: 16px;
}

.google-btn:hover {
  background: var(--surface-3);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.google-btn:active { transform: translateY(0) scale(0.98); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-3);
  font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-skip-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1.5px solid var(--border-2);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--dur-med);
  margin-bottom: 16px;
}
.auth-skip-btn:hover { background: var(--surface-2); color: var(--text-1); }
.auth-note { font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ── 6. FIREBASE CONFIG MODAL ─────────────────────────────────── */
.firebase-config-modal {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fcm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.fcm-card {
  position: relative;
  z-index: 1;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  animation: cardReveal 0.4s var(--ease-spring);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(249,115,22,0.2);
}

.fcm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.fcm-icon { font-size: 28px; }
.fcm-header h2 { font-family: var(--font-display); font-size: 22px; font-weight: 800; flex: 1; }
.fcm-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.fcm-close:hover { background: var(--danger); color: #fff; }

.fcm-sub { color: var(--text-2); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

.fcm-steps { margin-bottom: 20px; }
.fcm-step {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.fcm-step summary {
  font-size: 13px;
  color: var(--accent-1);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.fcm-step summary::-webkit-details-marker { display: none; }
.fcm-step summary::before { content: '▸ '; }
.fcm-step[open] summary::before { content: '▾ '; }
.fcm-step ol { padding-left: 20px; font-size: 13px; color: var(--text-2); margin-top: 10px; line-height: 2; }
.fcm-step a { color: var(--accent-3); }
.fcm-step code { background: var(--surface-3); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 12px; }

.fcm-label { display: block; font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.fcm-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
  resize: vertical;
  min-height: 160px;
  transition: border-color var(--dur-med);
  margin-bottom: 16px;
}
.fcm-textarea:focus { border-color: var(--accent-1); }

.fcm-actions { display: flex; gap: 12px; margin-bottom: 16px; }
.fcm-save-btn {
  flex: 1;
  padding: 14px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--dur-med);
  box-shadow: 0 4px 20px rgba(249,115,22,0.3);
}
.fcm-save-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(249,115,22,0.4); }
.fcm-cancel-btn { padding: 14px 20px; background: var(--surface-3); border-radius: var(--radius-md); color: var(--text-2); cursor: pointer; transition: all var(--dur-med); }
.fcm-cancel-btn:hover { background: var(--surface-4); color: var(--text-1); }
.fcm-security-note { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }

/* ── 7. LEVEL-UP OVERLAY ──────────────────────────────────────── */
.levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}

#levelup-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.levelup-content {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: levelupReveal 0.6s var(--ease-spring);
}

@keyframes levelupReveal {
  from { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.levelup-badge {
  font-size: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 40px rgba(139,92,246,0.9));
  animation: badgeSpin 1s var(--ease-spring) 0.3s both;
}

@keyframes badgeSpin {
  from { transform: scale(0) rotate(-180deg); }
  to   { transform: scale(1) rotate(0deg); }
}

.levelup-text {
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  animation: textGlow 1.5s ease-in-out infinite alternate;
}

@keyframes textGlow {
  from { filter: drop-shadow(0 0 8px rgba(139,92,246,0.5)); }
  to   { filter: drop-shadow(0 0 24px rgba(236,72,153,0.8)); }
}

.levelup-level {
  font-size: clamp(20px, 5vw, 28px);
  color: var(--text-1);
  font-family: var(--font-display);
  font-weight: 700;
}
.levelup-title-text { font-size: 16px; color: var(--text-2); margin-top: 4px; }

/* ── 8. ACHIEVEMENT TOAST ─────────────────────────────────────── */
.achievement-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 9000;
  background: var(--surface-2);
  border: 1px solid var(--accent-1);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
  min-width: 280px;
  max-width: min(380px, calc(100vw - 40px));
  transition: transform 0.5s var(--ease-spring), opacity 0.3s ease;
}

.achievement-toast.show {
  transform: translateX(-50%) translateY(0);
}

.ach-toast-icon { font-size: 32px; flex-shrink: 0; }
.ach-toast-body { flex: 1; }
.ach-toast-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-1); font-weight: 700; margin-bottom: 2px; font-family: var(--font-mono); }
.ach-toast-name { font-size: 15px; font-weight: 700; color: var(--text-1); font-family: var(--font-display); }
.ach-toast-xp { font-family: var(--font-mono); font-size: 13px; color: var(--accent-2); font-weight: 700; flex-shrink: 0; }

/* ── 9. XP BURST ──────────────────────────────────────────────── */
#xp-burst-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9100;
  overflow: hidden;
}

.xp-burst {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-1);
  pointer-events: none;
  animation: xpFloat 1.2s var(--ease-out) forwards;
  text-shadow: 0 0 10px var(--accent-glow);
  white-space: nowrap;
}

@keyframes xpFloat {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  60%  { transform: translateY(-60px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-100px) scale(0.8); opacity: 0; }
}

/* ── 10. NOTIFICATION PANEL ───────────────────────────────────── */
.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 7000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100vw);
  background: var(--surface-1);
  border-left: 1px solid var(--border-2);
  z-index: 7100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}

.notif-panel.open {
  transform: translateX(0);
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  padding-top: calc(20px + var(--safe-top));
}

.notif-panel-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.notif-panel-actions { display: flex; align-items: center; gap: 10px; }
.notif-clear-all { font-size: 13px; color: var(--text-3); cursor: pointer; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--surface-3); transition: all var(--dur-fast); }
.notif-clear-all:hover { background: var(--surface-4); color: var(--danger); }
.notif-panel-close { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all var(--dur-fast); }
.notif-panel-close:hover { background: var(--surface-4); }

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast);
  margin-bottom: 4px;
  position: relative;
}

.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: rgba(139,92,246,0.06); }
.notif-item-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.notif-item-body { flex: 1; }
.notif-item-msg { font-size: 14px; color: var(--text-1); line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--text-3); margin-top: 3px; font-family: var(--font-mono); }
.notif-item-dot {
  width: 7px; height: 7px;
  background: var(--accent-1);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.7; }
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-3);
}
.notif-empty span { font-size: 40px; opacity: 0.4; }
.notif-empty p { font-size: 14px; }

/* ── 11. APP SHELL ────────────────────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

/* ── 12. TOP BAR ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  padding-top: var(--safe-top);
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  display: flex;
  align-items: center;
  background: rgba(6,6,11,0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-med);
}

.theme-light .topbar { background: rgba(244,244,248,0.9); }

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-sword { font-size: 22px; filter: drop-shadow(0 0 8px var(--accent-glow)); }
.topbar-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-1) 40%, var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.sync-dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulseDot 1.5s ease-in-out infinite;
}

.sync-dot.syncing { background: var(--warning); }

.topbar-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 10px 4px 8px;
  cursor: default;
}

.streak-fire { font-size: 16px; }
.streak-count {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--warning);
}

.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
  transition: all var(--dur-med) var(--ease-spring);
  flex-shrink: 0;
}

.topbar-icon-btn:hover {
  background: var(--surface-3);
  color: var(--text-1);
  transform: scale(1.08);
  border-color: var(--border-2);
}
.topbar-icon-btn:active { transform: scale(0.94); }

.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 18px; height: 18px;
  background: var(--danger);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: var(--font-mono);
  border: 2px solid var(--bg);
  animation: badgePop 0.3s var(--ease-spring);
}

@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.topbar-user-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-1);
}

/* ── 13. MAIN CONTENT & SECTIONS ──────────────────────────────── */
.main-content {
  flex: 1;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
}

.section {
  display: none;
  padding: 16px max(16px, var(--safe-left)) 20px;
  animation: sectionIn 0.35s var(--ease-out);
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.section.active { display: block; }

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-1) 40%, var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 4px 16px var(--accent-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

.add-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.add-btn:active { transform: scale(0.96); }

/* ── 14. DASHBOARD ────────────────────────────────────────────── */
.daily-brief {
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(236,72,153,0.08));
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: briefSlide 0.5s var(--ease-spring);
}

@keyframes briefSlide {
  from { transform: translateX(-20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.brief-text { font-size: 14px; color: var(--text-2); line-height: 1.5; flex: 1; }
.brief-dismiss { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--dur-fast); }
.brief-dismiss:hover { background: var(--surface-4); }

/* XP Hero */
.xp-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.xp-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.xp-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.xp-ring-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.xp-ring-bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 10;
}

.xp-ring-fill {
  fill: none;
  stroke: url(#xp-grad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1s var(--ease-out);
}

.xp-orbit-dot {
  fill: var(--accent-2);
  filter: drop-shadow(0 0 6px var(--accent-2));
  animation: orbitDot 3s linear infinite;
}

@keyframes orbitDot {
  from { transform-origin: 90px 90px; transform: rotate(0deg) translateX(70px); }
  to   { transform-origin: 90px 90px; transform: rotate(360deg) translateX(70px); }
}

.xp-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.xp-level-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.xp-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.xp-info { flex: 1; min-width: 0; }
.xp-title-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 4px;
}
.xp-counts { font-family: var(--font-mono); font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.xp-to-next { font-size: 12px; color: var(--text-3); }

/* Stat Pills */
.stat-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 380px) {
  .stat-pills { grid-template-columns: repeat(2, 1fr); }
}

.stat-pill {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  transition: all var(--dur-med) var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.stat-pill::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transform: scaleX(0);
  transition: transform var(--dur-med);
}

.stat-pill:hover { border-color: var(--border-2); transform: translateY(-2px); }
.stat-pill:hover::before { transform: scaleX(1); }

.stat-pill--streak .stat-pill-val { color: var(--warning); }

.stat-pill-val {
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 800;
  color: var(--accent-1);
  line-height: 1;
  margin-bottom: 4px;
  transition: transform var(--dur-fast);
}

.stat-pill-val.bump {
  animation: numBump 0.3s var(--ease-spring);
}

@keyframes numBump {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}

.stat-pill-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-mono); }

/* Quick Add */
.quick-add-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  transition: border-color var(--dur-med), box-shadow var(--dur-med);
}

.quick-add-card:focus-within {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.quick-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.quick-task-input {
  flex: 1;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-1);
  transition: border-color var(--dur-med);
  min-width: 0;
}

.quick-task-input:focus { border-color: var(--accent-1); }
.quick-task-input::placeholder { color: var(--text-3); }

.quick-add-submit {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.quick-add-submit:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 6px 20px var(--accent-glow); }
.quick-add-submit:active { transform: scale(0.95); }

.quick-add-opts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.priority-btns {
  display: flex;
  gap: 6px;
  flex: 1;
}

.prio-btn {
  flex: 1;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  transition: all var(--dur-med) var(--ease-spring);
  font-family: var(--font-mono);
}

.prio-btn:hover { color: var(--text-1); border-color: var(--border-2); }
.prio-btn[data-priority="low"].active   { color: var(--prio-low); border-color: var(--prio-low); background: rgba(16,185,129,0.1); }
.prio-btn[data-priority="medium"].active { color: var(--prio-med); border-color: var(--prio-med); background: rgba(245,158,11,0.1); }
.prio-btn[data-priority="high"].active   { color: var(--prio-high); border-color: var(--prio-high); background: rgba(239,68,68,0.1); }

.quick-task-date {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-2);
  transition: border-color var(--dur-med);
  cursor: pointer;
}
.quick-task-date:focus { border-color: var(--accent-1); }

/* Home Cards */
.home-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}

.home-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.home-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-count {
  background: var(--accent-1);
  color: #fff;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.card-see-more {
  font-size: 13px;
  color: var(--accent-1);
  font-weight: 600;
  transition: all var(--dur-fast);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.card-see-more:hover { background: rgba(139,92,246,0.1); }

.today-task-list { display: flex; flex-direction: column; gap: 8px; }

.today-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--dur-fast);
  animation: itemSlideIn 0.3s var(--ease-spring) both;
}

@keyframes itemSlideIn {
  from { transform: translateX(-10px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.today-task-item:hover { border-color: var(--border-2); }

.today-check-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  background: transparent;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-med) var(--ease-spring);
  font-size: 12px;
}
.today-check-btn:hover { border-color: var(--accent-1); background: rgba(139,92,246,0.15); transform: scale(1.15); }
.today-check-btn.checked { background: var(--accent-1); border-color: var(--accent-1); color: #fff; }

.today-task-text { flex: 1; font-size: 14px; min-width: 0; truncate: true; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-task-text.done { text-decoration: line-through; color: var(--text-3); }

.today-task-prio {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.today-task-prio[data-priority="low"]    { background: var(--prio-low); }
.today-task-prio[data-priority="medium"] { background: var(--prio-med); }
.today-task-prio[data-priority="high"]   { background: var(--prio-high); box-shadow: 0 0 6px rgba(239,68,68,0.5); }

.today-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 14px;
}
.today-empty span { font-size: 32px; display: block; margin-bottom: 8px; }

/* Widget Grid */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

@media (min-width: 480px) {
  .widget-grid { grid-template-columns: repeat(3, 1fr); }
}

.widget {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.widget::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  opacity: 0;
  transition: opacity var(--dur-med);
}

.widget:hover {
  border-color: var(--accent-1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.widget:hover::before { opacity: 0.05; }
.widget:active { transform: translateY(0) scale(0.97); }

.widget-icon { font-size: 24px; flex-shrink: 0; position: relative; z-index: 1; }
.widget-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.widget-title { font-size: 13px; font-weight: 700; font-family: var(--font-display); color: var(--text-1); margin-bottom: 2px; }
.widget-preview { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-arrow { font-size: 16px; color: var(--text-3); position: relative; z-index: 1; transition: transform var(--dur-med); flex-shrink: 0; }
.widget:hover .widget-arrow { transform: translateX(4px); color: var(--accent-1); }

/* ── 15. TASKS SECTION ────────────────────────────────────────── */
.task-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  pointer-events: none;
  flex-shrink: 0;
}

.task-search {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px 10px 36px;
  font-size: 14px;
  color: var(--text-1);
  transition: border-color var(--dur-med), box-shadow var(--dur-med);
  cursor: text;
}
.task-search:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-glow); }
.task-search::placeholder { color: var(--text-3); }

.task-view-btns { display: flex; gap: 4px; flex-shrink: 0; }
.view-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all var(--dur-med);
}
.view-btn.active { background: rgba(139,92,246,0.15); border-color: var(--accent-1); color: var(--accent-1); }
.view-btn:hover { color: var(--text-1); }

.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--dur-med) var(--ease-spring);
  flex-shrink: 0;
  font-family: var(--font-display);
}

.filter-tab:hover { color: var(--text-1); border-color: var(--border-2); }
.filter-tab.active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* Task cards */
.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all var(--dur-med) var(--ease-spring);
  animation: itemSlideIn 0.3s var(--ease-spring) both;
  touch-action: pan-y;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 2px;
}

.task-card[data-priority="low"]::before    { background: var(--prio-low); }
.task-card[data-priority="medium"]::before { background: var(--prio-med); }
.task-card[data-priority="high"]::before   { background: var(--prio-high); box-shadow: 0 0 8px rgba(239,68,68,0.4); }

.task-card:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.task-card.completed { opacity: 0.55; }
.task-card.overdue { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.04); }

.task-card.swipe-delete {
  animation: swipeOut 0.3s var(--ease-in) forwards;
}

@keyframes swipeOut {
  to { transform: translateX(-100%); opacity: 0; height: 0; padding: 0; margin: 0; border-width: 0; }
}

.task-card.fade-out {
  animation: fadeOutScale 0.3s var(--ease-in) forwards;
}

@keyframes fadeOutScale {
  to { transform: scale(0.9); opacity: 0; height: 0; padding: 0; margin: 0; border-width: 0; }
}

.task-checkbox {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  background: transparent;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  margin-top: 1px;
  font-size: 13px;
}
.task-checkbox:hover { border-color: var(--accent-1); background: rgba(139,92,246,0.1); transform: scale(1.1); }
.task-checkbox.checked { background: var(--accent-1); border-color: var(--accent-1); color: #fff; transform: scale(1); }
.task-checkbox.checked:hover { background: var(--accent-2); border-color: var(--accent-2); }

.task-main { flex: 1; min-width: 0; }
.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
}

.task-title.done { text-decoration: line-through; color: var(--text-3); }

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-meta-item {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-meta-item.overdue { color: var(--danger); }

.task-category-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.task-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.task-card:hover .task-actions { opacity: 1; }

/* Always visible on mobile */
@media (hover: none) {
  .task-actions { opacity: 1; }
}

.task-action-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all var(--dur-fast);
  color: var(--text-3);
}
.task-action-btn:hover { background: var(--surface-4); color: var(--text-1); }
.task-action-btn.delete:hover { background: rgba(239,68,68,0.2); color: var(--danger); }

/* Kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-height: 400px;
}

@media (max-width: 500px) {
  .kanban-board { grid-template-columns: 1fr; }
}

.kanban-col {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 200px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.kanban-col-header h3 { font-size: 13px; font-weight: 700; font-family: var(--font-display); flex: 1; }
.kanban-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-todo { background: var(--text-3); }
.dot-progress { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.dot-done { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.kanban-col-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

.kanban-cards { display: flex; flex-direction: column; gap: 8px; }

.kanban-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 13px;
  cursor: grab;
  transition: all var(--dur-fast);
  animation: itemSlideIn 0.3s var(--ease-spring) both;
}
.kanban-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }

/* Bulk bar */
.bulk-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  background: var(--surface-2);
  border: 1px solid var(--accent-1);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
  animation: slideUp 0.3s var(--ease-spring);
  flex-wrap: wrap;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

#bulk-count { font-size: 13px; color: var(--text-2); font-family: var(--font-mono); flex: 1; }
.bulk-btn { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; transition: all var(--dur-fast); }
.bulk-btn--complete { background: rgba(16,185,129,0.15); color: var(--success); }
.bulk-btn--complete:hover { background: rgba(16,185,129,0.25); }
.bulk-btn--delete { background: rgba(239,68,68,0.15); color: var(--danger); }
.bulk-btn--delete:hover { background: rgba(239,68,68,0.25); }
.bulk-btn--cancel { background: var(--surface-3); color: var(--text-2); }

/* Empty state */
.tasks-empty, .habits-empty, .notes-empty, .vault-empty, .journal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
  animation: fadeIn 0.4s ease;
}

.empty-icon { font-size: 48px; opacity: 0.4; margin-bottom: 4px; }
.tasks-empty h3, .habits-empty h3, .notes-empty h3, .vault-empty h3, .journal-empty h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
}
.tasks-empty p, .habits-empty p, .notes-empty p, .vault-empty p, .journal-empty p {
  font-size: 14px;
  color: var(--text-3);
}

/* ── 16. HABITS SECTION ───────────────────────────────────────── */
.habit-date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.habit-day-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 18px;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.habit-day-btn:hover { background: var(--surface-3); color: var(--text-1); }

.habit-week-strip {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.habit-week-strip::-webkit-scrollbar { display: none; }

.habit-day-tab {
  flex: 1;
  min-width: 40px;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
}

.habit-day-tab .day-letter { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; }
.habit-day-tab .day-num { font-size: 14px; font-weight: 700; font-family: var(--font-display); color: var(--text-2); }
.habit-day-tab .day-dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; margin-top: 2px; }

.habit-day-tab.active {
  background: rgba(139,92,246,0.15);
  border-color: var(--accent-1);
}
.habit-day-tab.active .day-num { color: var(--accent-1); }
.habit-day-tab.has-activity .day-dot { background: var(--success); box-shadow: 0 0 4px rgba(16,185,129,0.5); }

/* Habit summary ring */
.habits-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.habits-ring-wrap {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}

.habits-ring-svg {
  width: 80px; height: 80px;
  transform: rotate(-90deg);
}

.habits-ring-bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 8;
}

.habits-ring-fill {
  fill: none;
  stroke: var(--success);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset 0.8s var(--ease-out);
  filter: drop-shadow(0 0 6px rgba(16,185,129,0.5));
}

.habits-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.habits-summary-pct {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--success), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.habits-summary-label { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* Habit items */
.habit-list { display: flex; flex-direction: column; gap: 10px; }

.habit-item {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--dur-med) var(--ease-spring);
  animation: itemSlideIn 0.3s var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}

.habit-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--habit-color, var(--accent-1));
  border-radius: 2px;
}

.habit-item:hover { border-color: var(--border-2); transform: translateY(-1px); }

.habit-icon { font-size: 24px; flex-shrink: 0; }
.habit-info { flex: 1; min-width: 0; }
.habit-name { font-size: 15px; font-weight: 600; font-family: var(--font-display); color: var(--text-1); margin-bottom: 2px; }
.habit-streak { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

.habit-complete-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--habit-color, var(--border-2));
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  flex-shrink: 0;
}
.habit-complete-btn:hover { transform: scale(1.15); background: rgba(139,92,246,0.1); }
.habit-complete-btn.done {
  background: var(--habit-color, var(--accent-1));
  border-color: var(--habit-color, var(--accent-1));
  color: #fff;
  transform: scale(1);
  box-shadow: 0 0 16px var(--habit-color, var(--accent-glow));
}

.habit-delete-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: all var(--dur-fast);
}
.habit-item:hover .habit-delete-btn { opacity: 1; }
.habit-delete-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
@media (hover: none) { .habit-delete-btn { opacity: 1; } }

/* ── 17. FOCUS SECTION ────────────────────────────────────────── */
.focus-today-min {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-3);
  background: rgba(6,182,212,0.1);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(6,182,212,0.2);
}

.focus-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.focus-tab {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-2);
  transition: all var(--dur-med) var(--ease-spring);
}
.focus-tab:hover { color: var(--text-1); border-color: var(--border-2); }
.focus-tab.active {
  background: rgba(139,92,246,0.15);
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.focus-panel { animation: sectionIn 0.3s var(--ease-out); }

/* Pomodoro cycles */
.pomodoro-cycles {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.pomo-cycle {
  font-size: 22px;
  opacity: 0.3;
  transition: all var(--dur-med) var(--ease-spring);
  filter: grayscale(1);
}

.pomo-cycle.done {
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1.15);
  animation: pomoDone 0.4s var(--ease-spring);
}

@keyframes pomoDone {
  0%,100% { transform: scale(1.15); }
  50%      { transform: scale(1.35) rotate(10deg); }
}

.pomo-mode-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

/* Timer Ring */
.timer-ring-wrap {
  position: relative;
  width: min(240px, 70vw);
  height: min(240px, 70vw);
  margin: 0 auto 24px;
}

.timer-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 8;
}

.timer-ring-fill {
  fill: none;
  stroke: url(#timer-grad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 629;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke var(--dur-med);
  filter: drop-shadow(0 0 8px rgba(139,92,246,0.6));
}

.timer-ring-fill.break { stroke: var(--success); filter: drop-shadow(0 0 8px rgba(16,185,129,0.6)); }

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: clamp(32px, 10vw, 48px);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -1px;
  line-height: 1;
}

.timer-task-link {
  font-size: 11px;
  color: var(--text-3);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Timer controls */
.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.timer-adjust {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-2);
  transition: all var(--dur-med) var(--ease-spring);
}
.timer-adjust:hover { background: var(--surface-3); color: var(--text-1); transform: scale(1.1); border-color: var(--border-2); }
.timer-adjust:active { transform: scale(0.95); }

.timer-main-btn {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 4px 24px var(--accent-glow);
}
.timer-main-btn:hover { transform: scale(1.08); box-shadow: 0 8px 32px var(--accent-glow); }
.timer-main-btn:active { transform: scale(0.95); }
.timer-main-btn.paused svg { opacity: 0.8; }

.timer-secondary-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.timer-sec-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
  transition: all var(--dur-med);
}
.timer-sec-btn:hover { background: var(--surface-3); color: var(--text-1); border-color: var(--border-2); }

.timer-custom-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.timer-custom-label { font-size: 13px; color: var(--text-3); }
.timer-custom-input {
  width: 70px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: center;
  color: var(--text-1);
  transition: border-color var(--dur-med);
}
.timer-custom-input:focus { border-color: var(--accent-1); }
.timer-custom-set {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: rgba(139,92,246,0.15);
  border: 1px solid var(--accent-1);
  color: var(--accent-1);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--dur-fast);
}
.timer-custom-set:hover { background: rgba(139,92,246,0.25); }

/* Ambient sounds */
.ambient-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.ambient-label { font-size: 13px; font-weight: 700; color: var(--text-2); font-family: var(--font-display); margin-bottom: 12px; }

.ambient-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 400px) {
  .ambient-btns { grid-template-columns: repeat(6, 1fr); }
}

.ambient-btn {
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  text-align: center;
  transition: all var(--dur-med) var(--ease-spring);
  cursor: pointer;
  line-height: 1.4;
}
.ambient-btn:hover { background: var(--surface-3); color: var(--text-1); border-color: var(--border-2); }
.ambient-btn.active {
  background: rgba(6,182,212,0.15);
  border-color: var(--accent-3);
  color: var(--accent-3);
  animation: ambientPulse 2s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.3); }
  50%       { box-shadow: 0 0 0 4px rgba(6,182,212,0.1); }
}

.ambient-vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ambient-mute-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
  transition: all var(--dur-fast);
}
.ambient-mute-btn:hover { color: var(--text-1); }
.ambient-mute-btn.muted { color: var(--danger); }

.ambient-vol {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}
.ambient-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-1);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform var(--dur-fast);
}
.ambient-vol::-webkit-slider-thumb:hover { transform: scale(1.3); }

.ambient-vol-val { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); min-width: 30px; }

/* Focus session history */
.focus-history {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.focus-history-header { margin-bottom: 12px; }
.focus-history-header h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-2); }

.focus-session-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }

.focus-session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
}

.fsi-icon { font-size: 16px; }
.fsi-dur { font-family: var(--font-mono); color: var(--accent-3); font-weight: 700; }
.fsi-task { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsi-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* Stopwatch */
.sw-display {
  font-family: var(--font-mono);
  font-size: clamp(36px, 12vw, 56px);
  font-weight: 700;
  text-align: center;
  margin: 20px 0 24px;
  background: linear-gradient(135deg, var(--text-1), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
}

.sw-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.sw-btn {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  transition: all var(--dur-med) var(--ease-spring);
}

.sw-btn--start { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: #fff; box-shadow: 0 4px 20px var(--accent-glow); }
.sw-btn--start:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--accent-glow); }
.sw-btn--lap { background: var(--surface-2); border: 1.5px solid var(--border-2); color: var(--text-2); }
.sw-btn--lap:hover:not(:disabled) { background: var(--surface-3); color: var(--text-1); }
.sw-btn--lap:disabled { opacity: 0.4; cursor: not-allowed; }
.sw-btn--reset { background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text-3); }
.sw-btn--reset:hover { background: var(--surface-3); color: var(--text-1); }
.sw-btn--fs { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); padding: 12px 16px; }
.sw-btn--fs:hover { color: var(--text-1); }

.sw-laps { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }

.sw-lap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  animation: itemSlideIn 0.3s var(--ease-spring);
}
.sw-lap-item.fastest { color: var(--success); background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.sw-lap-item.slowest { color: var(--danger); background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.15); }
.sw-lap-num { color: var(--text-3); min-width: 30px; }
.sw-lap-time { flex: 1; }
.sw-lap-delta { color: var(--text-3); font-size: 11px; }

/* Analog clock */
.clock-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 24px; }

.analog-clock-svg {
  width: min(220px, 80vw);
  height: min(220px, 80vw);
  drop-shadow: 0 0 40px var(--accent-glow);
  filter: drop-shadow(0 4px 20px rgba(139,92,246,0.3));
}

.clock-face { fill: var(--surface-2); stroke: var(--border-2); stroke-width: 2; }
.clock-hand { stroke: var(--text-1); transition: none; }
.clock-hand--hour { stroke: var(--text-1); }
.clock-hand--minute { stroke: rgba(255,255,255,0.85); }
.clock-hand--second { stroke: var(--accent-1); filter: drop-shadow(0 0 4px var(--accent-glow)); }
.clock-center-cap { fill: var(--accent-1); filter: drop-shadow(0 0 6px var(--accent-glow)); }

.clock-digital {
  font-family: var(--font-mono);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 1px;
}

.clock-controls { display: flex; justify-content: center; gap: 12px; }
.clock-btn {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--dur-med);
}
.clock-btn:hover { background: var(--surface-3); color: var(--text-1); }
.clock-btn.active { background: rgba(139,92,246,0.15); border-color: var(--accent-1); color: var(--accent-1); }

/* ── 18. JOURNAL SECTION ──────────────────────────────────────── */
.journal-editor {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 24px;
  transition: border-color var(--dur-med), box-shadow var(--dur-med);
}

.journal-editor:focus-within {
  border-color: rgba(139,92,246,0.3);
  box-shadow: 0 0 0 4px rgba(139,92,246,0.06);
}

.mood-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mood-row::-webkit-scrollbar { display: none; }

.mood-pill {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: all var(--dur-med) var(--ease-spring);
  flex-shrink: 0;
}
.mood-pill:hover { color: var(--text-1); border-color: var(--border-2); transform: translateY(-1px); }
.mood-pill.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(236,72,153,0.15));
  border-color: var(--accent-1);
  color: var(--text-1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.journal-prompt-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  animation: briefSlide 0.3s var(--ease-spring);
}
.prompt-icon { font-size: 18px; flex-shrink: 0; }
#journal-prompt-text { flex: 1; }
.prompt-dismiss { font-size: 12px; color: var(--text-3); flex-shrink: 0; transition: color var(--dur-fast); }
.prompt-dismiss:hover { color: var(--text-1); }

.journal-title-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border);
  padding: 8px 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 14px;
  transition: border-color var(--dur-med);
}
.journal-title-input:focus { border-bottom-color: var(--accent-1); }
.journal-title-input::placeholder { color: var(--text-3); font-weight: 400; }

.journal-body {
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.7;
  margin-bottom: 14px;
  min-height: 140px;
  font-family: var(--font-body);
}
.journal-body::placeholder { color: var(--text-3); }

.journal-footer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.journal-word-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.journal-word-goal { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

.save-btn {
  margin-left: auto;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 4px 16px var(--accent-glow);
  white-space: nowrap;
}
.save-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.save-btn:active { transform: scale(0.97); }

.journal-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.journal-mood-filter {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--dur-med);
  flex-shrink: 0;
}
.journal-mood-filter:focus { border-color: var(--accent-1); }

/* Journal entry cards */
.journal-list { display: flex; flex-direction: column; gap: 12px; }

.journal-entry-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  animation: itemSlideIn 0.3s var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}

.journal-entry-card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.journal-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.journal-entry-mood { font-size: 20px; flex-shrink: 0; }
.journal-entry-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journal-entry-date { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); flex-shrink: 0; }

.journal-entry-preview { font-size: 13px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.journal-entry-footer { display: flex; align-items: center; gap: 10px; }
.journal-entry-words { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

.journal-entry-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.journal-entry-card:hover .journal-entry-actions { opacity: 1; }
@media (hover: none) { .journal-entry-actions { opacity: 1; } }

.entry-action-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-3);
  transition: all var(--dur-fast);
}
.entry-action-btn:hover { color: var(--text-1); background: var(--surface-4); }
.entry-action-btn.delete:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ── 19. NOTES SECTION ────────────────────────────────────────── */
.notes-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.notes-tag-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.notes-tag-filter::-webkit-scrollbar { display: none; }

.notes-tag-btn {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--dur-med) var(--ease-spring);
}
.notes-tag-btn:hover { color: var(--text-1); border-color: var(--border-2); }
.notes-tag-btn.active {
  background: rgba(139,92,246,0.15);
  border-color: var(--accent-1);
  color: var(--accent-1);
}

/* Note editor */
.note-editor {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 24px;
  animation: cardReveal 0.3s var(--ease-spring);
}

.note-title-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border);
  padding: 8px 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 12px;
  transition: border-color var(--dur-med);
}
.note-title-input:focus { border-bottom-color: var(--accent-1); }
.note-title-input::placeholder { color: var(--text-3); font-weight: 400; }

/* Rich text toolbar */
.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.rte-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast);
}
.rte-btn:hover { background: var(--surface-3); color: var(--text-1); }
.rte-btn.active { background: rgba(139,92,246,0.2); color: var(--accent-1); }

.rte-divider { width: 1px; height: 20px; background: var(--border); margin: 0 2px; flex-shrink: 0; }

.rte-select {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--dur-med);
  max-width: 80px;
}
.rte-select:focus { border-color: var(--accent-1); }

.rte-color {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: transparent;
  padding: 2px;
  transition: transform var(--dur-fast);
}
.rte-color:hover { transform: scale(1.1); }

.note-body-editor {
  min-height: 120px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
  border: 1.5px solid var(--border);
  transition: border-color var(--dur-med);
  outline: none;
}
.note-body-editor:focus { border-color: var(--accent-1); }
.note-body-editor[placeholder]:empty::before {
  content: attr(placeholder);
  color: var(--text-3);
  pointer-events: none;
}

.note-editor-footer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.note-tags-pick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.note-tag-pick {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  transition: all var(--dur-med) var(--ease-spring);
}
.note-tag-pick:hover { color: var(--text-1); border-color: var(--border-2); }
.note-tag-pick.active { background: rgba(139,92,246,0.15); border-color: var(--accent-1); color: var(--accent-1); }

.note-editor-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cancel-btn {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.cancel-btn:hover { background: var(--surface-4); color: var(--text-1); }

/* Notes grid */
.notes-grid {
  columns: 2;
  column-gap: 12px;
}

@media (min-width: 480px) { .notes-grid { columns: 3; } }
@media (max-width: 340px) { .notes-grid { columns: 1; } }

.note-card {
  break-inside: avoid;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  display: block;
  width: 100%;
  animation: itemSlideIn 0.3s var(--ease-spring) both;
  position: relative;
}

.note-card:hover { border-color: var(--border-2); transform: translateY(-3px); box-shadow: var(--shadow-sm); }

.note-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card-preview {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.note-card-footer { display: flex; align-items: center; justify-content: space-between; }
.note-tag-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(139,92,246,0.15);
  color: var(--accent-1);
  font-weight: 600;
  font-family: var(--font-mono);
}

.note-card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--dur-fast); }
.note-card:hover .note-card-actions { opacity: 1; }
@media (hover: none) { .note-card-actions { opacity: 1; } }

/* ── 20. VAULT SECTION ────────────────────────────────────────── */
.currency-toggle {
  display: flex;
  gap: 4px;
}

.currency-btn {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  font-family: var(--font-mono);
  transition: all var(--dur-med);
}
.currency-btn.active { background: rgba(139,92,246,0.15); border-color: var(--accent-1); color: var(--accent-1); }
.currency-btn:hover { color: var(--text-1); }

.vault-hero {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.vault-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(16,185,129,0.15), transparent 70%);
  pointer-events: none;
}

.vault-hero-label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 2px; font-family: var(--font-mono); margin-bottom: 8px; }

.vault-nw {
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--success), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  transition: all var(--dur-slow) var(--ease-out);
}

.vault-nw.negative {
  background: linear-gradient(135deg, var(--danger), var(--warning));
  -webkit-background-clip: text;
  background-clip: text;
}

.vault-nw-change { font-size: 13px; color: var(--text-3); font-family: var(--font-mono); margin-bottom: 20px; min-height: 18px; }
.vault-nw-change.positive { color: var(--success); }
.vault-nw-change.negative { color: var(--danger); }

.vault-totals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
}

.vault-total { text-align: center; padding: 0 24px; }
.vault-total-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-mono); margin-bottom: 4px; }
.vault-total-val { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.vault-total--assets .vault-total-val { color: var(--success); }
.vault-total--liabs .vault-total-val { color: var(--danger); }
.vault-total-divider { width: 1px; height: 40px; background: var(--border); }

.vault-snapshot-btn {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: rgba(16,185,129,0.15);
  border: 1.5px solid rgba(16,185,129,0.3);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
}
.vault-snapshot-btn:hover { background: rgba(16,185,129,0.25); transform: translateY(-2px); }

/* Vault chart */
.vault-chart-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
}

.vault-chart {
  width: 100%;
  height: 160px;
  display: block;
}

.vault-chart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 13px;
}

.vault-add-row { margin-bottom: 16px; }

.vault-cat-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.vault-cat-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-family: var(--font-display);
  transition: all var(--dur-med) var(--ease-spring);
}
.vault-cat-tab:hover { color: var(--text-1); border-color: var(--border-2); }
.vault-cat-tab.active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
}

/* Vault entry list */
.vault-entry-list { display: flex; flex-direction: column; gap: 8px; }

.vault-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: all var(--dur-med) var(--ease-spring);
  animation: itemSlideIn 0.3s var(--ease-spring) both;
}

.vault-entry:hover { border-color: var(--border-2); transform: translateX(3px); }

.vault-entry-icon { font-size: 22px; flex-shrink: 0; }
.vault-entry-info { flex: 1; min-width: 0; }
.vault-entry-name { font-size: 14px; font-weight: 600; font-family: var(--font-display); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-entry-cat { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); margin-top: 2px; }
.vault-entry-amount { font-family: var(--font-display); font-size: 16px; font-weight: 700; flex-shrink: 0; }
.vault-entry[data-type="asset"] .vault-entry-amount { color: var(--success); }
.vault-entry[data-type="liability"] .vault-entry-amount { color: var(--danger); }
.vault-entry-delete { color: var(--text-3); font-size: 16px; opacity: 0; transition: all var(--dur-fast); padding: 4px; border-radius: 4px; }
.vault-entry:hover .vault-entry-delete { opacity: 1; }
.vault-entry-delete:hover { color: var(--danger); }
@media (hover: none) { .vault-entry-delete { opacity: 1; } }

/* ── 21. AI COACH SECTION ─────────────────────────────────────── */
.coach-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.coach-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulseDot 2s ease-in-out infinite;
}

.coach-api-notice {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 20px;
  animation: cardReveal 0.4s var(--ease-spring);
}

.coach-notice-icon { font-size: 48px; margin-bottom: 16px; }
.coach-api-notice h3 { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.coach-api-notice p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }

.coach-api-input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 14px;
  transition: border-color var(--dur-med);
}
.coach-api-input:focus { border-color: var(--accent-1); }
.coach-api-note { font-size: 12px; color: var(--text-3); margin-top: 12px; }

.coach-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 50vh;
}

.coach-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  padding: 4px 0;
}

.coach-msg {
  display: flex;
  gap: 10px;
  animation: itemSlideIn 0.4s var(--ease-spring);
}

.coach-msg--user { flex-direction: row-reverse; }

.coach-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.coach-msg--user .coach-msg-avatar { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: #fff; }

.coach-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.coach-msg--assistant .coach-msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  color: var(--text-1);
}

.coach-msg--user .coach-msg-bubble {
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(236,72,153,0.2));
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  color: var(--text-1);
}

.coach-msg-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.coach-msg-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typingDot 1.2s ease-in-out infinite;
}
.coach-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.coach-msg-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%             { transform: translateY(-6px); opacity: 1; }
}

.coach-quick-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.coach-quick-prompts::-webkit-scrollbar { display: none; }

.quick-prompt {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--dur-med) var(--ease-spring);
}
.quick-prompt:hover { background: rgba(139,92,246,0.1); border-color: var(--accent-1); color: var(--text-1); transform: translateY(-2px); }

.coach-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--surface-1);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  transition: border-color var(--dur-med), box-shadow var(--dur-med);
}

.coach-input-wrap:focus-within {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.coach-input {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
  cursor: text;
}
.coach-input::placeholder { color: var(--text-3); }

.coach-send-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.coach-send-btn:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 4px 20px var(--accent-glow); }
.coach-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── 22. PROFILE SECTION ──────────────────────────────────────── */
.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 16px 20px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.profile-avatar-wrap {
  position: relative;
  width: 80px; height: 80px;
  grid-row: 1 / span 2;
}

.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2.5px solid var(--accent-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  overflow: hidden;
  box-shadow: 0 0 24px var(--accent-glow);
  object-fit: cover;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-upload {
  position: absolute;
  bottom: 0; right: 0;
  width: 26px; height: 26px;
  background: var(--accent-1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.profile-avatar-upload:hover { transform: scale(1.15); background: var(--accent-2); }

.profile-info { display: flex; flex-direction: column; gap: 4px; }

.profile-name-wrap { display: flex; align-items: center; gap: 8px; }
.profile-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  outline: none;
  border-radius: 4px;
  transition: background var(--dur-fast);
  min-width: 60px;
}
.profile-name:focus { background: var(--surface-3); padding: 0 4px; }

.profile-name-save {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast);
}
.profile-name-save:hover { transform: scale(1.1); }

.profile-level-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.profile-member-since { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

.profile-sync-status {
  grid-column: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-signin-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
}
.profile-signin-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); background: var(--surface-3); }

.profile-signout-wrap { display: flex; align-items: center; gap: 12px; }
.profile-cloud-user { display: flex; align-items: center; gap: 8px; }
.profile-cloud-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--accent-1); }
#profile-cloud-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.profile-signout-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.profile-signout-btn:hover { background: rgba(239,68,68,0.2); }

/* XP bar */
.profile-xp-wrap { margin-bottom: 20px; padding: 0 4px; }
.profile-xp-label { display: flex; justify-content: flex-end; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.profile-xp-bar-bg {
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.profile-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-out);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Profile stats grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (max-width: 400px) { .profile-stats-grid { grid-template-columns: repeat(2, 1fr); } }

.profile-stat {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  transition: all var(--dur-med) var(--ease-spring);
}
.profile-stat:hover { transform: translateY(-2px); border-color: var(--border-2); }
.profile-stat-val {
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}
.profile-stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-mono); }

/* Activity heatmap */
.heatmap-section, .goals-section, .achievements-section, .settings-section { margin-bottom: 32px; }
.profile-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-heatmap {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 2px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
}
.activity-heatmap::-webkit-scrollbar { display: none; }

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--surface-3);
  transition: all var(--dur-fast);
  cursor: default;
  min-width: 10px;
}
.heatmap-cell:hover { transform: scale(1.3); z-index: 1; position: relative; }
.heatmap-cell[data-level="1"] { background: rgba(139,92,246,0.25); }
.heatmap-cell[data-level="2"] { background: rgba(139,92,246,0.45); }
.heatmap-cell[data-level="3"] { background: rgba(139,92,246,0.65); }
.heatmap-cell[data-level="4"] { background: var(--accent-1); box-shadow: 0 0 4px var(--accent-glow); }

/* Goal bars */
.goal-bars { display: flex; flex-direction: column; gap: 14px; }

.goal-bar-item { }
.goal-bar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.goal-bar-label { font-size: 14px; font-weight: 600; font-family: var(--font-display); }
.goal-bar-count { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.goal-bar-bg { height: 8px; background: var(--surface-3); border-radius: var(--radius-full); overflow: hidden; }
.goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-out);
  box-shadow: 0 0 8px var(--accent-glow);
}
.goal-bar-fill.complete { background: linear-gradient(90deg, var(--success), var(--accent-3)); }

/* Achievements */
.ach-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.ach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--dur-med) var(--ease-spring);
  cursor: default;
}

.ach-item.unlocked {
  border-color: var(--accent-1);
  background: rgba(139,92,246,0.08);
  box-shadow: 0 0 16px var(--accent-glow);
}

.ach-item.unlocked:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 8px 24px var(--accent-glow); }

.ach-item-icon { font-size: 26px; }
.ach-item.locked .ach-item-icon { filter: grayscale(1); opacity: 0.4; }
.ach-item-name { font-size: 10px; font-weight: 700; color: var(--text-2); font-family: var(--font-display); line-height: 1.2; }
.ach-item.locked .ach-item-name { color: var(--text-3); }
.ach-item-date { font-size: 9px; color: var(--text-3); font-family: var(--font-mono); }

/* Settings */
.settings-list { display: flex; flex-direction: column; gap: 2px; }

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--dur-fast);
  margin-bottom: 6px;
}
.settings-item:hover { border-color: var(--border-2); }

.settings-item-info { flex: 1; }
.settings-item-label { font-size: 14px; font-weight: 600; font-family: var(--font-display); color: var(--text-1); }
.settings-item-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.settings-action-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.settings-action-btn:hover { background: var(--surface-4); color: var(--text-1); transform: translateY(-1px); }
.settings-action-btn--danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.settings-action-btn--danger:hover { background: rgba(239,68,68,0.2); }

/* ── 23. BOTTOM NAV ───────────────────────────────────────────── */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  width: 100%;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 0 max(4px, var(--safe-right)) var(--safe-bottom) max(4px, var(--safe-left));
  background: rgba(6,6,11,0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  align-items: stretch;
  z-index: 300;
  overflow: hidden;
  scrollbar-width: none;
}
.bottomnav::-webkit-scrollbar { display: none; }
.theme-light .bottomnav { background: rgba(244,244,248,0.93); }

.nav-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  padding: 0 4px;
  position: relative;
  background: transparent;
  border: none;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: var(--radius-full);
  transition: width var(--dur-med) var(--ease-spring);
}

.nav-item.active { color: var(--accent-1); }
.nav-item.active::before { width: 32px; }
.nav-item:hover { color: var(--text-2); }
.nav-item.active:hover { color: var(--accent-1); }

.nav-icon {
  width: 22px;
  height: 22px;
  transition: transform var(--dur-med) var(--ease-spring);
}

.nav-item.active .nav-icon { transform: translateY(-2px) scale(1.1); }
.nav-item:active .nav-icon { transform: scale(0.88); }

.nav-label {
  font-size: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: color var(--dur-med);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  position: absolute;
  top: 6px; right: 8px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg);
}

/* ── 24. MODALS ───────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 600px) {
  .modal { align-items: center; padding: 20px; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.4s var(--ease-spring);
  padding-bottom: var(--safe-bottom);
}

@media (min-width: 600px) {
  .modal-card {
    border-radius: var(--radius-xl);
    animation: cardReveal 0.35s var(--ease-spring);
  }
}

@keyframes modalSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-card--sm { max-width: 380px; }
@media (min-width: 600px) { .modal-card--sm { width: 380px; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  margin-bottom: 0;
}

.modal-header h3 { font-family: var(--font-display); font-size: 18px; font-weight: 800; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all var(--dur-fast);
  color: var(--text-2);
}
.modal-close:hover { background: var(--surface-4); color: var(--text-1); }

.modal-body { padding: 16px 20px; flex: 1; overflow-y: auto; }

.modal-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); font-family: var(--font-display); margin-bottom: 6px; margin-top: 14px; }
.modal-label:first-child { margin-top: 0; }

.modal-input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text-1);
  transition: border-color var(--dur-med), box-shadow var(--dur-med);
}
.modal-input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-glow); }
.modal-input::placeholder { color: var(--text-3); }

.modal-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-1);
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
  transition: border-color var(--dur-med);
}
.modal-textarea:focus { border-color: var(--accent-1); }
.modal-textarea::placeholder { color: var(--text-3); }

.modal-select {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-1);
  cursor: pointer;
  transition: border-color var(--dur-med);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23606078' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.modal-select:focus { border-color: var(--accent-1); }

.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal-priority-btns {
  display: flex;
  gap: 8px;
}

.modal-prio-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-2);
  transition: all var(--dur-med) var(--ease-spring);
}
.modal-prio-btn:hover { color: var(--text-1); border-color: var(--border-2); }
.modal-prio-btn[data-priority="low"].active   { color: var(--prio-low); border-color: var(--prio-low); background: rgba(16,185,129,0.1); }
.modal-prio-btn[data-priority="medium"].active { color: var(--prio-med); border-color: var(--prio-med); background: rgba(245,158,11,0.1); }
.modal-prio-btn[data-priority="high"].active   { color: var(--prio-high); border-color: var(--prio-high); background: rgba(239,68,68,0.1); }
.modal-prio-btn[data-type="asset"].active  { color: var(--success); border-color: var(--success); background: rgba(16,185,129,0.1); }
.modal-prio-btn[data-type="liability"].active { color: var(--danger); border-color: var(--danger); background: rgba(239,68,68,0.1); }

.modal-hint { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}

.modal-cancel-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.modal-cancel-btn:hover { background: var(--surface-4); color: var(--text-1); }

.modal-save-btn {
  flex: 2;
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.modal-save-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.modal-save-btn:active { transform: scale(0.98); }
.modal-save-btn--danger { background: linear-gradient(135deg, var(--danger), #b91c1c); box-shadow: 0 4px 16px rgba(239,68,68,0.3); }
.modal-save-btn--danger:hover { box-shadow: 0 8px 24px rgba(239,68,68,0.4); }

/* Habit color picks */
.habit-color-picks { display: flex; gap: 10px; flex-wrap: wrap; }
.habit-color-pick {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
}
.habit-color-pick:hover { transform: scale(1.2); }
.habit-color-pick.active { border-color: var(--text-1); transform: scale(1.2); box-shadow: 0 0 12px currentColor; }

/* Timer task pick list */
.timer-task-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.timer-task-pick {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.timer-task-pick:hover { border-color: var(--accent-1); background: rgba(139,92,246,0.08); }
.timer-task-pick.selected { border-color: var(--accent-1); background: rgba(139,92,246,0.15); }

/* ── 25. FULL VIEW POPUP ──────────────────────────────────────── */
.fullview-popup {
  position: fixed;
  inset: 0;
  z-index: 6500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fullview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.fullview-card {
  position: relative;
  z-index: 1;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  width: min(640px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  animation: cardReveal 0.4s var(--ease-spring);
  box-shadow: var(--shadow-lg);
}

.fullview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  background: var(--surface-1);
  z-index: 1;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.fullview-meta { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.fullview-actions { display: flex; gap: 8px; }

.fullview-edit-btn, .fullview-delete-btn, .fullview-close-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.fullview-edit-btn { background: rgba(139,92,246,0.15); color: var(--accent-1); }
.fullview-edit-btn:hover { background: rgba(139,92,246,0.25); }
.fullview-delete-btn { background: rgba(239,68,68,0.1); color: var(--danger); }
.fullview-delete-btn:hover { background: rgba(239,68,68,0.2); }
.fullview-close-btn { background: var(--surface-3); color: var(--text-2); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; padding: 0; }
.fullview-close-btn:hover { background: var(--surface-4); color: var(--text-1); }

.fullview-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; padding: 0 20px; margin-bottom: 16px; line-height: 1.3; }
.fullview-body { padding: 0 20px 24px; font-size: 15px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

/* ── 26. FULLSCREEN FOCUS ─────────────────────────────────────── */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

#fs-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fs-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.fs-display {
  font-family: var(--font-mono);
  font-size: clamp(60px, 18vw, 120px);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-1), var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -4px;
  line-height: 1;
  margin-bottom: 16px;
}

.fs-sub {
  font-size: 16px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.fs-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.fs-btn {
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
}

.fs-btn-primary { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: #fff; box-shadow: 0 4px 24px var(--accent-glow); }
.fs-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 36px var(--accent-glow); }
.fs-btn-secondary { background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15); color: var(--text-2); }
.fs-btn-secondary:hover { background: rgba(255,255,255,0.12); color: var(--text-1); }

.fs-exit-btn {
  position: absolute;
  top: max(20px, var(--safe-top) + 12px);
  right: max(20px, var(--safe-right) + 12px);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-med);
  z-index: 2;
}
.fs-exit-btn:hover { background: rgba(255,255,255,0.14); color: var(--text-1); }

/* ── 27. UTILITIES & ANIMATIONS ───────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Ripple effect for buttons */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: scale(0);
  animation: rippleEffect 0.6s linear;
  pointer-events: none;
}

@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

/* Toast (generic) */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 8900;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger); color: var(--danger); }
.toast.warning { border-color: var(--warning); color: var(--warning); }

/* ── 28. RESPONSIVE TWEAKS ────────────────────────────────────── */
@media (max-width: 360px) {
  .stat-pills { gap: 7px; }
  .stat-pill-val { font-size: 16px; }
  .xp-level-num { font-size: 26px; }
  .timer-display { font-size: 28px; }
  .topbar-name { font-size: 16px; }
  :root { --nav-h: 60px; }
}

@media (max-width: 420px) {
  .bottomnav { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .nav-item { padding: 0 2px; }
  .nav-icon { width: 19px; height: 19px; }
  .nav-label { font-size: 7.5px; letter-spacing: 0; }
  .nav-item.active::before { width: 24px; }
  .nav-badge { right: 3px; }
}

@media (max-width: 360px) {
  .bottomnav { padding-left: 2px; padding-right: 2px; }
  .nav-item { gap: 2px; padding: 0 1px; }
  .nav-icon { width: 18px; height: 18px; }
  .nav-label { font-size: 7px; letter-spacing: 0; }
  .nav-item.active::before { width: 22px; }
  .nav-badge {
    top: 5px;
    right: 2px;
    min-width: 13px;
    height: 13px;
    font-size: 7px;
    border-width: 1px;
    padding: 0 2px;
  }
}

@media (min-width: 768px) {
  .bottomnav {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 80px));
    justify-content: center;
  }
  .nav-item { max-width: 80px; }
  .section { padding: 24px 24px 28px; }
  .xp-hero { padding: 28px; }
  .widget-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── 24. FLOATING ADD BUTTON ─────────────────────────────────── */
.fab-add {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 80px);
  left: 16px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2, var(--accent)) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 255, 255, 0);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 350;
  animation: fabFloat 3s ease-in-out infinite;
}

.fab-add svg {
  width: 24px;
  height: 24px;
  color: white;
  transition: transform 0.3s ease;
}

.fab-add:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.fab-add:hover svg {
  transform: rotate(90deg);
}

.fab-add:active {
  transform: scale(0.95);
}

@keyframes fabFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.theme-light .fab-add {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.theme-light .fab-add:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
}

/* ── 25. QUICK ADD POPUP ──────────────────────────────────────── */
.quick-add-popup {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

.quick-add-popup:not(.hidden) {
  pointer-events: auto;
}

.quick-add-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.quick-add-menu {
  position: absolute;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 80px);
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-add-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

.quick-add-option:hover {
  background: rgba(40, 40, 60, 0.95);
  transform: translateX(4px);
  border-color: var(--accent);
}

.quick-add-icon {
  font-size: 18px;
}

.quick-add-label {
  font-size: 14px;
  font-weight: 500;
}

.theme-light .quick-add-option {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .quick-add-option:hover {
  background: rgba(245, 245, 250, 0.95);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── 26. POWERED BY PROSPERO UNIVERSE ────────────────────────── */
.powered-by {
  width: 100px;
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(120, 80, 255, 0.15) 0%, rgba(80, 150, 255, 0.15) 100%);
  border: 1px solid rgba(120, 80, 255, 0.3);
  border-radius: 20px;
  text-decoration: none;
  z-index: 280;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.powered-by:hover {
  background: linear-gradient(135deg, rgba(120, 80, 255, 0.25) 0%, rgba(80, 150, 255, 0.25) 100%);
  border-color: rgba(120, 80, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(120, 80, 255, 0.3);
}

.powered-by-text {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.powered-by-brand {
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(90deg, #a78bfa 0%, #60a5fa 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-light .powered-by {
  background: linear-gradient(135deg, rgba(120, 80, 255, 0.1) 0%, rgba(80, 150, 255, 0.1) 100%);
  border-color: rgba(120, 80, 255, 0.2);
}

.theme-light .powered-by-text {
  color: rgba(0, 0, 0, 0.5);
}

.theme-light .powered-by-brand {
  background: linear-gradient(90deg, #7c3aed 0%, #2563eb 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 29. DARK OVERLAY FOR MODALS ENTERING ─────────────────────── */
.modal.entering .modal-card { animation: modalSlideUp 0.4s var(--ease-spring); }

/* Loading state for async operations */
.loading-shimmer {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmerLoad 1.5s infinite;
}

@keyframes shimmerLoad {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Coach streaming text cursor */
.stream-cursor::after {
  content: '▋';
  animation: cursorBlink 1s step-end infinite;
  color: var(--accent-1);
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
/* ── PREMIUM SIGN-IN GATE ─────────────────────────────────────── */
.signin-gate {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #06060b;
}

/* Animated mesh background */
.signin-gate__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.signin-gate__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: gateOrb 10s ease-in-out infinite;
  pointer-events: none;
}

.signin-gate__orb--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.45), transparent 65%);
  top: -200px; left: -150px;
  animation-delay: 0s;
}
.signin-gate__orb--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(236,72,153,0.35), transparent 65%);
  bottom: -180px; right: -120px;
  animation-delay: -4s;
}
.signin-gate__orb--3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.25), transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -7s;
}

@keyframes gateOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -30px) scale(1.08); }
  66%       { transform: translate(-25px, 20px) scale(0.92); }
}

/* Grid overlay */
.signin-gate__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139,92,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

/* Floating particles canvas */
#signin-gate-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Main card */
.signin-gate__card {
  position: relative;
  z-index: 2;
  width: min(480px, calc(100vw - 32px));
  animation: gateCardIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes gateCardIn {
  from { transform: translateY(60px) scale(0.92); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Badge */
.signin-gate__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  animation: gateFadeUp 0.6s ease 0.2s both;
}

.signin-gate__badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: 100px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #a78bfa;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.signin-gate__badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 8px #a78bfa;
  animation: pulseDot 1.5s ease-in-out infinite;
}

/* Sword icon */
.signin-gate__icon {
  text-align: center;
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 30px rgba(139,92,246,0.9));
  animation: gateIconFloat 3s ease-in-out infinite, gateFadeUp 0.6s ease 0.1s both;
}

@keyframes gateIconFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-10px) rotate(3deg); }
}

/* Heading */
.signin-gate__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 46px);
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
  animation: gateFadeUp 0.6s ease 0.25s both;
  background: linear-gradient(135deg, #f0f0f5 30%, #a78bfa 60%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.signin-gate__sub {
  text-align: center;
  font-size: 16px;
  color: rgba(160,160,184,0.9);
  line-height: 1.6;
  margin-bottom: 28px;
  animation: gateFadeUp 0.6s ease 0.3s both;
  padding: 0 8px;
}

@keyframes gateFadeUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Features row */
.signin-gate__feats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
  animation: gateFadeUp 0.6s ease 0.35s both;
}

.signin-gate__feat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.signin-gate__feat:hover {
  background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.25);
  transform: translateY(-1px);
}

.signin-gate__feat-icon { font-size: 20px; flex-shrink: 0; }
.signin-gate__feat-text { font-size: 13px; font-weight: 600; color: rgba(240,240,245,0.85); font-family: var(--font-display); line-height: 1.3; }

/* Primary CTA */
.signin-gate__cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-radius: 16px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 0 0 1px rgba(139,92,246,0.5),
    0 8px 32px rgba(139,92,246,0.4),
    0 0 60px rgba(139,92,246,0.15);
  animation: gateFadeUp 0.6s ease 0.4s both;
  margin-bottom: 14px;
}

.signin-gate__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.signin-gate__cta:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(236,72,153,0.6),
    0 12px 48px rgba(139,92,246,0.55),
    0 0 80px rgba(139,92,246,0.2);
}
.signin-gate__cta:hover::before { opacity: 1; }
.signin-gate__cta:active { transform: scale(0.98); }

.signin-gate__cta > * { position: relative; z-index: 1; }

.signin-gate__cta-shimmer {
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: ctaShimmer 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes ctaShimmer {
  0%   { left: -100%; }
  50%, 100% { left: 150%; }
}

/* Skip link */
.signin-gate__skip {
  width: 100%;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: rgba(96,96,120,0.9);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s ease;
  animation: gateFadeUp 0.6s ease 0.5s both;
  font-family: var(--font-body);
}

.signin-gate__skip:hover { color: rgba(160,160,184,0.9); }
.signin-gate__skip span { text-decoration: underline; text-underline-offset: 3px; }

/* Trust line */
.signin-gate__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(96,96,120,0.7);
  font-family: var(--font-mono);
  animation: gateFadeUp 0.6s ease 0.55s both;
}

/* Urgency bar at top */
.signin-gate__urgency {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: max(8px, var(--safe-top)) 16px 8px;
  background: linear-gradient(135deg, rgba(139,92,246,0.9), rgba(236,72,153,0.9));
  backdrop-filter: blur(10px);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  color: #fff;
  z-index: 3;
  letter-spacing: 0.3px;
  animation: urgencyIn 0.5s ease 0.8s both;
}

@keyframes urgencyIn {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

.signin-gate__urgency-pulse {
  display: inline-block;
  animation: urgencyPulse 2s ease-in-out infinite;
}

@keyframes urgencyPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}