    /* Snappy 3D physics for reliability */
    .settings-row:active {
      transform: scale(0.96) translateZ(0) !important;
    }

    /* 🚀 PILLAR 1: DARKER THEME & ACCORDION CSS ENGINE */
    /* 🚀 Fix 1: Deeper, Truer Dark Mode Background */
    body.dark-mode,
    .dark-mode .app-container,
    [data-theme="dark"] body,
    [data-theme="dark"] .app-container {
      background: radial-gradient(circle at 15% 50%, #0a0f18, #050505, #000000) !important;
      background-attachment: fixed !important;
    }

    /* 🚀 Fix 2: Bolder Setting Labels */
    .settings-label {
      font-family: "Inter", -apple-system, sans-serif !important;
      font-weight: 700 !important; /* Bolded text */
      font-size: 16.5px !important;
      display: flex;
      align-items: center;
      gap: 10px; /* Space for SVG icons */
      pointer-events: none; /* Allows the row to handle the click */
    }

    /* Typography for the setting value (e.g., "English", "Manoj") */
    .settings-value {
      font-family: "Inter", -apple-system, sans-serif !important;
      font-size: 14px !important;
      font-weight: 400 !important;
      color: #888 !important;
      pointer-events: none;
    }

    /* 🚀 EXACT THEME MATCHING */
    body.light-mode .settings-row,
    [data-theme="light"] .settings-row {
      color: #1e293b !important;
      background: rgba(255, 255, 255, 0.7) !important;
      border: 1px solid rgba(255, 255, 255, 0.8) !important;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.03), inset 0 2px 4px rgba(255, 255, 255, 0.5) !important;
    }
    body.light-mode .settings-row:active,
    [data-theme="light"] .settings-row:active {
      background: rgba(255, 255, 255, 0.4) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
    }
    body.light-mode .settings-value,
    [data-theme="light"] .settings-value {
      color: #64748b !important;
    }

    body.dark-mode .settings-row,
    [data-theme="dark"] .settings-row {
      color: #f8fafc !important;
      background: rgba(30, 41, 59, 0.5) !important;
      border: 1px solid rgba(255, 255, 255, 0.05) !important;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.02) !important;
    }
    body.dark-mode .settings-row:active,
    [data-theme="dark"] .settings-row:active {
      background: rgba(30, 41, 59, 0.3) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    body.dark-mode .settings-value,
    [data-theme="dark"] .settings-value {
      color: #94a3b8 !important;
    }

    /* 🚀 Fix 3: Expandable Glass Accordion Architecture */
    .settings-group {
      background: transparent;
      border-radius: 20px !important;
      margin: 0 !important;
      transform: translateZ(0);
      transition: transform 0.2s ease, background 0.2s ease !important;
      overflow: hidden; /* Clips the expanding drawer */
      display: flex;
      flex-direction: column;
    }

    body.light-mode .settings-group,
    [data-theme="light"] .settings-group {
      background: rgba(255, 255, 255, 0.6) !important;
      border: 1px solid rgba(255, 255, 255, 0.6) !important;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
    }
    body.dark-mode .settings-group,
    [data-theme="dark"] .settings-group {
      background: rgba(30, 35, 45, 0.5) !important;
      border: 1px solid rgba(255, 255, 255, 0.06) !important;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    }

    /* Strips duplicate borders from the inner row since the group is now the card */
    .settings-group .settings-row {
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      border-radius: 0 !important;
    }

    /* 🚀 Fix 4: Inline Drawer & Input Theming */
    .settings-expansion {
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
      padding: 0 22px;
    }
    .settings-expansion.open {
      max-height: 280px; /* Expands smoothly */
      opacity: 1;
      padding: 4px 22px 20px;
    }

    .inline-input-wrapper {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .inline-input-wrapper input {
      width: 100%;
      padding: 14px 16px;
      border-radius: 12px;
      background: rgba(128, 128, 128, 0.1);
      border: 1px solid rgba(128, 128, 128, 0.2);
      color: inherit;
      font-family: inherit;
      font-size: 15px;
      outline: none;
      transition: border 0.2s;
    }
    .inline-input-wrapper input:focus {
      border-color: var(--primary-color, #10b981);
    }
    .inline-input-wrapper .save-btn,
    .inline-btn-row button {
      background: var(--accent-primary);
      color: var(--accent-contrast, #fff);
      border: none;
      padding: 12px;
      border-radius: 12px;
      font-weight: 700;
      cursor: pointer;
      text-align: center;
    }
    .inline-btn-row {
      display: flex;
      gap: 8px;
      flex-direction: row;
    }
    .inline-btn-row.col { flex-direction: column; }
    .inline-btn-row button {
      flex: 1;
      background: rgba(128, 128, 128, 0.15);
      color: inherit;
    }
    .inline-btn-row button.active-theme {
      background: var(--accent-primary);
      color: var(--accent-contrast, #fff);
    }

    /* 🚀 Fix 5: Modern Glassmorphic Toggle Switches (Unified 46px x 26px) */
    .toggle-switch {
      width: 46px !important;
      height: 26px !important;
      background: transparent !important;
      border: none !important;
      outline: none !important;
      box-shadow: none !important;
    }
    .toggle-switch .slider {
      border-radius: 999px !important;
      transition: 0.25s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    body.light-mode .toggle-switch .slider,
    html.light-mode .toggle-switch .slider,
    [data-theme="light"] .toggle-switch .slider {
      background: rgba(148, 163, 184, 0.32) !important;
      box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08) !important;
    }
    body.dark-mode .toggle-switch .slider,
    html.dark .toggle-switch .slider,
    [data-theme="dark"] .toggle-switch .slider {
      background: rgba(148, 163, 184, 0.26) !important;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35) !important;
    }

    /* The thumb (circle) inside the toggle */
    .toggle-switch .slider:before {
      height: 20px !important;
      width: 20px !important;
      left: 3px !important;
      bottom: 3px !important;
      border-radius: 50% !important;
      background: #ffffff !important;
      box-shadow: 0 2px 5px rgba(15, 23, 42, 0.22) !important;
    }

    /* Active (Teal) State */
    .toggle-switch input:checked + .slider {
      background: var(--accent-primary, #0d9488) !important;
      box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.16) !important;
    }
    .toggle-switch input:checked + .slider:before {
      transform: translateX(20px) !important;
    }

    /* 🚀 Fix 1: Stop Flexbox from crushing the Accordion Groups */
    .settings-list {
      overflow-y: auto !important; /* Guarantees the container scrolls */
      flex-wrap: nowrap !important;
    }

    .settings-group {
      flex-shrink: 0 !important; /* CRITICAL: Prevents the height squash */
      min-height: min-content !important; 
      height: auto !important;
    }

    /* 🚀 Fix 2: Restore Premium Thickness to the Rows */
    .settings-group .settings-row {
      flex-shrink: 0 !important;
      padding: 18px 22px !important; /* Hard-locking the padding */
      min-height: 64px !important; /* Absolute baseline height so text NEVER clips */
      height: auto !important;
    }

    /* 🚀 Fix 3: Center Typography within the restored height */
    .settings-label {
      line-height: 1.2 !important;
      display: flex !important;
      align-items: center !important;
      gap: 10px !important;
    }

    .settings-value {
      line-height: 1.2 !important;
      display: flex !important;
      align-items: center !important;
    }

    /* ==========================================================================
       PILLAR 1: OBSIDIAN DARK MODE, TOASTS, & SUB-MENUS (CSS)
       ========================================================================== */
    /* 🚀 Fix 1: Obsidian Dark Mode Settings Background */
    body.dark-mode #settings-modal,
    body.dark-mode #sheet-settings-menu .bottom-sheet,
    [data-theme="dark"] #settings-modal,
    [data-theme="dark"] #sheet-settings-menu .bottom-sheet {
      background: rgba(8, 12, 18, 0.9) !important; /* Deepest dark slate/black */
      border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    /* 🚀 Fix 2: Global Toast Notification Engine */
    #app-toast {
      position: fixed;
      bottom: 90px; /* Above bottom navigation/buttons */
      left: 50%;
      transform: translateX(-50%) translateY(20px) translateZ(0);
      padding: 10px 24px;
      border-radius: 30px;
      font-weight: 600;
      font-size: 14px;
      opacity: 0;
      pointer-events: none;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      z-index: 10000;
    }
    #app-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0) translateZ(0);
    }
    body.light-mode #app-toast,
    [data-theme="light"] #app-toast {
      background: rgba(15, 23, 42, 0.9);
      color: #ffffff;
      box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    }
    body.dark-mode #app-toast,
    [data-theme="dark"] #app-toast {
      background: rgba(255, 255, 255, 0.9);
      color: #0f172a;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    }

    /* 🚀 Fix 3: Theme Cycler Button & Chevron Animations */
    .theme-cycle-btn,
    .chevron-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      color: inherit;
      transition: transform 0.3s ease, color 0.2s;
      cursor: pointer;
    }
    .theme-cycle-btn svg { width: 22px; height: 22px; }
    .chevron-icon svg { width: 18px; height: 18px; }
    .settings-expansion.open ~ * .chevron-icon {
      transform: rotate(180deg); /* Flips arrow when open */
    }
    .settings-expansion.open {
      max-height: 1200px !important;
    }

    /* 🚀 Fix 4: Sophisticated Sub-Menus (Master Sound & Export) */
    .sub-setting-header {
      font-size: 11px !important;
      font-weight: 800 !important;
      color: var(--primary-color, #10b981) !important;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      margin: 18px 0 6px 0;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .sub-setting-header:first-child { margin-top: 4px; }
    .sub-setting-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 14px 0;
      border-bottom: 1px solid rgba(128, 128, 128, 0.15);
      font-size: 15px;
      font-weight: 500;
      cursor: pointer;
    }
    .sub-setting-row:last-child { border-bottom: none; }
    .sub-setting-row .val {
      color: #888;
      font-size: 13px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .sub-setting-row svg { width: 18px; height: 18px; color: #888; }

    /* 🚀 Fix 1: Nested Sound Dropdown Engine */
    .nested-sound-dropdown {
      max-height: 0;
      overflow: hidden;
      background: rgba(128, 128, 128, 0.08);
      border-radius: 12px;
      margin: 0 10px;
      transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, margin 0.3s ease;
    }
    .nested-sound-dropdown.open {
      max-height: 900px;
      overflow: visible;
      padding: 8px 0;
      margin-bottom: 14px;
    }
    .nested-sound-dropdown div {
      padding: 12px 18px;
      font-size: 14px;
      font-weight: 500;
      color: #888;
      cursor: pointer;
      transition: background 0.2s, color 0.2s;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .nested-sound-dropdown div:hover {
      background: rgba(128, 128, 128, 0.15);
      color: var(--accent-primary);
    }
    body.light-mode .nested-sound-dropdown div { color: #64748b; }
    body.light-mode .nested-sound-dropdown div:hover { color: var(--accent-primary); }

    /* 🚀 Fix 1: Subtle, Premium Aurora Mesh Backgrounds */
    body.light-mode #settings-modal,
    body.light-mode #sheet-settings-menu .bottom-sheet {
      background:
        radial-gradient(circle at 10% 0%, rgba(236, 72, 153, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
        rgba(248, 250, 252, 0.95) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.95) !important;
    }

    body.dark-mode #settings-modal,
    body.dark-mode #sheet-settings-menu .bottom-sheet {
      background:
        radial-gradient(circle at 10% 0%, rgba(236, 72, 153, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
        rgba(8, 12, 18, 0.97) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    /* 🚀 Fix 2: Minimalist Gradient Header Text */
    .settings-header h2 {
      background: linear-gradient(135deg, #64748b, #8b5cf6, #3b82f6) !important;
      -webkit-background-clip: text !important;
      -webkit-text-fill-color: transparent !important;
      background-size: 200% 200%;
      animation: gradientShift 5s ease infinite;
    }

    body.dark-mode .settings-header h2 {
      background: linear-gradient(135deg, #cbd5e1, #a78bfa, #60a5fa) !important;
      -webkit-background-clip: text !important;
      -webkit-text-fill-color: transparent !important;
    }

    @keyframes gradientShift {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }

    /* 🚀 Fix 3: Iridescent Glass Card Borders */
    body.light-mode .settings-group {
      border: 1px solid rgba(255, 255, 255, 0.8) !important;
      box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05) !important;
    }
    body.dark-mode .settings-group {
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 1px rgba(255,255,255,0.2) !important;
    }

    /* 🚀 Fix 1: System-Wide Green for Missile Launch Button */
    body.light-mode #missile-launch-btn,
    body.light-mode .missile-launch-btn,
    body.light-mode #btn-engage-missile,
    body.dark-mode #missile-launch-btn,
    body.dark-mode .missile-launch-btn,
    body.dark-mode #btn-engage-missile,
    button[onclick*="launchMissile"] {
      background-color: #0d9488 !important;
      background: #0d9488 !important;
      color: #ffffff !important;
      border: none !important;
      box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3) !important;
    }

    /* 🚀 Fix 2: Light Mode Multi-Select Options Bar */
    body.light-mode #bulk-action-bar,
    body.light-mode .bulk-action-bar,
    body.light-mode .modern-bulk-bar,
    body.light-mode #notes-bulk-action-bar,
    body.light-mode .multi-select-bar,
    body.light-mode .multi-select-options {
      background-color: rgba(255, 255, 255, 0.95) !important;
      background: rgba(255, 255, 255, 0.95) !important;
      color: #0f172a !important;
      border-top: 1px solid #e2e8f0 !important;
    }
    /* Ensure icons and text inside the multi-select bar are dark in light mode */
    body.light-mode #bulk-action-bar *,
    body.light-mode .bulk-action-bar button,
    body.light-mode .bulk-action-bar .icon-btn,
    body.light-mode .bulk-action-bar svg,
    body.light-mode #notes-bulk-action-bar *,
    body.light-mode .multi-select-bar * {
      color: #0f172a !important;
    }

    /* 🚀 Fix 3: Universal Theme-Based Toasts */
    body.light-mode #app-toast,
    body.light-mode .toast,
    body.light-mode .toast-item,
    body.light-mode [id*="toast"] {
      background-color: rgba(255, 255, 255, 0.95) !important;
      color: #0f172a !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
    }
    body.dark-mode #app-toast,
    body.dark-mode .toast,
    body.dark-mode .toast-item,
    body.dark-mode [id*="toast"] {
      background-color: rgba(30, 41, 59, 0.95) !important;
      color: #f8fafc !important;
      border: 1px solid #334155 !important;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
    }
    body.light-mode #toast-container,
    body.dark-mode #toast-container {
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
    }

    /* 🚀 Fix 4: Unsaved Task Animated Modal */
    #unsaved-task-modal {
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
      z-index: 12000 !important;
    }
    #unsaved-task-modal.show {
      opacity: 1;
      visibility: visible;
    }
    #unsaved-task-modal .modal-content {
      background: var(--bg-surface, #1e293b);
      color: var(--text-primary, #f8fafc);
      border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
      box-shadow: 0 20px 50px rgba(0,0,0,0.35);
      transform: scale(0.9) translateY(20px);
      transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    body.light-mode #unsaved-task-modal .modal-content {
      background: rgba(255, 255, 255, 0.96);
      color: #0f172a;
      border: 1px solid #e2e8f0;
      box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
    }
    #unsaved-task-modal.show .modal-content {
      transform: scale(1) translateY(0);
    }

    /* 🚀 Fix 1: Universal Pomodoro Color Sync (#0d9488) */
    .global-green-btn {
      background-color: #0d9488 !important;
      background: #0d9488 !important;
      color: #ffffff !important;
      border: none !important;
      /* Perfectly matched RGB glow for #0d9488 */
      box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3) !important;
      font-weight: 700 !important;
    }

    /* 🚀 Fix 1: Minimalist Modal Background Blur */
    #unsaved-task-modal {
      background: rgba(10, 10, 14, 0.56) !important;
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }

    /* 🚀 Fix 2: Refined Layout & Padding */
    .minimal-modal-content {
      padding: 28px 24px !important;
      width: 320px !important;
      max-width: 85% !important;
      border-radius: 28px !important;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      background: rgba(255, 255, 255, 0.96) !important;
      border: 1px solid rgba(15, 23, 42, 0.08) !important;
      box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14) !important;
      backdrop-filter: blur(16px) !important;
      -webkit-backdrop-filter: blur(16px) !important;
    }

    /* 🚀 Fix 3: Modern Typography Hierarchy */
    .minimal-modal-title {
      font-family: "Inter", -apple-system, sans-serif !important;
      font-weight: 600 !important; /* Elegant semi-bold, not heavy */
      font-size: 18px !important;
      margin: 0 0 8px 0 !important;
      letter-spacing: -0.3px !important;
      color: #0f172a !important;
    }

    .minimal-modal-text {
      font-family: "Inter", -apple-system, sans-serif !important;
      font-weight: 400 !important;
      font-size: 14px !important;
      line-height: 1.5 !important;
      margin: 0 0 24px 0 !important;
      color: #64748b !important;
    }

    /* 🚀 Fix 4: Tinted Minimalist Action Buttons */
    .minimal-modal-actions {
      display: flex;
      gap: 12px;
      width: 100%;
    }

    .minimal-btn {
      flex: 1;
      min-height: 44px;
      padding: 12px 0 !important;
      border-radius: 14px !important;
      font-family: "Inter", -apple-system, sans-serif !important;
      font-weight: 600 !important;
      font-size: 14px !important;
      border: none !important;
      cursor: pointer !important;
      transition: transform 0.15s ease, background 0.2s ease !important;
    }
    .minimal-btn:active {
      transform: scale(0.95) !important; /* Snappy tactile feedback */
    }

    /* 🚀 Fix 5: Light Mode Color Mapping */
    body.light-mode .minimal-modal-content,
    html.light-mode .minimal-modal-content,
    [data-theme="light"] .minimal-modal-content {
      background: rgba(255, 255, 255, 0.96) !important;
      border: 1px solid rgba(15, 23, 42, 0.08) !important;
      box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14) !important;
    }
    body.light-mode .minimal-modal-title,
    html.light-mode .minimal-modal-title,
    [data-theme="light"] .minimal-modal-title { color: #0f172a !important; }
    body.light-mode .minimal-modal-text,
    html.light-mode .minimal-modal-text,
    [data-theme="light"] .minimal-modal-text { color: #64748b !important; }
    body.light-mode .btn-keep,
    html.light-mode .btn-keep,
    [data-theme="light"] .btn-keep { background: rgba(148, 163, 184, 0.16) !important; color: #334155 !important; }
    body.light-mode .btn-discard,
    html.light-mode .btn-discard,
    [data-theme="light"] .btn-discard { background: rgba(239, 68, 68, 0.12) !important; color: #ef4444 !important; }

    /* 🚀 Fix 6: Dark Mode Color Mapping */
    body.dark-mode .minimal-modal-content,
    html.dark .minimal-modal-content,
    [data-theme="dark"] .minimal-modal-content {
      background: rgba(18, 18, 22, 0.95) !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55) !important;
    }
    body.dark-mode .minimal-modal-title,
    html.dark .minimal-modal-title,
    [data-theme="dark"] .minimal-modal-title { color: #f8fafc !important; }
    body.dark-mode .minimal-modal-text,
    html.dark .minimal-modal-text,
    [data-theme="dark"] .minimal-modal-text { color: #94a3b8 !important; }
    body.dark-mode .btn-keep,
    html.dark .btn-keep,
    [data-theme="dark"] .btn-keep { background: rgba(255, 255, 255, 0.1) !important; color: #cbd5e1 !important; }
    body.dark-mode .btn-discard,
    html.dark .btn-discard,
    [data-theme="dark"] .btn-discard { background: rgba(239, 68, 68, 0.16) !important; color: #f87171 !important; }

    /* 🚀 Fix 1: Glossy Light Mode Toast (Typography Synced with Dark Mode) */
    body.light-mode #app-toast,
    body.light-mode .toast,
    body.light-mode .toast-item,
    body.light-mode [id*="toast"] {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.85) 100%) !important;
      border: 1px solid rgba(0, 0, 0, 0.08) !important;
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), inset 0 2px 4px rgba(255, 255, 255, 1) !important; 
      
      /* We strictly set the color here, but DO NOT force font-size or font-weight so it perfectly mirrors Dark Mode */
      color: #0f172a !important; 
    }
    body.light-mode #toast-container {
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    /* 🚀 Fix 2: The Washout Killer (Forces nested spans/divs to be dark) */
    body.light-mode #app-toast *,
    body.light-mode .toast *,
    body.light-mode .toast-item *,
    body.light-mode [id*="toast"] * {
      color: #0f172a !important;
    }

    /* 🚀 Fix 3: Protect the UNDO button text */
    body.light-mode #app-toast button,
    body.light-mode .toast button,
    body.light-mode .toast-item button,
    body.light-mode [id*="toast"] button {
      color: #0f172a !important; 
      font-weight: 700 !important; /* Keeps the button action bold */
    }

    /* 🚀 Fix 1: Glossy Light Mode Macro Banner */
    body.light-mode #macro-banner,
    body.light-mode .macro-banner,
    body.light-mode #macro-goal-banner,
    body.light-mode .macro-goal-banner,
    body.light-mode .macro-banner-surface,
    body.light-mode #macro-goal-display,
    body.light-mode [class*="macro-banner"] {
      background: rgba(255, 255, 255, 0.85) !important;
      color: #0f172a !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04) !important;
      border-radius: 26px !important; /* Matches the unified curvy card geometry */
    }
    body.light-mode #macro-goal-banner.macro-banner-scrolled,
    body.light-mode #macro-goal-banner.hidden,
    body.light-mode .macro-goal-banner.macro-banner-scrolled,
    body.light-mode .macro-goal-banner.hidden {
      border-color: transparent !important;
      box-shadow: none !important;
    }

    /* 🚀 Fix 2: The Washout Killer for Nested Banner Text */
    /* Forces all spans, strong tags, and icons inside the banner to be readable dark slate */
    body.light-mode #macro-banner *,
    body.light-mode .macro-banner *,
    body.light-mode #macro-goal-banner *,
    body.light-mode .macro-goal-banner *,
    body.light-mode .macro-banner-surface *,
    body.light-mode #macro-goal-display *,
    body.light-mode [class*="macro-banner"] * {
      color: #0f172a !important;
    }

    /* Optional: If you have a progress bar inside the macro banner, ensure its track is visible in light mode */
    body.light-mode #macro-banner .progress-track,
    body.light-mode .macro-banner .progress-track,
    body.light-mode #macro-goal-banner .progress-track,
    body.light-mode .macro-goal-banner .progress-track {
      background: rgba(0, 0, 0, 0.1) !important;
    }

    /* 🚀 Fix 1: Stabilize OS Native Text Engine for Notes */
    .notes-view textarea, 
    .notes-view [contenteditable="true"],
    [id*="note"] [contenteditable="true"],
    [id*="note"] [contenteditable="true"] *,
    textarea[id*="note"], 
    textarea[id*="journal"],
    .modal-content textarea {
      -webkit-user-select: text !important;
      user-select: text !important;
      -webkit-touch-callout: default !important; /* Protects native Cut/Copy/Spellcheck menus */
      outline: none !important;
    }

    /* 🚀 Fix 1: Neutralize Native Android Tap Highlights on Text Areas */
    textarea, input[type="text"], [contenteditable="true"] {
      -webkit-tap-highlight-color: transparent !important;
      outline: none !important;
    }

    /* 🚀 Fix 1: Extended Edit Options (Hidden on new tasks) */
    #extended-edit-options,
    .extended-edit-options-block {
      display: none; /* Hidden by default */
      flex-direction: column;
      gap: 16px;
      margin-top: 20px;
      padding-top: 20px;
      border-top: 1px solid rgba(128, 128, 128, 0.2);
    }
    .task-card.expanded .extended-edit-options-block {
      display: flex;
    }

    /* 🚀 Fix 2: Glassy Description Box */
    .task-description-area {
      width: 100%;
      min-height: 100px;
      padding: 14px 16px;
      border-radius: 16px;
      background: rgba(128, 128, 128, 0.08);
      border: 1px solid rgba(128, 128, 128, 0.2);
      color: inherit;
      font-family: "Inter", -apple-system, sans-serif;
      font-size: 14px;
      resize: vertical;
      outline: none;
      transition: border 0.2s, background 0.2s;
    }
    .task-description-area:focus {
      border-color: var(--primary-color, #0d9488);
      background: rgba(128, 128, 128, 0.12);
    }

    /* 🚀 Fix 3: Location & Duration Grid */
    .extended-input-grid {
      display: flex;
      gap: 12px;
      align-items: center;
    }
    .extended-input-grid select, .extended-input-grid input {
      flex: 1;
      padding: 12px 16px;
      border-radius: 12px;
      background: rgba(128, 128, 128, 0.08);
      border: 1px solid rgba(128, 128, 128, 0.2);
      color: inherit;
      font-size: 14px;
      outline: none;
    }
    .extended-input-grid select:focus, .extended-input-grid input:focus {
      border-color: var(--primary-color, #0d9488);
    }

    /* 🚀 Fix 4: Inbox Button in Date Picker */
    .date-picker-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 16px;
    }
    .inbox-btn {
      background: rgba(128, 128, 128, 0.15);
      color: inherit;
      border: none;
      padding: 10px 16px;
      border-radius: 12px;
      font-weight: 600;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      transition: transform 0.15s, background 0.2s;
    }
    .inbox-btn:active { transform: scale(0.95); }
    body.light-mode .inbox-btn { color: #0f172a; }
    body.dark-mode .inbox-btn { color: #f8fafc; }

    /* 🚀 Fix 1: Dynamic Active Fields Container */
    #active-advanced-fields,
    .exact-active-fields-slot {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 10px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }
    #active-advanced-fields:empty {
      display: none;
      margin-top: 0;
    }
    .exact-active-fields-slot:not(:has(.advanced-input-card[style*="display: flex"])),
    .exact-active-fields-slot:not(:has(.advanced-input-card[style*="display:flex"])) {
      gap: 0;
      margin-top: 0;
    }
    .exact-active-fields-slot:has(.advanced-input-card[style*="display: flex"]),
    .exact-active-fields-slot:has(.advanced-input-card[style*="display:flex"]) {
      display: flex !important;
      flex-direction: column;
      gap: 10px;
      margin-top: 10px;
    }
    .inline-active-fields-slot,
    .inline-more-menu-slot,
    #dynamic-task-features-home {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    /* 🚀 Fix 2: The 'More' Toggle Button */
    .more-toggle-btn {
      background: transparent;
      border: none;
      color: #888;
      font-size: 11.5px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 6px 0;
      cursor: pointer;
      text-transform: uppercase;
      letter-spacing: 0.45px;
      margin-top: 6px;
      transition: color 0.2s;
    }
    .more-toggle-btn:hover { color: var(--primary-color, #0d9488); }
    .more-toggle-btn svg { width: 14px; height: 14px; transition: transform 0.3s ease; }
    .more-toggle-btn.open svg { transform: rotate(180deg); }

    /* 🚀 Fix 3: Advanced Actionable Buttons (Inside More) */
    @keyframes moreMenuReveal {
      from {
        opacity: 0;
        transform: translateY(-4px) scale(0.985);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    #more-menu-actions,
    .more-menu-actions {
      display: none;
      flex-direction: column;
      gap: 2px;
      margin-top: 8px;
      padding: 6px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.72);
      border: 1px solid rgba(26, 26, 26, 0.08);
      box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75);
      transform-origin: top center;
      animation: moreMenuReveal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    body.dark-mode #more-menu-actions,
    html.dark #more-menu-actions,
    [data-theme="dark"] #more-menu-actions,
    body.dark-mode .more-menu-actions,
    html.dark .more-menu-actions,
    [data-theme="dark"] .more-menu-actions {
      background: rgba(255, 255, 255, 0.035);
      border-color: rgba(255, 255, 255, 0.085);
      box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    body.light-mode #more-menu-actions,
    [data-theme="light"] #more-menu-actions,
    body.light-mode .more-menu-actions,
    [data-theme="light"] .more-menu-actions {
      background: rgba(255, 255, 255, 0.78);
      border-color: rgba(26, 26, 26, 0.08);
      box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    }

    #more-menu-actions .advanced-action-btn,
    .more-menu-actions .advanced-action-btn {
      background: transparent;
      border: none;
      width: 100%;
      min-height: 40px;
      padding: 8px 11px;
      border-radius: 11px;
      color: var(--text-primary, #1e293b);
      font-family: var(--font-body, inherit);
      font-size: 12.5px;
      font-weight: 500;
      letter-spacing: -0.01em;
      text-align: left;
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: background-color 0.18s cubic-bezier(0.16, 1, 0.3, 1), color 0.18s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    }

    #more-menu-actions .advanced-action-btn svg,
    .more-menu-actions .advanced-action-btn svg {
      width: 17px;
      height: 17px;
      flex-shrink: 0;
      stroke-width: 1.8;
      color: var(--text-muted, #64748b);
      transition: color 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    #more-menu-actions .advanced-action-btn::after,
    .more-menu-actions .advanced-action-btn::after {
      content: '+';
      margin-left: auto;
      font-size: 16px;
      font-weight: 400;
      line-height: 1;
      color: var(--text-muted, #64748b);
      opacity: 0.45;
      transition: opacity 0.18s ease, color 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    #more-menu-actions .advanced-action-btn:hover,
    .more-menu-actions .advanced-action-btn:hover {
      background: rgba(15, 23, 42, 0.045);
    }

    #more-menu-actions .advanced-action-btn:active,
    .more-menu-actions .advanced-action-btn:active {
      background: rgba(15, 23, 42, 0.08);
      transform: scale(0.985);
    }

    #more-menu-actions .advanced-action-btn:hover svg,
    #more-menu-actions .advanced-action-btn:focus-visible svg,
    .more-menu-actions .advanced-action-btn:hover svg,
    .more-menu-actions .advanced-action-btn:focus-visible svg {
      color: var(--accent-primary, #0D9488);
    }

    #more-menu-actions .advanced-action-btn:hover::after,
    #more-menu-actions .advanced-action-btn:focus-visible::after,
    .more-menu-actions .advanced-action-btn:hover::after,
    .more-menu-actions .advanced-action-btn:focus-visible::after {
      opacity: 0.95;
      color: var(--accent-primary, #0D9488);
    }

    #more-menu-actions .advanced-action-btn:focus-visible,
    .more-menu-actions .advanced-action-btn:focus-visible {
      outline: 2px solid var(--accent-primary, #0D9488);
      outline-offset: -2px;
      background: rgba(15, 23, 42, 0.04);
    }

    body.light-mode #more-menu-actions .advanced-action-btn,
    [data-theme="light"] #more-menu-actions .advanced-action-btn,
    body.light-mode .more-menu-actions .advanced-action-btn,
    [data-theme="light"] .more-menu-actions .advanced-action-btn {
      color: #1e293b;
    }

    body.dark-mode #more-menu-actions .advanced-action-btn,
    html.dark #more-menu-actions .advanced-action-btn,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn,
    body.dark-mode .more-menu-actions .advanced-action-btn,
    html.dark .more-menu-actions .advanced-action-btn,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn {
      color: #e4e4e7;
    }

    body.dark-mode #more-menu-actions .advanced-action-btn svg,
    html.dark #more-menu-actions .advanced-action-btn svg,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn svg,
    body.dark-mode #more-menu-actions .advanced-action-btn::after,
    html.dark #more-menu-actions .advanced-action-btn::after,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn::after,
    body.dark-mode .more-menu-actions .advanced-action-btn svg,
    html.dark .more-menu-actions .advanced-action-btn svg,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn svg,
    body.dark-mode .more-menu-actions .advanced-action-btn::after,
    html.dark .more-menu-actions .advanced-action-btn::after,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn::after {
      color: rgba(255, 255, 255, 0.52);
    }

    body.dark-mode #more-menu-actions .advanced-action-btn:hover,
    html.dark #more-menu-actions .advanced-action-btn:hover,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn:hover,
    body.dark-mode #more-menu-actions .advanced-action-btn:focus-visible,
    html.dark #more-menu-actions .advanced-action-btn:focus-visible,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn:focus-visible,
    body.dark-mode .more-menu-actions .advanced-action-btn:hover,
    html.dark .more-menu-actions .advanced-action-btn:hover,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn:hover,
    body.dark-mode .more-menu-actions .advanced-action-btn:focus-visible,
    html.dark .more-menu-actions .advanced-action-btn:focus-visible,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn:focus-visible {
      background: rgba(255, 255, 255, 0.06);
    }

    body.dark-mode #more-menu-actions .advanced-action-btn:active,
    html.dark #more-menu-actions .advanced-action-btn:active,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn:active,
    body.dark-mode .more-menu-actions .advanced-action-btn:active,
    html.dark .more-menu-actions .advanced-action-btn:active,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn:active {
      background: rgba(255, 255, 255, 0.1);
    }

    body.dark-mode #more-menu-actions .advanced-action-btn:hover svg,
    html.dark #more-menu-actions .advanced-action-btn:hover svg,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn:hover svg,
    body.dark-mode #more-menu-actions .advanced-action-btn:focus-visible svg,
    html.dark #more-menu-actions .advanced-action-btn:focus-visible svg,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn:focus-visible svg,
    body.dark-mode #more-menu-actions .advanced-action-btn:hover::after,
    html.dark #more-menu-actions .advanced-action-btn:hover::after,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn:hover::after,
    body.dark-mode #more-menu-actions .advanced-action-btn:focus-visible::after,
    html.dark #more-menu-actions .advanced-action-btn:focus-visible::after,
    [data-theme="dark"] #more-menu-actions .advanced-action-btn:focus-visible::after,
    body.dark-mode .more-menu-actions .advanced-action-btn:hover svg,
    html.dark .more-menu-actions .advanced-action-btn:hover svg,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn:hover svg,
    body.dark-mode .more-menu-actions .advanced-action-btn:focus-visible svg,
    html.dark .more-menu-actions .advanced-action-btn:focus-visible svg,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn:focus-visible svg,
    body.dark-mode .more-menu-actions .advanced-action-btn:hover::after,
    html.dark .more-menu-actions .advanced-action-btn:hover::after,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn:hover::after,
    body.dark-mode .more-menu-actions .advanced-action-btn:focus-visible::after,
    html.dark .more-menu-actions .advanced-action-btn:focus-visible::after,
    [data-theme="dark"] .more-menu-actions .advanced-action-btn:focus-visible::after {
      color: var(--accent-primary, #2DD4BF);
    }

    @media (prefers-reduced-motion: reduce) {
      #more-menu-actions,
      .more-menu-actions {
        animation: none;
      }
      #more-menu-actions .advanced-action-btn,
      #more-menu-actions .advanced-action-btn svg,
      #more-menu-actions .advanced-action-btn::after,
      .more-menu-actions .advanced-action-btn,
      .more-menu-actions .advanced-action-btn svg,
      .more-menu-actions .advanced-action-btn::after {
        transition: none;
      }
    }

    /* 🚀 Fix 4: Time Block & OpenStreetMap + Leaflet Picker UI (Strictly Box-Contained) */
    .advanced-input-card {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      padding: 10px 12px;
      border-radius: 16px;
      background: var(--bg-elevated, rgba(128, 128, 128, 0.06));
      border: 1px solid var(--border-subtle, rgba(128, 128, 128, 0.14));
      overflow: hidden;
    }
    body.dark-mode .advanced-input-card,
    html.dark .advanced-input-card,
    [data-theme="dark"] .advanced-input-card {
      background: rgba(255, 255, 255, 0.04);
      border-color: rgba(255, 255, 255, 0.09);
    }
    .advanced-input-card .desc-input-wrapper {
      margin-top: 2px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }
    .advanced-input-card .task-description-area {
      min-height: 64px;
      padding: 10px 38px 10px 12px;
      border-radius: 12px;
      box-sizing: border-box;
    }
    .advanced-input-label {
      font-size: 11.5px;
      font-weight: 800;
      letter-spacing: 0.02em;
      color: var(--text-muted, #888);
    }
    #card-loc .extended-input-grid,
    .exact-card-loc .extended-input-grid {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      gap: 0;
    }
    #card-loc .loc-sleek-trigger,
    .exact-card-loc .loc-sleek-trigger {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
      justify-content: space-between !important;
      padding: 9px 12px !important;
      min-height: 38px !important;
      border-radius: 11px !important;
      font-size: 13px !important;
    }
    #card-loc .loc-sleek-menu,
    .exact-card-loc .loc-sleek-menu {
      margin: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }
    #card-loc .loc-sleek-menu.open,
    .exact-card-loc .loc-sleek-menu.open {
      margin: 4px 0 !important;
    }
    .map-picker-btn {
      background: rgba(0, 0, 0, 0.035);
      border: 1px solid rgba(0, 0, 0, 0.08);
      padding: 9px 12px;
      min-height: 38px;
      border-radius: 11px;
      color: var(--text-primary, #18181b);
      font-family: var(--font-body, inherit);
      font-size: 13px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      overflow: hidden;
      text-align: left;
      transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .map-picker-btn:hover {
      background: rgba(13, 148, 136, 0.07);
      border-color: rgba(13, 148, 136, 0.4);
    }
    .map-picker-btn:active {
      transform: scale(0.985);
    }
    body.dark-mode .map-picker-btn,
    html.dark .map-picker-btn,
    [data-theme="dark"] .map-picker-btn {
      background: rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.1);
      color: #f4f4f5;
    }
    body.dark-mode .map-picker-btn:hover,
    html.dark .map-picker-btn:hover,
    [data-theme="dark"] .map-picker-btn:hover {
      background: rgba(45, 212, 191, 0.08);
      border-color: rgba(45, 212, 191, 0.4);
    }
    .loc-coords-subtext {
      display: none;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 6px;
      max-width: 100%;
      box-sizing: border-box;
      font-family: var(--font-mono, monospace);
      font-size: 11px;
      color: var(--text-muted, #64748b);
      padding: 4px 2px 0;
    }
    .loc-coords-subtext.active {
      display: flex;
    }
    .loc-geofence-status-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-family: var(--font-display, sans-serif);
      font-size: 10.5px;
      font-weight: 700;
      color: var(--accent-primary, #0D9488);
    }
    .loc-geofence-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent-primary, #0D9488);
      box-shadow: 0 0 8px var(--accent-primary, #0D9488);
    }

    /* OpenStreetMap + Leaflet Modal (Minimalistic, Modern & Animated) */
    @keyframes osmBackdropIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    @keyframes osmBackdropOut {
      from { opacity: 1; }
      to { opacity: 0; }
    }
    @keyframes osmDialogSpringIn {
      0% { opacity: 0; transform: translate3d(0, 22px, 0) scale(0.92); }
      70% { opacity: 1; transform: translate3d(0, -2px, 0) scale(1.008); }
      100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    }
    @keyframes osmDialogScaleOut {
      0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
      100% { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.93); }
    }
    @keyframes osmSectionSlideUp {
      from {
        opacity: 0;
        transform: translateY(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    @keyframes osmDropdownReveal {
      0% {
        opacity: 0;
        transform: translateY(-8px) scaleY(0.94);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
      }
    }
    @keyframes osmDropdownHide {
      0% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
      }
      100% {
        opacity: 0;
        transform: translateY(-6px) scaleY(0.95);
      }
    }
    @keyframes osmSuggestionSlideIn {
      from {
        opacity: 0;
        transform: translateX(-6px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
    @keyframes osmPinDropBounce {
      0% {
        transform: translateY(-24px) scale(0.75);
      }
      55% {
        transform: translateY(3px) scale(1.08, 0.92);
      }
      78% {
        transform: translateY(-4px) scale(0.97, 1.03);
      }
      100% {
        transform: translateY(0) scale(1);
      }
    }
    @keyframes osmPinPulseWave {
      0% {
        transform: translate(-50%, -50%) scale(0.4);
        opacity: 0.75;
      }
      100% {
        transform: translate(-50%, -50%) scale(2.4);
        opacity: 0;
      }
    }
    @keyframes osmValueFlash {
      0% {
        background-color: rgba(13, 148, 136, 0.22);
      }
      100% {
        background-color: transparent;
      }
    }
    @keyframes osmRadarPulse {
      0% { transform: rotate(0deg) scale(1); }
      50% { transform: rotate(180deg) scale(1.12); }
      100% { transform: rotate(360deg) scale(1); }
    }

    #osm-map-picker-modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9999998;
      background: rgba(9, 9, 11, 0.56);
      align-items: center;
      justify-content: center;
      padding: 12px;
      box-sizing: border-box;
      transition: padding 0.22s ease;
    }
    #osm-map-picker-modal *,
    #osm-map-picker-modal *::before,
    #osm-map-picker-modal *::after {
      box-sizing: border-box;
    }
    #osm-map-picker-modal.open {
      display: flex;
      animation: osmBackdropIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    #osm-map-picker-modal.kb-label-focused {
      align-items: flex-start;
      padding-top: max(8px, env(safe-area-inset-top, 8px));
      padding-bottom: 8px;
    }
    #osm-map-picker-modal.closing {
      animation: osmBackdropOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
      pointer-events: none;
    }
    .osm-modal-dialog {
      width: 100%;
      max-width: min(440px, calc(100vw - 24px));
      max-height: calc(100dvh - 24px);
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 14px;
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid rgba(24, 24, 27, 0.09);
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
      color: #0f172a;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      transform-origin: center center;
      animation: osmDialogSpringIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
      transition: max-height 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    }
    #osm-map-picker-modal.closing .osm-modal-dialog {
      animation: osmDialogScaleOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
    }
    #osm-map-picker-modal.open:not(.closing) .osm-modal-header {
      animation: osmSectionSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.02s both;
    }
    #osm-map-picker-modal.open:not(.closing) .osm-search-wrap {
      animation: osmSectionSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
    }
    #osm-map-picker-modal.open:not(.closing) .osm-map-stage {
      animation: osmSectionSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
    }
    #osm-map-picker-modal.open:not(.closing) .osm-meta-grid {
      animation: osmSectionSlideUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.11s both;
    }
    #osm-map-picker-modal.open:not(.closing) .osm-modal-footer {
      animation: osmSectionSlideUp 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
    }
    body.dark-mode .osm-modal-dialog,
    html.dark .osm-modal-dialog,
    [data-theme="dark"] .osm-modal-dialog {
      background: rgba(18, 18, 22, 0.96);
      border-color: rgba(255, 255, 255, 0.1);
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.68);
      color: #f4f4f5;
    }
    .osm-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-width: 0;
    }
    .osm-modal-title {
      font-family: var(--font-display, sans-serif);
      font-size: 15px;
      font-weight: 800;
      letter-spacing: -0.02em;
      margin: 0;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .osm-close-btn {
      flex: 0 0 36px;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 1px solid rgba(128, 128, 128, 0.16);
      background: rgba(128, 128, 128, 0.06);
      color: inherit;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      padding: 0;
      transition: background 0.18s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .osm-close-btn:hover {
      background: rgba(128, 128, 128, 0.14);
      transform: rotate(90deg) scale(1.05);
    }
    .osm-close-btn:active {
      transform: scale(0.9);
    }
    .osm-search-wrap {
      position: relative;
      width: 100%;
      min-width: 0;
      z-index: 1500;
    }
    .osm-search-row {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
      min-width: 0;
    }
    .osm-search-field-box {
      flex: 1 1 0%;
      min-width: 0;
      height: 38px;
      min-height: 38px;
      display: flex;
      align-items: center;
      border-radius: 11px;
      border: 1px solid rgba(128, 128, 128, 0.22);
      background: rgba(128, 128, 128, 0.06);
      padding: 0 4px 0 11px;
      gap: 4px;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.18s ease;
    }
    .osm-search-field-box:focus-within {
      border-color: var(--accent-primary, #0D9488);
      box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
      background: transparent;
    }
    .osm-search-input {
      flex: 1 1 0%;
      width: 100%;
      min-width: 0;
      height: 36px;
      min-height: 36px;
      padding: 0 11px;
      border-radius: 11px;
      border: 1px solid rgba(128, 128, 128, 0.2);
      background: rgba(128, 128, 128, 0.06);
      color: inherit;
      font-family: var(--font-body, sans-serif);
      font-size: 13px;
      line-height: 1.2;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: border-color 0.2s ease, background-color 0.25s ease;
    }
    .osm-search-input:focus {
      outline: 2px solid var(--accent-primary, #0D9488);
      outline-offset: -1px;
      background: transparent;
    }
    .osm-search-input.osm-value-updated {
      animation: osmValueFlash 0.55s ease;
    }
    .osm-search-field-box .osm-search-input {
      border: none;
      background: transparent;
      padding: 0;
      height: 100%;
      min-height: 0;
      border-radius: 0;
      outline: none;
    }
    .osm-search-field-box .osm-search-input:focus {
      outline: none;
    }
    .osm-search-clear-btn {
      display: none;
      flex: 0 0 30px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: none;
      background: rgba(128, 128, 128, 0.14);
      color: var(--text-muted, #71717a);
      align-items: center;
      justify-content: center;
      cursor: pointer;
      padding: 0;
      transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    }
    .osm-search-clear-btn.visible {
      display: inline-flex;
      animation: osmDialogSpringIn 0.18s ease forwards;
    }
    .osm-search-clear-btn:hover {
      background: rgba(128, 128, 128, 0.24);
      color: inherit;
      transform: scale(1.08);
    }
    .osm-search-clear-btn:active {
      transform: scale(0.9);
    }
    .osm-icon-only-btn {
      flex: 0 0 36px;
      width: 36px;
      height: 36px;
      min-height: 36px;
      padding: 0;
      border-radius: 8px;
      border: none;
      background: rgba(13, 148, 136, 0.12);
      color: var(--accent-primary, #0D9488);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.18s ease, color 0.18s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .osm-icon-only-btn:hover {
      background: var(--accent-primary, #0D9488);
      color: var(--accent-contrast, #ffffff);
      transform: scale(1.05);
    }
    .osm-icon-only-btn:active {
      transform: scale(0.92);
    }
    .osm-action-icon-btn {
      flex: 0 0 auto;
      height: 38px;
      min-height: 38px;
      padding: 0 11px;
      border-radius: 11px;
      border: 1px solid rgba(128, 128, 128, 0.2);
      background: rgba(128, 128, 128, 0.08);
      color: inherit;
      font-family: var(--font-display, sans-serif);
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .osm-action-icon-btn:hover {
      border-color: var(--accent-primary, #0D9488);
      color: var(--accent-primary, #0D9488);
      background: rgba(13, 148, 136, 0.08);
      transform: translateY(-1px);
    }
    .osm-action-icon-btn:active {
      transform: scale(0.95);
    }
    .osm-action-icon-btn.locating {
      border-color: var(--accent-primary, #0D9488);
      color: var(--accent-primary, #0D9488);
      background: rgba(13, 148, 136, 0.1);
      pointer-events: none;
    }
    .osm-action-icon-btn.locating svg {
      animation: osmRadarPulse 1s linear infinite;
    }
    .osm-search-results {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      z-index: 1600;
      flex-direction: column;
      max-height: 235px;
      overflow-y: auto;
      overscroll-behavior: contain;
      border-radius: 13px;
      border: 1px solid rgba(128, 128, 128, 0.22);
      background: rgba(255, 255, 255, 0.99);
      box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
      transform-origin: top center;
    }
    body.dark-mode .osm-search-results,
    html.dark .osm-search-results,
    [data-theme="dark"] .osm-search-results {
      background: rgba(22, 22, 26, 0.99);
      border-color: rgba(255, 255, 255, 0.15);
      box-shadow: 0 16px 38px rgba(0, 0, 0, 0.65);
    }
    .osm-search-results.open {
      display: flex;
      animation: osmDropdownReveal 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .osm-search-results.closing {
      animation: osmDropdownHide 0.16s ease forwards;
      pointer-events: none;
    }
    .osm-search-section-label {
      padding: 6px 11px 4px;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted, #71717a);
      background: rgba(128, 128, 128, 0.04);
      border-bottom: 1px solid rgba(128, 128, 128, 0.08);
      display: flex;
      align-items: center;
      justify-content: space-between;
      user-select: none;
    }
    .osm-search-item {
      width: 100%;
      padding: 8px 11px;
      border: none;
      border-bottom: 1px solid rgba(128, 128, 128, 0.08);
      background: transparent;
      color: inherit;
      text-align: left;
      font-size: 12.5px;
      line-height: 1.3;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-width: 0;
      animation: osmSuggestionSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--item-idx, 0) * 26ms) both;
      transition: background 0.14s ease, transform 0.14s ease, padding-left 0.14s ease;
    }
    .osm-search-item-main {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
    }
    .osm-search-item-icon {
      flex: 0 0 24px;
      width: 24px;
      height: 24px;
      border-radius: 7px;
      background: rgba(13, 148, 136, 0.1);
      color: var(--accent-primary, #0D9488);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.16s ease, background 0.16s ease;
    }
    .osm-search-item-icon.history {
      background: rgba(128, 128, 128, 0.1);
      color: var(--text-muted, #71717a);
    }
    .osm-search-item:hover .osm-search-item-icon,
    .osm-search-item.kb-active .osm-search-item-icon {
      transform: scale(1.08);
      background: rgba(13, 148, 136, 0.18);
      color: var(--accent-primary, #0D9488);
    }
    .osm-search-item-copy {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
      flex: 1;
    }
    .osm-search-item-text {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 600;
      font-size: 12.5px;
    }
    .osm-search-item-addr {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 11px;
      color: var(--text-muted, #71717a);
    }
    .osm-search-item-sub {
      font-family: var(--font-mono, monospace);
      font-size: 10.5px;
      color: var(--text-muted, #71717a);
      flex-shrink: 0;
    }
    .osm-search-hl {
      background: rgba(13, 148, 136, 0.22);
      color: var(--accent-primary, #0D9488);
      font-weight: 800;
      border-radius: 3px;
      padding: 0 2px;
    }
    .osm-search-item:last-child {
      border-bottom: none;
    }
    .osm-search-item:hover,
    .osm-search-item.kb-active {
      background: rgba(13, 148, 136, 0.11);
      padding-left: 14px;
    }
    .osm-search-item:active {
      transform: scale(0.985);
    }
    .osm-search-status {
      padding: 9px 11px;
      font-size: 12px;
      color: var(--text-muted, #71717a);
      display: flex;
      align-items: center;
      gap: 8px;
      animation: osmSuggestionSlideIn 0.2s ease both;
    }
    .osm-mini-spinner {
      width: 13px;
      height: 13px;
      border-radius: 50%;
      border: 2px solid rgba(13, 148, 136, 0.25);
      border-top-color: var(--accent-primary, #0D9488);
      animation: osmSpin 0.65s linear infinite;
      flex-shrink: 0;
    }
    @keyframes osmSpin {
      to { transform: rotate(360deg); }
    }
    .osm-map-stage {
      position: relative;
      z-index: 1;
      width: 100%;
      height: clamp(290px, 48vh, 395px);
      border-radius: 15px;
      overflow: hidden;
      border: 1px solid rgba(128, 128, 128, 0.18);
      background: #18181b;
      flex-shrink: 0;
      transition: height 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    }
    #osm-map-picker-modal.kb-label-focused .osm-map-stage {
      height: clamp(92px, 16dvh, 130px);
    }
    #osm-leaflet-map {
      width: 100%;
      height: 100%;
      z-index: 1;
      touch-action: none;
    }
    /* Smooth Dark Theme Tile Filter for OpenStreetMap */
    body.dark-mode #osm-leaflet-map .leaflet-tile-pane,
    html.dark #osm-leaflet-map .leaflet-tile-pane,
    [data-theme="dark"] #osm-leaflet-map .leaflet-tile-pane {
      filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
    }
    .osm-custom-pin-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      filter: drop-shadow(0 4px 10px rgba(13, 148, 136, 0.55));
    }
    .osm-pin-marker-inner {
      display: flex;
      align-items: center;
      justify-content: center;
      transform-origin: bottom center;
      animation: osmPinDropBounce 0.46s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    .osm-pin-pulse-ring {
      position: absolute;
      bottom: 2px;
      left: 50%;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: rgba(13, 148, 136, 0.45);
      pointer-events: none;
      animation: osmPinPulseWave 1.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    }
    .osm-meta-grid {
      display: flex;
      flex-direction: column;
      gap: 7px;
      width: 100%;
      min-width: 0;
    }
    .osm-coords-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      width: 100%;
      min-width: 0;
      font-size: 11px;
    }
    .osm-coords-mono {
      font-family: var(--font-mono, monospace);
      font-size: 11px;
      font-weight: 600;
      color: var(--accent-primary, #0D9488);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
      padding: 2px 5px;
      border-radius: 5px;
      transition: background-color 0.25s ease, transform 0.2s ease;
    }
    .osm-coords-mono.osm-value-updated {
      animation: osmValueFlash 0.55s ease;
    }
    .osm-radius-group {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      flex-shrink: 0;
    }
    .osm-radius-btn {
      height: 26px;
      padding: 0 8px;
      border-radius: 7px;
      border: 1px solid rgba(128, 128, 128, 0.2);
      background: transparent;
      color: inherit;
      font-family: var(--font-mono, monospace);
      font-size: 10.5px;
      font-weight: 600;
      line-height: 1;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .osm-radius-btn:hover {
      border-color: var(--accent-primary, #0D9488);
      transform: translateY(-1px);
    }
    .osm-radius-btn:active {
      transform: scale(0.92);
    }
    .osm-radius-btn.active {
      background: var(--accent-primary, #0D9488);
      border-color: var(--accent-primary, #0D9488);
      color: var(--accent-contrast, #ffffff);
      box-shadow: 0 4px 10px -2px rgba(13, 148, 136, 0.45);
      transform: scale(1.03);
    }
    .osm-modal-footer {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-width: 0;
    }
    .osm-cancel-btn {
      flex: 0 0 auto;
      height: 31px;
      min-height: 31px;
      padding: 0 13px;
      border-radius: 9px;
      border: 1px solid rgba(128, 128, 128, 0.2);
      background: rgba(128, 128, 128, 0.07);
      color: inherit;
      font-family: var(--font-display, sans-serif);
      font-size: 12.5px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.16s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .osm-cancel-btn:hover {
      background: rgba(128, 128, 128, 0.14);
      transform: translateY(-1px);
    }
    .osm-cancel-btn:active {
      transform: scale(0.95);
    }
    .osm-save-pin-btn {
      width: 100%;
      flex: 1 1 100%;
      min-width: 0;
      height: 42px;
      min-height: 42px;
      padding: 0 16px;
      border-radius: 12px;
      border: none;
      background: var(--accent-primary, #0D9488);
      color: var(--accent-contrast, #ffffff);
      font-family: var(--font-display, sans-serif);
      font-size: 13.5px;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      box-shadow: 0 6px 16px -4px rgba(13, 148, 136, 0.4);
      transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, filter 0.18s ease;
    }
    .osm-save-pin-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 22px -4px rgba(13, 148, 136, 0.52);
      filter: brightness(1.04);
    }
    .osm-save-pin-btn:active {
      transform: scale(0.96);
    }

    /* 🚀 Fix 1: Time Block Anti-Overflow Grid */
    .time-block-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    /* 🚀 Fix 2: Compact Stacked Input Group */
    .time-input-group {
      flex: 1 1 115px;
      display: flex;
      flex-direction: column; /* Stacks 'From' above '00:00' to save horizontal space */
      align-items: flex-start;
      background: rgba(128, 128, 128, 0.08);
      border: 1px solid rgba(128, 128, 128, 0.2);
      border-radius: 12px;
      padding: 8px 10px;
      position: relative; /* CRITICAL: Anchor for the invisible clock trigger */
      box-sizing: border-box;
      min-width: 0; /* CRITICAL: Prevents flexbox from blowing out past screen bounds */
      max-width: 100%;
      overflow: hidden;
    }

    .time-input-group span { 
      font-size: 10.5px;
      text-transform: uppercase;
      color: #888;
      font-weight: 700;
      margin-bottom: 2px;
    }

    /* 🚀 Fix 3: Native OS Circular Clock Trigger Engine */
    .time-input-group input[type="time"] {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      background: transparent;
      border: none;
      color: inherit;
      font-size: 14px;
      font-weight: 600;
      outline: none;
      padding: 0;
      font-family: "Inter", -apple-system, sans-serif;
    }

    /* This stretches the native HTML time-picker icon to cover the ENTIRE box invisibly.
       Tapping anywhere on the box instantly summons the native Android/iOS clock popup. */
    .time-input-group input[type="time"]::-webkit-calendar-picker-indicator {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      height: 100%;
      background: transparent;
      color: transparent;
      cursor: pointer;
      z-index: 10;
    }

    /* 🚀 Fix 1: Advanced Card Flex Header */
    .advanced-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 2px;
    }

    /* 🚀 Fix 2: Subtle Demount/Remove Button */
    .remove-field-btn {
      background: transparent;
      border: none;
      color: #888;
      cursor: pointer;
      padding: 6px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s ease, color 0.2s ease;
    }
    .remove-field-btn:hover, .remove-field-btn:active {
      background: rgba(239, 68, 68, 0.1); /* Soft red tint */
      color: #ef4444; /* Alert red */
    }

    /* 🚀 Fix 1: Calendar Sync Row */
    .sync-toggle-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(128, 128, 128, 0.05);
      padding: 10px 12px;
      border-radius: 12px;
      margin-top: 8px;
      border: 1px solid rgba(128, 128, 128, 0.1);
    }
    .sync-toggle-row span {
      font-size: 13px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      color: #888;
    }
    body.light-mode .sync-toggle-row span { color: #475569; }

    /* 🚀 Fix 1: The 24-Hour Planner Container */
    #time-blocking-schedule {
      display: flex;
      flex-direction: column;
      padding: 8px 0;
      margin-top: 8px;
    }

    /* 🚀 Fix 2: Individual Hour Slots */
    .time-slot-row {
      display: flex;
      min-height: 48px; /* Compact when empty, expands automatically when tasks exist */
      border-bottom: 1px solid rgba(128, 128, 128, 0.08);
    }
    .time-slot-row:last-child { border-bottom: none; }

    .time-slot-label {
      width: 55px;
      padding-top: 12px;
      padding-right: 12px;
      font-size: 11px;
      font-weight: 700;
      color: #888;
      text-align: right;
      border-right: 1px dashed rgba(128, 128, 128, 0.2);
    }

    .time-slot-content {
      flex: 1;
      padding: 8px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* 🚀 Fix 3: Task Cards (Nested INSIDE the slot) */
    .slot-task-card {
      background: rgba(13, 148, 136, 0.08); /* Subtle theme tint */
      border-left: 3px solid var(--primary-color, #0d9488);
      border-radius: 8px;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      cursor: pointer;
      transition: transform 0.15s, background 0.2s;
    }
    .slot-task-card:active { transform: scale(0.98); background: rgba(13, 148, 136, 0.15); }

    .slot-task-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
    body.light-mode .slot-task-title { color: #0f172a; }
    body.dark-mode .slot-task-title { color: #f8fafc; }

    .slot-task-time { font-size: 11px; font-weight: 600; color: var(--primary-color, #0d9488); }
    .slot-task-loc { font-size: 11px; color: #888; margin-top: 4px; display: flex; align-items: center; gap: 4px; }

    /* 🚀 Fix 1: Unallotted Tasks Tray */
    #unallotted-tray {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding: 12px;
      background: rgba(128, 128, 128, 0.05);
      border: 1px dashed rgba(128, 128, 128, 0.3);
      border-radius: 16px;
      margin-bottom: 16px;
      min-height: 40px;
      align-items: center;
    }
    #unallotted-tray::-webkit-scrollbar { display: none; }

    .unallotted-card {
      min-width: 140px;
      background: rgba(128, 128, 128, 0.1);
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      cursor: grab;
      user-select: none;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      border: 1px solid rgba(128, 128, 128, 0.1);
    }
    .unallotted-card:active, .slot-task-card:active { cursor: grabbing; }

    /* 🚀 Fix 1: Minimalist Anticipated Drop Area */
    .time-slot-content {
      transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
      border: 2px solid transparent; 
      border-radius: 12px;
      min-height: 48px;
      cursor: cell;
    }

    /* The modern drag-over state: Soft background, solid outline, and a slight push-down scale */
    .time-slot-content.drag-over {
      background: rgba(13, 148, 136, 0.05); /* Very subtle primary tint */
      border: 2px solid var(--primary-color, #0d9488); /* Clean, solid outline */
      transform: scale(0.98); /* Physical depression effect */
      box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.03);
    }

    /* 🚀 Fix 1: Protect Draggables from OS Swipe Hijacking */
    .slot-task-card, .unallotted-card {
      touch-action: none !important; /* CRITICAL for mobile drag-and-drop */
      -webkit-user-select: none;
      user-select: none;
    }

    /* 🚀 Fix 1: Unallotted Tray Drop Zone State */
    #unallotted-tray {
      transition: background 0.2s, border 0.2s, transform 0.2s;
    }

    #unallotted-tray.drag-over {
      background: rgba(239, 68, 68, 0.05); /* Soft red tint to indicate 'removing' the time block */
      border-color: rgba(239, 68, 68, 0.5);
      transform: scale(0.98);
    }

    /* Ensure empty tray text doesn't block the drop event */
    .empty-tray-text {
      pointer-events: none; 
    }

    /* 🚀 Fix 1: Reschedule Button Light/Dark Theme Contrast */
    .reschedule-btn, 
    button[id*="reschedule"],
    .overdue-header-actions button {
      /* Default / Light Mode State */
      color: #64748b !important; /* High contrast Slate for Light Mode */
      background: rgba(100, 116, 139, 0.08) !important;
      border-color: rgba(100, 116, 139, 0.18) !important;
      transition: all 0.2s ease;
    }

    .reschedule-btn:hover,
    button[id*="reschedule"]:hover {
      background: rgba(100, 116, 139, 0.15) !important;
      color: #334155 !important;
    }

    /* Dark Mode Overrides */
    body.dark-mode .reschedule-btn,
    body.dark-mode button[id*="reschedule"],
    body.dark-mode .overdue-header-actions button,
    html.dark .reschedule-btn,
    html.dark button[id*="reschedule"],
    html.dark .overdue-header-actions button,
    [data-theme="dark"] .reschedule-btn,
    [data-theme="dark"] button[id*="reschedule"],
    [data-theme="dark"] .overdue-header-actions button {
      color: #94a3b8 !important; /* Softer Slate for Dark Mode */
      background: rgba(148, 163, 184, 0.1) !important;
      border-color: rgba(148, 163, 184, 0.18) !important;
    }

    body.dark-mode .reschedule-btn:hover,
    body.dark-mode button[id*="reschedule"]:hover,
    html.dark .reschedule-btn:hover,
    html.dark button[id*="reschedule"]:hover,
    [data-theme="dark"] .reschedule-btn:hover,
    [data-theme="dark"] button[id*="reschedule"]:hover {
      background: rgba(148, 163, 184, 0.2) !important;
      color: #f8fafc !important;
    }

    .reschedule-btn {
      white-space: nowrap;
      flex-shrink: 0;
    }

    .board-column-header .board-col-title-group {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .board-column-header .board-reschedule-btn {
      padding: 4px 10px;
      font-size: 0.62rem;
      letter-spacing: 0.8px;
    }

    .todo-cal-header-actions .reschedule-btn {
      padding: 4px 10px;
      font-size: 0.62rem;
      letter-spacing: 0.8px;
    }

    .cal-overdue-divider {
      margin-top: 2px;
      margin-bottom: 4px;
    }

    .cal-today-divider {
      display: flex;
      align-items: center;
      margin-top: 10px;
      margin-bottom: 4px;
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: var(--text-muted);
    }

    .cal-today-divider::after {
      display: none !important;
    }

    /* 🚀 Fix 2: Reschedule Dropdown Menu Theme Engine */
    .reschedule-dropdown,
    .dropdown-menu[id*="reschedule"],
    .reschedule-options,
    #bulk-reschedule-dropdown {
      /* Default / Light Mode State */
      background-color: #ffffff !important;
      border: 1px solid rgba(0, 0, 0, 0.08) !important;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
      color: #0f172a !important;
    }

    #bulk-reschedule-dropdown {
      position: fixed !important;
    }

    /* Dropdown Action Items (Light Mode) */
    .reschedule-dropdown button,
    .dropdown-menu[id*="reschedule"] button,
    #bulk-reschedule-dropdown .reschedule-option,
    .reschedule-option {
      color: #334155 !important;
    }
    .reschedule-dropdown button:hover,
    .dropdown-menu[id*="reschedule"] button:hover,
    #bulk-reschedule-dropdown .reschedule-option:hover,
    .reschedule-option:hover {
      background-color: rgba(0, 0, 0, 0.05) !important;
      color: #0f172a !important;
    }

    /* Dark Mode Overrides */
    body.dark-mode .reschedule-dropdown,
    body.dark-mode .dropdown-menu[id*="reschedule"],
    body.dark-mode .reschedule-options,
    body.dark-mode #bulk-reschedule-dropdown,
    html.dark .reschedule-dropdown,
    html.dark .dropdown-menu[id*="reschedule"],
    html.dark .reschedule-options,
    html.dark #bulk-reschedule-dropdown,
    [data-theme="dark"] .reschedule-dropdown,
    [data-theme="dark"] .dropdown-menu[id*="reschedule"],
    [data-theme="dark"] .reschedule-options,
    [data-theme="dark"] #bulk-reschedule-dropdown {
      background-color: #1e293b !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
      color: #f8fafc !important;
    }

    /* Dropdown Action Items (Dark Mode) */
    body.dark-mode .reschedule-dropdown button,
    body.dark-mode .dropdown-menu[id*="reschedule"] button,
    body.dark-mode #bulk-reschedule-dropdown .reschedule-option,
    body.dark-mode .reschedule-option,
    html.dark .reschedule-dropdown button,
    html.dark .dropdown-menu[id*="reschedule"] button,
    html.dark #bulk-reschedule-dropdown .reschedule-option,
    html.dark .reschedule-option,
    [data-theme="dark"] .reschedule-dropdown button,
    [data-theme="dark"] .dropdown-menu[id*="reschedule"] button,
    [data-theme="dark"] #bulk-reschedule-dropdown .reschedule-option,
    [data-theme="dark"] .reschedule-option {
      color: #cbd5e1 !important;
    }
    body.dark-mode .reschedule-dropdown button:hover,
    body.dark-mode .dropdown-menu[id*="reschedule"] button:hover,
    body.dark-mode #bulk-reschedule-dropdown .reschedule-option:hover,
    body.dark-mode .reschedule-option:hover,
    html.dark .reschedule-dropdown button:hover,
    html.dark .dropdown-menu[id*="reschedule"] button:hover,
    html.dark #bulk-reschedule-dropdown .reschedule-option:hover,
    html.dark .reschedule-option:hover,
    [data-theme="dark"] .reschedule-dropdown button:hover,
    [data-theme="dark"] .dropdown-menu[id*="reschedule"] button:hover,
    [data-theme="dark"] #bulk-reschedule-dropdown .reschedule-option:hover,
    [data-theme="dark"] .reschedule-option:hover {
      background-color: rgba(255, 255, 255, 0.05) !important;
      color: #ffffff !important;
    }

    /* 🚀 Fix 1: Date Selection Modal - Inbox Button */
    .date-quick-select-row {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
      overflow-x: auto;
      padding-bottom: 4px;
    }
    .date-quick-select-row::-webkit-scrollbar { display: none; }

    .date-quick-btn {
      background: rgba(128, 128, 128, 0.08);
      border: 1px solid rgba(128, 128, 128, 0.2);
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 600;
      color: inherit;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.2s, transform 0.1s;
    }
    .date-quick-btn:active { transform: scale(0.95); }

    /* 🚀 Fix 1: Base Inbox & Custom Button Layout */
    .date-quick-btn.inbox,
    .date-quick-btn.custom-recur {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    /* 🚀 Fix 2: Universal Active State Highlight */
    .date-quick-btn.active {
      background: rgba(13, 148, 136, 0.1) !important;
      color: var(--primary-color, #0d9488) !important;
      border-color: var(--primary-color, #0d9488) !important;
    }

    body.dark-mode .date-quick-btn.active,
    html.dark .date-quick-btn.active,
    [data-theme="dark"] .date-quick-btn.active {
      background: rgba(45, 212, 191, 0.15) !important;
      color: #2dd4bf !important; /* Brighter teal for dark mode */
      border-color: #2dd4bf !important;
    }

    /* Custom Multi-Weekday & Multi-Date Recurrence Panel */
    .custom-recur-panel {
      flex-direction: column;
      gap: 12px;
      margin-bottom: 14px;
      animation: paneEnter 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .custom-recur-weekdays-block {
      background: var(--bg-elevated, rgba(128, 128, 128, 0.06));
      border: 1px solid var(--border-subtle, rgba(128, 128, 128, 0.16));
      border-radius: 16px;
      padding: 10px 10px 11px;
    }
    .custom-recur-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
      padding: 0 2px;
    }
    .custom-recur-section-title {
      font-size: 11.5px;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      opacity: 0.72;
    }
    .custom-recur-clear-btn {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--accent-primary, #0d9488);
      background: transparent;
      border: none;
      padding: 2px 6px;
      border-radius: 8px;
      cursor: pointer;
    }
    .custom-weekdays-row {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 5px;
      width: 100%;
    }
    .custom-weekday-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 36px;
      padding: 0 2px;
      border-radius: 11px;
      font-size: 11.5px;
      font-weight: 700;
      border: 1px solid var(--border-subtle, rgba(128, 128, 128, 0.2));
      background: var(--bg-surface, rgba(128, 128, 128, 0.08));
      color: #0f172a;
      cursor: pointer;
      transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
    }
    body.dark-mode .custom-weekday-btn,
    html.dark .custom-weekday-btn,
    [data-theme="dark"] .custom-weekday-btn {
      color: #e2e8f0;
      background: rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.12);
    }
    .custom-weekday-btn.active {
      background: var(--accent-primary, #0d9488) !important;
      color: #ffffff !important;
      border-color: var(--accent-primary, #0d9488) !important;
      box-shadow: 0 4px 10px rgba(13, 148, 136, 0.28);
    }
    .custom-recur-calendar-block {
      background: var(--bg-elevated, rgba(128, 128, 128, 0.04));
      border: 1px solid var(--border-subtle, rgba(128, 128, 128, 0.14));
      border-radius: 18px;
      padding: 10px 10px 10px;
    }
    .custom-cal-days-grid {
      gap: 6px;
      margin-bottom: 10px;
    }
    .custom-cal-days-grid .cal-day-btn {
      min-height: 36px;
      font-size: 12.5px;
      font-weight: 700;
      border-radius: 11px;
    }
    .custom-recur-summary {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-secondary, #64748b);
      background: rgba(13, 148, 136, 0.08);
      border: 1px solid rgba(13, 148, 136, 0.2);
      border-radius: 10px;
      padding: 6px 10px;
      line-height: 1.35;
      text-align: center;
    }

    /* 🚀 Fix 1: Calendar Grid Selected State */
    .calendar-day.selected, 
    .date-cell.selected {
      background-color: var(--accent-primary) !important;
      color: var(--accent-contrast, #ffffff) !important;
      border-radius: 50%; /* Or your preferred shape */
      font-weight: 700;
    }

    /* 🚀 Fix 1: Date Picker Footer & Save Button */
    .date-picker-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid rgba(128, 128, 128, 0.1);
    }

    .save-date-btn {
      background: var(--accent-primary);
      color: var(--accent-contrast, #ffffff);
      border: none;
      padding: 10px 24px;
      border-radius: 12px;
      font-weight: 700;
      font-size: 14px;
      cursor: pointer;
      transition: transform 0.15s, opacity 0.2s;
      box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
    }
    .save-date-btn:active { transform: scale(0.95); }

    /* 🚀 Fix 1: Bulletproof Full-Bleed Breakout */
    #board-view-container,
    #todo-list-container.kanban-board-view {
      position: relative !important;
      width: 100vw !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      background: transparent !important;
      padding: 0 !important;
      margin-top: 8px !important;
    }

    /* 🚀 Fix 2: Strict Horizontal Axis Lock */
    .board-view-layout {
      display: flex !important;
      flex-direction: row !important;
      flex-wrap: nowrap !important; /* CRITICAL: Prevents vertical stacking */
      overflow-x: auto !important;
      overflow-y: hidden !important;
      gap: 16px !important;
      padding: 16px 20px 40px 20px !important;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      align-items: flex-start !important; /* Prevents columns from stretching weirdly */
    }
    .board-view-layout::-webkit-scrollbar { display: none; }

    /* 🚀 Fix 3: Rigid Kanban Columns */
    .board-column {
      flex: 0 0 85vw !important; /* Strictly locks column width to 85% of screen */
      width: 85vw !important;
      max-width: 360px !important;
      background: rgba(128, 128, 128, 0.05) !important;
      border: 1px solid rgba(128, 128, 128, 0.1) !important;
      border-radius: 20px !important;
      padding: 16px !important;
      scroll-snap-align: center;
      display: flex !important;
      flex-direction: column !important;
      gap: 12px !important;
      max-height: 72vh !important;
      overflow-y: auto !important;
    }
    .board-column::-webkit-scrollbar { display: none; }

    .board-col-header {
      font-size: 20px !important;
      font-weight: 800 !important;
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding-bottom: 12px !important;
      border-bottom: 2px solid rgba(128, 128, 128, 0.1) !important;
      position: sticky;
      top: 0;
      background: inherit;
      z-index: 10;
    }
    .board-col-count {
      font-size: 14px !important;
      background: var(--accent-primary) !important;
      color: var(--accent-contrast, #ffffff) !important;
      padding: 4px 12px !important;
      border-radius: 16px !important;
      font-weight: 700;
    }

    /* 🚀 Fix 1: Protect the Card from Column Squashing */
    .detailed-board-card {
      background: #ffffff !important;
      border: 1px solid rgba(128, 128, 128, 0.15) !important;
      border-left: 6px solid #cbd5e1 !important; 
      border-radius: 12px !important; 
      padding: 14px 16px !important;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 8px !important;
      min-height: 72px !important; 
      text-align: left !important;
      align-items: stretch !important;
      
      /* Structural Hardening */
      width: 100% !important;
      max-width: 100% !important;
      overflow: hidden !important; 
      box-sizing: border-box !important;
      height: auto !important;
      flex-shrink: 0 !important; /* CRITICAL: Forces scrollbar on the column instead of squashing the card */
      cursor: pointer;
      transition: transform 0.15s, box-shadow 0.2s;
    }
    body.dark-mode .detailed-board-card,
    html.dark .detailed-board-card,
    [data-theme="dark"] .detailed-board-card { 
      background: #1e293b !important; 
      border-color: rgba(255,255,255,0.05) !important; 
      border-left-color: #334155 !important;
    }
    .detailed-board-card:active { transform: scale(0.98); }

    /* Priority Colors */
    .detailed-board-card.priority-high { border-left-color: #ef4444 !important; }
    .detailed-board-card.priority-medium { border-left-color: #f59e0b !important; }
    .detailed-board-card.priority-low { border-left-color: #3b82f6 !important; }

    /* 🚀 Fix 2: Protect the Header from Card Squashing */
    .board-card-header { 
      display: flex !important; 
      justify-content: space-between !important; 
      align-items: flex-start !important; 
      width: 100% !important; 
      gap: 8px !important;
      box-sizing: border-box !important;
      
      /* Structural Hardening */
      flex-shrink: 0 !important; /* CRITICAL: Prevents the header from collapsing to 0 height */
      min-height: min-content !important;
    }

    /* 🚀 Fix 3: Bulletproof Title */
    .board-card-title,
    .cal-sheet-title { 
      flex-grow: 1 !important;
      flex-shrink: 0 !important; /* Never shrink the text block */
      flex-basis: auto !important;
      min-width: 0 !important; 
      word-break: break-word !important; 
      overflow-wrap: anywhere !important; 
      white-space: normal !important; 
      font-size: 15px !important; 
      font-weight: 700 !important; 
      color: #0f172a; 
      margin: 0 !important;
      line-height: 1.3 !important;
    }
    body.dark-mode .board-card-title,
    html.dark .board-card-title,
    [data-theme="dark"] .board-card-title { color: #f8fafc; }

    /* 🚀 Fix 4: Protect other Card Elements from Squashing */
    .board-card-desc,
    .board-meta-grid,
    .board-progress-container {
      flex-shrink: 0 !important; /* Prevents details from vanishing during tray expansion */
    }

    .board-card-desc { font-size: 13px !important; color: #64748b !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-style: italic; }

    .board-meta-grid { 
      display: grid !important; 
      grid-template-columns: 1fr 1fr !important; 
      gap: 10px !important; 
      padding-top: 12px !important; 
      border-top: 1px dashed rgba(128, 128, 128, 0.2) !important; 
    }
    .board-meta-item { 
      display: flex; align-items: center; gap: 6px; 
      font-size: 12px !important; font-weight: 600 !important; color: #64748b !important; 
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    }
    .board-meta-item svg { flex-shrink: 0; color: var(--primary-color, #0d9488); }

    /* 🚀 Fix 4: Visual Progress Bar for Subtasks */
    .board-progress-container {
      margin-top: 4px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .board-progress-label {
      display: flex;
      justify-content: space-between;
      font-size: 10px;
      font-weight: 700;
      color: #888;
      text-transform: uppercase;
    }
    .board-progress-track {
      height: 4px;
      background: rgba(128, 128, 128, 0.15);
      border-radius: 2px;
      overflow: hidden;
    }
    .board-progress-fill {
      height: 100%;
      background: var(--primary-color, #0d9488);
      border-radius: 2px;
      transition: width 0.3s ease;
    }

    /* 🚀 Fix 1: Inline Action Tray Architecture */
    .board-action-tray {
      display: none; /* Toggled dynamically via JS */
      flex-direction: column;
      gap: 14px;
      margin-top: 12px;
      padding-top: 14px;
      border-top: 1px dashed rgba(128, 128, 128, 0.25);
      animation: traySlideDown 0.2s ease-out forwards;
      cursor: default; /* Prevents card click propagation */
    }

    @keyframes traySlideDown {
      from { opacity: 0; transform: translateY(-5px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* 🚀 Fix 2: Tray Option Groups & Pills */
    .tray-opt-group { display: flex; flex-direction: column; gap: 8px; }
    .tray-label { font-size: 11px; font-weight: 800; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

    .tray-pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
    .tray-pill {
      background: rgba(128, 128, 128, 0.06);
      border: 1px solid rgba(128, 128, 128, 0.2);
      padding: 8px 16px;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 700;
      color: #64748b;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    body.dark-mode .tray-pill,
    html.dark .tray-pill,
    [data-theme="dark"] .tray-pill { color: #cbd5e1; }
    .tray-pill:active { transform: scale(0.95); }

    /* Active States */
    .tray-pill.active {
      background: var(--accent-primary);
      color: var(--accent-contrast, #ffffff) !important;
      border-color: var(--accent-primary);
    }

    /* 🚀 Fix 3: Tray Action Buttons (Bottom Row) */
    .tray-action-row { display: flex; gap: 10px; margin-top: 4px; }
    .tray-btn {
      flex: 1;
      padding: 10px;
      border-radius: 12px;
      border: none;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: transform 0.1s;
    }
    .tray-btn:active { transform: scale(0.95); }
    .tray-btn.delete { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
    .tray-btn.edit { background: rgba(128, 128, 128, 0.1); color: inherit; }

    /* 🚀 Fix 1: Calendar Inspector Overlay & Animation */
    .cal-inspector-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.4);
      z-index: 9999;
      display: none; /* Toggled via JS */
      align-items: flex-end;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.2s ease;
    }
    .cal-inspector-overlay.show { opacity: 1; }

    /* 🚀 Fix 2: Bottom Sheet UI */
    .cal-inspector-sheet {
      width: 100%;
      max-width: 600px;
      background: #ffffff;
      border-radius: 28px 28px 0 0;
      padding: 24px;
      box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
      transform: translateY(100%);
      transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      display: flex;
      flex-direction: column;
      gap: 16px;
      max-height: 85vh;
      overflow-y: auto;
    }
    body.dark-mode .cal-inspector-sheet,
    html.dark .cal-inspector-sheet,
    [data-theme="dark"] .cal-inspector-sheet { background: #1e293b; border-top: 1px solid rgba(255,255,255,0.05); }
    .cal-inspector-overlay.show .cal-inspector-sheet { transform: translateY(0); }

    /* 🚀 Fix 3: Sheet Typography & Grids */
    .cal-sheet-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
    .cal-sheet-title { font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1.2; margin: 0; }
    body.dark-mode .cal-sheet-title,
    html.dark .cal-sheet-title,
    [data-theme="dark"] .cal-sheet-title { color: #f8fafc; }

    .cal-sheet-close {
      background: rgba(128, 128, 128, 0.1);
      border: none;
      border-radius: 50%;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #64748b;
      cursor: pointer;
      flex-shrink: 0;
    }

    .cal-sheet-desc { font-size: 14px; color: #64748b; line-height: 1.5; background: rgba(128,128,128,0.04); padding: 12px; border-radius: 12px; }
    .cal-sheet-actions { display: flex; gap: 12px; margin-top: 8px; }

    /* 🚀 Fix 1: Calendar Inline Edit Tray */
    .cal-inline-edit-tray {
      display: none; /* Toggled via JS */
      flex-direction: column;
      gap: 12px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px dashed rgba(128, 128, 128, 0.2);
      animation: inlineTrayFade 0.2s ease-out forwards;
      cursor: default;
    }
    @keyframes inlineTrayFade {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* 🚀 Fix 2: Inline Inputs */
    .cal-inline-input {
      width: 100%;
      background: rgba(128, 128, 128, 0.05);
      border: 1px solid rgba(128, 128, 128, 0.2);
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      color: inherit;
      font-family: inherit;
      box-sizing: border-box;
    }
    .cal-inline-input:focus {
      outline: none;
      border-color: var(--primary-color, #0d9488);
      background: transparent;
    }

    .cal-inline-row {
      display: flex;
      gap: 10px;
    }

    /* 🚀 Fix 3: Inline Action Buttons */
    .cal-inline-actions { display: flex; gap: 8px; margin-top: 4px; }
    .cal-inline-btn {
      flex: 1;
      padding: 10px;
      border-radius: 10px;
      border: none;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.1s;
    }
    .cal-inline-btn:active { transform: scale(0.95); }
    .cal-inline-btn.save { background: var(--accent-primary); color: var(--accent-contrast, #ffffff); }
    .cal-inline-btn.cancel { background: rgba(128, 128, 128, 0.1); color: inherit; }

    /* 🚀 Fix 1: Seamless List-Style Title */
    .seamless-list-title {
      width: 100%;
      border: none;
      background: transparent;
      font-size: 16px;
      font-weight: 700;
      color: #0f172a;
      padding: 4px 0 12px 0;
      margin-bottom: 12px;
      border-bottom: 1px solid rgba(128, 128, 128, 0.15);
      font-family: inherit;
      transition: border-color 0.2s;
    }
    body.dark-mode .seamless-list-title,
    html.dark .seamless-list-title,
    [data-theme="dark"] .seamless-list-title { color: #f8fafc; }
    .seamless-list-title:focus { 
      outline: none; 
      border-bottom-color: var(--primary-color, #0d9488); 
    }

    /* 🚀 Fix 2: Sleek Time Block Pills */
    .seamless-time-pill {
      background: rgba(128, 128, 128, 0.06);
      border: 1px solid rgba(128, 128, 128, 0.15);
      border-radius: 12px;
      padding: 8px 12px;
      font-size: 13px;
      font-weight: 700;
      color: inherit;
      font-family: inherit;
      flex: 1;
      transition: border-color 0.2s;
    }
    .seamless-time-pill:focus { 
      outline: none; 
      border-color: var(--primary-color, #0d9488); 
      background: transparent;
    }

    /* 🚀 Fix 1: Universal Expanded Tray (List View Replica) */
    .universal-expanded-tray {
      display: none; /* Toggled via JS */
      flex-direction: column;
      padding-top: 8px;
      animation: trayFadeIn 0.15s ease-out forwards;
      cursor: default; 
    }
    @keyframes trayFadeIn { from { opacity: 0; } to { opacity: 1; } }

    /* 🚀 Fix 2: Subtask Adder & Divider */
    .univ-subtask-add {
      color: var(--primary-color, #0d9488);
      font-size: 13px;
      font-weight: 700;
      padding: 8px 0;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      transition: opacity 0.2s;
    }
    .univ-subtask-add:active { opacity: 0.6; }

    .univ-divider {
      height: 1px;
      background: rgba(128, 128, 128, 0.15);
      margin: 14px 0;
      width: 100%;
    }

    /* 🚀 Fix 3: Icon-Based Action Row */
    .univ-action-row {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
    }

    .univ-btn-date {
      background: rgba(13, 148, 136, 0.15);
      color: var(--primary-color, #0d9488);
      border: 1px solid var(--primary-color, #0d9488);
      border-radius: 12px;
      padding: 8px 14px;
      font-weight: 700;
      font-size: 13px;
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      transition: transform 0.1s;
    }
    .univ-btn-date:active { transform: scale(0.95); }

    .univ-btn-icon {
      background: #f4f3ef; /* Premium beige/warm gray matching your list view */
      border: none;
      border-radius: 12px;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: #64748b;
      transition: transform 0.1s, background 0.2s;
    }
    body.dark-mode .univ-btn-icon,
    html.dark .univ-btn-icon,
    [data-theme="dark"] .univ-btn-icon { background: rgba(255, 255, 255, 0.05); color: #cbd5e1; }
    .univ-btn-icon:active { transform: scale(0.92); }
    .univ-btn-icon.delete { color: #ef4444; }

    /* 🚀 Fix 4: More Options Footer */
    .univ-more-options {
      color: #5d8f8a;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.5px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 18px;
      cursor: pointer;
      transition: opacity 0.2s;
    }
    .univ-more-options:active { opacity: 0.6; }

    /* 🚀 Fix 1: Interactive Subtask Elements */
    .univ-subtask-item {
      display: flex; 
      align-items: center; 
      gap: 10px; 
      font-size: 13px; 
      color: #334155; 
      margin-bottom: 8px; 
      cursor: pointer;
      transition: opacity 0.2s;
    }
    body.dark-mode .univ-subtask-item,
    html.dark .univ-subtask-item,
    [data-theme="dark"] .univ-subtask-item { color: #cbd5e1; }
    .univ-subtask-item:active { opacity: 0.7; }

    .univ-subtask-checkbox {
      width: 16px; 
      height: 16px; 
      border: 2px solid var(--primary-color, #0d9488); 
      border-radius: 4px; 
      transition: background 0.2s; 
      flex-shrink: 0;
    }

    @keyframes trayFadeOut { 
      from { opacity: 1; transform: scale(1); } 
      to { opacity: 0; transform: scale(0.9); } 
    }

    /* 🚀 Fix 1: Inline More Options Panel */
    .univ-more-panel {
      display: none; /* Toggled via JS */
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px dashed rgba(128, 128, 128, 0.2);
      animation: trayFadeIn 0.2s ease-out forwards;
      cursor: default;
    }

    /* Reusable Inline Inputs */
    .cal-inline-input {
      width: 100%;
      background: rgba(128, 128, 128, 0.05);
      border: 1px solid rgba(128, 128, 128, 0.2);
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      color: inherit;
      font-family: inherit;
      box-sizing: border-box;
      transition: border-color 0.2s;
    }
    .cal-inline-input:focus {
      outline: none;
      border-color: var(--primary-color, #0d9488);
      background: transparent;
    }

    /* 🚀 Fix 1: Sleek Horizontal Popover Container */
    .univ-sleek-popover {
      display: none; /* Toggled to flex via JS */
      align-items: center;
      justify-content: space-between;
      background: #ffffff;
      border: 1px solid rgba(128, 128, 128, 0.1);
      border-radius: 16px;
      padding: 6px;
      margin-top: 12px;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
      animation: popoverFadeIn 0.15s ease-out forwards;
      gap: 4px;
      overflow-x: auto;
    }
    body.dark-mode .univ-sleek-popover,
    html.dark .univ-sleek-popover,
    [data-theme="dark"] .univ-sleek-popover { background: #1e293b; border-color: rgba(255,255,255,0.05); }
    .univ-sleek-popover::-webkit-scrollbar { display: none; }

    @keyframes popoverFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

    /* 🚀 Fix 2: High-Fidelity Pills */
    .sleek-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 12px;
      border-radius: 12px;
      border: none;
      background: transparent;
      font-size: 13px;
      font-weight: 700;
      color: #64748b;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
    }
    .sleek-pill:active { transform: scale(0.95); }

    /* The Active State (Grey Bubble with Shadow) */
    .sleek-pill.active {
      background: #f1f5f9;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
      color: #334155;
    }
    body.dark-mode .sleek-pill.active,
    html.dark .sleek-pill.active,
    [data-theme="dark"] .sleek-pill.active { background: rgba(255,255,255,0.1); color: #f8fafc; }

    /* 🚀 Fix 3: Exact Priority and Energy Colors */
    .sleek-pill.pri-low { color: #3b82f6; }
    .sleek-pill.pri-med { color: #f97316; }
    .sleek-pill.pri-high { color: #ef4444; }

    .sleek-pill.eng-low { color: #22c55e; }
    .sleek-pill.eng-med { color: #eab308; }
    .sleek-pill.eng-high { color: #f97316; }

    /* 🚀 Fix 1: Main Container & Typography (List View 1:1 Parity) */
    .exact-expanded-tray {
      display: none; /* Toggled via JS */
      flex-direction: column;
      width: 100%;
      margin-top: 0;
      cursor: default;
      box-sizing: border-box;
    }
    .detailed-board-card.expanded {
      border-radius: 26px !important;
    }
    .detailed-board-card.expanded:active {
      transform: none !important;
    }
    .detailed-board-card.expanded .subtasks-accordion,
    .exact-expanded-tray .subtasks-accordion {
      max-height: none;
      opacity: 1;
      margin-top: 10px;
      overflow: visible;
      pointer-events: auto;
    }
    .detailed-board-card.expanded .task-options-row,
    .exact-expanded-tray .task-options-row {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: flex-start;
      flex-wrap: wrap;
      gap: 6px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      overflow: visible;
      animation: paneEnter 0.22s var(--spring-fluid);
    }
    .exact-expanded-tray .subtasks-accordion .subtasks-wrapper,
    .exact-expanded-tray .subtasks-accordion .btn-reveal-subtask-input,
    .exact-expanded-tray .subtasks-accordion .subtask-add-row {
      margin-left: 30px;
      max-width: calc(100% - 30px);
      box-sizing: border-box;
    }
    .board-column .exact-expanded-tray .subtasks-accordion .subtasks-wrapper,
    .board-column .exact-expanded-tray .subtasks-accordion .btn-reveal-subtask-input,
    .board-column .exact-expanded-tray .subtasks-accordion .subtask-add-row {
      margin-left: 0;
      max-width: 100%;
    }
    .exact-add-subtask {
      color: #0d9488;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      margin-bottom: 12px;
    }
    .exact-divider {
      height: 1px;
      background: rgba(128, 128, 128, 0.12);
      width: 100%;
      margin-bottom: 12px;
    }

    /* 🚀 Fix 1b: Prevent Card Clipping */
    .detailed-board-card {
      overflow: visible !important;
      box-sizing: border-box !important;
    }

    /* 🚀 Fix 2: Wrap-Safe Action Row */
    .exact-action-row {
      display: flex;
      flex-wrap: wrap; /* CRITICAL: Prevents crushing on small mobile screens */
      gap: 8px;
      align-items: center;
      width: 100%;
    }
    .exact-btn-date {
      background: #eaf5f4;
      color: #0d9488;
      border: 1px solid rgba(13, 148, 136, 0.3);
      border-radius: 12px;
      padding: 0 14px;
      height: 40px;
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
    }
    .exact-btn-icon {
      background: #f4f3ef; /* Native Beige */
      color: #a8a29e;
      border: none;
      border-radius: 12px;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    .exact-btn-icon.active { background: #e7e5df; } /* Active toggle state */
    .exact-btn-delete {
      background: #fef2f2;
      color: #ef4444;
      border: none;
      border-radius: 12px;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      margin-left: auto; /* Pushes to the right edge */
    }

    /* 🚀 Fix 3: Inline, Non-Clipping Popovers (Exact List View Glass Popover Parity) */
    .exact-popover-wrapper {
      position: relative !important;
      display: none;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px;
      padding: 8px;
      border-radius: 14px;
      background: var(--bg-glass);
      border: 1px solid rgba(128, 128, 128, 0.15);
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
      transform-origin: top center;
      animation: popIn 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      overflow: visible;
      z-index: 30;
    }
    .exact-popover-wrapper.open {
      display: flex;
    }

    .exact-pop-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 12px;
      border-radius: 10px;
      border: none;
      background: transparent;
      font-size: 13px;
      font-weight: 700;
      color: #64748b;
      cursor: pointer;
      transition: background 0.1s;
    }
    .exact-pop-pill.active {
      background: #f1f5f9; /* Native Grey Bubble */
      color: #1e293b;
      box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
    }

    /* 🚀 Fix 4: More Options & Panel */
    .exact-more-options {
      color: #5d8f8a;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 16px;
      cursor: pointer;
      text-transform: uppercase;
    }
    /* 🚀 Fix 1: Annihilate Duplicate Trays */
    /* If a second tray renders in the same card, it is permanently hidden */
    .exact-expanded-tray ~ .exact-expanded-tray {
      display: none !important;
      opacity: 0 !important;
      pointer-events: none !important;
      height: 0 !important;
      overflow: hidden !important;
    }

    /* 🚀 Fix 2: Hide Native App Ghost HTML */
    /* Hides common native classes if they sit next to our custom tray */
    .exact-expanded-tray ~ .task-expanded-content,
    .exact-expanded-tray ~ .action-tray,
    .exact-expanded-tray ~ .subtask-adder {
      display: none !important;
    }

    /* 🚀 Fix 3: Premium Dashed Container for Grey Pills */
    .exact-more-panel {
      display: none; /* Toggled via JS */
      flex-direction: column;
      margin-top: 14px;
      padding: 12px;
      background: #ffffff;
      border: 1px dashed rgba(128, 128, 128, 0.25); /* The native dotted bounding box */
      border-radius: 16px;
      width: 100%;
      box-sizing: border-box;
      animation: popoverFadeIn 0.2s ease-out forwards;
    }
    body.dark-mode .exact-more-panel { background: #1e293b; border-color: rgba(255,255,255,0.1); }

    /* 🚀 Fix 2: Premium Input Styling */
    .exact-input {
      width: 100%;
      background: rgba(128, 128, 128, 0.04);
      border: 1px solid rgba(128, 128, 128, 0.12);
      border-radius: 12px;
      padding: 12px 14px;
      font-size: 14px;
      font-family: inherit;
      color: inherit;
      outline: none;
      box-sizing: border-box;
      transition: all 0.2s ease;
    }
    .exact-input:focus {
      border-color: var(--primary-color, #0d9488);
      background: transparent;
      box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    }
    body.dark-mode .exact-input,
    html.dark .exact-input,
    [data-theme="dark"] .exact-input { border-color: rgba(255,255,255,0.1); }

    /* 🚀 Fix 3: Inline Save Button */
    .exact-save-btn {
      background: var(--accent-primary);
      color: var(--accent-contrast, #ffffff);
      border: none;
      border-radius: 12px;
      padding: 12px;
      font-weight: 700;
      font-size: 14px;
      margin-top: 14px;
      cursor: pointer;
      transition: transform 0.1s;
      box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
    }
    .exact-save-btn:active { transform: scale(0.95); }

    /* 🚀 Fix 1: Native Grey Pill Styling */
    .exact-grey-pill {
      background: #f8fafc;
      border: 1px solid rgba(128, 128, 128, 0.08);
      border-radius: 12px;
      padding: 12px 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 14px;
      font-weight: 600;
      color: #334155;
      cursor: pointer;
      margin-bottom: 8px;
      transition: background 0.15s, transform 0.1s;
    }
    body.dark-mode .exact-grey-pill { background: rgba(255,255,255,0.05); color: #cbd5e1; }
    .exact-grey-pill:active { background: #f1f5f9; transform: scale(0.98); }
    .exact-grey-pill svg { color: #64748b; }

    /* 🚀 Fix 1: Location Widget Container */
    .exact-loc-widget {
      display: none; /* Toggled to flex via JS */
      flex-direction: column;
      gap: 8px;
      margin-bottom: 12px;
    }

    /* 🚀 Fix 2: Header & Close Button */
    .exact-loc-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: #94a3b8; /* Native Grey */
      font-size: 13px;
      font-weight: 700;
      margin-bottom: 4px;
      padding: 0 4px;
    }
    .exact-loc-header svg {
      cursor: pointer;
      color: #94a3b8;
      transition: color 0.15s;
    }
    .exact-loc-header svg:hover { color: #475569; }
    body.dark-mode .exact-loc-header svg:hover { color: #f8fafc; }

    /* 🚀 Fix 3: Native Dropdown & Action Button */
    .exact-loc-dropdown, 
    .exact-loc-action-btn {
      background: transparent;
      border: 1px solid rgba(128, 128, 128, 0.2);
      border-radius: 12px;
      padding: 14px 16px;
      display: flex;
      align-items: center;
      font-size: 14px;
      font-weight: 600;
      color: inherit;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
    }
    .exact-loc-dropdown { justify-content: space-between; }
    .exact-loc-action-btn { justify-content: flex-start; gap: 12px; }
    .exact-loc-action-btn:active { background: rgba(128, 128, 128, 0.05); }

    /* The Exact Red Map Pin */
    .exact-loc-action-btn svg {
      color: #ef4444; /* Native Red */
    }

    /* 🚀 Fix 1: Theme the Native Calendar Icon */
    /* Light Mode Base */
    input[type="date"]::-webkit-calendar-picker-indicator {
      cursor: pointer;
      opacity: 0.5;
      transition: all 0.2s ease;
    }

    /* Light Mode Hover (Shifts to Sharpener Teal) */
    input[type="date"]::-webkit-calendar-picker-indicator:hover {
      opacity: 1;
      filter: invert(0.4) sepia(1) saturate(5) hue-rotate(130deg);
    }

    /* Dark Mode Base (Inverts from pitch black to sleek grey) */
    body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
    html.dark input[type="date"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
      filter: invert(1) opacity(0.6);
    }

    /* Dark Mode Hover (Shifts to glowing Sharpener Teal) */
    body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator:hover,
    html.dark input[type="date"]::-webkit-calendar-picker-indicator:hover,
    [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
      filter: invert(0.7) sepia(1) saturate(5) hue-rotate(130deg) brightness(1.2);
    }

    /* Ensure the date input text matches the modal's typography */
    .date-picker-header input[type="date"],
    #date-picker-native-input {
      color: inherit;
      font-family: inherit;
      font-weight: 700;
    }

    /* 🚀 Fix 1: Hardened Parent Containers */
    /* Forces the flex container to respect the column width and enables children to shrink */
    .board-card-header,
    .cal-task-header,
    .cal-event-header,
    .calendar-card-header {
      display: flex !important;
      flex-wrap: nowrap !important;
      min-width: 0 !important; /* CRITICAL: Unlocks shrinking for flex children */
      max-width: 100% !important;
      width: 100% !important;
      align-items: flex-start !important;
      box-sizing: border-box !important;
    }

    /* 🚀 Fix 2: Bulletproof Title Text Wrapping */
    /* Forces continuous text strings to break violently at the container edge */
    .board-card-title,
    .cal-sheet-title,
    .cal-task-title,
    .calendar-task-title,
    .calendar-event-title,
    .detailed-board-card .board-card-title {
      flex: 1 1 auto !important; /* Allows the title to fill space but still shrink */
      min-width: 0 !important; /* CRITICAL: Permits the element to shrink narrower than its text */
      max-width: 100% !important;
      white-space: normal !important; /* Overrides any nowrap commands */
      overflow-wrap: anywhere !important; /* Aggressively breaks long strings without spaces */
      word-break: break-word !important;
      word-wrap: break-word !important;
      display: block !important;
      line-height: 1.4 !important;
      margin: 0 !important;
      padding-right: 8px !important; /* Ensures text doesn't touch the Priority/Energy icons */
    }

    /* 🚀 Fix 3: Strict Card Boundaries */
    /* Ensures the outermost card never expands past the Kanban/Calendar column */
    .detailed-board-card,
    .cal-task-card,
    .calendar-card {
      min-width: 0 !important;
      max-width: 100% !important;
      width: 100% !important;
      overflow: visible !important; /* Visible allows popovers to escape, but width remains strict */
      box-sizing: border-box !important;
    }

    /* 🚀 Fix 1: Hide redundant bottom save button structurally */
    #date-picker-modal .modal-content > div:last-child button:last-child,
    #date-picker-modal .modal-footer button.save-btn,
    .date-picker-container > div:last-of-type > button:last-of-type,
    #sheet-date-repeat .date-picker-footer button.save-date-btn,
    .date-picker-footer button.save-date-btn {
      /* If the structural hierarchy matches the bottom row, nuke it */
      display: none !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }

    /* 🚀 Fix 1: NLP Wrapper & Layering */
    .nlp-wrapper {
      position: relative;
      width: 100%;
      display: flex;
      align-items: center;
    }

    /* 🚀 Fix 2: The Highlight Backdrop */
    .nlp-backdrop,
    #nlp-shadow.nlp-backdrop {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;

      /* 🔴 IMPORTANT: These must EXACTLY match your main input's font and padding */
      padding: 12px 14px;
      font-size: 15px;
      font-family: inherit;
      font-weight: 600;
      line-height: normal;
      border: 1px solid transparent;
      box-sizing: border-box;

      color: transparent; /* Normal text is invisible on the backdrop layer */
      white-space: pre; /* Prevents wrapping, matches <input type="text"> */
      overflow: hidden; /* Hides overflow */
      pointer-events: none; /* Allows clicks to pass through to the real input */
      z-index: 1;
    }

    /* 🚀 Fix 3: The Actual Input Element */
    .nlp-input,
    #composer-task-title.nlp-input {
      width: 100%;
      padding: 12px 14px;
      font-size: 15px;
      font-family: inherit;
      font-weight: 600;
      line-height: normal;
      background: transparent !important; /* See through to the backdrop */
      border: 1px solid rgba(128, 128, 128, 0.2);
      border-radius: 12px;
      color: #0f172a;
      box-sizing: border-box;
      position: relative;
      z-index: 2;
      transition: border-color 0.2s;
    }
    .nlp-input:focus,
    #composer-task-title.nlp-input:focus {
      outline: none;
      border-color: var(--primary-color, #0d9488);
    }
    body.dark-mode .nlp-input,
    html.dark .nlp-input,
    [data-theme="dark"] .nlp-input,
    body.dark-mode #composer-task-title.nlp-input,
    html.dark #composer-task-title.nlp-input,
    [data-theme="dark"] #composer-task-title.nlp-input {
      color: #f8fafc;
      border-color: rgba(255, 255, 255, 0.1);
    }

    /* 🚀 Fix 4: The Teal Highlight Marker */
    .nlp-match {
      background: rgba(13, 148, 136, 0.2); /* Teal marker background */
      color: transparent; /* Keeps text rendering handled by the top layer to prevent fuzzy kerning */
      border-radius: 4px;
      padding: 2px 0;
      margin: 0 -1px; /* Micro-adjustment for exact letter spacing */
    }
    body.dark-mode .nlp-match,
    html.dark .nlp-match,
    [data-theme="dark"] .nlp-match {
      background: rgba(13, 148, 136, 0.35);
    }

    /* 🚀 Fix 1: Default Suggestion Chips */
    .recurring-chips {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }
    .recurring-chip {
      background: rgba(128, 128, 128, 0.08);
      border: 1px solid rgba(128, 128, 128, 0.1);
      color: #475569;
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s;
    }
    .recurring-chip:hover { background: rgba(128, 128, 128, 0.15); }
    .recurring-chip:active { transform: scale(0.95); }
    body.dark-mode .recurring-chip,
    html.dark .recurring-chip,
    [data-theme="dark"] .recurring-chip { color: #cbd5e1; }

    /* 🚀 Fix 1: Universal AI Confirmation Badge */
    .recurring-confirm {
      display: none; /* Toggled via JS */
      align-items: center;
      background: rgba(13, 148, 136, 0.05);
      color: #0d9488;
      border: 1px solid rgba(13, 148, 136, 0.15);
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 13px;
      font-weight: 600;
      margin-top: 8px;
      margin-bottom: 8px;
      width: 100%;
      box-sizing: border-box;
      animation: popoverFadeIn 0.2s ease;
    }
    body.dark-mode .recurring-confirm,
    html.dark .recurring-confirm,
    [data-theme="dark"] .recurring-confirm {
      background: rgba(13, 148, 136, 0.15);
      color: #2dd4bf;
    }

    /* 🚀 Fix 1: Compact Calendar Grid (Reduces size, maximizes task space) */
    .compact-search-cal-wrapper {
      padding: 12px 16px;
      background: #ffffff;
      border-bottom: 1px solid rgba(128, 128, 128, 0.08);
      flex-shrink: 0; /* Prevents calendar from squishing */
      border-radius: 16px;
    }
    body.dark-mode .compact-search-cal-wrapper,
    html.dark .compact-search-cal-wrapper,
    [data-theme="dark"] .compact-search-cal-wrapper {
      background: #0f172a;
      border-color: rgba(255, 255, 255, 0.05);
    }

    .compact-cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px; /* Tight, compact gap */
      text-align: center;
    }
    .compact-cal-day {
      height: 34px !important; /* Reduced height */
      min-height: 34px !important;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      border-radius: 10px;
      cursor: pointer;
      color: #475569;
      transition: all 0.15s ease;
    }
    body.dark-mode .compact-cal-day,
    html.dark .compact-cal-day,
    [data-theme="dark"] .compact-cal-day {
      color: #cbd5e1;
    }
    .compact-cal-day.active-day,
    .compact-cal-day.selected {
      background: var(--accent-primary) !important;
      color: var(--accent-contrast, #ffffff) !important;
    }

    /* 🚀 Fix 2: Maximize Task Container */
    .search-task-scroll-area {
      flex: 1 1 auto; /* Expands to fill all remaining vertical space */
      overflow-y: auto;
      padding: 16px;
      background: #f8fafc; /* Sleek native contrast background */
      border-radius: 16px;
    }
    body.dark-mode .search-task-scroll-area,
    html.dark .search-task-scroll-area,
    [data-theme="dark"] .search-task-scroll-area {
      background: #020617;
    }
    body.dark-mode .search-task-scroll-area .detailed-board-card,
    html.dark .search-task-scroll-area .detailed-board-card,
    [data-theme="dark"] .search-task-scroll-area .detailed-board-card {
      background: #0f172a !important;
      border-color: rgba(255, 255, 255, 0.08) !important;
    }

    /* 🚀 Fix 3: Premium Native Checkbox */
    .exact-checkbox {
      width: 22px;
      height: 22px;
      flex-shrink: 0;
      border: 2px solid rgba(128, 128, 128, 0.25);
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      margin-right: 12px;
      background: transparent;
      margin-top: 2px; /* Micro-adjustment for vertical alignment with text */
    }
    .exact-checkbox:hover { border-color: var(--primary-color, #0d9488); }
    .exact-checkbox.completed {
      background: var(--primary-color, #0d9488);
      border-color: var(--primary-color, #0d9488);
    }

    /* 🚀 Fix 1: Lock the Master Viewport */
    /* Assuming your search view has a main wrapper. Add this class to it. */
    .search-view-master-container {
      display: flex !important;
      flex-direction: column !important;
      height: 100vh !important; /* Locks exactly to screen height */
      max-height: 100vh !important;
      overflow: hidden !important; /* CRITICAL: Kills global page scrolling */
    }

    /* 🚀 Fix 2: Fix Headers & Remove Gaps */
    .search-header-bar,
    .compact-search-cal-wrapper {
      flex-shrink: 0 !important; /* Prevents them from squishing */
      margin-bottom: 0 !important; /* Brings calendar and tasks closer */
      border-bottom: none !important;
      z-index: 10;
    }

    /* 🚀 Fix 3: The Dedicated Scroll Area */
    .search-task-scroll-area {
      flex: 1 1 auto !important; /* Takes up all remaining vertical space */
      min-height: 0 !important;
      overflow-y: auto !important; /* Only this specific area scrolls */
      -webkit-overflow-scrolling: touch !important; /* Native momentum scrolling on iOS */
      padding-top: 8px !important; /* Tightens the visual gap to the calendar */
      padding-bottom: 100px !important; /* Prevents last task from hiding under bottom nav */
    }

    /* 🚀 Fix 1: Aggressively Shrink Calendar Wrapper */
    .compact-search-cal-wrapper {
      padding: 6px 10px !important; /* Stripped down padding */
      background: #ffffff;
      border-bottom: 1px solid rgba(128, 128, 128, 0.08);
      flex-shrink: 0 !important;
    }
    body.dark-mode .compact-search-cal-wrapper,
    html.dark .compact-search-cal-wrapper,
    [data-theme="dark"] .compact-search-cal-wrapper {
      background: #0f172a;
      border-color: rgba(255, 255, 255, 0.05);
    }

    /* 🚀 Fix 2: Ultra-Tight Calendar Grid */
    .compact-cal-grid {
      display: grid !important;
      grid-template-columns: repeat(7, 1fr) !important;
      gap: 2px !important; /* Absolute minimum gap for alignment */
      text-align: center;
      max-width: 100% !important;
    }

    /* 🚀 Fix 3: Squished Calendar Days */
    .compact-cal-day {
      height: 28px !important; /* Aggressively reduced from 34px */
      min-height: 28px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      font-size: 13px !important; /* Smaller, sleeker font */
      font-weight: 700 !important;
      border-radius: 8px !important; /* Tighter corners */
      margin: 0 !important;
      padding: 0 !important;
    }

    /* 🚀 Fix 4: Maximize Task Room */
    .search-task-scroll-area {
      padding-top: 4px !important; /* Pulls tasks directly up against the calendar */
    }

    /* 🚀 Fix 1: Strip Chunky Priority Borders & Modernize Cards */
    .search-task-scroll-area .detailed-board-card {
      border-left: 1px solid rgba(128, 128, 128, 0.12) !important; /* Overrides the thick colored priority lines */
      border-radius: 16px !important;
      padding: 16px !important;
      background: #ffffff !important;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
      margin-bottom: 12px !important;
      transition: transform 0.2s, box-shadow 0.2s;
    }
    body.dark-mode .search-task-scroll-area .detailed-board-card,
    html.dark .search-task-scroll-area .detailed-board-card,
    [data-theme="dark"] .search-task-scroll-area .detailed-board-card {
      background: #1e293b !important;
      border-color: rgba(255, 255, 255, 0.05) !important;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    }

    /* 🚀 Fix 2: Priority-Colored Checkboxes */
    .exact-checkbox {
      width: 22px;
      height: 22px;
      flex-shrink: 0;
      border: 2px solid rgba(128, 128, 128, 0.3); /* Default None */
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      margin-right: 14px;
      background: transparent;
      margin-top: 2px; /* Perfect vertical alignment with text */
    }

    /* Map Priority Colors strictly to the Checkbox border */
    .exact-checkbox.pri-high { border-color: #ef4444; } /* Red */
    .exact-checkbox.pri-medium { border-color: #f97316; } /* Orange */
    .exact-checkbox.pri-low { border-color: #3b82f6; } /* Blue */

    /* Subtle tactile hover states */
    .exact-checkbox.pri-high:hover { background: rgba(239, 68, 68, 0.1); }
    .exact-checkbox.pri-medium:hover { background: rgba(249, 115, 22, 0.1); }
    .exact-checkbox.pri-low:hover { background: rgba(59, 130, 246, 0.1); }

    /* 🚀 Fix 1: Search Bar Gap & Calendar Card Refinement */
    .compact-search-cal-wrapper {
      margin-top: 12px !important; /* Creates the requested space below the search bar */
      padding: 8px 12px !important; /* Cuts internal calendar fluff */
      border-radius: 16px !important; /* Ensures it looks like a sleek floating card */
    }

    /* 🚀 Fix 2: Micro-Grid for Dates */
    .compact-cal-grid {
      gap: 2px !important; 
    }
    .compact-cal-day {
      height: 24px !important; /* Aggressively reduced */
      min-height: 24px !important;
      width: 24px !important; /* Perfect uniform sizing */
      margin: 0 auto !important; /* Centers within the grid column */
      font-size: 12px !important; /* Scaled down */
      border-radius: 6px !important; 
    }

    /* Shrink the Month/Year header to match the new compact scale */
    .compact-search-cal-wrapper h2,
    .compact-search-cal-wrapper h3,
    .compact-search-cal-wrapper .calendar-header {
      font-size: 14px !important;
      margin-bottom: 6px !important;
      padding-bottom: 0 !important;
    }

    /* 🚀 Fix 3: Task Card De-Fluffing */
    .search-task-scroll-area .detailed-board-card {
      padding: 10px 14px !important; /* Strips 6px of vertical and 2px of horizontal fluff */
      margin-bottom: 8px !important; /* Brings tasks closer together */
      border-radius: 12px !important; /* Slightly tighter corners for the compressed layout */
    }

    /* 🚀 Fix 4: Proportionally Scale the Checkbox */
    .search-task-scroll-area .exact-checkbox {
      width: 20px !important; /* Scaled down slightly to match tighter padding */
      height: 20px !important;
      margin-right: 12px !important;
      margin-top: 1px !important; /* Perfect vertical alignment with text */
      border-width: 2px !important;
    }

    /* Ensure the title text scales beautifully in the denser layout */
    .search-task-scroll-area .board-card-title {
      font-size: 14px !important; /* Sleek, readable, but compact */
      line-height: 1.3 !important;
    }

    /* 🚀 Fix 1: Ultra-Tight Card Padding & Margins */
    .search-task-scroll-area .detailed-board-card {
      padding: 8px 12px !important; /* Aggressively reduced from 10px 14px */
      margin-bottom: 6px !important; /* Squeezes the tasks closer together */
      border-radius: 10px !important; /* Slightly sharper corners for compact view */
    }

    /* 🚀 Fix 2: Tighter Checkbox Alignment */
    .search-task-scroll-area .exact-checkbox {
      margin-right: 10px !important; /* Brings the task title closer to the checkbox */
      margin-top: 0 !important; /* Perfect pixel alignment for the tighter padding */
    }

    /* 🚀 Fix 3: Condensed Text Wrapping */
    .search-task-scroll-area .board-card-title {
      line-height: 1.25 !important; /* Tighter line-height for wrapped, multi-line tasks */
      padding-top: 1px !important; /* Micro-adjustment to center text with the 20px checkbox */
    }

    /* 🚀 Fix 1: Force Single-Row Action Bar */
    .exact-action-row {
      flex-wrap: nowrap !important; /* CRITICAL: Kills the line break */
      gap: 6px !important; /* Tighter spacing */
      width: 100% !important;
      overflow: hidden !important;
    }

    /* 🚀 Fix 2: Dynamically Shrinking Date Pill */
    .exact-btn-date {
      flex: 1 1 auto !important; /* Absorbs remaining space, shrinks if needed */
      min-width: 0 !important; /* Unlocks flexbox shrinking */
      padding: 0 10px !important; 
      height: 38px !important; /* Scaled down slightly for dense cards */
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important; /* Adds '...' if the date text is too long */
      justify-content: center !important;
    }

    /* 🚀 Fix 3: Condensed Icon Buttons */
    .exact-btn-icon, 
    .exact-btn-delete {
      width: 38px !important; /* Scaled down from 40px */
      height: 38px !important;
      flex-shrink: 0 !important; /* Prevents icons from squishing */
    }

    /* 🚀 Fix 4: Date Picker Z-Index Stacking Override */
    /* Ensures the Date Modal always renders ON TOP of the Search Overlay */
    #date-picker-modal,
    #sheet-date-repeat-picker,
    .date-picker-container,
    .modal-overlay,
    .flatpickr-calendar {
      z-index: 99999 !important; 
    }

    /* 🚀 Fix 1: Time & Meta Display Row */
    .search-task-meta-row {
      display: flex !important;
      align-items: center !important;
      gap: 4px !important;
      margin-top: 4px !important; /* Spacing between title and time */
      font-size: 11px !important; /* Sleek, secondary metadata size */
      font-weight: 700 !important;
      color: #64748b !important; /* Muted secondary text */
      letter-spacing: 0.2px !important;
    }
    body.dark-mode .search-task-meta-row,
    html.dark .search-task-meta-row,
    [data-theme="dark"] .search-task-meta-row { color: #94a3b8 !important; }

    /* Micro-icon formatting */
    .search-task-meta-row svg {
      color: #94a3b8 !important;
      width: 12px !important;
      height: 12px !important;
    }
    body.dark-mode .search-task-meta-row svg,
    html.dark .search-task-meta-row svg,
    [data-theme="dark"] .search-task-meta-row svg { color: #64748b !important; }

    /* 🚀 Fix 1: Perfect Calendar Cell Geometry */
    /* Adjust '.calendar-day' if your main dashboard uses a slightly different class like '.dashboard-cal-day' */
    .calendar-day, 
    .dashboard-calendar .calendar-day,
    .todo-cal-day-cell,
    #todo-cal-days-grid .todo-cal-day-cell {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      justify-content: center !important;
      height: 46px !important; /* Strict height to fit both text and badge without overlapping */
      min-height: 46px !important;
      width: 100% !important;
      border-radius: 12px !important;
      padding: 4px 0 !important;
      box-sizing: border-box !important;
      position: relative !important;
      overflow: hidden !important; /* Prevents background pills from bleeding out */
    }

    /* Keep the Search Overlay micro-grid compact */
    #cal-popup-grid .compact-cal-day {
      height: 24px !important;
      min-height: 24px !important;
      width: 24px !important;
      border-radius: 6px !important;
      padding: 0 !important;
    }

    /* 🚀 Fix 2: Tame the Task Count Badge */
    /* Targets the small indicator pill/circle inside the calendar cell */
    .calendar-day .task-count,
    .calendar-day .task-indicator,
    .calendar-day span:nth-child(2),
    .todo-cal-day-cell .todo-cal-day-badge,
    .todo-cal-day-cell span:nth-child(2) {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      font-size: 9px !important;
      font-weight: 800 !important;
      line-height: 1 !important;
      padding: 2px 5px !important;
      border-radius: 10px !important;
      background: rgba(13, 148, 136, 0.15) !important; /* Subtle Teal */
      color: #0d9488 !important;
      margin-top: 2px !important; /* Slight gap below the date */
      min-width: 14px !important;
      z-index: 2 !important;
    }

    /* 🚀 Fix 3: Active Day UI Correction */
    .calendar-day.active,
    .calendar-day.selected,
    .todo-cal-day-cell.active,
    .todo-cal-day-cell.selected {
      background: var(--primary-color, #0d9488) !important;
      color: #ffffff !important;
    }
    .calendar-day.active .task-count,
    .calendar-day.selected .task-count,
    .calendar-day.active span:nth-child(2),
    .todo-cal-day-cell.active .todo-cal-day-badge,
    .todo-cal-day-cell.selected .todo-cal-day-badge,
    .todo-cal-day-cell.active span:nth-child(2),
    .todo-cal-day-cell.selected span:nth-child(2) {
      background: rgba(255, 255, 255, 0.25) !important;
      color: #ffffff !important;
    }

    /* 🚀 Fix 4: Strip Dashboard Container Padding */
    /* Targets the wrapper holding "Today's Tasks" */
    .tasks-section,
    .dashboard-tasks-wrapper,
    #tasks-container,
    #todo-cal-day-tasks-panel,
    #todo-calendar-view-container {
      padding: 8px 10px !important; /* Aggressively reduced from standard 16px/24px padding */
    }

    /* 🚀 Fix 5: App-Wide Card Density Alignment */
    /* Ensures the main dashboard cards match the sleek density we built in the search view */
    #tasks-container .detailed-board-card,
    .tasks-section .detailed-board-card,
    #todo-cal-day-tasks-panel .detailed-board-card,
    #todo-cal-selected-day-list .detailed-board-card {
      padding: 10px 14px !important; 
      margin-bottom: 8px !important; 
      border-radius: 12px !important;
      box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
      border: 1px solid rgba(128,128,128,0.1) !important;
    }

    /* Header row inside dashboard tasks */
    .tasks-section-header {
      padding: 4px 6px 12px 6px !important;
      margin: 0 !important;
    }

    /* 🚀 Fix 1: The Board Entrance Animation */
    @keyframes boardCardPop {
      0% { opacity: 0; transform: translateY(12px) scale(0.98); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* 🚀 Fix 2: Minimalist Board Card Override */
    .board-column .detailed-board-card {
      border-left: 1px solid rgba(128, 128, 128, 0.12) !important; /* Kills the chunky priority line */
      border-radius: 12px !important;
      padding: 10px 14px !important; /* Matches high-density search view */
      background: #ffffff !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
      margin-bottom: 8px !important;
      
      /* 🚀 Apply the animation */
      animation: boardCardPop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
      transform-origin: top center;
    }
    body.dark-mode .board-column .detailed-board-card,
    html.dark .board-column .detailed-board-card,
    [data-theme="dark"] .board-column .detailed-board-card {
      background: #1e293b !important;
      border-color: rgba(255, 255, 255, 0.05) !important;
      box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    }

    .board-column .exact-checkbox {
      width: 20px !important;
      height: 20px !important;
      margin-right: 10px !important;
      margin-top: 0 !important;
      border-width: 2px !important;
    }

    .board-column .board-card-title {
      font-size: 14px !important;
      line-height: 1.25 !important;
      padding-top: 1px !important;
    }

    /* 🚀 Fix 1: Drag Physics & Visual Feedback */
    .detailed-board-card.dragging {
      opacity: 0.4 !important;
      transform: scale(0.95) !important;
      box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
      cursor: grabbing !important;
      border: 1px dashed var(--primary-color, #0d9488) !important;
    }

    /* Ensure columns have a minimum height to receive drops even when empty */
    .board-column {
      min-height: 150px;
      padding-bottom: 20px;
      transition: background 0.2s ease;
    }
    .board-column.drag-over {
      background: rgba(13, 148, 136, 0.03) !important;
      border-radius: 16px;
    }
    body.dark-mode .board-column.drag-over,
    html.dark .board-column.drag-over,
    [data-theme="dark"] .board-column.drag-over {
      background: rgba(13, 148, 136, 0.08) !important;
    }

    /* Column Header Styling */
    .board-column-header {
      font-size: 16px;
      font-weight: 800;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .board-column-header .count-badge {
      background: rgba(128,128,128,0.15);
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 12px;
    }

    /* 🚀 Fix 1: The Smooth Anticipation Placeholder */
    .board-drop-placeholder {
      border: 2px dashed rgba(13, 148, 136, 0.4) !important;
      border-radius: 12px !important;
      background: rgba(13, 148, 136, 0.05) !important;
      margin-bottom: 8px !important;
      transition: height 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
      pointer-events: none !important; /* Prevents it from interfering with the cursor */
    }
    body.dark-mode .board-drop-placeholder,
    html.dark .board-drop-placeholder,
    [data-theme="dark"] .board-drop-placeholder { 
      border-color: rgba(45, 212, 191, 0.4) !important;
      background: rgba(45, 212, 191, 0.05) !important;
    }

    /* 🚀 Fix 2: Horizontal Board Track */
    .board-horizontal-scroll {
      display: flex !important;
      flex-wrap: nowrap !important;
      gap: 20px !important;
      overflow-x: auto !important; /* Enables horizontal scrolling */
      overflow-y: hidden !important;
      padding-bottom: 40px !important;
      height: 100% !important;
      -webkit-overflow-scrolling: touch !important; /* iOS Momentum */
    }

    /* Force columns to retain their size so they scroll instead of squishing */
    .board-horizontal-scroll .board-column {
      flex: 0 0 280px !important; /* Fixed width, will not shrink */
      width: 280px !important;
      min-height: 200px !important;
    }

    /* 🚀 Fix 1: Modern Glassmorphism Drop Placeholder */
    .board-drop-placeholder {
      border: 1px solid rgba(13, 148, 136, 0.25) !important;
      border-radius: 12px !important;
      background: rgba(255, 255, 255, 0.5) !important;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 4px 12px rgba(0, 0, 0, 0.03) !important;
      margin-bottom: 8px !important;
      transition: height 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
      pointer-events: none !important;
    }
    body.dark-mode .board-drop-placeholder,
    html.dark .board-drop-placeholder,
    [data-theme="dark"] .board-drop-placeholder { 
      background: rgba(30, 41, 59, 0.4) !important;
      border-color: rgba(45, 212, 191, 0.25) !important;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    }

    /* 🚀 Fix 1: Hide Native Scrollbars for Minimalist UI */
    .board-horizontal-scroll {
      -ms-overflow-style: none !important;  /* IE and Edge */
      scrollbar-width: none !important;  /* Firefox */
    }

    /* Chrome, Safari and Opera */
    .board-horizontal-scroll::-webkit-scrollbar {
      display: none !important; 
    }

    /* 🚀 Fix 4: The Universal Glass Engine */
    /* Targets every major UI container in the Sharpener app */
    .detailed-board-card,
    .search-task-scroll-area .detailed-board-card,
    .board-column .detailed-board-card,
    #tasks-container .detailed-board-card,
    .tasks-section .detailed-board-card,
    #todo-cal-day-tasks-panel .detailed-board-card,
    #todo-cal-selected-day-list .detailed-board-card,
    body.dark-mode .search-task-scroll-area .detailed-board-card,
    html.dark .search-task-scroll-area .detailed-board-card,
    [data-theme="dark"] .search-task-scroll-area .detailed-board-card,
    body.dark-mode .board-column .detailed-board-card,
    html.dark .board-column .detailed-board-card,
    [data-theme="dark"] .board-column .detailed-board-card,
    .compact-search-cal-wrapper,
    body.dark-mode .compact-search-cal-wrapper,
    html.dark .compact-search-cal-wrapper,
    [data-theme="dark"] .compact-search-cal-wrapper,
    .search-header-bar,
    .modal-content,
    .bottom-sheet,
    .date-picker-container,
    .exact-more-panel,
    .bottom-nav,
    .dashboard-tasks-wrapper,
    #search-view-overlay,
    #sheet-cal-search .bottom-sheet,
    .recurring-confirm,
    .board-column-header,
    .tasks-section,
    .calendar-tasks-container,
    #todo-cal-day-tasks-panel {
      background: var(--glass-bg) !important;
      background-color: var(--glass-bg) !important;
      border: 1px solid var(--glass-border) !important;
      box-shadow: var(--glass-shadow) !important;
    }

    /* 🚀 Fix 5: Inner UI Elements (Inputs, Badges, Chips) */
    /* Secondary elements get a more subtle glass treatment */
    .exact-input,
    .nlp-input,
    .recurring-chip,
    .count-badge,
    .board-drop-placeholder {
      background: rgba(128, 128, 128, 0.08) !important;
      border: 1px solid var(--glass-border) !important;
    }
    body.dark-mode .exact-input,
    body.dark-mode .nlp-input,
    body.dark-mode .recurring-chip,
    body.dark-mode .count-badge,
    html.dark .exact-input,
    html.dark .nlp-input,
    html.dark .recurring-chip,
    html.dark .count-badge,
    [data-theme="dark"] .exact-input,
    [data-theme="dark"] .nlp-input,
    [data-theme="dark"] .recurring-chip,
    [data-theme="dark"] .count-badge {
      background: rgba(255, 255, 255, 0.05) !important;
    }

    /* 🚀 Fix 6: Calendar Grid Glass Alignment */
    /* Ensure the calendar itself doesn't double-blur, but the days look tactile */
    .compact-cal-grid,
    .calendar-grid {
      background: transparent !important;
    }
    .compact-cal-day,
    .calendar-day,
    .todo-cal-day-cell {
      background: transparent !important;
      border: 1px solid transparent !important;
    }
    .compact-cal-day:hover,
    .calendar-day:hover,
    .todo-cal-day-cell:hover {
      background: rgba(128, 128, 128, 0.1) !important;
    }
    /* Active days retain the primary teal color, but gain a slight glow */
    .compact-cal-day.active-day,
    .calendar-day.active,
    .calendar-day.selected,
    .todo-cal-day-cell.active,
    .todo-cal-day-cell.selected {
      background: var(--primary-color, #0d9488) !important;
      box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3) !important;
      border: none !important;
    }

    /* 🚀 Fix 7: Dark Mode Typography Contrast */
    /* Prevents dark grey text from vanishing against the black glass */
    body.dark-mode .board-card-title,
    body.dark-mode .search-task-meta-row,
    body.dark-mode h2, 
    body.dark-mode h3, 
    body.dark-mode span,
    html.dark .board-card-title,
    html.dark .search-task-meta-row,
    html.dark h2, 
    html.dark h3, 
    html.dark span,
    [data-theme="dark"] .board-card-title,
    [data-theme="dark"] .search-task-meta-row,
    [data-theme="dark"] h2, 
    [data-theme="dark"] h3, 
    [data-theme="dark"] span {
      text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important; /* Sharpens text */
    }
    body.dark-mode .board-card-title,
    html.dark .board-card-title,
    [data-theme="dark"] .board-card-title {
      color: #f8fafc !important;
    }
    body.dark-mode .search-task-meta-row,
    html.dark .search-task-meta-row,
    [data-theme="dark"] .search-task-meta-row {
      color: #cbd5e1 !important;
    }
    body.dark-mode .board-column-header,
    html.dark .board-column-header,
    [data-theme="dark"] .board-column-header {
      color: #ffffff !important;
    }

    /* 🚀 Fix 1: Strip Header Borders for Seamless Glassmorphism */
    /* Targeting all common permutations of the main header container */
    .todo-header,
    .focus-top-bar,
    .dashboard-header,
    .main-header,
    .app-header,
    .board-header,
    .board-header-section,
    .top-bar-container,
    .app-top-bar {
      border: none !important;
      border-top: none !important;
      border-bottom: none !important;
      box-shadow: none !important; /* Removes any hairline drop-shadows */
      background: transparent !important; /* Allows the root glass gradient to flow through untouched */
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    /* 🚀 Fix 2: Clean up the Options Button */
    /* Ensures the 3-dot menu button in the header matches the premium theme */
    .todo-header .three-dot-btn,
    .dashboard-header .menu-btn,
    .main-header .icon-btn,
    .app-header button {
      border: 1px solid var(--glass-border) !important;
      background: rgba(128, 128, 128, 0.08) !important;
      box-shadow: var(--glass-shadow) !important;
    }
    body.dark-mode .todo-header .three-dot-btn,
    html.dark .todo-header .three-dot-btn,
    [data-theme="dark"] .todo-header .three-dot-btn,
    body.dark-mode .dashboard-header .menu-btn,
    body.dark-mode .main-header .icon-btn,
    html.dark .dashboard-header .menu-btn,
    html.dark .main-header .icon-btn,
    [data-theme="dark"] .dashboard-header .menu-btn,
    [data-theme="dark"] .main-header .icon-btn {
      background: rgba(255, 255, 255, 0.05) !important;
    }

    /* 🚀 Fix 1: Vaporize Board Division Borders */
    .board-column-header,
    .board-col-header {
      border: none !important;
      border-top: none !important;
      border-bottom: none !important;
      border-left: none !important;
      border-right: none !important;
      outline: none !important;
      box-shadow: none !important; 
      background: transparent !important; /* Prevents solid backgrounds from covering the glass */
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      padding: 8px 4px 16px 4px !important; /* Optimizes spacing after border removal */
    }

    /* 🚀 Fix 2: Ensure any nested spans/divs don't carry rogue borders */
    .board-column-header > div,
    .board-column-header > span:not(.count-badge),
    .board-col-header > div,
    .board-col-header > span:not(.board-col-count) {
      border: none !important;
      background: transparent !important;
    }

    /* 🚀 Fix 1: Upgraded Flex Metadata Row */
    .search-task-meta-row {
      display: flex !important;
      align-items: center !important;
      flex-wrap: wrap !important; 
      gap: 12px !important; /* Crisp horizontal spacing between Time and Energy */
      margin-top: 4px !important; 
    }

    /* 🚀 Fix 2: Universal Meta Item Styling */
    .meta-item {
      display: inline-flex !important;
      align-items: center !important;
      gap: 4px !important; /* Space between icon and text */
      font-size: 11px !important;
      font-weight: 700 !important;
      color: #64748b !important;
      letter-spacing: 0.2px !important;
    }
    body.dark-mode .meta-item,
    html.dark .meta-item,
    [data-theme="dark"] .meta-item { color: #94a3b8 !important; }

    .meta-item svg {
      width: 12px !important;
      height: 12px !important;
      color: inherit;
    }

    /* 🚀 Fix 3: Energy Icon Accent */
    .meta-item.energy-badge svg {
      fill: currentColor !important; /* Makes the lightning bolt solid */
      color: #f59e0b !important; /* Amber color to distinguish it from time */
    }

    /* 🚀 Fix 1: Icon-Only Energy Metadata */
    .meta-item.energy-low svg,
    .meta-item.energy-high svg {
      width: 14px !important;
      height: 14px !important;
      margin-top: 1px; /* Optical alignment with the time text */
    }

    /* 🟢 Low Energy: Green Battery */
    .meta-item.energy-low svg,
    .energy-btn.active.low-btn svg {
      color: #10b981 !important; /* Crisp Emerald Green */
    }
    .energy-btn.low-btn { color: #10b981 !important; }

    /* 🔴 High Energy: Red Thunder */
    .meta-item.energy-high svg,
    .energy-btn.active.high-btn svg {
      color: #ef4444 !important; /* Crisp Crimson Red */
      fill: rgba(239, 68, 68, 0.2) !important; /* Subtle red glow inside the bolt */
    }
    .energy-btn.high-btn { color: #ef4444 !important; }

    /* 🚀 Fix 1: Annihilate Text in Collapsed Energy Badges */
    .meta-item.energy-low span,
    .meta-item.energy-high span,
    .meta-item.energy-badge span {
      display: none !important;
    }

    /* 🚀 Fix 2: Bulletproof SVG Color Enforcement */
    .meta-item.energy-low svg,
    .search-task-meta-row .meta-item.energy-low svg,
    body.dark-mode .search-task-meta-row .meta-item.energy-low svg,
    html.dark .search-task-meta-row .meta-item.energy-low svg,
    [data-theme="dark"] .search-task-meta-row .meta-item.energy-low svg {
      color: #10b981 !important; /* Emerald Green */
      fill: rgba(16, 185, 129, 0.2) !important;
    }
    .meta-item.energy-high svg,
    .search-task-meta-row .meta-item.energy-high svg,
    body.dark-mode .search-task-meta-row .meta-item.energy-high svg,
    html.dark .search-task-meta-row .meta-item.energy-high svg,
    [data-theme="dark"] .search-task-meta-row .meta-item.energy-high svg {
      color: #ef4444 !important; /* Crimson Red */
      fill: rgba(239, 68, 68, 0.2) !important;
    }

    /* Ensure the SVG doesn't get squished */
    .meta-item.energy-low,
    .meta-item.energy-high {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    /* 🚀 Fix 1: Hardened Dark Mode Header Shield */
    body.dark-mode header, 
    body.dark-mode .header,
    body.dark-mode #header,
    body.dark-mode .app-header, 
    body.dark-mode .main-header, 
    body.dark-mode .dashboard-header,
    body.dark-mode .top-bar,
    body.dark-mode .todo-header,
    body.dark-mode .focus-top-bar,
    body.dark-mode .board-header,
    body.dark-mode .board-header-section,
    body.dark-mode .top-bar-container,
    body.dark-mode .app-top-bar,
    html.dark header, 
    html.dark .header,
    html.dark #header,
    html.dark .app-header, 
    html.dark .main-header, 
    html.dark .dashboard-header,
    html.dark .top-bar,
    html.dark .todo-header,
    html.dark .focus-top-bar,
    html.dark .board-header,
    html.dark .board-header-section,
    html.dark .top-bar-container,
    html.dark .app-top-bar,
    [data-theme="dark"] header, 
    [data-theme="dark"] .header,
    [data-theme="dark"] #header,
    [data-theme="dark"] .app-header, 
    [data-theme="dark"] .main-header, 
    [data-theme="dark"] .dashboard-header,
    [data-theme="dark"] .top-bar,
    [data-theme="dark"] .todo-header,
    [data-theme="dark"] .focus-top-bar,
    [data-theme="dark"] .board-header,
    [data-theme="dark"] .board-header-section,
    [data-theme="dark"] .top-bar-container,
    [data-theme="dark"] .app-top-bar {
      /* Dial the opacity up to 98% to act as a solid visual blocker */
      background: rgba(9, 9, 11, 0.98) !important; 
      
      /* Ensure no borders sneak back in */
      border: none !important;
      border-top: none !important;
      border-bottom: none !important;
      box-shadow: none !important;
      
      /* Aggressive z-index to guarantee it sits above all scrolling task cards */
      position: sticky !important;
      top: 0 !important;
      z-index: 999 !important;
    }

    /* 🚀 Fix 2: Ensure task containers don't overlap the sticky header */
    body.dark-mode .tasks-section,
    body.dark-mode .dashboard-tasks-wrapper,
    body.dark-mode #tasks-container,
    body.dark-mode #board-container,
    body.dark-mode #board-view-container,
    body.dark-mode #todo-list,
    html.dark .tasks-section,
    html.dark .dashboard-tasks-wrapper,
    html.dark #tasks-container,
    html.dark #board-container,
    html.dark #board-view-container,
    html.dark #todo-list,
    [data-theme="dark"] .tasks-section,
    [data-theme="dark"] .dashboard-tasks-wrapper,
    [data-theme="dark"] #tasks-container,
    [data-theme="dark"] #board-container,
    [data-theme="dark"] #board-view-container,
    [data-theme="dark"] #todo-list {
      position: relative !important;
      z-index: 1 !important;
    }

    /* 🚀 Fix 1: Search Overlay Glassmorphism & Theme Sync */
    #search-view-overlay,
    .search-overlay-container,
    .search-modal,
    #sheet-cal-search,
    #sheet-cal-search .bottom-sheet,
    .search-view-master-container {
      background: rgba(241, 245, 249, 0.85) !important; /* Bright, translucent slate for Light Mode */
      background-color: rgba(241, 245, 249, 0.85) !important;
    }
    body.dark-mode #search-view-overlay,
    body.dark-mode .search-overlay-container,
    body.dark-mode .search-modal,
    body.dark-mode #sheet-cal-search,
    body.dark-mode #sheet-cal-search .bottom-sheet,
    body.dark-mode .search-view-master-container,
    html.dark #search-view-overlay,
    html.dark .search-overlay-container,
    html.dark .search-modal,
    html.dark #sheet-cal-search,
    html.dark #sheet-cal-search .bottom-sheet,
    html.dark .search-view-master-container,
    [data-theme="dark"] #search-view-overlay,
    [data-theme="dark"] .search-overlay-container,
    [data-theme="dark"] .search-modal,
    [data-theme="dark"] #sheet-cal-search,
    [data-theme="dark"] #sheet-cal-search .bottom-sheet,
    [data-theme="dark"] .search-view-master-container {
      background: rgba(9, 9, 11, 0.9) !important; /* Deep translucent black for Dark Mode */
      background-color: rgba(9, 9, 11, 0.9) !important;
    }

    /* Ensure inner glass surfaces inside Search Overlay retain their translucent glass fill */
    .compact-search-cal-wrapper,
    .search-header-bar,
    .search-task-scroll-area .detailed-board-card {
      background: var(--glass-bg) !important;
      background-color: var(--glass-bg) !important;
      border: 1px solid var(--glass-border) !important;
    }

    /* 🚀 Fix 2: Vaporize the Solid White Task Container */
    .search-task-scroll-area,
    .search-results-container,
    #search-results,
    #cal-popup-grouped-feed,
    #cal-popup-grouped-feed > .squircle-card {
      background: transparent !important;
      background-color: transparent !important;
      border: none !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    /* 🚀 Fix 3: Calendar Text Visibility */
    .compact-search-cal-wrapper h2,
    .compact-search-cal-wrapper h3,
    .compact-search-cal-wrapper .calendar-header,
    #cal-popup-month-label,
    .compact-cal-day,
    .compact-cal-day:not(.active-day),
    #cal-popup-grid .cal-day:not(.active-day):not(.selected) {
      color: #0f172a !important; /* Sharp, dark slate for Light Mode */
    }
    body.dark-mode .compact-search-cal-wrapper h2,
    body.dark-mode .compact-search-cal-wrapper h3,
    body.dark-mode .compact-search-cal-wrapper .calendar-header,
    body.dark-mode #cal-popup-month-label,
    body.dark-mode .compact-cal-day:not(.active-day),
    body.dark-mode #cal-popup-grid .cal-day:not(.active-day):not(.selected),
    html.dark .compact-search-cal-wrapper h2,
    html.dark .compact-search-cal-wrapper h3,
    html.dark .compact-search-cal-wrapper .calendar-header,
    html.dark #cal-popup-month-label,
    html.dark .compact-cal-day:not(.active-day),
    html.dark #cal-popup-grid .cal-day:not(.active-day):not(.selected),
    [data-theme="dark"] .compact-search-cal-wrapper h2,
    [data-theme="dark"] .compact-search-cal-wrapper h3,
    [data-theme="dark"] .compact-search-cal-wrapper .calendar-header,
    [data-theme="dark"] #cal-popup-month-label,
    [data-theme="dark"] .compact-cal-day:not(.active-day),
    [data-theme="dark"] #cal-popup-grid .cal-day:not(.active-day):not(.selected) {
      color: #f8fafc !important; /* Bright white for Dark Mode */
    }

    /* Ensure the active calendar day keeps its white text on the teal background */
    .compact-cal-day.active-day,
    #cal-popup-grid .cal-day.active-day,
    #cal-popup-grid .cal-day.selected {
      color: #ffffff !important;
    }

    /* 🚀 Fix 4: Search Input Text Contrast */
    .search-header-bar input,
    #search-task-input,
    #cal-popup-search-input,
    .floating-search-input {
      color: #0f172a !important; /* Dark text for light mode typing */
    }
    body.dark-mode .search-header-bar input,
    body.dark-mode #search-task-input,
    body.dark-mode #cal-popup-search-input,
    body.dark-mode .floating-search-input,
    html.dark .search-header-bar input,
    html.dark #search-task-input,
    html.dark #cal-popup-search-input,
    html.dark .floating-search-input,
    [data-theme="dark"] .search-header-bar input,
    [data-theme="dark"] #search-task-input,
    [data-theme="dark"] #cal-popup-search-input,
    [data-theme="dark"] .floating-search-input {
      color: #f8fafc !important; /* Light text for dark mode typing */
    }

    /* Placeholder Contrast */
    .search-header-bar input::placeholder,
    #search-task-input::placeholder,
    #cal-popup-search-input::placeholder {
      color: #64748b !important;
    }
    body.dark-mode .search-header-bar input::placeholder,
    body.dark-mode #search-task-input::placeholder,
    body.dark-mode #cal-popup-search-input::placeholder,
    html.dark .search-header-bar input::placeholder,
    html.dark #search-task-input::placeholder,
    html.dark #cal-popup-search-input::placeholder,
    [data-theme="dark"] .search-header-bar input::placeholder,
    [data-theme="dark"] #search-task-input::placeholder,
    [data-theme="dark"] #cal-popup-search-input::placeholder {
      color: #94a3b8 !important;
    }

    /* 🚀 Fix 1: Vibrant Light Mode Indicator */
    /* Casts a wide net to catch the indicator whether it's an ::after, a span, or a border */
    .compact-cal-day.has-task::after,
    .compact-cal-day.has-tasks::after,
    .compact-cal-day .indicator,
    .compact-cal-day .task-indicator,
    .compact-cal-day .cal-dot,
    .compact-cal-day[style*="border-bottom"] {
      background-color: #0d9488 !important; /* Bold Primary Teal */
      border-bottom-color: #0d9488 !important; 
      opacity: 1 !important; /* Overrides any legacy translucency */
    }

    /* 🚀 Fix 2: Glowing Dark Mode Indicator */
    body.dark-mode .compact-cal-day.has-task::after,
    body.dark-mode .compact-cal-day.has-tasks::after,
    body.dark-mode .compact-cal-day .indicator,
    body.dark-mode .compact-cal-day .task-indicator,
    body.dark-mode .compact-cal-day .cal-dot,
    body.dark-mode .compact-cal-day[style*="border-bottom"],
    html.dark .compact-cal-day.has-task::after,
    html.dark .compact-cal-day.has-tasks::after,
    html.dark .compact-cal-day .indicator,
    html.dark .compact-cal-day .task-indicator,
    html.dark .compact-cal-day .cal-dot,
    html.dark .compact-cal-day[style*="border-bottom"],
    [data-theme="dark"] .compact-cal-day.has-task::after,
    [data-theme="dark"] .compact-cal-day.has-tasks::after,
    [data-theme="dark"] .compact-cal-day .indicator,
    [data-theme="dark"] .compact-cal-day .task-indicator,
    [data-theme="dark"] .compact-cal-day .cal-dot,
    [data-theme="dark"] .compact-cal-day[style*="border-bottom"] {
      background-color: #2dd4bf !important; /* Brilliant Bright Cyan */
      border-bottom-color: #2dd4bf !important;
      box-shadow: 0 1px 4px rgba(45, 212, 191, 0.6) !important; /* Micro neon-glow to pop against black */
      opacity: 1 !important;
    }

    /* 🚀 Fix 3: Perfect Geometry Normalization */
    /* If the line uses an ::after pseudo-element or .cal-dot span, this forces it into a perfect pill shape */
    .compact-cal-day.has-task::after,
    .compact-cal-day.has-tasks::after,
    .compact-cal-day .indicator,
    .compact-cal-day .task-indicator,
    .compact-cal-day .cal-dot {
      content: '' !important;
      display: block !important;
      width: 14px !important;
      height: 2px !important;
      min-height: 2px !important;
      flex-shrink: 0 !important;
      border-radius: 2px !important;
      margin: 2px auto 0 auto !important; /* Spaces it precisely below the number */
      border: none !important; 
    }

    /* Ensure the active day hides the indicator so it doesn't clash with the solid teal background */
    .compact-cal-day.active-day::after,
    .compact-cal-day.active-day .indicator,
    .compact-cal-day.active-day .task-indicator,
    .compact-cal-day.active-day .cal-dot {
      display: none !important; 
    }

    /* 🚀 Fix 1: Universal Modal Glassmorphism (Light Mode Default) */
    .modal-content,
    .bottom-sheet,
    #task-input-modal > div,
    .date-picker-container,
    #date-picker-modal .modal-content,
    #sheet-date-repeat-picker .bottom-sheet,
    #sheet-task-composer .bottom-sheet,
    .add-task-container {
      background: rgba(255, 255, 255, 0.95) !important; /* Bright, clean glass for Light Theme */
      background-color: rgba(255, 255, 255, 0.95) !important;
      border: 1px solid var(--glass-border) !important;
      color: #0f172a !important; /* Force dark text for Light Theme */
    }

    /* 🚀 Fix 2: Dark Mode Modal Override */
    body.dark-mode .modal-content,
    body.dark-mode .bottom-sheet,
    body.dark-mode #task-input-modal > div,
    body.dark-mode .date-picker-container,
    body.dark-mode #date-picker-modal .modal-content,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet,
    body.dark-mode #sheet-task-composer .bottom-sheet,
    body.dark-mode .add-task-container,
    html.dark .modal-content,
    html.dark .bottom-sheet,
    html.dark #task-input-modal > div,
    html.dark .date-picker-container,
    html.dark #date-picker-modal .modal-content,
    html.dark #sheet-date-repeat-picker .bottom-sheet,
    html.dark #sheet-task-composer .bottom-sheet,
    html.dark .add-task-container,
    [data-theme="dark"] .modal-content,
    [data-theme="dark"] .bottom-sheet,
    [data-theme="dark"] #task-input-modal > div,
    [data-theme="dark"] .date-picker-container,
    [data-theme="dark"] #date-picker-modal .modal-content,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet,
    [data-theme="dark"] #sheet-task-composer .bottom-sheet,
    [data-theme="dark"] .add-task-container {
      background: rgba(9, 9, 11, 0.95) !important; /* Deep black glass for Dark Theme */
      background-color: rgba(9, 9, 11, 0.95) !important;
      border-color: rgba(255, 255, 255, 0.08) !important;
      color: #f8fafc !important; /* Force light text for Dark Theme */
    }

    /* 🚀 Fix 3: Light Theme Modal Typography */
    .modal-content h2, 
    .modal-content h3, 
    .modal-content span:not(.count-badge):not(.nlp-match),
    .date-picker-container h2,
    .date-picker-container h3,
    .date-picker-container span:not(.count-badge):not(.nlp-match),
    .date-picker-container label,
    .date-picker-container .calendar-day:not(.active-day):not(.active):not(.selected),
    #sheet-date-repeat-picker .bottom-sheet h2,
    #sheet-date-repeat-picker .bottom-sheet h3,
    #sheet-date-repeat-picker .bottom-sheet span:not(.count-badge):not(.nlp-match),
    #sheet-date-repeat-picker .bottom-sheet label,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn:not(.active-day):not(.active):not(.selected),
    #sheet-date-repeat-picker .bottom-sheet .calendar-day:not(.active-day):not(.active):not(.selected),
    .add-task-container h2,
    .add-task-container h3,
    .add-task-container label {
      color: #0f172a !important; /* Sharp Slate text */
    }

    /* 🚀 Fix 4: Dark Theme Modal Typography */
    body.dark-mode .modal-content h2, 
    body.dark-mode .modal-content h3, 
    body.dark-mode .modal-content span:not(.count-badge):not(.nlp-match),
    body.dark-mode .date-picker-container h2,
    body.dark-mode .date-picker-container h3,
    body.dark-mode .date-picker-container span:not(.count-badge):not(.nlp-match),
    body.dark-mode .date-picker-container label,
    body.dark-mode .date-picker-container .calendar-day:not(.active-day):not(.active):not(.selected),
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet h2,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet h3,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet span:not(.count-badge):not(.nlp-match),
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet label,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet .cal-day-btn:not(.active-day):not(.active):not(.selected),
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet .calendar-day:not(.active-day):not(.active):not(.selected),
    body.dark-mode .add-task-container h2,
    body.dark-mode .add-task-container h3,
    body.dark-mode .add-task-container label,
    html.dark .modal-content h2, 
    html.dark .modal-content h3, 
    html.dark .modal-content span:not(.count-badge):not(.nlp-match),
    html.dark .date-picker-container h2,
    html.dark .date-picker-container h3,
    html.dark .date-picker-container span:not(.count-badge):not(.nlp-match),
    html.dark .date-picker-container label,
    html.dark .date-picker-container .calendar-day:not(.active-day):not(.active):not(.selected),
    html.dark #sheet-date-repeat-picker .bottom-sheet h2,
    html.dark #sheet-date-repeat-picker .bottom-sheet h3,
    html.dark #sheet-date-repeat-picker .bottom-sheet span:not(.count-badge):not(.nlp-match),
    html.dark #sheet-date-repeat-picker .bottom-sheet label,
    html.dark #sheet-date-repeat-picker .bottom-sheet .cal-day-btn:not(.active-day):not(.active):not(.selected),
    html.dark #sheet-date-repeat-picker .bottom-sheet .calendar-day:not(.active-day):not(.active):not(.selected),
    html.dark .add-task-container h2,
    html.dark .add-task-container h3,
    html.dark .add-task-container label,
    [data-theme="dark"] .modal-content h2, 
    [data-theme="dark"] .modal-content h3, 
    [data-theme="dark"] .modal-content span:not(.count-badge):not(.nlp-match),
    [data-theme="dark"] .date-picker-container h2,
    [data-theme="dark"] .date-picker-container h3,
    [data-theme="dark"] .date-picker-container span:not(.count-badge):not(.nlp-match),
    [data-theme="dark"] .date-picker-container label,
    [data-theme="dark"] .date-picker-container .calendar-day:not(.active-day):not(.active):not(.selected),
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet h2,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet h3,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet span:not(.count-badge):not(.nlp-match),
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet label,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet .cal-day-btn:not(.active-day):not(.active):not(.selected),
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet .calendar-day:not(.active-day):not(.active):not(.selected),
    [data-theme="dark"] .add-task-container h2,
    [data-theme="dark"] .add-task-container h3,
    [data-theme="dark"] .add-task-container label {
      color: #f8fafc !important; /* Bright White text */
    }

    /* Preserve white text on active/selected calendar days inside Date Picker */
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.selected,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.active-day,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.active,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.selected span,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.active-day span,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.active span,
    .date-picker-container .calendar-day.active-day,
    .date-picker-container .calendar-day.active,
    .date-picker-container .calendar-day.selected {
      color: #ffffff !important;
    }

    /* 🚀 Fix 5: Input Contrast Inside Modals */
    .modal-content input,
    .modal-content textarea,
    .add-task-container input:not(.nlp-input),
    .add-task-container textarea,
    #sheet-date-repeat-picker .bottom-sheet input {
      color: #0f172a !important;
      background: rgba(0, 0, 0, 0.03) !important;
    }
    .add-task-container input.nlp-input {
      color: #0f172a !important;
      background: transparent !important;
    }
    body.dark-mode .modal-content input,
    body.dark-mode .modal-content textarea,
    body.dark-mode .add-task-container input:not(.nlp-input),
    body.dark-mode .add-task-container textarea,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet input,
    html.dark .modal-content input,
    html.dark .modal-content textarea,
    html.dark .add-task-container input:not(.nlp-input),
    html.dark .add-task-container textarea,
    html.dark #sheet-date-repeat-picker .bottom-sheet input,
    [data-theme="dark"] .modal-content input,
    [data-theme="dark"] .modal-content textarea,
    [data-theme="dark"] .add-task-container input:not(.nlp-input),
    [data-theme="dark"] .add-task-container textarea,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet input {
      color: #f8fafc !important;
      background: rgba(255, 255, 255, 0.05) !important;
    }
    body.dark-mode .add-task-container input.nlp-input,
    html.dark .add-task-container input.nlp-input,
    [data-theme="dark"] .add-task-container input.nlp-input {
      color: #f8fafc !important;
      background: transparent !important;
    }

    /* 🚀 Fix 1: High-Contrast Pending Tasks Text (Light Mode) */
    /* Casting a wide net to catch the status text regardless of its exact class name */
    .tasks-pending,
    .pending-count,
    .pending-count-footer,
    .pending-counter-text,
    #today-pending-counter,
    .todo-bottom-counter,
    .pending-tasks-info,
    .task-status-text,
    .tasks-section > center,
    .dashboard-tasks-wrapper > center,
    #tasks-container > center,
    #tasks-container > div[style*="text-align: center"] {
      color: #475569 !important; /* Sharp, high-contrast slate gray */
      font-weight: 600 !important;
      opacity: 1 !important;
      text-shadow: none !important; /* Prevents blurry text */
    }

    /* 🚀 Fix 2: Bright Pending Tasks Text (Dark Mode) */
    body.dark-mode .tasks-pending,
    body.dark-mode .pending-count,
    body.dark-mode .pending-count-footer,
    body.dark-mode .pending-counter-text,
    body.dark-mode #today-pending-counter,
    body.dark-mode .todo-bottom-counter,
    body.dark-mode .pending-tasks-info,
    body.dark-mode .task-status-text,
    body.dark-mode .tasks-section > center,
    body.dark-mode .dashboard-tasks-wrapper > center,
    body.dark-mode #tasks-container > center,
    body.dark-mode #tasks-container > div[style*="text-align: center"],
    html.dark .tasks-pending,
    html.dark .pending-count,
    html.dark .pending-count-footer,
    html.dark .pending-counter-text,
    html.dark #today-pending-counter,
    html.dark .todo-bottom-counter,
    html.dark .pending-tasks-info,
    html.dark .task-status-text,
    html.dark .tasks-section > center,
    html.dark .dashboard-tasks-wrapper > center,
    html.dark #tasks-container > center,
    html.dark #tasks-container > div[style*="text-align: center"],
    [data-theme="dark"] .tasks-pending,
    [data-theme="dark"] .pending-count,
    [data-theme="dark"] .pending-count-footer,
    [data-theme="dark"] .pending-counter-text,
    [data-theme="dark"] #today-pending-counter,
    [data-theme="dark"] .todo-bottom-counter,
    [data-theme="dark"] .pending-tasks-info,
    [data-theme="dark"] .task-status-text,
    [data-theme="dark"] .tasks-section > center,
    [data-theme="dark"] .dashboard-tasks-wrapper > center,
    [data-theme="dark"] #tasks-container > center,
    [data-theme="dark"] #tasks-container > div[style*="text-align: center"] {
      color: #cbd5e1 !important; /* Crisp, bright slate for dark backgrounds */
    }

    /* 🚀 Fix 1: Mild Highlight for Today's Date (Light Mode) */
    .calendar-day.today,
    .compact-cal-day.today,
    .todo-cal-day-cell.today,
    .date-picker-container .today,
    .calendar-grid .today,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today,
    #cal-popup-grid .cal-day-btn.today {
      background: rgba(13, 148, 136, 0.08) !important; /* Soft translucent teal wash */
      color: #0d9488 !important; /* Distinct teal text */
      font-weight: 800 !important;
      border: 1px solid rgba(13, 148, 136, 0.3) !important; /* Subtle framing ring */
    }
    .calendar-day.today > span:first-child,
    .compact-cal-day.today > span:first-child,
    .todo-cal-day-cell.today > span:first-child,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today > span:first-child {
      color: #0d9488 !important;
      font-weight: 800 !important;
    }

    /* 🚀 Fix 2: Mild Highlight for Today's Date (Dark Mode) */
    body.dark-mode .calendar-day.today,
    body.dark-mode .compact-cal-day.today,
    body.dark-mode .todo-cal-day-cell.today,
    body.dark-mode .date-picker-container .today,
    body.dark-mode .calendar-grid .today,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today,
    body.dark-mode #cal-popup-grid .cal-day-btn.today,
    html.dark .calendar-day.today,
    html.dark .compact-cal-day.today,
    html.dark .todo-cal-day-cell.today,
    html.dark .date-picker-container .today,
    html.dark .calendar-grid .today,
    html.dark #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today,
    html.dark #cal-popup-grid .cal-day-btn.today,
    [data-theme="dark"] .calendar-day.today,
    [data-theme="dark"] .compact-cal-day.today,
    [data-theme="dark"] .todo-cal-day-cell.today,
    [data-theme="dark"] .date-picker-container .today,
    [data-theme="dark"] .calendar-grid .today,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today,
    [data-theme="dark"] #cal-popup-grid .cal-day-btn.today {
      background: rgba(45, 212, 191, 0.12) !important;
      color: #2dd4bf !important;
      border: 1px solid rgba(45, 212, 191, 0.3) !important;
    }
    body.dark-mode .calendar-day.today > span:first-child,
    body.dark-mode .compact-cal-day.today > span:first-child,
    body.dark-mode .todo-cal-day-cell.today > span:first-child,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today > span:first-child,
    html.dark .calendar-day.today > span:first-child,
    html.dark .compact-cal-day.today > span:first-child,
    html.dark .todo-cal-day-cell.today > span:first-child,
    html.dark #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today > span:first-child,
    [data-theme="dark"] .calendar-day.today > span:first-child,
    [data-theme="dark"] .compact-cal-day.today > span:first-child,
    [data-theme="dark"] .todo-cal-day-cell.today > span:first-child,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today > span:first-child {
      color: #2dd4bf !important;
    }

    /* 🚀 Fix 3: Conflict Resolution (If Today is ALSO the Selected Day) */
    /* Reverts to the bold, solid primary color to indicate selection dominance */
    .calendar-day.today.active,
    .calendar-day.today.selected,
    .compact-cal-day.today.active-day,
    .compact-cal-day.today.selected,
    .todo-cal-day-cell.today.selected,
    .todo-cal-day-cell.today.active,
    .date-picker-container .today.selected,
    .calendar-grid .today.active,
    .calendar-grid .today.selected,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.active,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.active-day,
    #cal-popup-grid .cal-day-btn.today.selected,
    #cal-popup-grid .cal-day-btn.today.active-day,
    body.dark-mode .calendar-day.today.active,
    body.dark-mode .calendar-day.today.selected,
    body.dark-mode .compact-cal-day.today.active-day,
    body.dark-mode .compact-cal-day.today.selected,
    body.dark-mode .todo-cal-day-cell.today.selected,
    body.dark-mode .date-picker-container .today.selected,
    body.dark-mode .calendar-grid .today.active,
    body.dark-mode .calendar-grid .today.selected,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected,
    body.dark-mode #cal-popup-grid .cal-day-btn.today.active-day,
    html.dark .calendar-day.today.active,
    html.dark .calendar-day.today.selected,
    html.dark .compact-cal-day.today.active-day,
    html.dark .compact-cal-day.today.selected,
    html.dark .todo-cal-day-cell.today.selected,
    html.dark .date-picker-container .today.selected,
    html.dark .calendar-grid .today.active,
    html.dark .calendar-grid .today.selected,
    html.dark #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected,
    html.dark #cal-popup-grid .cal-day-btn.today.active-day,
    [data-theme="dark"] .calendar-day.today.active,
    [data-theme="dark"] .calendar-day.today.selected,
    [data-theme="dark"] .compact-cal-day.today.active-day,
    [data-theme="dark"] .compact-cal-day.today.selected,
    [data-theme="dark"] .todo-cal-day-cell.today.selected,
    [data-theme="dark"] .date-picker-container .today.selected,
    [data-theme="dark"] .calendar-grid .today.active,
    [data-theme="dark"] .calendar-grid .today.selected,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected,
    [data-theme="dark"] #cal-popup-grid .cal-day-btn.today.active-day {
      background: var(--primary-color, #0d9488) !important;
      color: #ffffff !important;
      border: none !important;
      box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3) !important;
    }
    .calendar-day.today.active > span:first-child,
    .calendar-day.today.selected > span:first-child,
    .compact-cal-day.today.active-day > span:first-child,
    .compact-cal-day.today.selected > span:first-child,
    .todo-cal-day-cell.today.selected > span:first-child,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected > span:first-child,
    body.dark-mode .calendar-day.today.active > span:first-child,
    body.dark-mode .calendar-day.today.selected > span:first-child,
    body.dark-mode .compact-cal-day.today.active-day > span:first-child,
    body.dark-mode .compact-cal-day.today.selected > span:first-child,
    body.dark-mode .todo-cal-day-cell.today.selected > span:first-child,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected > span:first-child,
    html.dark .calendar-day.today.active > span:first-child,
    html.dark .calendar-day.today.selected > span:first-child,
    html.dark .compact-cal-day.today.active-day > span:first-child,
    html.dark .compact-cal-day.today.selected > span:first-child,
    html.dark .todo-cal-day-cell.today.selected > span:first-child,
    html.dark #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected > span:first-child,
    [data-theme="dark"] .calendar-day.today.active > span:first-child,
    [data-theme="dark"] .calendar-day.today.selected > span:first-child,
    [data-theme="dark"] .compact-cal-day.today.active-day > span:first-child,
    [data-theme="dark"] .compact-cal-day.today.selected > span:first-child,
    [data-theme="dark"] .todo-cal-day-cell.today.selected > span:first-child,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.today.selected > span:first-child {
      color: #ffffff !important;
    }

    /* 🚀 Fix 1: Past Date Dimming (Light Mode) */
    .calendar-day.past-date,
    .compact-cal-day.past-date,
    .todo-cal-day-cell.past-date,
    .date-picker-container .past-date,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.past-date,
    #cal-popup-grid .cal-day-btn.past-date {
      opacity: 0.45 !important; /* Softly desaturates the day */
      filter: grayscale(30%) !important;
      color: #64748b !important;
    }
    .calendar-day.past-date span,
    .compact-cal-day.past-date span,
    .todo-cal-day-cell.past-date span {
      color: #64748b !important; /* Muted slate text */
    }

    /* 🚀 Fix 2: Past Date Dimming (Dark Mode) */
    body.dark-mode .calendar-day.past-date,
    body.dark-mode .compact-cal-day.past-date,
    body.dark-mode .todo-cal-day-cell.past-date,
    body.dark-mode .date-picker-container .past-date,
    body.dark-mode #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.past-date,
    body.dark-mode #cal-popup-grid .cal-day-btn.past-date,
    html.dark .calendar-day.past-date,
    html.dark .compact-cal-day.past-date,
    html.dark .todo-cal-day-cell.past-date,
    html.dark .date-picker-container .past-date,
    html.dark #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.past-date,
    html.dark #cal-popup-grid .cal-day-btn.past-date,
    [data-theme="dark"] .calendar-day.past-date,
    [data-theme="dark"] .compact-cal-day.past-date,
    [data-theme="dark"] .todo-cal-day-cell.past-date,
    [data-theme="dark"] .date-picker-container .past-date,
    [data-theme="dark"] #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.past-date,
    [data-theme="dark"] #cal-popup-grid .cal-day-btn.past-date {
      opacity: 0.35 !important;
      filter: grayscale(40%) !important;
      color: #94a3b8 !important;
    }
    body.dark-mode .calendar-day.past-date span,
    body.dark-mode .compact-cal-day.past-date span,
    body.dark-mode .todo-cal-day-cell.past-date span,
    html.dark .calendar-day.past-date span,
    html.dark .compact-cal-day.past-date span,
    html.dark .todo-cal-day-cell.past-date span,
    [data-theme="dark"] .calendar-day.past-date span,
    [data-theme="dark"] .compact-cal-day.past-date span,
    [data-theme="dark"] .todo-cal-day-cell.past-date span {
      color: #94a3b8 !important;
    }

    /* 🚀 Fix 3: Conflict Resolution (Never dim if Today or Active Selection) */
    .calendar-day.today.past-date,
    .calendar-day.active.past-date,
    .calendar-day.selected.past-date,
    .compact-cal-day.today.past-date,
    .compact-cal-day.active-day.past-date,
    .compact-cal-day.selected.past-date,
    .todo-cal-day-cell.today.past-date,
    .todo-cal-day-cell.selected.past-date,
    #sheet-date-repeat-picker .bottom-sheet .cal-day-btn.selected.past-date,
    #cal-popup-grid .cal-day-btn.active-day.past-date,
    body.dark-mode .calendar-day.today.past-date,
    body.dark-mode .calendar-day.active.past-date,
    body.dark-mode .calendar-day.selected.past-date,
    body.dark-mode .compact-cal-day.today.past-date,
    body.dark-mode .compact-cal-day.active-day.past-date,
    body.dark-mode .compact-cal-day.selected.past-date,
    html.dark .calendar-day.today.past-date,
    html.dark .calendar-day.active.past-date,
    html.dark .calendar-day.selected.past-date,
    html.dark .compact-cal-day.today.past-date,
    html.dark .compact-cal-day.active-day.past-date,
    html.dark .compact-cal-day.selected.past-date,
    [data-theme="dark"] .calendar-day.today.past-date,
    [data-theme="dark"] .calendar-day.active.past-date,
    [data-theme="dark"] .calendar-day.selected.past-date,
    [data-theme="dark"] .compact-cal-day.today.past-date,
    [data-theme="dark"] .compact-cal-day.active-day.past-date,
    [data-theme="dark"] .compact-cal-day.selected.past-date {
      opacity: 1 !important;
      filter: none !important;
    }
    .calendar-day.active.past-date span,
    .calendar-day.selected.past-date span,
    .compact-cal-day.active-day.past-date span,
    .compact-cal-day.selected.past-date span,
    .todo-cal-day-cell.selected.past-date span {
      color: #ffffff !important;
    }

    /* 🚀 Fix 1: Notes Dropdown Container Normalization */
    .notes-options-menu,
    .notes-dropdown,
    .dropdown-content,
    .mind-hub-menu,
    .notes-header .dropdown-menu,
    .journal-header .dropdown-menu {
      background: rgba(255, 255, 255, 0.95) !important; /* Bright glass for Light Theme */
      background-color: rgba(255, 255, 255, 0.95) !important;
      border: 1px solid var(--glass-border) !important;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08) !important;
      border-radius: 16px !important;
      padding: 8px 0 !important;
      min-width: 220px !important;
      overflow: hidden !important;
      z-index: 1000 !important;
    }

    /* 🚀 Fix 2: Dark Mode Menu Container */
    body.dark-mode .notes-options-menu,
    body.dark-mode .notes-dropdown,
    body.dark-mode .dropdown-content,
    body.dark-mode .mind-hub-menu,
    body.dark-mode .notes-header .dropdown-menu,
    body.dark-mode .journal-header .dropdown-menu,
    html.dark .notes-options-menu,
    html.dark .notes-dropdown,
    html.dark .dropdown-content,
    html.dark .mind-hub-menu,
    html.dark .notes-header .dropdown-menu,
    html.dark .journal-header .dropdown-menu,
    [data-theme="dark"] .notes-options-menu,
    [data-theme="dark"] .notes-dropdown,
    [data-theme="dark"] .dropdown-content,
    [data-theme="dark"] .mind-hub-menu,
    [data-theme="dark"] .notes-header .dropdown-menu,
    [data-theme="dark"] .journal-header .dropdown-menu {
      background: rgba(9, 9, 11, 0.95) !important; /* Deep black glass for Dark Theme */
      background-color: rgba(9, 9, 11, 0.95) !important;
      border-color: rgba(255, 255, 255, 0.08) !important;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
    }

    /* 🚀 Fix 3: Standardizing Menu Item Layout */
    .notes-options-menu .menu-item,
    .notes-options-menu div,
    .notes-options-menu li,
    .notes-options-menu a,
    .dropdown-content a,
    .mind-hub-menu .menu-item,
    .notes-header .dropdown-menu div {
      padding: 14px 20px !important;
      font-size: 14px !important;
      font-weight: 600 !important;
      color: #0f172a !important; /* Crisp slate text for Light Mode */
      display: flex !important;
      justify-content: space-between !important; /* Aligns text left and future icons right */
      align-items: center !important;
      cursor: pointer !important;
      transition: background 0.2s ease, color 0.2s ease !important;
      border: none !important;
      border-radius: 0 !important;
      background: transparent !important;
      text-decoration: none !important;
    }

    /* 🚀 Fix 4: Dark Mode Text Colors */
    body.dark-mode .notes-options-menu .menu-item,
    body.dark-mode .notes-options-menu div,
    body.dark-mode .notes-options-menu li,
    body.dark-mode .notes-options-menu a,
    body.dark-mode .dropdown-content a,
    body.dark-mode .mind-hub-menu .menu-item,
    body.dark-mode .notes-header .dropdown-menu div,
    html.dark .notes-options-menu .menu-item,
    html.dark .notes-options-menu div,
    html.dark .notes-options-menu li,
    html.dark .notes-options-menu a,
    html.dark .dropdown-content a,
    html.dark .mind-hub-menu .menu-item,
    html.dark .notes-header .dropdown-menu div,
    [data-theme="dark"] .notes-options-menu .menu-item,
    [data-theme="dark"] .notes-options-menu div,
    [data-theme="dark"] .notes-options-menu li,
    [data-theme="dark"] .notes-options-menu a,
    [data-theme="dark"] .dropdown-content a,
    [data-theme="dark"] .mind-hub-menu .menu-item,
    [data-theme="dark"] .notes-header .dropdown-menu div {
      color: #f8fafc !important; /* Bright white text for Dark Mode */
    }

    /* 🚀 Fix 5: Hover States */
    .notes-options-menu .menu-item:hover,
    .notes-options-menu div:hover,
    .notes-options-menu li:hover,
    .notes-options-menu a:hover,
    .dropdown-content a:hover,
    .mind-hub-menu .menu-item:hover,
    .notes-header .dropdown-menu div:hover {
      background: rgba(13, 148, 136, 0.08) !important; /* Soft teal highlight */
    }

    body.dark-mode .notes-options-menu .menu-item:hover,
    body.dark-mode .notes-options-menu div:hover,
    body.dark-mode .notes-options-menu li:hover,
    body.dark-mode .notes-options-menu a:hover,
    body.dark-mode .dropdown-content a:hover,
    body.dark-mode .mind-hub-menu .menu-item:hover,
    body.dark-mode .notes-header .dropdown-menu div:hover,
    html.dark .notes-options-menu .menu-item:hover,
    html.dark .notes-options-menu div:hover,
    html.dark .notes-options-menu li:hover,
    html.dark .notes-options-menu a:hover,
    html.dark .dropdown-content a:hover,
    html.dark .mind-hub-menu .menu-item:hover,
    html.dark .notes-header .dropdown-menu div:hover,
    [data-theme="dark"] .notes-options-menu .menu-item:hover,
    [data-theme="dark"] .notes-options-menu div:hover,
    [data-theme="dark"] .notes-options-menu li:hover,
    [data-theme="dark"] .notes-options-menu a:hover,
    [data-theme="dark"] .dropdown-content a:hover,
    [data-theme="dark"] .mind-hub-menu .menu-item:hover,
    [data-theme="dark"] .notes-header .dropdown-menu div:hover {
      background: rgba(255, 255, 255, 0.05) !important; /* Subtle white highlight */
    }

    /* ========================================================================
       REAL-TIME GLASSMORPHISM SEARCH ENGINE FOR HISTORY LOGS (PILLAR 1)
       ======================================================================== */
    /* 🚀 Fix 1: Premium History Search Bar */
    .history-search-wrapper {
      position: sticky;
      top: 0;
      z-index: 10;
      padding-bottom: 12px;
      margin-bottom: 12px;
      background: transparent;
      border-bottom: 1px solid var(--glass-border);
    }

    .history-search-input {
      width: 100%;
      padding: 12px 16px 12px 40px; /* Padding for the search icon */
      border-radius: 12px !important;
      background: rgba(128, 128, 128, 0.08) !important;
      border: 1px solid var(--glass-border) !important;
      color: #0f172a !important; /* Light mode text */
      font-size: 14px;
      font-weight: 500;
      outline: none;
      transition: all 0.2s ease;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: 12px center;
    }

    /* 🚀 Fix 2: Dark Mode Adaptation */
    body.dark-mode .history-search-input,
    html.dark .history-search-input,
    [data-theme="dark"] .history-search-input {
      background-color: rgba(255, 255, 255, 0.05) !important;
      color: #f8fafc !important; /* Dark mode text */
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    }

    /* 🚀 Fix 3: Active Focus Glow */
    .history-search-input:focus {
      border-color: var(--primary-color, #0d9488) !important;
      box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15) !important;
    }

    /* ========================================================================
       STICKY SHIELD OVERRIDE FOR HISTORY LOGS (PILLAR 1)
       ======================================================================== */
    /* 🚀 Fix 1: Opaque Search Shield (Light Mode) */
    .history-search-wrapper {
      position: sticky !important;
      top: -4px !important; /* Snaps perfectly to the top of the modal's inner scroll area */
      z-index: 100 !important; /* Forces the search bar above all log items */
      background: rgba(255, 255, 255, 0.98) !important; /* Near-solid shield to block text bleed */
      padding: 10px 0 12px 0 !important;
      margin-bottom: 12px !important;
      border-bottom: 1px solid var(--glass-border) !important;
    }

    /* 🚀 Fix 2: Opaque Search Shield (Dark Mode) */
    body.dark-mode .history-search-wrapper,
    html.dark .history-search-wrapper,
    [data-theme="dark"] .history-search-wrapper {
      background: rgba(9, 9, 11, 0.98) !important;
    }

    /* 🚀 Fix 3: Container Context Safety */
    /* Guarantees the list container doesn't accidentally overlap the sticky wrapper */
    .history-container,
    .activity-logs-container,
    .modal-content .logs-list,
    #activity-logs-list,
    #focus-history-list,
    #eisenhower-history-list {
      position: relative !important;
      z-index: 1 !important;
    }

    /* ========================================================================
       STATIC MODAL HEIGHT ANCHOR FOR HISTORY LOGS (PILLAR 1)
       ======================================================================== */
    /* 🚀 Fix 1: Lock the Outer Modal Height */
    /* Targeting common naming conventions for the Activity Logs bottom sheet/modal */
    #history-modal .modal-content,
    #history-modal .bottom-sheet,
    #sheet-activity-logs .bottom-sheet,
    #sheet-focus-history .bottom-sheet,
    #sheet-eisenhower-history .bottom-sheet,
    .activity-logs-container,
    .history-container,
    .logs-modal-wrapper {
      min-height: 80vh !important; /* Locks the modal to a premium, tall height */
      max-height: 90vh !important;
      display: flex !important;
      flex-direction: column !important;
    }

    /* 🚀 Fix 2: Expand the Inner Scroll Area */
    /* Forces the container holding the cards to stretch and fill the locked height */
    .logs-list,
    .history-scroll-area,
    #history-logs-list,
    .activity-logs-list,
    .history-content,
    #activity-logs-list,
    #focus-history-list,
    #eisenhower-history-list {
      flex: 1 1 auto !important; /* Expands to fill available space */
      min-height: 60vh !important; /* Failsafe height strut */
      overflow-y: auto !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: flex-start !important; /* Ensures filtered items stay pinned to the top */
    }

    /* 🚀 Fix 3: Ensure Empty State is Centered */
    /* If the search yields 0 results, the empty state message should sit nicely in the middle */
    .search-empty-state {
      flex: 1 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      min-height: 200px !important;
    }

    /* ========================================================================
       ACTIVE STATE SORTING ENGINE UI HIGHLIGHTS (PILLAR 2)
       ======================================================================== */
    #dynamic-sort-menu {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      justify-content: center;
    }

    /* 🚀 Fix 4: Sort UI Highlights */
    /* Highlights the currently active sort mode so the user knows what is applied */
    .sort-active-mode,
    .notes-options-menu .menu-item.sort-active-mode {
      color: var(--primary-color, #0d9488) !important;
      background: rgba(13, 148, 136, 0.1) !important;
      border-radius: 8px !important;
    }

    /* ========================================================================
       INLINE SORT SUB-MENU STYLING (PILLAR 3)
       ======================================================================== */
    /* 🚀 Fix 3: Inline Sort Sub-Menu Styles */
    #inline-sort-options .menu-item {
      padding: 10px 16px !important;
      font-size: 13px !important;
      font-weight: 700 !important;
      color: #64748b !important;
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      border-radius: 9px !important;
      cursor: pointer !important;
    }
    body.dark-mode #inline-sort-options .menu-item,
    html.dark #inline-sort-options .menu-item,
    [data-theme="dark"] #inline-sort-options .menu-item {
      color: #94a3b8 !important;
    }

    /* Checkmark injection for the active sort */
    .sort-opt.active-sort,
    #inline-sort-options .menu-item.sort-opt.active-sort {
      color: var(--primary-color, #0d9488) !important;
    }
    .sort-opt.active-sort::after {
      content: '✓';
      font-weight: bold;
      margin-left: auto;
    }

    /* ========================================================================
       ICONOGRAPHIC SUB-MENU MATRIX (PILLAR 1)
       ======================================================================== */
    /* 🚀 Fix 1: Strip the Vertical Lines */
    /* Targets both the Sort and View dropdown containers to ensure no legacy borders survive */
    #inline-sort-options,
    #inline-view-options,
    .inline-sub-menu {
      border-left: none !important;
      margin-left: 0 !important;
      padding-left: 8px !important; /* Keeps the gentle indentation */
    }

    /* 🚀 Fix 2: Icon Alignment Engine */
    #inline-sort-options .menu-item,
    #inline-view-options .menu-item,
    .inline-sub-menu .menu-item {
      display: flex !important;
      align-items: center !important;
      justify-content: flex-start !important;
      gap: 12px !important; /* Perfect spacing between the SVG and the text */
      padding: 12px 16px !important;
      font-size: 13px !important;
      font-weight: 700 !important;
      color: #64748b !important;
      border-radius: 9px !important;
      cursor: pointer !important;
    }

    body.dark-mode #inline-sort-options .menu-item,
    body.dark-mode #inline-view-options .menu-item,
    body.dark-mode .inline-sub-menu .menu-item,
    html.dark #inline-sort-options .menu-item,
    html.dark #inline-view-options .menu-item,
    html.dark .inline-sub-menu .menu-item,
    [data-theme="dark"] #inline-sort-options .menu-item,
    [data-theme="dark"] #inline-view-options .menu-item,
    [data-theme="dark"] .inline-sub-menu .menu-item {
      color: #94a3b8 !important;
    }

    /* 🚀 Fix 3: Premium SVG Styling */
    #inline-sort-options .menu-item svg,
    #inline-view-options .menu-item svg,
    .inline-sub-menu .menu-item svg {
      opacity: 0.6;
      transition: color 0.2s ease, opacity 0.2s ease;
      flex-shrink: 0;
    }

    /* 🚀 Fix 4: Active State Highlight */
    .sort-opt.active-sort,
    .view-opt.active-view,
    #inline-sort-options .menu-item.sort-opt.active-sort,
    #inline-view-options .menu-item.view-opt.active-view {
      color: var(--primary-color, #0d9488) !important;
    }

    .sort-opt.active-sort svg,
    .view-opt.active-view svg,
    .active-opt svg {
      opacity: 1 !important;
      color: var(--primary-color, #0d9488) !important;
    }

    /* Ensure the checkmark gets pushed completely to the right edge */
    .sort-opt.active-sort::after,
    .view-opt.active-view::after {
      content: '✓';
      font-weight: bold;
      margin-left: auto !important;
    }

    /* =========================================
       DYNAMIC FILTER MODAL & CHIPS (CSS)
       ========================================= */
    #dynamic-filter-modal {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      justify-content: center;
    }

    #dynamic-filter-modal > .bottom-sheet {
      padding: 0 !important;
      overflow: hidden !important;
      display: flex !important;
      flex-direction: column !important;
      max-height: 85dvh !important;
    }

    #dynamic-filter-modal > .bottom-sheet > div:nth-child(1) {
      flex-shrink: 0;
      position: relative;
      z-index: 10;
      background: #f9f8f6;
      border-bottom: 1px solid var(--glass-border);
    }

    body.dark-mode #dynamic-filter-modal > .bottom-sheet > div:nth-child(1),
    html.dark #dynamic-filter-modal > .bottom-sheet > div:nth-child(1),
    [data-theme="dark"] #dynamic-filter-modal > .bottom-sheet > div:nth-child(1) {
      background: #09090b;
    }

    #dynamic-filter-modal > .bottom-sheet > div:nth-child(2) {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    #dynamic-filter-modal > .bottom-sheet > .filter-modal-footer {
      flex-shrink: 0;
      position: relative;
      z-index: 10;
      background: #f9f8f6;
      border-top: 1px solid var(--glass-border);
      padding: 12px 20px calc(env(safe-area-inset-bottom, 16px) + 12px);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    body.dark-mode #dynamic-filter-modal > .bottom-sheet > .filter-modal-footer,
    html.dark #dynamic-filter-modal > .bottom-sheet > .filter-modal-footer,
    [data-theme="dark"] #dynamic-filter-modal > .bottom-sheet > .filter-modal-footer {
      background: #09090b;
    }

    #dynamic-filter-modal .filter-clear-btn {
      width: 100%;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 14px !important;
      font-size: 14px !important;
      font-weight: 700 !important;
    }

    .filter-chip {
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      user-select: none;
      
      /* Default Inactive State (Glass) */
      background: rgba(150, 150, 150, 0.08);
      border: 1px solid rgba(150, 150, 150, 0.15);
      color: var(--text-main, #52525b);
    }

    body.dark-mode .filter-chip,
    html.dark .filter-chip,
    [data-theme="dark"] .filter-chip {
      background: rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.1);
      color: #a1a1aa;
    }

    .filter-chip:active {
      transform: scale(0.95);
    }

    /* Active Selected State */
    .filter-chip.active {
      background: var(--primary-color, #0d9488) !important;
      border-color: var(--primary-color, #0d9488) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    }

    /* 🚀 Fix 1: SVG Layout inside Filter Chips */
    .filter-chip {
      display: flex !important;
      align-items: center !important;
      gap: 6px !important;
    }

    .filter-chip svg {
      width: 14px !important;
      height: 14px !important;
      flex-shrink: 0 !important;
      transition: color 0.2s ease, fill 0.2s ease !important;
    }

    /* 🚀 Fix 2: App-Standard Energy Colors */
    .chip-energy-high svg {
      color: #ef4444 !important; /* Crimson Red */
      fill: rgba(239, 68, 68, 0.2) !important;
    }
    .chip-energy-low svg {
      color: #10b981 !important; /* Emerald Green */
      fill: rgba(16, 185, 129, 0.2) !important;
    }

    /* 🚀 Fix 3: Priority Flag Colors */
    .chip-priority-high svg { color: #ef4444 !important; }
    .chip-priority-medium svg { color: #f59e0b !important; }
    .chip-priority-low svg { color: #3b82f6 !important; }

    /* 🚀 Fix 4: Active Chip Override */
    /* When a chip is selected, the icon turns white to match the teal background */
    .filter-chip.active svg {
      color: inherit !important;
      fill: currentColor !important; 
    }

    /* 🚀 Fix 1: System-Wide Destructive Button (Clear) */
    .filter-clear-btn {
      background: rgba(239, 68, 68, 0.1) !important; /* Translucent Crimson Wash */
      color: #ef4444 !important;
      padding: 6px 12px !important;
      border-radius: 8px !important;
      font-size: 13px !important;
      font-weight: 600 !important;
      border: none !important;
      cursor: pointer !important;
      transition: all 0.2s ease !important;
    }

    .filter-clear-btn:hover {
      background: rgba(239, 68, 68, 0.18) !important;
    }

    /* 🚀 Fix 2: Priority "None" Muted Styling */
    .chip-priority-none svg {
      color: #64748b !important;
    }
    body.dark-mode .chip-priority-none svg {
      color: #94a3b8 !important;
    }

    /* 🚀 Fix 3: Accordion Animation */
    .accordion-chevron {
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    .accordion-chevron.open {
      transform: rotate(180deg) !important;
    }

    /* 🚀 Fix 1: Sub-Menu Item Legibility (Inactive Options) */
    #inline-sort-options .menu-item,
    #inline-view-options .menu-item,
    .inline-sub-menu .menu-item {
      color: #334155 !important; /* Crisp Dark Slate for Light Theme */
      opacity: 1 !important; 
    }
    body.dark-mode #inline-sort-options .menu-item,
    body.dark-mode #inline-view-options .menu-item,
    body.dark-mode .inline-sub-menu .menu-item,
    html.dark #inline-sort-options .menu-item,
    html.dark #inline-view-options .menu-item,
    html.dark .inline-sub-menu .menu-item,
    [data-theme="dark"] #inline-sort-options .menu-item,
    [data-theme="dark"] #inline-view-options .menu-item,
    [data-theme="dark"] .inline-sub-menu .menu-item {
      color: #e2e8f0 !important; /* Bright Slate/White for Dark Theme */
    }

    /* 🚀 Fix 2: Selected Option Preview Colors (The ▾ labels in the main menu) */
    .menu-item[onclick*="toggleInlineSortMenu"] span:last-child,
    .menu-item[onclick*="toggleInlineViewMenu"] span:last-child,
    #sort-active-label,
    #view-active-label {
      color: var(--primary-color, #0d9488) !important;
      font-weight: 600 !important;
      opacity: 1 !important;
    }
    body.dark-mode .menu-item[onclick*="toggleInlineSortMenu"] span:last-child,
    body.dark-mode .menu-item[onclick*="toggleInlineViewMenu"] span:last-child,
    body.dark-mode #sort-active-label,
    body.dark-mode #view-active-label,
    html.dark .menu-item[onclick*="toggleInlineSortMenu"] span:last-child,
    html.dark .menu-item[onclick*="toggleInlineViewMenu"] span:last-child,
    html.dark #sort-active-label,
    html.dark #view-active-label,
    [data-theme="dark"] .menu-item[onclick*="toggleInlineSortMenu"] span:last-child,
    [data-theme="dark"] .menu-item[onclick*="toggleInlineViewMenu"] span:last-child,
    [data-theme="dark"] #sort-active-label,
    [data-theme="dark"] #view-active-label {
      color: #2dd4bf !important; /* Vibrant Cyan to pop against the dark menu */
    }

    /* Ensure the active checkmarked items in the sub-menu stay bright */
    .sort-opt.active-sort,
    .view-opt.active-view {
      color: var(--primary-color, #0d9488) !important;
    }
    body.dark-mode .sort-opt.active-sort,
    body.dark-mode .view-opt.active-view,
    html.dark .sort-opt.active-sort,
    html.dark .view-opt.active-view,
    [data-theme="dark"] .sort-opt.active-sort,
    [data-theme="dark"] .view-opt.active-view {
      color: #2dd4bf !important;
    }

    /* 🚀 Fix 3: Swipe UI Annihilator Failsafe */
    #inline-swipe-options,
    #btn-menu-nested-swipe,
    #submenu-todo-swipe,
    .menu-item[onclick*="SwipeMenu"],
    .menu-item[onclick*="swipeAction"] {
      display: none !important;
      pointer-events: none !important;
    }

    /* 🚀 Fix 1: Restore Main Menu Item Spacing & Typography */
    .menu-item[onclick*="toggleCompletedTasks"],
    .menu-item[onclick*="toggleInlineViewMenu"],
    .menu-item[onclick*="toggleInlineSortMenu"],
    .menu-item[onclick*="openFilterModal"],
    .menu-item[onclick*="openLogModal"] {
      padding: 14px 20px !important;
      font-size: 14px !important;
      font-weight: 600 !important;
      cursor: pointer !important;
      transition: background 0.2s ease, color 0.2s ease !important;
    }

    /* 🚀 Fix 2: Restore Smooth Hover States (Light Mode) */
    .menu-item[onclick*="toggleCompletedTasks"]:hover,
    .menu-item[onclick*="toggleInlineViewMenu"]:hover,
    .menu-item[onclick*="toggleInlineSortMenu"]:hover,
    .menu-item[onclick*="openFilterModal"]:hover,
    .menu-item[onclick*="openLogModal"]:hover {
      background: rgba(13, 148, 136, 0.08) !important;
      border-radius: 12px !important;
    }

    /* 🚀 Fix 3: Restore Smooth Hover States (Dark Mode) */
    body.dark-mode .menu-item[onclick*="toggleCompletedTasks"]:hover,
    body.dark-mode .menu-item[onclick*="toggleInlineViewMenu"]:hover,
    body.dark-mode .menu-item[onclick*="toggleInlineSortMenu"]:hover,
    body.dark-mode .menu-item[onclick*="openFilterModal"]:hover,
    body.dark-mode .menu-item[onclick*="openLogModal"]:hover,
    html.dark .menu-item[onclick*="toggleCompletedTasks"]:hover,
    html.dark .menu-item[onclick*="toggleInlineViewMenu"]:hover,
    html.dark .menu-item[onclick*="toggleInlineSortMenu"]:hover,
    html.dark .menu-item[onclick*="openFilterModal"]:hover,
    html.dark .menu-item[onclick*="openLogModal"]:hover,
    [data-theme="dark"] .menu-item[onclick*="toggleCompletedTasks"]:hover,
    [data-theme="dark"] .menu-item[onclick*="toggleInlineViewMenu"]:hover,
    [data-theme="dark"] .menu-item[onclick*="toggleInlineSortMenu"]:hover,
    [data-theme="dark"] .menu-item[onclick*="openFilterModal"]:hover,
    [data-theme="dark"] .menu-item[onclick*="openLogModal"]:hover {
      background: rgba(255, 255, 255, 0.05) !important;
      border-radius: 12px !important;
    }

    /* 🚀 Fix 1: Compact Recurring Icon Styling */
    .task-recurring-icon {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      color: #64748b !important;
      opacity: 0.8;
    }
    body.dark-mode .task-recurring-icon,
    html.dark .task-recurring-icon,
    [data-theme="dark"] .task-recurring-icon {
      color: #94a3b8 !important;
    }

    /* 🚀 Fix 2: Compact Minimalistic Expanded Recurring Pill */
    .task-recurring-detail {
      display: inline-flex !important;
      align-items: center !important;
      width: fit-content !important;
      max-width: 100%;
      gap: 5px !important;
      padding: 2px 8px !important;
      margin-top: 4px !important;
      background: rgba(13, 148, 136, 0.06);
      border-radius: 6px;
      font-size: 11px !important;
      font-weight: 600 !important;
      line-height: 1.3 !important;
      color: var(--text-secondary, #475569) !important;
      border: 1px solid rgba(13, 148, 136, 0.16);
    }
    body.dark-mode .task-recurring-detail,
    html.dark .task-recurring-detail,
    [data-theme="dark"] .task-recurring-detail {
      color: #cbd5e1 !important;
      background: rgba(20, 184, 166, 0.08);
      border-color: rgba(45, 212, 191, 0.18);
    }
    .task-recurring-detail svg {
      color: var(--primary-color, #0d9488);
      flex-shrink: 0;
    }

    /* 🚀 Fix 3: The State Toggle Logic */
    /* Hides the detailed text when the card is collapsed */
    .task-card:not(.expanded) .task-recurring-detail,
    .board-card:not(.expanded) .task-recurring-detail,
    .detailed-board-card:not(.expanded) .task-recurring-detail,
    .list-card:not(.expanded) .task-recurring-detail {
      display: none !important;
    }

    /* Hides the small icon when the card is expanded to prevent redundancy */
    .task-card.expanded .task-recurring-icon,
    .board-card.expanded .task-recurring-icon,
    .detailed-board-card.expanded .task-recurring-icon,
    .list-card.expanded .task-recurring-icon {
      display: none !important;
    }

    /* 🚀 Fix 1: Premium Feature Card Entrance (More Section Staggered Animations) */
    @keyframes featurePop {
      0% { opacity: 0; transform: translateY(20px) scale(0.96); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }

    .more-content .feature-card,
    #more-tab .feature-card,
    #tab-more .feature-card,
    #more-hub-grid > .more-grid-cell,
    .grid-container > div,
    .more-grid > div {
      opacity: 0;
      animation: featurePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    /* Stagger the entrance of each card */
    .more-content .feature-card:nth-child(1), #more-tab .feature-card:nth-child(1), #tab-more .feature-card:nth-child(1), #more-hub-grid > .more-grid-cell:nth-child(1), .grid-container > div:nth-child(1), .more-grid > div:nth-child(1) { animation-delay: 0.05s; }
    .more-content .feature-card:nth-child(2), #more-tab .feature-card:nth-child(2), #tab-more .feature-card:nth-child(2), #more-hub-grid > .more-grid-cell:nth-child(2), .grid-container > div:nth-child(2), .more-grid > div:nth-child(2) { animation-delay: 0.10s; }
    .more-content .feature-card:nth-child(3), #more-tab .feature-card:nth-child(3), #tab-more .feature-card:nth-child(3), #more-hub-grid > .more-grid-cell:nth-child(3), .grid-container > div:nth-child(3), .more-grid > div:nth-child(3) { animation-delay: 0.15s; }
    .more-content .feature-card:nth-child(4), #more-tab .feature-card:nth-child(4), #tab-more .feature-card:nth-child(4), #more-hub-grid > .more-grid-cell:nth-child(4), .grid-container > div:nth-child(4), .more-grid > div:nth-child(4) { animation-delay: 0.20s; }
    .more-content .feature-card:nth-child(5), #more-tab .feature-card:nth-child(5), #tab-more .feature-card:nth-child(5), #more-hub-grid > .more-grid-cell:nth-child(5), .grid-container > div:nth-child(5), .more-grid > div:nth-child(5) { animation-delay: 0.25s; }
    .more-content .feature-card:nth-child(6), #more-tab .feature-card:nth-child(6), #tab-more .feature-card:nth-child(6), #more-hub-grid > .more-grid-cell:nth-child(6), .grid-container > div:nth-child(6), .more-grid > div:nth-child(6) { animation-delay: 0.30s; }
    .more-content .feature-card:nth-child(7), #more-tab .feature-card:nth-child(7), #tab-more .feature-card:nth-child(7), #more-hub-grid > .more-grid-cell:nth-child(7), .grid-container > div:nth-child(7), .more-grid > div:nth-child(7) { animation-delay: 0.35s; }
    .more-content .feature-card:nth-child(8), #more-tab .feature-card:nth-child(8), #tab-more .feature-card:nth-child(8), #more-hub-grid > .more-grid-cell:nth-child(8), .grid-container > div:nth-child(8), .more-grid > div:nth-child(8) { animation-delay: 0.40s; }

    /* 🚀 Fix 2: Force Native Touch Scrolling in Settings */
    .settings-container,
    #settings-modal,
    #settings-modal .modal-content,
    #sheet-settings-menu .bottom-sheet,
    .settings-list,
    .more-content,
    #more-tab,
    #tab-more {
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch !important;
      touch-action: pan-y !important;
      overscroll-behavior-y: contain !important;
      padding-bottom: 100px !important; /* Prevents bottom nav from blocking the last items */
    }

    /* 🚀 Fix 1: The Premium Entrance Keyframe */
    @keyframes featureModalPop {
      0% { 
        opacity: 0; 
        transform: scale(0.92) translateY(20px); 
      }
      100% { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
      }
    }

    /* 🚀 Fix 2: Applying Animation to Feature Targets */
    /* We target the direct child (the actual content box) of your feature modals to animate the UI, not the dark background overlay */

    /* Habit Tracker Targets */
    #habit-tracker-modal > div,
    #habit-tracker-modal .modal-content,
    #habit-tracker-container,
    .habit-tracker-wrapper,
    #more-habit-tracker-view,

    /* Eisenhower Matrix Targets */
    #eisenhower-modal > div,
    #eisenhower-modal .modal-content,
    #eisenhower-matrix-container,
    .eisenhower-wrapper,
    #more-eisenhower-view,

    /* Time Blocking & Phone Usage Targets */
    #time-blocking-modal > div,
    #time-blocking-modal .modal-content,
    #time-blocking-container,
    .time-blocking-wrapper,
    #more-timeblocking-view,
    #more-phone-usage-view {
      /* 0.4s duration with a snappy, frictionless spring curve */
      animation: featureModalPop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
      will-change: transform, opacity !important; /* Hardware acceleration */
    }

    /* 🚀 Fix 3: Optional Overlay Fade (If your modals have dark backgrounds) */
    @keyframes overlayFadeIn {
      0% { background-color: rgba(0, 0, 0, 0); }
      100% { background-color: rgba(0, 0, 0, 0.4); } /* Adjust based on your dark overlay opacity */
    }

    #habit-tracker-modal,
    #eisenhower-modal,
    #time-blocking-modal {
      animation: overlayFadeIn 0.3s ease forwards;
    }

    /* 🚀 Fix 1: Time Left (Upcoming - Future) */
    .time-left,
    .time-left span,
    .time-left svg {
      color: var(--primary-color, #0d9488) !important; /* Vibrant Teal */
      font-weight: 600 !important;
    }
    body.dark-mode .time-left,
    body.dark-mode .time-left span,
    body.dark-mode .time-left svg,
    html.dark .time-left,
    html.dark .time-left span,
    html.dark .time-left svg,
    [data-theme="dark"] .time-left,
    [data-theme="dark"] .time-left span,
    [data-theme="dark"] .time-left svg {
      color: #2dd4bf !important;
    }

    /* 🚀 Fix 2: Time Crossed (Overdue - Past) */
    .time-crossed,
    .time-crossed span,
    .time-crossed svg {
      color: #ef4444 !important; /* Alert Crimson */
      font-weight: 600 !important;
    }
    body.dark-mode .time-crossed,
    body.dark-mode .time-crossed span,
    body.dark-mode .time-crossed svg,
    html.dark .time-crossed,
    html.dark .time-crossed span,
    html.dark .time-crossed svg,
    [data-theme="dark"] .time-crossed,
    [data-theme="dark"] .time-crossed span,
    [data-theme="dark"] .time-crossed svg {
      color: #f87171 !important; /* Bright Red for dark mode */
    }

    /* 🚀 Fix 3: Neutralized Time (Completed Tasks) */
    /* Prevents a completed task from screaming red at you just because the time passed */
    .task-completed .time-crossed,
    .task-completed .time-left,
    .task-completed .time-crossed span,
    .task-completed .time-left span,
    .task-completed .time-crossed svg,
    .task-completed .time-left svg,
    .completed .time-crossed,
    .completed .time-left,
    .completed .time-crossed span,
    .completed .time-left span,
    .completed .time-crossed svg,
    .completed .time-left svg {
      color: #94a3b8 !important; 
    }

    /* 🚀 Fix 1: Restore Task Adder Save Button */
    #date-picker-modal .save-btn,
    .date-picker-container .save-btn,
    #sheet-date-repeat-picker:not(.journal-jump-mode) #btn-save-date-picker-top {
      display: inline-flex !important; /* Restores the button to its original state */
    }

    /* 🚀 Fix 2: Vaporize ONLY the Journal Jump Button */
    /* We target the specific JavaScript function attached to the button to safely hide it */
    .date-picker-container button[onclick*="jumpToSelectedDate"],
    .date-picker-container button[onclick*="jump"],
    #sheet-date-repeat-picker.journal-jump-mode #btn-save-date-picker-top {
      display: none !important;
    }

    /* 🚀 Fix 1: System-Wide Dull Placeholder Text (Light Mode) */
    input::placeholder,
    textarea::placeholder,
    input::-webkit-input-placeholder,
    textarea::-webkit-input-placeholder,
    [contenteditable][data-placeholder]:empty::before {
      color: #94a3b8 !important; /* Muted Slate */
      opacity: 0.65 !important; /* Forces the 'shaded' translucent effect */
      font-weight: 400 !important;
      transition: opacity 0.2s ease !important;
    }

    /* 🚀 Fix 2: System-Wide Dull Placeholder Text (Dark Mode) */
    body.dark-mode input::placeholder,
    body.dark-mode textarea::placeholder,
    body.dark-mode input::-webkit-input-placeholder,
    body.dark-mode textarea::-webkit-input-placeholder,
    html.dark input::placeholder,
    html.dark textarea::placeholder,
    html.dark input::-webkit-input-placeholder,
    html.dark textarea::-webkit-input-placeholder,
    [data-theme="dark"] input::placeholder,
    [data-theme="dark"] textarea::placeholder,
    [data-theme="dark"] input::-webkit-input-placeholder,
    [data-theme="dark"] textarea::-webkit-input-placeholder,
    body.dark-mode [contenteditable][data-placeholder]:empty::before,
    html.dark [contenteditable][data-placeholder]:empty::before,
    [data-theme="dark"] [contenteditable][data-placeholder]:empty::before {
      color: #64748b !important; /* Deeper Slate for dark backgrounds */
      opacity: 0.5 !important; /* Slightly more translucent in dark mode */
    }

    /* 🚀 Fix 3: Focus State Refinement */
    /* Gently fades the instructional text out even more when the user clicks into the box */
    input:focus::placeholder,
    textarea:focus::placeholder,
    [contenteditable][data-placeholder]:focus:empty::before {
      opacity: 0.3 !important;
    }

    /* ============================================================================
       APP-WIDE GLASSMORPHISM INITIATION TIP BALLOON SYSTEM
       ============================================================================ */
    .v-tip-balloon {
      position: fixed;
      z-index: 100005;
      width: min(258px, calc(100vw - 28px));
      padding: 13px 15px 12px;
      border-radius: 18px;
      background: linear-gradient(155deg, rgba(28, 32, 42, 0.72) 0%, rgba(15, 18, 26, 0.62) 100%);
      backdrop-filter: blur(26px) saturate(190%);
      -webkit-backdrop-filter: blur(26px) saturate(190%);
      border: 1px solid rgba(255, 255, 255, 0.16);
      box-shadow:
        0 22px 48px -12px rgba(0, 0, 0, 0.50),
        0 6px 16px -4px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04);
      color: rgba(248, 250, 252, 0.96);
      font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
      opacity: 0;
      transform: translate3d(0, 9px, 0) scale(0.955);
      pointer-events: none;
      will-change: transform, opacity;
      transition:
        opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        top 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        left 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .v-tip-balloon::before {
      content: '';
      position: absolute;
      top: 0;
      left: 16px;
      right: 16px;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
      pointer-events: none;
      border-radius: 99px;
    }
    .v-tip-balloon.placement-top {
      transform: translate3d(0, -9px, 0) scale(0.955);
    }
    .v-tip-balloon.no-pos-transition {
      transition:
        opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .v-tip-balloon.visible {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
      pointer-events: auto;
    }
    body.light-mode .v-tip-balloon,
    html.light-mode .v-tip-balloon,
    [data-theme="light"] .v-tip-balloon {
      background: linear-gradient(155deg, rgba(255, 255, 255, 0.80) 0%, rgba(244, 247, 252, 0.68) 100%);
      color: #0f172a;
      border-color: rgba(15, 23, 42, 0.10);
      box-shadow:
        0 20px 44px -12px rgba(15, 23, 42, 0.16),
        0 4px 12px -2px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.94),
        inset 0 -1px 0 rgba(15, 23, 42, 0.03);
    }
    body.light-mode .v-tip-balloon::before,
    html.light-mode .v-tip-balloon::before,
    [data-theme="light"] .v-tip-balloon::before {
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98), transparent);
    }
    .v-tip-balloon.force-dark-glass,
    body.light-mode .v-tip-balloon.force-dark-glass,
    html.light-mode .v-tip-balloon.force-dark-glass,
    [data-theme="light"] .v-tip-balloon.force-dark-glass {
      background: linear-gradient(155deg, rgba(28, 32, 42, 0.80) 0%, rgba(14, 17, 24, 0.72) 100%);
      color: rgba(248, 250, 252, 0.96);
      border-color: rgba(255, 255, 255, 0.18);
      box-shadow:
        0 22px 48px -12px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    }
    .v-tip-balloon.force-dark-glass .v-tip-kicker,
    .v-tip-balloon.force-dark-glass .v-tip-step-count {
      color: rgba(226, 232, 240, 0.64);
    }
    .v-tip-balloon.force-dark-glass .v-tip-body {
      color: rgba(226, 232, 240, 0.80);
    }
    .v-tip-balloon.force-dark-glass .v-tip-skip-btn {
      color: rgba(203, 213, 225, 0.76);
    }
    .v-tip-balloon.force-dark-glass .v-tip-back-btn {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.14);
      color: rgba(248, 250, 252, 0.88);
    }
    .v-tip-balloon.force-dark-glass .v-tip-next-btn {
      background: rgba(255, 255, 255, 0.16);
      color: #ffffff;
      border-color: rgba(255, 255, 255, 0.24);
    }
    .v-tip-balloon.force-dark-glass .v-tip-arrow {
      background: rgba(24, 28, 38, 0.86);
      border-color: rgba(255, 255, 255, 0.18);
    }
    .v-tip-balloon.force-dark-glass .v-tip-step-dot {
      background: rgba(255, 255, 255, 0.24);
    }

    @keyframes vTipGentleFloat {
      0%, 100% { transform: translate3d(0, 0, 0); }
      50% { transform: translate3d(0, -2.5px, 0); }
    }
    .v-tip-inner {
      transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .v-tip-balloon.visible .v-tip-inner {
      animation: vTipGentleFloat 4.2s ease-in-out infinite;
    }
    .v-tip-inner.is-swapping {
      opacity: 0;
      transform: translate3d(0, 3px, 0);
    }

    .v-tip-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }
    .v-tip-kicker {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(226, 232, 240, 0.64);
    }
    body.light-mode .v-tip-kicker,
    html.light-mode .v-tip-kicker,
    [data-theme="light"] .v-tip-kicker {
      color: rgba(15, 23, 42, 0.52);
    }
    .v-tip-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent-primary, #10b981);
      box-shadow: 0 0 8px var(--accent-glow, rgba(16, 185, 129, 0.55));
      flex-shrink: 0;
    }
    .v-tip-progress-wrap {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .v-tip-dots {
      display: inline-flex;
      align-items: center;
      gap: 3.5px;
    }
    .v-tip-step-dot {
      width: 4px;
      height: 4px;
      border-radius: 99px;
      background: rgba(255, 255, 255, 0.24);
      transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.24s ease;
    }
    .v-tip-step-dot.active {
      width: 12px;
      background: var(--accent-primary, #10b981);
    }
    body.light-mode .v-tip-step-dot,
    html.light-mode .v-tip-step-dot,
    [data-theme="light"] .v-tip-step-dot {
      background: rgba(15, 23, 42, 0.16);
    }
    body.light-mode .v-tip-step-dot.active,
    html.light-mode .v-tip-step-dot.active,
    [data-theme="light"] .v-tip-step-dot.active {
      background: var(--accent-primary, #0d9488);
    }
    .v-tip-step-count {
      font-size: 10px;
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      color: rgba(226, 232, 240, 0.52);
    }
    body.light-mode .v-tip-step-count,
    html.light-mode .v-tip-step-count,
    [data-theme="light"] .v-tip-step-count {
      color: rgba(15, 23, 42, 0.45);
    }

    .v-tip-title {
      font-family: var(--font-display, var(--font-sans, system-ui));
      font-size: 13.5px;
      font-weight: 700;
      line-height: 1.25;
      letter-spacing: -0.015em;
      margin: 0 0 4px 0;
      color: inherit;
    }
    .v-tip-body {
      font-size: 12px;
      font-weight: 450;
      line-height: 1.42;
      color: rgba(226, 232, 240, 0.78);
      margin: 0 0 11px 0;
    }
    body.light-mode .v-tip-body,
    html.light-mode .v-tip-body,
    [data-theme="light"] .v-tip-body {
      color: rgba(15, 23, 42, 0.68);
    }

    .v-tip-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .v-tip-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-left: auto;
    }
    .v-tip-skip-btn {
      background: transparent;
      border: none;
      color: rgba(203, 213, 225, 0.72);
      font-size: 12px;
      font-weight: 600;
      padding: 6px 12px;
      min-height: 36px;
      border-radius: 10px;
      cursor: pointer;
      transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
    }
    .v-tip-skip-btn:hover {
      background: rgba(255, 255, 255, 0.08);
      color: rgba(248, 250, 252, 0.95);
    }
    .v-tip-skip-btn:active {
      transform: scale(0.96);
    }
    body.light-mode .v-tip-skip-btn,
    html.light-mode .v-tip-skip-btn,
    [data-theme="light"] .v-tip-skip-btn {
      color: rgba(71, 85, 105, 0.78);
    }
    body.light-mode .v-tip-skip-btn:hover,
    html.light-mode .v-tip-skip-btn:hover,
    [data-theme="light"] .v-tip-skip-btn:hover {
      background: rgba(15, 23, 42, 0.06);
      color: #0f172a;
    }

    .v-tip-back-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      padding: 0;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: rgba(248, 250, 252, 0.84);
      cursor: pointer;
      transition: background-color 0.18s ease, transform 0.15s ease;
    }
    .v-tip-back-btn:hover {
      background: rgba(255, 255, 255, 0.14);
    }
    .v-tip-back-btn:active {
      transform: scale(0.94);
    }
    body.light-mode .v-tip-back-btn,
    html.light-mode .v-tip-back-btn,
    [data-theme="light"] .v-tip-back-btn {
      background: rgba(15, 23, 42, 0.05);
      border-color: rgba(15, 23, 42, 0.10);
      color: rgba(15, 23, 42, 0.78);
    }
    body.light-mode .v-tip-back-btn:hover,
    html.light-mode .v-tip-back-btn:hover,
    [data-theme="light"] .v-tip-back-btn:hover {
      background: rgba(15, 23, 42, 0.09);
    }

    .v-tip-next-btn {
      background: rgba(255, 255, 255, 0.14);
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.22);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: -0.005em;
      padding: 6px 14px;
      min-height: 36px;
      border-radius: 10px;
      cursor: pointer;
      transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
    }
    .v-tip-next-btn:hover {
      background: rgba(255, 255, 255, 0.22);
      border-color: rgba(255, 255, 255, 0.30);
    }
    .v-tip-next-btn:active {
      transform: scale(0.96);
    }
    body.light-mode .v-tip-next-btn,
    html.light-mode .v-tip-next-btn,
    [data-theme="light"] .v-tip-next-btn {
      background: rgba(15, 23, 42, 0.88);
      color: #ffffff;
      border-color: rgba(15, 23, 42, 0.12);
      box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.28);
    }
    body.light-mode .v-tip-next-btn:hover,
    html.light-mode .v-tip-next-btn:hover,
    [data-theme="light"] .v-tip-next-btn:hover {
      background: #0f172a;
    }

    .v-tip-arrow {
      position: absolute;
      width: 10px;
      height: 10px;
      border-radius: 2px;
      background: rgba(24, 28, 38, 0.78);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      transform: rotate(45deg);
      pointer-events: none;
      transition: left 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }
    body.light-mode .v-tip-arrow,
    html.light-mode .v-tip-arrow,
    [data-theme="light"] .v-tip-arrow {
      background: rgba(252, 253, 255, 0.88);
    }
    .v-tip-arrow.arrow-top {
      top: -5.5px;
      border-top: 1px solid rgba(255, 255, 255, 0.16);
      border-left: 1px solid rgba(255, 255, 255, 0.16);
    }
    .v-tip-arrow.arrow-bottom {
      bottom: -5.5px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.16);
      border-right: 1px solid rgba(255, 255, 255, 0.16);
    }
    body.light-mode .v-tip-arrow.arrow-top,
    html.light-mode .v-tip-arrow.arrow-top,
    [data-theme="light"] .v-tip-arrow.arrow-top {
      border-top-color: rgba(15, 23, 42, 0.10);
      border-left-color: rgba(15, 23, 42, 0.10);
    }
    body.light-mode .v-tip-arrow.arrow-bottom,
    html.light-mode .v-tip-arrow.arrow-bottom,
    [data-theme="light"] .v-tip-arrow.arrow-bottom {
      border-bottom-color: rgba(15, 23, 42, 0.10);
      border-right-color: rgba(15, 23, 42, 0.10);
    }

    @keyframes vTipTargetPulse {
      0%, 100% {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.36), 0 0 18px var(--accent-glow, rgba(16, 185, 129, 0.28));
      }
      50% {
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18), 0 0 26px var(--accent-glow, rgba(16, 185, 129, 0.42));
      }
    }
    @keyframes vTipTargetPulseLight {
      0%, 100% {
        box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.22), 0 0 16px var(--accent-glow, rgba(13, 148, 136, 0.22));
      }
      50% {
        box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.10), 0 0 24px var(--accent-glow, rgba(13, 148, 136, 0.34));
      }
    }
    .v-tip-target-ring {
      position: relative;
      z-index: 100002 !important;
      animation: vTipTargetPulse 2.6s ease-in-out infinite !important;
      transition: box-shadow 0.26s ease !important;
    }
    body.light-mode .v-tip-target-ring,
    html.light-mode .v-tip-target-ring,
    [data-theme="light"] .v-tip-target-ring {
      animation: vTipTargetPulseLight 2.6s ease-in-out infinite !important;
    }

    .feature-micro-balloon {
      position: fixed;
      z-index: 100006;
      max-width: min(232px, calc(100vw - 28px));
      padding: 9px 13px;
      border-radius: 14px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(155deg, rgba(28, 32, 42, 0.74) 0%, rgba(15, 18, 26, 0.64) 100%);
      backdrop-filter: blur(24px) saturate(185%);
      -webkit-backdrop-filter: blur(24px) saturate(185%);
      color: rgba(248, 250, 252, 0.94);
      border: 1px solid rgba(255, 255, 255, 0.16);
      box-shadow:
        0 16px 34px -10px rgba(0, 0, 0, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
      font-size: 11.5px;
      font-weight: 550;
      line-height: 1.38;
      pointer-events: auto;
      cursor: pointer;
      opacity: 0;
      transform: translate3d(0, 6px, 0) scale(0.96);
      transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .feature-micro-balloon.visible {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }
    body.light-mode .feature-micro-balloon,
    html.light-mode .feature-micro-balloon,
    [data-theme="light"] .feature-micro-balloon {
      background: linear-gradient(155deg, rgba(255, 255, 255, 0.82) 0%, rgba(244, 247, 252, 0.70) 100%);
      color: #0f172a;
      border-color: rgba(15, 23, 42, 0.10);
      box-shadow:
        0 14px 30px -10px rgba(15, 23, 42, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
    }

    body.onboarding-locked .v-tip-balloon,
    body.onboarding-locked .feature-micro-balloon,
    body.missile-lockdown-active .v-tip-balloon,
    body.missile-lockdown-active .feature-micro-balloon,
    body.pomo-fullscreen-active .v-tip-balloon,
    body.pomo-fullscreen-active .feature-micro-balloon,
    body.ritual-lockdown-active .v-tip-balloon,
    body.ritual-lockdown-active .feature-micro-balloon {
      display: none !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }

    /* Long-Press Button Action Gist Balloon (Unified Glassmorphism) */
    #global-tooltip-overlay.v-gist-balloon {
      position: fixed;
      z-index: 100010;
      width: max-content;
      max-width: min(244px, calc(100vw - 28px));
      padding: 8px 13px;
      border-radius: 14px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(155deg, rgba(28, 32, 42, 0.78) 0%, rgba(15, 18, 26, 0.68) 100%);
      backdrop-filter: blur(24px) saturate(185%);
      -webkit-backdrop-filter: blur(24px) saturate(185%);
      border: 1px solid rgba(255, 255, 255, 0.16);
      box-shadow:
        0 18px 38px -10px rgba(0, 0, 0, 0.48),
        0 4px 12px -2px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
      color: rgba(248, 250, 252, 0.95);
      font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
      font-size: 11.5px;
      font-weight: 550;
      line-height: 1.38;
      letter-spacing: -0.005em;
      text-align: left;
      white-space: normal;
      pointer-events: none;
      opacity: 0;
      transform: translate3d(0, 7px, 0) scale(0.95);
      will-change: transform, opacity;
      transition:
        opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    }
    #global-tooltip-overlay.v-gist-balloon::before {
      content: '';
      position: absolute;
      top: 0;
      left: 14px;
      right: 14px;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
      pointer-events: none;
    }
    #global-tooltip-overlay.v-gist-balloon.placement-top {
      transform: translate3d(0, -7px, 0) scale(0.95);
    }
    #global-tooltip-overlay.v-gist-balloon.visible {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }
    body.light-mode #global-tooltip-overlay.v-gist-balloon,
    html.light-mode #global-tooltip-overlay.v-gist-balloon,
    [data-theme="light"] #global-tooltip-overlay.v-gist-balloon {
      background: linear-gradient(155deg, rgba(255, 255, 255, 0.84) 0%, rgba(244, 247, 252, 0.72) 100%);
      color: #0f172a;
      border-color: rgba(15, 23, 42, 0.10);
      box-shadow:
        0 16px 34px -10px rgba(15, 23, 42, 0.16),
        0 3px 10px -2px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
    }
    body.light-mode #global-tooltip-overlay.v-gist-balloon::before,
    html.light-mode #global-tooltip-overlay.v-gist-balloon::before,
    [data-theme="light"] #global-tooltip-overlay.v-gist-balloon::before {
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98), transparent);
    }
    #global-tooltip-overlay.v-gist-balloon.force-dark-glass,
    body.light-mode #global-tooltip-overlay.v-gist-balloon.force-dark-glass,
    html.light-mode #global-tooltip-overlay.v-gist-balloon.force-dark-glass,
    [data-theme="light"] #global-tooltip-overlay.v-gist-balloon.force-dark-glass {
      background: linear-gradient(155deg, rgba(28, 32, 42, 0.84) 0%, rgba(14, 17, 24, 0.74) 100%);
      color: rgba(248, 250, 252, 0.96);
      border-color: rgba(255, 255, 255, 0.18);
      box-shadow:
        0 18px 38px -10px rgba(0, 0, 0, 0.62),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    }
    .v-gist-arrow {
      position: absolute;
      width: 9px;
      height: 9px;
      border-radius: 2px;
      background: rgba(24, 28, 38, 0.82);
      transform: rotate(45deg);
      pointer-events: none;
    }
    .v-gist-arrow.arrow-top {
      top: -5px;
      border-top: 1px solid rgba(255, 255, 255, 0.16);
      border-left: 1px solid rgba(255, 255, 255, 0.16);
    }
    .v-gist-arrow.arrow-bottom {
      bottom: -5px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.16);
      border-right: 1px solid rgba(255, 255, 255, 0.16);
    }
    body.light-mode #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow,
    html.light-mode #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow,
    [data-theme="light"] #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow {
      background: rgba(252, 253, 255, 0.90);
    }
    body.light-mode #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow.arrow-top,
    html.light-mode #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow.arrow-top,
    [data-theme="light"] #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow.arrow-top {
      border-top-color: rgba(15, 23, 42, 0.10);
      border-left-color: rgba(15, 23, 42, 0.10);
    }
    body.light-mode #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow.arrow-bottom,
    html.light-mode #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow.arrow-bottom,
    [data-theme="light"] #global-tooltip-overlay.v-gist-balloon:not(.force-dark-glass) .v-gist-arrow.arrow-bottom {
      border-bottom-color: rgba(15, 23, 42, 0.10);
      border-right-color: rgba(15, 23, 42, 0.10);
    }

    @media (prefers-reduced-motion: reduce) {
      .v-tip-balloon,
      .v-tip-inner,
      .v-tip-arrow,
      .feature-micro-balloon,
      #global-tooltip-overlay.v-gist-balloon {
        transition: opacity 0.15s ease !important;
        animation: none !important;
      }
      .v-tip-target-ring {
        animation: none !important;
      }
    }

    /* 🚀 Fix 1: Master Container Reversion */
    .settings-list-container {
      display: flex !important;
      flex-direction: column !important;
      gap: 12px !important; /* Restores the tight, cohesive grouping */
      width: 100% !important;
      padding: 4px 16px 40px 16px !important;
      box-sizing: border-box !important;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch !important;
    }

    /* 🚀 Fix 2: Sleek Pill-Shaped Cards */
    .setting-card {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important; /* Perfect vertical centering */
      padding: 16px 20px !important; /* Streamlined height */
      background: rgba(128, 128, 128, 0.08) !important;
      border: none !important;
      border-radius: 20px !important; /* The sleek pill look */
      width: 100% !important;
      box-sizing: border-box !important;
      cursor: pointer;
      transition: background 0.2s ease;
    }
    body.dark-mode .setting-card,
    html.dark .setting-card,
    [data-theme="dark"] .setting-card {
      background: rgba(30, 41, 59, 0.6) !important; /* Matches the deep slate blue from the screenshot */
    }

    /* 🚀 Fix 3: Left Axis & Icon Colors */
    .setting-left {
      display: flex !important;
      align-items: center !important;
      gap: 14px !important;
      font-size: 15px !important;
      font-weight: 600 !important;
      color: #334155 !important;
      flex-shrink: 0 !important;
      width: 45% !important; /* Secures left-side territory */
    }
    body.dark-mode .setting-left,
    html.dark .setting-left,
    [data-theme="dark"] .setting-left { color: #f8fafc !important; }

    .setting-left svg {
      width: 20px !important;
      height: 20px !important;
      fill: none;
      flex-shrink: 0 !important;
    }
    /* Recreating the exact accent colors from the screenshot */
    .icon-theme { stroke: #818cf8 !important; }      /* Indigo */
    .icon-name { stroke: #38bdf8 !important; }       /* Light Blue */
    .icon-macro { stroke: #fb7185 !important; }      /* Rose/Pink */
    .icon-sound { stroke: #a78bfa !important; }      /* Purple */
    .icon-backup { stroke: #fbbf24 !important; }     /* Amber */
    .icon-reminders { stroke: #34d399 !important; }  /* Emerald */

    /* 🚀 Fix 4: Right Axis Text Wrapping */
    .setting-right {
      display: flex !important;
      align-items: center !important;
      justify-content: flex-end !important;
      font-size: 13px !important;
      color: #64748b !important;
      text-align: left !important;
      flex-grow: 1 !important;
      word-wrap: break-word !important;
      line-height: 1.4 !important;
      gap: 6px !important;
    }
    body.dark-mode .setting-right,
    html.dark .setting-right,
    [data-theme="dark"] .setting-right { color: #94a3b8 !important; }

    .setting-right svg {
      width: 16px !important;
      height: 16px !important;
      stroke: currentColor;
      fill: none;
    }

    /* 🚀 Fix 5: Destructive Button Restoration */
    .settings-destructive-btn {
      background: rgba(225, 29, 72, 0.05) !important;
      color: #f43f5e !important;
      border: 1px solid rgba(225, 29, 72, 0.15) !important;
      border-radius: 20px !important; /* Matches cards */
      padding: 16px !important;
      font-size: 14px !important;
      font-weight: 600 !important;
      width: 100% !important;
      cursor: pointer;
      margin-top: 8px !important;
    }

    /* Keep collapsed inline expansion drawers out of flex gap flow */
    .settings-list-container .settings-expansion {
      display: none;
      background: rgba(128, 128, 128, 0.06);
      border-radius: 16px;
      margin-top: -4px;
    }
    body.dark-mode .settings-list-container .settings-expansion,
    html.dark .settings-list-container .settings-expansion,
    [data-theme="dark"] .settings-list-container .settings-expansion {
      background: rgba(255, 255, 255, 0.04);
    }
    .settings-list-container .settings-expansion.open {
      display: block;
      max-height: 420px;
      opacity: 1;
      padding: 14px 18px;
    }

    /* ==========================================================================
       PILLAR 1: NUCLEAR SCROLLBAR ERADICATOR (CSS)
       ========================================================================== */
    /* 🚀 Fix 1: Destroy Inner Scrollbars and Height Limits */
    #settings-modal .modal-content > div,
    #settings-modal .bottom-sheet > div,
    .settings-list-container,
    .settings-wrapper {
      height: auto !important;
      min-height: 100% !important;
      max-height: none !important;
      overflow: visible !important; 
      overflow-y: visible !important;
      flex: 1 1 auto !important;
    }

    /* 🚀 Fix 2: Forcefully Hide Webkit Inner Scrollbars */
    /* If the browser still tries to paint it, this makes it invisible */
    #settings-modal::-webkit-scrollbar,
    #settings-modal .modal-content::-webkit-scrollbar,
    #settings-modal .modal-content > div::-webkit-scrollbar,
    .settings-list-container::-webkit-scrollbar {
      display: none !important;
      width: 0 !important;
    }

    /* 🚀 Fix 3: Empower the Master Modal Shell */
    /* Only the outermost container is allowed to scroll, using the full screen */
    #settings-modal,
    #settings-modal .modal-content,
    #settings-modal .bottom-sheet {
      height: auto !important;
      max-height: 90vh !important; /* Expands to use almost the entire screen */
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch !important;
      padding: 8px 16px max(32px, calc(env(safe-area-inset-bottom, 16px) + 24px)) 16px !important;
      display: flex !important;
      flex-direction: column !important;
    }

    /* 🚀 Fix 6: Perfect Content Alignment */
    .setting-card {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 16px 20px !important;
      border-radius: 20px !important;
      width: 100% !important;
      box-sizing: border-box !important;
      margin-bottom: 2px !important;
    }

    .settings-destructive-btn {
      background: rgba(239, 68, 68, 0.1) !important;
      border: 1px solid rgba(239, 68, 68, 0.2) !important;
    }

    /* ==========================================================================
       MONOCHROME BLACK & WHITE GLASSMORPHISM MATRIX (PILLARS 1, 2, & 3)
       ========================================================================== */
    /* 🚀 Fix 1: Pure White Modal Shell (Light Mode) */
    #settings-modal,
    #settings-modal .modal-content,
    #settings-modal .bottom-sheet,
    #sheet-settings-menu .bottom-sheet,
    body.light-mode #settings-modal,
    body.light-mode #settings-modal .modal-content,
    body.light-mode #settings-modal .bottom-sheet,
    body.light-mode #sheet-settings-menu .bottom-sheet,
    html.light-mode #settings-modal,
    html.light-mode #settings-modal .modal-content,
    html.light-mode #settings-modal .bottom-sheet,
    html.light-mode #sheet-settings-menu .bottom-sheet,
    [data-theme="light"] #settings-modal,
    [data-theme="light"] #settings-modal .modal-content,
    [data-theme="light"] #settings-modal .bottom-sheet,
    [data-theme="light"] #sheet-settings-menu .bottom-sheet {
      background: rgba(255, 255, 255, 0.96) !important;
      backdrop-filter: blur(16px) !important;
      -webkit-backdrop-filter: blur(16px) !important;
      border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
      color: #18181b !important;
    }

    /* 🚀 Fix 2: Pure Obsidian Black Modal Shell (Dark Mode) */
    body.dark-mode #settings-modal,
    body.dark-mode #settings-modal .modal-content,
    body.dark-mode #settings-modal .bottom-sheet,
    body.dark-mode #sheet-settings-menu .bottom-sheet,
    html.dark #settings-modal,
    html.dark #settings-modal .modal-content,
    html.dark #settings-modal .bottom-sheet,
    html.dark #sheet-settings-menu .bottom-sheet,
    [data-theme="dark"] #settings-modal,
    [data-theme="dark"] #settings-modal .modal-content,
    [data-theme="dark"] #settings-modal .bottom-sheet,
    [data-theme="dark"] #sheet-settings-menu .bottom-sheet {
      background: rgba(12, 12, 14, 0.97) !important; /* True Black-based Dark */
      backdrop-filter: blur(16px) !important;
      -webkit-backdrop-filter: blur(16px) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
      color: #f4f4f5 !important;
    }

    /* Keep intermediate .modal-content inside #settings-modal transparent so only the outer shell paints */
    #settings-modal > .modal-content,
    body.dark-mode #settings-modal > .modal-content,
    html.dark #settings-modal > .modal-content,
    [data-theme="dark"] #settings-modal > .modal-content {
      background: transparent !important;
      background-color: transparent !important;
      border: none !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      padding: 0 !important;
      max-height: none !important;
      overflow: visible !important;
      overflow-y: visible !important;
    }

    /* 🚀 Fix 3: Neutralize Settings Heading (Remove Blue Tint/Gradient) */
    #settings-modal h2,
    #settings-modal h3,
    #settings-modal .modal-header h2,
    #settings-modal .modal-header h3 {
      background: none !important;
      -webkit-background-clip: unset !important;
      -webkit-text-fill-color: currentColor !important;
      color: #18181b !important;
    }
    body.dark-mode #settings-modal h2,
    body.dark-mode #settings-modal h3,
    body.dark-mode #settings-modal .modal-header h2,
    body.dark-mode #settings-modal .modal-header h3,
    html.dark #settings-modal h2,
    html.dark #settings-modal h3,
    [data-theme="dark"] #settings-modal h2,
    [data-theme="dark"] #settings-modal h3 {
      color: #ffffff !important;
    }

    /* 🚀 Fix 4: Crisp White Glass Cards (Light Mode) */
    .setting-card {
      background: rgba(255, 255, 255, 0.78) !important;
      border: 1px solid rgba(0, 0, 0, 0.06) !important;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
      transition: background 0.2s ease, border-color 0.2s ease !important;
    }
    .setting-card:hover {
      background: rgba(255, 255, 255, 0.95) !important;
      border-color: rgba(0, 0, 0, 0.1) !important;
    }

    /* 🚀 Fix 5: Obsidian Black Glass Cards (Dark Mode - Zero Blue) */
    body.dark-mode .setting-card,
    html.dark .setting-card,
    [data-theme="dark"] .setting-card {
      background: rgba(255, 255, 255, 0.04) !important; /* Pure neutral dark translucency */
      border: 1px solid rgba(255, 255, 255, 0.07) !important;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    }
    body.dark-mode .setting-card:hover,
    html.dark .setting-card:hover,
    [data-theme="dark"] .setting-card:hover {
      background: rgba(255, 255, 255, 0.08) !important;
      border-color: rgba(255, 255, 255, 0.12) !important;
    }

    /* 🚀 Fix 6: Neutral Typography (Left Labels) */
    .setting-left {
      font-family: inherit !important;
      font-size: 15px !important;
      color: #18181b !important;
      font-weight: 500 !important;
    }
    body.dark-mode .setting-left,
    html.dark .setting-left,
    [data-theme="dark"] .setting-left {
      color: #f4f4f5 !important;
    }

    /* 🚀 Fix 7: Neutral Typography (Right Values & Carets) */
    .setting-right {
      font-family: inherit !important;
      font-size: 14px !important;
      color: #71717a !important; /* Neutral Medium Gray */
    }
    body.dark-mode .setting-right,
    html.dark .setting-right,
    [data-theme="dark"] .setting-right {
      color: #a1a1aa !important; /* Neutral Light Gray */
    }

    /* ==========================================================================
       SETTINGS POLISH & INPUT GHOSTING MATRIX (PILLARS 1 & 2)
       ========================================================================== */
    /* 🚀 Fix 1: Bump Base Value Contrast */
    .setting-right {
      color: #52525b !important; /* Zinc 600 - Darker, punchier gray */
      font-weight: 500 !important;
    }
    body.dark-mode .setting-right,
    html.dark .setting-right,
    [data-theme="dark"] .setting-right {
      color: #d4d4d8 !important; /* Zinc 300 */
    }

    /* 🚀 Fix 2: Clean Inline Inputs Inside Settings (Scoped, Left-Aligned, Visible Focus) */
    #settings-modal .inline-input-wrapper input,
    #settings-modal .inline-input-wrapper textarea,
    #inline-name-input,
    #inline-macro-input {
      display: block;
      width: 100%;
      box-sizing: border-box;
      text-align: left;
      font-family: inherit;
      font-size: 14px;
      font-weight: 500;
      padding: 11px 14px;
      border-radius: 12px;
      background: #F8FAFC;
      border: 1px solid rgba(15, 23, 42, 0.14);
      color: #18181b;
      outline: none;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }

    body.dark-mode #settings-modal .inline-input-wrapper input,
    body.dark-mode #settings-modal .inline-input-wrapper textarea,
    body.dark-mode #inline-name-input,
    body.dark-mode #inline-macro-input,
    html.dark #settings-modal .inline-input-wrapper input,
    html.dark #settings-modal .inline-input-wrapper textarea,
    html.dark #inline-name-input,
    html.dark #inline-macro-input,
    [data-theme="dark"] #settings-modal .inline-input-wrapper input,
    [data-theme="dark"] #settings-modal .inline-input-wrapper textarea,
    [data-theme="dark"] #inline-name-input,
    [data-theme="dark"] #inline-macro-input {
      background: #1C202B;
      border-color: rgba(255, 255, 255, 0.16);
      color: #f4f4f5;
    }

    #settings-modal .inline-input-wrapper input:focus,
    #settings-modal .inline-input-wrapper textarea:focus,
    #inline-name-input:focus,
    #inline-macro-input:focus {
      border-color: var(--accent-primary, #0d9488);
      box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
      background: #FFFFFF;
    }

    body.dark-mode #settings-modal .inline-input-wrapper input:focus,
    body.dark-mode #settings-modal .inline-input-wrapper textarea:focus,
    body.dark-mode #inline-name-input:focus,
    body.dark-mode #inline-macro-input:focus,
    html.dark #settings-modal .inline-input-wrapper input:focus,
    html.dark #settings-modal .inline-input-wrapper textarea:focus,
    html.dark #inline-name-input:focus,
    html.dark #inline-macro-input:focus,
    [data-theme="dark"] #settings-modal .inline-input-wrapper input:focus,
    [data-theme="dark"] #settings-modal .inline-input-wrapper textarea:focus,
    [data-theme="dark"] #inline-name-input:focus,
    [data-theme="dark"] #inline-macro-input:focus {
      background: #222734;
      border-color: #2DD4BF;
      box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
    }

    /* Keep only bare inline value inputs inside .setting-right borderless */
    .setting-right > input[type="number"],
    .setting-right > input.inline-value-input {
      background: transparent;
      border: none;
      outline: none;
      box-shadow: none;
      color: #18181b;
      font-family: inherit;
      font-size: 14px;
      font-weight: 600;
      text-align: right;
      padding: 0;
      margin: 0;
      width: 100%;
    }

    body.dark-mode .setting-right > input[type="number"],
    body.dark-mode .setting-right > input.inline-value-input,
    html.dark .setting-right > input[type="number"],
    html.dark .setting-right > input.inline-value-input,
    [data-theme="dark"] .setting-right > input[type="number"],
    [data-theme="dark"] .setting-right > input.inline-value-input {
      color: #ffffff;
    }

    /* 🚀 Fix 4: Vibrant Sun (Light Mode) */
    #theme-display svg {
      stroke: #f59e0b !important; /* Vibrant Amber */
      fill: rgba(245, 158, 11, 0.2) !important;
    }

    /* 🚀 Fix 5: Vibrant Moon/Stars (Dark Mode) */
    body.dark-mode #theme-display svg,
    html.dark #theme-display svg,
    [data-theme="dark"] #theme-display svg {
      stroke: #a78bfa !important; /* Vibrant Purple */
      fill: rgba(167, 139, 250, 0.2) !important;
    }

    /* ==========================================================================
       TYPOGRAPHY CONTRAST IN SETTINGS ROWS
       ========================================================================== */
    .setting-right,
    .setting-right span,
    #name-display,
    #macro-goal-display {
      color: #18181b !important; /* Solid Obsidian */
      font-weight: 600 !important;
    }

    body.dark-mode .setting-right,
    body.dark-mode .setting-right span,
    body.dark-mode #name-display,
    body.dark-mode #macro-goal-display,
    html.dark .setting-right,
    html.dark .setting-right span,
    html.dark #name-display,
    html.dark #macro-goal-display,
    [data-theme="dark"] .setting-right,
    [data-theme="dark"] .setting-right span,
    [data-theme="dark"] #name-display,
    [data-theme="dark"] #macro-goal-display {
      color: #ffffff !important; /* Pure White */
    }

    /* Neutralize legacy #macro-goal-display banner box/border rules in Light & Dark modes */
    #macro-goal-display,
    #name-display,
    body.light-mode #macro-goal-display,
    body.light-mode #name-display,
    body.dark-mode #macro-goal-display,
    body.dark-mode #name-display,
    [data-theme="light"] #macro-goal-display,
    [data-theme="dark"] #macro-goal-display {
      background: transparent !important;
      background-color: transparent !important;
      border: none !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      border-radius: 0 !important;
    }

    /* ============================================================================
       VIRTUAL KEYBOARD EVASION MATRIX — PILLAR 1: SCROLL BEHAVIOR ENGINE (CSS)
       ============================================================================ */
    /* 🚀 Fix 1: Smooth Scroll & Padding Transition Prep */
    #date-picker-modal .modal-content,
    #date-picker-modal .bottom-sheet,
    .date-picker-container,
    #sheet-date-repeat-picker .bottom-sheet {
      scroll-behavior: smooth !important;
      transition: padding-bottom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
      overflow-y: auto !important;
    }

    /* ============================================================================
       SCROLL-FADE STABILIZATION MATRIX — PILLAR 1: HARDWARE-ACCELERATED FADE ENGINE (CSS)
       ============================================================================ */
    /* 🚀 Fix 1: Unified Silky Fade + Height Choreography (No blur churn or border-width snap) */
    #macro-goal-banner,
    .macro-goal-banner,
    .macro-banner-container,
    .macro-goal-wrapper,
    #macro-banner {
      transform-origin: 50% 0%;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                  transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
                  height 0.44s cubic-bezier(0.16, 1, 0.3, 1),
                  min-height 0.44s cubic-bezier(0.16, 1, 0.3, 1),
                  max-height 0.44s cubic-bezier(0.16, 1, 0.3, 1),
                  margin-top 0.44s cubic-bezier(0.16, 1, 0.3, 1),
                  margin-bottom 0.44s cubic-bezier(0.16, 1, 0.3, 1),
                  border-color 0.24s ease,
                  box-shadow 0.28s ease !important;
      will-change: opacity, transform, height, margin !important;
    }

    /* 🚀 Fix 2: Smooth Choreographed Scrolled / Dismissed State (No Layout Snap) */
    #macro-goal-banner.macro-banner-scrolled,
    #macro-goal-banner.hidden,
    .macro-banner-scrolled {
      opacity: 0 !important;
      height: 0 !important;
      min-height: 0 !important;
      max-height: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      border-color: transparent !important;
      box-shadow: none !important;
      overflow: hidden !important;
      transform: translate3d(0, -10px, 0) scale(0.982) !important;
      pointer-events: none !important;
      animation: none !important;
    }
    #macro-goal-banner.macro-banner-scrolled .macro-content,
    #macro-goal-banner.hidden .macro-content {
      opacity: 0 !important;
      transform: translate3d(0, -6px, 0) !important;
    }
    #macro-goal-banner.macro-banner-scrolled .macro-accent-bar,
    #macro-goal-banner.hidden .macro-accent-bar {
      opacity: 0 !important;
    }
    @media (prefers-reduced-motion: reduce) {
      #macro-goal-banner,
      .macro-goal-banner,
      #macro-goal-banner .macro-content,
      #macro-goal-banner .macro-accent-bar {
        transition: opacity 0.16s ease !important;
      }
    }

    /* ============================================================================
       APP-WIDE EXIT CHOREOGRAPHY MATRIX — PILLAR 1: EXIT CHOREOGRAPHY ENGINE (CSS)
       ============================================================================ */
    /* 🚀 Fix 1: Modal Scale-Out Animation */
    @keyframes scaleOut {
      0% { opacity: 1; transform: scale(1) translateY(0); }
      100% { opacity: 0; transform: scale(0.96) translateY(10px); }
    }

    /* 🚀 Fix 2: Bottom Sheet Slide-Down Animation */
    @keyframes slideDownOut {
      0% { opacity: 1; transform: translateY(0); }
      100% { opacity: 0; transform: translateY(100%); }
    }

    /* 🚀 Fix 3: Universal Fade-Out (Overlays & Menus) */
    @keyframes fadeOutFast {
      0% { opacity: 1; }
      100% { opacity: 0; }
    }

    /* 🚀 Fix 4: The Closing State Classes */
    /* When JS applies these classes, the element animates out gracefully */
    .modal-closing {
      animation: fadeOutFast 0.25s ease forwards !important;
      pointer-events: none !important;
    }
    .modal-closing .modal-content,
    .modal-closing > div:not(.overlay) {
      animation: scaleOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    }
    .modal-closing.bottom-sheet,
    .modal-closing .bottom-sheet,
    .modal-closing .bottom-sheet-content {
      animation: slideDownOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    }
    .menu-closing {
      animation: fadeOutFast 0.2s ease forwards !important;
      pointer-events: none !important;
    }

    /* ============================================================================
       UNIVERSAL DROPDOWN SYNCHRONIZATION MATRIX — PILLAR 1: MENU GEOMETRY (CSS)
       ============================================================================ */
    /* 🚀 Fix 1: Menu Entrance Animation */
    @keyframes menuScaleIn {
      0% { opacity: 0; transform: scale(0.95) translateY(-5px); }
      100% { opacity: 1; transform: scale(1) translateY(0); }
    }

    /* 🚀 Fix 2: Universal Dropdown Container */
    .dropdown-menu, 
    .inline-sub-menu {
      background: rgba(255, 255, 255, 0.96) !important;
      border: 1px solid rgba(0, 0, 0, 0.06) !important;
      border-radius: 16px !important;
      padding: 8px !important;
      min-width: 220px !important;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
      
      /* Animation Bind */
      transform-origin: top right;
      animation: menuScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
      z-index: 100 !important;
    }

    /* Dark Mode Dropdown Shell */
    body.dark-mode .dropdown-menu,
    body.dark-mode .inline-sub-menu {
      background: rgba(12, 12, 14, 0.96) !important; /* Pure Obsidian */
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    }

    /* 🚀 Fix 3: Universal Dropdown Items (Matches To-Do Exact Layout) */
    .dropdown-item {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 14px 16px !important;
      margin-bottom: 2px !important;
      font-size: 15px !important;
      font-weight: 600 !important;
      color: #18181b !important;
      border-radius: 12px !important;
      cursor: pointer;
      transition: background 0.2s ease !important;
    }
    body.dark-mode .dropdown-item { color: #f4f4f5 !important; }

    .dropdown-item:hover { background: rgba(0, 0, 0, 0.04) !important; }
    body.dark-mode .dropdown-item:hover { background: rgba(255, 255, 255, 0.06) !important; }

    /* 🚀 Fix 4: Right-Aligned Icons & Values */
    .dropdown-item svg {
      width: 18px !important;
      height: 18px !important;
      stroke: #71717a !important;
    }
    body.dark-mode .dropdown-item svg { stroke: #a1a1aa !important; }

    .dropdown-item .active-value {
      color: var(--primary-color, #0d9488) !important;
      font-size: 13px !important;
      font-weight: 700 !important;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .notes-header {
      position: relative;
    }
    .notes-header .dropdown {
      position: relative;
    }

    /* ============================================================================
       NOTES MENU INTERACTION & STATE MATRIX — PILLAR 1: SUB-MENU & ACTIVE BUTTON
       ============================================================================ */
    /* 🚀 Fix 1: Active State for 3-Dot Trigger Button */
    .three-dot-btn.active-section,
    #notes-menu-btn.active-section {
      background: var(--primary-color, #0d9488) !important;
      color: #ffffff !important;
      border-color: var(--primary-color, #0d9488) !important;
    }
    .three-dot-btn.active-section svg,
    #notes-menu-btn.active-section svg {
      stroke: #ffffff !important;
    }

    /* 🚀 Fix 2: Nested View Options Container */
    .dropdown-sub-menu-container {
      display: none;
      flex-direction: column;
      padding-left: 12px;
      margin: 4px 0 8px 0;
      border-left: 2px solid rgba(13, 148, 136, 0.3);
    }
    .dropdown-sub-item {
      padding: 10px 14px !important;
      font-size: 14px !important;
      font-weight: 500 !important;
      color: #71717a !important;
      border-radius: 8px !important;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    body.dark-mode .dropdown-sub-item { color: #a1a1aa !important; }
    .dropdown-sub-item:hover {
      background: rgba(0, 0, 0, 0.04) !important;
      color: #18181b !important;
    }
    body.dark-mode .dropdown-sub-item:hover {
      background: rgba(255, 255, 255, 0.06) !important;
      color: #ffffff !important;
    }
    .dropdown-sub-item.selected {
      color: var(--primary-color, #0d9488) !important;
      font-weight: 700 !important;
    }

    /* ============================================================================
       NOTES DROPDOWN SYMMETRY & STATE CORRECTION — PILLAR 1: CSS
       ============================================================================ */
    /* 🚀 Fix 1: Match To-Do 3-Dot Button Geometry (38px Soft-Rounded Square, Neutral) */
    .three-dot-btn,
    #notes-menu-btn,
    #btn-todo-three-dot,
    #todo-menu-btn {
      width: 38px !important;
      height: 38px !important;
      border-radius: 12px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      background: rgba(0, 0, 0, 0.04) !important;
      border: none !important;
      color: var(--text-primary, #18181b) !important;
      cursor: pointer;
      transition: background 0.2s ease, transform 0.1s ease !important;
    }
    body.dark-mode .three-dot-btn,
    body.dark-mode #notes-menu-btn,
    body.dark-mode #btn-todo-three-dot,
    body.dark-mode #todo-menu-btn {
      background: rgba(255, 255, 255, 0.08) !important;
      color: var(--text-primary, #f4f4f5) !important;
    }

    .three-dot-btn:active,
    #notes-menu-btn:active {
      transform: scale(0.92) !important;
    }

    /* 🚀 Fix 2: Dropdown Item Typography & Spacing */
    .dropdown-menu .dropdown-item {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      padding: 12px 16px !important;
      font-size: 15px !important;
      font-weight: 500 !important;
      color: #18181b !important;
      border-radius: 10px !important;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease !important;
    }
    body.dark-mode .dropdown-menu .dropdown-item {
      color: #f4f4f5 !important;
    }

    .dropdown-menu .dropdown-item:hover {
      background: rgba(0, 0, 0, 0.04) !important;
    }
    body.dark-mode .dropdown-menu .dropdown-item:hover {
      background: rgba(255, 255, 255, 0.06) !important;
    }

    /* 🚀 Fix 3: Active State for Menu Items (Archived / Bin) - Green Accent */
    .dropdown-menu .dropdown-item.section-active,
    .dropdown-menu .dropdown-item.section-active span {
      color: var(--primary-color, #0d9488) !important;
      font-weight: 600 !important;
    }
    .dropdown-menu .dropdown-item.section-active svg {
      stroke: var(--primary-color, #0d9488) !important;
    }

    /* ============================================================================
       NOTES 3-DOT DROPDOWN & SUB-MENU — EXACT PARITY WITH TO-DO 3-DOT MENU
       ============================================================================ */
    #notes-dropdown.three-dot-dropdown {
      position: absolute !important;
      top: 46px !important;
      right: 0 !important;
      min-width: 236px !important;
      background: var(--bg-surface) !important;
      border: 1px solid var(--border-strong) !important;
      border-radius: var(--squircle-sm) !important;
      box-shadow: var(--shadow-float) !important;
      padding: 6px !important;
      z-index: 60 !important;
      display: none;
      flex-direction: column;
      gap: 4px;
      transform-origin: top right;
      animation: paneEnter 0.2s var(--spring-fluid);
    }
    #notes-dropdown.three-dot-dropdown.open {
      display: flex !important;
    }
    #notes-dropdown.three-dot-dropdown > .menu-item {
      padding: 14px 20px !important;
      font-size: 14px !important;
      font-weight: 600 !important;
      color: var(--text-primary) !important;
      border-radius: 12px !important;
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      cursor: pointer !important;
      transition: background 0.2s ease, color 0.2s ease !important;
    }
    #notes-dropdown.three-dot-dropdown > .menu-item:hover {
      background: rgba(13, 148, 136, 0.08) !important;
    }
    body.dark-mode #notes-dropdown.three-dot-dropdown > .menu-item:hover,
    html.dark #notes-dropdown.three-dot-dropdown > .menu-item:hover,
    [data-theme="dark"] #notes-dropdown.three-dot-dropdown > .menu-item:hover {
      background: rgba(255, 255, 255, 0.05) !important;
    }
    #notes-view-indicator {
      color: var(--primary-color, #0d9488) !important;
      font-size: 12px !important;
      font-weight: 600 !important;
      opacity: 1 !important;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    body.dark-mode #notes-view-indicator,
    html.dark #notes-view-indicator,
    [data-theme="dark"] #notes-view-indicator {
      color: #2dd4bf !important;
    }
    #notes-dropdown.three-dot-dropdown > .menu-item.section-active,
    #notes-dropdown.three-dot-dropdown > .menu-item.section-active span {
      color: var(--primary-color, #0d9488) !important;
      font-weight: 700 !important;
    }
    body.dark-mode #notes-dropdown.three-dot-dropdown > .menu-item.section-active,
    body.dark-mode #notes-dropdown.three-dot-dropdown > .menu-item.section-active span,
    html.dark #notes-dropdown.three-dot-dropdown > .menu-item.section-active,
    html.dark #notes-dropdown.three-dot-dropdown > .menu-item.section-active span,
    [data-theme="dark"] #notes-dropdown.three-dot-dropdown > .menu-item.section-active,
    [data-theme="dark"] #notes-dropdown.three-dot-dropdown > .menu-item.section-active span {
      color: #2dd4bf !important;
    }
    #notes-dropdown.three-dot-dropdown > .menu-item.section-active svg {
      stroke: var(--primary-color, #0d9488) !important;
      opacity: 1 !important;
    }
    body.dark-mode #notes-dropdown.three-dot-dropdown > .menu-item.section-active svg,
    html.dark #notes-dropdown.three-dot-dropdown > .menu-item.section-active svg,
    [data-theme="dark"] #notes-dropdown.three-dot-dropdown > .menu-item.section-active svg {
      stroke: #2dd4bf !important;
    }
    #notes-view-sub-options {
      border-left: none !important;
      margin-left: 0 !important;
      padding-left: 8px !important;
    }
    #notes-view-sub-options .menu-item.notes-sub-option {
      display: flex !important;
      align-items: center !important;
      justify-content: flex-start !important;
      gap: 12px !important;
      padding: 12px 16px !important;
      font-size: 13px !important;
      font-weight: 700 !important;
      color: #334155 !important;
      border-radius: 9px !important;
      cursor: pointer !important;
      transition: background 0.2s ease, color 0.2s ease !important;
    }
    body.dark-mode #notes-view-sub-options .menu-item.notes-sub-option,
    html.dark #notes-view-sub-options .menu-item.notes-sub-option,
    [data-theme="dark"] #notes-view-sub-options .menu-item.notes-sub-option {
      color: #e2e8f0 !important;
    }
    #notes-view-sub-options .menu-item.notes-sub-option:hover {
      background: rgba(0, 0, 0, 0.04) !important;
    }
    body.dark-mode #notes-view-sub-options .menu-item.notes-sub-option:hover,
    html.dark #notes-view-sub-options .menu-item.notes-sub-option:hover,
    [data-theme="dark"] #notes-view-sub-options .menu-item.notes-sub-option:hover {
      background: rgba(255, 255, 255, 0.06) !important;
    }
    #notes-view-sub-options .menu-item.notes-sub-option.selected,
    #notes-view-sub-options .menu-item.notes-sub-option.active-view {
      color: var(--primary-color, #0d9488) !important;
    }
    body.dark-mode #notes-view-sub-options .menu-item.notes-sub-option.selected,
    body.dark-mode #notes-view-sub-options .menu-item.notes-sub-option.active-view,
    html.dark #notes-view-sub-options .menu-item.notes-sub-option.selected,
    html.dark #notes-view-sub-options .menu-item.notes-sub-option.active-view,
    [data-theme="dark"] #notes-view-sub-options .menu-item.notes-sub-option.selected,
    [data-theme="dark"] #notes-view-sub-options .menu-item.notes-sub-option.active-view {
      color: #2dd4bf !important;
    }
