    /* Global Surface Variables (Light Theme — 60fps Mobile Optimized, No Heavy Blur) */
    :root {
      --glass-bg: rgba(255, 255, 255, 0.96);
      --glass-border: rgba(15, 23, 42, 0.1);
      --glass-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
      --glass-blur: none;
      --app-base-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }

    /* Global Surface Variables (Dark Theme — True Obsidian Depth) */
    body.dark-mode,
    html.dark,
    [data-theme="dark"] {
      --glass-bg: rgba(14, 14, 18, 0.96);
      --glass-border: rgba(255, 255, 255, 0.09);
      --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
      --glass-blur: none;
      --app-base-bg: linear-gradient(135deg, #09090b 0%, #171717 100%);
    }

    html, body {
      background: var(--app-base-bg) !important;
    }

    :root {
      /* 
      ====================================================
         🛠️ EDIT YOUR ANIMATION TIMING HERE (CSS) 🛠️
      ==================================================== 
      */

      /* SPED UP: Was 1.5s, now 0.9s */
      --drop-time: 0.9s;       

      /* SPED UP: The vacuum closes faster */
      --gap-close-time: 0.7s;  
      --gap-close-delay: 0.2s; 

      /* SPED UP: Unchecking flies up faster */
      --rise-time: 0.9s; 
    }

    /* ==========================================================================
       1. DESIGN TOKENS, CONTEXTUAL PALETTES & FLUID SPRING PHYSICS
       ========================================================================== */
    :root {
      --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'JetBrains Mono', monospace;

      --spring-fluid: cubic-bezier(0.175, 0.885, 0.32, 1.275);
      --spring-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
      --spring-liquid: cubic-bezier(0.175, 0.885, 0.32, 1.275);

      --squircle-xs: 12px;
      --squircle-sm: 16px;
      --squircle-md: 22px;
      --squircle-lg: 28px;
      --squircle-xl: 34px;
      --radius-card: 26px;

      /* Priority Semantic Accents */
      --prio-high: #EF4444;
      --prio-mid: #F97316;
      --prio-low: #3B82F6;
      --prio-none: #64748B;

      /* 5-Tier Mood Surface Colors (Light Mode) */
      --mood-radiant-bg: #D1FAE5;
      --mood-radiant-border: #10B981;
      --mood-radiant-text: #064E3B;

      --mood-good-bg: #E0F2FE;
      --mood-good-border: #0EA5E9;
      --mood-good-text: #0C4A6E;

      --mood-balanced-bg: #EDE9FE;
      --mood-balanced-border: #8B5CF6;
      --mood-balanced-text: #3B0764;

      --mood-challenging-bg: #FEF3C7;
      --mood-challenging-border: #F59E0B;
      --mood-challenging-text: #78350F;

      --mood-exhausting-bg: #FFE4E6;
      --mood-exhausting-border: #F43F5E;
      --mood-exhausting-text: #881337;

      /* LIGHT THEME BASE: Premium "Warm Bone" E-Ink (#F9F8F6) & Soft Charcoal (#1A1A1A) */
      --bg-canvas: #F9F8F6;
      --bg-surface: #FFFFFF;
      --surface-color: var(--bg-surface);
      --bg-elevated: #EFECE6;
      --surface-variant: var(--bg-elevated);
      --bg-glass: rgba(249, 248, 246, 0.96);
      --text-primary: #1A1A1A;
      --text-color: var(--text-primary);
      --text-secondary: #4A4843;
      --text-muted: #78756E;
      --border-subtle: rgba(26, 26, 26, 0.08);
      --border-strong: rgba(26, 26, 26, 0.16);
      --accent-primary: #0D9488;
      --primary-accent: var(--accent-primary);
      --primary-color: var(--accent-primary);
      --accent-secondary: #0F766E;
      --accent-contrast: #FFFFFF;
      --accent-glow: rgba(13, 148, 136, 0.22);
      --shadow-soft: 0 10px 30px -8px rgba(26, 26, 26, 0.06), 0 2px 6px -1px rgba(26, 26, 26, 0.04);
      --shadow-float: 0 22px 48px -12px rgba(26, 26, 26, 0.18);
      --watermark-opacity: 0.035;
    }

    html.dark,
    [data-theme="dark"],
    body.dark-mode {
      /* DARK MODE BASE: Absolute "OLED Abyss" (#000000) & Crisp Off-White (#EAEAEA) */
      --bg-canvas: #000000;
      --bg-surface: #0D0D0F;
      --surface-color: var(--bg-surface);
      --bg-elevated: #17171A;
      --surface-variant: var(--bg-elevated);
      --bg-glass: rgba(9, 9, 11, 0.96);
      --text-primary: #EAEAEA;
      --text-color: var(--text-primary);
      --text-secondary: #B8B8C2;
      --text-muted: #7E7E8A;
      --border-subtle: rgba(234, 234, 234, 0.09);
      --border-strong: rgba(234, 234, 234, 0.18);
      --accent-primary: #2DD4BF;
      --primary-accent: var(--accent-primary);
      --primary-color: var(--accent-primary);
      --accent-secondary: #14B8A6;
      --accent-contrast: #041513;
      --accent-glow: rgba(45, 212, 191, 0.28);
      --prio-none: #A1A1AA;
      --shadow-soft: 0 12px 32px -8px rgba(0, 0, 0, 0.75), 0 2px 6px -1px rgba(0, 0, 0, 0.55);
      --shadow-float: 0 26px 58px -10px rgba(0, 0, 0, 0.92);
      --watermark-opacity: 0.04;

      /* 5-Tier Mood Surface Colors (Dark Mode — Rich Atmospheric Tints) */
      --mood-radiant-bg: #0A201B;
      --mood-radiant-border: #10B981;
      --mood-radiant-text: #EAEAEA;

      --mood-good-bg: #0B1D2C;
      --mood-good-border: #38BDF8;
      --mood-good-text: #EAEAEA;

      --mood-balanced-bg: #18122B;
      --mood-balanced-border: #A78BFA;
      --mood-balanced-text: #EAEAEA;

      --mood-challenging-bg: #26190A;
      --mood-challenging-border: #F59E0B;
      --mood-challenging-text: #EAEAEA;

      --mood-exhausting-bg: #290E17;
      --mood-exhausting-border: #FB7185;
      --mood-exhausting-text: #EAEAEA;
    }

    /* MISSILE MODE SUB-VIEW — Seamless Zero-Box Pre-Launch & True Fullscreen Theme Takeover */
    #missile-arena {
      --m-bg: transparent;
      --m-text: #111827;
      --m-muted: #6B7280;
      --m-track: rgba(17, 24, 39, 0.12);
      --m-border: transparent;
      --m-surface: transparent;
      --m-btn-bg: #111827;
      --m-btn-text: #FFFFFF;
      background: transparent !important;
      color: var(--m-text);
      border-radius: 0 !important;
      border: none !important;
      box-shadow: none !important;
      margin: 0 !important;
      padding: 8px 0 0 0 !important;
      width: 100% !important;
      max-width: none !important;
      min-height: 0 !important;
      transition: background-color 0.3s var(--spring-fluid), color 0.3s var(--spring-fluid);
    }
    html.dark #missile-arena {
      --m-bg: transparent;
      --m-text: #FFFFFF;
      --m-muted: #9CA3AF;
      --m-track: rgba(255, 255, 255, 0.14);
      --m-border: transparent;
      --m-surface: transparent;
      --m-btn-bg: #FFFFFF;
      --m-btn-text: #000000;
    }

    /* Missile Mode Breathing Timer & Rocket Icon Animations */
    @keyframes missileBreathe {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.045); opacity: 0.84; }
    }
    .missile-breathing {
      animation: missileBreathe 3.2s ease-in-out infinite;
    }
    @keyframes rocketIgnite {
      0% { transform: translateY(8px) scale(0.85); opacity: 0.5; }
      45% { transform: translateY(-10px) scale(1.18) rotate(-8deg); opacity: 1; }
      75% { transform: translateY(-4px) scale(1.06) rotate(5deg); }
      100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
    }
    @keyframes rocketOrbitComplete {
      0% { transform: scale(1) translateY(0); }
      35% { transform: scale(1.32) translateY(-18px) rotate(-12deg); }
      70% { transform: scale(0.92) translateY(4px) rotate(8deg); }
      100% { transform: scale(1) translateY(0) rotate(0deg); }
    }
    .rocket-icon-wrap {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: auto;
      height: auto;
      border-radius: 0;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      color: var(--m-text);
      margin: 0 0 4px 0;
      transition: transform 0.35s var(--spring-bounce);
    }
    .rocket-icon-wrap.launching {
      animation: rocketIgnite 0.85s var(--spring-bounce);
    }
    .rocket-icon-wrap.completed-flight {
      animation: rocketOrbitComplete 1.1s var(--spring-bounce);
    }

    /* Full-Screen 1.5s Splash Screen Overlay */
    #splash-screen {
      position: fixed;
      inset: 0;
      z-index: 9999;
      background-color: var(--bg-canvas);
      color: var(--text-primary);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      user-select: none;
      opacity: 1;
      transition: opacity 0.48s var(--spring-fluid), transform 0.52s var(--spring-fluid);
    }
    #splash-screen.splash-hide {
      opacity: 0;
      transform: scale(1.03);
      pointer-events: none;
    }
    html.skip-splash-instant #splash-screen {
      display: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
      transition: none !important;
    }
    .splash-emblem {
      width: 66px;
      height: 66px;
      border-radius: 20px;
      background: var(--accent-glow);
      border: 1.5px solid var(--accent-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent-primary);
      box-shadow: 0 16px 36px var(--accent-glow);
    }
    .splash-title {
      font-family: var(--font-display);
      font-size: 32px;
      font-weight: 800;
      letter-spacing: 0.18em;
      text-indent: 0.18em;
    }
    .splash-sub {
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.14em;
      color: var(--accent-primary);
      text-transform: uppercase;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      -webkit-user-select: none;
    }

    input, textarea, [contenteditable="true"] {
      user-select: auto;
      -webkit-user-select: auto;
    }

    html, body {
      width: 100vw;
      height: 100dvh;
      margin: 0;
      padding: 0 0 env(safe-area-inset-bottom, 24px) 0;
      overflow: hidden;
      -webkit-text-size-adjust: 100%;
      overscroll-behavior: none;
      background-color: var(--bg-canvas);
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: 16px;
      line-height: 1.5;
      transition: background-color 0.42s var(--spring-fluid), color 0.35s var(--spring-fluid);
      -webkit-font-smoothing: antialiased;
    }

    .tabular-nums {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums;
    }

    button, input, textarea, select {
      font: inherit;
      color: inherit;
      background: none;
      border: none;
      outline: none;
    }

    .tap-spring {
      transition: transform 0.22s var(--spring-fluid), background-color 0.25s var(--spring-fluid), border-color 0.25s var(--spring-fluid), box-shadow 0.25s var(--spring-fluid), opacity 0.22s var(--spring-fluid);
      cursor: pointer;
      user-select: none;
    }
    .tap-spring:active {
      transform: scale(0.95);
    }

    /* ==========================================================================
       2. SUBTLE ABSTRACT TAB WATERMARKS & ONE-TIME FLOATING BUBBLE GUIDES
       ========================================================================== */
    .tab-watermark {
      position: fixed;
      right: -40px;
      bottom: 60px;
      width: 420px;
      height: 420px;
      pointer-events: none;
      z-index: 0;
      opacity: var(--watermark-opacity);
      color: var(--text-primary);
      transition: opacity 0.4s var(--spring-fluid), transform 0.6s var(--spring-fluid);
    }
    body.missile-lockdown .tab-watermark {
      display: none !important;
    }


    /* ==========================================================================
       3. ONBOARDING & INITIATION (App-Wide Glassmorphic Cinematic Flow)
       ========================================================================== */
    body.onboarding-locked .app-shell,
    body.onboarding-locked .bottom-nav,
    body.onboarding-locked #macro-anchor-bar,
    body.onboarding-locked .fab-cluster,
    body.onboarding-locked .tab-watermark {
      display: none !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }

    @keyframes onboardOrbDriftA {
      0%   { transform: translate3d(-6%, -4%, 0) scale(1); opacity: 0.72; }
      50%  { transform: translate3d(8%, 6%, 0) scale(1.12); opacity: 0.92; }
      100% { transform: translate3d(-2%, 10%, 0) scale(0.96); opacity: 0.78; }
    }
    @keyframes onboardOrbDriftB {
      0%   { transform: translate3d(6%, 8%, 0) scale(1.04); opacity: 0.64; }
      50%  { transform: translate3d(-9%, -5%, 0) scale(0.94); opacity: 0.88; }
      100% { transform: translate3d(4%, -9%, 0) scale(1.08); opacity: 0.7; }
    }
    @keyframes onboardOrbDriftC {
      0%   { transform: translate3d(0%, 0%, 0) scale(0.95); opacity: 0.45; }
      50%  { transform: translate3d(-6%, 5%, 0) scale(1.1); opacity: 0.72; }
      100% { transform: translate3d(5%, -4%, 0) scale(1); opacity: 0.5; }
    }
    @keyframes onboardOrbitSpin {
      from { transform: rotate(0deg); }
      to   { transform: rotate(360deg); }
    }
    @keyframes onboardOrbitSpinRev {
      from { transform: rotate(360deg); }
      to   { transform: rotate(0deg); }
    }
    @keyframes onboardEmblemFloat {
      0%, 100% { transform: translateY(0px) scale(1); }
      50%      { transform: translateY(-4px) scale(1.03); }
    }
    @keyframes onboardHorizonSweep {
      0%   { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
      35%  { opacity: 0.55; }
      75%  { opacity: 0.25; }
      100% { transform: translateX(220%) skewX(-18deg); opacity: 0; }
    }
    @keyframes onboardStepSlideNext {
      from { opacity: 0; transform: translate3d(26px, 6px, 0) scale(0.985); }
      to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    }
    @keyframes onboardStepSlidePrev {
      from { opacity: 0; transform: translate3d(-26px, 6px, 0) scale(0.985); }
      to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    }
    @keyframes onboardExitDissolve {
      from { opacity: 1; transform: scale(1) translateZ(0); }
      to   { opacity: 0; transform: scale(1.035) translateZ(0); }
    }

    .onboarding-screen {
      position: fixed;
      inset: 0;
      z-index: 130;
      background:
        radial-gradient(circle at 18% 18%, rgba(13, 148, 136, 0.14) 0%, transparent 52%),
        radial-gradient(circle at 82% 80%, rgba(59, 130, 246, 0.11) 0%, transparent 56%),
        linear-gradient(165deg, #FBF9F5 0%, #F4EFE6 52%, #ECE7DD 100%);
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: max(20px, env(safe-area-inset-top, 20px)) 16px max(24px, env(safe-area-inset-bottom, 24px));
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      transition: background 0.55s ease;
    }
    html.dark .onboarding-screen,
    [data-theme="dark"] .onboarding-screen,
    body.dark-mode .onboarding-screen {
      background:
        radial-gradient(circle at 20% 18%, rgba(45, 212, 191, 0.14) 0%, transparent 52%),
        radial-gradient(circle at 82% 82%, rgba(56, 189, 248, 0.1) 0%, transparent 56%),
        radial-gradient(circle at 50% 42%, rgba(20, 23, 29, 0.72) 0%, #030406 100%);
    }
    .onboarding-screen.active {
      display: flex;
      animation: paneEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .onboarding-screen.is-exiting {
      animation: onboardExitDissolve 0.44s cubic-bezier(0.22, 1, 0.36, 1) forwards;
      pointer-events: none;
    }

    /* Cinematic Ambient Backdrop Layer */
    .onboard-ambient-stage {
      position: fixed;
      inset: 0;
      pointer-events: none;
      overflow: hidden;
      z-index: 0;
    }
    .onboard-orb {
      position: absolute;
      border-radius: 9999px;
      filter: blur(64px);
      will-change: transform, opacity;
    }
    .onboard-orb-a {
      width: min(74vw, 480px);
      height: min(74vw, 480px);
      top: -14%;
      left: -12%;
      background: radial-gradient(circle, rgba(13, 148, 136, 0.28) 0%, rgba(13, 148, 136, 0) 70%);
      animation: onboardOrbDriftA 18s ease-in-out infinite alternate;
    }
    .onboard-orb-b {
      width: min(78vw, 520px);
      height: min(78vw, 520px);
      bottom: -18%;
      right: -14%;
      background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0) 72%);
      animation: onboardOrbDriftB 22s ease-in-out infinite alternate;
    }
    .onboard-orb-c {
      width: min(60vw, 360px);
      height: min(60vw, 360px);
      top: 38%;
      left: 50%;
      margin-left: min(-30vw, -180px);
      background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0) 72%);
      animation: onboardOrbDriftC 15s ease-in-out infinite alternate;
    }
    html.dark .onboard-orb-a,
    [data-theme="dark"] .onboard-orb-a,
    body.dark-mode .onboard-orb-a {
      background: radial-gradient(circle, rgba(45, 212, 191, 0.22) 0%, rgba(45, 212, 191, 0) 70%);
    }
    html.dark .onboard-orb-b,
    [data-theme="dark"] .onboard-orb-b,
    body.dark-mode .onboard-orb-b {
      background: radial-gradient(circle, rgba(56, 189, 248, 0.17) 0%, rgba(56, 189, 248, 0) 72%);
    }

    /* Subtle Geometric Horizon Field */
    .onboard-horizon-rings {
      position: absolute;
      top: 50%;
      left: 50%;
      width: min(145vw, 860px);
      height: min(145vw, 860px);
      transform: translate(-50%, -50%);
      opacity: 0.36;
    }
    .onboard-horizon-rings::before,
    .onboard-horizon-rings::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 1px dashed rgba(13, 148, 136, 0.22);
      animation: onboardOrbitSpin 72s linear infinite;
    }
    .onboard-horizon-rings::after {
      inset: 16%;
      border-style: solid;
      border-color: rgba(26, 26, 26, 0.06);
      animation: onboardOrbitSpinRev 48s linear infinite;
    }
    html.dark .onboard-horizon-rings::before,
    [data-theme="dark"] .onboard-horizon-rings::before,
    body.dark-mode .onboard-horizon-rings::before {
      border-color: rgba(45, 212, 191, 0.18);
    }
    html.dark .onboard-horizon-rings::after,
    [data-theme="dark"] .onboard-horizon-rings::after,
    body.dark-mode .onboard-horizon-rings::after {
      border-color: rgba(255, 255, 255, 0.06);
    }

    /* Main Glassmorphic Initiation Stage Card */
    .onboarding-card {
      position: relative;
      z-index: 2;
      width: 100%;
      max-width: 444px;
      margin: auto;
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid rgba(15, 23, 42, 0.08);
      border-radius: 30px;
      padding: 24px 26px 28px;
      box-shadow:
        0 28px 68px -18px rgba(26, 24, 21, 0.14),
        0 4px 18px -2px rgba(26, 24, 21, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
      overflow-y: auto;
      overflow-x: hidden;
      max-height: 92vh;
      text-align: center;
      transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    }
    .onboarding-screen.active ~ #toast-container,
    .onboarding-screen.active ~ #toast-banner,
    .onboarding-screen.active ~ #unified-app-toast,
    .onboarding-screen.active ~ #undo-toast {
      display: none !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }
    html.dark .onboarding-card,
    [data-theme="dark"] .onboarding-card,
    body.dark-mode .onboarding-card {
      background: rgba(16, 19, 26, 0.98) !important;
      border: 1px solid rgba(255, 255, 255, 0.14) !important;
      color: #F8FAFC !important;
      box-shadow:
        0 34px 76px -18px rgba(0, 0, 0, 0.88),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
    #onboarding-overlay span {
      text-shadow: none !important;
    }
    .onboarding-card::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 45%;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
      animation: onboardHorizonSweep 7.5s ease-in-out infinite;
      pointer-events: none;
    }

    /* Top Bar: Back Button + Progress Segments + Step Count */
    .onboard-topbar {
      display: grid;
      grid-template-columns: 36px 1fr 36px;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
    }
    .onboard-back-btn {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      border: 1px solid var(--border-subtle);
      background: rgba(255, 255, 255, 0.55);
      color: var(--text-secondary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    }
    html.dark .onboard-back-btn,
    [data-theme="dark"] .onboard-back-btn,
    body.dark-mode .onboard-back-btn {
      background: rgba(255, 255, 255, 0.08) !important;
      border-color: rgba(255, 255, 255, 0.16) !important;
      color: #F8FAFC !important;
    }
    .onboard-back-btn.is-hidden {
      opacity: 0;
      pointer-events: none;
      transform: scale(0.9);
    }
    .onboard-back-btn:active {
      transform: scale(0.93);
    }
    .onboard-progress-track {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .onboard-progress-seg {
      height: 5px;
      width: 18px;
      border-radius: 999px;
      background: var(--border-strong);
      transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1), background 0.35s ease, box-shadow 0.35s ease;
    }
    html.dark .onboard-progress-seg,
    [data-theme="dark"] .onboard-progress-seg,
    body.dark-mode .onboard-progress-seg {
      background: rgba(255, 255, 255, 0.2);
    }
    .onboard-progress-seg.is-done {
      background: rgba(13, 148, 136, 0.45);
    }
    html.dark .onboard-progress-seg.is-done,
    [data-theme="dark"] .onboard-progress-seg.is-done,
    body.dark-mode .onboard-progress-seg.is-done {
      background: rgba(45, 212, 191, 0.5);
    }
    .onboard-progress-seg.is-active,
    html.dark .onboard-progress-seg.is-active,
    [data-theme="dark"] .onboard-progress-seg.is-active,
    body.dark-mode .onboard-progress-seg.is-active {
      width: 34px;
      background: var(--accent-primary);
      box-shadow: 0 0 12px var(--accent-glow);
    }
    .onboard-step-count {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      text-align: right;
      letter-spacing: 0.02em;
    }
    html.dark .onboard-step-count,
    [data-theme="dark"] .onboard-step-count,
    body.dark-mode .onboard-step-count {
      color: #94A3B8 !important;
    }

    /* Welcoming Animated Emblem Crest */
    .onboard-crest-wrap {
      position: relative;
      width: 64px;
      height: 64px;
      margin: 2px auto 16px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .onboard-crest-aura {
      position: absolute;
      inset: -10px;
      border-radius: 50%;
      background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
      filter: blur(8px);
      animation: onboardEmblemFloat 4.8s ease-in-out infinite;
    }
    .onboard-crest-ring {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 1px dashed rgba(13, 148, 136, 0.35);
      animation: onboardOrbitSpin 22s linear infinite;
    }
    html.dark .onboard-crest-ring,
    [data-theme="dark"] .onboard-crest-ring,
    body.dark-mode .onboard-crest-ring {
      border-color: rgba(45, 212, 191, 0.38);
    }
    .onboard-crest-ring::before {
      content: "";
      position: absolute;
      top: -2.5px;
      left: 50%;
      width: 5px;
      height: 5px;
      margin-left: -2.5px;
      border-radius: 50%;
      background: var(--accent-primary);
      box-shadow: 0 0 8px var(--accent-primary);
    }
    .onboard-crest-core {
      position: relative;
      width: 44px;
      height: 44px;
      border-radius: 15px;
      background: linear-gradient(145deg, rgba(13, 148, 136, 0.16), rgba(13, 148, 136, 0.04));
      border: 1px solid rgba(13, 148, 136, 0.28);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent-primary);
      animation: onboardEmblemFloat 4.8s ease-in-out infinite;
      box-shadow: 0 8px 20px -6px var(--accent-glow);
      transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    }
    html.dark .onboard-crest-core,
    [data-theme="dark"] .onboard-crest-core,
    body.dark-mode .onboard-crest-core {
      background: linear-gradient(145deg, rgba(45, 212, 191, 0.22), rgba(45, 212, 191, 0.06));
      border-color: rgba(45, 212, 191, 0.38);
      color: #2DD4BF !important;
    }

    .onboarding-greeting {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      color: var(--accent-primary);
      letter-spacing: 0.14em;
      text-transform: uppercase;
      margin-bottom: 8px;
    }
    html.dark .onboarding-greeting,
    [data-theme="dark"] .onboarding-greeting,
    body.dark-mode .onboarding-greeting {
      color: #2DD4BF !important;
    }
    .onboarding-heading {
      font-family: var(--font-display);
      font-size: clamp(22px, 5vw, 27px);
      font-weight: 800;
      letter-spacing: -0.03em;
      line-height: 1.18;
      color: var(--text-primary);
      margin: 0 0 8px;
    }
    html.dark .onboarding-heading,
    [data-theme="dark"] .onboarding-heading,
    body.dark-mode .onboarding-heading {
      color: #FFFFFF !important;
    }
    .onboard-subcopy {
      font-family: var(--font-body);
      font-size: 13.5px;
      line-height: 1.48;
      color: var(--text-secondary);
      margin: 0 auto 22px;
      max-width: 340px;
    }
    html.dark .onboard-subcopy,
    [data-theme="dark"] .onboard-subcopy,
    body.dark-mode .onboard-subcopy {
      color: #CBD5E1 !important;
    }
    .onboarding-stack {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
    }
    .onboarding-input {
      width: 100%;
      height: 52px;
      border-radius: 16px;
      padding: 0 18px;
      background: rgba(255, 255, 255, 0.78);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: 15px;
      font-weight: 500;
      text-align: center;
      outline: none;
      transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    }
    html.dark .onboarding-input,
    [data-theme="dark"] .onboarding-input,
    body.dark-mode .onboarding-input {
      background: rgba(255, 255, 255, 0.07) !important;
      border: 1px solid rgba(255, 255, 255, 0.18) !important;
      color: #FFFFFF !important;
      caret-color: #2DD4BF !important;
    }
    .onboarding-input::placeholder {
      color: var(--text-muted);
      font-weight: 400;
      opacity: 0.75;
    }
    html.dark .onboarding-input::placeholder,
    [data-theme="dark"] .onboarding-input::placeholder,
    body.dark-mode .onboarding-input::placeholder {
      color: #94A3B8 !important;
      opacity: 0.85 !important;
    }
    .onboarding-input:focus {
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 3px var(--accent-glow);
      background: var(--bg-surface);
    }
    html.dark .onboarding-input:focus,
    [data-theme="dark"] .onboarding-input:focus,
    body.dark-mode .onboarding-input:focus {
      background: rgba(255, 255, 255, 0.11) !important;
      border-color: #2DD4BF !important;
      color: #FFFFFF !important;
      box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.26) !important;
    }

    /* Primary & Secondary Action Buttons */
    .onboarding-screen .onboarding-btn,
    .onboard-primary-btn {
      width: 100%;
      height: 52px;
      border-radius: 16px;
      border: none;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: transform 0.18s ease, box-shadow 0.22s ease, opacity 0.22s ease, background 0.22s ease;
      background: var(--accent-primary);
      color: var(--accent-contrast);
      font-family: var(--font-display);
      font-size: 15px;
      letter-spacing: -0.01em;
      box-shadow: 0 12px 26px -8px var(--accent-glow);
      cursor: pointer;
      margin-top: 2px;
    }
    html.dark .onboarding-screen .onboarding-btn,
    [data-theme="dark"] .onboarding-screen .onboarding-btn,
    body.dark-mode .onboarding-screen .onboarding-btn,
    html.dark .onboard-primary-btn,
    [data-theme="dark"] .onboard-primary-btn,
    body.dark-mode .onboard-primary-btn {
      background: #0D9488 !important;
      color: #FFFFFF !important;
      text-shadow: none !important;
      box-shadow: 0 12px 26px -8px rgba(45, 212, 191, 0.35) !important;
    }
    html.dark .onboarding-screen .onboarding-btn span,
    html.dark .onboarding-screen .onboarding-btn svg,
    [data-theme="dark"] .onboarding-screen .onboarding-btn span,
    [data-theme="dark"] .onboarding-screen .onboarding-btn svg,
    body.dark-mode .onboarding-screen .onboarding-btn span,
    body.dark-mode .onboarding-screen .onboarding-btn svg {
      color: #FFFFFF !important;
      text-shadow: none !important;
    }
    .onboarding-screen .onboarding-btn:active,
    .onboard-primary-btn:active {
      transform: scale(0.98);
    }
    .onboard-ghost-btn {
      width: 100%;
      height: 44px;
      border-radius: 14px;
      border: 1px solid var(--border-subtle);
      background: transparent;
      color: var(--text-secondary);
      font-family: var(--font-display);
      font-size: 13.5px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.16s ease;
    }
    html.dark .onboard-ghost-btn,
    [data-theme="dark"] .onboard-ghost-btn,
    body.dark-mode .onboard-ghost-btn {
      background: rgba(255, 255, 255, 0.05) !important;
      border-color: rgba(255, 255, 255, 0.16) !important;
      color: #E2E8F0 !important;
    }
    .onboard-ghost-btn:hover,
    html.dark .onboard-ghost-btn:hover,
    [data-theme="dark"] .onboard-ghost-btn:hover,
    body.dark-mode .onboard-ghost-btn:hover {
      background: rgba(255, 255, 255, 0.1) !important;
      color: #FFFFFF !important;
    }
    .onboard-ghost-btn:active {
      transform: scale(0.985);
    }

    /* Quick Intention Suggestions (Step 2) */
    .onboard-goal-chips {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 7px;
      margin: 2px 0 4px;
    }
    .onboard-goal-chip {
      padding: 6px 11px;
      border-radius: 11px;
      border: 1px solid var(--border-subtle);
      background: rgba(255, 255, 255, 0.5);
      color: var(--text-secondary);
      font-family: var(--font-body);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.16s ease;
    }
    html.dark .onboard-goal-chip,
    [data-theme="dark"] .onboard-goal-chip,
    body.dark-mode .onboard-goal-chip {
      background: rgba(255, 255, 255, 0.07) !important;
      border-color: rgba(255, 255, 255, 0.16) !important;
      color: #E2E8F0 !important;
    }
    .onboard-goal-chip.is-picked {
      border-color: var(--accent-primary);
      background: var(--accent-glow);
      color: var(--text-primary);
    }
    html.dark .onboard-goal-chip.is-picked,
    [data-theme="dark"] .onboard-goal-chip.is-picked,
    body.dark-mode .onboard-goal-chip.is-picked {
      background: rgba(45, 212, 191, 0.22) !important;
      border-color: #2DD4BF !important;
      color: #5EEAD4 !important;
      font-weight: 600 !important;
    }
    .onboard-goal-chip:active {
      transform: scale(0.96);
    }

    /* Google Sign-In Material Glass Button & Connected Account Card (Step 3) */
    .onboard-gsi-btn {
      width: 100%;
      height: 50px;
      border-radius: 15px;
      border: 1px solid var(--border-strong);
      background: #FFFFFF;
      color: #1F1F1F;
      font-family: var(--font-display);
      font-size: 14.5px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 11px;
      cursor: pointer;
      box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.12);
      transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
    }
    html.dark .onboard-gsi-btn,
    [data-theme="dark"] .onboard-gsi-btn,
    body.dark-mode .onboard-gsi-btn {
      background: #FFFFFF !important;
      color: #0F172A !important;
      border-color: rgba(255, 255, 255, 0.3) !important;
      box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.55) !important;
      text-shadow: none !important;
    }
    html.dark .onboard-gsi-btn span,
    [data-theme="dark"] .onboard-gsi-btn span,
    body.dark-mode .onboard-gsi-btn span {
      color: #0F172A !important;
      text-shadow: none !important;
    }
    .onboard-gsi-btn:active {
      transform: scale(0.985);
    }
    .onboard-google-connected-card {
      display: none;
      align-items: center;
      gap: 12px;
      padding: 11px 14px;
      border-radius: 16px;
      background: rgba(16, 185, 129, 0.1);
      border: 1px solid rgba(16, 185, 129, 0.32);
      text-align: left;
    }
    .onboard-google-connected-card.is-visible {
      display: flex;
    }
    .onboard-google-avatar {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      object-fit: cover;
      flex-shrink: 0;
      background: #0D9488;
      color: #FFFFFF;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-display);
      font-weight: 700;
      font-size: 14px;
    }
    .onboard-google-meta {
      flex: 1;
      min-width: 0;
    }
    .onboard-google-name {
      font-family: var(--font-display);
      font-size: 13.5px;
      font-weight: 700;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    html.dark .onboard-google-name,
    [data-theme="dark"] .onboard-google-name,
    body.dark-mode .onboard-google-name {
      color: #F8FAFC !important;
    }
    .onboard-google-email {
      font-size: 12px;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    html.dark .onboard-google-email,
    [data-theme="dark"] .onboard-google-email,
    body.dark-mode .onboard-google-email {
      color: #CBD5E1 !important;
    }
    .onboard-google-badge {
      font-size: 11px;
      font-weight: 700;
      color: #10B981;
      background: rgba(16, 185, 129, 0.14);
      padding: 4px 8px;
      border-radius: 9px;
      flex-shrink: 0;
    }
    html.dark .onboard-google-badge,
    [data-theme="dark"] .onboard-google-badge,
    body.dark-mode .onboard-google-badge {
      color: #34D399 !important;
      background: rgba(16, 185, 129, 0.2) !important;
    }

    /* Interactive Rows for Sync & Preferences (Steps 3 & 4) */
    .onboard-option-list {
      display: flex;
      flex-direction: column;
      gap: 9px;
      text-align: left;
    }
    .onboard-option-card {
      padding: 12px 14px;
      border-radius: 16px;
      background: #F8FAFC;
      border: 1px solid rgba(15, 23, 42, 0.08);
      display: flex;
      flex-direction: column;
      gap: 10px;
      transition: border-color 0.2s ease, background 0.2s ease;
    }
    html.dark .onboard-option-card,
    [data-theme="dark"] .onboard-option-card,
    body.dark-mode .onboard-option-card {
      background: #181C24 !important;
      border-color: rgba(255, 255, 255, 0.12) !important;
    }
    .onboard-option-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      cursor: pointer;
    }
    .onboard-option-left {
      display: flex;
      align-items: center;
      gap: 11px;
      min-width: 0;
      flex: 1;
    }
    .onboard-icon-tile {
      width: 34px;
      height: 34px;
      border-radius: 11px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      background: rgba(13, 148, 136, 0.12);
      color: var(--accent-primary);
    }
    html.dark .onboard-icon-tile,
    [data-theme="dark"] .onboard-icon-tile,
    body.dark-mode .onboard-icon-tile {
      background: rgba(45, 212, 191, 0.16);
      color: #2DD4BF;
    }
    .onboard-option-title {
      font-family: var(--font-display);
      font-size: 13.5px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.25;
    }
    html.dark .onboard-option-title,
    [data-theme="dark"] .onboard-option-title,
    body.dark-mode .onboard-option-title {
      color: #F8FAFC !important;
    }
    .onboard-option-sub {
      font-size: 11.8px;
      color: var(--text-secondary);
      line-height: 1.3;
      margin-top: 1px;
    }
    html.dark .onboard-option-sub,
    [data-theme="dark"] .onboard-option-sub,
    body.dark-mode .onboard-option-sub {
      color: #CBD5E1 !important;
    }
    .onboard-switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 26px;
      flex-shrink: 0;
    }
    .onboard-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .onboard-switch-track {
      position: absolute;
      inset: 0;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.35);
      transition: background 0.25s ease;
      cursor: pointer;
    }
    .onboard-switch-track::after {
      content: "";
      position: absolute;
      top: 3px;
      left: 3px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #FFFFFF;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
      transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .onboard-switch input:checked + .onboard-switch-track {
      background: var(--accent-primary, #0d9488);
    }
    .onboard-switch input:checked + .onboard-switch-track::after {
      transform: translateX(20px);
    }

    /* Segmented Controls inside Step 3 & Step 4 */
    .onboard-seg-group {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      width: 100%;
    }
    .onboard-seg-btn {
      height: 34px;
      border-radius: 10px;
      border: 1px solid rgba(15, 23, 42, 0.08);
      background: #FFFFFF;
      color: var(--text-secondary);
      font-family: var(--font-display);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    html.dark .onboard-seg-btn,
    [data-theme="dark"] .onboard-seg-btn,
    body.dark-mode .onboard-seg-btn {
      background: #222733 !important;
      border-color: rgba(255, 255, 255, 0.12) !important;
      color: #E2E8F0 !important;
    }
    .onboard-seg-btn.is-active {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      color: var(--accent-contrast);
      box-shadow: 0 4px 12px -4px var(--accent-glow);
    }
    html.dark .onboard-seg-btn.is-active,
    [data-theme="dark"] .onboard-seg-btn.is-active,
    body.dark-mode .onboard-seg-btn.is-active {
      background: #0D9488 !important;
      border-color: #2DD4BF !important;
      color: #FFFFFF !important;
      font-weight: 700 !important;
      text-shadow: none !important;
      box-shadow: 0 4px 12px -3px rgba(45, 212, 191, 0.38) !important;
    }
    .onboard-drive-cadence-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--border-subtle);
    }
    html.dark .onboard-drive-cadence-row,
    [data-theme="dark"] .onboard-drive-cadence-row,
    body.dark-mode .onboard-drive-cadence-row {
      border-top-color: rgba(255, 255, 255, 0.1);
    }
    .onboard-drive-cadence-row.is-disabled {
      opacity: 0.46;
      pointer-events: none;
    }
    .onboard-sync-hint {
      font-size: 11.5px;
      color: var(--text-muted);
      text-align: center;
      margin-top: 2px;
      min-height: 16px;
    }
    html.dark .onboard-sync-hint,
    [data-theme="dark"] .onboard-sync-hint,
    body.dark-mode .onboard-sync-hint {
      color: #94A3B8 !important;
    }

    /* Multi-Step Animated Stage */
    .onboarding-stage-viewport {
      position: relative;
      width: 100%;
    }
    .onboarding-step-panel {
      display: none;
      width: 100%;
    }
    .onboarding-step-panel.is-active {
      display: block;
      animation: onboardStepSlideNext 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .onboarding-step-panel.is-active.is-back-nav {
      animation: onboardStepSlidePrev 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    @media (max-width: 440px) {
      .onboarding-card {
        padding: 20px 18px 24px;
        border-radius: 26px;
      }
      .onboard-crest-wrap {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
      }
      .onboard-crest-core {
        width: 40px;
        height: 40px;
      }
      .onboard-subcopy {
        margin-bottom: 18px;
      }
    }
    @media (prefers-reduced-motion: reduce) {
      .onboard-orb,
      .onboard-horizon-rings::before,
      .onboard-horizon-rings::after,
      .onboard-crest-aura,
      .onboard-crest-ring,
      .onboard-crest-core,
      .onboarding-card::before,
      .onboarding-step-panel.is-active {
        animation: none !important;
      }
    }

    #macro-anchor-bar {
      max-width: 760px;
      margin: env(safe-area-inset-top, 16px) auto 0;
      padding: 0;
      max-height: 240px;
      opacity: 1;
      transform: translateY(0) scale(1);
      overflow: visible;
      transition: transform 0.4s ease, opacity 0.4s ease, max-height 0.4s ease, padding 0.4s ease, margin-top 0.4s ease;
      position: relative;
      z-index: 15;
    }
    #macro-anchor-bar.glided-away {
      transform: translateY(-120%) scale(0.97);
      opacity: 0;
      max-height: 0;
      margin-top: 0;
      padding-top: 0;
      padding-bottom: 0;
      pointer-events: none;
    }
    .macro-banner-surface {
      background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
      color: var(--accent-contrast);
      border-radius: var(--squircle-md);
      padding: 14px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      box-shadow: 0 12px 28px -6px var(--accent-glow);
    }

    /* ==========================================================================
       4. APP SHELL & 6-TAB BOTTOM BAR (NO TOP HEADER)
       ========================================================================== */
    .app-shell {
      max-width: 760px;
      width: 100%;
      margin: 0 auto;
      height: 100dvh;
      max-height: 100dvh;
      display: flex;
      flex-direction: column;
      padding-top: env(safe-area-inset-top, 32px);
      padding-bottom: env(safe-area-inset-bottom, 24px);
      overflow: hidden;
      position: relative;
      z-index: 5;
    }
    #macro-anchor-bar:not(.glided-away) + .app-shell {
      padding-top: 0;
    }
    #macro-anchor-bar:not(.glided-away) + .app-shell .todo-header {
      padding-top: 4px !important;
    }

    .immersive-mode,
    .strict-fullscreen,
    body.immersive-mode,
    body.strict-fullscreen,
    body.immersive-mode .app-shell,
    body.strict-fullscreen .app-shell,
    body.immersive-mode .tab-pane,
    body.strict-fullscreen .tab-pane,
    body.immersive-mode #macro-anchor-bar,
    body.strict-fullscreen #macro-anchor-bar {
      padding-top: 0 !important;
      padding-bottom: 0 !important;
      margin-top: 0 !important;
    }

    .tab-pane {
      display: none;
      padding: 20px 20px calc(env(safe-area-inset-bottom, 24px) + 96px);
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior-y: contain;
      -webkit-overflow-scrolling: touch;
      animation: paneEnter 0.35s var(--spring-fluid);
    }
    .tab-pane.active {
      display: block;
    }

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

    .page-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      margin-bottom: 20px;
      gap: 12px;
    }
    .page-title {
      font-family: var(--font-display);
      font-size: clamp(26px, 4vw, 34px);
      font-weight: 800;
      letter-spacing: -0.03em;
      line-height: 1.1;
      color: var(--text-primary);
    }
    .page-subtitle {
      font-size: 13.5px;
      font-weight: 500;
      color: var(--text-secondary);
      margin-top: 4px;
    }

    .squircle-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--squircle-md);
      padding: 16px 18px;
      box-shadow: var(--shadow-soft);
      color: var(--text-primary);
      transition: transform 0.34s var(--spring-fluid), background-color 0.3s var(--spring-fluid), border-color 0.3s var(--spring-fluid), box-shadow 0.3s var(--spring-fluid), opacity 0.34s var(--spring-fluid);
    }

    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 64px 24px;
      border-radius: var(--squircle-lg);
      border: 1.5px dashed var(--border-strong);
      color: var(--text-secondary);
      margin-top: 10px;
    }
    .empty-state svg {
      width: 42px;
      height: 42px;
      color: var(--text-muted);
      margin-bottom: 14px;
    }

    /* True Empty States: Empty task lists, Kanban columns, and Eisenhower quadrants remain strictly blank */
    .philosophical-empty-state {
      display: none !important;
    }

    /* Live NLP Task Input & Shadow Backdrop Highlighter */
    :root {
      --nlp-highlight: rgba(37, 99, 235, 0.22);
      --primary-rgb: 37, 99, 235;
      --surface-variant: var(--bg-elevated);
    }
    html.dark,
    [data-theme="dark"] {
      --nlp-highlight: rgba(59, 130, 246, 0.30);
      --primary-rgb: 59, 130, 246;
      --surface-variant: var(--bg-elevated);
    }
    .nlp-input-stage {
      position: relative;
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      overflow: hidden;
    }
    #nlp-shadow,
    .nlp-input-backdrop {
      position: absolute;
      inset: 0;
      font-family: var(--font-sans);
      font-size: 15.5px;
      font-weight: 400;
      letter-spacing: normal;
      line-height: 1.45;
      padding: 8px 0;
      color: transparent;
      white-space: pre;
      overflow: hidden;
      pointer-events: none;
      user-select: none;
      -webkit-user-select: none;
      z-index: 1;
    }
    .nlp-live-input {
      position: relative;
      z-index: 2;
      flex: 1;
      min-width: 0;
      width: 100%;
      font-family: var(--font-sans);
      font-size: 15.5px;
      font-weight: 400;
      letter-spacing: normal;
      line-height: 1.45;
      padding: 8px 0;
      color: var(--text-primary);
      background: transparent;
      border: none;
      outline: none;
      cursor: text;
      user-select: text;
      -webkit-user-select: text;
    }
    .nlp-live-input::placeholder {
      color: var(--text-muted);
      opacity: 1;
    }
    #nlp-shadow mark,
    mark.nlp-highlight,
    .nlp-highlight {
      display: inline;
      color: transparent;
      background-color: var(--nlp-highlight);
      border-radius: 4px;
      padding: 1px 0;
      font-family: inherit;
      font-size: inherit;
      font-weight: inherit;
      letter-spacing: inherit;
      line-height: inherit;
    }

    /* Pillar 2, 3 & 4: Journal UI Modernization, Embedded Mic Pulse, Contextual Bold & Mood Color Shift */
    @keyframes micPulse {
      0% {
        opacity: 0.45;
        transform: scale(0.96);
      }
      50% {
        opacity: 1;
        transform: scale(1.04);
      }
      100% {
        opacity: 0.45;
        transform: scale(0.96);
      }
    }
    .journal-editor-container {
      position: relative;
      border-radius: 16px;
      background: var(--surface-variant, var(--bg-elevated));
      padding: 16px;
      min-height: 250px;
      flex: 1;
      display: flex;
      flex-direction: column;
      border: 1.5px solid var(--border-subtle);
      overflow: hidden;
      transition: border-color 0.3s ease, background-color 0.4s ease;
    }
    .journal-editor-container:focus-within {
      border-color: var(--accent-primary);
    }
    .journal-mic-pulse-overlay {
      position: absolute;
      inset: 0;
      background: radial-gradient(circle, rgba(var(--primary-rgb, 37, 99, 235), 0.1) 0%, transparent 70%);
      animation: micPulse 1.5s infinite;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s ease, visibility 0.25s ease;
      z-index: 1;
    }
    .journal-editor-container.mic-active .journal-mic-pulse-overlay {
      opacity: 1;
      visibility: visible;
    }
    #journal-editor {
      width: 100%;
      min-height: 250px;
      border: none;
      outline: none;
      resize: none;
      background: transparent;
      font-family: inherit;
      font-size: 16px;
      color: var(--text-primary);
      line-height: 1.75;
      flex: 1;
      position: relative;
      z-index: 2;
      padding-bottom: 48px;
    }
    #journal-editor::placeholder {
      color: var(--text-muted);
    }
    #audio-wave-overlay {
      display: none;
      position: absolute;
      inset: 0;
      background: var(--surface-variant, var(--bg-elevated));
      border-radius: 16px;
      align-items: center;
      justify-content: center;
      gap: 6px;
      z-index: 10;
      transition: box-shadow 0.1s ease-out;
    }
    #audio-wave-overlay.recording-active {
      display: flex;
    }
    .audio-bar {
      width: 4px;
      height: 15px;
      background-color: var(--primary-color, var(--accent-primary, #4A90E2));
      border-radius: 4px;
      transition: transform 0.06s ease-out;
    }

    @keyframes wavePulse {
      0%, 100% { transform: scaleY(1); opacity: 0.5; }
      50% { transform: scaleY(2.5); opacity: 1; }
    }

    .journal-embedded-mic-btn {
      position: absolute;
      bottom: 16px;
      right: 16px;
      z-index: 20;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background: var(--bg-surface);
      color: var(--text-primary);
      border: 1px solid var(--border-strong);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
      cursor: pointer;
      transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    }
    .journal-embedded-mic-btn.mic-active,
    .journal-embedded-mic-btn.listening {
      background: var(--accent-primary);
      color: #FFFFFF;
      border-color: var(--accent-primary);
      box-shadow: 0 0 18px rgba(var(--primary-rgb, 37, 99, 235), 0.45);
    }
    .journal-action-bar {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 14px;
      padding-top: 8px;
    }
    .journal-step-wrap {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      transition: opacity 0.32s ease, transform 0.32s ease;
    }
    .journal-step-wrap.fading-out {
      opacity: 0;
      transform: translateY(-8px);
      pointer-events: none;
    }
    .journal-mood-step {
      display: none;
      flex: 1;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 24px 16px;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.38s ease, transform 0.38s ease;
    }
    .journal-mood-step.active {
      display: flex;
      opacity: 1;
      transform: translateY(0);
    }
    .journal-mood-emoji-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 14px;
      margin-top: 24px;
      flex-wrap: wrap;
    }
    .journal-mood-emoji-btn {
      width: 58px;
      height: 58px;
      border-radius: 18px;
      font-size: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-elevated);
      border: 1.5px solid var(--border-subtle);
      cursor: pointer;
      transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
    }
    .journal-mood-emoji-btn:hover,
    .journal-mood-emoji-btn.selected {
      transform: translateY(-4px) scale(1.08);
      border-color: var(--accent-primary);
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    }
    body,
    #journal-fs-overlay {
      transition: background-color 0.8s ease;
    }
    body.mood-bg-1,
    #journal-fs-overlay.mood-bg-1 {
      background-color: #38182F !important;
      color: #F8FAFC !important;
    }
    body.mood-bg-2,
    #journal-fs-overlay.mood-bg-2 {
      background-color: #3E241B !important;
      color: #F8FAFC !important;
    }
    body.mood-bg-3,
    #journal-fs-overlay.mood-bg-3 {
      background-color: #1E293B !important;
      color: #F8FAFC !important;
    }
    body.mood-bg-4,
    #journal-fs-overlay.mood-bg-4 {
      background-color: #113835 !important;
      color: #F8FAFC !important;
    }
    body.mood-bg-5,
    #journal-fs-overlay.mood-bg-5 {
      background-color: #172B5C !important;
      color: #F8FAFC !important;
    }

    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 40;
      background: var(--bg-glass);
      border-top: 1px solid var(--border-subtle);
      padding-bottom: env(safe-area-inset-bottom, 0px);
      transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
    }
    .bottom-nav-inner {
      max-width: 760px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      height: 68px;
      padding: 0 4px;
    }
    .nav-tab {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      min-height: 48px;
      border-radius: var(--squircle-sm);
      color: var(--text-muted);
      position: relative;
      transition: color 0.25s var(--spring-fluid), transform 0.2s var(--spring-fluid);
    }
    .nav-tab svg {
      width: 21px;
      height: 21px;
      stroke-width: 2;
      transition: transform 0.3s var(--spring-bounce);
    }
    .nav-tab span {
      font-family: var(--font-display);
      font-size: 10.5px;
      font-weight: 700;
      white-space: nowrap;
    }
    .nav-tab.active {
      color: var(--accent-primary);
    }
    .nav-tab.active svg {
      transform: translateY(-2px) scale(1.08);
      stroke-width: 2.4;
    }
    /* Bottom Nav Micro-Animations on Tab Switch */
    @keyframes navTickAction {
      0%   { transform: translateY(0) scale(0.88) rotate(-8deg); }
      50%  { transform: translateY(-4px) scale(1.18) rotate(6deg); }
      100% { transform: translateY(-2px) scale(1.08) rotate(0deg); }
    }
    @keyframes navTickFocus {
      0%   { transform: translateY(0) scale(0.9) rotate(-25deg); }
      60%  { transform: translateY(-3px) scale(1.15) rotate(12deg); }
      100% { transform: translateY(-2px) scale(1.08) rotate(0deg); }
    }
    @keyframes navFlipMind {
      0%   { transform: translateY(0) scaleX(0.65) scaleY(0.95); }
      55%  { transform: translateY(-3px) scaleX(1.16) scaleY(1.1); }
      100% { transform: translateY(-2px) scale(1.08); }
    }
    @keyframes navExpandInsight {
      0%   { transform: translateY(0) scale(0.8); }
      50%  { transform: translateY(-4px) scale(1.22); }
      100% { transform: translateY(-2px) scale(1.08); }
    }
    @keyframes navPopMore {
      0%   { transform: translateY(0) scale(0.85) rotate(0deg); }
      50%  { transform: translateY(-3px) scale(1.18) rotate(90deg); }
      100% { transform: translateY(-2px) scale(1.08) rotate(0deg); }
    }
    .nav-tab[data-tab-target="action"].active svg  { animation: navTickAction 0.42s var(--spring-bounce); }
    .nav-tab[data-tab-target="focus"].active svg   { animation: navTickFocus 0.44s var(--spring-bounce); }
    .nav-tab[data-tab-target="mind"].active svg    { animation: navFlipMind 0.44s var(--spring-bounce); }
    .nav-tab[data-tab-target="insight"].active svg { animation: navExpandInsight 0.42s var(--spring-bounce); }
    .nav-tab[data-tab-target="more"].active svg    { animation: navPopMore 0.42s var(--spring-bounce); }

    /* Universal Hardware-Accelerated Scroll-to-Fill (Interlinked Toggle + Main Workspace Slide-Up) */
    #tab-todo .focus-top-bar,
    #tab-focus .focus-top-bar,
    #tab-mind .focus-top-bar {
      position: sticky;
      top: 4px;
      z-index: 25;
      transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
      transform: translate3d(0, 0, 0);
      transform-origin: top center;
      will-change: transform, opacity;
      backface-visibility: hidden;
    }
    #action-subview-todo,
    #action-subview-antitasks,
    #pomo-arena,
    #missile-arena,
    #mind-subview-notes,
    #mind-subview-journal {
      margin-top: 0;
      transition: margin-top 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    }
    body.workspace-scrolled-down #tab-todo .focus-top-bar,
    body.workspace-scrolled-down #tab-focus .focus-top-bar,
    body.workspace-scrolled-down #tab-mind .focus-top-bar,
    body.composer-active #tab-todo .focus-top-bar,
    body.composer-active #tab-focus .focus-top-bar,
    body.composer-active #tab-mind .focus-top-bar,
    body.action-toggle-dismissed #tab-todo .focus-top-bar {
      transform: translate3d(0, -118%, 0) !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }
    body.workspace-scrolled-down #action-subview-todo,
    body.workspace-scrolled-down #action-subview-antitasks,
    body.workspace-scrolled-down #pomo-arena,
    body.workspace-scrolled-down #missile-arena:not(.missile-lockdown),
    body.workspace-scrolled-down #mind-subview-notes,
    body.workspace-scrolled-down #mind-subview-journal,
    body.composer-active #action-subview-todo,
    body.composer-active #action-subview-antitasks,
    body.composer-active #pomo-arena,
    body.composer-active #missile-arena:not(.missile-lockdown),
    body.composer-active #mind-subview-notes,
    body.composer-active #mind-subview-journal,
    body.action-toggle-dismissed #action-subview-todo,
    body.action-toggle-dismissed #action-subview-antitasks {
      margin-top: -56px !important;
    }
    #tab-todo {
      transition: padding-top 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    }
    body.action-toggle-dismissed #tab-todo {
      padding-top: 0;
    }
    .nav-tab.active::after {
      content: '';
      position: absolute;
      top: 5px;
      width: 18px;
      height: 3px;
      border-radius: 99px;
      background: var(--accent-primary);
    }

    /* ==========================================================================
       5. TAB 1: SPEARHEAD TASK, 2-SECOND COMPLETION SLIDE & DRAG FEEDBACK
       ========================================================================== */
    .todo-list {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y !important;
      padding-bottom: 0;
    }

    .todo-list-container,
    #todo-list-container {
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y !important; /* Forces the browser to allow vertical scrolling */
      height: 100%;
      padding-bottom: 80px; /* Space for FAB */
    }

    .task-card {
      position: relative;
      touch-action: pan-y;
      user-select: none;
      padding: 9px 14px;
    }

    /* Pending Counter & 3-Dot Menu at Top of To-Do List */
    .todo-header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      position: relative;
    }
    .pending-counter-text {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    .three-dot-btn {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--shadow-soft);
    }
    .three-dot-dropdown {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      min-width: 228px;
      background: var(--bg-surface);
      border: 1px solid var(--border-strong);
      border-radius: var(--squircle-sm);
      box-shadow: var(--shadow-float);
      padding: 6px;
      z-index: 60;
      display: none;
      flex-direction: column;
      gap: 4px;
      animation: paneEnter 0.2s var(--spring-fluid);
    }
    .three-dot-dropdown.open {
      display: flex;
    }
    .dropdown-action-btn {
      width: 100%;
      padding: 10px 12px;
      border-radius: 11px;
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text-primary);
      text-align: left;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .dropdown-action-btn:hover,
    .dropdown-action-btn:active {
      background: var(--bg-elevated);
    }
    .dropdown-nested-submenu {
      display: none;
      flex-direction: column;
      gap: 4px;
      padding: 4px 6px 6px 12px;
      margin: 2px 0 4px;
      border-left: 2px solid var(--border-strong);
      animation: paneEnter 0.18s var(--spring-fluid);
    }
    .dropdown-nested-submenu.open {
      display: flex;
    }
    .nested-choice-btn {
      width: 100%;
      padding: 7px 10px;
      border-radius: 9px;
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-secondary);
      text-align: left;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: background-color 0.18s ease, color 0.18s ease;
    }
    .nested-choice-btn:hover {
      background: var(--bg-elevated);
      color: var(--text-primary);
    }
    .nested-choice-btn.active {
      background: var(--accent-soft);
      color: var(--accent-primary);
    }

    /* Dynamic Drag & Drop Visual Feedback, Right-Swipe Action Underlay, Kanban View & Bulk Action Bar */
    .task-card-swipe-wrap {
      position: relative;
      border-radius: var(--radius-card);
      overflow: hidden;
      margin-bottom: 8px;
      touch-action: pan-y;
    }
    .task-swipe-underlay {
      position: absolute;
      inset: 0;
      border-radius: var(--radius-card);
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding-left: 18px;
      gap: 8px;
      font-family: var(--font-display);
      font-size: 12.5px;
      font-weight: 800;
      letter-spacing: 0.02em;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.16s ease, background-color 0.2s ease;
      z-index: 0;
    }
    .task-swipe-underlay[data-action="select"] {
      background: rgba(59, 130, 246, 0.18);
      border: 1px solid rgba(59, 130, 246, 0.45);
      color: #3B82F6;
    }
    .task-swipe-underlay[data-action="complete"] {
      background: rgba(16, 185, 129, 0.18);
      border: 1px solid rgba(16, 185, 129, 0.45);
      color: #10B981;
    }
    .task-swipe-underlay[data-action="delete"] {
      background: rgba(239, 68, 68, 0.18);
      border: 1px solid rgba(239, 68, 68, 0.45);
      color: #EF4444;
    }
    .task-card {
      position: relative;
      z-index: 1;
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .task-card.swiping-right {
      transition: none !important;
    }
    .sortable-fallback {
      opacity: 1 !important;
      background: var(--surface-color, var(--bg-surface)) !important;
      box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
      z-index: 100250 !important;
      border-radius: 12px;
      transition: box-shadow 0.2s ease !important;
      will-change: transform !important;
      pointer-events: none !important;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
    }
    .sortable-ghost {
      opacity: 0.24 !important;
      background: var(--surface-variant, var(--bg-elevated)) !important;
      transition: opacity 0.15s ease !important;
    }
    .sortable-drag,
    .dragging,
    .task-card.dragging {
      box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
      z-index: 100250 !important;
      border-radius: 12px;
      opacity: 1 !important;
      background: var(--surface-color, var(--bg-surface)) !important;
      color: var(--text-color, var(--text-primary)) !important;
      transition: box-shadow 0.2s ease !important;
      will-change: transform !important;
      pointer-events: none !important;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
    }

    /* Pillar 1: Independent Sticky Today Banner */
    .todo-header {
      position: sticky;
      top: -1px; /* The -1px trick completely seals any subpixel rendering slits */
      z-index: 100;

      /* Solid background shield to hide scrolling tasks */
      background: var(--bg-color, #000000);

      /* Padding ensures content isn't hidden under the mobile notch when stuck */
      padding: max(env(safe-area-inset-top), 16px) 16px 12px 16px;
      margin-left: -20px;
      margin-right: -20px;

      display: flex;
      justify-content: space-between;
      align-items: center;

      /* Subtle border/shadow when scrolling */
      border-style: none;
      border-bottom: 1px solid transparent;
      transition: border-bottom 0.3s ease;
    }
    #search-btn,
    #todo-fab-search-pill,
    #btn-header-profile-avatar {
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, width 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.28s cubic-bezier(0.22, 1, 0.36, 1), margin-right 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
      opacity: 1;
      transform: translate3d(0, 0, 0);
      will-change: transform, opacity;
    }
    #search-btn.hidden,
    #todo-fab-search-pill.hidden:not(.expanded),
    #btn-header-profile-avatar.hidden:not(.is-open) {
      opacity: 0;
      transform: translate3d(0, -20px, 0);
      pointer-events: none;
    }
    .strike-through {
      text-decoration: line-through;
      opacity: 0.5;
      transform: scale(0.98);
      transition: all 0.45s ease;
    }
    .strike-through .task-title-text,
    .strike-through .task-name {
      text-decoration: line-through !important;
      opacity: 0.55;
      transition: opacity 0.35s ease;
    }
    @keyframes collapseTaskSpace {
      0% {
        margin-bottom: 12px;
        max-height: 150px;
        padding-top: 18px;
        padding-bottom: 18px;
        border-width: 1px;
      }
      100% {
        margin-bottom: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
        /* CRITICAL: Do NOT include opacity: 0 here anymore */
      }
    }

    .task-falling { 
      z-index: 10 !important; 
      animation: physicsGravityDrop var(--drop-time) cubic-bezier(0.3, 0.7, 0.4, 1) forwards, collapseTaskSpace var(--gap-close-time) cubic-bezier(0.4, 0, 0.2, 1) var(--gap-close-delay) both !important; 
      pointer-events: none; box-shadow: none !important; 
    }
    .task-rising { 
      z-index: 10 !important; 
      animation: physicsAntiGravityRise var(--rise-time) cubic-bezier(0.3, 0.7, 0.4, 1) forwards, collapseTaskSpace var(--gap-close-time) cubic-bezier(0.4, 0, 0.2, 1) var(--gap-close-delay) both !important; 
      pointer-events: none; box-shadow: none !important; 
    }

    /* GHOST PHYSICS KEYFRAMES */
    @keyframes physicsGravityDrop {
      0% { transform: translateY(0) scale(1); opacity: 1; }
      100% { transform: translateY(var(--drop-target-y, 300px)) scale(1); opacity: 1; }
    }

    @keyframes physicsAntiGravityRise {
      0% { transform: translateY(0) scale(0.97); opacity: 1; }
      20% { transform: translateY(12px) scale(0.95); opacity: 1; } /* Anticipation dip */
      100% { transform: translateY(var(--rise-target-y, -300px)) scale(1); opacity: 1; }
    }

    /* 🛬 DOCKING BAY PLACEHOLDER: Smoothly pushes siblings down 🛬 */
    .make-room-placeholder {
      width: 100%;
      border-radius: 12px;
      pointer-events: none;
      overflow: hidden;
      opacity: 0; /* Remains invisible, strictly manipulates layout height */
    }

    @keyframes expandTaskSpace {
      0% { 
        height: 0; 
        margin-bottom: 0; 
      }
      100% { 
        height: var(--target-height, 60px); 
        margin-bottom: 8px; /* Matches standard task gap */
      }
    }

    /* Pillar 2: Modern Bulk Action Bar, Global Smoothness, Task Spacing & Global Toast Engine */
    .modern-bulk-bar {
      position: fixed;
      bottom: 90px; /* Elevated strictly above the bottom navigation bar */
      left: 50%;
      transform: translateX(-50%);
      background: rgba(30, 30, 30, 0.85);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 30px;
      display: flex;
      gap: 10px;
      padding: 8px 16px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.3);
      z-index: 99999; /* Highest priority layer */
      transition: all 0.3s ease;
    }
    .modern-bulk-bar.hidden {
      opacity: 0;
      pointer-events: none;
      transform: translateX(-50%) translateY(20px);
    }
    .bulk-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      background: transparent;
      border: none;
      color: #fff;
      font-weight: 600;
      font-size: 14px;
      padding: 8px 12px;
      border-radius: 20px;
      transition: background 0.2s;
      cursor: pointer;
    }
    .bulk-btn:active {
      background: rgba(255,255,255,0.1);
    }
    .bulk-cancel { color: #a0a0a0; margin-right: auto; }
    .bulk-cancel:active { color: #ffffff; background: rgba(255,255,255,0.1); }
    .bulk-date-active {
      color: var(--primary-color, var(--accent-primary));
      background: rgba(74, 144, 226, 0.15);
    }
    #today-pending-counter {
      display: none !important;
    }
    /* 3. Macro Goal Banner Physics */
    .macro-goal-banner {
      /* Adds safe-area padding for the top of the screen */
      margin: max(env(safe-area-inset-top), 16px) 16px 16px 16px;
      background: linear-gradient(135deg, rgba(30, 30, 34, 0.95), rgba(20, 20, 22, 0.95));
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 26px;
      display: flex;
      flex-direction: row;
      overflow: hidden;
      box-sizing: border-box;
      box-shadow: 0 8px 24px rgba(0,0,0,0.2);

      /* Fluid Collapse Physics */
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
      transform-origin: 50% 0%;
    }

    /* 4. The Collapse State */
    .macro-goal-banner.hidden {
      opacity: 0;
      margin-top: 0;
      margin-bottom: 0;
      border-color: transparent;
      box-shadow: none;
      transform: translate3d(0, -10px, 0) scale(0.982);
      pointer-events: none;
    }

    .macro-accent-bar {
      width: 4px;
      flex-shrink: 0;
      background: var(--primary-color, #4A90E2);
      border-radius: 4px 0 0 4px;
      box-shadow: 0 0 10px var(--primary-color, #4A90E2);
      transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .macro-content {
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1 1 auto;
      min-width: 0;
      transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
                  transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .macro-greeting {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-size: 0.85rem;
      color: rgba(255, 255, 255, 0.7);
      margin: 0 0 4px 0;
      font-weight: 600;
    }
    .macro-header-row {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 0;
    }
    .macro-title {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-size: 0.7rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--primary-color, #4A90E2);
      margin: 0;
    }
    .macro-text {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-size: 1.15rem;
      font-weight: 800;
      color: #ffffff;
      line-height: 1.3;
      margin: 2px 0 0 0;
      letter-spacing: -0.3px;
    }
    .macro-highlight {
      color: var(--primary-color, #4A90E2);
      font-weight: 900;
    }
    .calendar-day.disabled {
      opacity: 0.2;
      pointer-events: none;
    }
    .mood-selector,
    .journal-mood-emoji-row {
      display: flex;
      flex-wrap: nowrap;
      justify-content: space-between;
      overflow-x: auto;
      gap: 5px;
    }
    .calendar-grid,
    .cal-grid {
      transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.25s ease;
    }
    button, .task-item, .journal-preview-card, .journal-board-card, .dropdown-content {
      transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .task-divider {
      display: flex;
      align-items: center;
      font-size: 0.8rem;
      color: var(--text-muted, #888888);
      margin: 24px 16px 12px 16px;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      font-weight: 700;
      pointer-events: none; /* Prevents touch interference */
      transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
      overflow: hidden;
    }

    /* The horizontal line that stretches after the text */
    .task-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: rgba(255, 255, 255, 0.1);
      margin-left: 12px;
    }

    .plain-divider {
      color: transparent;
      font-size: 0;
      margin: 12px 16px;
    }
    .plain-divider::after {
      margin-left: 0;
    }
    .divider-hidden {
      opacity: 0 !important;
      max-height: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      padding: 0 !important;
      border: none !important;
    }

    .overdue-risk,
    .overdue-risk .task-card {
      background: linear-gradient(145deg, rgba(239, 108, 0, 0.12), var(--surface-color)) !important;
      border-left: 3px solid #ff9800 !important; /* Premium left-accent line */
    }

    .overdue-divider { color: #ff4757; }
    /* Disable the default ::after line on the overdue divider so we can inject the button */
    .overdue-divider::after { display: none !important; }

    /* Reschedule Button inside the divider */
    .reschedule-btn {
      display: flex;
      align-items: center;
      gap: 4px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #ffffff;
      padding: 5px 12px;
      border-radius: 12px;
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      pointer-events: auto;
    }
    .reschedule-btn:active { background: rgba(255, 255, 255, 0.2); transform: scale(0.95); }

    /* ULTRA-GLASSY PILL TOAST */
    .modern-toast {
      position: fixed;
      bottom: 40px; /* Slightly higher off the bottom edge */
      left: 50%;
      
      /* Starts lower and slightly scaled down for the fluid pop */
      transform: translateX(-50%) translateY(40px) scale(0.9);
      
      min-width: 220px;
      max-width: 85vw;
      
      /* Advanced Glassmorphism */
      background: rgba(20, 20, 24, 0.55); /* Highly transparent */
      
      /* Glass edge lighting and pill shape */
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-top: 1px solid rgba(255, 255, 255, 0.15); 
      border-radius: 40px; 
      
      /* Depth shadow */
      box-shadow: 0 20px 40px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.05);
      
      padding: 12px 24px;
      color: #f1f1f1;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-size: 0.8rem;
      font-weight: 500;
      letter-spacing: 0.3px;
      z-index: 999999;
      
      display: flex;
      align-items: center;
      gap: 16px;
      opacity: 0;
      pointer-events: none;
      
      /* Fluid Spring Physics */
      transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .modern-toast.toast-active {
      transform: translateX(-50%) translateY(0) scale(1);
      opacity: 1;
      pointer-events: auto;
    }

    /* Minimalist Action Button */
    .modern-toast-btn {
      background: transparent;
      color: var(--primary-color, #4A90E2);
      border: none;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-weight: 800;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      cursor: pointer;
      padding: 6px 14px;
      border-radius: 20px; /* Matches the pill aesthetic */
      transition: all 0.2s ease;
      position: relative;
    }

    .modern-toast-btn:active {
      transform: scale(0.92);
      background: rgba(74, 144, 226, 0.15); /* Subtle primary color wash */
    }

    /* Floating Dropdown Menu for Bulk Reschedule */
    #bulk-reschedule-dropdown {
      position: absolute;
      background: rgba(24, 24, 28, 0.98);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      padding: 8px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      z-index: 99999;
      box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
      min-width: 170px;
      
      /* Fluid Pop-in Animation */
      transform-origin: top right;
      transform: scale(0.9);
      opacity: 0;
      pointer-events: none;
      transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    #bulk-reschedule-dropdown.menu-open {
      transform: scale(1);
      opacity: 1;
      pointer-events: auto;
    }

    .reschedule-option {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      color: #e0e0e0;
      font-size: 0.85rem;
      border-radius: 10px;
      font-weight: 600;
      transition: all 0.2s;
      cursor: pointer;
    }
    .reschedule-option svg { color: var(--primary-color, #4A90E2); }
    .reschedule-option:active { background: rgba(255,255,255,0.1); color: #fff; }

    .completed-divider { color: #4CAF50; margin-top: 32px; }
    .completed-divider::after { background: rgba(76, 175, 80, 0.25); }

    .pending-count-footer {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-size: 0.75rem;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.35);
      text-align: center;
      
      /* THE PRECISION GAP FIX: Tight, balanced breathing room */
      padding: 12px 16px 4px 16px; 
      margin-top: 2px;
      margin-bottom: 2px;
      
      letter-spacing: 0.5px;
      pointer-events: none;
      transition: all 0.3s ease; /* Smoothly glides when tasks above it collapse */
    }

    /* Pulls the Completed Divider up when it sits right below the pending count */
    .pending-count-footer + .task-divider.completed-divider,
    .pending-count-footer + .completed-divider {
      margin-top: 4px !important; 
      padding-top: 8px;
    }

    /* ====================================================
       🛠️ SETTINGS ACCORDION & SOUND CONTROLS (CSS) 🛠️
       ==================================================== */
    details.settings-accordion {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      margin-bottom: 12px;
      overflow: hidden;
      transition: all 0.3s ease;
    }

    details.settings-accordion summary {
      padding: 16px;
      font-weight: 600;
      font-size: 1rem;
      color: #fff;
      cursor: pointer;
      list-style: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      user-select: none;
    }

    details.settings-accordion summary::-webkit-details-marker {
      display: none;
    }

    /* Custom Rotating Chevron for Accordions */
    details.settings-accordion summary .chevron {
      transition: transform 0.3s ease;
      opacity: 0.6;
    }
    details.settings-accordion[open] summary .chevron {
      transform: rotate(180deg);
    }

    .accordion-content {
      padding: 0 16px 16px 16px;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      margin-top: 4px;
      padding-top: 16px;
    }

    /* Nested Sub-Accordions for Export/Import */
    details.sub-accordion {
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 8px;
      margin-bottom: 10px;
    }
    details.sub-accordion summary {
      padding: 12px;
      font-size: 0.9rem;
      color: rgba(255, 255, 255, 0.85);
    }

    /* Standalone Red Clear Data Button */
    .danger-zone-btn {
      width: 100%;
      padding: 15px;
      margin-top: 8px;
      border-radius: 12px;
      background: rgba(255, 71, 87, 0.1);
      border: 1px solid rgba(255, 71, 87, 0.3);
      color: #ff4757;
      font-weight: 600;
      font-size: 0.95rem;
      cursor: pointer;
      transition: all 0.2s ease;
      text-align: center;
    }
    .danger-zone-btn:active {
      background: rgba(255, 71, 87, 0.2);
      transform: scale(0.98);
    }

    /* Sound Section Specifics */
    .sound-control-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
    }
    .sound-select {
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.15);
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 0.85rem;
      outline: none;
      max-width: 150px;
    }
    .custom-upload-label {
      display: inline-block;
      font-size: 0.75rem;
      color: #4CAF50;
      border: 1px dashed rgba(76, 175, 80, 0.4);
      padding: 6px 10px;
      border-radius: 6px;
      cursor: pointer;
      margin-top: -6px;
      margin-bottom: 14px;
      text-align: center;
      width: 100%;
    }

    /* Toggle Switch for Master / Interface Sound */
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 26px;
      flex-shrink: 0;
    }
    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .toggle-switch .slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background: rgba(148, 163, 184, 0.35);
      border-radius: 999px;
      transition: 0.25s ease;
    }
    .toggle-switch .slider::before {
      content: "";
      position: absolute;
      height: 20px;
      width: 20px;
      left: 3px;
      bottom: 3px;
      background: #fff;
      border-radius: 50%;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
      transition: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .toggle-switch input:checked + .slider {
      background: var(--accent-primary, #0d9488);
    }
    .toggle-switch input:checked + .slider::before {
      transform: translateX(20px);
    }

    /* ====================================================
       🛠️ LONG-PRESS ACTION TOOLTIP (CSS) 🛠️
       ==================================================== */
    .modern-action-tooltip {
      position: fixed;
      z-index: 100000;
      
      /* Ultra-Glassy Pill Matching the Toast Engine */
      background: rgba(25, 25, 28, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.15);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
      
      color: rgba(255, 255, 255, 0.95);
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-size: 0.75rem;
      font-weight: 500;
      letter-spacing: 0.3px;
      white-space: nowrap;
      
      padding: 6px 12px;
      border-radius: 8px;
      pointer-events: none; /* Never blocks the user's finger */
      
      /* Animation States */
      opacity: 0;
      transform: translateY(8px) scale(0.9);
      transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                  transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modern-action-tooltip.show-tooltip {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    /* 🛡️ MASTER TOUCH SHIELD: Blocks Android OS native long-press menus 🛡️ */
    button, .btn, .icon-btn, .action-btn, [onclick], [data-tooltip], .tab, .menu-item, input[type="checkbox"], label {
      -webkit-touch-callout: none !important;
      -webkit-user-select: none !important;
      user-select: none !important;
      outline: none !important;
      -webkit-tap-highlight-color: transparent !important;
    }

    /* 🧱 Z-AXIS LAYERING: Ghost travels behind, but dividers remain clean 🧱 */

    /* Keep solid background ONLY on the tasks themselves */
    .todo-item {
      position: relative;
      z-index: 10;
      background-color: #18181c; 
    }

    /* Strip the background from dividers and footers, returning them to normal */
    .task-divider, 
    .pending-count-footer,
    .settings-group-title {
      position: relative;
      z-index: 15;
      background-color: transparent !important; /* FIXED: Removes the unasked solid background */
    }

    .task-item {
      position: relative;
      z-index: 10; /* Keeps standard tasks on top layer */
      background: var(--surface-color); /* Ensure this is fully opaque, not transparent */
      padding: 0;
      margin-bottom: 10px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }
    .task-item .task-card {
      margin: 0;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }
    .pill-btn {
      padding: 8px 14px;
      border-radius: 999px;
      font-family: var(--font-display);
      font-size: 12.5px;
      font-weight: 800;
      background: var(--bg-elevated);
      color: var(--text-primary);
      border: 1px solid var(--border-subtle);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
    }

    /* Pillar 4: Sleek CSS Slider Switch & Clean Export Button States */
    .settings-slider-switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 26px;
    }
    .settings-slider-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .settings-slider-track {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background-color: var(--bg-elevated);
      border: 1px solid var(--border-strong);
      border-radius: 34px;
      transition: 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .settings-slider-track::before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: var(--text-secondary);
      border-radius: 50%;
      transition: 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .settings-slider-switch input:checked + .settings-slider-track {
      background-color: var(--accent-primary);
      border-color: var(--accent-primary);
    }
    .settings-slider-switch input:checked + .settings-slider-track::before {
      transform: translateX(20px);
      background-color: var(--accent-contrast);
    }
    /* BACKUP & EXPORT UI REDESIGN */
    .settings-group-title {
      font-weight: 700;
      font-size: 15px;
      color: #ffffff;
    }

    .export-format-container {
      display: flex;
      gap: 12px;
      margin-top: 16px;
      margin-bottom: 16px;
    }

    .export-chip {
      flex: 1;
      padding: 12px;
      background: rgba(255, 255, 255, 0.05); /* Muted by default, no pre-selection */
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      color: rgba(255, 255, 255, 0.6);
      text-align: center;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    /* Only ignites Neon Green when actively selected */
    .export-chip.selected {
      background: rgba(0, 230, 118, 0.1); 
      border-color: #00E676; /* Neon Green */
      color: #00E676;
      box-shadow: 0 0 15px rgba(0, 230, 118, 0.2);
    }

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

    .export-execute-btn {
      width: 100%;
      padding: 14px;
      background: rgba(255, 255, 255, 0.1); /* Neutral glass */
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 14px;
      color: #fff;
      font-weight: bold;
      transition: all 0.2s;
      cursor: pointer;
    }

    .export-execute-btn:active {
      background: #00E676; /* Ignites on press */
      color: #000;
      border-color: #00E676;
    }

    /* Pillar 4: Notes Header & Glassy 3-Dot Dropdown Menu CSS */
    .notes-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      gap: 12px;
    }
    .icon-btn.menu-btn {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: var(--surface-color);
      border: 1px solid var(--border-subtle);
      color: var(--text-color);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      font-weight: 700;
      cursor: pointer;
      box-shadow: var(--shadow-soft);
    }
    .dropdown { position: relative; display: inline-block; }
    .notes-dropdown,
    .dropdown-content {
      position: absolute;
      right: 0;
      top: calc(100% + 6px);
      min-width: 170px;
      background: rgba(30, 30, 30, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      box-shadow: 0 10px 25px rgba(0,0,0,0.3);
      z-index: 100;
      overflow: hidden;
      padding: 6px;
    }
    .dropdown-content.hidden { display: none; }
    .dropdown-content a {
      color: #fff;
      font-size: 13.5px;
      font-weight: 600;
      padding: 10px 14px;
      border-radius: 8px;
      text-decoration: none;
      display: block;
    }
    .dropdown-content a:hover { background: rgba(255, 255, 255, 0.1); }
    .task-card.selected-task,
    .note-card.selected-note {
      border-color: var(--accent-primary) !important;
      background: var(--accent-soft) !important;
      box-shadow: 0 0 0 1.5px var(--accent-primary), var(--shadow-soft);
    }
    .task-select-badge {
      width: 20px;
      height: 20px;
      border-radius: 99px;
      border: 1.8px solid var(--border-strong);
      display: none;
      align-items: center;
      justify-content: center;
      margin-left: auto;
      flex-shrink: 0;
      color: var(--accent-contrast);
      background: var(--bg-elevated);
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    body.selection-mode-active .task-select-badge {
      display: inline-flex;
    }
    body.selection-mode-active .fab-cluster,
    body.notes-selection-mode-active .fab-cluster {
      display: none !important;
    }
    .task-card.selected-task .task-select-badge {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      transform: scale(1.08);
    }

    /* Kanban / Board View (CSS Grid/Flexbox Horizontal Columns with Mandatory Snap) */
    .todo-list.kanban-board-view {
      display: flex;
      gap: 12px;
      overflow-x: auto;
      padding-bottom: 24px;
      align-items: stretch;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
    }
    .kanban-column {
      flex: 0 0 min(280px, 82vw);
      width: min(280px, 82vw);
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-card);
      padding: 12px;
      min-height: 310px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      scroll-snap-align: start;
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .kanban-column.drag-over-col {
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 2px var(--accent-glow);
      background: var(--bg-elevated);
    }
    .kanban-col-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 2px 4px 8px;
      border-bottom: 1px solid var(--border-subtle);
      margin-bottom: 2px;
    }
    .kanban-col-title {
      font-family: var(--font-display);
      font-size: 13px;
      font-weight: 800;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .kanban-col-count {
      font-size: 11px;
      font-weight: 800;
      padding: 2px 8px;
      border-radius: 99px;
      background: var(--bg-elevated);
      color: var(--text-secondary);
    }
    .kanban-col-cards {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 0;
      min-height: 240px;
    }
    .kanban-status-pills {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-top: 6px;
    }
    .kanban-move-pill {
      padding: 3px 8px;
      border-radius: 7px;
      font-size: 10.5px;
      font-weight: 700;
      background: var(--bg-elevated);
      color: var(--text-secondary);
      border: 1px solid var(--border-subtle);
    }
    .kanban-move-pill.active {
      background: var(--accent-glow);
      color: var(--accent-primary);
      border-color: var(--accent-primary);
    }
    .bulk-action-bar {
      position: fixed;
      left: 50%;
      bottom: 82px;
      transform: translateX(-50%) translateY(130%);
      opacity: 0;
      pointer-events: none;
      z-index: 68;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 20px;
      background: var(--bg-glass);
      border: 1.5px solid var(--accent-primary);
      box-shadow: var(--shadow-float), 0 8px 28px var(--accent-glow);
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      white-space: nowrap;
    }
    .bulk-action-bar.visible {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
      pointer-events: auto;
    }
    .bulk-bar-btn {
      min-height: 38px;
      padding: 7px 13px;
      border-radius: 13px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      font-family: var(--font-display);
      font-size: 12.5px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .bulk-bar-btn.danger {
      color: #EF4444;
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.28);
    }
    .bulk-bar-close {
      min-height: 36px;
      padding: 6px 12px;
      border-radius: 11px;
      background: var(--bg-elevated);
      color: var(--text-secondary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12.5px;
      font-weight: 800;
    }
    #undo-btn {
      background: none;
      border: none;
      color: var(--primary-color, var(--accent-primary, #4A90E2));
      font-weight: bold;
      padding: 0;
      cursor: pointer;
    }
    .task-drag-placeholder,
    .task-placeholder {
      height: 52px;
      background: rgba(150, 150, 150, 0.1);
      border-radius: 12px;
      border: 1px solid rgba(150, 150, 150, 0.15);
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
      margin: 4px 0;
      transition: height 0.24s cubic-bezier(0.22, 1, 0.36, 1), margin 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
      pointer-events: none;
    }

    /* Single-Canvas Unified Notes Editor: First Line Title + Horizontal Divider */
    #note-rte-canvas > .note-title-line,
    #note-rte-canvas > :first-child:not(.inline-check-row):not(.resizable-img-wrap) {
      font-family: var(--font-display);
      font-size: 21px;
      font-weight: 800;
      line-height: 1.32;
      color: var(--text-primary);
      border-bottom: 1px solid var(--border-subtle);
      padding-bottom: 10px;
      margin-bottom: 12px;
      display: block;
    }
    #note-rte-canvas > .note-title-line:empty::before {
      content: attr(data-title-placeholder);
      color: var(--text-muted);
      font-weight: 700;
      pointer-events: none;
    }

    /* Pillar 1: 60fps GPU-Accelerated Task Completion Strike & Drop */
    .task-strike-instant .task-name,
    .task-strike-instant .task-title-text {
      text-decoration: line-through !important;
      opacity: 0.5 !important;
      transition: all 0.2s ease !important;
    }

    .task-title-text {
      position: relative;
      display: inline;
      font-size: 15.5px;
      font-weight: 600;
      color: var(--text-primary);
      transition: opacity 0.2s ease, color 0.2s ease;
    }
    .task-card.completed .task-title-text {
      text-decoration: line-through;
      color: var(--text-muted);
    }
    .task-card.completed {
      opacity: 0.55;
      background: transparent;
    }

    .task-main-row {
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 32px;
    }
    .task-body-area {
      flex: 1;
      min-width: 0;
      cursor: pointer;
      padding: 2px 0;
    }

    .drag-grip,
    .drag-handle {
      min-width: 28px;
      width: 28px;
      height: 34px;
      padding: 4px !important;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      cursor: grab;
      touch-action: none !important;
      -webkit-user-select: none !important;
      user-select: none !important;
      border-radius: 8px;
      flex-shrink: 0;
    }
    .drag-grip:active,
    .drag-handle:active {
      cursor: grabbing;
      color: var(--accent-primary);
      background: var(--bg-elevated);
    }
    body.task-dragging-active,
    body.task-dragging-active * {
      -webkit-user-select: none !important;
      user-select: none !important;
      -webkit-touch-callout: none !important;
    }
    body.task-dragging-active,
    body.task-dragging-active #todo-list-container,
    body.task-dragging-active .todo-list,
    body.task-dragging-active .task-card-swipe-wrap,
    body.task-dragging-active .task-card,
    body.task-dragging-active .task-item {
      touch-action: none !important;
      overscroll-behavior: none !important;
    }
    body.task-dragging-active .task-item,
    body.task-dragging-active .task-card {
      transition: none !important;
    }
    .task-card.dragging,
    .sortable-fallback.dragging {
      position: fixed !important;
      z-index: 100250 !important;
      pointer-events: none !important;
      border-radius: 26px !important;
      background: var(--bg-surface, #ffffff) !important;
      border: 1px solid var(--border-strong, rgba(148, 163, 184, 0.25)) !important;
    }
    body.dark-mode .task-card.dragging,
    body.dark-mode .sortable-fallback.dragging,
    html.dark .task-card.dragging,
    html.dark .sortable-fallback.dragging {
      background: #18181b !important;
    }

    .prio-checkbox {
      width: 26px;
      height: 26px;
      min-width: 26px;
      border-radius: 9px;
      border: 2.2px solid var(--prio-none);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.28s var(--spring-bounce);
      cursor: pointer;
      position: relative;
      flex-shrink: 0;
    }
    .prio-checkbox::before { content: ''; position: absolute; inset: -9px; }
    .prio-checkbox[data-prio="high"] { border-color: var(--prio-high); }
    .prio-checkbox[data-prio="mid"]  { border-color: var(--prio-mid); }
    .prio-checkbox[data-prio="low"]  { border-color: var(--prio-low); }
    .prio-checkbox[data-prio="none"] { border-color: var(--prio-none); }

    .prio-checkbox.checked[data-prio="high"] { background: var(--prio-high); border-color: var(--prio-high); transform: scale(1.08); }
    .prio-checkbox.checked[data-prio="mid"]  { background: var(--prio-mid);  border-color: var(--prio-mid);  transform: scale(1.08); }
    .prio-checkbox.checked[data-prio="low"]  { background: var(--prio-low);  border-color: var(--prio-low);  transform: scale(1.08); }
    .prio-checkbox.checked[data-prio="none"] { background: var(--accent-primary); border-color: var(--accent-primary); transform: scale(1.08); }

    .prio-checkbox svg {
      width: 15px;
      height: 15px;
      color: #FFFFFF;
      stroke-width: 3;
      transform: scale(0);
      transition: transform 0.25s var(--spring-bounce);
    }
    .prio-checkbox.checked svg {
      transform: scale(1);
    }

    /* Pillar 1 & 2: To-Do Action Bar Wrap-Safe Layout & Containment */
    .task-options-row {
      display: none;
      flex-direction: row;
      align-items: center;
      justify-content: flex-start;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--border-subtle);
      position: relative;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      overflow: visible;
    }
    .task-options-row::-webkit-scrollbar {
      display: none;
    }
    .task-card.expanded .task-options-row,
    .task-entry-actions,
    #todo-action-bar {
      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;
    }
    .task-card.expanded .task-options-row {
      animation: paneEnter 0.22s var(--spring-fluid);
    }
    .task-options-row > button:not(.opt-del),
    .task-options-row .energy-selector-wrap,
    .task-options-row .energy-icon-cycle-btn,
    .task-entry-actions > button:not(.opt-del),
    .task-entry-actions .energy-selector-wrap,
    .task-entry-actions .energy-icon-cycle-btn,
    #todo-action-bar > button:not(.opt-del),
    #todo-action-bar .energy-selector-wrap,
    #todo-action-bar .energy-icon-cycle-btn {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex-shrink: 1;
      min-width: 0;
      max-width: 100%;
      padding: 6px 10px;
      box-sizing: border-box;
    }
    .task-options-row .energy-selector-wrap,
    .task-entry-actions .energy-selector-wrap,
    #todo-action-bar .energy-selector-wrap {
      padding: 0;
      overflow: visible;
    }
    .task-options-row button span:empty,
    .task-entry-actions button span:empty,
    #todo-action-bar button span:empty {
      display: none;
    }
    .task-options-row button span,
    .task-entry-actions button span,
    #todo-action-bar button span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .task-options-row button svg,
    .task-entry-actions button svg,
    #todo-action-bar button svg {
      flex-shrink: 0;
    }
    .task-options-row .opt-del,
    .task-entry-actions .opt-del,
    #todo-action-bar .opt-del {
      flex-shrink: 0 !important;
      padding: 8px !important;
      margin-left: auto;
      width: 34px;
      height: 34px;
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    /* Dedicated Proper Spacing for Task Composer Action Bar (#todo-action-bar) */
    #sheet-task-composer #todo-action-bar,
    #todo-action-bar {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 6px;
      margin-bottom: 16px !important;
      padding: 2px 0;
      width: 100%;
      box-sizing: border-box;
    }
    #sheet-task-composer #todo-action-bar > button,
    #todo-action-bar > button {
      flex: 1 1 auto;
      min-height: 40px;
      padding: 8px 14px;
      gap: 7px;
      justify-content: center;
    }
    #sheet-task-composer #todo-action-bar .energy-selector-wrap,
    #todo-action-bar .energy-selector-wrap {
      flex: 1 1 auto;
      display: inline-flex;
      padding: 0;
    }
    #sheet-task-composer #todo-action-bar .energy-icon-cycle-btn,
    #todo-action-bar .energy-icon-cycle-btn {
      width: 100%;
      min-height: 40px;
      padding: 8px 14px;
      gap: 7px;
      justify-content: center;
    }

    /* Subtask Accordion (Strictly Hidden by Default; Uncapped Height When Expanded Inside Card) */
    .subtasks-accordion {
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      margin-top: 0;
      margin-left: 0;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      pointer-events: none;
      transition: opacity 0.24s var(--spring-fluid), margin-top 0.24s var(--spring-fluid);
    }
    .task-card.expanded .subtasks-accordion {
      max-height: none;
      opacity: 1;
      margin-top: 10px;
      overflow: visible;
      pointer-events: auto;
    }
    .subtasks-accordion .subtasks-wrapper,
    .subtasks-accordion .btn-reveal-subtask-input,
    .subtasks-accordion .subtask-add-row {
      margin-left: 30px;
      max-width: calc(100% - 30px);
      box-sizing: border-box;
    }
    .subtasks-wrapper {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .subtask-item {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 5px 8px;
      border-radius: 10px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      transition: all 0.22s var(--spring-fluid);
    }
    .subtask-check-btn {
      width: 18px;
      height: 18px;
      border-radius: 6px;
      border: 1.8px solid var(--accent-primary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      background: transparent;
      color: var(--accent-contrast);
      transition: all 0.2s var(--spring-bounce);
    }
    .subtask-check-btn.checked {
      background: var(--accent-primary);
    }
    .subtask-check-btn svg {
      width: 12px;
      height: 12px;
      stroke-width: 3;
      transform: scale(0);
      transition: transform 0.2s var(--spring-bounce);
    }
    .subtask-check-btn.checked svg {
      transform: scale(1);
    }
    .subtask-title {
      flex: 1;
      font-size: 13.5px;
      font-weight: 500;
      color: var(--text-primary);
      word-break: break-word;
    }
    .subtask-item.done .subtask-title {
      text-decoration: line-through;
      color: var(--text-muted);
    }
    .subtask-del-btn {
      font-size: 12px;
      color: var(--text-muted);
      padding: 2px 6px;
      border-radius: 6px;
    }
    .subtask-del-btn:hover {
      color: #EF4444;
    }
    .subtask-add-row {
      display: none;
      align-items: center;
      gap: 8px;
      margin-top: 8px;
      animation: paneEnter 0.18s var(--spring-fluid);
    }
    .subtask-add-row.open {
      display: flex;
    }
    .btn-reveal-subtask-input {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 4px;
      padding: 4px 10px;
      border-radius: 9px;
      font-size: 12.5px;
      font-weight: 700;
      color: var(--accent-primary);
      background: transparent;
      cursor: pointer;
    }
    .btn-reveal-subtask-input:hover,
    .btn-reveal-subtask-input:active {
      background: var(--bg-elevated);
    }
    .subtask-inline-input {
      flex: 1;
      padding: 7px 11px;
      border-radius: 10px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-strong);
      font-size: 13px;
      color: var(--text-primary);
    }
    .subtask-count-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 8px;
      background: var(--bg-elevated);
      color: var(--accent-primary);
      font-size: 11px;
      font-weight: 700;
    }

    /* Color-Coded Task Tags (With Glowing Selection Aura) & Google Calendar Imported Event Cards */
    .task-tag-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 8px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.01em;
      border: 1px solid transparent;
      box-shadow: 0 0 10px var(--tag-glow-color, rgba(59, 130, 246, 0.28));
      transition: box-shadow 0.22s ease, transform 0.18s ease;
    }
    .task-card.gcal-event-card,
    .detailed-board-card.gcal-event-card {
      border-left: 4px solid #3B82F6 !important;
      background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-surface) 38%);
    }
    .gcal-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 7px;
      background: rgba(59, 130, 246, 0.14);
      color: #2563EB;
      border: 1px solid rgba(59, 130, 246, 0.3);
      font-size: 10.5px;
      font-weight: 750;
      line-height: 1.25;
      white-space: nowrap;
      flex-shrink: 0;
    }
    body.dark-mode .gcal-badge,
    html.dark .gcal-badge,
    [data-theme="dark"] .gcal-badge {
      background: rgba(59, 130, 246, 0.2);
      color: #93C5FD;
      border-color: rgba(96, 165, 250, 0.35);
    }
    .tag-color-dot {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid transparent;
      transition: transform 0.18s var(--spring-bounce), box-shadow 0.2s ease;
    }
    .tag-color-dot.selected,
    .tag-color-dot.active {
      transform: scale(1.22);
      border-color: var(--text-primary);
      box-shadow: 0 0 12px currentColor;
    }
    @keyframes taskFluidGlide {
      0% { opacity: 0.45; transform: translateY(14px) scale(0.985); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    .task-glide-anim {
      animation: taskFluidGlide 0.38s var(--spring-fluid);
    }
    .mini-opt-btn {
      min-height: 36px;
      padding: 6px 12px;
      border-radius: 12px;
      background: var(--bg-elevated);
      color: var(--text-primary);
      font-size: 12.5px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      flex-shrink: 0;
      border: 1px solid transparent;
    }
    .mini-opt-btn.active-date-pill {
      background: var(--accent-glow);
      color: var(--accent-primary);
      border-color: var(--accent-primary);
      font-weight: 700;
    }
    .mini-opt-btn.danger {
      color: #EF4444;
    }

    /* Priority & Energy Glowing Indicators, Identical Frosted Popovers, Spring Reveal & 0.2s Bounce Micro-Interaction */
    @keyframes popIn {
      0% {
        opacity: 0;
        transform: scale(0.9);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }
    @keyframes iconSelectBounce {
      0%   { transform: scale(1); }
      50%  { transform: scale(1.2); }
      100% { transform: scale(1); }
    }
    .icon-bounce-ack {
      animation: iconSelectBounce 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    }

    .flag-icon[data-prio="high"] {
      color: var(--prio-high);
      fill: var(--prio-high);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .flag-icon[data-prio="mid"] {
      color: var(--prio-mid);
      fill: var(--prio-mid);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .flag-icon[data-prio="low"] {
      color: var(--prio-low);
      fill: var(--prio-low);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .flag-icon[data-prio="none"] { color: var(--prio-none); fill: none; filter: none; }

    .opt-prio[data-prio="high"],
    #btn-composer-prio[data-prio="high"] {
      border-color: rgba(239, 68, 68, 0.55);
      box-shadow: 0 0 14px rgba(239, 68, 68, 0.28);
      color: var(--prio-high);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .opt-prio[data-prio="mid"],
    #btn-composer-prio[data-prio="mid"] {
      border-color: rgba(245, 158, 11, 0.55);
      box-shadow: 0 0 14px rgba(245, 158, 11, 0.28);
      color: var(--prio-mid);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .opt-prio[data-prio="low"],
    #btn-composer-prio[data-prio="low"] {
      border-color: rgba(59, 130, 246, 0.55);
      box-shadow: 0 0 14px rgba(59, 130, 246, 0.28);
      color: var(--prio-low);
      filter: drop-shadow(0px 0px 4px currentColor);
    }

    .prio-popup-menu,
    .energy-popup-menu {
      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;
      position: relative;
      z-index: 30;
    }
    .prio-popup-menu.open,
    .energy-popup-menu.open {
      display: flex;
    }
    .prio-choice-btn,
    .energy-choice-btn,
    .energy-choice-pill {
      flex: 1 1 68px;
      min-width: 0;
      min-height: 34px;
      padding: 6px 8px;
      border-radius: 10px;
      font-size: 12px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      background: var(--bg-surface);
      border: 1px solid rgba(128, 128, 128, 0.15);
      white-space: nowrap;
      box-sizing: border-box;
      cursor: pointer;
      transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.18s ease, background-color 0.2s ease;
    }
    .prio-choice-btn.selected,
    .energy-choice-btn.selected,
    .energy-choice-pill.selected {
      border-color: currentColor;
      box-shadow: 0 0 14px currentColor;
    }
    .energy-choice-btn[data-energy-val="high"],
    .energy-choice-pill[data-energy-val="high"] {
      color: #F97316;
    }
    .energy-choice-btn[data-energy-val="mid"],
    .energy-choice-pill[data-energy-val="mid"] {
      color: #F59E0B;
    }
    .energy-choice-btn[data-energy-val="low"],
    .energy-choice-pill[data-energy-val="low"] {
      color: #10B981;
    }
    .energy-choice-btn[data-energy-val="none"] {
      color: var(--prio-none);
    }

    .energy-selector-wrap {
      display: inline-flex;
      align-items: center;
      flex-shrink: 1;
      min-width: 0;
      max-width: 100%;
    }
    .energy-icon-cycle-btn {
      min-height: 36px;
      padding: 6px 10px;
      border-radius: 12px;
      font-size: 12.5px;
      font-weight: 600;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      background: var(--bg-elevated);
      border: 1px solid transparent;
      color: var(--text-primary);
      cursor: pointer;
      flex-shrink: 1;
      min-width: 0;
      max-width: 100%;
      white-space: nowrap;
      box-sizing: border-box;
      transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .energy-icon-cycle-btn .energy-glyph {
      display: inline-block;
      font-size: 14px;
      line-height: 1;
    }
    .energy-icon-cycle-btn[data-energy="none"] .energy-glyph {
      opacity: 0.55;
      filter: grayscale(0.75);
    }
    .energy-icon-cycle-btn[data-energy="high"] {
      color: #F97316;
      border-color: rgba(249, 115, 22, 0.55);
      box-shadow: 0 0 14px rgba(249, 115, 22, 0.28);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .energy-icon-cycle-btn[data-energy="mid"] {
      color: #F59E0B;
      border-color: rgba(245, 158, 11, 0.55);
      box-shadow: 0 0 14px rgba(245, 158, 11, 0.26);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .energy-icon-cycle-btn[data-energy="low"] {
      color: #10B981;
      border-color: rgba(16, 185, 129, 0.55);
      box-shadow: 0 0 14px rgba(16, 185, 129, 0.26);
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .task-energy-indicator {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      line-height: 1;
      padding: 2px 5px;
      border-radius: 7px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      flex-shrink: 0;
      color: #F97316;
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .task-energy-indicator[data-energy="mid"] {
      color: #F59E0B;
      filter: drop-shadow(0px 0px 4px currentColor);
    }
    .task-energy-indicator[data-energy="low"] {
      color: #10B981;
      filter: drop-shadow(0px 0px 4px currentColor);
    }

    /* Pillar 4: Insight Tab Staggered Slide-Up/Fade-In & SVG Physical Draw Animations */
    @keyframes insightCardSlideUp {
      0% {
        opacity: 0;
        transform: translate3d(0, 22px, 0) scale(0.985);
      }
      100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
      }
    }
    #tab-insight.active .squircle-card {
      opacity: 0;
      animation: insightCardSlideUp 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
      will-change: transform, opacity;
    }
    #tab-insight.active .kpi-grid .squircle-card:nth-child(1) { animation-delay: 0.03s; }
    #tab-insight.active .kpi-grid .squircle-card:nth-child(2) { animation-delay: 0.09s; }
    #tab-insight.active .kpi-grid .squircle-card:nth-child(3) { animation-delay: 0.15s; }
    #tab-insight.active > .squircle-card:nth-of-type(1) { animation-delay: 0.20s; }
    #tab-insight.active > .squircle-card:nth-of-type(2) { animation-delay: 0.26s; }
    #tab-insight.active > .squircle-card:nth-of-type(3) { animation-delay: 0.32s; }
    #tab-insight.active > .squircle-card:nth-of-type(4) { animation-delay: 0.38s; }
    #tab-insight.active > .squircle-card:nth-of-type(5) { animation-delay: 0.44s; }
    #tab-insight.active > .squircle-card:nth-of-type(6) { animation-delay: 0.48s; }
    #tab-insight.active .review-cards-grid .squircle-card:nth-child(1) { animation-delay: 0.50s; }
    #tab-insight.active .review-cards-grid .squircle-card:nth-child(2) { animation-delay: 0.56s; }

    #svg-ring-score,
    #svg-ring-focus,
    #svg-ring-habits,
    #svg-task-completion-arc,
    #svg-task-friction-arc {
      transition: stroke-dashoffset 0.95s cubic-bezier(0.22, 1, 0.36, 1), stroke-dasharray 0.95s cubic-bezier(0.22, 1, 0.36, 1) !important;
      will-change: stroke-dashoffset;
    }
    #svg-trend-line {
      transition: stroke-dashoffset 1.15s cubic-bezier(0.22, 1, 0.36, 1);
      will-change: stroke-dashoffset;
      filter: drop-shadow(0 4px 10px rgba(255, 85, 0, 0.28));
    }
    #svg-trend-area {
      transition: opacity 0.85s ease;
    }
    #card-insight-7day-curve {
      position: relative;
      background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.25);
      padding: 18px 18px 14px;
    }
    .insight-trend-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 14px;
    }
    .insight-trend-badges {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .insight-trend-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 9px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: -0.01em;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      color: var(--text-secondary);
    }
    .insight-trend-pill.peak {
      background: var(--accent-soft);
      border-color: rgba(255, 85, 0, 0.24);
      color: var(--accent-primary);
    }
    #svg-trend-points .trend-point-group {
      cursor: pointer;
    }
    #svg-trend-points .trend-pt-halo {
      transition: r 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
      transform-origin: center;
    }
    #svg-trend-points .trend-pt-dot {
      transition: r 0.22s cubic-bezier(0.22, 1, 0.36, 1), stroke-width 0.22s ease;
    }
    #svg-trend-points .trend-point-group:hover .trend-pt-halo {
      r: 13px;
      opacity: 0.32;
    }
    #svg-trend-points .trend-point-group:hover .trend-pt-dot {
      r: 6.5px;
    }
    #insights-axis-days {
      display: grid;
      grid-template-columns: repeat(var(--axis-cols, 7), minmax(0, 1fr));
      gap: 2px;
      align-items: center;
      width: 100%;
      margin-top: 6px;
      text-align: center;
    }
    .insight-axis-day-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-width: 0;
      padding: 5px 3px;
      border-radius: 8px;
      border: 1px solid transparent;
      font-size: 10.5px;
      line-height: 1.1;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: pointer;
      transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
      user-select: none;
    }
    .insight-axis-day-btn:hover {
      background: var(--bg-surface);
      color: var(--text-primary);
    }
    .insight-axis-day-btn.is-today {
      background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
      border-color: color-mix(in srgb, var(--accent-primary) 28%, transparent);
      color: var(--accent-primary);
      font-weight: 800;
    }

    /* D3.js 30-Day Task Completion Velocity Bar Chart Card */
    #card-insight-30d-d3-velocity {
      position: relative;
      background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.25);
      padding: 18px 18px 15px;
      overflow: visible !important;
    }
    .d3-velocity-controls {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 3px;
      border-radius: 10px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
    }
    .d3-velocity-mode-btn {
      appearance: none;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-family: var(--font-sans);
      font-size: 10.5px;
      font-weight: 700;
      padding: 4px 8px;
      border-radius: 7px;
      cursor: pointer;
      transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
      line-height: 1.1;
    }
    .d3-velocity-mode-btn:hover {
      color: var(--text-primary);
    }
    .d3-velocity-mode-btn.active {
      background: var(--accent-soft);
      color: var(--accent-primary);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    }
    .d3-velocity-kpi-strip {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
      margin-bottom: 12px;
    }
    .d3-velocity-kpi-cell {
      padding: 7px 9px;
      border-radius: 11px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      min-width: 0;
    }
    .d3-velocity-kpi-lbl {
      font-size: 9.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .d3-velocity-kpi-val {
      font-family: var(--font-display);
      font-size: 14px;
      font-weight: 800;
      color: var(--text-primary);
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #d3-velocity-chart-wrap {
      width: 100%;
      height: 228px;
      position: relative;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      touch-action: pan-y;
      overscroll-behavior-x: contain;
    }
    #d3-velocity-svg {
      display: block;
      width: 100%;
      height: 100%;
      overflow: visible;
      touch-action: pan-y;
    }
    #d3-velocity-svg .d3-vel-bar {
      cursor: pointer;
      transform-box: fill-box;
      transform-origin: center bottom;
      transition:
        filter 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        stroke-width 0.22s ease;
    }
    #d3-velocity-svg .d3-vel-bar.is-dimmed,
    #d3-velocity-svg .d3-prio-seg.is-dimmed {
      opacity: 0.42;
    }
    #d3-velocity-svg .d3-prio-seg {
      transition: opacity 0.22s ease, filter 0.22s ease;
    }
    #d3-velocity-svg .d3-prio-seg.is-hovered {
      opacity: 1 !important;
      filter: brightness(1.12);
    }
    #d3-velocity-svg .d3-vel-bar:hover,
    #d3-velocity-svg .d3-vel-bar.is-hovered {
      opacity: 1 !important;
      transform: scaleY(1.035);
      filter: brightness(1.15) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.26));
    }
    #d3-velocity-svg .d3-axis path,
    #d3-velocity-svg .d3-axis line {
      stroke: var(--border-subtle);
    }
    #d3-velocity-svg .d3-axis text {
      fill: var(--text-muted);
      font-family: var(--font-mono, monospace);
      font-size: 9.5px;
      font-weight: 600;
    }
    .d3-velocity-tooltip {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 35;
      pointer-events: none;
      min-width: 194px;
      max-width: 238px;
      padding: 10px 12px;
      border-radius: 14px;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border, var(--border-strong));
      box-shadow: var(--glass-shadow), 0 14px 32px rgba(0, 0, 0, 0.22);
      opacity: 0;
      will-change: transform, opacity, left, top;
      transform: translate3d(0, 8px, 0) scale(0.96);
      transition:
        opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
        left 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        top 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.24s ease;
      font-size: 11px;
      color: var(--text-primary);
    }
    .d3-velocity-tooltip.is-visible {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }
    .d3-vel-tt-metrics {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      margin-top: 7px;
      padding: 6px 8px;
      border-radius: 10px;
      background: color-mix(in srgb, var(--glass-bg) 65%, var(--bg-elevated));
      border: 1px solid var(--glass-border, var(--border-subtle));
    }
    .d3-vel-tt-metric-lbl {
      font-size: 9px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
    }
    .d3-vel-tt-metric-val {
      font-family: var(--font-display);
      font-size: 13.5px;
      font-weight: 800;
      color: var(--text-primary);
      margin-top: 1px;
    }
    .d3-velocity-legend {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--border-subtle);
      font-size: 10.5px;
      font-weight: 600;
      color: var(--text-muted);
    }
    #card-insight-30d-d3-trends {
      position: relative;
      background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.25);
      padding: 18px 18px 15px;
      overflow: visible !important;
    }
    #d3-trends-chart-wrap {
      width: 100%;
      height: 220px;
      position: relative;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      touch-action: pan-y;
      overscroll-behavior-x: contain;
    }
    #d3-trends-svg {
      display: block;
      width: 100%;
      height: 100%;
      overflow: visible;
      touch-action: pan-y;
    }
    #d3-trends-svg .d3-axis path,
    #d3-trends-svg .d3-axis line {
      stroke: var(--border-subtle);
    }
    #d3-trends-svg .d3-axis text {
      fill: var(--text-muted);
      font-family: var(--font-mono, monospace);
      font-size: 9.5px;
      font-weight: 600;
    }
    #d3-trends-svg .d3-wk-bar {
      cursor: pointer;
      transition: opacity 0.2s ease, filter 0.2s ease;
    }
    #d3-trends-svg .d3-wk-bar.is-dimmed {
      opacity: 0.42;
    }
    .d3-chart-empty-overlay {
      position: absolute;
      inset: 14px 12px 26px 28px;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 8px;
      padding: 14px;
      border-radius: 14px;
      background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
      border: 1px dashed var(--border-strong);
      z-index: 12;
    }
    .d3-chart-empty-overlay.is-visible {
      display: flex;
    }
    .d3-chart-empty-title {
      font-family: var(--font-display);
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .d3-chart-empty-sub {
      font-size: 11px;
      color: var(--text-muted);
      max-width: 240px;
      line-height: 1.4;
    }
    .d3-chart-empty-cta {
      appearance: none;
      border: 1px solid var(--border-strong);
      background: var(--accent-soft);
      color: var(--accent-primary);
      font-family: var(--font-sans);
      font-size: 11px;
      font-weight: 700;
      padding: 6px 14px;
      border-radius: 9px;
      cursor: pointer;
      white-space: nowrap;
      transition: transform 0.16s ease, background 0.16s ease;
    }
    .d3-chart-empty-cta:hover {
      background: var(--accent-primary);
      color: var(--accent-contrast, #FFFFFF);
    }
    @media (max-width: 440px) {
      .d3-velocity-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    /* Insight Header, Streak Pill Row & Master Timeframe Range Filter Bar (7d, 30d, 90d) */
    #tab-insight .insight-page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 18px;
      padding-top: 6px;
      margin-bottom: 12px;
    }
    #insight-streak-banner {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex-wrap: nowrap;
      flex-shrink: 0;
    }
    #insight-streak-banner .streak-badge,
    #insight-streak-banner .reward-shield-pill-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      height: 30px;
      min-height: 30px;
      padding: 0 9px;
      border-radius: 10px;
      font-size: 11.5px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
      box-sizing: border-box;
    }
    #insight-streak-banner .streak-badge-best {
      background: var(--bg-elevated);
      color: var(--text-secondary);
      border-color: var(--border-strong);
    }
    .insight-global-range-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 6px 8px 6px 14px;
      margin-bottom: 14px;
      border-radius: 14px;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.14);
      box-sizing: border-box;
    }
    .insight-global-range-label {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }
    .insight-global-range-meta {
      font-family: var(--font-display);
      font-size: 12.5px;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    .insight-global-range-seg {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 3px;
      border-radius: 10px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      flex-shrink: 0;
    }
    .insight-global-range-btn {
      appearance: none;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-secondary);
      font-family: var(--font-display);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: -0.01em;
      padding: 0 13px;
      height: 28px;
      min-height: 28px;
      min-width: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 7px;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
    }
    .insight-global-range-btn:hover {
      color: var(--text-primary);
    }
    .insight-global-range-btn.active {
      background: var(--accent-primary);
      color: var(--accent-contrast, #FFFFFF);
      border-color: var(--accent-primary);
      box-shadow: 0 2px 8px -2px var(--accent-glow, rgba(255, 107, 43, 0.35));
    }

    /* D3.js Completed Tasks by Category Doughnut Chart Card */
    #card-insight-category-doughnut {
      position: relative;
      background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.25);
      padding: 18px 18px 15px;
      overflow: visible !important;
    }
    .d3-cat-doughnut-layout {
      display: grid;
      grid-template-columns: 168px minmax(0, 1fr);
      gap: 18px;
      align-items: center;
    }
    .d3-cat-doughnut-stage {
      position: relative;
      width: 168px;
      height: 168px;
      margin: 0 auto;
      flex-shrink: 0;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      touch-action: pan-y;
      overscroll-behavior-x: contain;
    }
    #d3-category-doughnut-svg {
      display: block;
      width: 100%;
      height: 100%;
      overflow: visible;
      touch-action: pan-y;
    }
    #d3-category-doughnut-svg .d3-cat-arc {
      cursor: pointer;
      transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), filter 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }
    #d3-category-doughnut-svg .d3-cat-arc.is-dimmed {
      opacity: 0.34;
    }
    #d3-category-doughnut-svg .d3-cat-arc.is-active {
      opacity: 1;
      filter: brightness(1.08) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.24));
    }
    .d3-cat-center-readout {
      position: absolute;
      inset: 28px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      pointer-events: none;
      padding: 4px;
    }
    .d3-cat-center-val {
      font-family: var(--font-display);
      font-size: 24px;
      font-weight: 800;
      line-height: 1.05;
      letter-spacing: -0.03em;
      color: var(--text-primary);
    }
    .d3-cat-center-lbl {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-secondary);
      margin-top: 3px;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .d3-cat-center-sub {
      font-size: 10px;
      font-weight: 600;
      color: var(--text-muted);
      margin-top: 1px;
      min-height: 13px;
    }
    .d3-cat-legend-col {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .d3-cat-legend-list {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .d3-cat-legend-row {
      appearance: none;
      width: 100%;
      min-height: 40px;
      padding: 6px 8px;
      border: none;
      border-radius: 10px;
      background: transparent;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      text-align: left;
      cursor: pointer;
      transition: background-color 0.16s ease, opacity 0.16s ease;
    }
    .d3-cat-legend-row:hover,
    .d3-cat-legend-row.is-active {
      background: color-mix(in srgb, var(--bg-elevated) 72%, var(--border-subtle));
    }
    .d3-cat-legend-row.is-dimmed {
      opacity: 0.45;
    }
    .d3-cat-legend-row:focus-visible {
      outline: 2px solid var(--accent-primary);
      outline-offset: 1px;
    }
    .d3-cat-legend-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      width: 100%;
    }
    .d3-cat-legend-name-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
    }
    .d3-cat-legend-swatch {
      width: 9px;
      height: 9px;
      border-radius: 3px;
      flex-shrink: 0;
    }
    .d3-cat-legend-name {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .d3-cat-legend-meta {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text-secondary);
      white-space: nowrap;
      flex-shrink: 0;
    }
    .d3-cat-legend-bar-track {
      width: 100%;
      height: 4px;
      border-radius: 99px;
      background: var(--border-subtle);
      overflow: hidden;
    }
    .d3-cat-legend-bar-fill {
      height: 100%;
      border-radius: 99px;
      transition: width 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .d3-cat-unused-note {
      font-size: 11px;
      font-weight: 500;
      color: var(--text-muted);
      padding: 4px 8px 0;
      line-height: 1.4;
    }
    .d3-cat-legend-chevron {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-muted);
      margin-left: 3px;
      opacity: 0.7;
    }
    .d3-cat-expand-btn {
      width: 100%;
      margin-top: 10px;
      padding: 7px 10px 2px;
      border: none;
      border-top: 1px solid var(--border-subtle);
      background: transparent;
      color: var(--text-muted);
      font-size: 11.5px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      cursor: pointer;
      transition: color 0.16s ease;
    }
    .d3-cat-expand-btn:hover {
      color: var(--text-primary);
    }
    .d3-cat-expand-chevron {
      width: 15px;
      height: 15px;
      transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      flex-shrink: 0;
    }
    .d3-cat-expand-btn[aria-expanded="true"] .d3-cat-expand-chevron {
      transform: rotate(180deg);
    }
    .d3-cat-empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 8px;
      padding: 22px 14px 18px;
      border-radius: 14px;
      background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
      border: 1px dashed var(--border-strong);
      margin-bottom: 4px;
    }
    @media (max-width: 420px) {
      .d3-cat-doughnut-layout {
        grid-template-columns: 1fr;
        gap: 14px;
      }
      .d3-cat-doughnut-stage {
        width: 176px;
        height: 176px;
      }
    }
    /* Task Category Management System Styles */
    .todo-category-filter-bar {
      display: flex;
      align-items: center;
      gap: 0;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      touch-action: pan-x;
      padding: 4px 2px 10px 2px;
      margin-bottom: 4px;
      scrollbar-width: none;
      -ms-overflow-style: none;
      -webkit-overflow-scrolling: touch;
    }
    .todo-category-filter-bar::-webkit-scrollbar {
      display: none;
    }
    .todo-cat-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      margin-right: 7px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      color: var(--text-secondary);
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      white-space: nowrap;
      cursor: pointer;
      transition:
        max-width 0.34s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
        padding 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        margin 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
      flex-shrink: 0;
      overflow: hidden;
      max-width: 240px;
    }
    .todo-cat-chip:hover {
      border-color: var(--border-focus);
      color: var(--text-primary);
    }
    .todo-cat-chip.active {
      background: var(--cat-chip-bg, var(--accent-soft));
      color: var(--cat-chip-color, var(--accent-primary));
      border-color: var(--cat-chip-border, var(--accent-primary));
      box-shadow: 0 2px 10px -2px var(--cat-chip-glow, rgba(59, 130, 246, 0.28));
    }
    .todo-cat-all-chevron {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 800;
      line-height: 1;
      margin-left: 1px;
      opacity: 0.8;
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .todo-category-filter-bar.tray-open .todo-cat-all-chevron {
      transform: rotate(180deg);
    }
    .todo-category-filter-bar:not(.tray-open) .todo-cat-collapsible:not(.active) {
      max-width: 0 !important;
      opacity: 0 !important;
      padding-left: 0 !important;
      padding-right: 0 !important;
      margin-right: 0 !important;
      border-left-width: 0 !important;
      border-right-width: 0 !important;
      pointer-events: none !important;
      transform: translateX(-10px) scale(0.92);
    }
    .todo-cat-chip-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .todo-cat-chip-count {
      font-size: 10.5px;
      font-weight: 800;
      padding: 1px 5px;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.16);
      color: inherit;
      opacity: 0.85;
    }
    .todo-cat-manage-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 6px 11px;
      margin-right: 7px;
      border-radius: 999px;
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text-muted);
      background: transparent;
      border: 1px dashed var(--border-subtle);
      white-space: nowrap;
      cursor: pointer;
      flex-shrink: 0;
      overflow: hidden;
      max-width: 200px;
      transition:
        max-width 0.34s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
        padding 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        margin 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease;
    }
    .todo-cat-manage-btn:hover {
      color: var(--text-primary);
      border-color: var(--text-secondary);
      background: var(--bg-elevated);
    }
    .task-cat-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 10.5px;
      font-weight: 800;
      letter-spacing: 0.02em;
      border: 1px solid transparent;
      line-height: 1.35;
      flex-shrink: 0;
    }
    .task-cat-badge-dot {
      width: 5.5px;
      height: 5.5px;
      border-radius: 50%;
      background: currentColor;
    }
    .task-inline-cat-strip {
      display: flex;
      align-items: center;
      gap: 6px;
      overflow-x: auto;
      padding: 8px 2px 2px 2px;
      margin-top: 6px;
      border-top: 1px dashed var(--border-subtle);
      scrollbar-width: none;
    }
    .task-inline-cat-strip::-webkit-scrollbar {
      display: none;
    }
    .composer-cat-bar {
      display: flex;
      align-items: center;
      gap: 6px;
      overflow-x: auto;
      padding: 2px 0 6px 0;
      scrollbar-width: none;
    }
    .composer-cat-bar::-webkit-scrollbar {
      display: none;
    }
    /* Modern Minimalistic Glassmorphism Task Category Manager & App-Wide Dragging */
    #sheet-task-category-manager .bottom-sheet {
      background: rgba(255, 255, 255, 0.78) !important;
      background-color: rgba(255, 255, 255, 0.78) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.7) !important;
    }
    body.dark-mode #sheet-task-category-manager .bottom-sheet,
    html.dark #sheet-task-category-manager .bottom-sheet,
    [data-theme="dark"] #sheet-task-category-manager .bottom-sheet {
      background: rgba(12, 12, 16, 0.76) !important;
      background-color: rgba(12, 12, 16, 0.76) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    #sheet-task-category-manager .cat-composer-glass {
      background: var(--glass-bg) !important;
      border: 1px solid var(--glass-border) !important;
      box-shadow: var(--glass-shadow);
      border-radius: 20px;
    }
    #category-manager-list {
      padding: 2px 2px 10px 2px;
      overscroll-behavior: contain;
    }
    #category-manager-list.cat-dragging-active,
    #category-manager-list.cat-dragging-active .cat-manager-item {
      touch-action: none !important;
      overscroll-behavior: none !important;
    }
    .cat-manager-item {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 11px 14px;
      border-radius: 18px;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      box-shadow: var(--glass-shadow);
      transition: transform 0.2s var(--spring-fluid), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.18s ease;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      touch-action: pan-y;
    }
    .cat-manager-item:hover {
      border-color: var(--border-strong);
    }
    .cat-manager-item.cat-sortable-ghost {
      opacity: 0.22 !important;
      background: var(--surface-variant, var(--bg-elevated)) !important;
      border-color: transparent !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      transition: opacity 0.15s ease !important;
    }
    .cat-manager-item.cat-drag-fallback {
      position: fixed !important;
      z-index: 100300 !important;
      margin: 0 !important;
      border-radius: 18px !important;
      pointer-events: none !important;
      will-change: transform !important;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      background: rgba(255, 255, 255, 0.74) !important;
      border: 1px solid rgba(255, 255, 255, 0.85) !important;
      box-shadow: 0 20px 44px -8px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
      color: var(--text-primary) !important;
      opacity: 1 !important;
    }
    body.dark-mode .cat-manager-item.cat-drag-fallback,
    html.dark .cat-manager-item.cat-drag-fallback,
    [data-theme="dark"] .cat-manager-item.cat-drag-fallback {
      background: rgba(22, 22, 28, 0.72) !important;
      border: 1px solid rgba(255, 255, 255, 0.14) !important;
      box-shadow: 0 22px 48px -8px rgba(0, 0, 0, 0.72), 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    }
    .cat-drag-grip {
      width: 24px;
      height: 28px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      opacity: 0.6;
      cursor: grab;
      touch-action: none !important;
      border-radius: 8px;
      flex-shrink: 0;
      transition: opacity 0.18s ease, color 0.18s ease, background-color 0.18s ease;
    }
    .cat-manager-item:hover .cat-drag-grip,
    .cat-drag-grip:focus-visible {
      opacity: 0.95;
      color: var(--text-secondary);
    }
    .cat-drag-grip:active {
      cursor: grabbing;
      color: var(--accent-primary);
      opacity: 1;
    }
    .cat-mgr-count-pill {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      background: rgba(148, 163, 184, 0.12);
      padding: 2px 8px;
      border-radius: 999px;
      flex-shrink: 0;
      letter-spacing: 0.01em;
    }
    .btn-cat-remove-minimal {
      width: 30px;
      height: 30px;
      padding: 0;
      border-radius: 10px;
      background: transparent;
      border: none;
      color: var(--text-muted);
      opacity: 0.68;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      cursor: pointer;
      transition: opacity 0.18s ease, color 0.18s ease, background-color 0.18s ease, transform 0.18s var(--spring-fluid);
    }
    .btn-cat-remove-minimal:hover {
      opacity: 1;
      color: #EF4444;
      background: rgba(239, 68, 68, 0.12);
    }
    .btn-cat-remove-minimal:active {
      transform: scale(0.9);
    }
    /* Habit Notification Schedule Styles (aligned with Anti-Task Reminder Schedule) */
    .habit-notif-schedule-card {
      padding: 12px 14px;
      margin-bottom: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .habit-nudge-days-row {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 5px;
    }
    .habit-nudge-day-btn {
      min-height: 32px;
      border-radius: 9px;
      border: 1px solid var(--border-subtle);
      background: var(--bg-elevated, var(--bg-surface));
      color: var(--text-muted);
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
    }
    .habit-nudge-day-btn.active {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      color: var(--accent-contrast);
    }
    .habit-preset-time-chip {
      padding: 4px 9px;
      border-radius: 8px;
      font-size: 11px;
      font-weight: 700;
      background: var(--bg-elevated);
      color: var(--text-secondary);
      border: 1px solid var(--border-subtle);
      cursor: pointer;
      transition: all 0.18s ease;
    }
    .habit-preset-time-chip.active {
      background: var(--accent-soft);
      color: var(--accent-primary);
      border-color: var(--accent-primary);
    }
    .habit-card-nudge-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 10.5px;
      font-weight: 700;
      background: var(--bg-elevated);
      color: var(--text-secondary);
      border: 1px solid var(--border-subtle);
    }
    .habit-card-nudge-pill.active {
      color: var(--accent-primary);
      background: var(--accent-soft);
      border-color: rgba(59, 130, 246, 0.35);
    }
    .d3-velocity-legend-items {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .d3-velocity-legend-item {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .d3-velocity-scale-ramp {
      width: 68px;
      height: 8px;
      border-radius: 99px;
      display: inline-block;
      border: 1px solid var(--border-subtle);
      box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
    }
    .d3-velocity-swatch {
      width: 8px;
      height: 8px;
      border-radius: 2.5px;
      display: inline-block;
    }

    /* Pillar 3: Insights UI Layout Bounds & Overflow Prevention */
    #tab-insight {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      overflow-x: hidden;
      padding: 0 16px calc(env(safe-area-inset-bottom, 24px) + 92px);
    }
    #tab-insight .squircle-card,
    #tab-insight .kpi-grid,
    #tab-insight .streak-hero-banner,
    #tab-insight .review-cards-grid {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      overflow: hidden;
      overflow-wrap: break-word;
      word-wrap: break-word;
    }
    .insight-expand-toggle {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-family: var(--font-display);
      font-size: 11.5px;
      font-weight: 700;
      color: var(--accent-primary);
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 999px;
      padding: 4px 10px;
      cursor: pointer;
      transition: transform 0.18s var(--spring-bounce), background-color 0.2s ease;
    }
    .insight-expand-toggle:active {
      transform: scale(0.95);
    }
    .insight-collapsible-body {
      display: none;
      margin-top: 8px;
      animation: paneEnter 0.22s var(--spring-fluid);
    }
    .insight-collapsible-body.expanded {
      display: block;
    }
    .task-inbox-badge {
      display: inline-flex;
      align-items: center;
      padding: 1px 7px;
      border-radius: 6px;
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      background: var(--bg-elevated);
      color: var(--text-muted);
      border: 1px solid var(--border-subtle);
    }

    /* Brain Dump Fullscreen Rapid Capture Modal */
    .brain-dump-modal {
      position: fixed;
      inset: 0;
      z-index: 10000;
      background: var(--bg-canvas);
      color: var(--text-primary);
      display: none;
      flex-direction: column;
      padding: max(24px, env(safe-area-inset-top, 24px)) 24px max(24px, env(safe-area-inset-bottom, 24px));
      animation: paneEnter 0.26s var(--spring-fluid);
    }
    .brain-dump-modal.open {
      display: flex;
    }
    .brain-dump-inner {
      max-width: 780px;
      width: 100%;
      margin: 0 auto;
      flex: 1;
      display: flex;
      flex-direction: column;
    }
    .brain-dump-textarea {
      flex: 1;
      width: 100%;
      border: none !important;
      outline: none !important;
      background: transparent !important;
      box-shadow: none !important;
      color: var(--text-primary);
      font-family: var(--font-body);
      font-size: clamp(18px, 2.6vw, 22px);
      font-weight: 500;
      line-height: 1.65;
      resize: none;
      padding: 12px 0;
    }
    .brain-dump-textarea::placeholder {
      color: var(--text-muted);
      opacity: 0.65;
    }

    .fab-cluster {
      position: fixed;
      right: max(20px, calc((100vw - 760px) / 2 + 20px));
      bottom: calc(env(safe-area-inset-bottom, 16px) + 80px);
      z-index: 999;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 10px;
      pointer-events: none;
    }
    body[data-action-sub="antitasks"] #action-todo-fab-cluster,
    body[data-mind-sub="journal"] #mind-notes-fab-cluster,
    body:not([data-mind-sub="journal"]) #mind-journal-fab-cluster {
      display: none !important;
    }
    .fab-sub {
      pointer-events: auto;
      width: 48px;
      height: 48px;
      border-radius: 24px;
      background: var(--bg-surface);
      color: var(--text-primary);
      border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-soft);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
    }
    /* Expanding In-Place Search Pill (Circle -> Pill Input Bar with Liquid Spring Physics) */
    .fab-search-pill {
      pointer-events: auto;
      width: 48px;
      height: 48px;
      border-radius: 24px;
      background: var(--bg-glass);
      color: var(--text-primary);
      border: 1.5px solid var(--border-strong);
      box-shadow: var(--shadow-float);
      display: flex;
      align-items: center;
      overflow: hidden;
      margin-right: 5px;
      transform-origin: center center;
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, width 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.28s cubic-bezier(0.22, 1, 0.36, 1), margin-right 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
      will-change: width, border-radius, transform, opacity;
    }
    .fab-search-pill.expanded {
      width: min(340px, calc(100vw - 32px));
      border-radius: 999px;
      background: var(--bg-surface, rgba(255, 255, 255, 0.94));
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-color: var(--accent-primary, #0d9488);
      box-shadow: 0 10px 32px -6px rgba(13, 148, 136, 0.28), 0 4px 16px rgba(15, 23, 42, 0.12);
      margin-right: 0;
      padding: 0 4px;
    }

    body.dark-mode .fab-search-pill.expanded,
    html.dark .fab-search-pill.expanded,
    [data-theme="dark"] .fab-search-pill.expanded {
      background: rgba(24, 24, 29, 0.94);
      box-shadow: 0 14px 38px -8px rgba(0, 0, 0, 0.65), 0 4px 18px rgba(0, 0, 0, 0.4);
    }
    /* Mind/Focus Scroll-to-Hide Pills (To-Do Avatar + Search 🔍 are grouped via actual scroll-only .hidden state) */
    body.workspace-scrolled-down .fab-search-pill:not(#todo-fab-search-pill):not(.expanded),
    body.workspace-scrolled-down .fab-sub {
      transform: translate3d(0, -20px, 0);
      opacity: 0;
      pointer-events: none;
    }
    .fab-search-trigger {
      width: 45px;
      height: 45px;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-primary);
      background: transparent;
      cursor: pointer;
    }
    .fab-search-pill.expanded .fab-search-trigger {
      width: 38px;
      color: var(--accent-primary);
    }
    .fab-search-input {
      flex: 1;
      min-width: 0;
      width: 0;
      opacity: 0;
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text-primary);
      background: transparent;
      border: none;
      outline: none;
      padding: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    .fab-search-pill.expanded .fab-search-input {
      width: 100%;
      opacity: 1;
      padding: 0 6px 0 2px;
      pointer-events: auto;
    }
    .fab-search-aux-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      flex-shrink: 0;
      display: none;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 800;
      color: var(--accent-primary);
      background: var(--bg-elevated);
      margin-right: 6px;
      cursor: pointer;
      transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
    }
    .fab-search-close {
      display: none !important;
    }
    .fab-search-pill.expanded .fab-search-aux-btn {
      display: inline-flex;
    }
    @keyframes fabMainTabScaleIn {
      0% {
        opacity: 0;
        transform: scale(0.42);
      }
      62% {
        opacity: 1;
        transform: scale(1.07);
      }
      84% {
        transform: scale(0.98);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }
    @keyframes fabSearchPillTabScaleIn {
      0% {
        opacity: 0;
        transform: scale(0.45);
      }
      64% {
        opacity: 1;
        transform: scale(1.06);
      }
      86% {
        transform: scale(0.98);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }
    @keyframes fabMainIconTabSpin {
      0% {
        transform: scale(0.5) rotate(-90deg);
      }
      68% {
        transform: scale(1.1) rotate(8deg);
      }
      100% {
        transform: scale(1) rotate(0deg);
      }
    }
    .fab-main {
      pointer-events: auto;
      position: relative;
      z-index: 999;
      width: 58px;
      height: 58px;
      border-radius: 20px;
      background: var(--accent-primary);
      color: var(--accent-contrast);
      box-shadow: 0 12px 28px var(--accent-glow);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transform-origin: center center;
      will-change: transform, opacity;
      transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    }
    .tab-pane.active .fab-main,
    .fab-main.fab-tab-scale-in {
      animation: fabMainTabScaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }
    .tab-pane.active .fab-main svg,
    .fab-main.fab-tab-scale-in svg {
      animation: fabMainIconTabSpin 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }
    .tab-pane.active .fab-search-pill:not(.hidden):not(.expanded),
    .fab-search-pill.fab-tab-scale-in:not(.hidden):not(.expanded) {
      animation: fabSearchPillTabScaleIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }
    body.workspace-scrolled-down .fab-search-pill:not(#todo-fab-search-pill):not(.expanded) {
      animation: none;
    }
    .fab-main:active {
      transform: scale(0.91);
    }

    /* ==========================================================================
       6. TAB 2: FOCUS (POMODORO, BOTTOM AMBIENT SPEAKER, NAMED PRESETS, MISSILE MODE)
       ========================================================================== */
    .focus-top-bar {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 18px;
    }
    .mode-pill-group {
      display: inline-flex;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      padding: 4px;
      border-radius: 16px;
    }
    .mode-pill-btn {
      padding: 8px 18px;
      border-radius: 12px;
      font-family: var(--font-display);
      font-size: 13px;
      font-weight: 700;
      color: var(--text-secondary);
      min-height: 38px;
      white-space: nowrap;
      transition: background-color 0.22s ease, color 0.22s ease, transform 0.2s var(--spring-fluid);
    }
    .mode-pill-btn.active {
      background: var(--accent-primary);
      color: var(--accent-contrast);
    }

    .cycle-steps-track {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin: 8px 0 14px;
    }
    .cycle-step-dot {
      height: 8px;
      width: 24px;
      border-radius: 99px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-strong);
      transition: all 0.35s var(--spring-fluid);
    }
    .cycle-step-dot.short-break { width: 12px; }
    .cycle-step-dot.long-break  { width: 30px; }
    .cycle-step-dot.completed   { background: var(--accent-primary); opacity: 0.45; }
    .cycle-step-dot.active      { background: var(--accent-primary); transform: scaleY(1.3); box-shadow: 0 0 12px var(--accent-glow); }

    .ring-stage {
      position: relative;
      width: 286px;
      height: 286px;
      margin: 6px auto 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      touch-action: pan-y;
    }
    #missile-arena .ring-stage {
      touch-action: none;
    }
    .ring-svg {
      width: 100%;
      height: 100%;
      transform: rotate(-90deg);
    }
    .ring-track {
      fill: none;
      stroke: var(--border-strong);
      stroke-width: 10;
    }
    .ring-progress {
      fill: none;
      stroke: var(--accent-primary);
      stroke-width: 10;
      stroke-linecap: round;
      transition: stroke-dashoffset 0.18s linear;
    }
    .ring-center {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      pointer-events: none;
      padding: 0 24px;
      box-sizing: border-box;
    }
    #pomo-config-summary {
      font-family: var(--font-body);
      font-variant-numeric: tabular-nums;
      font-size: 11px;
      font-weight: 600;
      letter-spacing: -0.01em;
      line-height: 1.25;
      color: var(--text-secondary);
      margin-top: 5px;
      white-space: nowrap;
    }
    .timer-readout {
      font-family: var(--font-mono);
      font-size: 52px;
      font-weight: 700;
      letter-spacing: -0.03em;
      color: var(--text-primary);
      line-height: 1.02;
    }

    .presets-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
      gap: 10px;
      width: 100%;
      max-width: 520px;
      margin: 24px auto 0;
    }
    .preset-tile {
      min-height: 82px;
      border-radius: var(--squircle-md);
      background: var(--bg-surface);
      border: 1.5px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      padding: 10px 8px;
      color: var(--text-primary);
      position: relative;
      user-select: none;
    }
    .preset-tile.active {
      border-color: var(--accent-primary);
      background: var(--bg-elevated);
    }

    /* Bottom Minimalist Speaker Icon & Ambient Audio Selection Popup */
    .focus-bottom-speaker-wrap {
      margin: 28px auto 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
    }
    .ambient-speaker-btn {
      width: 44px;
      height: 44px;
      border-radius: 15px;
      background: var(--bg-surface);
      border: 1px solid var(--border-strong);
      color: var(--text-secondary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--shadow-soft);
    }
    .ambient-speaker-btn.playing {
      color: var(--accent-primary);
      border-color: var(--accent-primary);
      box-shadow: 0 0 18px var(--accent-glow);
    }
    .ambient-audio-popup {
      position: absolute;
      bottom: calc(100% + 10px);
      background: var(--bg-surface);
      border: 1px solid var(--border-strong);
      border-radius: var(--squircle-sm);
      box-shadow: var(--shadow-float);
      padding: 6px;
      min-width: 190px;
      display: none;
      flex-direction: column;
      gap: 4px;
      z-index: 50;
      animation: paneEnter 0.2s var(--spring-fluid);
    }
    .ambient-audio-popup.open {
      display: flex;
    }
    .ambient-opt-btn {
      padding: 9px 12px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .ambient-opt-btn.active {
      background: var(--bg-elevated);
      color: var(--accent-primary);
      font-weight: 700;
    }

    /* POMODORO TRUE FULLSCREEN LOCKDOWN & FLOW MODAL */
    #pomo-arena.pomo-fullscreen-lockdown {
      position: fixed;
      inset: 0;
      z-index: 999;
      width: 100vw;
      height: 100dvh;
      background: var(--bg-base);
      display: flex !important;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 24px;
      margin: 0;
    }
    #pomo-arena.pomo-fullscreen-lockdown #pomo-header-info,
    #pomo-arena.pomo-fullscreen-lockdown #pomo-cycle-dots,
    #pomo-arena.pomo-fullscreen-lockdown #pomo-config-summary,
    #pomo-arena.pomo-fullscreen-lockdown #pomo-target-prelaunch-wrap,
    #pomo-arena.pomo-fullscreen-lockdown #pomo-controls-row,
    #pomo-arena.pomo-fullscreen-lockdown #pomo-presets-container {
      display: none !important;
    }
    body.pomo-fullscreen-active .bottom-nav,
    body.pomo-fullscreen-active .focus-top-bar,
    body.pomo-fullscreen-active .focus-bottom-speaker-wrap {
      display: none !important;
    }
    #pomo-arena.pomo-fullscreen-lockdown .ring-stage {
      width: 316px;
      height: 316px;
      margin: 0;
    }
    #pomo-arena.pomo-fullscreen-lockdown #pomo-timer-digits {
      font-size: 68px;
    }
    .pomo-fs-subtle-exit {
      display: none;
      position: fixed;
      top: max(22px, env(safe-area-inset-top, 22px));
      right: 22px;
      z-index: 10002;
      width: 42px;
      height: 42px;
      border-radius: 14px;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      align-items: center;
      justify-content: center;
      opacity: 0.78;
      transition: opacity 0.2s ease, transform 0.2s var(--spring-bounce);
    }
    .pomo-fs-subtle-exit:hover,
    .pomo-fs-subtle-exit:active {
      opacity: 1;
      transform: scale(0.94);
    }
    #pomo-arena.pomo-fullscreen-lockdown .pomo-fs-subtle-exit {
      display: inline-flex;
    }
    .pomo-flow-modal {
      display: none;
      margin-top: 28px;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      animation: paneEnter 0.28s var(--spring-bounce);
    }
    .pomo-flow-modal.visible {
      display: flex;
    }

    /* System-Wide Modern Minimalistic Glassmorphism Timer Turn-Off Popup */
    .global-timer-alarm-bar {
      position: fixed;
      top: max(18px, env(safe-area-inset-top, 18px));
      left: 50%;
      transform: translate3d(-50%, -150%, 0) scale(0.94);
      opacity: 0;
      pointer-events: none;
      z-index: 100260;
      width: min(90vw, 376px);
      padding: 12px 14px 12px 16px;
      border-radius: 24px;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(248, 250, 252, 0.56) 100%);
      border: 1px solid rgba(255, 255, 255, 0.65);
      box-shadow:
        0 20px 48px -12px rgba(15, 23, 42, 0.18),
        0 4px 14px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
      color: #0f172a;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      transition:
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }
    body.dark-mode .global-timer-alarm-bar,
    html.dark .global-timer-alarm-bar,
    [data-theme="dark"] .global-timer-alarm-bar,
    body:has(#oled-focus-clock-modal.oled-clock-open) .global-timer-alarm-bar {
      background: linear-gradient(135deg, rgba(30, 34, 46, 0.68) 0%, rgba(15, 18, 26, 0.54) 100%);
      border: 1px solid rgba(255, 255, 255, 0.16);
      box-shadow:
        0 24px 56px -10px rgba(0, 0, 0, 0.65),
        0 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
      color: #f8fafc;
    }
    .global-timer-alarm-bar.open {
      transform: translate3d(-50%, 0, 0) scale(1);
      opacity: 1;
      pointer-events: auto;
    }
    @keyframes glassTimerOrbPulse {
      0%, 100% { transform: scale(1) translateZ(0); opacity: 0.92; }
      50% { transform: scale(1.05) translateZ(0); opacity: 1; }
    }
    .global-timer-alarm-icon {
      width: 38px;
      height: 38px;
      border-radius: 14px;
      background: rgba(15, 23, 42, 0.06);
      border: 1px solid rgba(15, 23, 42, 0.08);
      color: currentColor;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      animation: glassTimerOrbPulse 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    }
    body.dark-mode .global-timer-alarm-icon,
    html.dark .global-timer-alarm-icon,
    [data-theme="dark"] .global-timer-alarm-icon,
    body:has(#oled-focus-clock-modal.oled-clock-open) .global-timer-alarm-icon {
      background: rgba(255, 255, 255, 0.09);
      border-color: rgba(255, 255, 255, 0.16);
    }
    .global-timer-alarm-title {
      font-family: var(--font-display);
      font-weight: 700;
      font-size: 14px;
      letter-spacing: -0.01em;
      color: inherit;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .global-timer-alarm-sub {
      font-size: 12px;
      font-weight: 500;
      color: rgba(15, 23, 42, 0.58);
      margin-top: 1px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    body.dark-mode .global-timer-alarm-sub,
    html.dark .global-timer-alarm-sub,
    [data-theme="dark"] .global-timer-alarm-sub,
    body:has(#oled-focus-clock-modal.oled-clock-open) .global-timer-alarm-sub {
      color: rgba(248, 250, 252, 0.64);
    }
    .global-timer-turnoff-btn {
      height: 36px;
      padding: 0 16px;
      border-radius: 14px;
      border: 1px solid rgba(15, 23, 42, 0.12);
      background: rgba(15, 23, 42, 0.88);
      color: #ffffff;
      font-family: var(--font-display);
      font-weight: 700;
      font-size: 13px;
      letter-spacing: -0.01em;
      cursor: pointer;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
      transition: transform 0.16s ease, background 0.16s ease;
    }
    body.dark-mode .global-timer-turnoff-btn,
    html.dark .global-timer-turnoff-btn,
    [data-theme="dark"] .global-timer-turnoff-btn,
    body:has(#oled-focus-clock-modal.oled-clock-open) .global-timer-turnoff-btn {
      background: rgba(255, 255, 255, 0.92);
      color: #090a0d;
      border-color: rgba(255, 255, 255, 0.4);
      box-shadow: 0 4px 16px rgba(255, 255, 255, 0.14);
    }
    .global-timer-turnoff-btn:active {
      transform: scale(0.95);
    }

    /* MISSILE MODE TRUE FULLSCREEN LOCKDOWN (100vw x 100vh Pure Theme Takeover) */
    html.missile-lockdown-active,
    body.missile-lockdown-active {
      background-color: #FFFFFF !important;
      color: #111827 !important;
      overflow: hidden !important;
      overscroll-behavior: none !important;
      touch-action: none !important;
      user-select: none !important;
      -webkit-user-select: none !important;
      -webkit-touch-callout: none !important;
      position: fixed !important;
      inset: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
    }
    html.dark.missile-lockdown-active,
    html.dark body.missile-lockdown-active {
      background-color: #000000 !important;
      color: #FFFFFF !important;
    }
    body.missile-lockdown-active .app-shell,
    body.missile-lockdown-active #tab-focus {
      transform: none !important;
      animation: none !important;
      padding: 0 !important;
      margin: 0 !important;
      max-width: none !important;
    }
    body.missile-lockdown-active .bottom-nav,
    body.missile-lockdown-active .focus-top-bar,
    body.missile-lockdown-active .focus-bottom-speaker-wrap,
    body.missile-lockdown-active #macro-anchor-bar,
    body.missile-lockdown-active #macro-goal-banner,
    body.missile-lockdown-active .tab-watermark,
    body.missile-lockdown-active #toast-banner,
    body.missile-lockdown-active #toast-container,
    body.missile-lockdown-active #unified-app-toast,
    body.missile-lockdown-active .modern-toast,
    body.missile-lockdown-active .toast-msg,
    body.missile-lockdown-active .fab-cluster {
      display: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }
    #missile-arena.missile-lockdown {
      position: fixed !important;
      inset: 0 !important;
      z-index: 2147483647 !important;
      width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
      display: flex !important;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background-color: #FFFFFF !important;
      color: #111827 !important;
      padding: 0 !important;
      margin: 0 !important;
      border: none !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      transform: none !important;
      animation: none !important;
      overscroll-behavior: none !important;
      touch-action: none !important;
      user-select: none !important;
      -webkit-user-select: none !important;
    }
    html.dark #missile-arena.missile-lockdown {
      background-color: #000000 !important;
      color: #FFFFFF !important;
    }
    #missile-arena.missile-lockdown .missile-prelaunch-ui,
    #missile-arena.missile-lockdown #missile-dial-knob,
    #missile-arena.missile-lockdown #missile-rocket-icon,
    #missile-arena.missile-lockdown #missile-target-live-label,
    #missile-arena.missile-lockdown .missile-lockdown-hint {
      display: none !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }
    #missile-arena.missile-lockdown .ring-stage {
      width: 312px !important;
      height: 312px !important;
      margin: 0 0 36px 0 !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
    }
    #missile-arena.missile-lockdown #missile-svg {
      display: block !important;
    }
    #missile-arena.missile-lockdown #missile-ring-arc {
      stroke: #111827 !important;
    }
    html.dark #missile-arena.missile-lockdown #missile-ring-arc {
      stroke: #FFFFFF !important;
    }
    #missile-arena.missile-lockdown #missile-svg circle:first-child {
      stroke: rgba(17, 24, 39, 0.1) !important;
    }
    html.dark #missile-arena.missile-lockdown #missile-svg circle:first-child {
      stroke: rgba(255, 255, 255, 0.12) !important;
    }
    #missile-arena.missile-lockdown .ring-center {
      position: absolute !important;
      inset: 0 !important;
      pointer-events: auto;
    }
    #missile-arena.missile-lockdown #missile-timer-digits {
      font-size: 68px !important;
      font-weight: 800;
      letter-spacing: -0.04em;
      color: #111827 !important;
      line-height: 1;
    }
    html.dark #missile-arena.missile-lockdown #missile-timer-digits {
      color: #FFFFFF !important;
    }

    .long-press-abort-btn {
      position: relative;
      overflow: hidden;
      width: 118px;
      height: 62px;
      min-width: 118px;
      border-radius: 999px;
      border: 1.5px solid rgba(17, 24, 39, 0.16) !important;
      background: rgba(17, 24, 39, 0.04) !important;
      color: #111827;
      display: none;
      align-items: center;
      justify-content: center;
      user-select: none;
      -webkit-user-select: none;
      touch-action: none;
      cursor: pointer;
      box-shadow: none !important;
      transition: transform 0.2s var(--spring-bounce), opacity 0.2s ease, background-color 0.2s ease;
    }
    html.dark .long-press-abort-btn {
      color: #FFFFFF;
      border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
      background: rgba(255, 255, 255, 0.06) !important;
    }
    .long-press-abort-btn svg {
      width: 28px;
      height: 28px;
    }
    .long-press-abort-btn:active {
      transform: scale(0.95);
    }
    #missile-arena.missile-lockdown .long-press-abort-btn {
      display: inline-flex;
      margin-top: 38px !important;
    }
    .long-press-fill {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 0%;
      background: rgba(239, 68, 68, 0.55);
      pointer-events: none;
      transition: width 0.05s linear;
      z-index: 1;
    }
    .missile-lockdown-hint {
      display: none !important;
    }

    /* COLLAPSED TASK CARD: STRICT HIDING OF TAGS, DATES, TIMES */
    .task-card:not(.expanded) .task-tags-strip,
    .task-card:not(.expanded) .task-meta-time-strip {
      display: none !important;
    }

    /* ANTI-TASKS: CLEAN MINIMAL SHIELD, 7-DAY DOT STRIP & URGE RESIST */
    #tab-todo #action-subview-antitasks .anti-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }
    #tab-todo #action-subview-antitasks .anti-header-meta {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
      flex-shrink: 0;
    }
    #tab-todo #action-subview-antitasks .anti-lock-all-btn {
      padding: 0 14px;
      min-height: 44px;
      border-radius: 12px;
      border: 1px solid var(--border-strong);
      background: var(--bg-surface);
      color: var(--text-primary);
      font-size: 12px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      white-space: nowrap;
      transition: transform 0.18s var(--spring-bounce), border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    }
    #tab-todo #action-subview-antitasks .anti-lock-all-btn:hover {
      border-color: var(--accent-primary);
      color: var(--accent-primary);
    }
    #tab-todo #action-subview-antitasks .anti-composer-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 8px 6px 16px;
      margin-bottom: 14px;
    }
    #tab-todo #action-subview-antitasks #antitask-title-input {
      flex: 1;
      min-width: 0;
      min-height: 40px;
      font-size: 15px;
      font-weight: 500;
      color: var(--text-primary);
      background: transparent;
      border: none;
      outline: none;
    }
    #tab-todo #action-subview-antitasks #btn-add-antitask {
      min-width: 44px;
      min-height: 40px;
      padding: 0 16px;
      border-radius: 16px;
      background: var(--accent-primary);
      color: var(--accent-contrast);
      font-weight: 800;
      font-size: 16px;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      cursor: pointer;
      white-space: nowrap;
    }
    #tab-todo #antitask-list-container {
      gap: 10px;
    }
    #tab-todo .anti-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      min-height: 68px;
      transition: transform 0.22s var(--spring-fluid), border-color 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
    }
    .shield-check-btn {
      width: 42px;
      height: 42px;
      min-width: 42px;
      border-radius: 14px;
      border: 1.5px solid var(--border-strong);
      background: var(--bg-elevated, var(--bg-surface));
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.22s var(--spring-bounce), background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
      flex-shrink: 0;
    }
    .shield-check-btn svg {
      width: 19px;
      height: 19px;
      stroke-width: 2.2;
      transition: transform 0.22s var(--spring-bounce);
    }
    .shield-check-btn.locked {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      color: var(--accent-contrast);
      box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-primary) 32%, transparent);
    }
    .iron-grey-locked {
      background: var(--bg-surface) !important;
      border-color: var(--border-subtle) !important;
      opacity: 0.72;
    }
    .iron-grey-locked .anti-title {
      color: var(--text-muted);
      text-decoration: line-through;
    }
    #tab-todo .anti-title {
      font-weight: 700;
      font-size: 15px;
      line-height: 1.3;
      color: var(--text-primary);
      word-break: break-word;
      cursor: text;
    }
    #tab-todo .anti-title-edit {
      width: 100%;
      font-weight: 700;
      font-size: 15px;
      line-height: 1.3;
      color: var(--text-primary);
      background: var(--bg-elevated, var(--bg-surface));
      border: 1px solid var(--accent-primary);
      border-radius: 10px;
      padding: 4px 8px;
      outline: none;
    }
    #tab-todo .anti-meta-line {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 5px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
    }
    #tab-todo .anti-dots {
      display: inline-flex;
      align-items: center;
      gap: 3.5px;
    }
    #tab-todo .anti-dot {
      width: 6px;
      height: 6px;
      border-radius: 99px;
      background: var(--border-strong);
      opacity: 0.55;
      transition: background-color 0.2s ease, transform 0.2s ease;
    }
    #tab-todo .anti-dot.held {
      background: var(--accent-primary);
      opacity: 1;
    }
    #tab-todo .anti-dot.today {
      transform: scale(1.18);
    }
    #tab-todo .anti-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    #tab-todo .anti-resist-btn {
      min-width: 44px;
      min-height: 36px;
      padding: 0 10px;
      border-radius: 12px;
      border: 1px solid var(--border-strong);
      background: var(--bg-elevated, var(--bg-surface));
      color: var(--text-primary);
      font-size: 12px;
      font-weight: 800;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      cursor: pointer;
      white-space: nowrap;
      transition: transform 0.18s var(--spring-bounce), border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
    }
    #tab-todo .anti-resist-btn:hover {
      border-color: var(--accent-primary);
      color: var(--accent-primary);
    }
    #tab-todo .anti-del-btn {
      width: 36px;
      height: 36px;
      min-width: 36px;
      border-radius: 11px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-muted);
      font-size: 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: color 0.18s ease, background-color 0.18s ease;
    }
    #tab-todo .anti-del-btn:hover {
      color: #F43F5E;
      background: rgba(244, 63, 94, 0.1);
    }
    #tab-todo .anti-presets-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      margin-top: 14px;
    }
    #tab-todo .anti-preset-btn {
      min-height: 36px;
      padding: 6px 12px;
      border-radius: 12px;
      border: 1px solid var(--border-strong);
      background: var(--bg-surface);
      color: var(--text-primary);
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: transform 0.18s var(--spring-bounce), border-color 0.2s ease, color 0.2s ease;
    }
    #tab-todo .anti-preset-btn:hover {
      border-color: var(--accent-primary);
      color: var(--accent-primary);
    }
    .streak-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 8px;
      background: rgba(245, 158, 11, 0.14);
      color: #F59E0B;
      border: 1px solid rgba(245, 158, 11, 0.25);
      font-size: 11.5px;
      font-weight: 700;
    }

    /* CLEAN DATE PICKER MODE & TIME SPLIT (Hidden by Default Behind "Add a time") */
    #sheet-date-repeat-picker #time-and-clock-section {
      display: none;
    }
    #sheet-date-repeat-picker.time-expanded #time-and-clock-section {
      display: flex;
    }
    #sheet-date-repeat-picker.time-expanded #btn-expand-time-clock-wrap {
      display: none !important;
    }
    #sheet-date-repeat-picker.date-only-mode #time-and-clock-section,
    #sheet-date-repeat-picker.date-only-mode #btn-expand-time-clock-wrap,
    #sheet-date-repeat-picker.date-only-mode #repeat-rule-section,
    #sheet-date-repeat-picker.date-only-mode #btn-quick-custom,
    #sheet-date-repeat-picker.date-only-mode #custom-recur-panel,
    #sheet-date-repeat-picker.journal-jump-mode #btn-quick-custom,
    #sheet-date-repeat-picker.journal-jump-mode #custom-recur-panel {
      display: none !important;
    }
    #sheet-date-repeat-picker #custom-recur-panel {
      display: none;
    }
    #sheet-date-repeat-picker:not(.custom-recur-mode) #repeat-rule-section {
      display: none !important;
    }
    #sheet-date-repeat-picker.custom-recur-mode #custom-recur-panel {
      display: flex;
    }
    #sheet-date-repeat-picker.custom-recur-mode #standard-date-cal-wrap,
    #sheet-date-repeat-picker.custom-recur-mode #date-picker-native-input {
      display: none !important;
    }

    /* MONTHLY HABIT MATRIX STYLING & STRICT 4x2 MORE HUB GRID */
    .more-2x2-grid,
    .more-3x2-grid,
    .more-4x2-grid,
    .more-6x2-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: repeat(3, 1fr);
      gap: 12px;
      margin-top: 6px;
      padding-bottom: calc(env(safe-area-inset-bottom, 24px) + 84px);
    }
    #more-hub-grid.more-4x2-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: auto;
      grid-auto-rows: minmax(118px, auto);
    }
    .more-grid-cell {
      min-height: 118px;
      border-radius: var(--squircle-lg, 28px);
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      box-shadow: var(--shadow-soft);
      padding: 16px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: flex-start;
      text-align: left;
      transition: transform 0.28s var(--spring-bounce), border-color 0.25s ease, box-shadow 0.25s ease;
      position: relative;
      overflow: hidden;
    }
    #tab-more .more-grid-cell {
      border-radius: 28px;
    }
    #tab-more .squircle-card,
    #tab-more .eisenhower-quadrant,
    #tab-more .timeblock-sidebar,
    #tab-more .timeblock-timeline,
    #tab-more .dw-glass-card,
    #tab-more .dw-modal-panel {
      border-radius: 26px;
    }
    #tab-more .timeblock-sticky-date-bar,
    #tab-more details.dw-glass-accordion {
      border-radius: 24px;
    }
    #tab-more .dw-kpi-tile,
    #tab-more .dw-goal-box {
      border-radius: 18px;
    }

    /* Unified Curvy Geometry (26px–28px) across Action, Mind & Insight */
    #tab-todo .squircle-card,
    #tab-todo .task-card,
    #tab-todo .task-card-swipe-wrap,
    #tab-todo .task-swipe-underlay,
    #tab-todo .kanban-column,
    #tab-todo .todo-cal-card,
    #tab-todo .cal-task-card,
    #tab-todo .macro-goal-banner,
    #tab-todo .empty-state,
    #tab-mind .squircle-card,
    #tab-mind .note-card,
    #tab-mind .journal-board-card,
    #tab-mind .journal-preview-card,
    #tab-mind .empty-state,
    #tab-insight .squircle-card,
    #tab-insight .streak-hero-card,
    #tab-insight .insight-ring-card {
      border-radius: 26px;
    }
    #tab-insight .reward-badge-card {
      border-radius: 20px;
    }
    #tab-insight .review-stat-row {
      border-radius: 18px;
    }
    .more-grid-cell.interactive-cell {
      cursor: pointer;
    }
    .more-grid-cell.interactive-cell:hover {
      border-color: var(--accent-primary);
    }
    .more-grid-cell.placeholder-cell {
      background: var(--bg-surface);
      opacity: 0.54;
      border-style: dashed;
      border-color: var(--border-strong);
      box-shadow: none;
      pointer-events: none;
      user-select: none;
    }
    .habit-month-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
      padding: 0 4px;
    }
    .habit-month-matrix-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      margin-top: 12px;
    }
    .habit-weekday-header {
      text-align: center;
      font-size: 10.5px;
      font-weight: 800;
      color: var(--text-muted);
      padding: 2px 0;
    }
    .habit-matrix-day-btn {
      aspect-ratio: 1;
      border-radius: 10px;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      color: var(--text-secondary);
      font-family: var(--font-mono);
      font-size: 11.5px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.22s var(--spring-fluid);
      padding: 0;
      min-width: 0;
    }
    .habit-matrix-day-btn.today {
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 1px var(--accent-primary);
    }
    .habit-matrix-day-btn.done,
    .habit-matrix-day-btn.done-success {
      background: #10B981 !important;
      color: #FFFFFF !important;
      border-color: #059669 !important;
      box-shadow: 0 3px 10px rgba(16, 185, 129, 0.32);
    }
    .habit-matrix-day-btn.done-failed {
      background: #EF4444 !important;
      color: #FFFFFF !important;
      border-color: #DC2626 !important;
      box-shadow: 0 3px 10px rgba(239, 68, 68, 0.32);
    }
    .habit-action-btn-success {
      background: rgba(16, 185, 129, 0.14);
      color: #10B981;
      border: 1px solid rgba(16, 185, 129, 0.35);
    }
    .habit-action-btn-success.active {
      background: #10B981;
      color: #FFFFFF;
      border-color: #059669;
    }
    .habit-action-btn-failed {
      background: rgba(239, 68, 68, 0.12);
      color: #EF4444;
      border: 1px solid rgba(239, 68, 68, 0.3);
    }
    .habit-action-btn-failed.active {
      background: #EF4444;
      color: #FFFFFF;
      border-color: #DC2626;
    }
    #more-habit-tracker-view .habit-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 12px;
    }
    #more-habit-tracker-view .habit-composer-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 8px 6px 14px;
      margin-bottom: 12px;
    }
    #more-habit-tracker-view #habit-name-input {
      flex: 1;
      min-width: 0;
      min-height: 40px;
      font-size: 15px;
      font-weight: 500;
      color: var(--text-primary);
      background: transparent;
      border: none;
      outline: none;
    }
    #more-habit-tracker-view #btn-add-habit {
      min-width: 44px;
      min-height: 40px;
      padding: 0 16px;
      border-radius: 14px;
      background: var(--accent-primary);
      color: var(--accent-contrast);
      font-weight: 800;
      font-size: 17px;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      cursor: pointer;
    }
    #more-habit-tracker-view .habit-today-progress-card {
      padding: 12px 14px;
      margin-bottom: 10px;
      display: flex;
      flex-direction: column;
      gap: 9px;
      border: 1px solid var(--border-subtle);
      background: var(--bg-surface);
    }
    #more-habit-tracker-view .habit-today-progress-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    #more-habit-tracker-view .habit-today-progress-title-wrap {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }
    #more-habit-tracker-view .habit-today-progress-title {
      font-family: var(--font-display);
      font-size: 13.5px;
      font-weight: 800;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }
    #more-habit-tracker-view .habit-today-progress-sub {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #more-habit-tracker-view .habit-today-progress-badge {
      padding: 4px 10px;
      border-radius: 9px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      color: var(--text-secondary);
      font-family: var(--font-display);
      font-size: 12px;
      font-weight: 800;
      flex-shrink: 0;
      transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    #more-habit-tracker-view .habit-today-progress-card.all-done .habit-today-progress-badge {
      background: rgba(16, 185, 129, 0.16);
      border-color: rgba(16, 185, 129, 0.45);
      color: #10B981;
    }
    #more-habit-tracker-view .habit-today-progress-track {
      height: 6px;
      width: 100%;
      border-radius: 99px;
      background: var(--bg-elevated);
      overflow: hidden;
    }
    #more-habit-tracker-view .habit-today-progress-fill {
      height: 100%;
      border-radius: 99px;
      background: linear-gradient(90deg, #10B981, #34D399);
      transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    }
    #more-habit-tracker-view .habit-card {
      padding: 13px 14px;
      display: flex;
      flex-direction: column;
      gap: 11px;
      border: 1px solid var(--border-subtle);
      transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    }
    #more-habit-tracker-view .habit-card.is-completed-today {
      border-color: rgba(16, 185, 129, 0.32);
    }
    #more-habit-tracker-view .habit-card.just-completed-card {
      animation: hbCardCompletePop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    #more-habit-tracker-view .habit-card-top {
      display: flex;
      align-items: center;
      gap: 11px;
    }
    @keyframes hbCardCompletePop {
      0% { transform: scale(1); }
      40% { transform: scale(1.016); box-shadow: 0 8px 22px -6px rgba(16, 185, 129, 0.24); }
      100% { transform: scale(1); }
    }
    @keyframes hbCheckCompleteScale {
      0% { transform: scale(0.82); }
      50% { transform: scale(1.22); }
      78% { transform: scale(0.95); }
      100% { transform: scale(1); }
    }
    @keyframes hbCheckIconPop {
      0% { transform: scale(0.5) rotate(-12deg); opacity: 0.35; }
      60% { transform: scale(1.2) rotate(3deg); opacity: 1; }
      100% { transform: scale(1) rotate(0deg); opacity: 1; }
    }
    @keyframes hbCheckRingPulse {
      0% { transform: scale(0.88); opacity: 0.75; }
      100% { transform: scale(1.65); opacity: 0; }
    }
    @keyframes hbDayCellPop {
      0% { transform: scale(0.86); }
      55% { transform: scale(1.14); }
      100% { transform: scale(1); }
    }
    @keyframes hbStreakPulse {
      0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
      45% { transform: scale(1.09); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.18); }
      100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    }
    @keyframes hbStreakNumRise {
      0% { transform: translateY(7px) scale(0.88); opacity: 0.25; }
      65% { transform: translateY(-1px) scale(1.08); opacity: 1; }
      100% { transform: translateY(0) scale(1); opacity: 1; }
    }
    @keyframes hbStreakDeltaFloat {
      0% { transform: translateY(4px) scale(0.85); opacity: 0; }
      25% { transform: translateY(-2px) scale(1); opacity: 1; }
      100% { transform: translateY(-12px) scale(0.95); opacity: 0; }
    }
    @keyframes hbStreakFillSweep {
      0% { transform: scaleX(0); opacity: 0.85; }
      70% { transform: scaleX(1); opacity: 0.85; }
      100% { transform: scaleX(1); opacity: 0; }
    }
    #more-habit-tracker-view .hb-check-btn {
      position: relative;
      width: 42px;
      height: 42px;
      min-width: 42px;
      border-radius: 13px;
      border: 1.5px solid var(--border-strong);
      background: var(--bg-elevated);
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      overflow: visible;
      transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, box-shadow 0.24s ease;
    }
    #more-habit-tracker-view .hb-check-btn::after {
      content: '';
      position: absolute;
      inset: -2px;
      border-radius: 14px;
      border: 2px solid #10B981;
      opacity: 0;
      pointer-events: none;
    }
    #more-habit-tracker-view .hb-check-btn svg {
      transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
    }
    #more-habit-tracker-view .hb-check-btn.active {
      background: #10B981;
      border-color: #059669;
      color: #FFFFFF;
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
    }
    #more-habit-tracker-view .hb-check-btn.just-completed {
      animation: hbCheckCompleteScale 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    #more-habit-tracker-view .hb-check-btn.just-completed::after {
      animation: hbCheckRingPulse 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    #more-habit-tracker-view .hb-check-btn.just-completed svg {
      animation: hbCheckIconPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    #more-habit-tracker-view .hb-streak-counter {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 6px 10px;
      border-radius: 11px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 800;
      line-height: 1;
      flex-shrink: 0;
      overflow: visible;
      transition: background-color 0.26s ease, border-color 0.26s ease, color 0.26s ease, transform 0.26s var(--spring-bounce);
    }
    #more-habit-tracker-view .hb-streak-counter::after {
      content: '';
      position: absolute;
      left: 4px;
      right: 4px;
      bottom: 1px;
      height: 2px;
      border-radius: 99px;
      background: linear-gradient(90deg, #F59E0B, #10B981);
      transform-origin: left center;
      transform: scaleX(0);
      opacity: 0;
      pointer-events: none;
    }
    #more-habit-tracker-view .hb-streak-counter.has-streak {
      background: rgba(245, 158, 11, 0.13);
      border-color: rgba(245, 158, 11, 0.35);
      color: #F59E0B;
    }
    #more-habit-tracker-view .hb-streak-flame {
      font-size: 12px;
      line-height: 1;
      transition: transform 0.25s var(--spring-bounce), filter 0.25s ease;
    }
    #more-habit-tracker-view .hb-streak-counter:not(.has-streak) .hb-streak-flame {
      filter: grayscale(1);
      opacity: 0.55;
    }
    #more-habit-tracker-view .hb-streak-num {
      display: inline-block;
    }
    #more-habit-tracker-view .hb-streak-delta {
      position: absolute;
      top: -6px;
      right: 2px;
      font-size: 10px;
      font-weight: 800;
      color: #10B981;
      opacity: 0;
      pointer-events: none;
    }
    #more-habit-tracker-view .hb-streak-counter.streak-incrementing {
      animation: hbStreakPulse 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    #more-habit-tracker-view .hb-streak-counter.streak-incrementing::after {
      animation: hbStreakFillSweep 0.55s ease-out forwards;
    }
    #more-habit-tracker-view .hb-streak-counter.streak-incrementing .hb-streak-num {
      animation: hbStreakNumRise 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    }
    #more-habit-tracker-view .hb-streak-counter.streak-incrementing .hb-streak-delta {
      animation: hbStreakDeltaFloat 0.65s ease-out forwards;
    }
    #more-habit-tracker-view .hb-title-btn {
      flex: 1;
      min-width: 0;
      text-align: left;
      background: transparent;
      border: none;
      padding: 2px 0;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    #more-habit-tracker-view .hb-title {
      font-family: var(--font-display);
      font-size: 15px;
      font-weight: 700;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      transition: color 0.2s ease;
    }
    #more-habit-tracker-view .hb-meta-line {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #more-habit-tracker-view .habit-card.is-completed-today .hb-meta-line {
      color: #10B981;
    }
    #more-habit-tracker-view .hb-week-strip {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 5px;
    }
    #more-habit-tracker-view .hb-day-cell {
      height: 38px;
      padding: 3px 2px;
      border-radius: 10px;
      border: 1px solid var(--border-subtle);
      background: var(--bg-elevated);
      color: var(--text-muted);
      font-family: var(--font-body);
      white-space: nowrap;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1px;
      cursor: pointer;
      user-select: none;
      transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    }
    #more-habit-tracker-view .hb-day-wday {
      font-size: 9px;
      font-weight: 700;
      line-height: 1.05;
      opacity: 0.78;
      letter-spacing: -0.01em;
    }
    #more-habit-tracker-view .hb-day-status {
      font-size: 11px;
      font-weight: 800;
      line-height: 1.1;
    }
    #more-habit-tracker-view .hb-day-cell.today {
      border-color: var(--accent-primary);
      background: var(--accent-soft);
      color: var(--accent-primary);
    }
    #more-habit-tracker-view .hb-day-cell.today .hb-day-wday {
      opacity: 1;
      font-weight: 800;
    }
    #more-habit-tracker-view .hb-day-cell.done-success {
      background: rgba(16, 185, 129, 0.18);
      border-color: rgba(16, 185, 129, 0.55);
      color: #10B981;
    }
    #more-habit-tracker-view .hb-day-cell.done-success .hb-day-wday {
      opacity: 0.92;
    }
    #more-habit-tracker-view .hb-day-cell.just-completed-cell {
      animation: hbDayCellPop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    /* Habit Check-Off Confetti Burst Overlay */
    .habit-confetti-burst-layer {
      position: fixed;
      left: 0;
      top: 0;
      width: 0;
      height: 0;
      pointer-events: none;
      z-index: 9999;
      overflow: visible;
    }
    @keyframes hbConfettiFly {
      0% {
        transform: translate3d(0, 0, 0) scale(0.35) rotate(0deg);
        opacity: 1;
      }
      55% {
        transform: translate3d(calc(var(--hb-dx) * 0.78), calc(var(--hb-dy) * 0.75 - 8px), 0) scale(1.06) rotate(calc(var(--hb-rot) * 0.6));
        opacity: 1;
      }
      100% {
        transform: translate3d(var(--hb-dx), calc(var(--hb-dy) + 16px), 0) scale(0.55) rotate(var(--hb-rot));
        opacity: 0;
      }
    }
    .habit-confetti-particle {
      position: absolute;
      left: 0;
      top: 0;
      width: var(--hb-size, 6px);
      height: var(--hb-h, 6px);
      margin-left: calc(var(--hb-size, 6px) * -0.5);
      margin-top: calc(var(--hb-h, 6px) * -0.5);
      border-radius: var(--hb-radius, 2px);
      background: var(--hb-color, #10B981);
      pointer-events: none;
      will-change: transform, opacity;
      animation: hbConfettiFly var(--hb-dur, 620ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    #more-habit-tracker-view .habit-presets-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      margin-top: 12px;
    }
    #more-habit-tracker-view .habit-preset-btn {
      min-height: 36px;
      padding: 6px 12px;
      border-radius: 12px;
      border: 1px solid var(--border-strong);
      background: var(--bg-surface);
      color: var(--text-primary);
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
    }
    .habit-card-menu-wrap {
      position: relative;
      display: inline-flex;
    }
    .habit-card-dropdown {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      min-width: 130px;
      background: var(--bg-surface);
      border: 1px solid var(--border-strong);
      border-radius: 12px;
      box-shadow: var(--shadow-float);
      padding: 5px;
      z-index: 40;
      display: none;
      animation: paneEnter 0.18s var(--spring-fluid);
    }
    .habit-card-dropdown.open {
      display: block;
    }

    /* INSIGHTS: GLOBAL STREAKS BANNER & WEEKLY/MONTHLY REVIEW CARDS */
    .streak-hero-banner {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin-bottom: 14px;
    }
    .streak-hero-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-radius: var(--radius-card);
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, var(--bg-surface) 100%);
      border: 1px solid rgba(245, 158, 11, 0.32);
      box-shadow: var(--shadow-soft);
    }
    .streak-fire-orb {
      width: 42px;
      height: 42px;
      border-radius: 14px;
      background: rgba(245, 158, 11, 0.18);
      border: 1px solid rgba(245, 158, 11, 0.35);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      flex-shrink: 0;
    }
    .review-cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 14px;
      margin-bottom: 20px;
    }
    .review-stat-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin: 12px 0;
      padding: 10px;
      border-radius: 14px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      text-align: center;
    }

    /* ==========================================================================
       7. TAB 3: NOTES (LIST VS. GRID VIEW TOGGLE, FLOATING TOOLBAR, AUTO CHECKLISTS)
       ========================================================================== */
    .notes-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 16px;
      align-items: start;
      padding-bottom: 88px;
      width: 100%;
      box-sizing: border-box;
    }
    #notes-grid-container.notes-grid.list-view,
    #notes-grid-container[data-notes-view="list"],
    .notes-grid.list-view,
    body[data-notes-section="archive"] #notes-grid-container.list-view,
    body[data-notes-section="bin"] #notes-grid-container.list-view {
      display: flex !important;
      flex-direction: column !important;
      grid-template-columns: none !important;
      align-items: stretch !important;
      gap: 14px !important;
    }
    #notes-grid-container.notes-grid.list-view > .note-card,
    #notes-grid-container.notes-grid.list-view > .empty-state,
    .notes-grid.list-view > .note-card,
    .notes-grid.list-view > .empty-state,
    body[data-notes-section="archive"] #notes-grid-container.list-view > .note-card,
    body[data-notes-section="bin"] #notes-grid-container.list-view > .note-card {
      width: 100% !important;
      max-width: 100% !important;
    }
    #notes-grid-container.notes-grid.grid-view,
    #notes-grid-container[data-notes-view="grid"],
    .notes-grid.grid-view,
    body[data-notes-section="archive"] #notes-grid-container.grid-view,
    body[data-notes-section="bin"] #notes-grid-container.grid-view {
      display: grid !important;
      grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)) !important;
      gap: 16px !important;
      align-items: start !important;
    }
    @media (max-width: 480px) {
      #notes-grid-container.notes-grid.grid-view,
      #notes-grid-container[data-notes-view="grid"],
      .notes-grid.grid-view {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      }
    }
    .note-bin-actions button {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .note-card {
      cursor: pointer;
      display: flex;
      flex-direction: column;
      gap: 8px;
      position: relative;
      user-select: none;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      transition: transform 0.28s var(--spring-fluid), background-color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
    }
    .note-card.is-pinned {
      border-color: var(--accent-primary);
    }
    .note-pin-badge {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 26px;
      height: 26px;
      border-radius: 9px;
      background: rgba(128, 128, 128, 0.14);
      color: var(--accent-primary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      z-index: 4;
      pointer-events: auto;
      transition: transform 0.22s var(--spring-bounce), background-color 0.2s ease;
    }
    .note-pin-badge:active {
      transform: scale(0.9);
    }

    /* Pillar 3: Note Personalization (5 Premium Subtle Background Colors with High-Contrast Legibility) */
    :root {
      --note-color-default-bg: var(--bg-surface);
      --note-color-default-border: var(--border-subtle);
      --note-color-yellow-bg: #FDF6C7;
      --note-color-yellow-border: rgba(217, 119, 6, 0.28);
      --note-color-mint-bg: #DCFCE7;
      --note-color-mint-border: rgba(16, 185, 129, 0.28);
      --note-color-blue-bg: #E0F2FE;
      --note-color-blue-border: rgba(14, 165, 233, 0.28);
      --note-color-sand-bg: #F3E9DC;
      --note-color-sand-border: rgba(161, 98, 7, 0.24);
    }
    html.dark,
    [data-theme="dark"] {
      --note-color-default-bg: var(--bg-surface);
      --note-color-default-border: var(--border-subtle);
      --note-color-yellow-bg: #28220F;
      --note-color-yellow-border: rgba(250, 204, 21, 0.28);
      --note-color-mint-bg: #0D261C;
      --note-color-mint-border: rgba(52, 211, 153, 0.28);
      --note-color-blue-bg: #0D2130;
      --note-color-blue-border: rgba(56, 189, 248, 0.28);
      --note-color-sand-bg: #251D16;
      --note-color-sand-border: rgba(217, 119, 6, 0.28);
    }
    .note-card[data-note-color="default"],
    #note-editor-sheet-box[data-note-color="default"] #note-rte-canvas {
      background-color: var(--note-color-default-bg);
      border-color: var(--note-color-default-border);
    }
    .note-card[data-note-color="yellow"],
    #note-editor-sheet-box[data-note-color="yellow"],
    #note-editor-sheet-box[data-note-color="yellow"] #note-rte-canvas {
      background-color: var(--note-color-yellow-bg) !important;
      border-color: var(--note-color-yellow-border) !important;
      color: var(--text-primary) !important;
    }
    .note-card[data-note-color="mint"],
    #note-editor-sheet-box[data-note-color="mint"],
    #note-editor-sheet-box[data-note-color="mint"] #note-rte-canvas {
      background-color: var(--note-color-mint-bg) !important;
      border-color: var(--note-color-mint-border) !important;
      color: var(--text-primary) !important;
    }
    .note-card[data-note-color="blue"],
    #note-editor-sheet-box[data-note-color="blue"],
    #note-editor-sheet-box[data-note-color="blue"] #note-rte-canvas {
      background-color: var(--note-color-blue-bg) !important;
      border-color: var(--note-color-blue-border) !important;
      color: var(--text-primary) !important;
    }
    .note-card[data-note-color="sand"],
    #note-editor-sheet-box[data-note-color="sand"],
    #note-editor-sheet-box[data-note-color="sand"] #note-rte-canvas {
      background-color: var(--note-color-sand-bg) !important;
      border-color: var(--note-color-sand-border) !important;
      color: var(--text-primary) !important;
    }
    .note-color-palette-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 6px 4px 10px;
      flex-wrap: wrap;
    }
    .note-color-swatches {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .note-color-swatch {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 2px solid var(--border-strong);
      cursor: pointer;
      position: relative;
      transition: transform 0.2s var(--spring-bounce), border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .note-color-swatch[data-color="default"] { background: var(--bg-elevated); }
    .note-color-swatch[data-color="yellow"]  { background: #FDE68A; }
    .note-color-swatch[data-color="mint"]    { background: #A7F3D0; }
    .note-color-swatch[data-color="blue"]    { background: #BAE6FD; }
    .note-color-swatch[data-color="sand"]    { background: #E7D4B5; }
    .note-color-swatch.active {
      border-color: var(--accent-primary);
      transform: scale(1.14);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }

    /* Pillar 1: Native Mobile Bottom Sheet for Note Long-Press */
    .note-sheet-backdrop {
      position: fixed;
      inset: 0;
      z-index: 1999;
      background: rgba(0, 0, 0, 0.62);
      display: none;
      align-items: flex-end;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.25s ease;
    }
    .note-sheet-backdrop.open {
      display: flex;
      opacity: 1;
    }
    .note-bottom-sheet {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      z-index: 2000;
      background: var(--bg-surface);
      color: var(--text-primary);
      border-top-left-radius: var(--squircle-xl);
      border-top-right-radius: var(--squircle-xl);
      border-top: 1px solid var(--border-strong);
      box-shadow: var(--shadow-float);
      padding: 12px 20px calc(env(safe-area-inset-bottom, 24px) + 14px);
      transform: translateY(100%);
      transition: transform 0.36s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      will-change: transform;
    }
    .note-sheet-backdrop.open .note-bottom-sheet {
      transform: translateY(0);
      animation: slideUpSheet 0.36s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .note-sheet-action-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-width: 540px;
      margin: 0 auto;
    }
    .note-sheet-action-btn {
      width: 100%;
      min-height: 48px;
      padding: 12px 16px;
      border-radius: 16px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      font-family: var(--font-display);
      font-size: 14.5px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      text-align: left;
    }
    .note-sheet-action-btn.danger {
      color: #EF4444;
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.25);
    }

    /* Bottom-Docked Contextual Formatting Toolbar (Frosted Glass & Liquid Spring Physics) */
    .rte-floating-toolbar {
      position: fixed;
      left: 50%;
      bottom: 20px;
      z-index: 1250;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 12px;
      border-radius: 18px;
      background: var(--bg-glass);
      border: 1.5px solid var(--accent-primary);
      box-shadow: var(--shadow-float), 0 8px 30px var(--accent-glow);
      transform: translate3d(-50%, 140%, 0);
      opacity: 0;
      pointer-events: none;
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      will-change: transform, opacity;
    }
    .rte-floating-toolbar.visible {
      transform: translate3d(-50%, 0, 0);
      opacity: 1;
      pointer-events: auto;
    }
    .rte-btn {
      min-width: 38px;
      height: 34px;
      padding: 0 10px;
      border-radius: 10px;
      font-family: var(--font-display);
      font-size: 12.5px;
      font-weight: 800;
      color: var(--text-primary);
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }

    /* Eisenhower 4-Quadrant Matrix & Daily Time Blocking Timeline Styles (Apple-Tier Minimalist Overhaul) */
    .eisenhower-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
      padding-bottom: 24px;
    }
    @media (max-width: 560px) {
      .eisenhower-grid {
        grid-template-columns: 1fr;
      }
    }
    .eisenhower-quadrant {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 22px;
      padding: 16px;
      min-height: 204px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      cursor: text;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
      transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
    }
    .eisenhower-quadrant.drag-over-quad {
      border-color: var(--accent-primary);
      box-shadow: 0 8px 24px var(--accent-glow);
    }
    .eisenhower-quad-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border-subtle);
    }
    .eisenhower-inline-form {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: auto;
      padding-top: 8px;
      border-top: 1px solid var(--border-subtle);
    }
    .eisenhower-inline-input {
      flex: 1;
      min-width: 0;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-primary);
      padding: 7px 10px;
      border-radius: 10px;
      background: var(--bg-elevated);
      border: 1px solid transparent;
      transition: border-color 0.2s ease, background-color 0.2s ease;
    }
    .eisenhower-inline-input:focus {
      border-color: var(--accent-primary);
      background: var(--bg-surface);
    }
    .eisenhower-task-chip {
      padding: 10px 12px;
      border-radius: 13px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      font-size: 13px;
      font-weight: 600;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      cursor: grab;
      user-select: none;
      touch-action: none;
      min-width: 0;
      max-width: 100%;
      white-space: normal;
      overflow-wrap: break-word;
      word-wrap: break-word;
      box-sizing: border-box;
      transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    }
    .eisenhower-task-chip:hover {
      border-color: var(--border-strong);
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }
    .eisenhower-task-chip:active {
      cursor: grabbing;
      transform: scale(1.02);
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    }
    .eisenhower-empty-guidance {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 18px 12px;
      font-family: var(--font-display);
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: var(--text-muted);
      opacity: 0.36;
      pointer-events: none;
      user-select: none;
      transition: opacity 0.18s ease;
    }
    /* Sticky Date Navigation Header & Mobile-Safe Layout for Time Blocking */
    #more-timeblocking-view {
      width: 100%;
      max-width: 100vw;
      box-sizing: border-box;
      overflow-x: hidden;
    }
    .timeblock-sticky-date-bar {
      position: sticky;
      top: 0;
      z-index: 22;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 14px;
      margin-bottom: 14px;
      border-radius: 18px;
      background: var(--bg-glass);
      border: 1px solid var(--border-subtle);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      width: 100%;
      box-sizing: border-box;
    }
    .timeblock-layout {
      display: grid;
      grid-template-columns: 220px 1fr;
      gap: 16px;
      padding-bottom: 88px;
      align-items: start;
      width: 100%;
      max-width: 100vw;
      box-sizing: border-box;
      overflow-x: hidden;
    }
    .timeblock-sidebar {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 22px;
      padding: 16px;
      position: sticky;
      top: 68px;
      max-height: 340px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      overflow: hidden;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }
    #tb-unscheduled-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: 240px;
      overflow-y: auto;
      overflow-x: hidden;
      padding-right: 2px;
      box-sizing: border-box;
    }
    #tb-unscheduled-list .eisenhower-task-chip {
      flex-shrink: 0;
      width: 100%;
      box-sizing: border-box;
    }
    @media (max-width: 640px) {
      .timeblock-layout {
        grid-template-columns: 1fr;
      }
      .timeblock-sidebar {
        position: relative;
        top: auto;
        max-height: 220px;
      }
      #tb-unscheduled-list {
        max-height: 150px;
      }
    }
    .timeblock-timeline {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 22px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      overflow-x: hidden;
    }
    .timeblock-slot {
      display: grid;
      grid-template-columns: 68px 1fr;
      gap: 12px;
      align-items: stretch;
      min-height: 54px;
      padding: 9px 12px;
      border-radius: 14px;
      border: 1px solid var(--border-subtle);
      background: var(--bg-elevated);
      cursor: pointer;
      min-width: 0;
      box-sizing: border-box;
      transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
    }
    .timeblock-slot:hover {
      border-color: var(--border-strong);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }
    .timeblock-slot.drag-over-slot {
      border-style: solid;
      border-color: var(--accent-primary);
      background: var(--accent-soft);
      box-shadow: 0 0 14px var(--accent-glow);
    }
    .timeblock-hour-lbl {
      font-family: var(--font-mono);
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text-muted);
      padding-top: 5px;
    }
    .timeblock-events-col {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
      max-width: 100%;
    }
    .timeblock-inline-composer {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 2px;
    }
    .timeblock-inline-input {
      flex: 1;
      min-width: 0;
      font-size: 13px;
      font-weight: 600;
      padding: 7px 11px;
      border-radius: 10px;
      background: var(--bg-surface);
      border: 1px solid var(--accent-primary);
      color: var(--text-primary);
    }
    .timeblock-scheduled-pill {
      padding: 9px 12px;
      border-radius: 12px;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-left: 3.5px solid var(--accent-primary);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      cursor: grab;
      user-select: none;
      min-width: 0;
      max-width: 100%;
      width: 100%;
      box-sizing: border-box;
      white-space: normal;
      overflow-wrap: break-word;
      word-wrap: break-word;
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }
    .timeblock-scheduled-pill:hover {
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }
    .timeblock-scheduled-pill.gcal-pill {
      border-left-color: #3B82F6;
      background: linear-gradient(90deg, rgba(59, 130, 246, 0.14) 0%, var(--bg-surface) 60%);
    }
    .insight-clickable-card {
      cursor: pointer;
      transition: transform 0.22s var(--spring-fluid), border-color 0.22s ease, box-shadow 0.22s ease;
    }
    .insight-clickable-card:hover {
      border-color: var(--border-strong);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    }
    .insight-clickable-card:active {
      transform: scale(0.985);
    }
    .rte-btn:active {
      transform: scale(0.93);
    }
    .rte-canvas {
      width: 100%;
      flex: 1;
      min-height: 54dvh;
      max-height: 66dvh;
      overflow-y: auto;
      padding: 18px;
      border-radius: 20px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      font-size: 16px;
      line-height: 1.7;
      outline: none;
    }
    .rte-canvas:empty::before {
      content: attr(data-placeholder);
      color: var(--text-muted);
      pointer-events: none;
    }
    .rte-canvas h1 { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin: 6px 0; }
    .rte-canvas h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 5px 0; }
    .rte-canvas h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 4px 0; }
    .rte-canvas blockquote,
    .md-blockquote {
      border-left: 3px solid var(--accent-primary);
      padding: 4px 12px;
      margin: 6px 0;
      color: var(--text-secondary);
      font-style: italic;
      background: rgba(245, 158, 11, 0.06);
      border-radius: 0 10px 10px 0;
    }
    .rte-canvas ul,
    .md-list-ul,
    .nc-preview ul {
      padding-left: 24px;
      margin: 4px 0;
      list-style-type: disc;
    }
    .rte-canvas ul ul,
    .nc-preview ul ul {
      list-style-type: circle;
      margin: 2px 0;
    }
    .rte-canvas ol,
    .md-list-ol,
    .nc-preview ol {
      padding-left: 24px;
      margin: 4px 0;
      list-style-type: decimal;
    }
    .rte-canvas li,
    .nc-preview li {
      margin: 2px 0;
      line-height: 1.56;
    }
    .rte-canvas li::marker,
    .nc-preview li::marker {
      color: var(--text-secondary);
      font-weight: 600;
    }
    .rte-canvas code.md-inline-code,
    .nc-preview code.md-inline-code {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.88em;
      padding: 1px 6px;
      border-radius: 5px;
      background: color-mix(in srgb, var(--accent-primary, #0D9488) 12%, transparent);
      color: var(--accent-primary, #0D9488);
    }
    /* Pillar 2: Smart Checklist Mechanics — Restructured Inline Checkbox */
    .inline-check-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin: 5px 0;
      padding: 1px 0;
      border: none;
      background: transparent;
      width: 100%;
      position: relative;
    }
    .inline-check-box {
      position: relative;
      appearance: none;
      -webkit-appearance: none;
      width: 19px;
      height: 19px;
      margin: 3px 0 0 0;
      padding: 0;
      border-radius: 6px;
      border: 1.75px solid var(--border-strong, rgba(148, 163, 184, 0.58));
      background: transparent;
      color: var(--accent-contrast, #FFFFFF);
      cursor: pointer;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      user-select: none;
      -webkit-user-select: none;
      transition: background-color 0.16s cubic-bezier(0.16, 1, 0.3, 1),
                  border-color 0.16s cubic-bezier(0.16, 1, 0.3, 1),
                  transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .rte-canvas .inline-check-box::after {
      content: "";
      position: absolute;
      inset: -12px;
    }
    .rte-canvas .inline-check-box:hover {
      border-color: var(--accent-primary, #0D9488);
      background: color-mix(in srgb, var(--accent-primary, #0D9488) 10%, transparent);
    }
    .rte-canvas .inline-check-box:active {
      transform: scale(0.92);
    }
    .inline-check-box:focus-visible {
      outline: 2px solid var(--accent-primary, #0D9488);
      outline-offset: 2px;
    }
    .inline-check-icon {
      width: 12px;
      height: 10px;
      display: block;
      opacity: 0;
      transform: scale(0.55);
      transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                  transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
      pointer-events: none;
    }
    .inline-check-row[data-checked="true"] > .inline-check-box,
    .inline-check-row.checked-line > .inline-check-box,
    .inline-check-box[aria-checked="true"] {
      background: var(--accent-primary, #0D9488);
      border-color: var(--accent-primary, #0D9488);
    }
    .inline-check-row[data-checked="true"] > .inline-check-box .inline-check-icon,
    .inline-check-row.checked-line > .inline-check-box .inline-check-icon,
    .inline-check-box[aria-checked="true"] .inline-check-icon {
      opacity: 1;
      transform: scale(1);
    }
    .inline-check-row > .inline-check-text,
    .inline-check-row > span {
      flex: 1 1 0%;
      min-width: 0;
      min-height: 1.56em;
      outline: none;
      font-size: 15.5px;
      line-height: 1.56;
      color: var(--text-primary);
      word-break: break-word;
      overflow-wrap: anywhere;
      display: block;
      transition: color 0.16s ease, opacity 0.16s ease;
    }
    .inline-check-row[data-checked="true"] > .inline-check-text,
    .inline-check-row.checked-line > .inline-check-text,
    .inline-check-row.checked-line > span {
      text-decoration: line-through;
      text-decoration-thickness: 1.35px;
      text-decoration-color: color-mix(in srgb, var(--text-muted) 75%, transparent);
      color: var(--text-muted);
      opacity: 0.76;
    }
    /* Compact read-only preview inside Notes cards */
    .nc-preview .inline-check-row {
      gap: 7px;
      margin: 2px 0;
      padding: 0;
    }
    .nc-preview .inline-check-box {
      width: 14px;
      height: 14px;
      margin-top: 3px;
      border-radius: 4px;
      border-width: 1.5px;
      pointer-events: none;
    }
    .nc-preview .inline-check-icon {
      width: 9px;
      height: 8px;
    }
    .nc-preview .inline-check-row > .inline-check-text,
    .nc-preview .inline-check-row > span {
      font-size: 13.5px;
      line-height: 1.42;
      min-height: 1.42em;
    }
    /* Legacy fallback styling if raw input[type="checkbox"] appears prior to normalization */
    .inline-check-row input[type="checkbox"] {
      appearance: none;
      -webkit-appearance: none;
      width: 19px;
      height: 19px;
      margin: 3px 0 0 0;
      border-radius: 6px;
      border: 1.75px solid var(--border-strong, rgba(148, 163, 184, 0.58));
      background: transparent;
      cursor: pointer;
      flex-shrink: 0;
      display: inline-grid;
      place-content: center;
      transition: background-color 0.16s ease, border-color 0.16s ease;
    }
    .inline-check-row input[type="checkbox"]::before {
      content: "";
      width: 8px;
      height: 5px;
      border-left: 2px solid var(--accent-contrast, #FFFFFF);
      border-bottom: 2px solid var(--accent-contrast, #FFFFFF);
      transform: rotate(-45deg) scale(0);
      transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
      margin-top: -1px;
    }
    .inline-check-row input[type="checkbox"]:checked {
      background: var(--accent-primary, #0D9488);
      border-color: var(--accent-primary, #0D9488);
    }
    .inline-check-row input[type="checkbox"]:checked::before {
      transform: rotate(-45deg) scale(1);
    }
    @media (prefers-reduced-motion: reduce) {
      .inline-check-box,
      .inline-check-icon,
      .inline-check-row > .inline-check-text {
        transition: none !important;
      }
    }

    /* Interactive Image Resizing & Framing inside Notes */
    .resizable-img-wrap {
      position: relative;
      display: inline-block;
      max-width: 100%;
      margin: 6px 0;
      border-radius: 14px;
      overflow: hidden;
      border: 1.5px solid transparent;
      vertical-align: middle;
      user-select: none;
    }
    .resizable-img-wrap.active-img {
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 2px var(--accent-glow);
    }
    .resizable-img-wrap img {
      display: block;
      width: 100%;
      height: 100%;
      border-radius: 12px;
      object-fit: cover;
      pointer-events: none;
    }
    .resizable-img-wrap.crop-mode img {
      aspect-ratio: 16 / 10;
      object-fit: cover;
    }
    .resizable-img-wrap.fit-mode img {
      aspect-ratio: auto;
      object-fit: contain;
    }
    .img-resize-handle {
      display: none;
      position: absolute;
      right: 6px;
      bottom: 6px;
      width: 22px;
      height: 22px;
      border-radius: 7px;
      background: var(--accent-primary);
      color: var(--accent-contrast);
      cursor: nwse-resize;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 800;
      box-shadow: 0 2px 8px rgba(0,0,0,0.35);
      touch-action: none;
      z-index: 5;
    }
    .img-frame-bar {
      display: none;
      position: absolute;
      top: 6px;
      right: 6px;
      gap: 4px;
      z-index: 5;
    }
    .resizable-img-wrap.active-img .img-resize-handle,
    .resizable-img-wrap.active-img .img-frame-bar {
      display: inline-flex;
    }
    .img-frame-btn {
      padding: 3px 8px;
      border-radius: 7px;
      background: rgba(24, 24, 26, 0.82);
      color: #EDEDED;
      font-size: 10.5px;
      font-weight: 700;
      border: 1px solid rgba(255,255,255,0.18);
    }

    /* Printable PDF Report Template (Hidden on screen, visible in window.print()) */
    #printable-pdf-report {
      display: none;
    }
    @media print {
      body > *:not(#printable-pdf-report) {
        display: none !important;
      }
      #printable-pdf-report {
        display: block !important;
        padding: 24px;
        color: #111827;
        background: #FFFFFF;
        font-family: sans-serif;
      }
    }

    /* ==========================================================================
       8. TAB 4: JOURNAL (5-TIER MOOD FULL BACKGROUND COLOR INTEGRATION)
       ========================================================================== */
    .journal-board-card {
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-height: 82px;
      background: var(--surface-variant, var(--bg-elevated));
      border: 1px solid transparent;
      box-shadow: none;
      transition: all 0.35s var(--spring-fluid);
    }
    .journal-preview-date {
      font-size: 1.1rem;
      font-weight: 700;
      font-family: var(--font-display);
      color: var(--text-primary);
    }
    .journal-board-card .jb-snippet {
      font-size: 13.5px;
      opacity: 0.88;
      margin-top: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: 1.45;
    }
    /* Past day boards adopt the specific background color of the mood selected */
    .journal-board-card[data-mood="Radiant"],
    .mood-surface-Radiant {
      background-color: var(--mood-radiant-bg) !important;
      border-color: transparent !important;
      color: var(--mood-radiant-text) !important;
    }
    .journal-board-card[data-mood="Good"],
    .mood-surface-Good {
      background-color: var(--mood-good-bg) !important;
      border-color: transparent !important;
      color: var(--mood-good-text) !important;
    }
    .journal-board-card[data-mood="Balanced"],
    .mood-surface-Balanced {
      background-color: var(--mood-balanced-bg) !important;
      border-color: transparent !important;
      color: var(--mood-balanced-text) !important;
    }
    .journal-board-card[data-mood="Challenging"],
    .mood-surface-Challenging {
      background-color: var(--mood-challenging-bg) !important;
      border-color: transparent !important;
      color: var(--mood-challenging-text) !important;
    }
    .journal-board-card[data-mood="Exhausting"],
    .mood-surface-Exhausting {
      background-color: var(--mood-exhausting-bg) !important;
      border-color: transparent !important;
      color: var(--mood-exhausting-text) !important;
    }

    .fullscreen-modal {
      position: fixed;
      inset: 0;
      z-index: 85;
      background: var(--bg-canvas);
      color: var(--text-primary);
      display: none;
      flex-direction: column;
      animation: paneEnter 0.32s var(--spring-fluid);
    }
    .fullscreen-modal.open {
      display: flex;
    }

    /* ==========================================================================
       9. TAB 4: VISUAL INSIGHT RINGS & GITHUB-STYLE HEATMAP
       ========================================================================== */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 16px;
    }
    .insight-ring-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 14px 10px;
      gap: 6px;
    }
    .insight-mini-ring-wrap {
      position: relative;
      width: 78px;
      height: 78px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .insight-mini-ring-svg {
      width: 100%;
      height: 100%;
      transform: rotate(-90deg);
    }
    .insight-mini-ring-center {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }
    .heatmap-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      max-width: 320px;
      margin: 8px auto 0;
    }
    .heatmap-cell {
      aspect-ratio: 1 / 1;
      border-radius: 5px;
      display: block;
      font-size: 0;
      line-height: 0;
      color: transparent;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      transition: transform 0.18s var(--spring-bounce), background-color 0.25s ease, box-shadow 0.25s ease;
    }
    .heatmap-cell:hover {
      transform: scale(1.14);
    }
    .heatmap-cell[data-lv="1"] {
      background: #CCFBF1;
      border-color: #99F6E4;
    }
    .heatmap-cell[data-lv="2"] {
      background: #5EEAD4;
      border-color: #2DD4BF;
    }
    .heatmap-cell[data-lv="3"] {
      background: #14B8A6;
      border-color: #0D9488;
    }
    .heatmap-cell[data-lv="4"] {
      background: #0F766E;
      border-color: #115E59;
    }
    .heatmap-cell[data-lv="5"] {
      background: #064E3B;
      border-color: #047857;
      box-shadow: 0 0 8px rgba(13, 148, 136, 0.42);
    }
    html.dark .heatmap-cell[data-lv="1"],
    [data-theme="dark"] .heatmap-cell[data-lv="1"],
    body.dark-mode .heatmap-cell[data-lv="1"] {
      background: #0B2E29;
      border-color: #134E4A;
    }
    html.dark .heatmap-cell[data-lv="2"],
    [data-theme="dark"] .heatmap-cell[data-lv="2"],
    body.dark-mode .heatmap-cell[data-lv="2"] {
      background: #0F5C52;
      border-color: #0F766E;
    }
    html.dark .heatmap-cell[data-lv="3"],
    [data-theme="dark"] .heatmap-cell[data-lv="3"],
    body.dark-mode .heatmap-cell[data-lv="3"] {
      background: #0D9488;
      border-color: #14B8A6;
    }
    html.dark .heatmap-cell[data-lv="4"],
    [data-theme="dark"] .heatmap-cell[data-lv="4"],
    body.dark-mode .heatmap-cell[data-lv="4"] {
      background: #2DD4BF;
      border-color: #5EEAD4;
    }
    html.dark .heatmap-cell[data-lv="5"],
    [data-theme="dark"] .heatmap-cell[data-lv="5"],
    body.dark-mode .heatmap-cell[data-lv="5"] {
      background: #99F6E4;
      border-color: #CCFBF1;
      box-shadow: 0 0 10px rgba(45, 212, 191, 0.55);
    }
    .heatmap-cell.is-frozen {
      background: rgba(56, 189, 248, 0.24);
      border-color: rgba(56, 189, 248, 0.65);
      box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
    }
    @keyframes bioluminescentPulse {
      0% { opacity: 0.88; transform: scale(0.995) translateZ(0); }
      100% { opacity: 1; transform: scale(1.02) translateZ(0); }
    }
    .glow-cell {
      z-index: 2;
      border-radius: 5px !important;
      position: relative;
      animation: bioluminescentPulse 2.4s ease-in-out infinite alternate;
    }
    .heatmap-legend-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px;
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted);
    }
    .heatmap-scale-caption {
      font-size: 9.5px;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: var(--text-muted);
      opacity: 0.9;
    }
    .heatmap-legend-swatches {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-left: auto;
    }
    .heatmap-legend-sq {
      width: 11px;
      height: 11px;
      border-radius: 3px;
      display: inline-block;
      border: 1px solid var(--border-subtle);
      background: var(--bg-elevated);
    }
    .heatmap-legend-sq[data-lv="1"] { background: #CCFBF1; border-color: #99F6E4; }
    .heatmap-legend-sq[data-lv="2"] { background: #5EEAD4; border-color: #2DD4BF; }
    .heatmap-legend-sq[data-lv="3"] { background: #14B8A6; border-color: #0D9488; }
    .heatmap-legend-sq[data-lv="4"] { background: #0F766E; border-color: #115E59; }
    .heatmap-legend-sq[data-lv="5"] { background: #064E3B; border-color: #047857; }
    html.dark .heatmap-legend-sq[data-lv="1"],
    [data-theme="dark"] .heatmap-legend-sq[data-lv="1"],
    body.dark-mode .heatmap-legend-sq[data-lv="1"] { background: #0B2E29; border-color: #134E4A; }
    html.dark .heatmap-legend-sq[data-lv="2"],
    [data-theme="dark"] .heatmap-legend-sq[data-lv="2"],
    body.dark-mode .heatmap-legend-sq[data-lv="2"] { background: #0F5C52; border-color: #0F766E; }
    html.dark .heatmap-legend-sq[data-lv="3"],
    [data-theme="dark"] .heatmap-legend-sq[data-lv="3"],
    body.dark-mode .heatmap-legend-sq[data-lv="3"] { background: #0D9488; border-color: #14B8A6; }
    html.dark .heatmap-legend-sq[data-lv="4"],
    [data-theme="dark"] .heatmap-legend-sq[data-lv="4"],
    body.dark-mode .heatmap-legend-sq[data-lv="4"] { background: #2DD4BF; border-color: #5EEAD4; }
    html.dark .heatmap-legend-sq[data-lv="5"],
    [data-theme="dark"] .heatmap-legend-sq[data-lv="5"],
    body.dark-mode .heatmap-legend-sq[data-lv="5"] { background: #99F6E4; border-color: #CCFBF1; }

    .sheet-backdrop {
      position: fixed;
      inset: 0;
      z-index: 75;
      background: rgba(0, 0, 0, 0.62);
      display: none;
      align-items: flex-end;
      justify-content: center;
      transition: opacity 0.22s ease, background-color 0.22s ease;
    }
    .sheet-backdrop.open {
      display: flex;
    }
    .bottom-sheet {
      width: 100%;
      max-width: 560px;
      max-height: 90dvh;
      overflow-y: auto;
      background: var(--bg-glass);
      color: var(--text-primary);
      border-top-left-radius: var(--squircle-xl);
      border-top-right-radius: var(--squircle-xl);
      border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-float);
      padding: 12px 22px calc(env(safe-area-inset-bottom, 24px) + 16px);
      position: relative;
      transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
      animation: slideUpSheet 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }
    /* Pillar 1: Settings Menu Pure GPU Fix (Pre-rendered on GPU, animated strictly via transform & visibility) */
    /* Base state: Pre-rendered on GPU, pushed off screen */
    .settings-modal-container {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 5000;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      background: rgba(0, 0, 0, 0.55);
      transform: translateY(100%);
      visibility: hidden;
      /* Animate ONLY transform and visibility */
      transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.3, 1.1), visibility 0.35s !important;
      will-change: transform;
    }

    /* Active state: JavaScript simply toggles this class to slide it up */
    .settings-modal-container.settings-active {
      transform: translateY(0);
      visibility: visible;
    }

    .settings-modal-container .bottom-sheet {
      animation: none !important;
      transition: none !important;
      will-change: transform;
    }

    .add-task-container,
    #sheet-task-composer .bottom-sheet {
      display: flex;
      flex-direction: column;
      max-height: 88dvh;
      overflow: hidden;
      padding: 12px 22px 0 !important;
      margin-bottom: 0;
    }
    .task-sheet-scroll-body {
      overflow-y: auto;
      flex-shrink: 1;
      flex: 1 1 auto;
      min-height: 0;
      overscroll-behavior: contain;
      padding-right: 2px;
    }
    .task-sheet-actions-row {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
      margin-top: auto;
      padding-top: 12px;
      padding-bottom: calc(env(safe-area-inset-bottom, 24px) + 16px);
      border-top: 1px solid var(--border-subtle);
      background: transparent;
    }
    .tag-selector-scroll,
    #composer-tags-list,
    #composer-tag-builder-drawer {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      max-height: 120px;
      overflow-y: auto;
      overscroll-behavior: contain;
    }
    .cal-day-btn.past-disabled {
      opacity: 0.3;
      pointer-events: none;
      cursor: not-allowed;
    }
    .todo-calendar-view {
      display: none;
      flex-direction: column;
      gap: 14px;
      padding-bottom: 24px;
      animation: paneEnter 0.24s var(--spring-fluid);
    }
    .todo-calendar-view.active {
      display: flex;
    }
    .todo-cal-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--squircle-lg);
      padding: 16px;
      box-shadow: var(--shadow-soft);
    }
    .todo-cal-day-cell {
      min-height: 46px;
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
      background: transparent;
      border: 1px solid transparent;
      position: relative;
      cursor: pointer;
      transition: all 0.2s var(--spring-fluid);
    }
    .todo-cal-day-cell.has-tasks {
      background: var(--bg-elevated);
      border-color: var(--border-strong);
    }
    .todo-cal-day-cell.today-cell {
      border-color: var(--accent-primary);
    }
    .todo-cal-day-cell.selected {
      background: var(--accent-primary);
      color: var(--accent-contrast);
      border-color: var(--accent-primary);
      box-shadow: 0 4px 12px var(--accent-glow);
    }
    .todo-cal-day-badge {
      font-size: 9.5px;
      font-weight: 800;
      line-height: 1;
      margin-top: 3px;
      padding: 2px 5px;
      border-radius: 99px;
      background: var(--accent-glow);
      color: var(--accent-primary);
    }
    .todo-cal-day-cell.selected .todo-cal-day-badge {
      background: rgba(255, 255, 255, 0.24);
      color: var(--accent-contrast);
    }
    .insight-chart-canvas-wrap {
      height: 300px;
      width: 100%;
      position: relative;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      touch-action: pan-y;
      overscroll-behavior-x: contain;
    }
    #insight-chart-svg {
      touch-action: pan-y;
    }

    @keyframes slideUpSheet {
      from { transform: translateY(100%); }
      to   { transform: translateY(0); }
    }
    .sheet-handle {
      width: 42px;
      height: 5px;
      border-radius: 99px;
      background: var(--border-strong);
      margin: 4px auto 16px;
    }

    .cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      text-align: center;
    }
    .cal-day-btn {
      min-height: 44px;
      border-radius: 13px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
      position: relative;
    }
    .cal-day-btn.selected,
    .cal-day-btn.active-day,
    .cal-day-btn.active-calendar-day {
      background: var(--accent-primary);
      color: var(--accent-contrast);
    }
    .cal-dot {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--accent-primary);
      margin-top: 2px;
    }
    .cal-day-btn.selected .cal-dot,
    .cal-day-btn.active-day .cal-dot,
    .cal-day-btn.active-calendar-day .cal-dot {
      background: var(--accent-contrast);
    }

    .clock-dial-circle {
      width: 230px;
      height: 230px;
      border-radius: 50%;
      background: var(--bg-elevated);
      border: 1px solid var(--border-strong);
      position: relative;
      margin: 14px auto;
    }
    .clock-num-btn {
      position: absolute;
      width: 36px;
      height: 36px;
      margin-left: -18px;
      margin-top: -18px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-mono);
      font-size: 13.5px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .clock-num-btn.active {
      background: var(--accent-primary);
      color: var(--accent-contrast);
    }

    #toast-banner {
      position: fixed;
      bottom: 84px;
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      background: var(--text-primary);
      color: var(--bg-canvas);
      padding: 10px 18px;
      border-radius: 16px;
      font-size: 13.5px;
      font-weight: 700;
      z-index: 150;
      opacity: 0;
      pointer-events: none;
      display: inline-flex;
      align-items: center;
      gap: 12px;
      white-space: nowrap;
      transition: opacity 0.25s var(--spring-fluid), transform 0.25s var(--spring-fluid);
      box-shadow: var(--shadow-float);
    }
    #toast-banner.visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateX(-50%) translateY(0);
    }
    .toast-undo-btn {
      padding: 5px 12px;
      border-radius: 10px;
      background: var(--accent-primary);
      color: var(--accent-contrast);
      font-family: var(--font-display);
      font-size: 12.5px;
      font-weight: 800;
      cursor: pointer;
    }

    /* Swipe Animations, Bottom Counter, Analog Clock, Trajectory Command Grid & Habit Matrix */
    @keyframes swipeFromRight {
      from { opacity: 0; transform: translateX(28px); }
      to   { opacity: 1; transform: translateX(0); }
    }
    @keyframes swipeFromLeft {
      from { opacity: 0; transform: translateX(-28px); }
      to   { opacity: 1; transform: translateX(0); }
    }
    .swipe-anim-left { animation: swipeFromRight 0.32s var(--spring-fluid); }
    .swipe-anim-right { animation: swipeFromLeft 0.32s var(--spring-fluid); }

    .todo-bottom-counter {
      text-align: center;
      margin: 22px auto 84px;
      font-size: 13px;
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: 0.01em;
    }

    /* Analog Clock Dial Styles */
    .analog-clock-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      padding: 12px;
      border-radius: var(--squircle-md);
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      margin-bottom: 14px;
    }
    .analog-clock-header {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
    }
    .analog-time-chips {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: var(--bg-surface);
      padding: 4px 8px;
      border-radius: 12px;
      border: 1px solid var(--border-strong);
    }
    .analog-part-btn {
      padding: 4px 8px;
      border-radius: 8px;
      font-family: var(--font-mono);
      font-size: 16px;
      font-weight: 800;
      color: var(--text-secondary);
    }
    .analog-part-btn.active {
      background: var(--accent-primary);
      color: var(--accent-contrast);
    }
    .analog-face-wrap {
      position: relative;
      width: 216px;
      height: 216px;
      touch-action: none;
      user-select: none;
    }

    /* Trajectory Command Dashboard Grid (2x2 Matrix Layout with Strict Overflow Protection) */
    .trajectory-command-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
      margin-top: 8px;
      padding-bottom: 92px;
    }
    .traj-square-card {
      aspect-ratio: 1 / 1;
      min-width: 0;
      border-radius: var(--squircle-xl);
      background: var(--bg-surface);
      border: 1.5px solid var(--border-subtle);
      box-shadow: var(--shadow-soft);
      padding: 18px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      position: relative;
      overflow: hidden;
      word-wrap: break-word;
      overflow-wrap: anywhere;
      cursor: pointer;
      text-align: left;
    }
    .traj-square-card:hover {
      border-color: var(--accent-primary);
      box-shadow: var(--shadow-float);
    }
    .traj-card-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      border-radius: 10px;
      background: var(--bg-elevated);
      color: var(--accent-primary);
      font-size: 10.5px;
      font-weight: 800;
      letter-spacing: 0.04em;
      width: fit-content;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .traj-mini-matrix {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px;
      margin-top: 8px;
      width: 100%;
    }
    .traj-mini-dot {
      aspect-ratio: 1 / 1;
      border-radius: 4px;
      background: var(--bg-elevated);
    }
    .traj-mini-dot.lit {
      background: var(--accent-primary);
    }

    /* Expanding Global Search (Bottom Center of Trajectory) */
    .expanding-search-dock {
      position: fixed;
      bottom: 84px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 88;
      display: flex;
      flex-direction: column;
      align-items: center;
      pointer-events: none;
    }
    .expanding-search-pill {
      pointer-events: auto;
      display: flex;
      align-items: center;
      width: 48px;
      height: 48px;
      border-radius: 999px;
      background: var(--bg-surface);
      border: 1.5px solid var(--border-strong);
      box-shadow: var(--shadow-float);
      padding: 0 13px;
      overflow: hidden;
      transition: width 0.42s var(--spring-fluid), border-color 0.28s var(--spring-fluid), background-color 0.28s var(--spring-fluid);
    }
    .expanding-search-pill.expanded {
      width: min(360px, 88vw);
      border-color: var(--accent-primary);
    }
    .expanding-search-icon-btn {
      width: 22px;
      height: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--accent-primary);
      flex-shrink: 0;
      transition: transform 0.38s var(--spring-fluid);
    }
    .expanding-search-pill.expanded .expanding-search-icon-btn {
      transform: translateX(-2px) scale(0.95);
    }
    .expanding-search-input {
      flex: 1;
      width: 0;
      opacity: 0;
      margin-left: 0;
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      transition: opacity 0.28s var(--spring-fluid), margin-left 0.32s var(--spring-fluid);
    }
    .expanding-search-pill.expanded .expanding-search-input {
      width: 100%;
      opacity: 1;
      margin-left: 10px;
    }
    .expanding-search-results {
      pointer-events: auto;
      width: min(360px, 88vw);
      max-height: 240px;
      overflow-y: auto;
      margin-bottom: 10px;
      border-radius: var(--squircle-md);
      background: var(--bg-surface);
      border: 1.5px solid var(--border-strong);
      box-shadow: var(--shadow-float);
      padding: 8px;
      display: none;
      flex-direction: column;
      gap: 6px;
    }
    .expanding-search-results.open {
      display: flex;
      animation: paneEnter 0.25s var(--spring-fluid);
    }

    /* Habit Tracker GitHub-Style Matrix */
    .habit-github-grid {
      display: grid;
      grid-template-columns: repeat(14, 1fr);
      gap: 5px;
      margin-top: 10px;
    }
    .habit-day-sq {
      aspect-ratio: 1 / 1;
      border-radius: 5px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      cursor: pointer;
      transition: transform 0.18s var(--spring-fluid), background-color 0.2s var(--spring-fluid);
    }
    .habit-day-sq.done {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      box-shadow: 0 0 8px var(--accent-glow);
    }

    /* ==========================================================================
       PILLAR 2: MODERNIZED DISCARD / SAVE DIALOG (Blurred Backdrop + dialogPop)
       ========================================================================== */
    :root {
      --surface-color: var(--bg-surface);
    }
    @keyframes dialogPop {
      0% {
        opacity: 0;
        transform: scale(0.9);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }
    .discard-dialog-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(0, 0, 0, 0.56);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      z-index: 9999999;
    }
    .discard-dialog-backdrop.open {
      display: flex;
    }
    .discard-dialog-box {
      width: min(360px, 90vw);
      background: var(--surface-color, var(--bg-surface));
      border-radius: 24px;
      padding: 24px;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
      border: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      gap: 16px;
      animation: dialogPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }
    .discard-dialog-title {
      font-family: var(--font-display);
      font-size: 17px;
      font-weight: 800;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }
    .discard-dialog-desc {
      font-size: 13.5px;
      font-weight: 500;
      color: var(--text-secondary);
      line-height: 1.45;
      margin-top: -6px;
    }
    .discard-dialog-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 4px;
    }
    .discard-btn-keep {
      padding: 10px 14px;
      border-radius: 14px;
      background: transparent;
      color: var(--text-secondary);
      font-size: 13.5px;
      font-weight: 700;
      border: none;
      cursor: pointer;
      margin-right: auto;
    }
    .discard-btn-discard {
      padding: 10px 16px;
      border-radius: 14px;
      background: #EF4444;
      color: #FFFFFF;
      font-size: 13.5px;
      font-weight: 700;
      border: none;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(239, 68, 68, 0.28);
    }
    .discard-btn-save {
      padding: 10px 18px;
      border-radius: 14px;
      background: var(--accent-primary);
      color: var(--accent-contrast);
      font-size: 13.5px;
      font-weight: 800;
      border: none;
      cursor: pointer;
      box-shadow: 0 4px 14px var(--accent-glow);
    }

    /* ==========================================================================
       PILLAR 3: MISSILE MODE TARGET DISPLAY BELOW CLOCK
       ========================================================================== */
    .missile-target-display {
      display: none;
      font-size: 1.2rem;
      font-weight: 500;
      opacity: 0.9;
      color: var(--m-text);
      text-align: center;
      padding: 6px 14px;
      border-radius: 12px;
      max-width: 300px;
      word-break: break-word;
      cursor: pointer;
      user-select: none;
      transition: opacity 0.2s ease, transform 0.2s var(--spring-fluid);
    }
    .missile-target-display:active {
      transform: scale(0.97);
    }
    #missile-arena.missile-lockdown .missile-target-display {
      pointer-events: none;
      margin-top: -20px;
      margin-bottom: 18px;
    }
    .pomo-target-display {
      color: var(--text-primary);
    }
    #pomo-arena.pomo-fullscreen-lockdown .pomo-target-display {
      pointer-events: none;
      margin-top: 12px;
      margin-bottom: 4px;
    }

    /* ==========================================================================
       GLOBAL THEMES & V128 GRAVITY PHYSICS (PILLAR 1 & PILLAR 2)
       ========================================================================== */
    /* 🚀 Fix 3: Authentic V128 Gravity Animation Engine */
    .task-item,
    .task-item .task-card {
      border-radius: 26px;
      overflow: hidden;
      transform: translateZ(0);
    }
    .task-item {
      /* 
         The Secret to V128: 
         Transform (the drop) happens immediately (0s delay) over 0.95s.
         Max-height, margin, and padding (the collapse) are DELAYED by 0.42s so the item falls out of the way first. 
      */
      transition: transform 0.95s cubic-bezier(0.55, 0.085, 0.68, 0.53), 
                  opacity 0.55s ease, 
                  max-height 0.65s ease 0.42s, 
                  margin 0.65s ease 0.42s, 
                  padding 0.65s ease 0.42s;
      
      max-height: 280px; /* Safe upper limit for collapsed tasks with tags/meta */
      transform-origin: top center;
      will-change: transform, opacity;
      position: relative;
      z-index: 1;
    }
    .task-item.task-expanded,
    .task-card-swipe-wrap.task-expanded {
      max-height: none !important;
      overflow: visible !important;
      padding: 0 !important;
      z-index: 25 !important;
    }
    .task-item.task-expanded > .task-card.expanded {
      margin: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      box-sizing: border-box !important;
      border-radius: 26px !important;
      overflow: hidden !important;
    }

    /* Smooth Entry, Exit & FLIP Reorder Animations inside #todo-list-container */
    @keyframes todoTaskEnter {
      0% {
        opacity: 0;
        transform: translate3d(0, 14px, 0) scale(0.985);
      }
      100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
      }
    }
    @keyframes todoTaskCompletedEnter {
      0% {
        opacity: 0;
        transform: translate3d(0, -10px, 0) scale(0.97);
      }
      100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
      }
    }
    @keyframes todoTaskExit {
      0% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
      }
      100% {
        opacity: 0;
        transform: translate3d(-26px, 6px, 0) scale(0.96);
      }
    }
    #todo-list-container .task-card-swipe-wrap.todo-task-enter {
      animation: todoTaskEnter 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
      will-change: transform, opacity;
    }
    #todo-list-container #completed-tasks-list .task-card-swipe-wrap.todo-task-enter-completed {
      animation: todoTaskCompletedEnter 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
      will-change: transform, opacity;
    }
    #todo-list-container .task-card-swipe-wrap.todo-task-flip-moving {
      transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease !important;
      will-change: transform, opacity;
    }
    #todo-list-container .task-card-swipe-wrap.todo-task-exit,
    .task-item.deleting {
      animation: todoTaskExit 0.34s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
      opacity: 0 !important;
      max-height: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      padding-top: 0 !important;
      padding-bottom: 0 !important;
      height: 0 !important;
      border: none !important;
      overflow: hidden !important;
      pointer-events: none !important;
    }

    /* THE V128 GRAVITY DROP */
    .task-item.striking .task-title-text,
    .task-item.strike-through .task-title-text {
      text-decoration: line-through;
      opacity: 0.5;
    }

    /* The actual physical drop state */
    .task-item.striking-complete {
      transform: translateY(140px) rotate(4deg) scale(0.92) !important; /* Heavy physical drop */
      opacity: 0 !important;
      max-height: 0 !important;
      padding-top: 0 !important;
      padding-bottom: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      border: none !important;
      pointer-events: none !important;
      z-index: 0;
    }

    /* 🚀 Fix 2: Light Mode Mismatches (Multi-Select, Today Banner, Missile) */
    .light-mode .today-banner,
    .light-mode .date-header,
    .light-mode .date-header-row,
    [data-theme="light"] .today-banner,
    [data-theme="light"] .date-header,
    [data-theme="light"] .date-header-row {
      background: #f1f5f9 !important;
      color: #1e293b !important;
      border: 1px solid #cbd5e1 !important;
    }
    .light-mode #missile-launch-btn,
    .light-mode .missile-launch-btn,
    .light-mode #btn-launch-missile,
    .light-mode #btn-engage-missile,
    [data-theme="light"] #missile-launch-btn,
    [data-theme="light"] .missile-launch-btn,
    [data-theme="light"] #btn-launch-missile,
    [data-theme="light"] #btn-engage-missile {
      background: #10b981 !important;
      color: #ffffff !important;
    }
    .light-mode .bulk-action-bar,
    .light-mode .multi-select-options,
    .light-mode .multi-select-bar,
    .light-mode #task-bulk-action-bar,
    .light-mode #notes-bulk-action-bar,
    [data-theme="light"] .bulk-action-bar,
    [data-theme="light"] .multi-select-options,
    [data-theme="light"] .multi-select-bar {
      background: #ffffff !important;
      color: #0f172a !important;
      border-top: 1px solid #e2e8f0 !important;
      box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    }
    .light-mode .bulk-action-bar button,
    .light-mode .multi-select-options button,
    .light-mode .multi-select-bar button,
    [data-theme="light"] .bulk-action-bar button,
    [data-theme="light"] .multi-select-options button,
    [data-theme="light"] .multi-select-bar button {
      color: #0f172a !important;
    }
    .light-mode #global-tooltip-overlay,
    [data-theme="light"] #global-tooltip-overlay {
      background: rgba(255, 255, 255, 0.95) !important;
      color: #0f172a !important;
      border: 1px solid rgba(0, 0, 0, 0.1) !important;
    }

    /* Notes Text Underline Skipping */
    .notes-textarea, .note-content, #note-rte-canvas, #note-rte-canvas *, .nc-preview, .nc-preview * {
      text-decoration-skip-ink: none;
    }

    /* Dynamic Time Badge Base Style */
    .task-time-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      padding: 2.5px 7px;
      border-radius: 6px;
      margin-left: 8px;
      font-weight: 600;
      transition: background 0.3s ease, color 0.3s ease;
    }
    .task-time-badge svg { width: 12px; height: 12px; fill: currentColor; }

    /* Unified Close Buttons (Logs & Settings) */
    .unified-close-btn {
      font-weight: 600 !important;
      font-size: 14px !important;
      color: #ef4444 !important;
      background: rgba(239, 68, 68, 0.1) !important;
      border: none !important;
      padding: 6px 16px !important;
      border-radius: 20px !important;
      cursor: pointer;
      transition: background 0.2s;
    }
    .unified-close-btn:active {
      background: rgba(239, 68, 68, 0.2) !important;
    }

    /* 🚀 Fix 4: Smooth Add Task Modal */
    #add-task-modal .modal-content,
    #sheet-task-composer .bottom-sheet,
    #sheet-note-modal .bottom-sheet {
      transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
      will-change: transform;
    }

    /* 🚀 Fix: The Ultimate Today Banner Light Mode Override */
    /* Targets classes, IDs, wildcards, and forces override over any inline JS styles */
    body.light-mode .today-banner,
    body.light-mode #today-banner,
    body.light-mode .date-header,
    body.light-mode #date-header,
    body.light-mode .date-header-row,
    body.light-mode .todo-header,
    body.light-mode [class*="today-banner"],
    body.light-mode [id*="today-banner"],
    [data-theme="light"] .today-banner,
    [data-theme="light"] #today-banner,
    [data-theme="light"] .date-header,
    [data-theme="light"] #date-header,
    [data-theme="light"] .date-header-row,
    [data-theme="light"] .todo-header,
    [data-theme="light"] [class*="today-banner"],
    [data-theme="light"] [id*="today-banner"] {
      background-color: #f5f7fa !important;
      background: #f5f7fa !important;
      color: #0f172a !important;
      border: 1px solid #cbd5e1 !important;
      box-shadow: none !important;
    }

    /* Forces text color on any nested elements (like <span> or <strong>) inside the banner */
    body.light-mode .today-banner *,
    body.light-mode #today-banner *,
    body.light-mode .date-header *,
    body.light-mode #date-header *,
    body.light-mode .date-header-row *,
    body.light-mode .todo-header .header-left *,
    body.light-mode [class*="today-banner"] *,
    body.light-mode [id*="today-banner"] *,
    [data-theme="light"] .today-banner *,
    [data-theme="light"] #today-banner *,
    [data-theme="light"] .date-header *,
    [data-theme="light"] #date-header *,
    [data-theme="light"] .date-header-row *,
    [data-theme="light"] .todo-header .header-left *,
    [data-theme="light"] [class*="today-banner"] *,
    [data-theme="light"] [id*="today-banner"] * {
      color: #0f172a !important;
    }

    /* 🚀 Fix 1: Nuclear Light Mode Override for Missile Launch Button */
    body.light-mode #missile-launch-btn,
    body.light-mode .missile-launch-btn,
    body.light-mode #btn-launch-missile,
    body.light-mode #btn-engage-missile,
    body.light-mode button[onclick*="launchMissile"],
    [data-theme="light"] #missile-launch-btn,
    [data-theme="light"] .missile-launch-btn,
    [data-theme="light"] #btn-launch-missile,
    [data-theme="light"] #btn-engage-missile,
    [data-theme="light"] button[onclick*="launchMissile"] {
      background-color: #10b981 !important;
      background: #10b981 !important;
      color: #ffffff !important;
      border: none !important;
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    }

    /* 🚀 THE MASTER SETTINGS ROW ARCHITECTURE & GLASS REFINEMENT */
    /* 🚀 Fix 1: The Settings Modal Pane */
    #settings-modal,
    #sheet-settings-menu .bottom-sheet {
      border-radius: 32px 32px 0 0 !important; /* Deep bottom-sheet squircle */
      transform: translateZ(0);
      display: flex;
      flex-direction: column;
      padding-bottom: 40px !important; /* Breathing room at bottom */
      overflow: hidden !important;
    }

    body.light-mode #settings-modal,
    body.light-mode #sheet-settings-menu .bottom-sheet,
    [data-theme="light"] #settings-modal,
    [data-theme="light"] #sheet-settings-menu .bottom-sheet {
      background: rgba(248, 250, 252, 0.75) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.9) !important;
      box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.08) !important;
    }

    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(15, 23, 42, 0.75) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
      box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5) !important;
    }

    /* 🚀 Fix 2: Seamless Settings Header */
    .settings-header {
      padding: 4px 20px 10px !important;
      margin-bottom: 0 !important;
      border-bottom: none !important; /* Removes harsh legacy lines */
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      background: transparent !important;
    }
    #settings-modal > .sheet-handle {
      margin: 2px auto 6px !important;
    }
    .settings-header h2 {
      font-size: 26px !important;
      font-weight: 800 !important;
      letter-spacing: -0.5px !important;
      margin: 0 !important;
    }

    /* 🚀 Fix 3: Glassy Close Button */
    .unified-close-btn {
      border-radius: 20px !important;
      font-weight: 700 !important;
      padding: 8px 20px !important;
      transition: transform 0.15s ease !important;
    }
    .unified-close-btn:active {
      transform: scale(0.92) !important;
    }

    /* 🚀 Fix 4: Ultra-Reliable Floating Settings Rows */
    .settings-list {
      display: flex;
      flex-direction: column;
      width: 100%;
      margin: 0;
      background: transparent;
      padding: 8px 20px 30px !important;
      gap: 14px !important;
      overflow-y: auto !important;
      scroll-behavior: smooth !important;
    }
    .settings-list::-webkit-scrollbar {
      display: none; /* Clean scroll */
    }

    /* This single class applies to buttons, divs, and toggles equally */
    .settings-row {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      width: 100% !important;
      margin: 0 !important;
      border-radius: 20px !important; /* Boxy curves */
      padding: 18px 22px !important;
      cursor: pointer !important;
      text-align: left !important;
      outline: none !important;
      transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease, box-shadow 0.15s ease !important;
      transform: translateZ(0); /* Hardware lock */
    }

    /* Minimalistic & Neat Daily Log / Insight Drilldown Sheet (#sheet-daily-log) */
    #sheet-daily-log .daily-log-sheet {
      max-height: 86dvh;
      display: flex;
      flex-direction: column;
      background: var(--bg-surface);
      border: 1px solid var(--border-strong);
      border-bottom: none;
      border-top-left-radius: 26px;
      border-top-right-radius: 26px;
      padding: 10px 20px calc(env(safe-area-inset-bottom, 20px) + 18px);
      box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.32);
    }
    #sheet-daily-log .daily-log-sheet .sheet-handle {
      width: 38px;
      height: 4px;
      border-radius: 999px;
      margin: 2px auto 12px;
      opacity: 0.42;
      flex-shrink: 0;
    }
    #sheet-daily-log .daily-log-sheet-header {
      padding: 2px 0 14px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }
    #sheet-daily-log .daily-log-sheet-title {
      font-family: var(--font-display);
      font-size: 19px;
      font-weight: 800;
      color: var(--text-primary);
      letter-spacing: -0.025em;
      line-height: 1.2;
      margin: 0;
    }
    #sheet-daily-log .daily-log-sheet-sub {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-secondary);
      margin: 3px 0 0;
      line-height: 1.35;
    }
    #sheet-daily-log .daily-log-sheet-body {
      flex: 1;
      overflow-y: auto;
      padding: 14px 0 6px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      scrollbar-width: thin;
    }
    /* Segmented range bar inside #sheet-daily-log (fixes unstyled .anti-range-pill) */
    #sheet-daily-log .dl-range-bar-wrap {
      width: 100%;
    }
    #sheet-daily-log #drill-anti-range-tabs {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      align-items: center;
      gap: 4px;
      width: 100%;
      padding: 4px;
      border-radius: 12px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      box-sizing: border-box;
    }
    #sheet-daily-log #drill-anti-range-tabs .anti-range-pill {
      appearance: none;
      -webkit-appearance: none;
      border: none;
      outline: none;
      margin: 0;
      width: 100%;
      height: 32px;
      padding: 0 6px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-body);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: -0.01em;
      line-height: 1;
      white-space: nowrap;
      cursor: pointer;
      background: transparent;
      color: var(--text-secondary);
      transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
    }
    #sheet-daily-log #drill-anti-range-tabs .anti-range-pill:hover {
      background: var(--bg-surface);
      color: var(--text-primary);
    }
    #sheet-daily-log #drill-anti-range-tabs .anti-range-pill:focus-visible {
      box-shadow: 0 0 0 2px var(--accent-primary);
    }
    #sheet-daily-log #drill-anti-range-tabs .anti-range-pill.active {
      background: var(--accent-primary);
      color: var(--accent-contrast);
      font-weight: 800;
      box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.28);
    }
    #sheet-daily-log .kpi-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 9px;
      margin-bottom: 0;
      width: 100%;
      box-sizing: border-box;
    }
    #sheet-daily-log .dl-stat-card {
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 14px;
      padding: 13px 8px 11px;
      box-shadow: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 4px;
      min-width: 0;
      box-sizing: border-box;
    }
    #sheet-daily-log .dl-stat-label {
      font-size: clamp(9px, 2.5vw, 10.5px);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.045em;
      line-height: 1.2;
      color: var(--text-muted);
      white-space: nowrap;
      max-width: 100%;
    }
    #sheet-daily-log .dl-stat-val {
      font-size: clamp(17px, 4.6vw, 21px);
      font-weight: 800;
      font-family: var(--font-display);
      font-variant-numeric: tabular-nums;
      line-height: 1.1;
      letter-spacing: -0.025em;
      color: var(--text-primary);
      white-space: nowrap;
      display: inline-flex;
      align-items: baseline;
      justify-content: center;
      gap: 1px;
      max-width: 100%;
    }
    #sheet-daily-log .dl-stat-sub {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      line-height: 1.2;
      white-space: nowrap;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #sheet-daily-log .dl-stat-unit {
      font-size: 11.5px;
      font-weight: 700;
      font-family: var(--font-body);
      color: inherit;
      opacity: 0.78;
      white-space: nowrap;
      margin-left: 1px;
    }
    #sheet-daily-log .dl-section-card {
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      padding: 14px 15px;
      box-shadow: none;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    #sheet-daily-log .dl-section-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-secondary);
      margin-bottom: 0;
    }
    #sheet-daily-log .dl-section-count {
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 700;
      color: var(--text-secondary);
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      padding: 2px 8px;
      border-radius: 6px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    /* 30-Day Defense Heatmap inside #sheet-daily-log */
    #sheet-daily-log .dl-anti-legend {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      font-size: 10.5px;
      font-weight: 600;
      text-transform: none;
      letter-spacing: 0;
      color: var(--text-muted);
    }
    #sheet-daily-log .dl-anti-legend-item {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
    }
    #sheet-daily-log .dl-anti-swatch {
      width: 8px;
      height: 8px;
      border-radius: 2.5px;
      display: inline-block;
      flex-shrink: 0;
    }
    #sheet-daily-log .dl-anti-swatch.is-full,
    #sheet-daily-log .dl-anti-cell.is-full {
      background: #10B981;
      border-color: rgba(16, 185, 129, 0.35);
    }
    #sheet-daily-log .dl-anti-swatch.is-mid,
    #sheet-daily-log .dl-anti-cell.is-mid {
      background: rgba(16, 185, 129, 0.52);
      border-color: rgba(16, 185, 129, 0.25);
    }
    #sheet-daily-log .dl-anti-cell.is-low {
      background: rgba(16, 185, 129, 0.24);
      border-color: rgba(16, 185, 129, 0.18);
    }
    #sheet-daily-log .dl-anti-swatch.is-slip,
    #sheet-daily-log .dl-anti-cell.is-slip {
      background: rgba(244, 63, 94, 0.65);
      border-color: rgba(244, 63, 94, 0.35);
    }
    #sheet-daily-log .dl-anti-cell.is-empty {
      background: var(--bg-surface);
      border-color: var(--border-subtle);
    }
    #sheet-daily-log .dl-anti-matrix-grid {
      display: grid;
      grid-template-columns: repeat(15, minmax(0, 1fr));
      gap: 5px;
      width: 100%;
    }
    #sheet-daily-log .dl-anti-cell {
      aspect-ratio: 1 / 1;
      border-radius: 5px;
      border: 1px solid var(--border-subtle);
      transition: transform 0.14s ease;
    }
    #sheet-daily-log .dl-anti-cell.is-today {
      box-shadow: 0 0 0 1.5px var(--accent-primary);
    }
    #sheet-daily-log .dl-anti-matrix-foot {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      margin-top: -2px;
    }
    /* Anti-Tasks Rules Breakdown list */
    #sheet-daily-log .dl-anti-rules-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    #sheet-daily-log .dl-anti-rule-row {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 11px 13px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    #sheet-daily-log .dl-anti-rule-top {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    #sheet-daily-log .dl-anti-rule-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      flex-shrink: 0;
    }
    #sheet-daily-log .dl-anti-rule-dot.is-held {
      background: #10B981;
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
    }
    #sheet-daily-log .dl-anti-rule-dot.is-warn {
      background: #F43F5E;
      box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.14);
    }
    #sheet-daily-log .dl-anti-rule-dot.is-idle {
      background: var(--text-muted);
      opacity: 0.45;
    }
    #sheet-daily-log .dl-anti-rule-info {
      min-width: 0;
      flex: 1;
    }
    #sheet-daily-log .dl-anti-rule-title {
      font-weight: 700;
      font-size: 13.5px;
      color: var(--text-primary);
      line-height: 1.25;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    #sheet-daily-log .dl-anti-rule-meta {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-top: 2px;
      line-height: 1.25;
    }
    #sheet-daily-log .dl-anti-rule-pct {
      font-family: var(--font-display);
      font-weight: 800;
      font-size: 14px;
      letter-spacing: -0.02em;
      flex-shrink: 0;
    }
    #sheet-daily-log .dl-anti-rule-bar {
      width: 100%;
      height: 4px;
      border-radius: 999px;
      background: var(--bg-elevated);
      overflow: hidden;
    }
    #sheet-daily-log .dl-anti-rule-bar-fill {
      height: 100%;
      border-radius: 999px;
      transition: width 0.28s ease;
    }
    #sheet-daily-log .dl-list-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 0;
      border-top: 1px solid var(--border-subtle);
      font-size: 13px;
      color: var(--text-primary);
    }
    #sheet-daily-log .dl-list-row > strong {
      white-space: nowrap;
      flex-shrink: 0;
    }
    #sheet-daily-log .dl-section-head + .dl-list-row,
    #sheet-daily-log .dl-list-row:first-child {
      border-top: none;
      padding-top: 2px;
    }
    #sheet-daily-log .dl-list-row:last-child {
      padding-bottom: 2px;
    }
    #sheet-daily-log .dl-row-main {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
      font-weight: 600;
      color: var(--text-primary);
    }
    #sheet-daily-log .dl-row-meta {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      font-family: var(--font-mono);
      white-space: nowrap;
      flex-shrink: 0;
    }
    #sheet-daily-log .dl-row-tag {
      font-size: 10px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 6px;
      background: var(--bg-surface);
      color: var(--text-muted);
      white-space: nowrap;
      flex-shrink: 0;
    }
    #sheet-daily-log .dl-compact-card {
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 11px 13px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      transition: background 0.15s ease, border-color 0.15s ease;
    }
    #sheet-daily-log .dl-section-card .dl-compact-card {
      background: var(--bg-surface);
    }
    #sheet-daily-log .dl-compact-card.is-interactive {
      cursor: pointer;
    }
    #sheet-daily-log .dl-compact-card.is-interactive:hover,
    #sheet-daily-log .dl-compact-card.is-interactive:active {
      background: var(--bg-surface);
      border-color: var(--border-strong);
    }
    #sheet-daily-log .dl-empty-card {
      background: var(--bg-elevated);
      border: 1px dashed var(--border-subtle);
      border-radius: 14px;
      padding: 22px 16px;
      box-shadow: none;
      text-align: center;
    }
    #sheet-daily-log .dl-empty-text {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-muted);
    }

    /* Minimalistic & Neat Insight Hub (#tab-insight) */
    #tab-insight .insight-card-title {
      font-family: var(--font-display);
      font-size: 15px;
      font-weight: 800;
      letter-spacing: -0.02em;
      line-height: 1.2;
      color: var(--text-primary);
      margin: 0;
    }
    #tab-insight .insight-trend-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
      flex-wrap: nowrap;
    }
    #tab-insight .d3-velocity-kpi-strip {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      gap: 6px;
      margin-bottom: 10px;
    }
    #tab-insight .d3-velocity-kpi-cell {
      padding: 8px 8px 7px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    #tab-insight .insight-mini-kpi-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    #tab-insight .insight-mini-kpi-cell {
      padding: 9px 8px;
      border-radius: 12px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-width: 0;
    }
    #tab-insight .insight-mini-kpi-lbl {
      font-size: 9.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      white-space: nowrap;
    }
    #tab-insight .insight-mini-kpi-val {
      font-family: var(--font-display);
      font-size: 16.5px;
      font-weight: 800;
      color: var(--text-primary);
      margin-top: 2px;
      line-height: 1.15;
    }
    #tab-insight .insight-mini-kpi-sub {
      font-size: 10px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-top: 1px;
      white-space: nowrap;
    }
    #tab-insight .insight-sub-header {
      font-size: 10.5px;
      font-weight: 800;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      text-transform: uppercase;
    }
    #tab-insight .insight-sub-count {
      font-family: var(--font-mono);
      font-size: 10.5px;
      font-weight: 700;
      color: var(--accent-primary);
      background: var(--accent-soft);
      padding: 1px 7px;
      border-radius: 99px;
    }
    #tab-insight .insight-compact-row {
      padding: 8px 10px;
      border-radius: 11px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      gap: 5px;
    }
    #tab-insight .insight-empty-note {
      padding: 12px 10px;
      border-radius: 11px;
      background: var(--bg-elevated);
      border: 1px dashed var(--border-subtle);
      text-align: center;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
    }

    /* Enhanced Visual Components for Focus, Habits & Impulse Control Insight Cards */
    #insight-focus-analytics-card .ins-visual-hero,
    #insight-habits-partition .ins-visual-hero,
    #insight-antitask-analytics-card .ins-visual-hero {
      display: grid;
      grid-template-columns: 98px minmax(0, 1fr);
      gap: 14px;
      align-items: center;
      margin-bottom: 12px;
    }
    #insight-focus-analytics-card .ins-ring-stage,
    #insight-habits-partition .ins-ring-stage,
    #insight-antitask-analytics-card .ins-ring-stage {
      position: relative;
      width: 98px;
      height: 98px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    #insight-focus-analytics-card .ins-ring-center,
    #insight-habits-partition .ins-ring-center,
    #insight-antitask-analytics-card .ins-ring-center {
      position: absolute;
      inset: 14px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      pointer-events: none;
    }
    #insight-focus-analytics-card .ins-ring-val,
    #insight-habits-partition .ins-ring-val,
    #insight-antitask-analytics-card .ins-ring-val {
      font-family: var(--font-display);
      font-size: 17px;
      font-weight: 800;
      line-height: 1.1;
      letter-spacing: -0.02em;
      color: var(--text-primary);
      white-space: nowrap;
    }
    #insight-focus-analytics-card .ins-ring-sub,
    #insight-habits-partition .ins-ring-sub,
    #insight-antitask-analytics-card .ins-ring-sub {
      font-size: 9.5px;
      font-weight: 700;
      color: var(--text-muted);
      margin-top: 2px;
      white-space: nowrap;
    }
    #insight-focus-analytics-card .ins-metric-stack,
    #insight-habits-partition .ins-metric-stack,
    #insight-antitask-analytics-card .ins-metric-stack {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
    }
    #insight-focus-analytics-card .ins-metric-tile,
    #insight-habits-partition .ins-metric-tile,
    #insight-antitask-analytics-card .ins-metric-tile {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 7px 10px;
      border-radius: 11px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      min-width: 0;
    }
    #insight-focus-analytics-card .ins-metric-left,
    #insight-habits-partition .ins-metric-left,
    #insight-antitask-analytics-card .ins-metric-left {
      display: flex;
      align-items: center;
      gap: 7px;
      min-width: 0;
    }
    #insight-focus-analytics-card .ins-dot,
    #insight-habits-partition .ins-dot,
    #insight-antitask-analytics-card .ins-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    #insight-focus-analytics-card .ins-metric-lbl,
    #insight-habits-partition .ins-metric-lbl,
    #insight-antitask-analytics-card .ins-metric-lbl {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    #insight-focus-analytics-card .ins-metric-right,
    #insight-habits-partition .ins-metric-right,
    #insight-antitask-analytics-card .ins-metric-right {
      display: inline-flex;
      align-items: baseline;
      gap: 5px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    #insight-focus-analytics-card .ins-metric-right strong,
    #insight-habits-partition .ins-metric-right strong,
    #insight-antitask-analytics-card .ins-metric-right strong {
      font-family: var(--font-display);
      font-size: 14px;
      font-weight: 800;
      line-height: 1.1;
    }
    #insight-focus-analytics-card .ins-metric-right span,
    #insight-habits-partition .ins-metric-right span,
    #insight-antitask-analytics-card .ins-metric-right span {
      font-size: 10.5px;
      font-weight: 600;
      color: var(--text-muted);
    }
    #insight-focus-analytics-card .ins-split-bar,
    #insight-habits-partition .ins-split-bar,
    #insight-antitask-analytics-card .ins-split-bar {
      height: 5px;
      width: 100%;
      border-radius: 99px;
      background: var(--bg-elevated);
      overflow: hidden;
      display: flex;
      margin-top: 1px;
    }
    #insight-focus-analytics-card .ins-spark-card,
    #insight-habits-partition .ins-spark-card,
    #insight-antitask-analytics-card .ins-spark-card {
      padding: 9px 11px 8px;
      border-radius: 12px;
      background: var(--bg-elevated);
      border: 1px solid var(--border-subtle);
      margin-bottom: 12px;
    }
    #insight-focus-analytics-card .ins-spark-head,
    #insight-habits-partition .ins-spark-head,
    #insight-antitask-analytics-card .ins-spark-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 7px;
    }
    #insight-focus-analytics-card .ins-spark-title,
    #insight-habits-partition .ins-spark-title,
    #insight-antitask-analytics-card .ins-spark-title {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
    }
    #insight-focus-analytics-card .ins-spark-meta {
      font-size: 10.5px;
      font-weight: 700;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    #insight-habits-partition .ins-spark-legend,
    #insight-antitask-analytics-card .ins-spark-legend {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 9.5px;
      font-weight: 700;
      color: var(--text-muted);
    }
    #insight-habits-partition .ins-spark-legend span,
    #insight-antitask-analytics-card .ins-spark-legend span {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    #insight-habits-partition .ins-spark-legend i,
    #insight-antitask-analytics-card .ins-spark-legend i {
      width: 6px;
      height: 6px;
      border-radius: 2px;
      display: inline-block;
    }
    #insight-focus-analytics-card .ins-spark-svg {
      display: block;
      width: 100%;
      height: 52px;
      overflow: visible;
    }
    #insight-habits-partition .ins-defense-strip,
    #insight-antitask-analytics-card .ins-defense-strip {
      display: grid;
      grid-template-columns: repeat(14, minmax(0, 1fr));
      gap: 4px;
      height: 36px;
      align-items: end;
      padding: 2px 0;
    }
    #insight-habits-partition .ins-defense-col,
    #insight-antitask-analytics-card .ins-defense-col {
      height: 100%;
      border-radius: 5px;
      background: var(--bg-surface);
      display: flex;
      align-items: flex-end;
      overflow: hidden;
      position: relative;
    }
    #insight-habits-partition .ins-defense-col.is-today,
    #insight-antitask-analytics-card .ins-defense-col.is-today {
      box-shadow: 0 0 0 1px var(--accent-primary);
    }
    #insight-habits-partition .ins-defense-fill,
    #insight-antitask-analytics-card .ins-defense-fill {
      width: 100%;
      border-radius: 4px;
      transition: height 0.35s ease;
    }
    #insight-focus-analytics-card .ins-spark-axis,
    #insight-habits-partition .ins-spark-axis,
    #insight-antitask-analytics-card .ins-spark-axis {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 9.5px;
      font-weight: 600;
      color: var(--text-muted);
      margin-top: 5px;
    }
    #insight-habits-partition .ins-rule-dots,
    #insight-antitask-analytics-card .ins-rule-dots {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      flex-shrink: 0;
    }
    #insight-habits-partition .ins-rule-dot,
    #insight-antitask-analytics-card .ins-rule-dot {
      width: 7px;
      height: 7px;
      border-radius: 2px;
      background: var(--border-subtle);
    }
    #insight-habits-partition .ins-rule-dot.is-held,
    #insight-antitask-analytics-card .ins-rule-dot.is-held {
      background: #10B981;
    }
    #insight-antitask-analytics-card .ins-rule-dot.is-slip {
      background: #F43F5E;
    }
    #insight-antitask-analytics-card .ins-rule-dot.is-resist {
      background: #F59E0B;
    }

    /* ========================================================================
       2-PART PATTERNS EDITORIAL CARD (#card-traj-adaptive)
       ======================================================================== */
    #card-traj-adaptive .pat-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      gap: 10px;
      margin-bottom: 14px;
    }
    #card-traj-adaptive .pat-header-left {
      display: flex;
      align-items: baseline;
      gap: 8px;
      min-width: 0;
      flex-wrap: wrap;
    }
    #card-traj-adaptive .pat-meta-inline {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
    }
    #card-traj-adaptive .pat-section {
      width: 100%;
    }
    #card-traj-adaptive .pat-part-head {
      display: flex;
      align-items: baseline;
      gap: 7px;
      margin-bottom: 11px;
    }
    #card-traj-adaptive .pat-part-num {
      font-size: 11px;
      font-weight: 700;
      color: var(--accent-primary);
      letter-spacing: 0.02em;
    }
    #card-traj-adaptive .pat-part-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }
    #card-traj-adaptive .pat-part-meta {
      margin-left: auto;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
    }
    #card-traj-adaptive .pat-divider {
      border: none;
      border-top: 1px solid var(--border-subtle);
      margin: 18px 0 16px;
    }
    #card-traj-adaptive .pat-subhead {
      font-size: 12px;
      font-weight: 700;
      color: var(--text-primary);
      margin: 14px 0 6px;
    }

    /* Sleep Division (Equal Hairline Row in Cumulative Summary) */
    #card-traj-adaptive .pat-sleep-division {
      padding: 10px 4px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    #card-traj-adaptive .pat-sleep-top {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
    }
    #card-traj-adaptive .pat-sleep-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
    }
    #card-traj-adaptive .pat-sleep-state {
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
      flex-shrink: 0;
    }
    #card-traj-adaptive .pat-sleep-state.is-good { color: #10B981; }
    #card-traj-adaptive .pat-sleep-state.is-warn { color: #D97706; }
    #card-traj-adaptive .pat-sleep-state.is-bad { color: #F43F5E; }
    #card-traj-adaptive .pat-sleep-state.is-muted { color: var(--text-muted); }

    #card-traj-adaptive .pat-sleep-headline {
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
    }
    #card-traj-adaptive .pat-sleep-val {
      font-size: 15px;
      font-weight: 800;
      letter-spacing: -0.015em;
      color: var(--text-primary);
      line-height: 1.25;
    }
    #card-traj-adaptive .pat-sleep-window {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-secondary);
    }
    #card-traj-adaptive .pat-sleep-detail {
      font-size: 11px;
      font-weight: 500;
      color: var(--text-secondary);
      line-height: 1.38;
    }
    #card-traj-adaptive .pat-sleep-bars-wrap {
      margin-top: 8px;
      padding-top: 7px;
      border-top: 1px solid color-mix(in srgb, var(--border-subtle) 65%, transparent);
    }
    #card-traj-adaptive .pat-sleep-bars {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      align-items: end;
      height: 38px;
      position: relative;
    }
    #card-traj-adaptive .pat-sleep-goal-line {
      position: absolute;
      left: 0;
      right: 0;
      border-top: 1px dashed color-mix(in srgb, #10B981 48%, transparent);
      pointer-events: none;
    }
    #card-traj-adaptive .pat-sleep-bar-col {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      height: 100%;
      gap: 3px;
    }
    #card-traj-adaptive .pat-sleep-bar-fill {
      width: 100%;
      max-width: 20px;
      border-radius: 3px 3px 2px 2px;
      min-height: 3px;
    }
    #card-traj-adaptive .pat-sleep-bar-lbl {
      font-size: 9px;
      font-weight: 600;
      color: var(--text-muted);
      line-height: 1;
    }
    #card-traj-adaptive .pat-expandable-block[hidden] {
      display: none;
    }

    /* Borderless Hairline 2-Column Cumulative Summary Grid */
    #card-traj-adaptive .pat-metric-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      border-top: 1px solid var(--border-subtle);
      border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
      margin-bottom: 0;
    }
    #card-traj-adaptive .pat-metric-cell {
      padding: 10px 4px;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
      border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
    }
    #card-traj-adaptive .pat-metric-cell:nth-child(odd) {
      padding-right: 12px;
      border-right: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
    }
    #card-traj-adaptive .pat-metric-cell:nth-child(even) {
      padding-left: 12px;
    }
    #card-traj-adaptive .pat-metric-cell:nth-last-child(-n+2) {
      border-bottom: none;
    }
    #card-traj-adaptive .pat-metric-lbl {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
    }
    #card-traj-adaptive .pat-metric-val {
      font-size: 15px;
      font-weight: 800;
      color: var(--text-primary);
      letter-spacing: -0.015em;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #card-traj-adaptive .pat-metric-sub {
      font-size: 11px;
      font-weight: 500;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Editorial Hairline Lists (Patterns & Multi-Angle Diagnoses) */
    #card-traj-adaptive .pat-row-list {
      display: flex;
      flex-direction: column;
    }
    #card-traj-adaptive .pat-row {
      padding: 11px 0;
      border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 75%, transparent);
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    #card-traj-adaptive .pat-row:last-child {
      border-bottom: none;
      padding-bottom: 4px;
    }
    #card-traj-adaptive .pat-row.is-hidden-row {
      display: none;
    }
    #card-traj-adaptive .pat-row-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      line-height: 1.2;
    }
    #card-traj-adaptive .pat-row-tone {
      font-weight: 700;
    }
    #card-traj-adaptive .pat-row-tone.is-problem { color: #F43F5E; }
    #card-traj-adaptive .pat-row-tone.is-warning { color: #D97706; }
    #card-traj-adaptive .pat-row-tone.is-correlation { color: #6366F1; }
    #card-traj-adaptive .pat-row-tone.is-strength { color: #10B981; }

    #card-traj-adaptive .pat-row-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.35;
      text-wrap: balance;
    }
    #card-traj-adaptive .pat-row-body {
      font-size: 12px;
      font-weight: 500;
      color: var(--text-secondary);
      line-height: 1.45;
      word-wrap: break-word;
      overflow-wrap: break-word;
    }
    #card-traj-adaptive .pat-row-move {
      margin-top: 3px;
      font-size: 12px;
      font-weight: 600;
      color: var(--accent-primary);
      line-height: 1.4;
    }

    /* Part 2 Focal Lead Card (Single Subtle Surface Anchor) */
    #card-traj-adaptive .pat-lead-card {
      padding: 13px 14px;
      border-radius: 14px;
      background: color-mix(in srgb, #F43F5E 7%, var(--bg-elevated));
      border: 1px solid color-mix(in srgb, #F43F5E 20%, var(--border-subtle));
      margin-bottom: 6px;
    }
    #card-traj-adaptive .pat-lead-card.is-healthy {
      background: color-mix(in srgb, #10B981 7%, var(--bg-elevated));
      border-color: color-mix(in srgb, #10B981 20%, var(--border-subtle));
    }
    #card-traj-adaptive .pat-lead-kicker {
      font-size: 11px;
      font-weight: 700;
      color: #F43F5E;
      margin-bottom: 4px;
    }
    #card-traj-adaptive .pat-lead-card.is-healthy .pat-lead-kicker {
      color: #10B981;
    }
    #card-traj-adaptive .pat-lead-title {
      font-size: 14px;
      font-weight: 800;
      color: var(--text-primary);
      line-height: 1.32;
      text-wrap: balance;
    }
    #card-traj-adaptive .pat-lead-body {
      font-size: 12px;
      font-weight: 500;
      color: var(--text-secondary);
      line-height: 1.45;
      margin-top: 4px;
    }
    #card-traj-adaptive .pat-lead-move {
      font-size: 12px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.4;
      margin-top: 7px;
      padding-top: 7px;
      border-top: 1px solid color-mix(in srgb, var(--border-subtle) 85%, transparent);
    }

    /* Next Moves Clean Numbered List */
    #card-traj-adaptive .pat-action-list {
      display: flex;
      flex-direction: column;
    }
    #card-traj-adaptive .pat-action-row {
      display: flex;
      align-items: baseline;
      gap: 10px;
      padding: 8px 0;
      border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
    }
    #card-traj-adaptive .pat-action-row:last-child {
      border-bottom: none;
      padding-bottom: 2px;
    }
    #card-traj-adaptive .pat-action-idx {
      font-size: 11.5px;
      font-weight: 800;
      color: var(--accent-primary);
      flex-shrink: 0;
      min-width: 14px;
    }
    #card-traj-adaptive .pat-action-copy {
      flex: 1;
      min-width: 0;
      font-size: 12px;
      line-height: 1.42;
      color: var(--text-secondary);
    }
    #card-traj-adaptive .pat-action-copy strong {
      color: var(--text-primary);
      font-weight: 700;
    }

