* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #050505;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-blue: #0088ff;
    --accent-purple: #8800ff;
    --accent-glow: rgba(0, 136, 255, 0.5);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s infinite alternate ease-in-out;
}

.glow-orb.blue {
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    top: -200px;
    left: -100px;
}

.glow-orb.purple {
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    bottom: -200px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.2);
    }
}

/* Formularios de cristal */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.icon-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--glass-hover);
    color: white;
}


/* Contenedor Principal */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    transition: margin 0.4s ease;
}

/* Header */
.header {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1.5rem;
    height: auto;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
}

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

.logo-text {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.version {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    width: max-content;
}

.controls-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.glass-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.glass-select option {
    background: var(--bg-color);
    color: white;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 300;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
}

.dot.active {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

/* Header Bottom Nav */
.header-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    height: 40px;
    margin-top: 5px;
}

.nav-module {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-module:hover {
    color: white;
    background: var(--glass-hover);
}

.nav-module.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 -2px 0 var(--accent-blue);
}


/* Edge Toggles */
.edge-toggle {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 1rem 0.2rem;
    transition: 0.3s;
}

.edge-toggle:hover {
    color: white;
    background: var(--glass-hover);
}

.toggle-left {
    left: 0;
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.toggle-right {
    right: 0;
    border-radius: 8px 0 0 8px;
    border-right: none;
}


/* Main Workspace */
.agent-core {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    position: relative;
    /* Para mover el orbe absoluto si es necesario */
}

/* Orbe Views */
.orb-module-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.orb-container {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s;
}

.core-orb {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    box-shadow: 0 0 40px var(--accent-glow), inset 0 0 20px rgba(255, 255, 255, 0.5);
    z-index: 2;
    transition: all 0.3s ease;
}

.core-orb.speaking {
    animation: orb-pulse 1s var(--pulse-speed, 1s) infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 80px var(--accent-glow), inset 0 0 30px rgba(255, 255, 255, 0.8);
}

.pulse-ring {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
    animation: ring-expand 3s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.pulse-ring.delay {
    animation-delay: 1.5s;
}

/* Orbe Shrunk (Cuando cambia a Music, Stitch, etc) */
.orb-module-view.shrunk {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%) scale(0.55);
    align-items: center;
    z-index: 20;
}

.orb-module-view.shrunk .small-mic-btn {
    display: flex !important;
    position: absolute;
    left: 140px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.small-mic-btn {
    margin-top: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: rgba(129, 140, 248, 0.25);
    border: 1px solid rgba(129, 140, 248, 0.4);
    color: #c4b5fd;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.1rem;
    z-index: 10;
    pointer-events: auto !important;
}

.small-mic-btn:hover {
    background: rgba(255, 71, 87, 0.4);
    color: white;
    border-color: rgba(255, 71, 87, 0.5);
}


@keyframes orb-pulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    100% {
        transform: scale(1.15);
        filter: brightness(1.3);
    }
}

@keyframes ring-expand {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Interfases */
.interface-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: opacity 0.3s;
}

#other-interface-container {
    width: 80%;
    max-width: 900px;
    height: auto;
    position: relative;
    z-index: 10;
    margin: 120px auto 20px auto;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Wide Layout for Notebook and other full-width views */
.container.wide-layout {
    max-width: 96% !important;
    transition: max-width 0.4s ease;
}

.container.wide-layout #other-interface-container {
    width: 100%;
    max-width: 100%;
    margin-top: 100px;
    padding: 1.5rem;
    height: 80vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#notebook-ui {
    display: none;
    /* overrides display: none inline by JS as flex */
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    height: 100%;
    width: 100%;
}

/* Chat y Terminal */
#chat-interface-container {
    max-width: 800px;
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.transcription-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.message-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
    font-weight: 300;
    line-height: 1.6;
}

.role-user {
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    align-self: flex-end;
    max-width: 80%;
}

.role-assistant {
    color: var(--text-primary);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    font-size: 1.05rem;
    padding: 0.5rem;
    align-self: flex-start;
    max-width: 90%;
}

.role-assistant a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 400;
}

.role-assistant img.chat-img {
    max-width: 250px;
    border-radius: 12px;
    margin-top: 10px;
    display: block;
    border: 1px solid var(--glass-border);
}

/* Custom Scrollbar general */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* Barra de Texto y Voz Inferior */
.chat-input-area {
    width: 100%;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chat-input-area input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    padding: 0 1rem;
    outline: none;
}

.voice-btn {
    color: #ff4757;
}

.voice-btn.recording,
.small-mic-btn.recording {
    background: rgba(255, 71, 87, 0.4);
    border-radius: 50%;
    animation: pulse-mic 1s infinite;
}

@keyframes pulse-mic {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4);
    }

    100% {
        box-shadow: 0 0 0 15px rgba(255, 71, 87, 0);
    }
}

.camera-btn {
    color: var(--accent-blue);
}

.camera-btn.active {
    background: rgba(77, 171, 247, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(77, 171, 247, 0.5);
}


/* Paneles Laterales (Drawers) */
.drawer {
    position: fixed;
    top: 1rem;
    bottom: 1rem;
    width: 320px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}

.drawer-left {
    left: 1rem;
    transform: translateX(-120%);
    opacity: 0;
}

.drawer-left.open {
    transform: translateX(0);
    opacity: 1;
}

.drawer-right {
    right: 1rem;
    transform: translateX(120%);
    opacity: 0;
}

.drawer-right.open {
    transform: translateX(0);
    opacity: 1;
}

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

.drawer-header h3 {
    font-size: 1.1rem;
    font-weight: 400;
}

.drawer-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Modal Content specific */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 1rem;
}

/* Modales UI Universales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-content-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal-content-box {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#modal-img {
    max-width: 100%;
    max-height: calc(90vh - 4rem);
    object-fit: contain;
    border-radius: 8px;
    display: none;
}

#modal-text-container {
    display: none;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-width: 800px;
    width: 100%;
    padding-right: 10px;
}

#modal-text-title {
    font-size: 1.4rem;
    color: #818cf8;
    margin: 0;
    padding-right: 30px;
}

#modal-text-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.clickable-img {
    cursor: zoom-in;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.clickable-img:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.memory-card {
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.memory-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateX(4px);
}

/* Obsidian-NotebookLM Workspace Layout */
.notebook-workspace {
    display: grid;
    grid-template-columns: 310px 1fr 320px;
    gap: 1.2rem;
    width: 100%;
    height: 100%;
    align-items: stretch;
    margin-top: 0.5rem;
    transition: grid-template-columns 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), gap 0.4s ease;
}

#notebook-left-col {
    grid-column: 1;
}

#notebook-center-col {
    grid-column: 2;
}

#notebook-right-col {
    grid-column: 3;
}

.notebook-workspace.left-collapsed {
    grid-template-columns: 0px 1fr 320px;
    gap: 0.6rem;
}

.notebook-workspace.left-collapsed #notebook-left-col {
    display: none;
}

.notebook-workspace.right-collapsed {
    grid-template-columns: 310px 1fr 0px;
    gap: 0.6rem;
}

.notebook-workspace.right-collapsed #notebook-right-col {
    display: none;
}

.notebook-workspace.left-collapsed.right-collapsed {
    grid-template-columns: 0px 1fr 0px;
    gap: 0;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-secondary);
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--glass-hover) !important;
    color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

@media (max-width: 1100px) {
    .notebook-workspace {
        grid-template-columns: 1fr !important;
        height: auto;
        overflow-y: visible;
        gap: 1.2rem !important;
    }

    .notebook-workspace #notebook-left-col,
    .notebook-workspace #notebook-right-col {
        display: flex !important;
    }

    .sidebar-toggle-btn {
        display: none !important;
    }
}

.workspace-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    max-height: 100%;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.workspace-column.center {
    background: rgba(5, 5, 5, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.workspace-column::-webkit-scrollbar {
    width: 4px;
}

.workspace-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Toggle Switches */
.toggle-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.toggle-switch-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.switch-control {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 20px;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked+.switch-slider {
    background-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-glow);
}

input:checked+.switch-slider:before {
    transform: translateX(22px);
    background-color: white;
}

/* Tabs & Workspace Controls */
.workspace-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    align-items: center;
}

.workspace-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.workspace-tab-btn:hover {
    color: white;
    background: var(--glass-hover);
}

.workspace-tab-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -2px 0 var(--accent-blue);
}

.workspace-editor-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0.5rem;
}

.workspace-textarea {
    width: 100%;
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    line-height: 1.5;
}

.workspace-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(0, 136, 255, 0.25);
}

.workspace-title-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.workspace-title-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(0, 136, 255, 0.25);
}

.workspace-viewer {
    width: 100%;
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.2rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    overflow-y: auto;
    line-height: 1.6;
}

.workspace-viewer h1,
.workspace-viewer h2,
.workspace-viewer h3,
.workspace-viewer h4,
.workspace-viewer h5,
.workspace-viewer h6 {
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: #818cf8;
}

.workspace-viewer p {
    margin-bottom: 0.8rem;
}

.workspace-viewer ul,
.workspace-viewer ol {
    margin-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.workspace-viewer code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.workspace-viewer blockquote {
    border-left: 4px solid var(--accent-blue);
    background: rgba(0, 136, 255, 0.05);
    padding: 0.5rem 1rem;
    margin-bottom: 0.8rem;
    border-radius: 0 8px 8px 0;
}

.workspace-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

/* Premium Source Items */
.source-item-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
    text-align: left;
}

.source-item-btn:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.source-item-btn.active {
    background: rgba(0, 136, 255, 0.15);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.25);
}

.source-item-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.source-item-info i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.source-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
}

.source-item-delete {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 1rem;
    border-radius: 50%;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-item-delete:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.15);
}

/* Premium Semantic Connections list */
.connections-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.connection-item {
    background: rgba(136, 0, 255, 0.04);
    border: 1px solid rgba(136, 0, 255, 0.15);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.connection-item:hover {
    background: rgba(136, 0, 255, 0.12);
    border-color: var(--accent-purple);
    transform: translateX(4px);
    box-shadow: 0 0 8px rgba(136, 0, 255, 0.15);
}

.connection-meta {
    font-size: 0.75rem;
    color: var(--accent-purple);
    font-weight: 500;
}

/* Notebook Navigation Tabs */
.notebook-nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.notebook-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.notebook-tab-btn:hover {
    color: white;
    background: var(--glass-hover);
}

.notebook-tab-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -2px 0 var(--accent-blue);
}

/* Notebook Panel Switcher */
.notebook-panel {
    display: none;
    flex-grow: 1;
    min-height: 0;
    height: 100%;
}

.notebook-panel.active {
    display: flex;
    flex-direction: column;
}

/* Deep Research Workspace */
.research-workspace {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 1.2rem;
    width: 100%;
    height: 100%;
    align-items: stretch;
    min-height: 0;
}

.research-left-pane {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    overflow-y: auto;
}

.research-right-pane {
    display: flex;
    flex-direction: column;
    background: rgba(5, 5, 5, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1.2rem;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

/* Podcast & Transcription Workspace */
.podcast-workspace {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 1.2rem;
    width: 100%;
    height: 100%;
    align-items: stretch;
    min-height: 0;
}

.podcast-left-pane {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    overflow-y: auto;
}

.podcast-right-pane {
    display: flex;
    flex-direction: column;
    background: rgba(5, 5, 5, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1.2rem;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

/* Deep Research console / progress terminal */
.progress-terminal {
    background: #0d0e15;
    border: 1px solid #1e293b;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    max-height: 200px;
}

.terminal-header {
    background: #1e1f29;
    padding: 0.5rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid #1e293b;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.terminal-logs {
    padding: 0.8rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 160px;
    background: #090a0f;
}

.log-line {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line.info { color: #38bdf8; }
.log-line.success { color: #4ade80; }
.log-line.error { color: #f87171; }
.log-line.raw { color: #e2e8f0; }

/* History lists layout */
.research-history-list, .research-history-item {
    cursor: pointer;
}

.research-history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    color: #e2e8f0;
    margin-bottom: 0.3rem;
}

.research-history-item:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

/* ------------- SMART ROUTER & 3 PILLARS DASHBOARD ------------- */
.glass-panel-sm {
    background: rgba(12, 14, 24, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pillar-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pillar-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.pillar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pillar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: white;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.18);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.degraded {
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-badge.ready {
    background: rgba(168, 85, 247, 0.18);
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.pillar-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.pillar-detail {
    margin: 0;
    color: var(--text-secondary);
}

.pillar-detail code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: #a7f3d0;
}

/* Tabla de Modelos */
.router-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.router-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.router-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.router-table tbody tr {
    transition: background 0.2s ease;
}

.router-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tag-pill {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.7rem;
    margin-right: 0.3rem;
}

/* ------------- ADAPTACIÓN RESPONSIVE MÓVIL Y ANTI-PARPADEO ------------- */
html, body {
    overscroll-behavior-y: none;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

@media (max-width: 768px) {
    body {
        padding: 0.4rem;
        min-height: 100dvh;
        overflow-x: hidden;
    }

    /* Ajuste de Cabecera Móvil */
    .app-header {
        flex-wrap: wrap;
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
    }

    .header-left {
        gap: 0.5rem;
    }

    .header-left h1 {
        font-size: 1.2rem;
    }

    .header-right {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.3rem;
        justify-content: flex-start;
        gap: 0.4rem;
    }

    .nav-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Orbe Compacto en Vertical */
    .orb-module-view {
        padding: 0.5rem 0;
    }

    .orb-container {
        width: 90px;
        height: 90px;
    }

    .core-orb {
        width: 65px;
        height: 65px;
    }

    /* Chat y Subtítulos en Pantalla Móvil */
    .transcription-panel {
        max-height: 50vh;
        overscroll-behavior: contain;
    }

    .message-container {
        padding: 0.5rem;
        font-size: 0.9rem;
        max-height: 45vh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* Área de Entrada / Input */
    .chat-input-area {
        padding: 0.5rem 0.6rem;
        gap: 0.35rem;
    }

    #text-input {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    /* Modal de Autenticación Adaptado a Móvil */
    #auth-modal .modal-content-box {
        width: 92vw !important;
        max-width: 360px !important;
        padding: 1.5rem 1rem !important;
        margin: auto;
    }

    /* Tablas y Paneles en Móvil */
    .notebook-workspace, .research-workspace, .podcast-workspace {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
    }
}