@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;
}

/* text-slate-400 (#94a3b8) measures 2.56:1 on white — fails WCAG AA even for
   large text. Dark mode already remaps it to this same shade below; this is
   the light-mode half of that fix. */
.text-slate-400 {
    color: #64748b !important;
}

/* 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;
}

.bg-glow:nth-child(2) {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    right: -100px;
    top: 30%;
}

/* 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 {
    color: #0e7490;
}

.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: #10b981;
    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%, #10b981 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%; }
}

/* 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; }
}

/* Solid color, not a gradient clip: background-clip:text is banned by DESIGN.md's
   Do's and Don'ts — emphasis comes from weight/size, not decoration. */
.gradient-text {
    color: #0e7490;
}

/* 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;
}

/* Chat: Live transcription typing animation */
[data-chat-target="liveTranscription"] span {
    animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Chat: Mic button recording glow */
[data-chat-target="micButton"].bg-red-500 {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

/* ================================================================
   IMMERSIVE VOICE OVERLAY — single fullscreen voice surface,
   all viewports (desktop web, mobile web/PWA, native /voice)
   ================================================================ */

/* 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;
}

/* 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;
}

.pwa-immersive__mode-badge {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1;
    padding: 0.45rem 0.65rem;
    text-transform: uppercase;
}

/* ─── 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;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ─── Orbe de voz (canvas do componente voice-orb) ───────────
   Canvas transparente e sem clip: partículas e halo se fundem ao fundo do
   overlay (o orbe faz parte do cenário). Maior que o orbe para as órbitas
   (raio até ~180px) e o halo caberem sem corte. */
.pwa-immersive__orb-canvas {
    position: relative;
    width: min(92vw, 440px);
    aspect-ratio: 1 / 1;
    background: transparent;
    pointer-events: none; /* o clique é tratado pela orb-area ao redor */
}

.pwa-immersive__orb-canvas-el {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* ─── 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;
}

.pwa-immersive__mode-hint {
    max-width: 80%;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.8rem;
    line-height: 1.45;
    margin: -0.25rem 0 0.85rem;
    text-align: center;
}

/* Keyboard affordance — only meaningful where a keyboard exists */
.pwa-immersive__keyboard-hint {
    display: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: -0.35rem 0 0.6rem;
    text-align: center;
}

@media (min-width: 769px) {
    .pwa-immersive__keyboard-hint {
        display: block;
    }
}

.pwa-immersive__modes {
    display: grid;
    gap: 0.45rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 1rem;
    max-width: 420px;
    width: min(100%, 420px);
}

.pwa-immersive__mode-button {
    appearance: none;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    min-height: 2.35rem;
    padding: 0 0.5rem;
    text-align: center;
    text-transform: uppercase;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pwa-immersive__mode-button:active {
    transform: scale(0.96);
}

.pwa-immersive__mode-button--active {
    background: rgba(34, 211, 238, 0.16);
    border-color: rgba(34, 211, 238, 0.4);
    color: rgba(255, 255, 255, 0.92);
}

/* ─── 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);
}

/* User speech streams in as a quoted, dimmer line; the assistant's reply
   reads as regular text so the full answer works without audio. */
.pwa-immersive__transcription[data-role="user"] {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.pwa-immersive__transcription[data-role="assistant"] {
    color: rgba(255, 255, 255, 0.92);
    font-style: normal;
}

/* Durante a fala a transcrição vira um painel HUD futurista e ocupa o espaço
   nobre (os menos essenciais são recolhidos — ver regras de [data-state]). */
.pwa-immersive__transcription--speaking {
    position: relative;
    font-size: clamp(1.05rem, 3.6vw, 1.35rem);
    line-height: 1.75;
    font-weight: 500;
    max-width: min(94%, 660px);
    max-height: 42vh;
    padding: 1.6rem 1.35rem 1.35rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(34, 211, 238, 0.22);
    background:
        linear-gradient(180deg, rgba(8, 16, 32, 0.62), rgba(8, 16, 32, 0.28));
    box-shadow:
        0 0 0 1px rgba(34, 211, 238, 0.06),
        0 24px 70px rgba(0, 0, 0, 0.4),
        inset 0 0 46px rgba(34, 211, 238, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Rótulo flutuante + indicador "ao vivo" */
.pwa-immersive__transcription--speaking::before {
    content: "◈ TRANSCRIÇÃO";
    position: absolute;
    top: -0.64rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-tech, 'Inter', monospace);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: rgba(103, 232, 249, 0.92);
    background: #0b1120;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    white-space: nowrap;
}

/* Textura de scanlines sutil sobre o painel */
.pwa-immersive__transcription--speaking::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 1.1rem;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(34, 211, 238, 0.028) 3px,
        rgba(34, 211, 238, 0.028) 4px
    );
    mix-blend-mode: screen;
}

/* Karaokê: palavras dita/atual/por-vir têm brilho progressivo */
.pwa-immersive__word {
    transition: color 0.25s ease, text-shadow 0.25s ease, opacity 0.25s ease;
}

/* Estado base durante a fala: ainda não dita = apagada */
.pwa-immersive__transcription--speaking .pwa-immersive__word {
    color: rgba(255, 255, 255, 0.32);
}

/* Palavra já falada = legível */
.pwa-immersive__transcription--speaking .pwa-immersive__word--spoken {
    color: rgba(226, 240, 255, 0.92);
}

/* Palavra sendo falada agora = destaque ciano vivo (acompanha o orbe) */
.pwa-immersive__transcription--speaking .pwa-immersive__word--active {
    color: #ffffff;
    text-shadow:
        0 0 18px rgba(34, 211, 238, 0.85),
        0 0 6px rgba(103, 232, 249, 0.7);
}

/* ─── Layout durante a fala: mais espaço para a transcrição ─── */
.pwa-immersive-overlay[data-state="speaking"] .pwa-immersive__quick-actions,
.pwa-immersive-overlay[data-state="speaking"] .pwa-immersive__keyboard-hint,
.pwa-immersive-overlay[data-state="speaking"] .pwa-immersive__mode-hint,
.pwa-immersive-overlay[data-state="thinking"] .pwa-immersive__quick-actions,
.pwa-immersive-overlay[data-state="thinking"] .pwa-immersive__keyboard-hint {
    opacity: 0;
    max-height: 0;
    margin: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Orbe recua um pouco durante a fala para liberar altura à transcrição */
.pwa-immersive-overlay[data-state="speaking"] .pwa-immersive__orb-area {
    margin-bottom: 0.75rem;
    transform: scale(0.8);
}

.pwa-immersive__orb-area,
.pwa-immersive__quick-actions,
.pwa-immersive__mode-hint {
    transition: opacity 0.35s ease, max-height 0.35s ease, transform 0.4s ease, margin 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    .pwa-immersive__word,
    .pwa-immersive__orb-area,
    .pwa-immersive__quick-actions,
    .pwa-immersive__mode-hint { transition: none; }
}

/* ─── 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;
}

/* ─── Campo de respostas interativo (listas, tarefas, agenda) ──
   Quando a resposta traz itens acionáveis, o campo vira uma coluna rolável
   de blocos formatados (checkbox, linhas de agenda etc.). */
.pwa-immersive__cards--rich {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: min(42vh, 380px);
    overflow-y: auto;
    scrollbar-width: none;
    max-width: min(94%, 640px);
    margin: 0 auto;
    width: 100%;
}

.pwa-immersive__cards--rich::-webkit-scrollbar { display: none; }

.pwa-immersive-result {
    background: linear-gradient(180deg, rgba(10, 18, 34, 0.66), rgba(10, 18, 34, 0.34));
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 0.95rem;
    padding: 0.85rem 0.95rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
}

.pwa-immersive-result--enter {
    animation: pwa-result-in 0.4s ease both;
}

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

.pwa-immersive-result__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.pwa-immersive-result__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    color: #67e8f9;
    background: rgba(34, 211, 238, 0.12);
}

.pwa-immersive-result__icon--finance { color: #6ee7b7; background: rgba(16, 185, 129, 0.12); }
.pwa-immersive-result__icon--habit   { color: #fca5a5; background: rgba(244, 63, 94, 0.12); }
.pwa-immersive-result__icon--note    { color: #c4b5fd; background: rgba(139, 92, 246, 0.12); }

.pwa-immersive-result__label {
    font-family: var(--font-tech, 'Inter', monospace);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(226, 240, 255, 0.6);
}

.pwa-immersive-result__items { display: flex; flex-direction: column; gap: 0.15rem; }

.pwa-immersive-result__title { font-size: 0.95rem; font-weight: 700; color: #fff; }
.pwa-immersive-result__detail { margin-top: 0.15rem; font-size: 0.8rem; color: rgba(226, 240, 255, 0.6); }
.pwa-immersive-result__more { margin-top: 0.4rem; font-size: 0.72rem; color: rgba(226, 240, 255, 0.45); }

.pwa-immersive-result__line {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.3rem 0;
}

.pwa-immersive-result__time {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #67e8f9;
    text-transform: uppercase;
}

.pwa-immersive-result__text { font-size: 0.9rem; color: rgba(240, 248, 255, 0.94); }

/* Linha com checkbox (lista de compras, tarefas, medicação) */
.pwa-immersive-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.4rem;
    border-radius: 0.55rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-immersive-check:hover { background: rgba(255, 255, 255, 0.05); }

.pwa-immersive-check__box {
    flex-shrink: 0;
    width: 1.15rem;
    height: 1.15rem;
    accent-color: #22d3ee;
    cursor: pointer;
}

.pwa-immersive-check__text {
    flex: 1;
    font-size: 0.92rem;
    color: rgba(240, 248, 255, 0.94);
    transition: color 0.2s ease, opacity 0.2s ease;
}

.pwa-immersive-check__text--done {
    color: rgba(226, 240, 255, 0.4);
    text-decoration: line-through;
}

/* Chips de próximos passos no painel imersivo */
.pwa-immersive-result--chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.2rem 0.1rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.pwa-immersive-chip {
    appearance: none;
    border: 1px solid rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.10);
    color: #a5f3fc;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.pwa-immersive-chip:hover { background: rgba(34, 211, 238, 0.2); }
.pwa-immersive-chip:active { transform: scale(0.96); }

.pwa-immersive-check__badge {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(226, 240, 255, 0.7);
}

.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;
    display: block;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Cards deep-link to their domain screen */
a.pwa-immersive-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.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); }
}

/* ═══════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════ */
.dark {
    color-scheme: dark;
}

.dark body {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    color: #e2e8f0;
}

.dark .bg-grid {
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
}

.dark .bg-glow {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.dark .glass-panel {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 27, 75, 0.8) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Dark - Navigation */
.dark .nav-item { color: #94a3b8; }
.dark .nav-item:hover { color: #818cf8; }
.dark .nav-item.active { color: #a5b4fc; }

/* Dark - Cards & Surfaces */
.dark .bg-white { background-color: #1e293b !important; }
.dark .bg-white\/95 { background: rgba(30, 41, 59, 0.95) !important; }
.dark .bg-white\/80 { background: rgba(30, 41, 59, 0.8) !important; }
.dark .bg-white\/60 { background: rgba(30, 41, 59, 0.6) !important; }
.dark .bg-gray-50 { background-color: #0f172a !important; }
.dark .bg-gray-100 { background-color: #1e293b !important; }
.dark .bg-gray-200 { background-color: #334155 !important; }
.dark .hover\:bg-gray-200:hover { background-color: #334155 !important; }
.dark .bg-slate-50 { background-color: #0f172a !important; }
.dark .bg-slate-50\/80,
.dark .bg-slate-50\/70,
.dark .bg-slate-50\/50,
.dark .bg-slate-50\/40,
.dark .bg-slate-50\/30,
.dark .bg-gray-50\/50 {
    background-color: rgba(15, 23, 42, 0.6) !important;
}


/* Dark - Text */
.dark .text-gray-900,
.dark .text-gray-800,
.dark .text-slate-900,
.dark .text-slate-800 { color: #f1f5f9; }
.dark .text-gray-700,
.dark .text-slate-700,
.dark .text-gray-600,
.dark .text-slate-600 { color: #cbd5e1; }
.dark .text-gray-500,
.dark .text-slate-500 { color: #94a3b8; }
.dark .text-gray-400,
.dark .text-slate-400 { color: #64748b; }

/* Dark - Borders */
.dark .border-gray-100,
.dark .border-gray-200,
.dark .border-slate-100,
.dark .border-slate-200,
.dark .border-red-100,
.dark .border-white\/50 { border-color: rgba(99, 102, 241, 0.15); }
.dark .border-white\/70 { border-color: rgba(99, 102, 241, 0.18) !important; }
.dark .border-white\/60 { border-color: rgba(99, 102, 241, 0.15) !important; }
.dark .border-white\/20 { border-color: rgba(99, 102, 241, 0.05) !important; }
.dark .border-white\/10 { border-color: rgba(99, 102, 241, 0.03) !important; }


/* Dark - Inputs */
.dark input, .dark select, .dark textarea {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: rgba(99, 102, 241, 0.2);
    color: #e2e8f0;
}
.dark input::placeholder { color: #475569; }

/* Dark - Prose (chat messages, markdown content) */
.dark .prose { --tw-prose-body: #cbd5e1; --tw-prose-headings: #f1f5f9; --tw-prose-bold: #f1f5f9; --tw-prose-links: #818cf8; }

/* Dark - Header dropdown menus */
.dark .border-b { border-color: rgba(99, 102, 241, 0.15); }

/* Dark - Shadows */
.dark .shadow-lg,
.dark .shadow-xl,
.dark .shadow-2xl {
    --tw-shadow-color: rgba(0, 0, 0, 0.4);
}

/* Dark - Data Cards */
.dark .data-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Dark - Colored 50-level backgrounds (sub-cards, badges, breakdowns) */
.dark .bg-orange-50,
.dark .bg-pink-50,
.dark .bg-indigo-50, .dark .bg-indigo-50\/50,
.dark .bg-cyan-50\/40, .dark .bg-cyan-50\/30, .dark .bg-cyan-50\/20, .dark .bg-cyan-50\/10,
.dark .bg-teal-50, .dark .bg-teal-50\/80,
.dark .bg-purple-50, .dark .bg-purple-50\/50,
.dark .bg-blue-50, .dark .bg-blue-50\/50, .dark .bg-blue-50\/30,
.dark .bg-yellow-50,
.dark .bg-green-50,
.dark .bg-emerald-50\/50,
.dark .bg-amber-50\/50 {
    background-color: rgba(15, 23, 42, 0.6) !important;
}

/* Dark - Voice mode badges keep their distinct colors */
.dark .bg-emerald-50 { background-color: rgba(16, 185, 129, 0.15) !important; }
.dark .bg-cyan-50 { background-color: rgba(8, 145, 178, 0.15) !important; }
.dark .bg-amber-50 { background-color: rgba(245, 158, 11, 0.15) !important; }
.dark .bg-rose-50 { background-color: rgba(244, 63, 94, 0.15) !important; }
.dark .bg-red-50 { background-color: rgba(239, 68, 68, 0.15) !important; }
.dark .bg-red-100 { border-color: rgba(239, 68, 68, 0.2) !important; }


/* Dark - Colored 100-level backgrounds */
.dark .bg-orange-100,
.dark .bg-pink-100,
.dark .bg-emerald-100,
.dark .bg-indigo-100,
.dark .bg-cyan-100,
.dark .bg-teal-100,
.dark .bg-purple-100,
.dark .bg-amber-100,
.dark .bg-red-100,
.dark .bg-blue-100,
.dark .bg-yellow-100,
.dark .bg-rose-100,
.dark .bg-green-100 {
    background-color: rgba(30, 41, 59, 0.6) !important;
}

/* Dark - Colored 200-level backgrounds */
.dark .bg-indigo-200,
.dark .bg-red-200,
.dark .bg-green-200,
.dark .bg-orange-200 {
    background-color: rgba(30, 41, 59, 0.8) !important;
}

/* Dark - Slate UI backgrounds (buttons, badges) */
.dark .bg-slate-100 { background-color: rgba(30, 41, 59, 0.8) !important; }
.dark .bg-slate-200 { background-color: rgba(30, 41, 59, 0.6) !important; }

/* Dark - Gradient overrides via Tailwind v4 CSS custom properties */
.dark .from-indigo-50 { --tw-gradient-from: rgba(30, 27, 75, 0.4) !important; }
.dark .from-cyan-50 { --tw-gradient-from: rgba(8, 145, 178, 0.15) !important; }
.dark .from-emerald-50 { --tw-gradient-from: rgba(6, 78, 59, 0.2) !important; }
.dark .from-purple-50 { --tw-gradient-from: rgba(30, 27, 75, 0.3) !important; }
.dark .from-indigo-100 { --tw-gradient-from: rgba(30, 41, 59, 0.6) !important; }
.dark .from-orange-100 { --tw-gradient-from: rgba(30, 41, 59, 0.5) !important; }
.dark .from-emerald-100 { --tw-gradient-from: rgba(30, 41, 59, 0.5) !important; }
.dark .from-purple-100 { --tw-gradient-from: rgba(30, 41, 59, 0.5) !important; }
.dark .from-yellow-100 { --tw-gradient-from: rgba(30, 41, 59, 0.5) !important; }
.dark .via-white { --tw-gradient-via: rgba(15, 23, 42, 0.6) !important; }
.dark .to-purple-50 { --tw-gradient-to: rgba(30, 27, 75, 0.3) !important; }
.dark .to-indigo-50 { --tw-gradient-to: rgba(30, 27, 75, 0.3) !important; }
.dark .to-teal-50 { --tw-gradient-to: rgba(13, 148, 136, 0.15) !important; }
.dark .to-transparent { --tw-gradient-to: transparent !important; }
.dark .to-indigo-200 { --tw-gradient-to: rgba(99, 102, 241, 0.2) !important; }
.dark .to-red-100 { --tw-gradient-to: rgba(30, 41, 59, 0.5) !important; }
.dark .to-green-100 { --tw-gradient-to: rgba(30, 41, 59, 0.5) !important; }

/* Dark - Borders that use white or colored-100 */
.dark .border-white,
.dark .border-indigo-100,
.dark .border-cyan-100,
.dark .border-emerald-100,
.dark .border-orange-100,
.dark .border-purple-100,
.dark .border-rose-100,
.dark .border-amber-100,
.dark .border-indigo-200,
.dark .border-orange-200,
.dark .border-cyan-200,
.dark .border-purple-200,
.dark .border-rose-200 {
    border-color: rgba(99, 102, 241, 0.15) !important;
}

/* Dark - Progress bar tracks */
.dark .bg-white\/60 { background: rgba(30, 41, 59, 0.6) !important; }

/* Dark - Inline-style gradient cards (finance receita/despesa) — override via specificity */
.dark [style*="background: linear-gradient"][style*="#ffffff"],
.dark [style*="background: linear-gradient"][style*="rgba(236,254,255"],
.dark [style*="background: linear-gradient"][style*="rgba(255,241,242"] {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.8)) !important;
}

/* Dark - Dashed border buttons (add event, add goal) */
.dark .border-dashed {
    border-color: rgba(99, 102, 241, 0.3);
}

/* Dark - Notification badges, tags */
.dark .bg-cyan-50 { background-color: rgba(8, 145, 178, 0.15); }

/* Dark - Score label overrides */
.dark .bg-teal-100.text-teal-700 { background-color: rgba(20, 184, 166, 0.2); color: #5eead4; }
.dark .bg-emerald-100.text-emerald-700 { background-color: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.dark .bg-yellow-100.text-yellow-700 { background-color: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.dark .bg-red-100.text-red-700 { background-color: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* Dark - Finance sub-cards (replaced inline gradient styles) */
.finance-sub-card-income {
    background: linear-gradient(135deg, rgba(236,254,255,1) 0%, #ffffff 100%);
}
.finance-sub-card-expense {
    background: linear-gradient(135deg, rgba(255,241,242,1) 0%, #ffffff 100%);
}
.dark .finance-sub-card-income,
.dark .finance-sub-card-expense {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.8) 100%);
}

/* Dark - Event row gradient */
.dark .event-row {
    background: linear-gradient(to right, rgba(8, 145, 178, 0.1), transparent) !important;
}

/* Dark - Command palette */
.dark [data-command-palette-target="overlay"] > div {
    background-color: #1e293b;
    border-color: rgba(99, 102, 241, 0.3);
}
.dark [data-cmd-item]:hover,
.dark [data-cmd-item].bg-indigo-50 {
    background-color: rgba(99, 102, 241, 0.15);
}
.dark [data-cmd-item] span {
    color: #cbd5e1;
}

/* Dark - Events/Agenda page */
.dark [style*="background: linear-gradient(180deg, #f0fdfa"] {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 30%) !important;
}

/* Dark - Calendar glass panels & partial-opacity whites */
.dark .bg-white\/95 { background: rgba(30, 41, 59, 0.95) !important; }
.dark .bg-white\/85 { background: rgba(30, 41, 59, 0.85) !important; }
.dark .bg-white\/80 { background: rgba(30, 41, 59, 0.8) !important; }
.dark .bg-white\/75 { background: rgba(30, 41, 59, 0.75) !important; }
.dark .bg-white\/70 { background: rgba(30, 41, 59, 0.7) !important; }
.dark .bg-white\/60 { background: rgba(30, 41, 59, 0.6) !important; }
.dark .bg-white\/50 { background: rgba(30, 41, 59, 0.5) !important; }
.dark .bg-white\/40 { background: rgba(30, 41, 59, 0.4) !important; }
.dark .bg-white\/20 { background: rgba(30, 41, 59, 0.2) !important; }
.dark .bg-white\/10 { background: rgba(30, 41, 59, 0.1) !important; }


/* Dark - Calendar hover states */
.dark .hover\:bg-cyan-50\/30:hover { background: rgba(8, 145, 178, 0.1) !important; }
.dark .hover\:bg-cyan-50\/20:hover { background: rgba(8, 145, 178, 0.08) !important; }
.dark .hover\:bg-cyan-50\/10:hover { background: rgba(8, 145, 178, 0.05) !important; }
.dark .hover\:bg-white\/80:hover { background: rgba(30, 41, 59, 0.8) !important; }

/* Dark - Calendar today/active background states */
.dark .bg-cyan-50\/40 { background: rgba(8, 145, 178, 0.12) !important; }
.dark .bg-cyan-50\/30 { background: rgba(8, 145, 178, 0.1) !important; }
.dark .bg-cyan-50\/20 { background: rgba(8, 145, 178, 0.08) !important; }
.dark .bg-slate-50\/40 { background: rgba(15, 23, 42, 0.5) !important; }

/* Dark - Calendar dividers & grid borders */
.dark .divide-slate-200 > :not(:last-child) {
    border-color: rgba(99, 102, 241, 0.12) !important;
}
.dark .divide-y > :not(:last-child) {
    border-color: rgba(99, 102, 241, 0.12) !important;
}
.dark .divide-x > :not(:last-child) {
    border-color: rgba(99, 102, 241, 0.12) !important;
}
.dark .border-slate-200 { border-color: rgba(99, 102, 241, 0.12) !important; }
.dark .border-slate-300 { border-color: rgba(99, 102, 241, 0.15) !important; }

/* Dark - Calendar event badges */
.dark .border-l-4,
.dark .border-l-2 {
    border-left-color: inherit;
}

/* Dark - View switcher active tab */
.dark .bg-white.text-cyan-700 {
    background-color: rgba(8, 145, 178, 0.2) !important;
    color: #67e8f9 !important;
}

/* Dark - Event hover states (delete buttons) */
.dark .hover\:bg-red-50:hover { background-color: rgba(239, 68, 68, 0.15) !important; }
.dark .hover\:bg-cyan-50\/50:hover { background-color: rgba(8, 145, 178, 0.12) !important; }
.dark .hover\:bg-cyan-50:hover { background-color: rgba(8, 145, 178, 0.1) !important; }

/* Respect reduced-motion: ambient/looping effects pause, state changes stay.
   This app is served via jarvis_light.css (see application.html.erb); the
   equivalent block in jarvis_theme.css never actually applies. */
@media (prefers-reduced-motion: reduce) {
    .bg-grid,
    .core-ring,
    .core-center,
    .status-dot,
    .scan-line,
    .animate-bounce,
    .animate-pulse,
    .animate-ping {
        animation: none !important;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
