@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --neon-cyan: #6366f1; /* Indigo do PWA */
    --neon-blue: #4f46e5;
    --neon-purple: #818cf8;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(99, 102, 241, 0.2);
}

.font-tech {
    font-family: 'Rajdhani', sans-serif;
}

/* PWA Standalone Optimizations */
.is-standalone .pwa\:hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .is-standalone main {
        padding-top: calc(1rem + env(safe-area-inset-top)) !important;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #f1f5f9 100%);
    color: #1e293b;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -2;
}

.bg-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    animation: float 15s infinite ease-in-out;
}

.bg-glow:nth-child(2) {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    animation-delay: -7s;
    right: -100px;
    top: 30%;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -50px) scale(1.1); }
}

/* Glassmorphism Light */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.8) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
}

/* Neon Effects for Light Mode */
.neon-text {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.neon-border {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2),
                0 0 40px rgba(0, 212, 255, 0.1);
}

/* Navigation */
.nav-item {
    position: relative;
    transition: all 0.3s ease;
    color: #64748b;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: width 0.3s ease;
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

.nav-item:hover,
.nav-item.active {
    color: #0891b2;
}

/* Core Animation */
.core-container {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-ring {
    position: absolute;
    border: 2px solid rgba(6, 182, 212, 0.2);
    border-radius: 50%;
    animation: rotate 10s linear infinite;
}

.core-ring:nth-child(1) {
    width: 100%;
    height: 100%;
    border-top-color: #06b6d4;
    border-right-color: transparent;
    animation-duration: 8s;
}

.core-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    border-bottom-color: #a855f7;
    border-left-color: transparent;
    animation-duration: 12s;
    animation-direction: reverse;
}

.core-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    border-left-color: #3b82f6;
    border-top-color: transparent;
    animation-duration: 6s;
}

.core-center {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #a855f7 100%);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4),
                0 0 80px rgba(99, 102, 241, 0.2),
                inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: pulse 3s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.core-center::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 50%);
}

.core-center:hover {
    transform: scale(1.1);
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.6),
                0 0 100px rgba(6, 182, 212, 0.3);
}

.core-center.listening {
    animation: pulse-fast 0.5s ease-in-out infinite;
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    box-shadow: 0 0 60px rgba(236, 72, 153, 0.5),
                0 0 100px rgba(236, 72, 153, 0.3);
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-fast {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Data Cards Light */
.data-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
                0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.data-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.05), transparent);
    transition: left 0.6s ease;
}

.data-card:hover::before {
    left: 100%;
}

.data-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04),
                0 0 20px rgba(6, 182, 212, 0.15);
    transform: translateY(-4px);
}

/* Scanning Line */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #06b6d4, transparent);
    animation: scan 3s linear infinite;
    opacity: 0.6;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* Voice Wave */
.voice-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 30px;
}

.voice-bar {
    width: 4px;
    background: linear-gradient(to top, #06b6d4, #3b82f6);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.voice-bar:nth-child(1) { animation-delay: 0s; height: 20%; }
.voice-bar:nth-child(2) { animation-delay: 0.1s; height: 60%; }
.voice-bar:nth-child(3) { animation-delay: 0.2s; height: 100%; }
.voice-bar:nth-child(4) { animation-delay: 0.3s; height: 60%; }
.voice-bar:nth-child(5) { animation-delay: 0.4s; height: 20%; }

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

/* Scrollbar Light */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #06b6d4, #3b82f6);
    border-radius: 4px;
}

/* Status Indicator */
.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Chat Interface Light */
.chat-message-bubble {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-left: 3px solid #06b6d4;
    padding: 12px;
    margin: 8px 0;
    border-radius: 0 12px 12px 0;
    animation: slideIn 0.3s ease;
}

.chat-message-bubble.user {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
    border-left-color: #a855f7;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Hexagon Grid */
.hex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hex-item {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(241,245,249,0.8) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.hex-item:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: #06b6d4;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #0891b2 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Input */
.glass-input {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
    outline: none;
}

/* Immersive Mode: no scroll, full viewport */
body.immersive-active {
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

/* Desktop: full-screen backdrop with orb centered on top */
@media (min-width: 769px) {
    body.immersive-active::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.92);
        z-index: 999;
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    body.immersive-active::before {
        display: none !important;
    }
}

/* AI Core (orb) on top of backdrop, centered in the viewport (moved to body by JS) */
body.immersive-active [data-controller="fluxo-core"] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    z-index: 10000 !important;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    overflow: hidden;
}

/* When orb is full-screen speaking, hide the microphone icon */
body.immersive-active .core-center.listening .fa-microphone,
body.immersive-active .core-center.listening > i {
    display: none !important;
}

body.immersive-active [data-controller="fluxo-core"] .core-container {
    flex-shrink: 0;
    transform: scale(1.5);
    filter: drop-shadow(0 0 50px rgba(34, 211, 238, 0.4));
}

/* Text adjustments for Jarvis full screen */
body.immersive-active [data-controller="fluxo-core"] h3 {
    font-size: 3rem !important;
    margin-bottom: 2rem !important;
    color: white !important;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.8);
    letter-spacing: 0.5em !important;
}

body.immersive-active [data-controller="fluxo-core"] p {
    font-size: 1.2rem !important;
    color: rgba(34, 211, 238, 0.8) !important;
    margin-top: 2rem !important;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

body.immersive-active [data-controller="fluxo-core"] p {
    color: rgba(255, 255, 255, 0.8) !important;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

body.immersive-active .core-center.listening {
    box-shadow: 0 0 80px rgba(236, 72, 153, 0.8),
                0 0 120px rgba(236, 72, 153, 0.4),
                inset 0 0 30px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

body.immersive-active .core-ring {
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

body.immersive-active .voice-bar {
    background: #22d3ee !important;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.9);
    width: 6px !important;
    margin: 0 4px !important;
}

body.immersive-active .voice-wave {
    height: 60px !important;
}

/* ========== Fluxo Context Panel – parte do backdrop, legendas à direita ========== */
.fluxo-context-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: calc(100vw - 2rem);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.fluxo-context-panel.fluxo-context-panel--visible {
    transform: translateX(0);
}

.fluxo-context-panel__header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
}

.fluxo-context-panel__header-title {
    display: inline-flex;
    align-items: center;
}

.fluxo-context-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Transcript = o que o Fluxo está falando (legenda ao vivo) */
.fluxo-context-panel__transcript-wrap {
    margin-bottom: 0.5rem;
}

.fluxo-context-panel__transcript {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    min-height: 2.5em;
}

.fluxo-context-panel__items-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fluxo-context-panel__section {
    margin-bottom: 1rem;
}

.fluxo-context-panel__section:last-child {
    margin-bottom: 0;
}

.fluxo-context-panel__section-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(34, 211, 238, 0.7);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fluxo-context-panel__items {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fluxo-context-panel__item,
.fluxo-context-panel__section-title.fluxo-context-panel__item--pending {
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fluxo-context-panel__item--revealed,
.fluxo-context-panel__section-title.fluxo-context-panel__item--revealed {
    opacity: 1;
    transform: translateX(0);
}

.fluxo-context-panel__item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
}

.fluxo-context-panel__item-time {
    font-size: 0.62rem;
    color: rgba(34, 211, 238, 0.7);
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.fluxo-context-panel__item-title {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    line-height: 1.35;
}

.fluxo-context-panel__item-habit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.fluxo-context-panel__item-habit.done {
    color: rgba(34, 211, 238, 0.95);
}

.fluxo-context-panel__habit-icon {
    flex-shrink: 0;
}

.fluxo-context-panel__habit-name {
    flex: 1;
}

.fluxo-context-panel__habit-streak {
    font-size: 0.7rem;
    color: rgba(251, 191, 36, 0.95);
}

.fluxo-context-panel__loading,
.fluxo-context-panel__error,
.fluxo-context-panel__empty {
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

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

.chat-immersive-mode {
    display: none !important; /* User requested "only the orb" to appear */
}

/* Hide floating elements in immersive mode */
body.immersive-active .hud-element,
body.immersive-active nav.fixed,
body.immersive-active footer {
    display: none !important;
}

@media (max-width: 768px) {
    body.immersive-active [data-controller="fluxo-core"] {
        top: 25% !important;
        transform: translate(-50%, -50%) scale(0.8) !important;
    }
}


/* ================================================================
   PWA IMMERSIVE MODE — Mobile-only fullscreen voice overlay
   ================================================================ */

/* Overlay wrapper */
.pwa-immersive-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.pwa-immersive-overlay.pwa-immersive--active {
    opacity: 1;
    pointer-events: auto;
}

/* Hide entirely on desktop */
@media (min-width: 769px) {
    .pwa-immersive-overlay {
        display: none !important;
    }
}

/* Main container */
.pwa-immersive {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #080c24 0%, #0f172a 40%, #131a35 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ─── Header ─────────────────────────────────────────────── */
.pwa-immersive__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    flex-shrink: 0;
    z-index: 10;
}

/* ─── Body (orb + wave + status + transcription) ─────────── */
.pwa-immersive__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    z-index: 5;
    min-height: 0;
}

/* ─── Orb Area ───────────────────────────────────────────── */
.pwa-immersive__orb-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

/* Watermark behind orb */
.pwa-immersive__watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 0.15em;
    font-family: var(--font-tech, 'Inter', monospace);
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.3em;
    color: rgba(99, 102, 241, 0.07);
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

/* ─── Orb ────────────────────────────────────────────────── */
.pwa-immersive__orb {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Rings */
.pwa-immersive__ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(99, 102, 241, 0.15);
}

.pwa-immersive__ring--1 {
    width: 100%;
    height: 100%;
    animation: pwa-ring-rotate 12s linear infinite;
}

.pwa-immersive__ring--2 {
    width: 85%;
    height: 85%;
    border-color: rgba(139, 92, 246, 0.12);
    animation: pwa-ring-rotate 8s linear infinite reverse;
}

.pwa-immersive__ring--3 {
    width: 70%;
    height: 70%;
    border-color: rgba(168, 85, 247, 0.10);
    animation: pwa-ring-rotate 15s linear infinite;
}

/* Core (the glowing sphere) */
.pwa-immersive__core {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%,
        rgba(255, 180, 220, 0.9) 0%,
        rgba(236, 72, 153, 0.85) 30%,
        rgba(168, 85, 247, 0.7) 60%,
        rgba(99, 102, 241, 0.5) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 60px rgba(236, 72, 153, 0.4),
        0 0 120px rgba(168, 85, 247, 0.2),
        inset 0 -10px 30px rgba(99, 102, 241, 0.3),
        inset 0 10px 20px rgba(255, 255, 255, 0.15);
    animation: pwa-orb-pulse 4s ease-in-out infinite;
    z-index: 5;
    position: relative;
}

/* State: listening — faster pulse, red-ish glow */
.pwa-immersive__orb[data-state="listening"] .pwa-immersive__core {
    animation: pwa-orb-pulse-fast 1s ease-in-out infinite;
    box-shadow:
        0 0 80px rgba(236, 72, 153, 0.6),
        0 0 160px rgba(236, 72, 153, 0.3),
        inset 0 -10px 30px rgba(168, 85, 247, 0.4),
        inset 0 10px 20px rgba(255, 255, 255, 0.2);
}

.pwa-immersive__orb[data-state="listening"] .pwa-immersive__ring {
    border-color: rgba(236, 72, 153, 0.3);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.15);
}

/* State: thinking — breathing glow, indigo */
.pwa-immersive__orb[data-state="thinking"] .pwa-immersive__core {
    animation: pwa-orb-breathe 2s ease-in-out infinite;
    background: radial-gradient(circle at 40% 35%,
        rgba(180, 160, 255, 0.9) 0%,
        rgba(139, 92, 246, 0.8) 30%,
        rgba(99, 102, 241, 0.7) 60%,
        rgba(67, 56, 202, 0.5) 100%
    );
    box-shadow:
        0 0 60px rgba(139, 92, 246, 0.5),
        0 0 120px rgba(99, 102, 241, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

/* State: speaking — vibrant pulse with pink/magenta */
.pwa-immersive__orb[data-state="speaking"] .pwa-immersive__core {
    animation: pwa-orb-speak 2s ease-in-out infinite;
    box-shadow:
        0 0 80px rgba(236, 72, 153, 0.5),
        0 0 150px rgba(168, 85, 247, 0.3),
        0 0 200px rgba(99, 102, 241, 0.15),
        inset 0 -10px 30px rgba(99, 102, 241, 0.3),
        inset 0 10px 20px rgba(255, 255, 255, 0.2);
}

.pwa-immersive__orb[data-state="speaking"] .pwa-immersive__ring--1 {
    border-color: rgba(236, 72, 153, 0.25);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.1);
}

.pwa-immersive__orb[data-state="speaking"] .pwa-immersive__ring--2 {
    border-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.08);
}

/* ─── Voice Wave ─────────────────────────────────────────── */
.pwa-immersive__wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwa-immersive__wave--active {
    opacity: 1;
}

.pwa-immersive__bar {
    width: 5px;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(to top, #6366f1, #22d3ee);
    transform: scaleY(0.3);
    transform-origin: bottom;
    transition: transform 0.1s ease;
    animation: pwa-wave 1.2s ease-in-out infinite;
}

.pwa-immersive__bar:nth-child(1) { animation-delay: 0ms;   height: 60%; }
.pwa-immersive__bar:nth-child(2) { animation-delay: 150ms; height: 100%; }
.pwa-immersive__bar:nth-child(3) { animation-delay: 300ms; height: 80%; }
.pwa-immersive__bar:nth-child(4) { animation-delay: 150ms; height: 100%; }
.pwa-immersive__bar:nth-child(5) { animation-delay: 0ms;   height: 60%; }

/* ─── Status Text ────────────────────────────────────────── */
.pwa-immersive__status {
    font-family: var(--font-tech, 'Inter', monospace);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(236, 72, 153, 0.9);
    text-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
    margin-bottom: 1rem;
    text-align: center;
}

/* ─── Transcription ──────────────────────────────────────── */
.pwa-immersive__transcription {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    max-width: 85%;
    max-height: 120px;
    overflow-y: auto;
    padding: 0 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pwa-immersive__transcription::-webkit-scrollbar {
    display: none;
}

.pwa-immersive__transcription--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Context Cards ──────────────────────────────────────── */
.pwa-immersive__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    flex-shrink: 0;
    z-index: 10;
}

.pwa-immersive-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.875rem;
}

.pwa-immersive-card__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #818cf8;
    font-size: 0.75rem;
}

.pwa-immersive-card__icon--finance {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.pwa-immersive-card__icon--habit {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.pwa-immersive-card__icon--note {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
}

.pwa-immersive-card__label {
    font-family: var(--font-tech, 'Inter', monospace);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.pwa-immersive-card__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.15rem;
}

.pwa-immersive-card__detail {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.pwa-immersive-card--enter {
    animation: pwa-card-enter 0.4s ease-out forwards;
}

@keyframes pwa-card-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes pwa-ring-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes pwa-orb-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.03); }
}

@keyframes pwa-orb-pulse-fast {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

@keyframes pwa-orb-breathe {
    0%, 100% { transform: scale(0.97); opacity: 0.85; }
    50%      { transform: scale(1.05); opacity: 1; }
}

@keyframes pwa-orb-speak {
    0%, 100% { transform: scale(1); }
    25%      { transform: scale(1.06); }
    75%      { transform: scale(0.98); }
}

@keyframes pwa-wave {
    0%, 100% { transform: scaleY(0.3); }
    50%      { transform: scaleY(1); }
}
