/* =============================================
   CSS CUSTOM PROPERTIES — DARK (default)
   ============================================= */

:root, [data-theme="dark"] {
  --bg:              #0a0a12;
  --surface:         rgba(255,255,255,0.05);
  --surface-2:       rgba(255,255,255,0.09);
  --border:          rgba(255,255,255,0.08);
  --border-mid:      rgba(255,255,255,0.16);
  --text-1:          #e2e8f0;
  --text-2:          rgba(226,232,240,0.55);
  --text-3:          rgba(226,232,240,0.3);
  --accent:          #818cf8;
  --accent-2:        #f472b6;
  --accent-dim:      rgba(129,140,248,0.15);
  --accent-border:   rgba(129,140,248,0.4);
  --green:           #34d399;
  --green-dim:       rgba(52,211,153,0.12);
  --danger:          #f87171;
  --danger-dim:      rgba(248,113,113,0.12);
  --nav-bg:          rgba(10,10,18,0.92);
  --nav-border:      rgba(255,255,255,0.07);
  --modal-bg:        #0f0f1c;
  --input-bg:        rgba(255,255,255,0.06);
  --input-border:    rgba(255,255,255,0.1);
  --color-scheme:    dark;
}

/* =============================================
   CSS CUSTOM PROPERTIES — LIGHT
   ============================================= */

[data-theme="light"] {
  --bg:              #f8fafc;
  --surface:         #ffffff;
  --surface-2:       #f1f5f9;
  --border:          #e2e8f0;
  --border-mid:      #cbd5e1;
  --text-1:          #0f172a;
  --text-2:          #475569;
  --text-3:          #94a3b8;
  --accent:          #6366f1;
  --accent-2:        #ec4899;
  --accent-dim:      #eef2ff;
  --accent-border:   #6366f1;
  --green:           #10b981;
  --green-dim:       #f0fdf4;
  --danger:          #ef4444;
  --danger-dim:      #fef2f2;
  --nav-bg:          rgba(255,255,255,0.95);
  --nav-border:      #e2e8f0;
  --modal-bg:        #ffffff;
  --input-bg:        #f8fafc;
  --input-border:    #e2e8f0;
  --color-scheme:    light;
}

/* =============================================
   BASE
   ============================================= */

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html { background: var(--bg); }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  overscroll-behavior: none;
  transition: background 0.25s ease, color 0.2s ease;
}

.app-shell { background: var(--bg); transition: background 0.25s ease; }

/* =============================================
   UTILITY
   ============================================= */

.label-sm {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.c-text-1  { color: var(--text-1); }
.c-text-2  { color: var(--text-2); }
.c-text-3  { color: var(--text-3); }
.c-accent  { color: var(--accent); }
.c-green   { color: var(--green); }
.c-danger  { color: var(--danger); }

[data-theme="light"] .text-white        { color: var(--text-1) !important; }
[data-theme="light"] .text-white\/80    { color: rgba(15,23,42,0.85) !important; }
[data-theme="light"] .bg-white\/10      { background: rgba(0,0,0,0.05) !important; }
[data-theme="light"] .border-white\/10  { border-color: rgba(0,0,0,0.1) !important; }

/* =============================================
   TOP BAR
   ============================================= */

.top-bar {
  height: 56px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.pt-safe { padding-top: env(safe-area-inset-top, 0); }

/* =============================================
   GLASS CARD
   ============================================= */

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: background 0.25s ease, border-color 0.25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
[data-theme="dark"]  .glass-card { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset; }
[data-theme="light"] .glass-card { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

/* =============================================
   ICON BUTTON
   ============================================= */

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover  { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.9); }

/* =============================================
   USER AVATAR
   ============================================= */

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
  color: var(--accent);
}
.user-avatar:active { opacity: 0.7; }

/* =============================================
   WELCOME SCREEN
   ============================================= */

.welcome-screen { background: var(--bg); transition: opacity 0.45s ease, transform 0.45s ease; }
.welcome-exit { opacity: 0; transform: scale(0.97); pointer-events: none; }

.welcome-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.welcome-orb-1 {
  width: 340px; height: 340px; top: -80px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(129,140,248,0.18) 0%, transparent 70%);
  animation: orbFloat1 8s ease-in-out infinite;
}
.welcome-orb-2 {
  width: 260px; height: 260px; bottom: 60px; right: -60px;
  background: radial-gradient(circle, rgba(244,114,182,0.12) 0%, transparent 70%);
  animation: orbFloat2 10s ease-in-out infinite;
}
@keyframes orbFloat1 {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(20px); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-24px); }
}

.welcome-content { transition: transform 0.6s cubic-bezier(.34,1.1,.64,1); }
.welcome-content.btn-shown { transform: translateY(-28px); }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wu-icon     { animation: welcomeBounce 0.7s 0.05s cubic-bezier(.34,1.56,.64,1) both; }
.wu-title    { animation: fadeSlideUp 0.55s 0.25s ease both; }
.wu-sub      { animation: fadeSlideUp 0.55s 0.4s  ease both; }
.wu-features { animation: fadeSlideUp 0.55s 0.55s ease both; }
.wu-legal    { animation: fadeSlideUp 0.4s  0.1s  ease both; }

.welcome-icon-wrap {
  position: relative; width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 28px;
}
.welcome-icon-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(129,140,248,0.35);
  box-shadow: 0 0 40px rgba(129,140,248,0.2), inset 0 0 30px rgba(129,140,248,0.05);
  animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(129,140,248,0.2), inset 0 0 30px rgba(129,140,248,0.05); }
  50%       { box-shadow: 0 0 56px rgba(129,140,248,0.35), inset 0 0 40px rgba(129,140,248,0.10); }
}
.welcome-icon-emoji { font-size: 48px; line-height: 1; position: relative; z-index: 1; }

.welcome-title {
  font-size: 48px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 40%, rgba(255,255,255,0.6));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.welcome-sub {
  font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.35);
  margin-bottom: 32px; font-weight: 400;
}
.welcome-features {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  font-size: 12px; color: rgba(255,255,255,0.3); margin-bottom: 40px; font-weight: 500;
}
.welcome-dot { opacity: 0.4; }
.welcome-legal { margin-top: 20px; font-size: 11px; color: rgba(255,255,255,0.18); line-height: 1.5; }

@keyframes welcomeBounce {
  0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(3deg);  opacity: 1; }
  80%  { transform: scale(0.96) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg);    opacity: 1; }
}

/* =============================================
   SIGN-IN BUTTON + OVERLAY
   ============================================= */

.signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #111;
  padding: 15px 32px; border-radius: 100px; width: 100%; max-width: 280px;
  font-size: 15px; font-weight: 600; border: none; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 8px 32px rgba(0,0,0,0.4), 0 0 48px rgba(129,140,248,0.2);
  opacity: 0; transform: translateY(32px); pointer-events: none;
  transition: opacity 0.55s cubic-bezier(.34,1.1,.64,1),
              transform 0.6s cubic-bezier(.34,1.4,.64,1),
              box-shadow 0.15s;
}
.signin-btn.signin-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.signin-btn:hover  { box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 12px 40px rgba(0,0,0,0.5), 0 0 60px rgba(129,140,248,0.3); }
.signin-btn:active { transform: scale(0.97); }

.signin-overlay { background: var(--bg); }

/* =============================================
   NOTIFICATION BANNER
   ============================================= */

.notif-banner {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* =============================================
   SCREEN
   ============================================= */

.screen { animation: fadeSlideIn 0.22s ease; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   BOTTOM NAV
   ============================================= */

.bottom-nav {
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-bottom: env(safe-area-inset-bottom, 0);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.nav-btn {
  color: var(--text-3);
  transition: color 0.2s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-btn:active { transform: scale(0.88); }
.nav-btn.nav-active { color: var(--accent); }
.nav-btn.nav-active .nav-icon {
  transform: scale(1.18);
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
[data-theme="dark"] .nav-btn.nav-active .nav-icon {
  filter: drop-shadow(0 0 6px rgba(129,140,248,0.65));
}
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; transition: color 0.2s; }

/* =============================================
   FAB
   ============================================= */

.fab {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 4px 20px rgba(99,102,241,0.45);
}
.fab:hover  { filter: brightness(1.1); transform: translateX(-50%) scale(1.05); }
.fab:active { transform: translateX(-50%) scale(0.93); }
.fab.hidden { display: none; }

/* =============================================
   TIMER — PICK GRID (no active timer)
   ============================================= */

.timer-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.timer-pick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.25s;
  animation: cardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  user-select: none;
}
.timer-pick-card:hover   { border-color: var(--accent-border); }
.timer-pick-card:active  { transform: scale(0.96); }
[data-theme="dark"]  .timer-pick-card { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset; }
[data-theme="light"] .timer-pick-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }

.timer-pick-emoji { font-size: 2rem; line-height: 1; }
.timer-pick-title { font-size: 13px; font-weight: 600; color: var(--text-1); text-align: center; }
.timer-pick-dur   {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 2px 10px;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.timer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
}

/* =============================================
   TIMER — ACTIVE TIMER
   ============================================= */

.timer-active-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 24px;
  gap: 8px;
}

.timer-box-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.timer-box-emoji { font-size: 2.8rem; line-height: 1; }
.timer-box-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  text-align: center;
}
.timer-box-duration {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
}

.timer-ring-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  flex-shrink: 0;
}

.timer-svg { width: 260px; height: 260px; }

.timer-arc {
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timer-center-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.timer-countdown {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timer-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.timer-pause-btn {
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent-border);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 130px;
  text-align: center;
}
.timer-pause-btn:hover  { filter: brightness(1.1); }
.timer-pause-btn:active { transform: scale(0.96); }
.timer-pause-btn.paused {
  background: var(--surface-2);
  border-color: var(--border-mid);
  color: var(--text-1);
}

.timer-done-btn {
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  background: var(--green-dim);
  border: 1.5px solid rgba(52,211,153,0.35);
  color: var(--green);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 130px;
  text-align: center;
}
.timer-done-btn:hover  { filter: brightness(1.1); }
.timer-done-btn:active { transform: scale(0.96); }

.timer-abandon-btn {
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.timer-abandon-btn:hover  { border-color: var(--danger); color: var(--danger); }
.timer-abandon-btn:active { transform: scale(0.94); }

/* Arc glow when complete-able */
.timer-arc-full { filter: drop-shadow(0 0 8px rgba(129,140,248,0.7)); }

/* =============================================
   BOX CARD (Boxes tab)
   ============================================= */

.box-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
  transition: border-color 0.15s, background 0.25s, transform 0.15s;
  animation: cardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.box-card:hover { border-color: var(--border-mid); }
[data-theme="dark"]  .box-card { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset; }
[data-theme="light"] .box-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }

.box-card-inner {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.box-emoji {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.box-info { flex: 1; min-width: 0; }
.box-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.box-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.box-start-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent-border);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.box-start-btn:hover  { filter: brightness(1.1); transform: scale(1.08); }
.box-start-btn:active { transform: scale(0.9); }

/* Swipe delete reveal */
.box-delete-bg {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 80px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  border-radius: 0 18px 18px 0;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

/* nth-child stagger */
.box-card:nth-child(1) { animation-delay: 0ms; }
.box-card:nth-child(2) { animation-delay: 35ms; }
.box-card:nth-child(3) { animation-delay: 65ms; }
.box-card:nth-child(4) { animation-delay: 90ms; }
.box-card:nth-child(n+5) { animation-delay: 110ms; }

/* =============================================
   DURATION QUICK-SELECT
   ============================================= */

.dur-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.dur-btn {
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.dur-btn:active { transform: scale(0.9); }
.dur-btn.dur-active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* =============================================
   LOG SCREEN
   ============================================= */

.log-today-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
[data-theme="light"] .log-today-header { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }

.log-total-min {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.log-total-label { font-size: 0.7rem; font-weight: 600; color: var(--text-3); margin-top: 2px; }

.log-session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: cardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.15s;
}
.log-session-card:hover { border-color: var(--border-mid); }
[data-theme="light"] .log-session-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }

.log-session-emoji { font-size: 1.6rem; flex-shrink: 0; }
.log-session-info { flex: 1; min-width: 0; }
.log-session-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.log-session-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.log-session-time { font-size: 11px; font-weight: 600; color: var(--accent); flex-shrink: 0; }

/* =============================================
   HEATMAP CALENDAR
   ============================================= */

.stats-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}

.heatmap-lbl {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-3);
  padding-bottom: 2px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 600;
  transition: transform 0.1s;
}
.heatmap-cell:not(.empty):active { transform: scale(0.85); }
.heatmap-cell.empty  { background: transparent; }
.heatmap-cell.lvl-x  { background: var(--surface-2); color: var(--text-3); }
.heatmap-cell.lvl-0  { background: var(--surface-2); color: var(--text-3); }
.heatmap-cell.lvl-1  { background: rgba(129,140,248,0.18); color: var(--accent); }
.heatmap-cell.lvl-2  { background: rgba(129,140,248,0.38); color: var(--accent); }
.heatmap-cell.lvl-3  { background: rgba(129,140,248,0.65); color: #fff; }
.heatmap-cell.lvl-4  { background: var(--accent); color: #fff; }
.heatmap-cell.hm-today { outline: 2px solid var(--accent); outline-offset: 2px; }

[data-theme="light"] .heatmap-cell.lvl-1 { background: rgba(99,102,241,0.12); }
[data-theme="light"] .heatmap-cell.lvl-2 { background: rgba(99,102,241,0.28); }
[data-theme="light"] .heatmap-cell.lvl-3 { background: rgba(99,102,241,0.55); color: #fff; }

.log-section-hdr {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  margin-top: 16px;
}

/* =============================================
   MODAL
   ============================================= */

.modal-overlay { animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.modal-sheet {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-bottom: none;
  animation: slideUpSpring 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
  transition: background 0.25s ease;
}
[data-theme="dark"]  .modal-sheet { box-shadow: 0 -20px 60px rgba(0,0,0,0.7); }
[data-theme="light"] .modal-sheet { box-shadow: 0 -4px 32px rgba(0,0,0,0.12); }

@keyframes slideUpSpring {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-cancel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.15s;
}
.modal-cancel:hover { border-color: var(--border-mid); }

.modal-input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  outline: none;
  transition: border-color 0.15s;
  color: var(--text-1);
  width: 100%;
}
.modal-input:focus { border-color: var(--accent-border); }
.modal-input::placeholder { color: var(--text-3); }

/* =============================================
   EMOJI PICKER
   ============================================= */

.emoji-pick-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.emoji-pick-btn:hover  { border-color: var(--accent-border); }
.emoji-pick-btn:active { transform: scale(0.93); }

.emoji-grid {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.emoji-cell {
  font-size: 22px;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, transform 0.1s;
}
.emoji-cell:hover  { background: var(--surface); }
.emoji-cell:active { transform: scale(0.85); }
.emoji-cell.selected { background: var(--accent-dim); }

/* =============================================
   SAVE / DELETE BUTTONS
   ============================================= */

.save-btn {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.15s;
}
[data-theme="dark"]  .save-btn { box-shadow: 0 0 24px rgba(99,102,241,0.3); }
[data-theme="light"] .save-btn { box-shadow: 0 4px 14px rgba(99,102,241,0.25); border-color: transparent; }
.save-btn:hover  { filter: brightness(1.08); }
.save-btn:active { transform: scale(0.97); }

.delete-confirm-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.15s;
}
[data-theme="dark"] .delete-confirm-btn { box-shadow: 0 0 20px rgba(239,68,68,0.3); }
.delete-confirm-btn:active { transform: scale(0.97); }

/* =============================================
   TOAST
   ============================================= */

.toast {
  background: rgba(99,102,241,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
  white-space: nowrap;
}

/* =============================================
   SAFE AREA + SCROLL
   ============================================= */

.pb-safe-bottom { padding-bottom: max(24px, env(safe-area-inset-bottom)); }

::-webkit-scrollbar { width: 2px; height: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
