/* =========================================================
   STYLE.MOBILE.CSS
   Sanctuarie Mobile - The Ebook Pass (Master Blueprint)
   Consolidated: Architecture, Floors, Overlays, & Adaptive Geometry
   DEBUG LOG TRACE:
   - OPTIMIZED: Moved text truncation (overflow: hidden) from .m-thought-bubble to .th-text to prevent clipping of ::before outer borders.
   - REFINED: Boosted CSS specificity (div.m-thought-bubble) for quick/task/recur variants to pierce through .is-pinned-top overrides.
   - REFINED: Added explicit display: block to .th-text to ensure text-overflow ellipsis functions correctly.
========================================================= */

/* =========================================
   1. BASE ARCHITECTURE & DESKTOP CLEANUP
========================================= */
body:not(.is-mobile) #mobileElevator,
body:not(.is-mobile) #m-persistent-ui,
body:not(.is-mobile) #m-sparc-node,
body:not(.is-mobile) .m-modal-overlay { 
    display: none !important; 
    pointer-events: none !important; 
}

body.welcome-active #m-persistent-ui,
body.welcome-active .m-command-dock,
body.welcome-active #m-progress-bar-container {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.m-capture-dock { display: none !important; }

body.is-mobile #universeTrack, body.is-mobile #heartCanvas, body.is-mobile .nav-arrow, body.is-mobile .heart-btn,
body.is-mobile #desktopCanvas, body.is-mobile #ambientCanvas, body.is-mobile #efBgRoot, body.is-mobile #efBgTint,
body.is-mobile #idleLayer, body.is-mobile #appWrapper, body.is-mobile #hudOverlay, body.is-mobile #thought-reticle,
body.is-mobile #thoughtDock, body.is-mobile .void-trigger, body.is-mobile #cinemaOverlay, body.is-mobile .scroll-hint-capsule,
body.is-mobile #topHeaderZone, body.is-mobile #ef-sys-wrap, body.is-mobile #focusModeTrigger,
body.is-mobile .desktop-tools-dock {
    display: none !important;
}

body.is-mobile {
    overflow: hidden !important; overscroll-behavior: none !important;
    color: #fff; font-family: 'Noto Sans JP', sans-serif;
    margin: 0; padding: 0; user-select: none; -webkit-user-select: none;
    background: var(--elevator-bg, #07090e) !important;
    transition: background-color 0.8s ease-in-out;
}

body.is-mobile input, body.is-mobile textarea, body.is-mobile .editable-text { 
    user-select: auto; -webkit-user-select: auto; 
}

/* THE ELEVATOR */
#mobileElevator {
    position: absolute; inset: 0; z-index: 100;
    width: 100vw; height: 100vh; height: 100dvh; 
    overflow-y: auto; overflow-x: hidden;
    scroll-snap-type: y mandatory; 
    scroll-snap-stop: always; 
    scroll-behavior: smooth; scrollbar-width: none; 
}
#mobileElevator::-webkit-scrollbar { display: none; }

.elevator-floor {
    width: 100%; height: 100vh; height: 100dvh;
    scroll-snap-align: start; scroll-snap-stop: always;
    display: flex; flex-direction: column; position: relative; box-sizing: border-box;
}

/* =========================================
   2. FLOOR: THE AETHER (SKY, DROP ZONES & THOUGHTS)
========================================= */
.floor-sky { 
    background: linear-gradient(var(--bgAngle, 180deg), var(--bgTop, #0a0e17) 0%, var(--bgMid, #070a12) var(--bgFocus, 50%), var(--bgBot, #020305) 100%) !important; 
    overflow: hidden; 
    transition: background 1.5s ease;
}

.m-sky-container { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.m-sky-title { font-family: 'Noto Sans JP', sans-serif; font-size: 16px; font-weight: 800; letter-spacing: 8px; text-transform: uppercase; color: rgba(var(--circadian-bright, 255, 255, 255), 0.7); margin-bottom: 12px; text-align: center; text-shadow: 0 0 20px rgba(var(--circadian-dark, 0,0,0), 0.8); }
.m-sky-subtitle { font-family: 'Noto Sans JP', sans-serif; font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 3px; text-align: center; color: rgba(var(--circadian-bright, 255, 255, 255), 0.5); animation: m-bounce-up 3s infinite; text-shadow: 0 0 10px rgba(var(--circadian-dark, 0,0,0), 0.8); }
.m-sky-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(var(--circadian-bright, 255, 255, 255), 0.5); font-size: 14px; letter-spacing: 3px; text-transform: uppercase; font-weight: bold; text-shadow: 0 0 10px rgba(var(--circadian-dark, 0,0,0), 0.8); }

/* ✨ ASCENDED: Mobile Circadian Dark Glass (Mirroring Desktop) */
.m-thoughts-layer { position: absolute; inset: 0; pointer-events: none; }

.m-thought-bubble {
    position: absolute; pointer-events: auto; 
    background-color: rgba(var(--circadian-bright, 255, 255, 255), 0.12);
    border: 1px solid rgba(var(--circadian-bright, 255, 255, 255), 0.25);
    border-radius: 999px; 
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.1);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 10px 18px; 
    font-family: 'Noto Sans JP', sans-serif; font-size: 12.5px; font-weight: 500; text-align: center;
    transform: translate(-50%, -50%); transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, border-radius 0.3s ease; 
    touch-action: none !important; 
}

.m-thought-bubble .th-text { 
    color: rgba(var(--circadian-bright, 255, 255, 255), 0.95);
    pointer-events: none; user-select: none; 
    text-shadow: none; 
    transition: color 0.3s ease;
    /* Text truncation explicitly moved here to prevent parent clipping */
    display: block; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}

.m-thought-bubble.is-dragging { 
    z-index: 500; cursor: grabbing;
    background-color: rgba(var(--circadian-bright, 255, 255, 255), 0.25);
    border-color: var(--capsuleAccent, #55ddff); 
    box-shadow: 0 0 25px color-mix(in srgb, var(--capsuleAccent, #55ddff) 60%, transparent), inset 0 1px 1px rgba(255,255,255,0.3); 
}

.m-thought-bubble.is-pinned-top { 
    background-color: var(--pin-color, #55ddff);
    border-color: var(--pin-color, #55ddff); 
    box-shadow: 0 0 25px var(--pin-color, #55ddff), inset 0 1px 2px rgba(255,255,255,0.4); 
}
.m-thought-bubble.is-pinned-top .th-text {
    color: #000;
    font-weight: 800;
}

.m-thought-bubble.is-pinning-preview { 
    background-color: #88ffaa !important; 
    border-color: #88ffaa !important; 
    box-shadow: 0 0 40px rgba(136, 255, 170, 0.8), inset 0 1px 2px rgba(255,255,255, 0.8) !important; 
    transform: translate(-50%, -50%) scale(0.9) !important; 
}
.m-thought-bubble.is-pinning-preview .th-text {
    color: #000 !important;
    font-weight: 800 !important;
}

.m-thought-bubble.is-unpinning-preview { 
    background-color: #ffaa55 !important; 
    border-color: #ffaa55 !important; 
    box-shadow: 0 0 40px rgba(255, 170, 85, 0.8), inset 0 1px 2px rgba(255,255,255, 0.8) !important; 
    transform: translate(-50%, -50%) scale(1.1) !important; 
}
.m-thought-bubble.is-unpinning-preview .th-text {
    color: #000 !important;
    font-weight: 800 !important;
}

/* ✨ The Floating Release Pill */
.m-thought-bubble.is-unpinning-preview::after {
    content: "⇪ RELEASE";
    position: absolute; top: -35px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 170, 85, 0.5);
    padding: 6px 14px; border-radius: 12px;
    font-size: 11px; font-weight: 900; letter-spacing: 3px; color: #ffaa55;
    text-shadow: 0 0 10px rgba(255, 170, 85, 0.8);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    white-space: nowrap; pointer-events: none;
}

/* =========================================
   ✨ MOBILE THOUGHT VARIANTS (ASCENDED)
========================================= */

@keyframes recurDashCycle {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

/* --- 1. Quick Thoughts (Pure Wireframe) --- */
/* Unpinned: Completely transparent background, thicker dashed outline */
div.m-thought-bubble.is-quick-orb {
    background: transparent !important;
    border: 1.5px dashed color-mix(in srgb, var(--pin-color, #fff) 60%, rgba(255,255,255,0.4)) !important;
    backdrop-filter: none !important; 
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
}
div.m-thought-bubble.is-quick-orb .th-text {
    color: rgba(255,255,255,0.95) !important;
    opacity: 1 !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 2px 8px rgba(0,0,0,0.8) !important;
}

/* Pinned Quick Thought: Transparent background, bold dashed outline */
div.m-thought-bubble.is-pinned-top.is-quick-orb {
    background: transparent !important;
    border: 2px dashed var(--pin-color, #55ddff) !important;
    box-shadow: none !important;
}
div.m-thought-bubble.is-pinned-top.is-quick-orb .th-text {
    color: var(--pin-color, #55ddff) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 2px 8px rgba(0,0,0,0.8) !important;
    font-weight: 800 !important;
}

/* Pinned Quick Thought (Hollowed out, retains pin color) */
div.m-thought-bubble.is-pinned-top.is-quick-orb {
    background-color: color-mix(in srgb, var(--pin-color, #55ddff) 15%, transparent) !important;
    border: 1.5px dashed var(--pin-color, #55ddff) !important;
    box-shadow: 0 0 20px color-mix(in srgb, var(--pin-color, #55ddff) 25%, transparent) !important;
}
div.m-thought-bubble.is-pinned-top.is-quick-orb .th-text {
    color: var(--pin-color, #55ddff) !important;
    opacity: 1 !important;
    font-weight: 800 !important;
}

/* --- 2. Task Orbs --- */
div.m-thought-bubble.is-task-orb {
    border-radius: 0 !important;
}

/* --- 3. Recurring Orbs --- */
div.m-thought-bubble.is-recurring-orb {
    border-color: transparent !important;
}
div.m-thought-bubble.is-recurring-orb::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit; 
    padding: 3px; 
    background: repeating-linear-gradient(
        -45deg,
        var(--pin-color, rgba(255, 255, 255, 0.8)),
        var(--pin-color, rgba(255, 255, 255, 0.8)) 8px,
        transparent 8px,
        transparent 16px
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 200% 200%;
    animation: recurDashCycle 15s linear infinite;
    pointer-events: none;
    z-index: 10;
    opacity: 0.9;
}
div.m-thought-bubble.is-recurring-orb.is-dragging::before {
    animation-duration: 8s;
    filter: drop-shadow(0 0 8px var(--pin-color, #55ddff));
}


/* Adaptive Drop Zones */
.m-drop-zones { position: absolute; top: clamp(40px, env(safe-area-inset-top, 40px), 60px); left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 12px; opacity: 0; visibility: hidden; transform: translateY(-20px); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 800; }
.m-drop-zones.is-active { opacity: 1; visibility: visible; transform: translateY(0); }

.m-drop-zone { 
    flex: 1; 
    background-color: color-mix(in srgb, var(--bgMid, #05070a) 60%, rgba(10, 12, 18, 0.8));
    border: 1px dashed rgba(255, 255, 255, 0.2); 
    border-radius: 20px; padding: 24px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; transition: all 0.2s ease; 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 20px rgba(0,0,0, 0.5); 
}
.m-drop-zone .dz-icon { font-size: 28px; color: rgba(255, 255, 255, 0.8); transition: color 0.2s ease; }
.m-drop-zone .dz-label { font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); text-align: center; transition: color 0.2s ease; }

.m-drop-zone.pop.is-hovered { background: color-mix(in srgb, #ff5555 20%, rgba(15,18,25,0.9)); border-color: #ff5555; border-style: solid; transform: scale(1.05); box-shadow: 0 10px 30px rgba(255,85,85,0.3); }
.m-drop-zone.pop.is-hovered .dz-icon, .m-drop-zone.pop.is-hovered .dz-label { color: #ff5555; }
.m-drop-zone.snooze.is-hovered { background: color-mix(in srgb, #aa88ff 20%, rgba(15,18,25,0.9)); border-color: #aa88ff; border-style: solid; transform: scale(1.05); box-shadow: 0 10px 30px rgba(170,136,255,0.3); }
.m-drop-zone.snooze.is-hovered .dz-icon, .m-drop-zone.snooze.is-hovered .dz-label { color: #aa88ff; }
.m-drop-zone.project.is-hovered { background: color-mix(in srgb, #55ddff 20%, rgba(15,18,25,0.9)); border-color: #55ddff; border-style: solid; transform: scale(1.05); box-shadow: 0 10px 30px rgba(85,221,255,0.3); }
.m-drop-zone.project.is-hovered .dz-icon, .m-drop-zone.project.is-hovered .dz-label { color: #55ddff; }
.m-drop-zone.complete.is-hovered { background: color-mix(in srgb, #88ffaa 20%, rgba(15,18,25,0.9)); border-color: #88ffaa; border-style: solid; transform: scale(1.05); box-shadow: 0 10px 30px rgba(136,255,170,0.3); }
.m-drop-zone.complete.is-hovered .dz-icon, .m-drop-zone.complete.is-hovered .dz-label { color: #88ffaa; }

.m-pin-drop-zone {
    position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
    height: 44px; padding: 0 24px; border-radius: 22px; display: flex; align-items: center; justify-content: center; 
    background: color-mix(in srgb, var(--bgMid, #05070a) 50%, rgba(10, 12, 20, 0.85)); border: 1px dashed rgba(85, 221, 255, 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    opacity: 0; visibility: hidden; pointer-events: none; z-index: 100;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0,0,0, 0.6);
}
.m-pin-drop-zone span { font-family: 'Noto Sans JP', sans-serif; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 3px; color: #55ddff; text-shadow: 0 0 10px rgba(85, 221, 255, 0.5); transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.m-pin-drop-zone.is-active { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.m-pin-drop-zone.is-hovered { background: rgba(85, 221, 255, 0.2); border-style: solid; border-color: rgba(85, 221, 255, 0.8); box-shadow: 0 10px 30px rgba(85, 221, 255, 0.2), inset 0 0 15px rgba(85, 221, 255, 0.2); transform: translateX(-50%) scale(1.08); }
.m-pin-drop-zone.is-hovered span { color: #ffffff; text-shadow: 0 0 15px #55ddff, 0 0 20px #ffffff; }

/* =========================================
   2.1. EDGE RELEASE ZONES (THE AETHER)
========================================= */
.edge-release-zone {
    position: absolute !important;
    z-index: 10 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease !important;
    display: flex !important;
    box-sizing: border-box !important;
    transform: none !important; 
    visibility: visible !important;
}

.edge-release-zone.is-active {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
}

.edge-release-zone.is-hovered {
    transform: none !important;
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

/* Precise bounds scaling to container width/height percentages */
.edge-top { top: 0 !important; left: 0 !important; right: 0 !important; bottom: auto !important; height: 25% !important; width: 100% !important; background-image: radial-gradient(100% 100% at 50% 0%, rgba(255,255,255,0.15) 0%, transparent 100%) !important; }
.edge-bot { bottom: 0 !important; left: 0 !important; right: 0 !important; top: auto !important; height: 25% !important; width: 100% !important; background-image: radial-gradient(100% 100% at 50% 100%, rgba(255,255,255,0.15) 0%, transparent 100%) !important; }
.edge-left { top: 0 !important; bottom: 0 !important; left: 0 !important; right: auto !important; width: 25% !important; height: 100% !important; background-image: radial-gradient(100% 100% at 0% 50%, rgba(255,255,255,0.15) 0%, transparent 100%) !important; }
.edge-right { top: 0 !important; bottom: 0 !important; right: 0 !important; left: auto !important; width: 25% !important; height: 100% !important; background-image: radial-gradient(100% 100% at 100% 50%, rgba(255,255,255,0.15) 0%, transparent 100%) !important; }


/* =========================================
   3. FLOOR: THE HUB (FLOOR 0)
========================================= */
.floor-hub { padding: 0; }

.hub-h-scroller {
    display: flex; width: 100vw; height: 100vh; overflow-x: auto; overflow-y: visible;
    scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hub-h-scroller::-webkit-scrollbar { display: none; }

.hub-pane { 
    width: 100vw; height: 100%; flex-shrink: 0; 
    scroll-snap-align: start; scroll-snap-stop: always; 
    padding: 0 24px; box-sizing: border-box; 
    overflow: visible; touch-action: pan-x pan-y;
}
.hub-pane::-webkit-scrollbar { display: none; }

.hub-container, .vault-container { 
    display: flex; flex-direction: column; min-height: 100%; 
    max-width: 500px; margin: 0 auto; width: 100%; 
    padding-bottom: clamp(110px, 16vh, 140px) !important; box-sizing: border-box !important;
}

.hub-top-bar { display: flex; justify-content: space-between; align-items: center; padding: 24px 0 16px 0; margin-bottom: 20px; width: 100%; }
.hub-presence { font-size: 10px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: rgba(85,221,255,0.6); animation: gentlePulse 4s ease-in-out infinite alternate; text-align: center; }
.hub-swipe-hint { position: relative; z-index: 100; pointer-events: auto !important; font-size: 9px; font-weight: 800; letter-spacing: 2px; color: rgba(255,255,255,0.4); text-transform: uppercase; cursor: pointer; transition: color 0.2s; width: 70px; display: flex; align-items: center; }
.hub-swipe-hint:hover, .hub-swipe-hint:active { color: #fff; text-shadow: 0 0 10px #fff; }

.hub-header { margin-bottom: 40px; text-align: left; }
.hub-title-area { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.hub-title { font-family: 'Caveat', cursive; font-size: 48px; background: linear-gradient(to right, #fff 0%, rgba(255,255,255,0.5) 100%); -webkit-background-clip: text; color: transparent; filter: drop-shadow(0 0 15px rgba(255,255,255,0.1)); margin: 0; }

.hub-project-tally { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 auto; max-width: 120px; justify-content: flex-end; padding-top: 10px; }
.tally-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 2px rgba(255,255,255,0.5); }

/* Oracle Text Engine */
.hub-oracle-text { margin-bottom: 24px; padding: 0 8px; position: relative; }
.oracle-prose-container { position: relative; min-height: 180px; display: flex; align-items: flex-start; }
.oracle-prose-layer { position: absolute; inset: 0; opacity: 1; transition: opacity 1.5s ease; pointer-events: auto; }
.oracle-prose-layer.is-fading { opacity: 0; pointer-events: none; }

.oracle-greeting { font-family: 'Noto Sans JP', sans-serif; font-size: 10px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 16px; }
.oracle-prose { font-family: 'Neuton', serif; font-size: 22px; line-height: 1.6; color: rgba(255,255,255,0.9); }
.oracle-anim-word { display: inline-block; white-space: pre; }

.ctx-word { position: relative; font-weight: 700; white-space: nowrap; }
.ctx-action { color: #fff; font-weight: 700; font-style: italic; }
.ctx-manual { color: #fff; font-weight: 700; }
.ctx-time { color: rgba(255,255,255,0.6); font-weight: 700; }
.ctx-link { color: color-mix(in srgb, var(--ctx-color, #fff) 80%, #fff); text-shadow: 0 0 15px color-mix(in srgb, var(--ctx-color) 60%, transparent); cursor: pointer; padding: 2px 4px; margin: 0 -4px; border-radius: 4px; border-bottom: 1px dotted currentColor; transition: background-color 0.2s, transform 0.2s; display: inline-block; }
.ctx-link:active { background-color: color-mix(in srgb, var(--ctx-color) 20%, transparent); transform: scale(0.95); }

/* Carousel Actions */
.hub-next-text { padding: 0 8px; margin-bottom: 0; }
.hub-label { font-size: 10px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; }

.hub-task-carousel-container { display: flex; flex-direction: column; overflow: hidden; position: relative; }
.hub-task-row { 
    display: flex; align-items: flex-start; gap: 14px; 
    padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
    max-height: 80px; opacity: 1; transform: translateY(0); 
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.hub-task-row.slide-in-up { max-height: 0; opacity: 0; transform: translateY(20px); margin: 0; padding: 0; border: none; }
.hub-task-row.slide-out-up { max-height: 0; opacity: 0; transform: translateY(-20px); margin: 0; padding: 0; border: none; }

.hub-task-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.hub-task-text { display: flex; flex-direction: column; gap: 4px; }
.hub-task-proj { font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; opacity: 0.6; }
.hub-task-desc { font-family: 'Neuton', serif; font-size: 20px; line-height: 1.4; color: #fff; }

.hub-scroll-hint { 
    margin-top: auto; margin-bottom: 90px !important; padding-top: 30px;
    display: flex; flex-direction: column; align-items: center; 
    font-size: 10px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; 
    color: rgba(255,255,255,0.3); animation: m-bounce-up 2s infinite; 
}

/* =========================================
   4. FLOOR: PROJECT FLOORS (EBOOK CARDS)
========================================= */
.floor-project {
    background: radial-gradient(circle at center 30%, color-mix(in srgb, var(--capsuleAccent) 15%, transparent) 0%, #0a0c12 70%) !important;
}

.p-floor-container { 
    display: flex; flex-direction: column; height: 100%; width: 100%; 
    max-width: 550px; margin: 0 auto; 
    padding: clamp(50px, 8vh, 80px) 24px clamp(110px, 16vh, 140px) 24px; box-sizing: border-box; 
    opacity: 0.3; transform: scale(0.97) translateY(20px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ✨ ASCENDED: Respect both the Observer's focus AND the birthing state */
.elevator-floor.is-focused .p-floor-container,
.elevator-floor.is-arriving .p-floor-container { 
    opacity: 1; transform: scale(1) translateY(0); 
}
.p-floor-left { display: flex; flex-direction: column; flex-shrink: 1; min-height: 0; }
.p-floor-right { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; min-height: 35vh; justify-content: flex-start; padding-bottom: 10px; }

.p-floor-header { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(6px, 1.5vh, 12px); margin-bottom: clamp(10px, 2vh, 16px); width: 100%; flex-shrink: 1; min-height: 0; }

.p-title { 
    font-size: clamp(20px, 3.5vh, 34px); font-weight: 800; line-height: 1.15; margin: 0; width: 100%; 
    flex-shrink: 1; min-height: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; 
    background: linear-gradient(to right, #fff 0%, color-mix(in srgb, var(--capsuleAccent) 70%, #fff) 50%, #fff 100%);
    background-size: 200% auto; color: transparent; -webkit-background-clip: text;
    animation: textShimmer 8s linear infinite; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}

.p-category { font-size: 10px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--capsuleAccent); border-bottom: 2px solid var(--capsuleAccent); padding-bottom: 6px; text-shadow: 0 0 10px color-mix(in srgb, var(--capsuleAccent) 50%, transparent); flex-shrink: 0; }

.ebook-controls { display: flex; gap: 12px; }
.ebook-icon-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; transition: all 0.2s; user-select: none; }
.ebook-icon-btn.is-active { background: var(--capsuleAccent); color: #000; box-shadow: 0 0 15px color-mix(in srgb, var(--capsuleAccent) 50%, transparent); border: none; }

.p-floor-content { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; background: transparent !important; border: none !important; box-shadow: none !important; }
.p-content-label { font-size: 10px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 0; padding-bottom: 0; flex-shrink: 0; }

/* Tasks UI */
.p-task-list-wrap { 
    flex-grow: 1; min-height: 0; display: flex; flex-direction: column; 
    justify-content: flex-start; gap: clamp(6px, 1.5vh, 8px); 
    padding-bottom: clamp(5px, 1vh, 10px); 
    overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: none;
}
.p-task-list-wrap::-webkit-scrollbar { display: none; }

.m-card-header-actions { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; margin-top: clamp(8px, 2vh, 15px); margin-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.ebook-controls-mini { display: flex; gap: 8px; }
.ebook-icon-btn-mini { background: transparent; border: none; color: #fff; font-size: 14px; cursor: pointer; transition: opacity 0.2s; padding: 4px; user-select: none; }
.ebook-icon-btn-mini:active { transform: scale(0.9); }

.m-header-nav { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.m-nav-count { color: rgba(255, 255, 255, 0.3); font-family: monospace; }
.m-nav-btns { display: flex; gap: 2px; }
.m-nav-btn { color: rgba(255, 255, 255, 0.4); font-size: 14px; cursor: pointer; user-select: none; transition: color 0.1s; padding: 0 4px; }
.m-nav-btn:active { color: var(--capsuleAccent); }
.m-nav-btn.is-disabled { opacity: 0.1; pointer-events: none; }

.p-task-item { 
    position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.03) !important; 
    border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); 
    padding: clamp(10px, 1.5vh, 14px) 16px; 
    display: flex; align-items: flex-start; gap: 14px; 
    touch-action: pan-y; transition: transform 0.2s, opacity 0.3s, background-color: 0.2s; 
    flex-shrink: 0; margin-bottom: 0; 
}
.p-task-item:hover, .p-task-item:active { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.1); }
.p-task-bg-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--capsuleAccent) 40%, rgba(0,0,0,0.8)), color-mix(in srgb, var(--capsuleAccent) 20%, transparent)); border-right: 2px solid var(--capsuleAccent); box-shadow: 5px 0 20px color-mix(in srgb, var(--capsuleAccent) 30%, transparent); z-index: 0; transition: width 0.3s ease; }
.p-task-box { position: relative; z-index: 1; width: clamp(18px, 3vh, 22px); height: clamp(18px, 3vh, 22px); margin-top: -1px; border: 2px solid rgba(255,255,255,0.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; color: transparent; cursor: pointer; flex-shrink: 0; transition: all 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.4); }
.p-task-text { position: relative; z-index: 1; font-size: clamp(13px, 2vh, 15px); line-height: 1.3; flex-grow: 1; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.8); pointer-events: none; transition: opacity 0.3s, color 0.3s; }
.p-task-delete { position: relative; z-index: 10; background: transparent; border: none; color: rgba(255,255,255,0.3); font-size: 16px; padding: 4px; cursor: pointer; transition: color 0.2s, transform 0.2s; }
.p-task-delete:hover { color: #ff5555; transform: scale(1.2); }

.p-task-item.is-done { background: rgba(255, 255, 255, 0.05) !important; border-color: rgba(255, 255, 255, 0.1) !important; }
.p-task-item.is-done .p-task-bg-fill { background: color-mix(in srgb, var(--capsuleAccent) 30%, transparent); border-right: none; box-shadow: none; opacity: 1; filter: brightness(0.6); }
.p-task-item.is-done .p-task-box { background: var(--capsuleAccent); border-color: var(--capsuleAccent); color: #000; box-shadow: 0 0 15px color-mix(in srgb, var(--capsuleAccent) 50%, transparent); }
.p-task-item.is-done .p-task-text { opacity: 0.3; text-decoration: line-through; }

.p-task-item.is-danger { background: rgba(255, 50, 50, 0.15) !important; border: 1px solid rgba(255, 50, 50, 0.4) !important; transform: scale(0.96); }
.p-task-item.is-danger .p-task-text { color: #ff5555 !important; text-decoration: line-through; }
.p-task-item.is-danger .p-task-box { border-color: #ff5555 !important; }
.p-task-item.is-danger .p-task-bg-fill { background: rgba(255, 50, 50, 0.4) !important; border-right: none; }

/* =========================================
   5. PROGRESS SEGMENTS & SCRUBBERS
========================================= */
.p-floor-segments { margin-bottom: clamp(14px, 3vh, 28px); flex-shrink: 0; width: 100%; }
.m-segment-track { display: flex; gap: 2px; height: 8px !important; width: 100%; background: rgba(255,255,255,0.08) !important; border-radius: 8px; box-shadow: inset 0 2px 6px rgba(0,0,0,0.8) !important; padding: 2px; box-sizing: border-box; }
.m-seg-box { flex-grow: 1; height: 100%; border-radius: 4px; background: rgba(0,0,0,0.6) !important; overflow: hidden; }
.m-seg-box.manual-seg { flex-grow: 1.5; }
.m-seg-fill { height: 100%; border-radius: 4px; background: var(--capsuleAccent) !important; box-shadow: 0 0 15px color-mix(in srgb, var(--capsuleAccent) 60%, transparent) !important; filter: brightness(1.2); transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
body.is-scrubbing .m-seg-fill { transition: none !important; }

.m-project-scrubber { 
    align-self: center; margin-bottom: clamp(15px, 4vh, 30px); 
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.02) 100%); 
    border: 1px solid rgba(255, 255, 255, 0.25); 
    padding: clamp(8px, 1.5vh, 12px) 32px; border-radius: 999px; 
    font-family: 'Noto Sans JP', sans-serif; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 3px; color: #fff; text-align: center; 
    transition: all 0.3s ease; user-select: none; cursor: ew-resize; 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); 
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.4); 
    min-width: 180px; flex-shrink: 0; 
    touch-action: none !important; 
}
.m-project-scrubber.is-scrubbing { background: var(--capsuleAccent); color: #000; border-color: #fff; box-shadow: 0 10px 40px color-mix(in srgb, var(--capsuleAccent) 70%, transparent), inset 0 2px 4px rgba(255,255,255,0.8); transform: scale(1.08); text-shadow: none; }

.m-project-scrubber.is-danger { background: rgba(255, 50, 50, 0.2) !important; border-color: #ff5555 !important; color: #ff5555 !important; box-shadow: 0 0 30px rgba(255, 50, 50, 0.4) !important; transform: scale(0.95); }
.m-project-scrubber.is-danger span { color: #ff5555; text-shadow: 0 0 12px rgba(255, 50, 50, 0.8); }
.m-project-scrubber.is-danger::before { content: "⚠ IGNITE "; }

.p-time-badge { font-family: 'Noto Sans JP', sans-serif; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); cursor: ew-resize; transition: all 0.2s ease; user-select: none; display: inline-block; box-shadow: 0 4px 15px rgba(0,0,0,0.3); backdrop-filter: blur(10px); touch-action: none !important; }
.p-time-badge.is-active-scrub { background: #fff !important; color: #000 !important; border-color: #fff !important; box-shadow: 0 0 25px rgba(255,255,255,0.8) !important; transform: scale(1.08); }

/* =========================================
   6. FLOOR: THE VAULT (ARCHIVE)
========================================= */
.floor-basement { background: radial-gradient(circle at top center, #070a12 0%, #010102 100%) !important; padding: 0; overflow: hidden; }

.vault-top-half { flex-shrink: 0; z-index: 10; }
.vault-title { font-family: 'Caveat', cursive; font-size: 44px; background: linear-gradient(to bottom, rgba(255,255,255,0.4), rgba(255,255,255,0.1)); -webkit-background-clip: text; color: transparent; margin: 0; filter: drop-shadow(0 2px 10px rgba(0,0,0,0.8)); }

.vault-oracle-text { padding: 0; }
.vault-oracle-text .oracle-greeting { color: rgba(255,255,255,0.25); }
.vault-oracle-text .oracle-prose { color: rgba(255,255,255,0.5); font-size: 20px; }
.vault-highlight { color: var(--v-color, #fff); text-shadow: 0 0 12px color-mix(in srgb, var(--v-color) 40%, transparent); font-style: italic; }

.vault-sky-canvas { position: relative; flex-grow: 1; width: 100%; margin: 20px 0; z-index: 5; }
.vault-star-wrap { position: absolute; width: 64px; height: 64px; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; cursor: pointer; animation: vaultFloat linear infinite alternate; }
.vault-star-core { width: 8px; height: 8px; border-radius: 50%; background: var(--star-color); box-shadow: 0 0 10px var(--star-color); animation: vaultTwinkle 3s ease-in-out infinite alternate; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.vault-star-wrap:active .vault-star-core { transform: scale(0.5); }
.vault-star-wrap.is-flaring { z-index: 20; animation-play-state: paused; }
.vault-star-wrap.is-flaring .vault-star-core { transform: scale(2.5); background: #fff; box-shadow: 0 0 20px #fff, 0 0 40px var(--star-color), 0 0 80px var(--star-color); animation: none; }

.vault-memory-dock { flex-shrink: 0; height: 40px; display: flex; align-items: center; justify-content: center; z-index: 10; }
.vault-star-label { font-family: 'Neuton', serif; font-size: 22px; font-weight: 800; color: rgba(255,255,255,0.3); text-align: center; }
.vault-scroll-hint { margin-top: 10px !important; margin-bottom: 0 !important; opacity: 0.3; flex-shrink: 0; z-index: 10; }

/* =========================================
   7. SYSTEMS & NEXUS STYLING
========================================= */
.m-sys-status-box { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 24px; margin-bottom: 24px; box-shadow: inset 0 0 20px rgba(255,255,255,0.02); }
.sys-status-title { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.sys-status-desc { font-family: 'Neuton', serif; font-size: 18px; color: rgba(255,255,255,0.7); word-break: break-all; }
.sys-status-badge { display: inline-block; margin-top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }

.m-sys-status-box.unlinked .sys-status-title { color: rgba(255,255,255,0.4); }
.m-sys-status-box.linked .sys-status-title { color: #55ddff; text-shadow: 0 0 10px rgba(85,221,255,0.4); }
.m-sys-status-box.linked .sys-status-desc { color: #fff; }
.m-sys-status-box.linked .sys-status-badge { background: rgba(85,221,255,0.15); border: 1px solid #55ddff; color: #55ddff; }

.m-sys-btn, .m-sys-btn-logout { width: 100%; padding: 18px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); border-radius: 14px; color: #fff; font-family: 'Noto Sans JP', sans-serif; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s; }
.m-sys-btn:active { background: rgba(255,255,255,0.1); transform: scale(0.98); }
.m-sys-btn.primary { background: linear-gradient(135deg, rgba(85,221,255,0.15), rgba(0,136,204,0.1)); border-color: #55ddff; color: #55ddff; box-shadow: 0 5px 15px rgba(85,221,255,0.15); }
.m-sys-btn-logout { background: transparent; border-color: rgba(255,50,50,0.3); color: #ff5555; margin-bottom: 0; }
.m-sys-btn-logout:active { background: rgba(255,50,50,0.1); transform: scale(0.98); }
#m-heart-content-area a { color: #55ddff; text-decoration: none; border-bottom: 1px dotted #55ddff; transition: opacity 0.2s; }
#m-heart-content-area a:active { opacity: 0.5; }

/* =========================================
   8. COMMAND DOCK, HUD, MODALS & SPY
========================================= */
.m-persistent-ui, .m-modal-overlay { display: none; }
body.is-mobile .m-persistent-ui { display: flex; position: fixed; inset: 0; pointer-events: none; z-index: 800; flex-direction: column; justify-content: space-between; }

#m-progress-bar-container { 
    display: flex; gap: 2px; width: 100vw; height: 12px; background: rgba(0,0,0,0.9); 
    position: absolute; top: 0; left: 0; z-index: 810; pointer-events: auto; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.8); 
}
.m-global-seg-box { flex-grow: 1; height: 100%; background: rgba(255,255,255,0.1); overflow: hidden; border-radius: 0 0 4px 4px; }
.m-global-seg-fill { height: 100%; transition: width 0.4s ease; border-radius: 0 0 4px 4px; filter: brightness(1.2); }

/* Command Dock */
body.is-mobile .m-command-dock {
    position: fixed; bottom: clamp(20px, env(safe-area-inset-bottom, 30px), 40px); left: 0; right: 0;
    display: flex; justify-content: center; align-items: center; gap: 16px;
    z-index: 850; pointer-events: none; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
body.is-mobile .m-command-dock > * { pointer-events: auto; }

body.is-mobile .m-capture-ring { 
    width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, rgba(85,221,255,0.2), rgba(0,136,204,0.1)); border: 2px solid rgba(85,221,255,0.6); box-shadow: 0 10px 30px rgba(85,221,255,0.3), inset 0 0 15px rgba(85,221,255,0.2); display: flex; align-items: center; justify-content: center; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; padding: 0; backdrop-filter: blur(10px); 
}
body.is-mobile .m-capture-ring:active { transform: scale(0.9); filter: brightness(1.2); }
body.is-mobile .m-capture-ring::after { content: '✚'; font-size: 26px; color: #fff; text-shadow: 0 0 10px #55ddff; }

body.is-mobile .m-add-task-btn {
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--dock-accent, #55ddff) 20%, #0a0c12);
    border: 1px solid var(--dock-accent, #55ddff); color: #fff;
    height: 60px; border-radius: 30px; font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); cursor: pointer; overflow: hidden; white-space: nowrap;
    max-width: 0; opacity: 0; padding: 0; margin: 0; border-width: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
body.is-mobile .m-command-dock.state-project .m-add-task-btn { max-width: 200px; opacity: 1; padding: 0 30px; border-width: 1px; margin-left: 0; }
body.is-mobile .m-command-dock.state-project .m-capture-ring { opacity: 0.5; transform: scale(0.85); }

/* Scrubbing HUD & Scroll Spy */
#m-scrub-hud {
    position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.85); border: 1px solid #55ddff; color: #fff;
    padding: 20px 40px; border-radius: 20px; font-size: 32px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 4px; z-index: 920; pointer-events: none;
    opacity: 0; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(15px); box-shadow: 0 20px 50px rgba(0,0,0,0.5); text-align: center;
}
#m-scrub-hud.is-active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#m-scrub-hud.is-danger { border-color: #ff5555; color: #ff5555; box-shadow: 0 20px 50px rgba(255,85,85,0.4); }

#m-scroll-spy { position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%); width: 280px; height: 120px; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; z-index: 820; -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent); background: rgba(0,0,0,0.6); border-radius: 16px; padding: 20px 0; box-shadow: 0 10px 40px rgba(0,0,0,0.8); }
#m-scroll-spy.is-visible { opacity: 1; }
#m-scroll-spy-track { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.spy-item { font-size: 12px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.2); transition: all 0.4s ease; white-space: nowrap; }
.spy-item.is-active { color: var(--spy-color); font-size: 16px; text-shadow: 0 0 20px color-mix(in srgb, var(--spy-color) 80%, transparent); }

/* ✨ ASCENDED: Centered, Adaptive Input Modals */
body.is-mobile .m-modal-overlay { 
    display: flex; position: fixed; inset: 0; z-index: 900; 
    background: rgba(2,4,8,0.95) !important; backdrop-filter: blur(24px) !important; 
    align-items: center; justify-content: center; /* Centered by default */
    opacity: 0; visibility: hidden; pointer-events: none; 
    transition: opacity 0.3s ease, visibility 0.3s; 
}
body.is-mobile .m-modal-overlay.is-active { opacity: 1; visibility: visible; pointer-events: auto; }

body.is-mobile .m-thought-modal { 
    background: #0c0e14; border: 1px solid rgba(255,255,255,0.15); 
    border-radius: 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 40px rgba(85,221,255,0.1) !important; 
    padding: 24px; display: flex; flex-direction: column; gap: 16px; align-items: center; 
    width: 90vw; max-width: 400px; max-height: 85dvh; box-sizing: border-box;
    transform: scale(0.95) translateY(20px); opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important; 
}
body.is-mobile .m-modal-overlay.is-active .m-thought-modal { 
    transform: scale(1) translateY(0); opacity: 1; 
}

body.is-mobile #m-thought-input, body.is-mobile #m-task-input { 
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); 
    color: #fff; font-family: 'Noto Sans JP', sans-serif; font-size: 18px !important; 
    padding: 18px 24px; border-radius: 24px; outline: none; 
    transition: border-color 0.2s, box-shadow 0.2s; 
    flex-shrink: 1; overflow-y: auto; max-height: 40dvh; /* Scroll if text gets huge */
}
body.is-mobile #m-thought-input:focus, body.is-mobile #m-task-input:focus { 
    border-color: #55ddff; box-shadow: 0 0 20px rgba(85,221,255,0.2); background: rgba(0,0,0,0.5); 
}

body.is-mobile #m-thought-submit, body.is-mobile .m-task-submit-btn { 
    background: linear-gradient(135deg, #55ddff, #0088cc); border: none; 
    width: 60px; height: 60px; border-radius: 50%; color: #fff; font-size: 24px; 
    display: flex; align-items: center; justify-content: center; 
    box-shadow: 0 8px 25px rgba(85,221,255,0.4); cursor: pointer; 
    flex-shrink: 0; margin-top: auto; /* Forces button to the bottom if container squishes */
}

/* Keyboard/Mini Screen Adjustment */
@media (max-height: 700px) {
    body.is-mobile .m-modal-overlay {
        align-items: flex-start; /* Push modal up when keyboard is open */
        padding-top: 5dvh;
    }
}

/* Destruction Modal (Also centered now) */
.m-destroy-modal { 
    width: 90vw; max-width: 400px; background: #110505; border-radius: 28px; 
    border: 1px solid rgba(255, 50, 50, 0.4); box-shadow: 0 20px 60px rgba(255, 0, 0, 0.2); 
    padding: 36px 24px 36px 24px; display: flex; flex-direction: column; align-items: center; 
    text-align: center; transform: scale(0.95) translateY(20px); opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.m-modal-overlay.is-active .m-destroy-modal { transform: scale(1) translateY(0); opacity: 1; }
#m-destroy-title { margin: 0 0 12px 0; font-size: 28px; font-weight: 800; color: #ff5555; text-shadow: 0 0 20px rgba(255, 85, 85, 0.6); }
#m-destroy-desc { margin: 0 0 36px 0; font-size: 15px; color: rgba(255, 255, 255, 0.7); line-height: 1.5; }
.m-destroy-actions { display: flex; gap: 16px; width: 100%; }
.m-btn-cancel { flex: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15); color: #fff; padding: 18px; border-radius: 14px; font-weight: 800; font-size: 15px; cursor: pointer; transition: background 0.2s; }
.m-btn-cancel:active { background: rgba(255,255,255,0.1); }
.m-btn-burn { flex: 1; background: rgba(255, 50, 50, 0.15); border: 1px solid #ff5555; color: #ff5555; padding: 18px; border-radius: 14px; font-weight: 800; font-size: 15px; text-shadow: 0 0 10px rgba(255, 50, 50, 0.5); box-shadow: 0 8px 25px rgba(255, 50, 50, 0.3); cursor: pointer; transition: background 0.2s; }
.m-btn-burn:active { background: rgba(255,50,50,0.25); }

/* SPARC Node */
#m-sparc-bubble { position: absolute; background: rgba(10, 10, 15, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 18px; padding: 14px 20px; max-width: 250px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2); pointer-events: none; z-index: 930; box-sizing: border-box; }
#m-sparc-text { font-family: 'Neuton', serif; font-size: 16px; font-weight: 400; line-height: 1.4; color: rgba(255, 255, 255, 0.95); margin: 0; white-space: pre-wrap; }
#m-sparc-bubble[data-sparc-cat="philosophical"] { border-color: rgba(136, 255, 170, 0.5); box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 1px 2px rgba(136, 255, 170, 0.2); }
#m-sparc-bubble[data-sparc-cat="vital"] { border-color: rgba(255, 85, 85, 0.5); box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 1px 2px rgba(255, 85, 85, 0.2); }
#m-sparc-bubble[data-sparc-cat="ui"] { border-color: rgba(85, 221, 255, 0.5); box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 1px 2px rgba(85, 221, 255, 0.2); }

/* =========================================
   9. ANIMATIONS & PARTICLES
========================================= */
@keyframes m-bounce-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes textShimmer { to { background-position: 200% center; } }
@keyframes vaultTwinkle { 0% { opacity: 0.2; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 15px var(--star-color); } }
@keyframes vaultFloat { 0% { transform: translate(-50%, -50%) translateY(-6px); } 100% { transform: translate(-50%, -50%) translateY(6px); } }

.ef-particle-spark {
    position: absolute; border-radius: 50%; pointer-events: none; z-index: 940;
    transform: translate(-50%, -50%); will-change: transform, opacity;
}

/* =========================================
   10. SAFE ZONES & ADAPTIVE GEOMETRY 
========================================= */

@media (max-width: 380px) {
    .p-floor-container { padding: clamp(40px, 6vh, 60px) 20px clamp(100px, 15vh, 140px) 20px !important; }
    .p-title { font-size: clamp(20px, 4vh, 28px); line-height: 1.1; -webkit-line-clamp: 2; }
    .p-task-item { padding: clamp(8px, 1.2vh, 12px) 14px; gap: 10px; }
    .p-task-text { font-size: clamp(12px, 1.8vh, 14px); line-height: 1.2; }
}

@media (min-width: 600px) and (min-aspect-ratio: 4/5) {
    .p-floor-container {
        flex-direction: row; 
        max-width: 1000px; align-items: stretch; gap: 60px;
        padding: 80px 40px 140px 40px !important;
    }
    .p-floor-left { flex: 1; justify-content: center; }
    .p-floor-right { flex: 1; justify-content: flex-start; height: 100%; max-height: 70vh; align-self: center; }
    .p-title { font-size: 46px; -webkit-line-clamp: 3; }
    .p-task-item { padding: 18px 24px; }
    .p-task-text { font-size: 18px; }
}