/* ==========================================================================
   J.A.R.V.I.S. / LYRA MOBILE FIRST - TEMA OFICIAL: SOMBRA AMATISTA
   ========================================================================== */

:root {
    /* ==========================================
       DESIGN TOKENS - LYRA: SOMBRA AMATISTA
       ========================================== */
    --lyra-bg-dark: #0D0B14;        /* Fondo general (Obsidiana Violeta) */
    --lyra-panel-bg: #36195E;       /* Superficies, contenedores y paneles secundarios */
    --lyra-primary: #7B2CBF;        /* Color primario de acción, botones y elementos activos */
    
    /* Estados e Iluminación */
    --lyra-accent-glow: #C77DFF;    /* Halos de voz, bordes activos, partículas y destellos */
    --lyra-hover: #8A2BE2;          /* Estado hover de elementos interactivos */
    
    /* Textos y Bordes */
    --lyra-text-main: #F4EEF8;      /* Texto principal de alta legibilidad */
    --lyra-text-muted: #BCA0DC;     /* Texto secundario / subtítulos */
    --lyra-border: rgba(123, 44, 191, 0.3); /* Bordes sutiles con brillo violeta */

    /* Mapeo de compatibilidad para estilos móviles */
    --m-bg-base: var(--lyra-bg-dark);
    --m-bg-surface: #1E0D38;
    --m-bg-card: rgba(54, 25, 94, 0.6);
    --m-bg-card-active: #4E2082;
    
    --m-cyan: var(--lyra-accent-glow);
    --m-cyan-glow: rgba(199, 125, 255, 0.4);
    --m-cyan-subtle: rgba(123, 44, 191, 0.22);
    --m-blue: var(--lyra-primary);
    --m-purple: var(--lyra-hover);
    --m-emerald: #10B981;
    --m-amber: #F59E0B;
    --m-rose: #EC4899;

    --m-text-primary: var(--lyra-text-main);
    --m-text-secondary: var(--lyra-text-muted);
    --m-text-muted: #9578B5;

    --m-border: var(--lyra-border);
    --m-border-glow: rgba(199, 125, 255, 0.4);

    --m-header-h: 56px;
    --m-nav-h: 60px;

    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
}

/* Reset táctil */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: var(--lyra-bg-dark);
    color: var(--lyra-text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    overflow: hidden;
    touch-action: manipulation;
}

.m-app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: radial-gradient(circle at 50% 0%, #36195E 0%, #0D0B14 85%);
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   HEADER SUPERIOR MÓVIL
   ========================================================================== */
.m-header {
    height: calc(var(--m-header-h) + var(--sat));
    padding-top: var(--sat);
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    background: rgba(30, 13, 56, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--lyra-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 50;
}

.m-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.m-arc-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--lyra-accent-glow);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-arc-core {
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffffff;
}

.m-brand {
    display: flex;
    flex-direction: column;
}

.m-brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
}

.m-conn-badge {
    font-size: 0.6rem;
    font-weight: 700;
}
.m-conn-badge.online { color: var(--m-emerald); }
.m-conn-badge.offline { color: var(--m-rose); }

.m-header-center {
    display: flex;
    align-items: center;
}

.m-mode-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--m-cyan-subtle);
    border: 1px solid var(--m-border-glow);
    border-radius: 9999px;
    color: var(--m-cyan);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}

.m-mode-pill:active {
    background: rgba(0, 240, 255, 0.25);
}

.m-header-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.m-icon-btn {
    background: transparent;
    border: none;
    color: var(--m-text-secondary);
    font-size: 1.1rem;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.m-icon-btn:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   CONTENIDO PRINCIPAL & TABS
   ========================================================================== */
.m-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.m-tab-view {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.m-tab-view.active {
    display: flex !important;
}

/* ==========================================================================
   CHAT MÓVIL
   ========================================================================== */
.m-chat-mode-filter-bar {
    padding: 0.35rem 0.65rem;
    background: rgba(18, 10, 32, 0.85);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    z-index: 5;
}

.m-chat-mode-pills {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
}

.m-chat-mode-pills::-webkit-scrollbar {
    display: none;
}

.m-chat-mode-pill {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--m-text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    user-select: none;
    transition: all 0.2s ease;
}

.m-chat-mode-pill.active {
    background: rgba(0, 240, 255, 0.2);
    color: var(--m-cyan);
    border-color: var(--m-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.m-chat-mode-pill-badge {
    font-size: 0.65rem;
    padding: 0 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}

.chat-history-loader-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.4rem 0;
    width: 100%;
}

.btn-load-earlier {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--m-cyan);
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-load-earlier:disabled {
    opacity: 0.6;
}

.chat-history-start {
    font-size: 0.72rem;
    color: var(--m-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.message-mode-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 6px;
    border: 1px solid var(--m-cyan);
    color: var(--m-cyan);
    background: rgba(0, 240, 255, 0.08);
    margin-left: 0.35rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.m-messages-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: auto;
    overflow-anchor: none;
}

.m-welcome-card {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--m-bg-card);
    border: 1px solid var(--m-border);
    border-radius: 16px;
    margin: auto 0;
}

.m-welcome-reactor {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--m-cyan);
    box-shadow: 0 0 16px var(--m-cyan-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.m-reactor-pulse {
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 12px var(--m-cyan);
    animation: m-pulse 2s infinite ease-in-out;
}

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

.m-welcome-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.m-welcome-card p {
    color: var(--m-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.m-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.m-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--m-border);
    border-radius: 12px;
    color: var(--m-text-primary);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.m-chip:active {
    background: var(--m-cyan-subtle);
    border-color: var(--m-border-glow);
}

.m-chip i {
    color: var(--m-cyan);
    font-size: 1rem;
}

/* Mensajes */
.m-messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.m-msg-row {
    display: flex;
    gap: 0.65rem;
    width: 100%;
}

.m-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.m-msg-row.user .m-msg-avatar {
    background: linear-gradient(135deg, var(--lyra-primary), var(--lyra-hover));
    color: #ffffff;
    box-shadow: 0 0 10px rgba(123, 44, 191, 0.4);
}

.m-msg-row.assistant .m-msg-avatar {
    background: var(--lyra-panel-bg);
    border: 1.5px solid var(--lyra-accent-glow);
    color: var(--lyra-accent-glow);
    box-shadow: 0 0 12px rgba(199, 125, 255, 0.45);
}

.m-msg-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.m-msg-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--lyra-text-muted);
}

.m-msg-sender {
    font-weight: 600;
}
.m-msg-row.assistant .m-msg-sender { color: var(--lyra-accent-glow); }
.m-msg-row.user .m-msg-sender { color: var(--lyra-text-muted); }

.m-msg-bubble {
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.m-msg-row.user .m-msg-bubble {
    background: rgba(123, 44, 191, 0.35);
    border: 1px solid var(--lyra-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top-right-radius: 3px;
    margin-left: auto;
    max-width: 90%;
    color: var(--lyra-text-main);
}

.m-msg-row.assistant .m-msg-bubble {
    background: var(--lyra-panel-bg);
    background: linear-gradient(145deg, rgba(54, 25, 94, 0.8) 0%, rgba(30, 13, 56, 0.9) 100%);
    border: 1px solid var(--lyra-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top-left-radius: 3px;
    color: var(--lyra-text-main);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Toolbar de acciones en mensajes móviles */
.m-msg-actions-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.m-msg-row.user .m-msg-actions-toolbar {
    justify-content: flex-end;
}

.m-msg-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--m-text-secondary);
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 500;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    touch-action: manipulation;
}

.m-msg-action-btn:active {
    background: var(--m-cyan-subtle);
    color: var(--m-cyan);
    border-color: var(--m-border-glow);
}

.m-msg-action-btn.copied {
    color: var(--m-emerald) !important;
    border-color: var(--m-emerald) !important;
    background: rgba(0, 255, 136, 0.1) !important;
}

.m-msg-bubble p { margin-bottom: 0.5rem; }
.m-msg-bubble p:last-child { margin-bottom: 0; }
.m-msg-bubble pre {
    background: #04060a;
    border: 1px solid var(--m-border);
    border-radius: 6px;
    padding: 0.65rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    margin: 0.5rem 0;
}
.m-msg-bubble code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--m-cyan);
}
.m-msg-bubble pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
}

/* Indicador de typing */
.m-typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    background: var(--m-bg-card);
    border: 1px solid var(--m-border-glow);
    border-radius: 9999px;
    width: fit-content;
    font-size: 0.75rem;
    color: var(--m-cyan);
}

.m-dots {
    display: flex;
    gap: 3px;
}
.m-dots span {
    width: 5px;
    height: 5px;
    background: var(--m-cyan);
    border-radius: 50%;
    animation: m-bounce 1.4s infinite ease-in-out;
}
.m-dots span:nth-child(1) { animation-delay: 0s; }
.m-dots span:nth-child(2) { animation-delay: 0.2s; }
.m-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes m-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Barra de Adjuntos */
.m-attached-bar {
    padding: 0.45rem 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid var(--m-border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.m-attached-title {
    font-size: 0.7rem;
    color: var(--m-text-muted);
}

.m-attached-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.m-file-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem;
    background: var(--m-bg-card);
    border: 1px solid var(--m-border-glow);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--m-cyan);
}

/* Barra de Entrada de Chat */
.m-chat-input-bar {
    padding: 0.5rem 0.75rem;
    background: rgba(14, 20, 34, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--m-border);
    flex-shrink: 0;
}

.m-input-box {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #121a2d;
    border: 1px solid var(--m-border);
    border-radius: 24px;
    padding: 0.3rem 0.5rem;
}

.m-input-box:focus-within {
    border-color: var(--m-cyan);
}

.m-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.3;
    max-height: 100px;
    resize: none;
    padding: 0.35rem 0.2rem;
}

.m-textarea::placeholder {
    color: var(--m-text-muted);
}

.m-input-action-btn {
    background: transparent;
    border: none;
    color: var(--m-text-secondary);
    font-size: 1.15rem;
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.m-input-action-btn:active {
    color: var(--m-cyan);
}

.m-input-action-btn.recording {
    color: var(--m-rose);
    animation: m-record-pulse 1s infinite;
}

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

.m-send-action-btn {
    background: linear-gradient(135deg, var(--m-cyan), #00a2ff);
    color: #04060a;
    border: none;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 0 10px var(--m-cyan-glow);
    touch-action: manipulation;
}

.m-send-action-btn:active {
    transform: scale(0.92);
}

/* ==========================================================================
   PANTALLAS DE MÓDULOS (AGENDA, ARCHIVOS, MEMORIAS, AJUSTES)
   ========================================================================== */
.m-module-screen {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.m-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.m-screen-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.m-subtext {
    font-size: 0.8rem;
    color: var(--m-text-secondary);
    flex-shrink: 0;
}

.m-filter-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    width: 100%;
    min-height: 42px;
    padding: 0.25rem 0.15rem 0.5rem 0.15rem;
    scrollbar-width: none;
}

.m-filter-scroll::-webkit-scrollbar {
    display: none;
}

.m-filter-pill {
    padding: 0.45rem 1rem;
    min-height: 38px;
    height: 38px;
    background: var(--m-bg-card);
    border: 1px solid var(--m-border);
    border-radius: 9999px;
    color: var(--m-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}


.m-filter-pill.active {
    background: var(--lyra-primary);
    color: var(--lyra-text-main);
    font-weight: 700;
    border-color: var(--lyra-accent-glow);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.4);
}

.m-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}


.m-card {
    background: var(--lyra-panel-bg);
    background: linear-gradient(145deg, rgba(54, 25, 94, 0.65) 0%, rgba(26, 12, 48, 0.8) 100%);
    border: 1px solid var(--lyra-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    color: var(--lyra-text-main);
}

.m-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.m-card-desc {
    font-size: 0.85rem;
    color: var(--m-text-secondary);
    line-height: 1.4;
}

.m-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--m-text-muted);
    border-top: 1px solid var(--m-border);
    padding-top: 0.5rem;
}

.m-upload-cta {
    background: rgba(0, 240, 255, 0.05);
    border: 1.5px dashed var(--m-cyan);
    border-radius: 14px;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--m-cyan);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    touch-action: manipulation;
}

.m-upload-cta i { font-size: 2rem; }
.m-upload-cta span { font-size: 0.85rem; font-weight: 500; }

.m-search-bar {
    position: relative;
    display: flex;
    align-items: center;
}
.m-search-bar i {
    position: absolute;
    left: 0.85rem;
    color: var(--m-text-muted);
}
.m-search-bar input {
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 0.85rem 0.65rem 2.4rem;
    background: var(--m-bg-card);
    border: 1px solid var(--m-border);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.85rem;
    outline: none;
}
.m-search-bar input:focus { border-color: var(--m-cyan); }

.m-diag-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--m-text-secondary);
    padding: 0.3rem 0;
}
.m-status-text { font-weight: 700; color: var(--m-emerald); font-family: 'JetBrains Mono', monospace; }

/* Botones */

.m-btn-primary {
    background: linear-gradient(135deg, var(--lyra-primary), var(--lyra-hover));
    color: var(--lyra-text-main);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.4);
    border: none;
    border-radius: 12px;
    min-height: 44px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s ease;
}
.m-btn-primary:active {
    background: var(--lyra-hover);
    box-shadow: 0 0 20px rgba(199, 125, 255, 0.6);
    transform: scale(0.98);
}

.m-btn-primary-sm {
    background: var(--lyra-primary);
    color: var(--lyra-text-main);
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.35);
    border: none;
    border-radius: 8px;
    min-height: 36px;
    padding: 0.3rem 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    touch-action: manipulation;
}

.m-btn-secondary {
    background: rgba(54, 25, 94, 0.5);
    color: var(--lyra-text-main);
    border: 1px solid var(--lyra-border);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    min-height: 42px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s ease;
}
.m-btn-secondary:active {
    background: var(--lyra-panel-bg);
    border-color: var(--lyra-accent-glow);
    box-shadow: 0 0 12px rgba(199, 125, 255, 0.3);
}

.m-btn-block { width: 100%; }

.m-desktop-switch-btn {
    color: var(--m-cyan);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

/* ==========================================================================
   BARRA INFERIOR DE NAVEGACIÓN (BOTTOM NAV)
   ========================================================================== */

.m-bottom-nav {
    height: calc(var(--m-nav-h) + var(--sab));
    padding-bottom: var(--sab);
    background: rgba(22, 10, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--lyra-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-shrink: 0;
    z-index: 50;
}

.m-bnav-item {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--lyra-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    touch-action: manipulation;
}

.m-bnav-item i {
    font-size: 1.15rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.m-bnav-item.active {
    color: var(--lyra-accent-glow);
    font-weight: 700;
}

.m-bnav-item.active i {
    color: var(--lyra-accent-glow);
    transform: translateY(-2px);
    text-shadow: 0 0 12px var(--lyra-accent-glow);
}

.m-bnav-badge {
    position: absolute;
    top: 6px;
    right: 25%;
    background: var(--lyra-primary);
    color: var(--lyra-text-main);
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 0 8px rgba(199, 125, 255, 0.6);
}

/* ==========================================================================
   BOTTOM SHEETS & MODALES TÁCTILES
   ========================================================================== */
.m-bottom-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    animation: m-fade-in 0.2s ease;
}

.m-bottom-sheet-backdrop.hidden {
    display: none !important;
}

@keyframes m-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.m-bottom-sheet {
    width: 100%;
    max-height: 85vh;
    background: var(--m-bg-surface);
    border: 1px solid var(--m-border-glow);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--sab);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
    animation: m-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes m-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.m-sheet-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--m-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.m-sheet-header h3 {
    font-size: 1.05rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.m-sheet-close {
    background: transparent;
    border: none;
    color: var(--m-text-secondary);
    font-size: 1.15rem;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.m-sheet-body {
    padding: 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.m-sheet-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--m-bg-card);
    border: 1px solid var(--m-border);
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    touch-action: manipulation;
}
.m-sheet-item:active {
    background: var(--m-bg-card-active);
    border-color: var(--m-cyan);
}

.m-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.m-form-group label {
    font-size: 0.8rem;
    color: var(--m-text-secondary);
}
.m-form-input {
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 0.85rem;
    background: var(--m-bg-card);
    border: 1px solid var(--m-border);
    border-radius: 10px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}
.m-form-input:focus { border-color: var(--m-cyan); }

/* Toasts */
.m-toast-container {
    position: fixed;
    top: calc(var(--m-header-h) + var(--sat) + 10px);
    left: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
    pointer-events: none;
}

.m-toast {
    background: var(--m-bg-surface);
    border: 1px solid var(--m-cyan);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    pointer-events: auto;
    animation: m-toast-in 0.25s ease;
}

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

.m-toast.success i { color: var(--m-emerald); }
.m-toast.error i { color: var(--m-rose); }
.m-toast.info i { color: var(--m-cyan); }

/* Helpers */
.text-cyan { color: var(--m-cyan) !important; }
.text-success { color: var(--m-emerald) !important; }
.text-danger { color: var(--m-rose) !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.hidden { display: none !important; }
.m-hidden-input { display: none !important; }

.m-loading {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--m-text-muted);
    font-size: 0.85rem;
}
.m-loading i { font-size: 1.3rem; color: var(--m-cyan); margin-bottom: 0.5rem; display: block; }

/* YOUTUBE EMBED PLAYER COMPONENT (MOBILE) */
.yt-player-card {
    margin-top: 0.75rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.yt-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    background: rgba(30, 41, 59, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.yt-player-title-box {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
}

.yt-player-icon {
    color: #ff0000;
    font-size: 1rem;
}

.yt-player-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.yt-player-link {
    color: var(--m-cyan);
    font-size: 0.75rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.yt-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background: #000;
}

.yt-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   MENÚ DESPLEGABLE LATERAL IZQUIERDO (SIDEBAR DRAWER MÓVIL)
   ========================================================================== */
.m-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 14, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.m-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.m-sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    height: 100%;
    height: 100dvh;
    background: #0b111e;
    background: linear-gradient(180deg, #0e1628 0%, #070b14 100%);
    border-right: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
    z-index: 210;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.m-drawer-backdrop.open .m-sidebar-drawer {
    transform: translateX(0);
}

.m-drawer-header {
    padding: calc(var(--sat) + 1rem) 1.1rem 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--m-border);
    background: rgba(14, 22, 40, 0.5);
}

.m-drawer-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.m-drawer-brand .m-brand-name {
    font-size: 1.15rem;
}

.m-drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--m-border);
    color: var(--m-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
}

.m-drawer-close-btn:active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.m-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.m-drawer-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--m-text-muted);
    padding: 0.65rem 0.75rem 0.35rem;
}

.m-drawer-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.85rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--m-text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    touch-action: manipulation;
}

.m-drawer-item i.m-drawer-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    color: var(--m-text-muted);
    transition: color 0.18s ease;
}

.m-drawer-item span {
    flex: 1;
}

.m-drawer-item .m-drawer-badge {
    background: var(--m-cyan);
    color: #04060a;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
}

.m-drawer-item:hover, .m-drawer-item:active {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.m-drawer-item:active i.m-drawer-icon {
    color: var(--m-cyan);
}

.m-drawer-item.active {
    background: rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.35);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.15);
}

.m-drawer-item.active i.m-drawer-icon {
    color: var(--m-cyan);
    text-shadow: 0 0 8px var(--m-cyan-glow);
}

.m-drawer-footer {
    padding: 0.85rem;
    border-top: 1px solid var(--m-border);
    background: rgba(8, 12, 22, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.m-drawer-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--m-text-secondary);
}

.m-drawer-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--m-emerald);
    box-shadow: 0 0 8px var(--m-emerald);
}

/* ==========================================================================
   ESTILOS ESPECÍFICOS PARA MÚSICA MÓVIL
   ========================================================================== */
.m-music-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.m-music-toolbar .m-btn-secondary {
    flex: 1 1 calc(33% - 0.45rem);
    min-height: 38px;
    font-size: 0.74rem;
    padding: 0.35rem 0.5rem;
}

/* Grilla de 2 canciones por fila sin páginas */
#m-music-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    padding-bottom: 2rem !important;
}


.m-music-card {
    background: var(--lyra-panel-bg);
    background: linear-gradient(160deg, rgba(54, 25, 94, 0.8) 0%, rgba(26, 12, 48, 0.9) 100%);
    border: 1px solid var(--lyra-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.m-music-card:active {
    border-color: var(--lyra-accent-glow);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.4);
    transform: scale(0.98);
}

.m-music-thumb-row {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #140824;
    overflow: hidden;
}

.m-music-thumb-row img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m-music-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--lyra-primary);
    color: var(--lyra-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.5);
    transition: transform 0.15s ease, background 0.15s ease;
}

.m-music-play-btn:active {
    transform: translate(-50%, -50%) scale(0.92);
    background: var(--lyra-hover);
}

.m-music-details {
    padding: 0.55rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.m-music-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--lyra-text-main);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2rem;
}

.m-music-artist {
    font-size: 0.7rem;
    color: var(--lyra-text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-music-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.15rem;
}

.m-music-tag {
    font-size: 0.6rem;
    background: rgba(123, 44, 191, 0.25);
    color: var(--lyra-accent-glow);
    border: 1px solid var(--lyra-border);
    border-radius: 6px;
    padding: 1px 5px;
}

.m-music-tag.yt-import {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

.m-music-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(123, 44, 191, 0.25);
    gap: 0.2rem;
    flex-wrap: wrap;
}

/* Ocultar paginador: vista única y continua sin páginas */
.m-music-pagination,
#m-music-pagination {
    display: none !important;
}


/* WIDGET DE CUOTA R2 & AUDIO PLAYER MÓVIL */
.r2-quota-widget {
    background: #0f1629;
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.r2-quota-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.r2-quota-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--m-text-primary);
}

.r2-quota-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background: rgba(0, 240, 255, 0.15);
    color: var(--m-cyan);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.r2-quota-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

.r2-quota-bar-bg {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.r2-quota-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--m-cyan), #00a2ff);
    border-radius: 4px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px var(--m-cyan-glow);
}

.r2-quota-bar-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.r2-quota-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--m-text-muted);
}

.m-r2-audio-card {
    background: #0f1629;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    margin-top: 0.5rem;
}

.m-r2-player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.m-r2-player-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.m-r2-player-artist {
    font-size: 0.72rem;
    color: var(--m-cyan);
}

.m-r2-audio-element {
    width: 100%;
    height: 36px;
    filter: invert(1) hue-rotate(180deg);
    border-radius: 18px;
    outline: none;
}

.r2-mode-toggle-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--m-cyan, #38bdf8);
    padding: 0.18rem 0.45rem;
    border-radius: 10px;
    font-size: 0.7rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.r2-mode-toggle-btn:active {
    background: rgba(56, 189, 248, 0.3);
}

.r2-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.15s ease;
}

.r2-nav-btn:active {
    background: rgba(56, 189, 248, 0.25);
    color: var(--m-cyan, #38bdf8);
    transform: scale(0.92);
}

.r2-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.r2-queue-item:active {
    background: rgba(56, 189, 248, 0.2);
}

.r2-queue-item.active {
    background: rgba(56, 189, 248, 0.18);
    border-left: 3px solid var(--m-cyan, #38bdf8);
    color: var(--m-cyan, #38bdf8);
    font-weight: 700;
}

.r2-player-queue-list {
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--m-radius-sm, 8px);
    padding: 0.5rem;
    font-size: 0.74rem;
    color: var(--m-text-muted, #94a3b8);
    max-height: 200px;
    overflow-y: auto;
}

.r2-player-emotions-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.r2-player-emotion-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.12rem 0.45rem;
    border-radius: 9999px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--m-cyan, #38bdf8);
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-transform: capitalize;
}

.r2-queue-emotion-tag {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--m-cyan, #38bdf8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    text-transform: capitalize;
}

/* Streaming token cursor animation en mobile */
.stream-cursor {
    display: inline-block;
    color: var(--m-cyan, #38bdf8);
    font-weight: 700;
    margin-left: 2px;
    animation: streamBlink 0.8s infinite;
}

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

.m-msg-row.is-streaming .m-msg-body {
    min-height: 1.5rem;
}

/* Visualizador de Ondas en Móvil */
.r2-visualizer-container {
    width: 100%;
    height: 40px;
    margin-top: 0.4rem;
    background: linear-gradient(180deg, rgba(0, 15, 30, 0.7) 0%, rgba(0, 5, 15, 0.95) 100%);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.r2-visualizer-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Sugerencia de Tareas Casuales en Móvil */
.task-suggestion-card {
    margin-top: 0.6rem;
    padding: 0.75rem 0.9rem;
    background: linear-gradient(135deg, rgba(14, 28, 48, 0.9) 0%, rgba(6, 14, 28, 0.98) 100%);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-left: 3px solid var(--m-cyan, #00f0ff);
    border-radius: 8px;
}

.task-sug-header {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--m-cyan, #00f0ff);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.task-sug-body {
    font-size: 0.86rem;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.task-sug-date {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 4px;
    font-size: 0.72rem;
    color: var(--m-cyan, #00f0ff);
}

.task-sug-actions {
    display: flex;
    gap: 0.4rem;
}

/* Modal de Alarma Móvil */
.alarm-ringing-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 6, 18, 0.92);
    backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.alarm-ringing-card {
    background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
    border-radius: 18px;
    padding: 1.8rem 1.4rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.alarm-time-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    font-family: monospace;
    margin-bottom: 0.4rem;
}

.alarm-actions-grid {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.btn-alarm-dismiss {
    background: #ef4444 !important;
    color: #fff !important;
    border: none;
    font-weight: 700;
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
}

.btn-alarm-snooze {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.7rem 1rem;
    border-radius: 10px;
}

/* BLOQUES DE CÓDIGO CON RESALTADO DE SINTAXIS Y BOTÓN COPIAR MÓVIL (v4.7) */
.jarvis-code-block {
    margin: 0.65rem 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 240, 255, 0.22);
    background: #090d16;
}

.jarvis-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.38rem 0.7rem;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(0, 240, 255, 0.16);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
}

.jarvis-code-lang {
    color: var(--m-cyan, #00f0ff);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.jarvis-code-copy-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.jarvis-code-copy-btn.copied {
    background: rgba(16, 185, 129, 0.22);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.5);
}

.jarvis-code-block pre {
    margin: 0 !important;
    padding: 0.7rem 0.85rem !important;
    overflow-x: auto;
    background: transparent !important;
}

.jarvis-code-block pre code.hljs {
    padding: 0 !important;
    background: transparent !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}





