/* ==========================================================================
   TASKIFY SIGNATURE TRANSITION SYSTEM v1.0
   GPU-accelerated motion for every interactive element.
   Runs smoothly on the lowest-end Android devices (4-core, 2 GB RAM).

   Rules:
   ─ Only `opacity` + `transform` are ever animated (composited-only layers)
   ─ `translate3d()` on everything → forces GPU compositing
   ─ `will-change` declared where needed but NOT on every element
   ─ `linear` timing for < 180ms interactions (feels instant, no "springiness lag")
   ─ Custom spring curve for > 200ms entrances / gesture settle
   ─ Low-perf class degrades gracefully (instant transitions, no backdrop during motion)
   ─ prefers-reduced-motion: kills ALL animation / transition duration
   ========================================================================== */

/* ── SPEED TIER TOKENS ───────────────────────────────────────────────────── */

:root {
  /* Duration tiers */
  --tf-micro:   80ms;    /* Immediate tap feedback (buttons, checkboxes) */
  --tf-fast:   140ms;    /* Chips, toggles, dropdowns */
  --tf-normal: 220ms;    /* Cards, toasts, nav items */
  --tf-modal:  240ms;    /* Bottom sheet enter / exit */
  --tf-spring: 320ms;    /* Elastic gesture settle-back */
  --tf-theme:  420ms;    /* Theme cross-fade */

  /* Easing curves */
  --ease-swift:      cubic-bezier(0.22, 1, 0.36, 1);     /* Taskify Spring — fast out, gentle settle */
  --ease-out-quart:  cubic-bezier(0.25, 1, 0.5, 1);      /* Sheet slide */
  --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);      /* Swipe snap */
  --ease-overshoot:  cubic-bezier(0.34, 1.30, 0.64, 1);  /* Nav pop, micro-bounce */
  --ease-in-fast:    cubic-bezier(0.4, 0, 1, 1);          /* Exit */
  --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);        /* Colours, shadows */
}


/* ==========================================================================
   1. VIEW SLIDER — Horizontal Tab Navigation
   ========================================================================== */

#viewsSlider {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Transition is applied by JS during snap; CSS defines the fallback */
  transition: transform var(--tf-modal) var(--ease-out-expo) !important;
}

/* Disable CSS transition while finger is actively dragging (JS sets transition: none) */
#viewsSlider.tf-dragging {
  transition: none !important;
}


/* ==========================================================================
   2. BOTTOM NAVIGATION BAR
   ========================================================================== */

/* Initial slide-up entrance */
#bottomNav {
  animation: tf-nav-entrance var(--tf-spring) var(--ease-swift) both;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

@keyframes tf-nav-entrance {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Individual nav buttons — colour / opacity transition */
#bottomNav button,
.active-nav-btn {
  transition:
    transform var(--tf-fast) var(--ease-swift),
    opacity   var(--tf-fast) linear !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Touch press feedback */
#bottomNav button:active {
  transform: scale(0.90) !important;
  opacity: 0.75 !important;
}

/* FAB / Add button — intentionally stronger press feedback */
#navBtn-add {
  transition:
    transform var(--tf-micro) var(--ease-overshoot),
    box-shadow var(--tf-fast) var(--ease-standard) !important;
  will-change: transform;
}

#navBtn-add:active {
  transform: scale(0.84) !important;
}

/* Active nav icon — micro pop, handled via JS class .tf-nav-pop */
.tf-nav-pop {
  animation: tf-icon-pop var(--tf-normal) var(--ease-overshoot) both !important;
}

@keyframes tf-icon-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.88); }
  70%  { transform: scale(1.10); }
  100% { transform: scale(1); }
}


/* ==========================================================================
   3. MODAL SHEETS & OVERLAYS
   ========================================================================== */

/* Backdrop overlay — opacity only */
#newEntryOverlay,
#searchOverlay,
#budgetOverlay,
#settingsOverlay,
#taskDetailsOverlay,
#pomodoroOverlay,
#analyticsHubOverlay,
#achievementsOverlay,
#profileModalOverlay,
#habitDetailsOverlay,
#confirmDeleteOverlay,
#taskTimePromptOverlay,
#focusAnalysisOverlay,
.fixed.inset-0[id$="Overlay"] {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  transition: opacity var(--tf-fast) linear,
              visibility var(--tf-fast) linear !important;
}

#newEntryOverlay.open,
#searchOverlay.open,
#budgetOverlay.open,
#settingsOverlay.open,
#taskDetailsOverlay.open,
#pomodoroOverlay.open,
#analyticsHubOverlay.open,
#achievementsOverlay.open,
#profileModalOverlay.open,
#habitDetailsOverlay.open,
#confirmDeleteOverlay.open,
#taskTimePromptOverlay.open,
#focusAnalysisOverlay.open,
.fixed.inset-0[id$="Overlay"].open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity var(--tf-fast) linear,
              visibility 0ms linear !important;
}

/* Sheet panels — slide from bottom */
#newEntryOverlay      .modal-sheet,
#searchOverlay        .modal-sheet,
#budgetOverlay        .modal-sheet,
#settingsOverlay      .modal-sheet,
#confirmDeleteOverlay .modal-sheet,
#taskTimePromptOverlay .modal-sheet,
#focusAnalysisOverlay .modal-sheet,
#analyticsHubOverlay  .modal-sheet,
#pomodoroOverlay      .modal-sheet,
#taskDetailsOverlay   .modal-sheet,
#habitDetailsOverlay  .modal-sheet,
#profileModalOverlay  .modal-sheet,
.modal-sheet {
  transform: translate3d(0, 100%, 0);
  opacity: 0;
  will-change: transform, opacity;
  contain: layout style paint;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition:
    transform var(--tf-modal) var(--ease-out-quart),
    opacity   120ms linear !important;
}

#newEntryOverlay.open      .modal-sheet,
#searchOverlay.open        .modal-sheet,
#budgetOverlay.open        .modal-sheet,
#settingsOverlay.open      .modal-sheet,
#confirmDeleteOverlay.open .modal-sheet,
#taskTimePromptOverlay.open .modal-sheet,
#focusAnalysisOverlay.open  .modal-sheet,
#analyticsHubOverlay.open  .modal-sheet,
#pomodoroOverlay.open      .modal-sheet,
#taskDetailsOverlay.open   .modal-sheet,
#habitDetailsOverlay.open  .modal-sheet,
#profileModalOverlay.open  .modal-sheet,
.open > .modal-sheet,
.open .modal-sheet {
  transform: translate3d(0, 0, 0) !important;
  opacity: 1 !important;
  transition:
    transform var(--tf-modal) var(--ease-out-quart),
    opacity   120ms linear !important;
}

/* Small confirm dialog — scales in */
#confirmDeleteOverlay .confirm-sheet {
  transform: translate3d(0, 16px, 0) scale(0.92);
  opacity: 0;
  will-change: transform, opacity;
  transition:
    transform var(--tf-normal) var(--ease-swift),
    opacity   var(--tf-normal) var(--ease-swift) !important;
}

#confirmDeleteOverlay.open .confirm-sheet {
  transform: translate3d(0, 0, 0) scale(1.0) !important;
  opacity: 1 !important;
}

/* During drag-to-dismiss — no CSS transition, JS drives it (adds this class) */
.tf-sheet-dragging {
  transition: none !important;
  will-change: transform;
}


/* ==========================================================================
   4. TASK CARDS & LIST ITEMS
   ========================================================================== */

/* Enter animation */
.task-card-enter {
  animation: tf-card-enter var(--tf-normal) var(--ease-swift) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

/* Cap maximum stagger so last card never waits > 168ms (6 × 28ms) */
.task-card-enter:nth-child(n+7) {
  animation-delay: 168ms;
}

@keyframes tf-card-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Exit animation (e.g., delete / complete) */
.task-card-exit {
  animation: tf-card-exit var(--tf-fast) var(--ease-in-fast) forwards !important;
  pointer-events: none !important;
}

@keyframes tf-card-exit {
  to {
    opacity: 0;
    transform: translate3d(-28px, 0, 0) scale(0.96);
  }
}

/* Tap press feedback */
.task-card-enter:active,
.glass-card[onclick]:active,
[data-action]:active {
  transform: translate3d(0, 0, 0) scale(0.975) !important;
  opacity: 0.9 !important;
  transition:
    transform var(--tf-micro) linear,
    opacity   var(--tf-micro) linear !important;
}

/* Hover lift (desktop only — no visual hit on mobile) */
@media (hover: hover) and (pointer: fine) {
  .task-card-enter:hover {
    transform: translate3d(0, -2px, 0) !important;
    transition: transform var(--tf-fast) var(--ease-swift) !important;
  }
}


/* ==========================================================================
   5. BUTTONS — TAP FEEDBACK
   ========================================================================== */

button,
.select-trigger,
.option-item,
.category-chip,
#taskFilterChips button,
#searchFilterChips button,
#expenseCatChips button,
#incomeCatChips button,
.glass-card[onclick],
[data-action] {
  transition:
    transform var(--tf-micro) linear,
    opacity   var(--tf-micro) linear !important;
  -webkit-tap-highlight-color: transparent;
}

button:active,
.select-trigger:active,
.option-item:active,
.category-chip:active,
#taskFilterChips button:active,
#searchFilterChips button:active,
#expenseCatChips button:active,
#incomeCatChips button:active,
.glass-card[onclick]:active,
[data-action]:active {
  transform: scale(0.95) !important;
  opacity: 0.82 !important;
}

/* Primary action buttons get a stronger press */
button.bg-primary:active,
.btn-primary:active,
#saveTaskBtn:active,
#saveHabitBtn:active,
#saveExpenseBtn:active,
#saveIncomeBtn:active {
  transform: scale(0.94) !important;
  opacity: 0.88 !important;
}

/* FAB (floating action buttons) */
#newEntryFab,
#fabBtn {
  transition:
    transform var(--tf-fast) var(--ease-overshoot),
    box-shadow var(--tf-fast) var(--ease-standard) !important;
  will-change: transform;
}

#newEntryFab:active,
#fabBtn:active {
  transform: scale(0.86) !important;
}


/* ==========================================================================
   6. FILTER CHIPS — ACTIVE STATE
   ========================================================================== */

.chip-active,
#taskFilterChips button.chip-active,
#searchFilterChips button.chip-active,
#expenseCatChips button.chip-active,
#incomeCatChips button.chip-active {
  transition:
    transform      var(--tf-fast) var(--ease-swift),
    background-color var(--tf-fast) var(--ease-standard),
    color          var(--tf-fast) var(--ease-standard),
    border-color   var(--tf-fast) var(--ease-standard) !important;
}

/* Chip tap (non-active) */
#taskFilterChips button:not(.chip-active):active,
#searchFilterChips button:not(.chip-active):active,
#expenseCatChips button:not(.chip-active):active,
#incomeCatChips button:not(.chip-active):active {
  transform: scale(0.93) !important;
}


/* ==========================================================================
   7. TOGGLE SWITCHES & CHECKBOXES
   ========================================================================== */

input[type="checkbox"] + label::after,
.toggle-knob {
  transition: transform var(--tf-fast) var(--ease-swift) !important;
  will-change: transform;
}

/* Checkbox border colour changes */
input[type="checkbox"] + label,
input.peer + label {
  transition:
    border-color     var(--tf-fast) var(--ease-standard),
    background-color var(--tf-fast) var(--ease-standard) !important;
}


/* ==========================================================================
   8. DROPDOWN SELECTS
   ========================================================================== */

.select-options {
  transform-origin: top center;
  transform: translate3d(0, 0, 0) scaleY(0.88) translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--tf-fast) var(--ease-swift),
    opacity   var(--tf-fast) linear !important;
}

.select-options:not(.hidden) {
  transform: translate3d(0, 0, 0) scaleY(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}


/* ==========================================================================
   9. TOAST NOTIFICATIONS
   ========================================================================== */

.toast,
.app-toast,
[class*="toast"] {
  animation: tf-toast-enter var(--tf-normal) var(--ease-swift) both !important;
  will-change: transform, opacity;
}

@keyframes tf-toast-enter {
  from {
    opacity: 0;
    transform: translate3d(0, -20px, 0) scale(0.90);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* Toast dismiss (JS adds this class before removal) */
.tf-toast-exit {
  animation: tf-toast-exit 180ms var(--ease-in-fast) forwards !important;
}

@keyframes tf-toast-exit {
  to {
    opacity: 0;
    transform: translate3d(0, -16px, 0) scale(0.88);
  }
}


/* ==========================================================================
   10. PAGE HEADER ENTRANCE
   ========================================================================== */

.header-bar,
#appHeader,
#app-header {
  animation: tf-header-enter var(--tf-normal) var(--ease-swift) both;
}

@keyframes tf-header-enter {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Dashboard stat cards stagger */
.dash-stat-card {
  animation: tf-card-enter var(--tf-spring) var(--ease-swift) both;
  animation-delay: calc(var(--i, 0) * 38ms);
}

.dash-stat-card:nth-child(n+5) {
  animation-delay: 152ms;
}


/* ==========================================================================
   11. FORM INPUT FOCUS STATE
   ========================================================================== */

input:focus,
textarea:focus,
select:focus,
.select-trigger:focus {
  transition:
    transform     var(--tf-fast) var(--ease-swift),
    border-color  var(--tf-fast) var(--ease-standard),
    box-shadow    var(--tf-fast) var(--ease-standard) !important;
  transform: translate3d(0, -1px, 0);
  outline: none;
}

/* Revert on blur */
input:not(:focus),
textarea:not(:focus),
select:not(:focus) {
  transform: translate3d(0, 0, 0);
  transition:
    transform    var(--tf-fast) var(--ease-standard),
    border-color var(--tf-fast) var(--ease-standard) !important;
}


/* ==========================================================================
   12. SEGMENTED PILL INDICATOR (Entry Type Switcher)
   ========================================================================== */

#entryTypeSwitcher .pill-indicator,
#pillIndicator,
.pill-indicator {
  transition:
    left   var(--tf-fast) var(--ease-swift),
    width  var(--tf-fast) var(--ease-swift),
    transform var(--tf-fast) var(--ease-swift) !important;
  will-change: transform, left, width;
}

/* Disable hover scale on switcher buttons */
#entryTypeSwitcher button:hover {
  transform: none !important;
}

#entryTypeSwitcher button {
  transition:
    color var(--tf-fast) var(--ease-standard) !important;
}


/* ==========================================================================
   13. POMODORO TIMER RING
   ========================================================================== */

.pomodoro-ring,
.timer-ring-fg,
circle[stroke-dashoffset] {
  transition: stroke-dashoffset 900ms linear !important;
  will-change: stroke-dashoffset;
}


/* ==========================================================================
   14. FINANCE / PROGRESS BARS
   ========================================================================== */

.bar-fill,
[class*="bar"][style*="scaleY"],
[style*="scaleY"] {
  transition: transform 480ms var(--ease-standard) !important;
  transform-origin: bottom;
  will-change: transform;
}


/* ==========================================================================
   15. TIMELINE DIVIDERS & SECTION HEADERS
   ========================================================================== */

.timeline-group {
  contain: layout style;
}

.timeline-divider {
  animation: tf-fade-in var(--tf-normal) var(--ease-swift) both;
}

@keyframes tf-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ==========================================================================
   16. SCROLL CONTAINERS — Native momentum
   ========================================================================== */

.overflow-y-auto,
.overflow-x-auto,
[class*="overflow-y-scroll"],
[class*="overflow-x-scroll"] {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* No transition — scroll is native */
}


/* ==========================================================================
   17. GLASS CARD HOVER (desktop)
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  .glass-card {
    transition:
      background 280ms var(--ease-standard),
      box-shadow 280ms var(--ease-standard),
      border-color 280ms var(--ease-standard) !important;
  }
}

/* Clickable glass cards — tap feedback */
.glass-card[onclick] {
  transition:
    transform var(--tf-micro) linear,
    opacity   var(--tf-micro) linear !important;
}

.glass-card[onclick]:active {
  transform: scale(0.975) !important;
  opacity: 0.88 !important;
}


/* ==========================================================================
   18. THEME TRANSITION CROSS-FADE
   ========================================================================== */

.theme-transitioning .glass-card,
.theme-transitioning .glass-level-1,
.theme-transitioning header,
.theme-transitioning #app-shell,
.theme-transitioning #app-shell > div[class*="absolute bottom"],
.theme-transitioning .modal-sheet,
.theme-transitioning #searchInput,
.theme-transitioning .select-options,
.theme-transitioning #ambient-blobs,
.theme-transitioning #ambient-blobs > div,
.theme-transitioning input.peer {
  transition:
    background-color var(--tf-theme) var(--ease-standard),
    border-color     var(--tf-theme) var(--ease-standard),
    box-shadow       var(--tf-theme) var(--ease-standard),
    opacity          var(--tf-theme) var(--ease-standard),
    filter           var(--tf-theme) var(--ease-standard) !important;
}


/* ==========================================================================
   19. HARDWARE HINTS — GPU layer promotion
   ========================================================================== */

.glass-card,
#app-header,
.modal-sheet {
  contain: content;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#bottomNav {
  contain: none !important;
  overflow: visible !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Promote ambient blobs to own GPU layer — they're always animating */
#ambient-blobs > div {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}


/* ==========================================================================
   20. GESTURE STATES — Visual feedback during touch/drag
   ========================================================================== */

/* Tab swipe: rubber-band resistance at edges — JS applies this class */
#viewsSlider.tf-edge-resist {
  transition: transform 180ms var(--ease-swift) !important;
}

/* Sheet drag-to-dismiss: living breathing opacity during drag */
/* (opacity itself is driven by JS inline style — CSS just ensures no transition lag) */
.tf-sheet-dragging .modal-sheet {
  transition: none !important;
}
.tf-sheet-dragging {
  transition: none !important;
}

/* Settle-back spring after user releases without dismissing */
.tf-sheet-settling {
  transition:
    transform var(--tf-spring) var(--ease-overshoot),
    opacity   var(--tf-normal) linear !important;
}

/* Full dismiss animation */
.tf-sheet-dismissing {
  transition:
    transform var(--tf-modal) var(--ease-in-fast),
    opacity   var(--tf-fast) linear !important;
}


/* ==========================================================================
   21. LOW-PERF DEVICE FALLBACKS
   Triggered when logic.js detects: cores ≤ 4, RAM ≤ 3GB, or Save-Data header.
   All durations halved, no backdrop-filter during motion.
   ========================================================================== */

.low-perf-device .glass-card,
.low-perf-device .modal-sheet,
.low-perf-device #app-header,
.low-perf-device #bottomNav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: rgba(19, 19, 22, 0.97) !important;
}

/* During any active transition, suspend backdrop-filter to avoid GPU stalls */
.low-perf-device .task-card-enter,
.low-perf-device .dash-stat-card {
  animation-duration: calc(var(--tf-fast)) !important;
  animation-delay: 0ms !important;
}

.low-perf-device #bottomNav {
  animation-duration: var(--tf-fast) !important;
}

.low-perf-device .modal-sheet {
  transition:
    transform var(--tf-fast) linear,
    opacity   var(--tf-micro) linear !important;
}

.low-perf-device .glass-card[onclick],
.low-perf-device button,
.low-perf-device [data-action] {
  transition:
    transform var(--tf-micro) linear,
    opacity   var(--tf-micro) linear !important;
}

/* Completely kill entrance animations on very low-end devices
   (will-change already adds GPU layer overhead) */
.low-perf-device .task-card-enter,
.low-perf-device .dash-stat-card,
.low-perf-device .header-bar,
.low-perf-device #appHeader,
.low-perf-device .timeline-divider {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}


/* ==========================================================================
   22. PREFERS-REDUCED-MOTION — Accessibility override (highest priority)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:   0.01ms !important;
    animation-delay:      0ms    !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Restore visibility for elements that rely on opacity transitions */
  #newEntryOverlay,
  #searchOverlay,
  #budgetOverlay,
  #settingsOverlay,
  #taskDetailsOverlay,
  #pomodoroOverlay,
  #analyticsHubOverlay,
  #achievementsOverlay,
  #profileModalOverlay,
  #habitDetailsOverlay,
  #confirmDeleteOverlay,
  #taskTimePromptOverlay,
  #focusAnalysisOverlay,
  .fixed.inset-0[id$="Overlay"] {
    opacity: 0;
  }

  #newEntryOverlay.open,
  #searchOverlay.open,
  #budgetOverlay.open,
  #settingsOverlay.open,
  #taskDetailsOverlay.open,
  #pomodoroOverlay.open,
  #analyticsHubOverlay.open,
  #achievementsOverlay.open,
  #profileModalOverlay.open,
  #habitDetailsOverlay.open,
  #confirmDeleteOverlay.open,
  #taskTimePromptOverlay.open,
  #focusAnalysisOverlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .modal-sheet,
  .open .modal-sheet,
  .open > .modal-sheet {
    transform: translate3d(0, 0, 0) !important;
    opacity: 1 !important;
  }

  .task-card-enter,
  .dash-stat-card,
  .header-bar,
  #bottomNav,
  .timeline-divider {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .select-options:not(.hidden) {
    transform: none !important;
    opacity: 1 !important;
  }
}


/* ==========================================================================
   23. MID-PERF DEVICE — (6 GB RAM / 6-core phones that lag from blur stacking)
   JS sets class `mid-perf-device` on <html> for these devices.
   Strategy: halve blur radii, kill blob animations, remove magma orbs,
   simplify box-shadows. Glass effect stays but at lower cost.
   ========================================================================== */

/* Halve all backdrop-filter blur radii */
.mid-perf-device .glass-card {
  backdrop-filter: blur(12px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55) !important;
}

.mid-perf-device .glass-level-1 {
  backdrop-filter: blur(8px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(130%) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.40) !important;
}

.mid-perf-device #app-shell > header {
  backdrop-filter: blur(12px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
}

.mid-perf-device #app-shell > div[class*="absolute bottom"] {
  backdrop-filter: blur(14px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
}

.mid-perf-device .modal-sheet {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

/* Kill ambient blob animations — they eat GPU on every refresh tick */
.mid-perf-device .animate-float-1,
.mid-perf-device .animate-float-2,
.mid-perf-device .animate-float-3,
.mid-perf-device #ambient-blobs > div {
  animation-duration: 60s !important;  /* Slow to 1 fps effective range */
  animation-timing-function: linear !important;
}

/* Kill magma orbs entirely on mid-range */
.mid-perf-device .magma-orb-1,
.mid-perf-device .magma-orb-2,
.mid-perf-device .magma-orb-3 {
  animation: none !important;
  will-change: auto !important;
  opacity: 0 !important;
}

/* Suppress liquid glass extreme blur on mid-range */
.mid-perf-device html[data-liquid-glass="true"] .glass-card,
.mid-perf-device html[data-liquid-glass="true"] [data-theme] .glass-card {
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
}

/* No backdrop-filter transitions during any active drag/animation */
.mid-perf-device .tf-dragging,
.mid-perf-device .tf-sheet-dragging,
.mid-perf-device .tf-sheet-settling,
.mid-perf-device .tf-sheet-dismissing {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}


/* ==========================================================================
   24. GRAPH SVG CLASS STYLES
   Classes added by the user to SVG graph elements for theme-aware styling.
   Using currentColor / CSS variables so they inherit the active theme.
   ========================================================================== */

/* Grid lines — use the existing muted white at very low opacity */
.graph-grid-line {
  stroke: rgba(255, 255, 255, 0.06);
}

/* Data dots on lines */
.graph-dot {
  /* stroke is already set inline via JS (series colour) — no override needed */
  filter: drop-shadow(0 0 3px currentColor);
}

/* Tooltip background rectangle */
.graph-tooltip-bg {
  fill: #18181c;
}

/* Tooltip value text */
.graph-tooltip-text {
  fill: #ffffff;
}

/* X-axis labels */
.graph-x-label {
  fill: rgba(255, 255, 255, 0.40);
}

/* Low-perf: kill the drop-shadow filter on dots */
.low-perf-device .graph-dot,
.mid-perf-device .graph-dot {
  filter: none !important;
}
