/**
 * VISOR v3.0 — Premium Intelligence Interface
 * Cinematic animations, living aurora, luxury micro-interactions
 */

/* ================================================================
   VARIABLES & FOUNDATIONS
   ================================================================ */
:root {
    --v-cyan: #06d6f7;
    --v-azure: #0080ff;
    --v-blue: #4ea2ff;
    --v-purple: #7b2cbf;
    --v-magenta: #e040fb;
    --v-gold: #D2A84A;
    --v-bg: #050507;
    --v-panel-bg: rgba(8, 10, 16, 0.88);
    --v-glass: rgba(255,255,255,0.025);
    --v-border: rgba(255,255,255,0.06);
    --v-text: rgba(255,255,255,0.92);
    --v-text-secondary: #8A8D93;
    --v-muted: rgba(255,255,255,0.35);
    --v-font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
}

.trx_addons_scroll_to_top, .scroll_to_top,
[class*="scroll_to_top"], [class*="scroll-to-top"] {
    display: none !important;
}
.hsd-toast { z-index: 100010 !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.15s !important;
    }
}

/* ================================================================
   1. FLOATING ORB — Living, breathing presence
   ================================================================ */
/* ========== MINIMAL SIRI GLOW ==========
   No rings, no ribbons, no halos.
   Just a clean dark orb with a soft colored border + gentle glow that breathes cyan → magenta.
*/
#visor-orb {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.04) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(10, 14, 24, 0.98), rgba(3, 5, 10, 1));
    border: 1px solid rgba(6, 214, 247, 0.28);
    cursor: pointer;
    z-index: 99989;
    display: flex; align-items: center; justify-content: center;
    overflow: visible;
    padding: 0;
    outline: none;
    box-shadow:
        0 0 18px rgba(6, 214, 247, 0.16),
        0 0 48px 4px rgba(6, 214, 247, 0.09),
        0 0 110px 18px rgba(6, 214, 247, 0.045),
        0 4px 14px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.5s ease,
                border-color 0.5s ease,
                opacity 0.4s ease,
                bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --breath-duration: 5.2s;
    animation:
        visorOrbFloat 6s ease-in-out infinite,
        visorGlowBreathe var(--breath-duration) cubic-bezier(0.37, 0, 0.63, 1) infinite;
    will-change: transform;
}

/* ========== BREATHING CHARACTER STATES ==========
   Visor's rhythm reflects what it's doing + what the user is doing.
   Speed alone carries the character — same keyframe, different tempo.
*/
body[data-visor-state="listening"] :is(#visor-orb, .visor-welcome-icon) { --breath-duration: 7.5s; }
body[data-visor-state="typing"]    :is(#visor-orb, .visor-welcome-icon) { --breath-duration: 4.2s; }
body[data-visor-state="thinking"]  :is(#visor-orb, .visor-welcome-icon) { --breath-duration: 2.4s; }
body[data-visor-state="writing"]   :is(#visor-orb, .visor-welcome-icon) { --breath-duration: 3.2s; }
body[data-visor-state="alert"]     :is(#visor-orb, .visor-welcome-icon) { --breath-duration: 3.8s; }

.visor-orb-icon { position: relative; z-index: 2; }

/* All former rings / halos / ribbons / flows — OFF */
#visor-orb::before,
#visor-orb::after,
.visor-orb-flow,
.visor-orb-flow__blob,
.visor-orb-wave { display: none !important; }

/* Breathing rhythm — asymmetric inhale (faster swell) / exhale (slower settle) with a held peak.
   Aura EXPANDS and CONTRACTS in spread + opacity (not just hue), so it feels alive.
   Cycle: 0% rest → 35% peak inhale → 50% peak hold → 100% back to rest. */
@keyframes visorGlowBreathe {
    /* ——— REST (exhale complete): tight, dim cyan ——— */
    0% {
        border-color: rgba(6, 214, 247, 0.22);
        box-shadow:
            0 0 12px rgba(6, 214, 247, 0.10),
            0 0 32px 2px rgba(6, 214, 247, 0.05),
            0 0 70px 10px rgba(6, 214, 247, 0.02),
            0 4px 14px rgba(0, 0, 0, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
    /* ——— INHALE mid: aura growing, warming toward purple ——— */
    20% {
        border-color: rgba(90, 120, 220, 0.30);
        box-shadow:
            0 0 18px rgba(90, 120, 220, 0.15),
            0 0 50px 5px rgba(90, 120, 220, 0.09),
            0 0 110px 18px rgba(90, 120, 220, 0.04),
            0 4px 14px rgba(0, 0, 0, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
    /* ——— PEAK INHALE: fullest bloom, warmest magenta ——— */
    40%, 52% {
        border-color: rgba(224, 64, 251, 0.36);
        box-shadow:
            0 0 28px rgba(224, 64, 251, 0.24),
            0 0 72px 8px rgba(224, 64, 251, 0.13),
            0 0 160px 28px rgba(224, 64, 251, 0.065),
            0 4px 14px rgba(0, 0, 0, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    /* ——— EXHALE mid: cooling through purple ——— */
    75% {
        border-color: rgba(123, 44, 191, 0.26);
        box-shadow:
            0 0 18px rgba(123, 44, 191, 0.14),
            0 0 48px 4px rgba(123, 44, 191, 0.08),
            0 0 100px 14px rgba(123, 44, 191, 0.035),
            0 4px 14px rgba(0, 0, 0, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
    /* ——— REST returns ——— */
    100% {
        border-color: rgba(6, 214, 247, 0.22);
        box-shadow:
            0 0 12px rgba(6, 214, 247, 0.10),
            0 0 32px 2px rgba(6, 214, 247, 0.05),
            0 0 70px 10px rgba(6, 214, 247, 0.02),
            0 4px 14px rgba(0, 0, 0, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
}

#visor-orb:hover {
    transform: translateY(-2px) scale(1.08);
    border-color: rgba(6, 214, 247, 0.55);
    box-shadow:
        0 0 26px rgba(6, 214, 247, 0.28),
        0 0 52px rgba(224, 64, 251, 0.12),
        0 6px 18px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Self-aware reaction — soft breath of recognition.
   No rotation (wiggles are inherently snappy at sub-second timings).
   Uses scale + translate longhand so visorOrbFloat / visorGlowBreathe
   keep running underneath without colliding on transform shorthand —
   the float gives the swell a living wobble, not a freeze. */
#visor-orb.visor-orb--noticed {
    animation:
        visorOrbFloat 6s ease-in-out infinite,
        visorGlowBreathe var(--breath-duration) cubic-bezier(0.37, 0, 0.63, 1) infinite,
        visorOrbNoticed 1.3s cubic-bezier(0.45, 0.05, 0.25, 1);
    border-color: rgba(6, 214, 247, 0.3);
    box-shadow:
        0 0 50px rgba(6, 214, 247, 0.25),
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
#visor-orb.visor-orb--noticed::before { opacity: 1 !important; }

@keyframes visorOrbNoticed {
    0%        { scale: 1.00; translate: 0 0; }
    35%, 50%  { scale: 1.20; translate: 0 -4px; }
    100%      { scale: 1.00; translate: 0 0; }
}

.visor-orb-tooltip {
    position: absolute;
    bottom: calc(100% + 12px); right: 0;
    white-space: nowrap;
    font-family: var(--v-font);
    font-size: 12px; font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(6, 10, 18, 0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(6, 214, 247, 0.15);
    border-radius: 10px; padding: 7px 14px;
    pointer-events: none; opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(6, 214, 247, 0.06);
}
.visor-orb-tooltip::after {
    content: ''; position: absolute; bottom: -5px; right: 18px;
    width: 10px; height: 10px;
    background: rgba(6, 10, 18, 0.92);
    border-right: 1px solid rgba(6, 214, 247, 0.15);
    border-bottom: 1px solid rgba(6, 214, 247, 0.15);
    transform: rotate(45deg);
}
.visor-orb-tooltip--visible { opacity: 1; transform: translateY(0) scale(1); }

#visor-orb.visor-orb--launching {
    transform: scale(0.4) rotate(180deg);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.55, 0, 1, 0.45);
}

#visor-orb.visor-orb--hidden {
    opacity: 0; pointer-events: none; transform: scale(0.3);
}

.visor-orb-icon {
    filter: drop-shadow(0 0 6px rgba(6, 214, 247, 0.3));
    transition: filter 0.4s ease, transform 0.4s ease;
}
#visor-orb:hover .visor-orb-icon {
    filter: drop-shadow(0 0 16px rgba(6, 214, 247, 0.6));
    transform: scale(1.08);
}

/* Floating idle: gentle up-down with glow pulse */
@keyframes visorOrbFloat {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 0 24px rgba(6,214,247,0.08), 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
    }
    50% {
        transform: translateY(-4px);
        box-shadow: 0 0 36px rgba(6,214,247,0.14), 0 12px 36px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
    }
}

@keyframes visorRingSpin { to { transform: rotate(360deg); } }
@keyframes visorRingSpinReverse { to { transform: rotate(-360deg); } }

/* Subtle "alive" pulse — color saturation & glow breathe in sync */
@keyframes visorOrbBreathe {
    0%, 100% {
        filter: saturate(1) brightness(1);
    }
    50% {
        filter: saturate(1.15) brightness(1.08);
    }
}
@keyframes visorRingBreathe {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.85; }
}


/* ================================================================
   2. OVERLAY — Cinematic dim
   ================================================================ */
#visor-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99991;
    opacity: 0; pointer-events: none;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
#visor-overlay.visor-overlay--active { opacity: 1; pointer-events: auto; }


/* ================================================================
   3. AURORA BOREALIS — Living viewport border glow (5 blobs)
   ================================================================ */
.visor-aurora {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 99990;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    /* Tight mask: only reveal 4-6px at edges, fade over 30-40px */
    -webkit-mask-image:
        linear-gradient(to right, black 0px, black 4px, transparent 35px),
        linear-gradient(to left, black 0px, black 6px, transparent 40px),
        linear-gradient(to bottom, black 0px, black 4px, transparent 30px),
        linear-gradient(to top, black 0px, black 4px, transparent 30px);
    -webkit-mask-composite: source-over;
    mask-image:
        linear-gradient(to right, black 0px, black 4px, transparent 35px),
        linear-gradient(to left, black 0px, black 6px, transparent 40px),
        linear-gradient(to bottom, black 0px, black 4px, transparent 30px),
        linear-gradient(to top, black 0px, black 4px, transparent 30px);
    mask-composite: add;
}
.visor-aurora--active { opacity: 1; }

/* Animated border trace line — sweeps around the viewport */
.visor-aurora::before {
    content: '';
    position: absolute; inset: 0;
    border: 1px solid transparent;
    border-image: conic-gradient(
        from var(--visor-trace-angle, 0deg),
        var(--v-cyan) 0%, var(--v-azure) 8%, var(--v-purple) 15%,
        transparent 25%, transparent 85%,
        var(--v-azure) 92%, var(--v-cyan) 100%
    ) 1;
    animation: visorBorderTrace 6s linear infinite;
    opacity: 0.25;
}
@property --visor-trace-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@keyframes visorBorderTrace {
    to { --visor-trace-angle: 360deg; }
}

.visor-aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
    mix-blend-mode: screen;
    opacity: 0.7;
}

.visor-aurora-blob--1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(6, 214, 247, 0.4) 0%, transparent 65%);
    top: -100px; right: -60px;
    animation: visorAB1 14s ease-in-out infinite alternate;
}
.visor-aurora-blob--2 {
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(0, 128, 255, 0.3) 0%, transparent 65%);
    bottom: -140px; right: -80px;
    animation: visorAB2 18s ease-in-out infinite alternate;
}
.visor-aurora-blob--3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(123, 44, 191, 0.25) 0%, transparent 65%);
    top: 25%; left: -120px;
    animation: visorAB3 20s ease-in-out infinite alternate;
}
.visor-aurora-blob--4 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(6, 214, 247, 0.18) 0%, transparent 65%);
    top: -100px; left: 25%;
    animation: visorAB4 16s ease-in-out infinite alternate;
}
.visor-aurora-blob--5 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(224, 64, 251, 0.14) 0%, transparent 65%);
    bottom: -80px; left: 10%;
    animation: visorAB5 22s ease-in-out infinite alternate;
}

/* Gold tier override */
.visor-aurora--sme .visor-aurora-blob--1,
.visor-aurora--admin .visor-aurora-blob--1 {
    background: radial-gradient(circle, rgba(6, 214, 247, 0.4) 0%, rgba(210, 168, 74, 0.25) 50%, transparent 70%);
}
.visor-aurora--sme .visor-aurora-blob--2,
.visor-aurora--admin .visor-aurora-blob--2 {
    background: radial-gradient(circle, rgba(210, 168, 74, 0.35) 0%, transparent 70%);
}
.visor-aurora--sme .visor-aurora-blob--5,
.visor-aurora--admin .visor-aurora-blob--5 {
    background: radial-gradient(circle, rgba(210, 168, 74, 0.15) 0%, transparent 70%);
}

/* Thinking: rapid intensity surge */
.visor-aurora--thinking .visor-aurora-blob {
    animation-duration: 2.5s !important;
    filter: blur(70px) brightness(1.3) !important;
}
.visor-aurora--thinking .visor-aurora-blob--1 {
    background: radial-gradient(circle, rgba(6, 214, 247, 0.8) 0%, transparent 65%) !important;
}
.visor-aurora--thinking .visor-aurora-blob--2 {
    background: radial-gradient(circle, rgba(0, 128, 255, 0.6) 0%, transparent 65%) !important;
}
.visor-aurora--thinking .visor-aurora-blob--3 {
    background: radial-gradient(circle, rgba(123, 44, 191, 0.5) 0%, transparent 65%) !important;
}
.visor-aurora--thinking::before {
    opacity: 0.7 !important;
    animation-duration: 2s !important;
}

@keyframes visorAB1 {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.8; }
    25%  { transform: translate(-80px, 120px) scale(1.15); opacity: 1; }
    50%  { transform: translate(-140px, 280px) scale(0.9); opacity: 0.7; }
    75%  { transform: translate(-60px, 420px) scale(1.1); opacity: 0.9; }
    100% { transform: translate(30px, 550px) scale(1.05); opacity: 0.8; }
}
@keyframes visorAB2 {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(-100px, -180px) scale(1.2); }
    50%  { transform: translate(-220px, -80px) scale(0.9); }
    75%  { transform: translate(-150px, -380px) scale(1.15); }
    100% { transform: translate(20px, -550px) scale(1); }
}
@keyframes visorAB3 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(120px, -180px) scale(1.3); }
    66%  { transform: translate(80px, 120px) scale(0.85); }
    100% { transform: translate(40px, 250px) scale(1.1); }
}
@keyframes visorAB4 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(250px, 60px) scale(1.15); }
    66%  { transform: translate(450px, 30px) scale(0.85); }
    100% { transform: translate(150px, 80px) scale(1.2); }
}
@keyframes visorAB5 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(200px, -150px) scale(1.25); }
    100% { transform: translate(100px, -300px) scale(0.9); }
}


/* ================================================================
   4. IGNITION — Multi-color shockwave burst
   ================================================================ */
.visor-ignition {
    position: fixed;
    top: calc(100vh - 56px); left: calc(100vw - 56px);
    width: 80px; height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(6, 214, 247, 0.35) 0%,
        rgba(0, 128, 255, 0.2) 20%,
        rgba(123, 44, 191, 0.12) 45%,
        rgba(224, 64, 251, 0.05) 65%,
        transparent 80%
    );
    pointer-events: none;
    z-index: 99993;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}
.visor-ignition--active {
    animation: visorIgnitionBurst 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes visorIgnitionBurst {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0.9; }
    40%  { opacity: 0.3; }
    70%  { transform: translate(-50%, -50%) scale(28); opacity: 0.1; }
    100% { transform: translate(-50%, -50%) scale(38); opacity: 0; }
}

/* Secondary ripple ring */
.visor-ignition::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(6, 214, 247, 0.15);
    opacity: 0;
}
.visor-ignition--active::after {
    animation: visorIgnitionRing 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}
@keyframes visorIgnitionRing {
    0%   { transform: scale(0.5); opacity: 0.6; }
    100% { transform: scale(2); opacity: 0; }
}


/* ================================================================
   5. MAIN PANEL — Premium glass with animated border
   ================================================================ */
#visor-panel {
    position: fixed; top: 0; right: 0;
    width: 50vw; min-width: 480px; max-width: 1100px; height: 100vh;
    background: var(--v-panel-bg);
    backdrop-filter: blur(0px) saturate(1);
    -webkit-backdrop-filter: blur(0px) saturate(1);
    z-index: 99994;
    display: flex; flex-direction: column;
    font-family: var(--v-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    opacity: 0;
    transform: scale(0);
    transform-origin: calc(100% - 56px) calc(100% - 56px);
    pointer-events: none;
    transition:
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        backdrop-filter 0.5s ease 0.1s,
        -webkit-backdrop-filter 0.5s ease 0.1s,
        box-shadow 0.6s ease;
    box-shadow:
        -40px 0 80px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    will-change: transform, opacity;
}

#visor-panel.visor-panel--open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    backdrop-filter: blur(48px) saturate(1.6);
    -webkit-backdrop-filter: blur(48px) saturate(1.6);
    background:
        radial-gradient(ellipse 90% 55% at 50% 8%, rgba(6, 214, 247, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 18% 38%, rgba(123, 44, 191, 0.08) 0%, transparent 65%),
        radial-gradient(ellipse 80% 60% at 80% 75%, rgba(0, 128, 255, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(224, 64, 251, 0.05) 0%, transparent 70%),
        var(--v-panel-bg);
    box-shadow:
        -40px 0 100px rgba(0, 0, 0, 0.5),
        0 0 120px rgba(6, 214, 247, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        inset -1px 0 0 rgba(6, 214, 247, 0.06);
}

/* Internal aurora flow layer — two breathing orbs that drift behind content */
#visor-panel .visor-panel-aurora {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
#visor-panel.visor-panel--open .visor-panel-aurora { opacity: 1; }

#visor-panel .visor-panel-aurora::before,
#visor-panel .visor-panel-aurora::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    mix-blend-mode: screen;
    will-change: transform;
}
#visor-panel .visor-panel-aurora::before {
    width: 380px; height: 380px;
    top: -120px; left: -80px;
    background: radial-gradient(circle, rgba(6, 214, 247, 0.30) 0%, rgba(123, 44, 191, 0.12) 45%, transparent 70%);
    animation: visorPanelAuroraA 22s ease-in-out infinite alternate;
    opacity: 0.8;
}
#visor-panel .visor-panel-aurora::after {
    width: 420px; height: 420px;
    bottom: -160px; right: -120px;
    background: radial-gradient(circle, rgba(224, 64, 251, 0.22) 0%, rgba(0, 128, 255, 0.12) 45%, transparent 70%);
    animation: visorPanelAuroraB 26s ease-in-out infinite alternate;
    opacity: 0.75;
}

@keyframes visorPanelAuroraA {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(60px, 220px) scale(1.15); }
    100% { transform: translate(-30px, 480px) scale(0.95); }
}
@keyframes visorPanelAuroraB {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-90px, -260px) scale(1.2); }
    100% { transform: translate(40px, -520px) scale(0.95); }
}

/* Make sure panel content sits above the aurora layer */
#visor-panel .visor-header,
#visor-panel #visor-messages,
#visor-panel #visor-thinking,
#visor-panel #visor-suggestions,
#visor-panel #visor-insight-bar,
#visor-panel #visor-image-preview,
#visor-panel .visor-input-wrap { position: relative; z-index: 2; }

/* Left edge: animated scanning light */
#visor-panel::before {
    content: '';
    position: absolute; top: 0; left: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(6, 214, 247, 0.06) 15%,
        rgba(6, 214, 247, 0.03) 50%,
        rgba(6, 214, 247, 0.06) 85%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}
#visor-panel.visor-panel--open::before {
    opacity: 1;
}

/* Left edge scanner — light that travels up and down */
#visor-panel.visor-panel--open::after {
    content: '';
    position: absolute; left: 0;
    width: 2px; height: 60px;
    background: linear-gradient(to bottom, transparent, var(--v-cyan), transparent);
    animation: visorEdgeScan 4s ease-in-out infinite;
    opacity: 0.3;
    border-radius: 1px;
    z-index: 1;
}
@keyframes visorEdgeScan {
    0%, 100% { top: 10%; opacity: 0; }
    10% { opacity: 0.3; }
    50% { top: 80%; opacity: 0.3; }
    60% { opacity: 0; }
}


/* ================================================================
   6. HEADER — Clean and minimal
   ================================================================ */
.visor-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    flex-shrink: 0;
}

/* Horizontal header scan removed — vertical edge scan on the panel is sufficient */
.visor-header::after { display: none !important; }

.visor-logo { display: flex; align-items: center; gap: 12px; }
.visor-logo-icon { opacity: 0.85; transition: opacity 0.3s ease; }
.visor-logo:hover .visor-logo-icon { opacity: 1; }

.visor-brand {
    font-size: 13px; font-weight: 700;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
}

.visor-layer-badge {
    font-size: 8px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 4px;
    background: rgba(6, 214, 247, 0.06);
    border: 1px solid rgba(6, 214, 247, 0.1);
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 10px;
}
.visor-layer-badge--gold {
    background: rgba(210, 168, 74, 0.06);
    border-color: rgba(210, 168, 74, 0.12);
    color: var(--v-gold) !important;
}

.visor-close {
    background: none; border: none;
    color: rgba(255, 255, 255, 0.12);
    cursor: pointer; padding: 8px; border-radius: 8px;
    transition: all 0.25s ease;
    display: flex; align-items: center; justify-content: center;
}
.visor-close:hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}


/* ================================================================
   7. MESSAGES — Refined
   ================================================================ */
.visor-messages {
    flex: 1; overflow-y: auto;
    padding: 20px 22px;
    display: flex; flex-direction: column; gap: 16px;
    scroll-behavior: smooth;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 10px, black calc(100% - 30px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0px, black 10px, black calc(100% - 30px), transparent 100%);
}
.visor-messages::-webkit-scrollbar { width: 2px; }
.visor-messages::-webkit-scrollbar-track { background: transparent; }
.visor-messages::-webkit-scrollbar-thumb { background: rgba(6,214,247,0.06); border-radius: 1px; }

/* Welcome — staggered entrance */
.visor-welcome {
    text-align: center; padding: 52px 20px 24px;
    opacity: 0; transform: translateY(20px);
    animation: visorWelcomeFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}
@keyframes visorWelcomeFade { to { opacity: 1; transform: translateY(0); } }

/* Welcome icon — mirrors the minimal orb: clean dark sphere, breathing border, soft shapeless aura */
.visor-welcome-icon {
    --breath-duration: 5.2s;
    width: 88px; height: 88px;
    margin: 0 auto 28px; border-radius: 50%;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.035) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(10, 14, 24, 0.98), rgba(3, 5, 10, 1));
    border: 1px solid rgba(6, 214, 247, 0.28);
    display: flex; align-items: center; justify-content: center;
    color: var(--v-cyan); position: relative;
    animation: visorWelcomeBreathe var(--breath-duration) cubic-bezier(0.37, 0, 0.63, 1) infinite;
    box-shadow:
        0 0 24px rgba(6, 214, 247, 0.16),
        0 0 64px 6px rgba(6, 214, 247, 0.09),
        0 0 140px 22px rgba(6, 214, 247, 0.045),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
        width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        margin-bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.visor-welcome-icon svg {
    width: 32px; height: 32px;
    filter: drop-shadow(0 0 6px rgba(6, 214, 247, 0.45));
    position: relative; z-index: 2;
    transition:
        width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Once the SME has sent a message, the welcome icon steps back and lets the conversation breathe */
body[data-visor-has-messages="true"] .visor-welcome-icon {
    width: 56px; height: 56px; margin-bottom: 14px;
}
body[data-visor-has-messages="true"] .visor-welcome-icon svg {
    width: 22px; height: 22px;
}
/* Kill legacy rainbow rings */
.visor-welcome-icon::before,
.visor-welcome-icon::after { display: none !important; }

@keyframes visorWelcomeBreathe {
    /* REST — tight dim cyan */
    0% {
        border-color: rgba(6, 214, 247, 0.22);
        box-shadow:
            0 0 16px rgba(6, 214, 247, 0.10),
            0 0 44px 4px rgba(6, 214, 247, 0.05),
            0 0 100px 14px rgba(6, 214, 247, 0.02),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    /* INHALE mid */
    20% {
        border-color: rgba(90, 120, 220, 0.30);
        box-shadow:
            0 0 22px rgba(90, 120, 220, 0.15),
            0 0 60px 6px rgba(90, 120, 220, 0.09),
            0 0 140px 22px rgba(90, 120, 220, 0.04),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    /* PEAK held */
    40%, 52% {
        border-color: rgba(224, 64, 251, 0.36);
        box-shadow:
            0 0 34px rgba(224, 64, 251, 0.24),
            0 0 88px 10px rgba(224, 64, 251, 0.13),
            0 0 200px 34px rgba(224, 64, 251, 0.065),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
    /* EXHALE mid */
    75% {
        border-color: rgba(123, 44, 191, 0.26);
        box-shadow:
            0 0 22px rgba(123, 44, 191, 0.14),
            0 0 58px 5px rgba(123, 44, 191, 0.08),
            0 0 128px 18px rgba(123, 44, 191, 0.035),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    /* REST returns */
    100% {
        border-color: rgba(6, 214, 247, 0.22);
        box-shadow:
            0 0 16px rgba(6, 214, 247, 0.10),
            0 0 44px 4px rgba(6, 214, 247, 0.05),
            0 0 100px 14px rgba(6, 214, 247, 0.02),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
}

.visor-welcome-text {
    font-size: 17px; font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    letter-spacing: -0.012em; line-height: 1.45;
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(180,210,255,0.6) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 24px rgba(6, 214, 247, 0.10);
}
.visor-welcome-sub {
    font-size: 11px; color: rgba(255,255,255,0.28);
    margin-top: 10px; letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

/* Messages */
.visor-msg { max-width: 88%; }
.visor-msg--user { align-self: flex-end; }
.visor-msg--visor { align-self: flex-start; }

.visor-msg-text {
    font-size: 13.5px; color: var(--v-text);
    line-height: 1.55; padding: 11px 16px;
    background: rgba(6, 214, 247, 0.04);
    border: 1px solid rgba(6, 214, 247, 0.08);
    border-radius: 16px 16px 4px 16px;
    letter-spacing: -0.005em;
}

.visor-msg-content {
    font-size: 14px; color: rgba(255,255,255,0.74);
    line-height: 1.72; letter-spacing: -0.003em;
    min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.visor-msg-content p { margin: 0 0 12px; }
.visor-msg-content p:last-child { margin-bottom: 0; }
.visor-msg-content ul, .visor-msg-content ol { margin: 10px 0 14px; padding-left: 20px; }
.visor-msg-content li { margin-bottom: 6px; color: rgba(255,255,255,0.66); }
.visor-msg-content li::marker { color: rgba(6,214,247,0.55); }
.visor-msg-content strong { color: rgba(255,255,255,0.95); font-weight: 600; }
.visor-msg-content h2, .visor-msg-content h3, .visor-msg-content h4 {
    color: var(--v-text); font-weight: 600;
    margin: 18px 0 7px; letter-spacing: -0.01em;
    line-height: 1.4; padding-top: 1px;
}
.visor-msg-content h2:first-child,
.visor-msg-content h3:first-child,
.visor-msg-content h4:first-child { margin-top: 6px; }
.visor-msg-content h2 { font-size: 16px; color: #eef3f8; }
.visor-msg-content h3 { font-size: 14.5px; color: #eef3f8; }
.visor-msg-content h4 { font-size: 13.5px; color: rgba(238,243,248,0.82); }
/* A name auto-linked inside a heading should read as the heading itself,
   not a glaring blue underlined link. */
.visor-msg-content h2 a, .visor-msg-content h3 a, .visor-msg-content h4 a {
    color: inherit; text-decoration: none; border-bottom: none; font-weight: inherit;
}
.visor-msg-content hr { display: none; }
.visor-msg-content blockquote {
    margin: 14px 0; padding: 10px 14px;
    border-left: 2px solid rgba(6,214,247,0.4);
    background: rgba(6,214,247,0.04);
    border-radius: 0 8px 8px 0;
    color: rgba(255,255,255,0.78);
    font-style: italic;
}
.visor-msg-content em { color: var(--v-blue); font-style: italic; }
.visor-msg-content a.visor-sme-link {
    color: var(--v-blue); font-weight: 600; text-decoration: none;
    border-bottom: 1px solid rgba(78,162,255,0.35);
    transition: border-color 0.2s, color 0.2s;
}
.visor-msg-content a.visor-sme-link:hover { border-bottom-color: rgba(78,162,255,0.8); }
.visor-msg-content code {
    background: rgba(6,214,247,0.04); border: 1px solid rgba(6,214,247,0.06);
    padding: 2px 7px; border-radius: 5px; font-size: 12px;
    color: var(--v-cyan); font-family: 'SF Mono','Fira Code','JetBrains Mono', monospace;
}
.visor-msg-content a {
    color: var(--v-cyan); text-decoration: none;
    border-bottom: 1px solid rgba(6,214,247,0.15);
    transition: border-color 0.2s;
}
.visor-msg-content a:hover { border-color: rgba(6,214,247,0.5); }


/* ================================================================
   8. INTEL CARDS
   ================================================================ */
.visor-intel-card {
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 12px; overflow: hidden; margin: 8px 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.visor-intel-card:hover {
    border-color: rgba(6,214,247,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.visor-intel-title {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--v-cyan);
    padding: 10px 16px 7px; border-bottom: 1px solid rgba(255,255,255,0.02);
    display: flex; align-items: center; gap: 6px;
}
.visor-intel-title::before {
    content: ''; width: 4px; height: 4px;
    border-radius: 50%; background: var(--v-cyan);
    opacity: 0.5; box-shadow: 0 0 6px var(--v-cyan);
}
.visor-intel-body {
    padding: 10px 16px 14px; font-size: 12.5px;
    color: rgba(255,255,255,0.5); line-height: 1.65;
}
.visor-intel-note {
    font-size: 10.5px; color: rgba(6,214,247,0.3);
    font-style: italic; margin-top: 6px; padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.02);
}


/* ================================================================
   9. THINKING — Neural waveform with color shift
   ================================================================ */
.visor-thinking {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 22px; font-size: 11px;
    color: rgba(255,255,255,0.2); letter-spacing: 0.03em;
}
.visor-thinking-wave {
    display: flex; align-items: center; gap: 2px; height: 20px;
}
.visor-thinking-wave span {
    width: 2.5px; border-radius: 2px;
    background: linear-gradient(to top, var(--v-cyan), var(--v-azure));
    animation: visorWave 1.2s ease-in-out infinite;
}
.visor-thinking-wave span:nth-child(1) { height: 6px; animation-delay: 0s; }
.visor-thinking-wave span:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.visor-thinking-wave span:nth-child(3) { height: 16px; animation-delay: 0.2s; background: linear-gradient(to top, var(--v-azure), var(--v-purple)); }
.visor-thinking-wave span:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.visor-thinking-wave span:nth-child(5) { height: 6px; animation-delay: 0.4s; }

@keyframes visorWave {
    0%, 100% { transform: scaleY(0.3); opacity: 0.2; }
    50% { transform: scaleY(1.4); opacity: 1; }
}


/* ================================================================
   10. SUGGESTIONS — Hover sweep glow
   ================================================================ */
.visor-suggestions {
    display: flex; flex-direction: column; gap: 6px;
    padding: 0 22px 12px;
}
.visor-suggestion {
    background:
        linear-gradient(135deg, rgba(6, 214, 247, 0.04) 0%, rgba(123, 44, 191, 0.025) 100%),
        rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; padding: 11px 15px;
    font-size: 12.5px; color: rgba(255,255,255,0.55);
    cursor: pointer; text-align: left; font-family: inherit;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.6s ease, transform 0.3s ease;
    position: relative; overflow: visible;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.visor-suggestion:hover {
    background:
        linear-gradient(135deg, rgba(6, 214, 247, 0.08) 0%, rgba(224, 64, 251, 0.05) 100%),
        rgba(6,214,247,0.02);
    border-color: transparent;
    color: rgba(255,255,255,0.92);
    transform: translateY(-1px);
    box-shadow:
        0 0 16px rgba(6,214,247,0.20),
        0 0 40px rgba(123,44,191,0.10),
        0 0 80px rgba(6,214,247,0.05);
}


/* ================================================================
   10b. LIVE INSIGHT INDICATOR (always-on knowledge extraction)
   ================================================================ */
.visor-insight-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 22px;
    font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
    font-weight: 600;
    color: rgba(6,214,247,0.7);
    transition: all 0.6s ease;
    text-shadow: 0 0 12px rgba(6,214,247,0.30);
}
.visor-insight-bar.visor-insight-pulse { color: rgba(6,214,247,0.9); }
.visor-insight-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(6,214,247,0.4);
    animation: visor-dot-breathe 3s ease-in-out infinite;
    flex-shrink: 0;
}
.visor-insight-bar.visor-insight-pulse .visor-insight-dot {
    background: #06d6f7;
    box-shadow: 0 0 8px rgba(6,214,247,0.6);
    animation: none;
}
@keyframes visor-dot-breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Image upload */
.visor-attach {
    width: 38px; height: 38px;
    border-radius: 12px; border: 1px solid rgba(6,214,247,0.14);
    background:
        linear-gradient(135deg, rgba(6,214,247,0.10) 0%, rgba(123,44,191,0.06) 100%),
        rgba(6,214,247,0.04);
    color: var(--v-cyan); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.3s ease; opacity: 0.85;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.visor-attach:hover {
    opacity: 1;
    background:
        linear-gradient(135deg, rgba(6,214,247,0.22) 0%, rgba(224,64,251,0.12) 100%),
        rgba(6,214,247,0.12);
    border-color: rgba(6,214,247,0.34);
    box-shadow:
        0 0 22px rgba(6,214,247,0.20),
        0 0 50px rgba(123,44,191,0.10),
        inset 0 1px 0 rgba(255,255,255,0.08);
    transform: scale(1.06);
}
.visor-image-preview {
    display: flex; gap: 6px; padding: 8px 16px 0; flex-wrap: wrap;
    max-height: 180px; overflow-y: auto; flex-shrink: 0;
}
.visor-preview-thumb {
    position: relative; width: 56px; height: 56px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(6,214,247,0.15);
}
.visor-preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.visor-preview-pdf {
    width: auto; min-width: 56px; max-width: 140px;
    padding: 4px 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6,214,247,0.06);
}
.visor-pdf-icon {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.visor-pdf-label {
    font-size: 9px; color: rgba(6,214,247,0.7);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 120px;
}
.visor-msg-pdf-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 6px;
    background: rgba(6,214,247,0.06);
    border: 1px solid rgba(6,214,247,0.12);
    font-size: 11px; color: rgba(6,214,247,0.7);
}
.visor-msg-images { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.visor-msg-thumb {
    width: 80px; height: 80px; object-fit: cover;
    border-radius: 8px; border: 1px solid rgba(6,214,247,0.1);
}
.visor-preview-file {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 8px; border-radius: 6px;
    background: rgba(6,214,247,0.04);
    border: 1px solid rgba(6,214,247,0.08);
    font-size: 10px; color: rgba(255,255,255,0.7);
    position: relative; min-width: 0; width: 100%;
}
.visor-file-ready { border-color: rgba(6,214,247,0.2); }
.visor-file-error { border-color: rgba(248,113,113,0.3); color: rgba(248,113,113,0.8); }
.visor-file-uploading { border-color: rgba(6,214,247,0.1); }
.visor-file-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 500;
}
.visor-file-size { color: rgba(255,255,255,0.3); font-size: 10px; flex-shrink: 0; }
.visor-file-ok { color: #06d6f7; font-weight: 700; flex-shrink: 0; }
.visor-file-err { color: #f87171; font-size: 10px; flex-shrink: 0; }
.visor-progress-bar {
    width: 50px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.06); flex-shrink: 0; overflow: hidden;
}
.visor-progress-fill {
    height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, #06d6f7, #0ea5e9);
    transition: width 0.2s ease;
}
.visor-upload-count {
    display: flex; align-items: center;
    font-size: 10px; color: rgba(6,214,247,0.5);
    padding: 4px 8px; letter-spacing: 0.02em;
    width: 100%;
}
.visor-preview-remove {
    position: absolute; top: 2px; right: 2px;
    width: 18px; height: 18px; border-radius: 50%; border: none;
    background: rgba(0,0,0,0.7); color: #fff; font-size: 12px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.visor-preview-remove:hover { background: rgba(220,50,50,0.8); }
.visor-msg-images { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.visor-msg-thumb {
    width: 80px; height: 80px; object-fit: cover;
    border-radius: 8px; border: 1px solid rgba(6,214,247,0.1);
}

/* ================================================================
   11. INPUT
   ================================================================ */
.visor-input-wrap {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 14px 22px 20px;
    border-top: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
    position: relative;
}
.visor-input {
    flex: 1;
    background:
        linear-gradient(135deg, rgba(6, 214, 247, 0.025) 0%, rgba(123, 44, 191, 0.015) 100%),
        rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px; color: var(--v-text);
    font-family: inherit; font-size: 13.5px;
    padding: 12px 18px; resize: none; outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    max-height: 100px; overflow-y: auto; letter-spacing: -0.005em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.visor-input:focus {
    border-color: rgba(6,214,247,0.32);
    background:
        linear-gradient(135deg, rgba(6, 214, 247, 0.05) 0%, rgba(224, 64, 251, 0.03) 100%),
        rgba(6,214,247,0.02);
    box-shadow:
        0 0 0 3px rgba(6,214,247,0.08),
        0 0 28px rgba(6,214,247,0.10),
        0 0 60px rgba(123,44,191,0.06);
}
.visor-input::placeholder { color: rgba(255,255,255,0.22); letter-spacing: 0.01em; }

.visor-send {
    width: 42px; height: 42px;
    border-radius: 14px; border: none;
    background:
        linear-gradient(135deg, rgba(6,214,247,0.18) 0%, rgba(0,128,255,0.10) 100%),
        rgba(6,214,247,0.06);
    border: 1px solid rgba(6,214,247,0.22);
    color: var(--v-cyan); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; position: relative; overflow: visible;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 14px rgba(6,214,247,0.10), inset 0 1px 0 rgba(255,255,255,0.06);
}
.visor-send:hover {
    background:
        linear-gradient(135deg, rgba(6,214,247,0.30) 0%, rgba(224,64,251,0.18) 100%),
        rgba(6,214,247,0.12);
    border-color: rgba(6,214,247,0.40);
    color: #fff;
    box-shadow:
        0 0 28px rgba(6,214,247,0.32),
        0 0 60px rgba(123,44,191,0.18),
        inset 0 1px 0 rgba(255,255,255,0.10);
    transform: scale(1.06);
}
.visor-send:active { transform: scale(0.95); }


/* ================================================================
   12. MESSAGE ENTRANCE
   ================================================================ */
.visor-msg-enter {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    animation: visorMsgReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes visorMsgReveal {
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.visor-msg--visor.visor-msg-enter {
    transform: translateY(12px) translateX(-6px) scale(0.98);
    animation: visorMsgRevealV 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes visorMsgRevealV {
    to { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
}


/* ================================================================
   PREMIUM MICRO-INTERACTIONS
   ================================================================ */

/* Noise texture overlay — premium matte surface */
.visor-noise {
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.025;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

/* Aurora border glow on suggestion pills */
@property --visor-pill-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.visor-suggestion::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    padding: 1px;
    background: conic-gradient(
        from var(--visor-pill-angle),
        var(--v-cyan), var(--v-azure), var(--v-purple), var(--v-magenta),
        transparent 40%, transparent 60%,
        var(--v-magenta), var(--v-purple), var(--v-azure), var(--v-cyan)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.visor-suggestion::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 18px;
    background: conic-gradient(
        from var(--visor-pill-angle),
        rgba(6,214,247,0.12), rgba(0,128,255,0.08), rgba(123,44,191,0.06), rgba(224,64,251,0.04),
        transparent 40%, transparent 60%,
        rgba(224,64,251,0.04), rgba(123,44,191,0.06), rgba(0,128,255,0.08), rgba(6,214,247,0.12)
    );
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}
.visor-suggestion:hover::before {
    opacity: 0.8;
    animation: visorPillAurora 3s linear infinite;
}
.visor-suggestion:hover::after {
    opacity: 1;
    animation: visorPillAurora 3s linear infinite;
}
@keyframes visorPillAurora {
    to { --visor-pill-angle: 360deg; }
}

/* Staggered cascade entrance for suggestion pills */
.visor-suggestion--cascade {
    opacity: 0;
    transform: translateY(10px);
    animation: visorCascadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.visor-suggestion--cascade:nth-child(1) { animation-delay: 0.35s; }
.visor-suggestion--cascade:nth-child(2) { animation-delay: 0.47s; }
.visor-suggestion--cascade:nth-child(3) { animation-delay: 0.59s; }
@keyframes visorCascadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Floating micro-particles */
.visor-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--v-cyan), transparent);
    opacity: 0;
    pointer-events: none;
}
.visor-particle--1 { animation: visorP1 10s ease-in-out infinite; }
.visor-particle--2 { animation: visorP2 12s ease-in-out infinite 1s; }
.visor-particle--3 { animation: visorP3 9s ease-in-out infinite 0.5s; }
.visor-particle--4 { animation: visorP4 11s ease-in-out infinite 2s; }
.visor-particle--5 { animation: visorP5 13s ease-in-out infinite 1.5s; }
.visor-particle--6 { animation: visorP6 10s ease-in-out infinite 3s; }
@keyframes visorP1 { 0%,100%{transform:translate(-25px,-30px);opacity:0} 25%{opacity:0.5} 50%{transform:translate(30px,-20px);opacity:0.6} 75%{opacity:0.3} }
@keyframes visorP2 { 0%,100%{transform:translate(28px,25px);opacity:0} 25%{opacity:0.4} 50%{transform:translate(-20px,-35px);opacity:0.5} 75%{opacity:0.25} }
@keyframes visorP3 { 0%,100%{transform:translate(35px,-15px);opacity:0} 25%{opacity:0.45} 50%{transform:translate(-30px,25px);opacity:0.55} 75%{opacity:0.3} }
@keyframes visorP4 { 0%,100%{transform:translate(-20px,32px);opacity:0} 25%{opacity:0.35} 50%{transform:translate(25px,-28px);opacity:0.5} 75%{opacity:0.2} }
@keyframes visorP5 { 0%,100%{transform:translate(15px,35px);opacity:0} 25%{opacity:0.4} 50%{transform:translate(-35px,-10px);opacity:0.45} 75%{opacity:0.25} }
@keyframes visorP6 { 0%,100%{transform:translate(-32px,10px);opacity:0} 25%{opacity:0.3} 50%{transform:translate(20px,30px);opacity:0.5} 75%{opacity:0.2} }

/* Oscilloscope waveform */
.visor-oscilloscope {
    display: flex;
    align-items: center;
    height: 20px;
    width: 60px;
    flex-shrink: 0;
}
.visor-oscilloscope svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}
.visor-oscilloscope svg path {
    filter: drop-shadow(0 0 3px rgba(6, 214, 247, 0.5));
}

/* Send button pulse ring */
.visor-send--pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    border: 1.5px solid var(--v-cyan);
    animation: visorSendPulse 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}
@keyframes visorSendPulse {
    0% { inset: -2px; opacity: 0.6; }
    100% { inset: -16px; opacity: 0; }
}

/* Input focus: center-out border trace */
.visor-input-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%; right: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--v-cyan), transparent);
    transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1), right 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}
.visor-input-wrap:focus-within::after {
    left: 0; right: 0;
    opacity: 0.4;
}

/* Disclaimer — sits beneath composer, glass-tone, low emphasis */
.visor-disclaimer {
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    margin: 0 22px 14px;
    padding: 4px 0 2px;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
    text-align: center;
    user-select: none;
    flex-shrink: 0;
    line-height: 1.3;
    pointer-events: none;
    font-variant: all-small-caps;
    font-weight: 500;
    text-shadow: 0 0 18px rgba(6,214,247,0.06);
}
.visor-disclaimer-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: rgba(6,214,247,0.85);
    box-shadow:
        0 0 8px rgba(6,214,247,0.65),
        0 0 14px rgba(6,214,247,0.35);
    flex-shrink: 0;
    animation: visorDisclaimerBreath 3.6s ease-in-out infinite;
}
@keyframes visorDisclaimerBreath {
    0%, 100% { opacity: 0.75; }
    50%      { opacity: 1; }
}
.visor-disclaimer-text {
    color: rgba(255,255,255,0.55);
}


/* ================================================================
   13. RESPONSIVE — Mobile
   ================================================================ */
@media (max-width: 768px) {
    #visor-panel {
        width: 100vw; min-width: 0; max-width: 100vw;
        left: 0; right: 0; top: auto; bottom: 0;
        height: 100dvh; max-height: 100dvh;
        border-radius: 20px 20px 0 0;
        transform: scale(0);
        transform-origin: calc(100% - 43px) calc(100% - 43px);
        border-top: 1px solid rgba(6,214,247,0.08);
        box-sizing: border-box;
    }
    #visor-panel.visor-panel--open { transform: scale(1); }
    #visor-panel::before { display: none; }
    #visor-panel.visor-panel--open::after { display: none; }
    .visor-header { padding: 20px 18px 12px; }
    #visor-orb { bottom: 18px; right: 18px; width: 50px; height: 50px; }
    .visor-aurora-blob { filter: blur(60px); }
    .visor-messages { padding: 16px 18px; }
    .visor-input-wrap { padding: 12px 18px 20px; }
    .visor-suggestions { padding: 0 18px 10px; }
    .visor-suggestion { padding: 12px 14px; font-size: 13px; }
    .visor-input { font-size: 16px; padding: 14px 16px; }
    .visor-send { width: 46px; height: 46px; }
    .visor-disclaimer { margin: -10px 18px 14px; font-size: 10px; letter-spacing: 0.03em; }
    .visor-welcome { padding: 40px 16px 20px; }
    .visor-msg { max-width: 94%; }
    .visor-welcome-sub { display: none; }
}
@media (max-width: 380px) {
    .visor-header { padding: 18px 14px 10px; }
    .visor-messages { padding: 14px; }
    .visor-input-wrap { padding: 10px 14px 16px; }
    .visor-suggestions { padding: 0 14px 8px; }
    .visor-disclaimer { margin: -8px 14px 10px; }
}

/* ── Feedback thumbs ── */
.visor-feedback {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}
.visor-fb-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.2s, border-color 0.2s, color 0.2s;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
}
.visor-fb-btn:hover {
    opacity: 0.8;
    border-color: rgba(255,255,255,0.2);
}
.visor-fb-btn:disabled {
    cursor: default;
    opacity: 0.25;
}
.visor-fb-btn.visor-fb-active {
    opacity: 1;
    color: #D2A84A;
    border-color: rgba(210,168,74,0.4);
}
.visor-fb-btn.visor-fb-active svg { stroke: #D2A84A; }
.visor-fb-thanks {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    font-style: italic;
}
.visor-fb-reason {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    align-items: center;
}
.visor-fb-reason-input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    outline: none;
}
.visor-fb-reason-input:focus {
    border-color: rgba(210,168,74,0.4);
}
.visor-fb-reason-send {
    background: rgba(210,168,74,0.15);
    border: 1px solid rgba(210,168,74,0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: #D2A84A;
    cursor: pointer;
    white-space: nowrap;
}
.visor-fb-reason-send:hover {
    background: rgba(210,168,74,0.25);
}
