/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AURA MASCOT SYSTEM (Interactive Cinematic Edition v5 - FIXED)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
    --aura-neon: #00deff;
    --aura-neon-rgb: 0, 222, 255;
    --aura-glow: rgba(0, 222, 255, 0.4);
    --aura-orange: #ff6a00;
}

/* Docked State Logic */
.mascot-is-docked #pt-ai-mascot-container {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.5) translateY(100px) !important;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1) !important;
}
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ULTRA-PREMIUM CINEMATIC HOLOGRAM - V2
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.pocket-aura-icon {
    width: 60px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    perspective: 1200px;
    overflow: visible !important; /* Prevent beam clipping */
}

.pocket-aura-icon * {
    pointer-events: none !important; /* Ensure click hits parent icon */
}

.pocket-aura-icon:hover {
    transform: scale(1.1) rotateX(10deg);
}

/* Volumetric Light Beam */
.hologram-projection-beam {
    position: absolute;
    bottom: 5px;
    width: 80px;
    height: 60px;
    background: linear-gradient(to top, rgba(var(--aura-neon-rgb), 0.2) 0%, transparent 100%);
    clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
    filter: blur(8px);
    opacity: 0.2;
    animation: beam-flicker 3s infinite ease-in-out;
    pointer-events: none;
}

/* Pod Body & Dual Containment Rings */
.hologram-pod-core {
    width: 44px;
    height: 38px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: cinematic-breathing 4s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(var(--aura-neon-rgb), 0.15);
    z-index: 2;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.hologram-containment-rings span {
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    border: 2px solid rgba(var(--aura-neon-rgb), 0.6);
    animation: ring-pulse 3s infinite ease-in-out;
}

.hologram-containment-rings span:last-child {
    inset: -5px;
    border-width: 1px;
    opacity: 0.3;
    animation-delay: 0.5s;
}

/* Visor Glass High-Fidelity */
.hologram-visor-shield {
    width: 36px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: hologram-facial-bob 3s infinite ease-in-out;
}

.hologram-glass-texture {
    position: absolute;
    inset: 0;
    /* Hexagonal Grid Pattern */
    background-image: radial-gradient(rgba(var(--aura-neon-rgb), 0.15) 1px, transparent 1px);
    background-size: 4px 4px;
    pointer-events: none;
}

.hologram-glass-texture::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%; left: -150%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
    animation: visor-sweep 4s infinite linear;
}

/* Digital Iris Physics */
.hologram-eyes-complex {
    display: flex;
    justify-content: space-around;
    width: 26px;
    margin-top: 2px;
}

.h-eye {
    width: 8px;
    height: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.h-iris {
    position: absolute;
    inset: 0;
    border: 1px solid var(--aura-neon);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--aura-neon);
    animation: eye-iris-pulse 2s infinite ease-in-out;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.h-pupil {
    width: 4px;
    height: 4px;
    background: var(--aura-neon);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--aura-neon);
}

.h-glint {
    position: absolute;
    top: 1px; right: 1px;
    width: 2px; height: 1px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.8;
}

/* Liquified Waveform Smile */
.hologram-smile-waveform {
    width: 14px;
    height: 4px;
    border-bottom: 2px solid var(--aura-orange);
    border-radius: 50%;
    margin-top: 2px;
    filter: drop-shadow(0 0 5px var(--aura-orange));
    animation: smile-waveform 2s infinite ease-in-out;
}

/* Orbiting Energy Trails */
.h-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--aura-neon);
    border-radius: 50%;
    box-shadow: 
        0 0 8px var(--aura-neon),
        -5px 0 10px rgba(var(--aura-neon-rgb), 0.5),
        -10px 0 15px rgba(var(--aura-neon-rgb), 0.2);
    z-index: 10;
}

.h-particle.p1 { top: -5px; right: 0; animation: orbit-blur 4s infinite linear; }
.h-particle.p2 { bottom: -2px; left: -5px; animation: orbit-blur 5s infinite linear reverse; }
.h-particle.p3 { top: 15px; right: -10px; animation: orbit-blur 3s infinite linear; }

/* ── STATE-AWARE OVERRIDES ── */

/* Thinking State */
.pocket-aura-icon.thinking .hologram-pod-core {
    border-color: #eab308;
    box-shadow: inset 0 0 15px rgba(234, 179, 8, 0.3), 0 0 20px rgba(234, 179, 8, 0.4);
}
.pocket-aura-icon.thinking .h-iris {
    background: rgba(234, 179, 8, 0.2);
    border-color: #eab308;
}
.pocket-aura-icon.thinking .h-pupil {
    background: #eab308;
    box-shadow: 0 0 10px #eab308;
}

/* Error State */
.pocket-aura-icon.error .hologram-pod-core {
    border-color: #ef4444; 
    animation: hologram-jitter-red 0.1s infinite;
}

/* Moods */
.pocket-aura-icon.mood-love .h-pupil { background: #ec4899; box-shadow: 0 0 10px #ec4899; }
.pocket-aura-icon.mood-happy .hologram-visor-shield { animation-duration: 1.5s; }

/* ── ANIMATIONS ── */
@keyframes cinematic-breathing {
    0%, 100% { transform: scale(1) translateY(0); filter: brightness(1) drop-shadow(0 0 10px rgba(var(--aura-neon-rgb), 0.2)); }
    50% { transform: scale(1.04) translateY(-3px); filter: brightness(1.15) drop-shadow(0 0 20px rgba(var(--aura-neon-rgb), 0.4)); }
}

@keyframes beam-flicker {
    0%, 100% { opacity: 0.3; transform: scaleX(1); }
    50% { opacity: 0.5; transform: scaleX(1.1); }
    70% { opacity: 0.4; transform: skewX(2deg); }
}

@keyframes visor-sweep {
    from { transform: translateX(-100%) rotate(45deg); }
    to { transform: translateX(200%) rotate(45deg); }
}

@keyframes eye-iris-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes ring-pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

@keyframes orbit-blur {
    from { transform: rotate(0deg) translateX(18px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(18px) rotate(-360deg); }
}

@keyframes smile-waveform {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.1) translateY(1px); }
}

@keyframes hologram-facial-bob {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(1px, -1.5px); }
}

@keyframes hologram-jitter-red {
    0% { transform: translate(0); }
    50% { transform: translate(1.5px, -1px); filter: hue-rotate(10deg); }
    100% { transform: translate(-1px, 1px); }
}

@keyframes pocket-materialize {
    0% { transform: translateY(-30px) scale(0); opacity: 0; filter: blur(10px); }
    100% { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); }
}

/* Docking Zone Visual Feedback */
.pt-ai-header-zone.drag-over {
    background: rgba(0, 222, 255, 0.05);
    border-radius: 16px;
    box-shadow: inset 0 0 20px rgba(0, 222, 255, 0.1);
}

/* Parent Wrapper - Positioning Logic */
.pt-ai-mascot-wrapper.nextgen-mode {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 10001; /* Above almost everything */
    cursor: pointer;
    perspective: 1200px;
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: aura-hologram-materialize 1.5s ease-out forwards;
    display: block !important; /* Force visibility */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    will-change: transform, right;
}

.pt-ai-mascot-wrapper.nextgen-mode.is-dragging {
    transition: none !important;
    touch-action: none !important;
    cursor: grabbing !important;
}

/* Hover Interaction: Go Green Flashy */
.pt-ai-mascot-wrapper.nextgen-mode:hover {
    --aura-neon: #00ff9d; 
    --aura-neon-rgb: 0, 255, 157;
    --aura-glow: rgba(0, 255, 157, 0.5);
    transform: scale(1.15) translateY(-10px);
}

/* Offcanvas Push Mechanic (Desktop): Aura slides left based on dynamic panel width variable.
   We apply this to all desktop mascots (with or without custom pos) to avoid overlap. */
@media (min-width: 901px) {
    .pt-offcanvas-open .pt-ai-mascot-wrapper.nextgen-mode {
        /* Pushed to at least 40px from panel edge, but allows user to drag further left */
        right: max(var(--pt-mascot-custom-right, 40px), calc(var(--pt-ai-panel-width, 650px) + 40px)) !important; 
        transform: scale(0.95);
    }
}

/* Offcanvas Push Mechanic (Mobile): Handled in the @media (max-width: 900px) block below. */

/* Base visibility rules for all states */
.pt-ai-mascot-wrapper.nextgen-mode {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 100000001 !important;
}

/* Mobile Fixes (Unified visibility & sane defaults) */
@media (max-width: 900px) {
    .pt-ai-mascot-wrapper.nextgen-mode:not(.has-custom-pos) {
        width: 70px;
        height: 70px;
        bottom: 25px; /* Fallback */
        bottom: max(25px, env(safe-area-inset-bottom));
        right: 25px;
    }
    
    /* Ensure dimensions even when custom pos is on */
    .pt-ai-mascot-wrapper.nextgen-mode.has-custom-pos {
        width: 70px;
        height: 70px;
    }
    
    .pt-offcanvas-open .pt-ai-mascot-wrapper.nextgen-mode:not(.has-custom-pos) {
        /* On mobile, offcanvas is usually full width, push Aura to a safe corner or stay visible */
        right: 25px !important;
        opacity: 0.2 !important; /* Ghost mode when chat is open on mobile to not block input */
        pointer-events: none !important;
    }
}

/* Backdrop Halo (Enhanced Contrast) */
.pt-ai-mascot-wrapper.nextgen-mode::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 170px;
    height: 170px;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.6) 0%, rgba(15, 23, 42, 0) 75%);
    filter: blur(12px);
    z-index: -2;
    pointer-events: none;
    animation: halo-pulse 4s ease-in-out infinite;
}

@keyframes halo-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.5; }
}

/* Materialization Effect - Stabilized for mobile viewports */
@keyframes aura-hologram-materialize {
    0% { transform: scale(0.6) translateY(0) rotateY(45deg); opacity: 0; filter: contrast(3) brightness(3) blur(20px); }
    15% { opacity: 0.8; filter: contrast(1.5) brightness(1.5) blur(5px); }
    100% { transform: scale(1) translateY(0) rotateY(0); opacity: 1; }
}

/* Ground Projection (Neon Halo) */
.robot-ground-shadow {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 20px;
    background: radial-gradient(ellipse at center, var(--aura-glow) 0%, transparent 70%);
    filter: blur(5px);
    opacity: 0.5;
    z-index: -1;
    animation: projection-pulse 3s ease-in-out infinite;
}

@keyframes projection-pulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(0.95); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.15); }
}

/* Robot Parts Positioning (CRITICAL FIX FOR FLIP) */
.robot-companion-entity {
    position: relative;
    width: 100px;
    height: 120px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    animation: ultimate-flicker 10s linear infinite;
    will-change: transform, filter, opacity; /* Force l'accélération matérielle */
}

/* Head Container (Top Position) */
.robot-part.robot-head {
    position: absolute;
    top: 0; /* Anchored to top */
    left: 50%;
    transform: translateX(-50%);
    width: 95px;
    height: 90px;
    z-index: 5; /* Above Pod */
    animation: head-float-v2 4s ease-in-out infinite -1s;
}

/* Pod Container (Bottom Position) */
.robot-part.robot-pod {
    position: absolute;
    bottom: 5px; /* Anchored to bottom */
    left: 50%;
    transform: translateX(-50%);
    width: 85px;
    height: 70px;
    z-index: 2;
    animation: pod-float-v2 4s ease-in-out infinite;
}

/* Material Styles */
.robot-pod-shell {
    fill: rgba(var(--aura-neon-rgb), 0.1);
    stroke: var(--aura-glow);
    stroke-width: 1.2;
    transition: all 0.4s ease;
}

.robot-shell {
    fill: rgba(2, 6, 23, 0.3);
    stroke: var(--aura-neon);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 8px var(--aura-glow));
    transition: all 0.4s ease;
}

/* Neon Components */
.robot-core-glow {
    fill: var(--aura-neon);
    opacity: 0.6;
    animation: core-pulse 2s ease-in-out infinite;
    transition: fill 0.4s ease;
}

.antenna-shaft {
    fill: rgba(var(--aura-neon-rgb), 0.3);
    stroke: var(--aura-neon);
    stroke-width: 0.5;
}

.antenna-led {
    fill: var(--aura-neon);
    filter: drop-shadow(0 0 10px var(--aura-neon));
    transition: fill 0.4s ease;
}

.eye-ring-outer {
    fill: rgba(var(--aura-neon-rgb), 0.08);
    stroke: var(--aura-neon);
    stroke-width: 2.2;
    filter: drop-shadow(0 0 8px var(--aura-neon));
    transition: all 0.4s ease;
}

.eye-ring-inner {
    fill: var(--aura-neon);
    filter: drop-shadow(0 0 3px #ffffff);
    transition: fill 0.4s ease;
}

.aura-mouth-path {
    fill: none;
    stroke: var(--aura-neon);
    stroke-width: 3.5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px var(--aura-neon));
    transition: all 0.4s ease;
}

/* Advanced Cinematic Flicker */
@keyframes ultimate-flicker {
    0%, 18%, 22%, 42%, 46%, 88%, 92%, 100% { opacity: 1; transform: translate(0,0); filter: none; }
    20% { opacity: 0.8; transform: translate(-1px, 1px); filter: contrast(1.2); }
    45% { opacity: 0.9; transform: translate(1px, -1px); filter: brightness(1.4); }
}

/* Floating Animations */
@keyframes pod-float-v2 {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); }
    50% { transform: translateX(-50%) translateY(-10px) rotate(1deg); }
}

@keyframes head-float-v2 {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(1deg); }
    50% { transform: translateX(-50%) translateY(-13px) rotate(-1deg); }
}

/* Tooltip (Holographic Glass) */
.pt-ai-mascot-tooltip {
    position: absolute;
    right: 140px;
    top: 50%;
    transform: translateY(-50%) translateX(30px);
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--aura-glow);
    padding: 14px 24px;
    border-radius: 20px;
    color: var(--aura-neon);
    font-size: 13px;
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10002;
}

.pt-ai-mascot-wrapper:hover .pt-ai-mascot-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}


/* ── Physical Appendages (Hands) ── */
.robot-hand {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 10;
}

.robot-hand-l { left: -30px; top: 40px; transform: rotate(-20deg); }
.robot-hand-r { right: -30px; top: 40px; transform: rotate(20deg); }

.hand-path {
    fill: rgba(var(--aura-neon-rgb), 0.2);
    stroke: var(--aura-neon);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 5px var(--aura-neon));
}

/* Hands States */
.mood-super-happy .robot-hand, .mood-happy .robot-hand {
    opacity: 0.8;
    animation: hand-celebrate 0.6s ease-in-out infinite;
}

.mood-angry .robot-hand {
    opacity: 1;
    animation: hand-irritated 0.3s ease-in-out infinite;
}

@keyframes hand-celebrate {
    0%, 100% { transform: translateY(0) rotate(-20deg); }
    50% { transform: translateY(-15px) rotate(-10deg); }
}

@keyframes hand-irritated {
    0%, 100% { transform: translateX(0) rotate(-25deg); }
    50% { transform: translateX(-10px) rotate(-35deg); }
}

/* ── Faceplate Matrix Text ── */
.aura-face-text {
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-weight: 900;
    font-size: 10px; /* Smaller for longer names */
    fill: var(--aura-neon);
    filter: drop-shadow(0 0 5px var(--aura-neon));
    letter-spacing: 0.5px;
    pointer-events: none;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px var(--aura-neon);
    opacity: 0;
    text-transform: uppercase;
}

.has-face-text .aura-face-text { opacity: 1 !important; transform: scale(1.1); animation: text-flicker 0.1s infinite alternate; }
.has-face-text .aura-eyes, .mood-thinking .aura-eyes { opacity: 0.15 !important; } /* Dim eyes when text/loader is on face */

@keyframes text-flicker {
    from { opacity: 0.8; }
    to { opacity: 1; filter: brightness(1.3); }
}

/* ── Faceplate Loader ── */
.aura-face-loader { 
    color: var(--aura-neon);
    transition: all 0.5s ease;
    transform-origin: 50px 52px;
}

.mood-thinking .aura-face-loader { 
    opacity: 1 !important; 
    animation: aura-gear-rotate 2s linear infinite; 
}

@keyframes aura-gear-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Thought Cloud ── */
.aura-thought-cloud { transition: all 0.5s ease; pointer-events: none; opacity: 0; }
.pt-ai-mascot-wrapper.thinking .aura-thought-cloud { opacity: 1 !important; }

.thought-dot {
    fill: var(--aura-neon);
    filter: drop-shadow(0 0 5px var(--aura-neon));
}

.dot-1 { animation: thought-pulse 1.2s infinite 0s; }
.dot-2 { animation: thought-pulse 1.2s infinite 0.3s; }
.dot-3 { animation: thought-pulse 1.2s infinite 0.6s; }

@keyframes thought-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ── Emotion Mastery System ── */

.aura-mouth-path { opacity: 0; }
.mouth-neutral { opacity: 0.8; }

/* EMOTION CLASSES */

/* Happy & Super Happy */
.mood-happy .mouth-happy { opacity: 1; transform: scaleX(1.1); }
.mood-happy .mouth-neutral { opacity: 0; }

.mood-super-happy .mouth-super-happy { opacity: 1; stroke: #00ffcc; fill: rgba(0, 255, 204, 0.1); }
.mood-super-happy .mouth-neutral { opacity: 0; }
.mood-super-happy .robot-brow { transform: translateY(-3px); opacity: 1; }

/* Thinking / Analyzing Mode (Deep Search) */
.mood-thinking .mouth-thinking { opacity: 1; stroke-width: 4; }
.mood-thinking .mouth-neutral { opacity: 0; }
.mood-thinking .eye-ring-outer { 
    animation: aura-thinking-pulse 1.5s ease-in-out infinite; 
    stroke: #00deff !important;
}
.mood-thinking .robot-brow { 
    transform: translateY(1px) rotate(5deg); 
    opacity: 0.7; 
}
.mood-thinking .brow-r { transform: translateY(1px) rotate(-5deg); }

/* Animation triggers based on container state */
.pt-ai-mascot-wrapper.thinking .antenna-led,
.pt-ai-mascot-wrapper.detecting .antenna-led {
    animation: aura-antenna-ping 0.8s ease-in-out infinite !important;
}

/* Love Mode */
.mood-love .blush-circle { opacity: 0.4; animation: aura-blush-pulse 2s ease-in-out infinite; }
.mood-love .mouth-happy { opacity: 1; stroke: #ff2d55; }
.mood-love .mouth-neutral { opacity: 0; }
.mood-love .aura-heart { opacity: 0.8; animation: aura-heart-float 3s ease-in-out infinite; }
.mood-love .heart-2 { animation-delay: 1.5s; }
.mood-love .eye-ring-inner, .mood-love .eye-ring-outer { stroke: #ff2d55 !important; }

/* Angry */
.mood-angry .mouth-angry { opacity: 1; stroke: #ef4444; }
.mood-angry .mouth-neutral { opacity: 0; }
.mood-angry .robot-brow { transform: translateY(3px) rotate(15deg); stroke: #ef4444; opacity: 1; }
.mood-angry .brow-r { transform: translateY(3px) rotate(-15deg); }
.mood-angry .eye-ring-inner, .mood-angry .eye-ring-outer { stroke: #ef4444 !important; }

/* Surprised */
.mood-surprised .mouth-surprised { opacity: 1; transform: scale(1.2); }
.mood-surprised .mouth-neutral { opacity: 0; }
.mood-surprised .robot-brow { transform: translateY(-6px); opacity: 1; }

/* ── Chromatic Intelligence (Color Overrides) ── */
.mood-thinking { --aura-neon: #eab308; --aura-neon-rgb: 234, 179, 8; }
.mood-angry { --aura-neon: #ef4444; --aura-neon-rgb: 239, 68, 68; }
.mood-super-happy { --aura-neon: #22c55e; --aura-neon-rgb: 34, 197, 94; }
.mood-info { --aura-neon: #f97316; --aura-neon-rgb: 249, 115, 22; }

/* Apply new colors to icons and rings */
.mood-thinking .thought-dot, .mood-thinking .mouth-thinking, .mood-thinking .eye-ring-outer { stroke: var(--aura-neon) !important; fill: var(--aura-neon); }
.mood-info .mouth-surprised { stroke: var(--aura-neon); opacity: 1; }
.mood-info .eye-ring-outer, .mood-info .eye-ring-inner { stroke: var(--aura-neon) !important; }

/* ── Keyframes (Emotions) ── */

@keyframes aura-thinking-pulse {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 5px var(--aura-neon)); }
    50% { opacity: 0.5; filter: drop-shadow(0 0 15px var(--aura-neon)); }
}

@keyframes aura-antenna-ping {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 10px var(--aura-neon)); }
    50% { filter: brightness(2.5) drop-shadow(0 0 25px var(--aura-neon)); }
}

@keyframes aura-blush-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes aura-heart-float {
    0% { transform: translateY(0) scale(0) rotate(0deg); opacity: 0; }
    20% { opacity: 1; transform: translateY(-5px) scale(1) rotate(-10deg); }
    100% { transform: translateY(-30px) scale(0.5) rotate(20deg); opacity: 0; }
}
/* ── Wait Mode / Rate Limit Banner ── */
.pt-ai-wait-banner {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: rgba(234, 179, 8, 0.15); /* Warm Amber tint */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: wait-banner-slide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards,
               wait-banner-pulse 2s infinite ease-in-out;
}

@keyframes wait-banner-slide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes wait-banner-pulse {
    0%, 100% { border-color: rgba(234, 179, 8, 0.3); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
    50% { border-color: rgba(234, 179, 8, 0.6); box-shadow: 0 10px 40px rgba(234, 179, 8, 0.2); }
}

.pt-ai-wait-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fef08a; /* Yellow-200 */
}

.pt-ai-wait-banner .pt-ai-cancel-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fecaca;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.pt-ai-wait-banner .pt-ai-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
    color: white;
    transform: translateY(-1px);
}

.pt-ai-wait-banner .pt-ai-continue-action-btn {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.pt-ai-wait-banner .pt-ai-continue-action-btn:hover {
    background: rgba(16, 185, 129, 0.4);
    border-color: #10b981;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.pt-ai-wait-banner.is-interrupted {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    animation: wait-banner-error-pulse 2s infinite ease-in-out;
}

@keyframes wait-banner-error-pulse {
    0%, 100% { border-color: rgba(239, 68, 68, 0.3); }
    50% { border-color: rgba(239, 68, 68, 0.6); }
}

#pt-ai-header-session-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 12px;
    line-height: 12px;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#pt-ai-header-session-meta .pt-ai-header-tokens {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.4);
}

#pt-ai-header-session-meta .pt-ai-header-id {
    color: rgba(251, 146, 60, 0.8); /* orange-400 with opacity */
    font-weight: 800;
}

/* ── Inline Usage Info ── */
.pt-ai-inline-usage {
    font-size: 10px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.4;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: -0.01em;
    transition: opacity 0.3s ease;
}

.pt-ai-msg-bubble:hover .pt-ai-inline-usage {
    opacity: 0.8;
}

/* ── AI Message Separation ── */
.pt-ai-thoughts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Tighter gap for multiple thought accordions */
    margin-bottom: 12px;
}

.pt-ai-thoughts-wrapper:empty {
    display: none;
}

.pt-ai-response-wrapper {
    position: relative;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.pt-ai-response-wrapper div:first-child {
    margin-top: 0;
}

.pt-ai-message.ai .pt-ai-msg-bubble {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(var(--aura-neon-rgb), 0.05);
    padding: 20px;
    border-radius: 18px;
    border-top-left-radius: 4px;
}

.pt-ai-message.ai .pt-ai-response-content {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
    font-size: 13.5px;
    letter-spacing: 0.01em;
}

/* ── Premium List Styling ── */
.pt-ai-list {
    margin: 12px 0;
    list-style: none;
    padding-left: 4px;
}

.pt-ai-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.pt-ai-list li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--aura-neon);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--aura-glow);
    opacity: 0.6;
}

.pt-ai-list li:hover {
    color: white;
    transform: translateX(2px);
}

.pt-ai-list li:hover::before {
    opacity: 1;
    transform: scale(1.2);
}

/* ── Interactive File Blocks (Premium 16:9 Cards) ── */
.pt-ai-group-block {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0;
}

.pt-ai-file-preview-card {
    position: relative;
    width: 260px; /* Increased for 16:9 comfort */
    aspect-ratio: 16 / 9;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.pt-ai-file-preview-card:hover {

    border-color: var(--aura-neon);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--aura-neon-rgb), 0.2);
    z-index: 10;
}

.pt-ai-preview-media {
    position: relative;
    flex: 1;
    background: #ffffff;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pt-ai-preview-media img, 
.pt-ai-preview-media video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* ── Hover Action Menu ── */
.pt-ai-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s ease;
    z-index: 5;
}

.pt-ai-file-preview-card:hover .pt-ai-preview-overlay {
    opacity: 1;
}

.pt-ai-preview-action-btn-p {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.pt-ai-preview-action-btn-p:hover {
    background: var(--aura-neon);
    border-color: white;
    color: #0f172a;
    transform: scale(1.15);
}

.pt-ai-preview-action-btn-p.is-copied {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
    transform: scale(1.1);
}

.pt-ai-preview-action-btn-p.is-copied .icon-idle {
    display: none !important;
}

.pt-ai-preview-action-btn-p.is-copied .icon-copied {
    display: block !important;
}

/* ── Permanent Footer Bar ── */
.pt-ai-preview-info {
    padding: 8px 12px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-ai-preview-title-group {
    flex: 1;
    min-width: 0;
}

.pt-ai-preview-name {
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.pt-ai-preview-meta {
    font-size: 9px;
    font-weight: 700;
    color: var(--aura-neon);
    opacity: 0.8;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.pt-ai-preview-project-badge {
    background: rgba(var(--aura-neon-rgb), 0.1);
    color: var(--aura-neon);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 8px;
    border: 1px solid rgba(var(--aura-neon-rgb), 0.2);
    margin-left: auto;
}

/* PDF, Video & Generic placeholders enhancement */
.pt-ai-pdf-icon-wrapper svg {
    color: #0f172a;
    filter: drop-shadow(0 2px 4px rgba(var(--aura-neon-rgb), 0.2));
    transition: transform 0.3s ease;
}

.pt-ai-file-preview-card:hover .pt-ai-pdf-icon-wrapper svg {
    transform: scale(1.1);
    color: var(--aura-neon);
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AGENTIC PROTOCOL: PLANS & DELIVERABLES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* 📋 Action Plan Block */
.pt-ai-plan-container {
    background: rgba(var(--aura-neon-rgb), 0.03);
    border: 1px solid rgba(var(--aura-neon-rgb), 0.15);
    border-radius: 14px;
    padding: 20px;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.pt-ai-plan-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--aura-neon);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pt-ai-plan-content {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.6;
}

/* 📦 Deliverables Block (Accordions) */
.pt-ai-deliverables-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pt-ai-deliverable-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pt-ai-deliverable-item:hover {
    border-color: rgba(var(--aura-neon-rgb), 0.3);
    background: rgba(var(--aura-neon-rgb), 0.02);
}

.pt-ai-deliverable-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.pt-ai-deliverable-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pt-ai-deliverable-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.pt-ai-deliverable-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.pt-ai-deliverable-status {
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pt-ai-deliverable-status.done { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.pt-ai-deliverable-status.doing { background: rgba(234, 179, 8, 0.15); color: #fbbf24; border: 1px solid rgba(234, 179, 8, 0.3); animation: status-pulse 1.5s infinite; }
.pt-ai-deliverable-status.todo { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); }

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.pt-ai-deliverable-content {
    display: none;
    padding: 0 18px 18px 54px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    animation: slide-down 0.3s ease-out;
}

.pt-ai-deliverable-item.open .pt-ai-deliverable-content {
    display: block;
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes recovery-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 🤖 Message Actions Block & Footer */
.pt-ai-bubble-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pt-ai-response-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.pt-ai-btn-action {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pt-ai-btn-action:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    transform: translateY(-1px);
}

.pt-ai-btn-action.active,
.pt-ai-btn-action:active {
    background: rgba(var(--aura-neon-rgb), 0.15);
    color: var(--aura-neon);
}

.pt-ai-btn-action svg {
    width: 13px;
    height: 13px;
}

/* Tooltip like behavior for premium feel */
.pt-ai-btn-action[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 50%;
    transform: translateX(50%);
    background: #000;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 10;
}

/* Copied Badge Animation */
.pt-ai-copy-badge {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #22c55e;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 7px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.pt-ai-copy-badge.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Redesigned Interruption Recovery Zone ── */
.pt-ai-recovery-zone {
    margin-top: 16px;
    background: rgba(2, 6, 23, 0.5); /* Deep Aura background */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between !important; /* Force extreme alignment */
    gap: 12px;
    animation: recovery-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.pt-ai-recovery-zone::before {
    display: none;
}

.pt-ai-recovery-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.pt-ai-recovery-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    flex-shrink: 0;
    opacity: 1;
}

.pt-ai-recovery-text-group {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.pt-ai-recovery-title {
    font-size: 11px;
    font-weight: 900;
    color: #fca5a5;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    margin: 0;
}

.pt-ai-recover-btn {
    background: var(--pt-primary);
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    letter-spacing: 0.1em;
    min-width: 80px; /* Small fixed minimum for centering consistency */
    flex-shrink: 0;
}

.pt-ai-recover-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

@keyframes recovery-fade-in {
    from { opacity: 0; transform: scale(0.98) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}




.pt-ai-mindmap {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    font-family: 'JetBrains Mono', 'Source Code Pro', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    overflow-x: auto;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
}

.pt-ai-mindmap strong {
    color: var(--aura-neon, #00deff);
    text-shadow: 0 0 10px var(--aura-glow);
}

/* Blueprint connectors styling */
.pt-ai-mindmap-connector {
    color: var(--aura-neon, #00deff);
    opacity: 0.6;
    font-weight: bold;
    user-select: none;
}

/* Mermaid Container Styling */
.mermaid {
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    margin: 15px 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
    display: flex;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.mermaid svg {
    max-width: 100% !important;
    height: auto !important;
}

.mermaid:hover {
    border-color: var(--aura-neon, #00deff) !important;
    box-shadow: 0 15px 40px rgba(var(--aura-neon-rgb), 0.15) !important;
    transform: translateY(-2px);
}

/* High-tech Table Enhancement for Logic blocks */
.pt-ai-mindmap + .pt-ai-table-wrapper {
    margin-top: -5px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ── Premium Consumption Indicator ── */
.pt-ai-inline-badge-premium {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    vertical-align: middle;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    user-select: none;
}

.pt-ai-msg-bubble:hover .pt-ai-inline-badge-premium {
    background: rgba(var(--aura-neon-rgb), 0.1);
    border-color: rgba(var(--aura-neon-rgb), 0.3);
    color: var(--aura-neon);
    box-shadow: 0 0 15px rgba(var(--aura-neon-rgb), 0.1);
    transform: translateY(-1px);
}

.pt-ai-plan-confirm-btn {
    background: rgba(var(--aura-neon-rgb), 0.15);
    border: 1px solid rgba(var(--aura-neon-rgb), 0.3);
    color: var(--aura-neon);
    font-size: 11px;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pt-ai-plan-confirm-btn:hover {
    background: var(--aura-neon);
    color: #0f172a;
    box-shadow: 0 0 15px var(--aura-glow);
    transform: translateY(-1px);
}

/* ==========================================
   AURA REPORT STUDIO - PREMIUM STYLING
   ========================================== */

.pt-report-studio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pt-report-studio-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pt-report-studio-container {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.98);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.pt-report-studio-overlay.active .pt-report-studio-container {
    transform: translateY(0) scale(1);
}

/* Header & Controls */
.pt-report-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.pt-report-title-area h2 {
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 2px;
    margin: 0;
}

.pt-report-title-area p {
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
    margin: 2px 0 0 0;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
}

.pt-report-actions {
    display: flex;
    gap: 10px;
}

.pt-report-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.pt-report-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.pt-report-btn-primary {
    background: var(--portal-primary-color, #171d69) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

.pt-report-btn-primary:hover {
    filter: brightness(1.2);
}

/* Studio Body */
.pt-report-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #000;
}

/* Sidebar / Settings */
.pt-report-sidebar {
    width: 280px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pt-report-setting-group label {
    display: block;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.pt-report-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 12px;
    outline: none;
}

/* Editor Area - The "Paper" */
.pt-report-editor-view {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    background: #0a0a0f;
    scrollbar-width: thin;
}

.pt-report-paper-container {
    width: 100%;
    max-width: 800px;
}

.pt-report-paper {
    background: #fff;
    width: 100%;
    min-height: 1122px; /* A4 aspect ratio @ 96dpi is ~1122px height */
    padding: 60px 80px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
    position: relative;
    border-radius: 2px;
}

/* Branded Template Inside Paper */
.pt-paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--portal-primary-color, #171d69);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.pt-paper-logo img {
    max-height: 60px;
    width: auto;
}

.pt-paper-meta {
    text-align: right;
}

.pt-paper-meta h1 {
    font-size: 24px;
    font-weight: 900;
    margin: 0;
    color: #000;
}

.pt-paper-meta p {
    font-size: 12px;
    margin: 5px 0 0 0;
    color: #666;
}

/* Quill Overrides for Paper Look */
.pt-report-paper .ql-container.ql-snow {
    border: none !important;
}

.pt-report-paper .ql-editor {
    padding: 0 !important;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.pt-report-paper .ql-editor h1,
.pt-report-paper .ql-editor h2,
.pt-report-paper .ql-editor h3 {
    color: #000;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.pt-report-paper .ql-editor p {
    margin-bottom: 1em;
}

/* Toolbar customization */
.pt-report-studio-container .ql-toolbar.ql-snow {
    background: rgba(255, 255, 255, 0.02);
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 10px 20px !important;
}

.pt-report-studio-container .ql-snow .ql-stroke {
    stroke: rgba(255, 255, 255, 0.6) !important;
}
.pt-report-studio-container .ql-snow .ql-fill {
    fill: rgba(255, 255, 255, 0.6) !important;
}
.pt-report-studio-container .ql-snow .ql-picker {
    color: rgba(255, 255, 255, 0.6) !important;
}

@media (max-width: 900px) {
    .pt-report-sidebar {
        display: none;
    }
    .pt-report-paper {
        padding: 30px;
    }
    .pt-report-studio-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   GRAPH EXPORT SYSTEM (Chatbox Graphs)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.pt-ai-mermaid-container {
    position: relative;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem;
    transition: all 0.3s ease;
    overflow: visible;
}

.pt-ai-mermaid-container:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--aura-neon-rgb), 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pt-ai-graph-export-wrapper {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 50;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.pt-ai-mermaid-container:hover .pt-ai-graph-export-wrapper {
    opacity: 1;
    transform: translateY(0);
}

.pt-ai-graph-export-trigger {
    width: 34px;
    height: 34px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.pt-ai-graph-export-trigger:hover {
    background: var(--aura-neon);
    color: #0f172a;
    border-color: var(--aura-neon);
    box-shadow: 0 0 20px rgba(var(--aura-neon-rgb), 0.5);
    transform: scale(1.05);
}

.pt-ai-graph-export-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 8px;
    min-width: 160px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(-10px);
    transform-origin: top right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pt-ai-graph-export-wrapper:hover .pt-ai-graph-export-menu {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.pt-ai-export-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-weight: 700;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.pt-ai-export-option:hover {
    background: rgba(var(--aura-neon-rgb), 0.1);
    color: var(--aura-neon);
    padding-left: 18px;
}

.pt-ai-export-option svg {
    opacity: 0.4;
    transition: all 0.2s ease;
}

.pt-ai-export-option:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

.pt-ai-export-option.loading {
    pointer-events: none;
    opacity: 0.5;
}

.mermaid svg {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

