/* ============================================
   GLOBAL-STYLES.CSS - Estilos Globales IARI
   ============================================
   Estilos base para el dashboard IARI.
   Usa Tailwind CSS via CDN + customizaciones aquí.
   ============================================ */

/* ============================================
   RESET Y BASE
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body, #app {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============================================
   BLAZOR ERROR UI (dark theme)
   ============================================ */

#blazor-error-ui {
    background: #1f2937;
    border-top: 2px solid #ef4444;
    color: #fca5a5;
    bottom: 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    color: #9ca3af;
}

#blazor-error-ui .dismiss:hover {
    color: #f3f4f6;
}

/* ============================================
   ANIMACIONES
   ============================================ */

/* Animación de flotación para el orbe del hero */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Rotación lenta para avatar de Rupy pensando */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 2s linear infinite;
}

/* Animación de pulso para el glow */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.animate-pulse-glow {
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Animación de fade in para modales */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.2s ease-out;
}

/* Animación de scale in para modales */
@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-scaleIn {
    animation: scaleIn 0.2s ease-out;
}

/* Animación de slide in para sidebar */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}

/* Animación de slide in desde la derecha para toasts */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.activity-toast {
    animation: slideInRight 0.3s ease-out;
}

/* Animación de typing dots */
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.typing-dot {
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Slide-up animation for bottom panels (v7 redesign) */
@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

/* Slide-down animation for closing panels */
@keyframes slide-down {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.animate-slide-down {
    animation: slide-down 0.3s ease-out forwards;
}

/* Notification badge pulse animation */
@keyframes notification-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

.notification-badge-pulse {
    animation: notification-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Alternative subtle pulse for questionnaire badges */
@keyframes questionnaire-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.questionnaire-badge-pulse {
    animation: questionnaire-pulse 1.5s ease-in-out infinite;
}

/* Agent working animation (rotating cog effect) */
@keyframes agent-working {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.agent-working-indicator {
    animation: agent-working 2s linear infinite;
}

/* Agent card glow effect when active */
@keyframes agent-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.2);
    }
}

.agent-card-active {
    animation: agent-glow 2s ease-in-out infinite;
}

/* ============================================
   SCROLLBAR PERSONALIZADA (Dark Theme)
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Scrollbar más sutil para contenido principal */
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
}

/* ============================================
   UTILIDADES ADICIONALES
   ============================================ */

/* Line clamp para texto truncado */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Backdrop blur (fallback para navegadores antiguos) */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ============================================
   TIPOGRAFÍA PROSE (para artefactos - dark theme)
   ============================================ */

/* prose styles now handled by @tailwindcss/typography plugin
   loaded via CDN: ?plugins=typography
   Use: prose prose-sm prose-slate dark:prose-invert */

.prose ol, .prose-invert ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Code blocks (from Markdig) */
.prose pre, .prose-invert pre {
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    border: 1px solid var(--border-primary);
}

.prose code, .prose-invert code {
    background: var(--surface-hover);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    color: #ec4899;
}

.prose pre code, .prose-invert pre code {
    background: transparent;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Tables */
.prose table, .prose-invert table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.prose th, .prose-invert th,
.prose td, .prose-invert td {
    border: 1px solid var(--border-primary);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.prose th, .prose-invert th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

/* Blockquotes */
.prose blockquote, .prose-invert blockquote {
    border-left: 4px solid var(--iari-purple);
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Links */
.prose a, .prose-invert a {
    color: var(--iari-purple);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover, .prose-invert a:hover {
    color: var(--iari-pink);
}

/* Horizontal rules */
.prose hr, .prose-invert hr {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 1.5rem 0;
}

/* Strong/Bold */
.prose strong, .prose-invert strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Emphasis/Italic */
.prose em, .prose-invert em {
    font-style: italic;
}

/* Task lists (from Markdig) */
.prose input[type="checkbox"], .prose-invert input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--iari-purple);
}

/* max-w-none utility to override max-width */
.max-w-none {
    max-width: none;
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */

*:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* ============================================
   GRADIENTES REUTILIZABLES
   ============================================ */

.gradient-purple-pink {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.gradient-blue-cyan {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.gradient-orange-red {
    background: linear-gradient(135deg, #f97316, #ef4444);
}

.gradient-green-teal {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

/* ============================================
   GLOW EFFECTS
   ============================================ */

.glow-purple {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3),
                0 0 40px rgba(139, 92, 246, 0.2),
                0 0 60px rgba(139, 92, 246, 0.1);
}

.glow-blue {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3),
                0 0 40px rgba(59, 130, 246, 0.2),
                0 0 60px rgba(59, 130, 246, 0.1);
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   THEME SYSTEM - CSS Variables
   ============================================
   Light mode is default. Dark mode activates
   when .dark class is on :root (html element)
   ============================================ */

/* Light Mode (Default) - Aligned with POC v7 */
:root {
    /* Backgrounds - Slate palette from POC v7 */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-quaternary: #cbd5e1;

    /* Text - Slate palette */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --text-quaternary: #94a3b8;

    /* Borders */
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --border-tertiary: #94a3b8;

    /* Surfaces */
    --surface-card: #ffffff;
    --surface-modal: #ffffff;
    --surface-input: #f8fafc;
    --surface-hover: #f1f5f9;
    --surface-elevated: #ffffff;

    /* Scrollbar */
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;

    /* Shadows */
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Brand colors (same for both themes) */
    --iari-purple: #8b5cf6;
    --iari-pink: #ec4899;
    --iari-blue: #3b82f6;
    --iari-cyan: #06b6d4;

    /* Badge Colors - Project Types */
    --badge-greenfield-bg: #d1fae5;      /* emerald-100 */
    --badge-greenfield-text: #065f46;    /* emerald-800 */
    --badge-greenfield-border: #6ee7b7;  /* emerald-300 */
    --badge-brownfield-bg: #dbeafe;      /* blue-100 */
    --badge-brownfield-text: #1e40af;    /* blue-800 */
    --badge-brownfield-border: #93c5fd;  /* blue-300 */
    --badge-modernization-bg: #ffedd5;   /* orange-100 */
    --badge-modernization-text: #9a3412; /* orange-800 */
    --badge-modernization-border: #fdba74; /* orange-300 */
    --badge-default-bg: #f3f4f6;         /* gray-100 */
    --badge-default-text: #1f2937;       /* gray-800 */
    --badge-default-border: #d1d5db;     /* gray-300 */
}

/* Dark Mode */
/* Dark Mode - Aligned with POC v7 (Slate palette) */
:root.dark {
    /* Backgrounds - Slate palette from POC v7 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-quaternary: #475569;

    /* Text - Slate palette */
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #94a3b8;
    --text-quaternary: #64748b;

    /* Borders - Slate palette */
    --border-primary: #334155;
    --border-secondary: #475569;
    --border-tertiary: #64748b;

    /* Surfaces - Slate palette */
    --surface-card: #1e293b;
    --surface-modal: #1e293b;
    --surface-input: #334155;
    --surface-hover: #334155;
    --surface-elevated: #1e1e2a;

    /* Scrollbar */
    --scrollbar-track: #1a1a24;
    --scrollbar-thumb: #3d3d4d;
    --scrollbar-thumb-hover: #4d4d5d;

    /* Shadows */
    --shadow-color: rgba(0, 0, 0, 0.5);

    /* Badge Colors - Project Types */
    --badge-greenfield-bg: rgba(5, 150, 105, 0.2);
    --badge-greenfield-text: #6ee7b7;
    --badge-greenfield-border: rgba(5, 150, 105, 0.4);
    --badge-brownfield-bg: rgba(37, 99, 235, 0.2);
    --badge-brownfield-text: #93c5fd;
    --badge-brownfield-border: rgba(37, 99, 235, 0.4);
    --badge-modernization-bg: rgba(234, 88, 12, 0.2);
    --badge-modernization-text: #fdba74;
    --badge-modernization-border: rgba(234, 88, 12, 0.4);
    --badge-default-bg: rgba(75, 85, 99, 0.2);
    --badge-default-text: #d1d5db;
    --badge-default-border: rgba(75, 85, 99, 0.4);
}

/* Theme transition for smooth switching */
*, *::before, *::after {
    transition: background-color 0.15s ease-out,
                border-color 0.15s ease-out,
                color 0.15s ease-out,
                box-shadow 0.15s ease-out;
}

/* Disable transitions on page load */
.no-transitions, .no-transitions * {
    transition: none !important;
}

/* IARI Utility Classes (Theme-aware) */
.bg-theme-primary { background-color: var(--bg-primary); }
.bg-theme-secondary { background-color: var(--bg-secondary); }
.bg-theme-tertiary { background-color: var(--bg-tertiary); }
.bg-theme-card { background-color: var(--surface-card); }
.bg-theme-input { background-color: var(--surface-input); }
.bg-theme-hover { background-color: var(--surface-hover); }

.text-theme-primary { color: var(--text-primary); }
.text-theme-secondary { color: var(--text-secondary); }
.text-theme-tertiary { color: var(--text-tertiary); }

.border-theme-primary { border-color: var(--border-primary); }
.border-theme-secondary { border-color: var(--border-secondary); }

/* Legacy aliases for backwards compatibility */
.bg-iari-dark { background-color: var(--bg-primary); }
.bg-iari-surface { background-color: var(--bg-secondary); }
.border-iari-border { border-color: var(--border-primary); }
.text-iari-purple { color: var(--iari-purple); }
.text-iari-pink { color: var(--iari-pink); }
.text-iari-blue { color: var(--iari-blue); }
.text-iari-cyan { color: var(--iari-cyan); }

/* ============================================
   BADGE UTILITY CLASSES (Project Types)
   ============================================ */

.badge-greenfield {
    background-color: var(--badge-greenfield-bg);
    color: var(--badge-greenfield-text);
    border: 1px solid var(--badge-greenfield-border);
}

.badge-brownfield {
    background-color: var(--badge-brownfield-bg);
    color: var(--badge-brownfield-text);
    border: 1px solid var(--badge-brownfield-border);
}

.badge-modernization {
    background-color: var(--badge-modernization-bg);
    color: var(--badge-modernization-text);
    border: 1px solid var(--badge-modernization-border);
}

.badge-default {
    background-color: var(--badge-default-bg);
    color: var(--badge-default-text);
    border: 1px solid var(--badge-default-border);
}

/* ============================================
   BOTTOM NAV & SLIDE-UP PANELS (v7 Redesign)
   ============================================ */

/* Panel backdrop */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
}

/* Panel container */
.panel-container {
    background: var(--bg-secondary);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px var(--shadow-color);
    /* Smooth transform transitions for interactive feel */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

/* Panel hover effect (subtle lift) */
.panel-container:hover {
    box-shadow: 0 -6px 24px var(--shadow-color);
}

/* Panel drag handle (visual indicator for swipe-to-close) */
.panel-drag-handle {
    width: 40px;
    height: 4px;
    background-color: var(--border-tertiary);
    border-radius: 2px;
    margin: 8px auto 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    /* Larger touch targets on mobile */
    .bottom-nav-button {
        min-width: 64px;
        min-height: 64px;
    }

    /* Full width panels on mobile */
    .panel-container {
        border-radius: 1rem 1rem 0 0;
    }
}

@media (min-width: 768px) {
    /* iPad portrait and up */
    .panel-container {
        max-height: 50vh;
        margin: 0 auto;
        max-width: 640px;
        border-radius: 1rem;
        bottom: 70px !important;
    }

    /* Center the bottom nav items with more spacing */
    .bottom-nav {
        justify-content: center;
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    /* Desktop */
    .panel-container {
        max-height: 40vh;
        max-width: 720px;
    }
}

@media (min-width: 1280px) {
    /* Large desktop */
    .panel-container {
        max-width: 800px;
    }
}

/* Additional theme variables for v7 - Aligned with POC */
:root {
    --accent-primary: #8b5cf6;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --text-muted: #94a3b8;
    --bg-hover: #e2e8f0;
    --border-color: #e2e8f0;
}

:root.dark {
    --accent-primary: #8b5cf6;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --text-muted: #64748b;
    --bg-hover: #334155;
    --border-color: #334155;
}

/* ============================================
   v8 SLIDE PANEL SYSTEM
   ============================================ */

.slide-panel {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
.slide-panel.is-open {
    transform: translateX(0) !important;
    opacity: 1;
}

.slide-detail {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}
.slide-detail.is-visible {
    transform: translateX(0) !important;
    opacity: 1;
}

.chat-fade {
    transition: opacity 0.25s ease, filter 0.25s ease;
}
.chat-fade.dimmed {
    opacity: 0.15;
    filter: blur(2px);
    pointer-events: none;
}

/* FAB hover */
.fab-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.fab-btn:hover {
    transform: translateY(-2px);
}

/* Rupy avatar — spinning ring when thinking */
@keyframes rupy-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.rupy-ring-spin {
    animation: rupy-spin 2s linear infinite;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.4));
}

/* Typing dots bounce */
@keyframes rupy-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}
.rupy-dot {
    animation: rupy-bounce 1.2s ease-in-out infinite;
}

/* Shimmer bar */
@keyframes rupy-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.rupy-shimmer {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-primary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: rupy-shimmer 1.5s ease-in-out infinite;
}

/* Sombrero dropdown animation */
@keyframes sombrero-pop-up {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.sombrero-dropdown {
    animation: sombrero-pop-up 0.15s ease-out forwards;
}

/* ============================================
   QUICK START v2 — note-taking + composer
   ============================================ */

/* Floating pill action button */
.float-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.float-btn button {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.float-btn button:hover {
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
}
:root.dark .float-btn button {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}
:root.dark .float-btn button:hover {
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.5);
}
.float-btn button:active {
    transform: scale(0.97);
}

/* Note-style borderless textarea */
.note-textarea {
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    width: 100%;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
    caret-color: #7c3aed;
}
.note-textarea::placeholder { color: var(--text-tertiary); }

/* Chat composer input (inside rounded pill bar) */
.composer-input {
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    color: var(--text-primary);
    font-size: 13px;
}
.composer-input::placeholder { color: var(--text-tertiary); }

/* Card entrance animation */
@keyframes qs-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.qs-card {
    animation: qs-card-in 0.25s ease forwards;
    opacity: 0;
}

/* Inline description textarea (inside expandable cards) */
.qs-desc {
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    width: 100%;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}
.qs-desc::placeholder { color: var(--text-tertiary); opacity: 0.5; }

/* Activity FAB + popover (Components/Playground/ActivityFab + ActivityFloatingPanel) */

.activity-fab {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-card);
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease,
                background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease;
}
.activity-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.activity-fab.fab-has-unread {
    color: var(--iari-purple);
    border-color: rgba(139, 92, 246, 0.4);
    animation: fab-micro-pulse 4s ease-in-out infinite;
}
.activity-fab.fab-active {
    background: var(--iari-purple);
    color: white;
    border-color: var(--iari-purple);
    animation: none;
}

.fab-pulse-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--iari-purple);
    opacity: 0;
    pointer-events: none;
    animation: fab-ring-expand 0.7s ease-out;
}

.activity-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--iari-purple);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}
.activity-badge.fab-badge-bounce {
    animation: fab-badge-bounce 0.4s ease;
}

.activity-toast {
    position: absolute;
    bottom: 64px;
    right: 0;
    min-width: 240px;
    max-width: 340px;
    background: var(--surface-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 39;
    display: flex;
    align-items: center;
    gap: 10px;
}
.activity-toast.activity-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.activity-popover {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 380px;
    max-height: min(520px, 70vh);
    background: var(--surface-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform-origin: bottom right;
    transform: scale(0.92) translateY(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.activity-popover.activity-popover-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ArtifactPanel — modal flotante bloqueante (95vw x 95vh centrado).
   El backdrop cubre todo (incl. slide panels z-40 y activity-popover z-50),
   impidiendo abrir otro artefacto mientras hay uno en render. */
.artifact-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}
.artifact-backdrop.artifact-backdrop-open {
    opacity: 1;
    pointer-events: auto;
}

.artifact-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 95vw;
    height: 95vh;
    transform: translate(-50%, -50%) scale(0.96);
    background: var(--surface-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    z-index: 70;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.artifact-popover.artifact-popover-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

@keyframes fab-ring-expand {
    0%   { transform: scale(1);   opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}
@keyframes fab-micro-pulse {
    0%, 90%, 100% { transform: scale(1); }
    95%           { transform: scale(1.05); }
}
@keyframes fab-badge-bounce {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.3); }
}
