/* PWA App Shell Consolidated CSS Stream */

/* === _theme-vars.css === */
/* ================================================================
/* ================================================================
   VIEW TRANSITIONS API — Premium Native App Animations
   ================================================================ */
::view-transition-old(root) {
    animation: 250ms cubic-bezier(0.4, 0, 0.2, 1) both fade-out;
}
::view-transition-new(root) {
    animation: 300ms cubic-bezier(0.4, 0, 0.2, 1) both fade-in,
               300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slide-from-right {
    from { transform: translateX(20px); }
    to { transform: translateX(0); }
}

/* ================================================================
/* ================================================================
   0. GLOBAL TYPOGRAPHY & COMPONENT RESET
   ================================================================ */
#qm-pwa-shell, #qm-pwa-shell * {
    font-family: var(--font-body);
}

#qm-pwa-shell h1, #qm-pwa-shell h2, #qm-pwa-shell h3, #qm-pwa-shell h4, #qm-pwa-shell h5, #qm-pwa-shell h6 {
    font-family: var(--font-head);
}

#qm-pwa-shell input, 
#qm-pwa-shell select, 
#qm-pwa-shell textarea, 
#qm-pwa-shell button:not([class]) {
    font-family: var(--font-body);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--c-bg);
    color: var(--c-text);
    border: 1px solid var(--c-bdr);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

#qm-pwa-shell input:focus, 
#qm-pwa-shell select:focus, 
#qm-pwa-shell textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(var(--brand-rgb), 0.2);
}

#qm-pwa-shell select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

#qm-pwa-shell a {
    text-decoration: none;
    color: var(--brand);
}

/* ================================================================
   OS LEVEL DYNAMIC GRADIENT & GLOW TOKENS
   100% calculados dinámicamente a partir de las 16 variables del tema activo
   ================================================================ */
:root {
    --theme-grad-action: var(--brand);
    --theme-grad-triad: linear-gradient(135deg, color-mix(in srgb, var(--brand) 25%, var(--c-surface)) 0%, var(--brand) 25%, var(--brand) 100%);
    --theme-glow-action: none;
    --theme-glow-ambient: none;
    --theme-glow-focus: none;
    --glow-shadow: none;
}

:root.qm-gradient-active,
html.qm-gradient-active,
#qm-pwa-shell.qm-gradient-active,
body.qm-gradient-active #qm-pwa-shell {
    --theme-grad-action: linear-gradient(
        90deg,
        color-mix(in srgb, var(--brand) 35%, var(--c-surface)) 0%,
        color-mix(in srgb, var(--brand) 70%, var(--c-surface)) 45%,
        var(--brand) 100%
    );
    --theme-grad-triad: linear-gradient(
        135deg,
        color-mix(in srgb, var(--brand) 25%, var(--c-surface)) 0%,
        var(--brand) 25%,
        var(--brand) 100%
    );
    --theme-glow-action: 0 0 0 1.5px color-mix(in srgb, var(--brand) 85%, var(--c-surface)), 0 2px 6px rgba(0, 0, 0, 0.1);
    --theme-glow-ambient: 0 0 0 1.5px var(--brand);
    --theme-glow-focus: 0 0 0 1.5px var(--brand);
    --glow-shadow: none;
}





/* === _layout-base.css === */
/* ================================================================
   ESCALA Z-INDEX GLOBAL DEL OS (capas raiz de la PWA shell)
   ----------------------------------------------------------------
   Modelo unico de apilamiento. Prohibido usar valores arbitrarios
   (999999, para tapar errores): respetar estos rangos.

     0  - 9     Contenido de la shell (slots, vistas)
     10 - 29    Navegacion (sidebar desktop, bottom nav, FAB)
     30 - 49    Flotantes (tooltips, popovers)
     50 - 99    UI secundaria (barra de deep links)
     100 - 199  OS Window Manager (onboarding, KYC, ventanas OS)
     200 - 299  Iframe overlay (preview de negocios)
     1000+      Loader global y toasts criticos del OS

   Los z-index DENTRO de contenedores con transform o
   isolation:isolate (window manager, overlay-screens) son LOCALES
/* ================================================================
   a ese contexto de apilamiento y no compiten con esta escala.
   ================================================================ */

/* ================================================================
   0. DESKTOP UNIFIED PWA — Sidebar & Split Screen Chat
/* ================================================================
   2. SHELL BASE
   ================================================================ */
/* --- CONTROL DE FLUJO Y VISIBILIDAD DE LA PWA VS SITIO WEB --- */
body:not(.qm-pwa-deep-active) #qm-pwa-stage {
    display: none;
}

body:not(.qm-pwa-deep-active) #qm-pwa-shell {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--c-bg);
}

body.qm-pwa-deep-active #qm-pwa-stage {
    display: block;
}

body.qm-pwa-deep-active #qm-pwa-slots-container {
    display: none;
}

body.qm-pwa-deep-active #qm-pwa-shell {
    position: static;
    height: 0;
    width: 0;
    background: transparent;
}

#qm-organic-launcher {
    display: none;
    opacity: 0;
    pointer-events: none;
}

/* ================================================================
/* ================================================================
   7. LOADER Y STAGE
   ================================================================ */
#qm-pwa-loader {
    position: fixed;
    inset: 0;
    background: rgba(var(--nav-bg-rgb), 0.7);
    z-index: 1000; /* Capa 1000+: loader global, sobre todas las ventanas */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}

#qm-pwa-loader.active {
    opacity: 1;
    pointer-events: auto;
}

.qm-pwa-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(var(--brand-rgb), 0.3);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: qmPwaSpin 0.7s linear infinite;
}

@keyframes qmPwaSpin {
    100% {
        transform: rotate(360deg);
    }
}

#qm-pwa-stage {
    position: relative;
    overflow-x: hidden;
    width: 100%;
    min-height: 100dvh;
    background: var(--c-bg);
}

.qm-view {
    width: 100%;
    background: var(--c-bg);
    color: var(--c-text);
    will-change: transform, opacity;
    backface-visibility: hidden;
    min-height: 100dvh;
}

/*    PWA IFRAME OVERLAY FOR BUSINESS PROFILES
------------------------------------------- */
/* FIX: Reset background for PC full screen */
body:not(.qm-pwa-deep-active),
html:not(.qm-pwa-deep-active) {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    touch-action: manipulation;
    background: var(--c-bg);
}

body.qm-pwa-deep-active {
    position: static;
    overflow-y: auto;
    height: auto;
}

/* ================================================================
   OCULTAR SCROLLBARS PARA LOOK NATIVO EN PWA
   ================================================================ */
*::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ================================================================
   SANEAMIENTO ESTRUCTURAL DE INTERACCIONES Y FOCO DEL SO PWA
   ================================================================ */
#qm-pwa-shell,
#qm-pwa-shell *,
.qm-view,
.qm-pwa-overlay-screen,
.qm-os-window,
.qm-window-sheet,
.qm-window-dialog {
    -webkit-tap-highlight-color: transparent;
}

/* Neutralizar el recuadro azul genérico del navegador en clics y toques */
#qm-pwa-shell :focus:not(:focus-visible),
.qm-pwa-overlay-screen :focus:not(:focus-visible),
.qm-os-window :focus:not(:focus-visible),
.qm-window-sheet :focus:not(:focus-visible) {
    outline: none;
}

/* Anillo de foco accesible con variables de tema EXCLUSIVAMENTE para navegación por teclado */
#qm-pwa-shell button:focus-visible,
#qm-pwa-shell a:focus-visible,
#qm-pwa-shell [role="button"]:focus-visible,
#qm-pwa-shell .qm-btn:focus-visible,
#qm-pwa-shell .qm-segmented-item:focus-visible,
#qm-pwa-shell .qm-nav-item:focus-visible,
#qm-pwa-shell .qm-sidebar-item:focus-visible,
.qm-pwa-overlay-screen button:focus-visible,
.qm-os-window button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
}

/* ================================================================
   PULL-TO-REFRESH INDICATOR (SO PWA - MINIMALISTA NATIVO)
   ================================================================ */
.qm-ptr-indicator {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translate(-50%, -70px) scale(0.7);
    z-index: 60; /* Capa 50-99: UI secundaria del OS */
    pointer-events: none;
    opacity: 0;
    display: none;
    will-change: transform, opacity;
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.18s ease;
}

.qm-ptr-indicator.pulling,
.qm-ptr-indicator.refreshing {
    display: flex;
    opacity: 1;
}

.qm-ptr-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--c-surface);
    color: var(--brand);
    border: 1px solid var(--c-bdr);
    border-radius: 50%;
    box-shadow: 0 4px 18px color-mix(in srgb, var(--c-text-primary) 15%, transparent);
    backdrop-filter: blur(12px);
}

.qm-ptr-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s linear;
}

.qm-ptr-indicator.refreshing .qm-ptr-spinner-wrap {
    animation: qmPtrRotate 0.75s linear infinite;
}

@keyframes qmPtrRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === _layout-desktop-sidebar.css === */
/* ================================================================
   DESKTOP SIDEBAR & LAYOUT SHELL (< 280 líneas)
   100% Tokens de Tema CSS (Cero Colores Hardcodeados)
   ================================================================ */

/* Ocultar scrollbars globales y barra de escritorio en móviles */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }
.qm-pwa-desktop-sidebar { display: none; }

@media (min-width: 769px) {
    * {
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--c-bdr) 80%, var(--c-surface)) transparent;
    }
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
        display: block;
    }
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    ::-webkit-scrollbar-thumb {
        background: color-mix(in srgb, var(--c-bdr) 80%, var(--c-surface));
        border-radius: 4px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: var(--brand);
    }

    :root {
        --desktop-sidebar-w: 240px;
    }
    
    html.qm-sidebar-pinned {
        --desktop-sidebar-w: 240px;
    }

    html.qm-sidebar-collapsed {
        --desktop-sidebar-w: 80px;
    }

    html.qm-sidebar-dynamic {
        --desktop-sidebar-w: 80px;
    }

    #qm-pwa-bottom-nav {
        display: none;
    }

    /* Sidebar lateral de escritorio */
    .qm-pwa-desktop-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--desktop-sidebar-w);
        background: var(--nav-bg);
        border-right: 1px solid var(--nav-border);
        z-index: 20; /* Capa 10-29: navegación */
        padding: 32px 16px;
        box-sizing: border-box;
        box-shadow: 4px 0 24px color-mix(in srgb, var(--c-bg) 60%, transparent);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-x: hidden;
    }

    /* Expansión hover en estado dinámico */
    html.qm-sidebar-dynamic .qm-pwa-desktop-sidebar:hover {
        width: 260px;
    }

    .qm-sidebar-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 40px;
        width: 100%;
        box-sizing: border-box;
        position: relative;
        height: 48px;
    }
    
    .qm-sidebar-logo {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        font-size: 32px;
        filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--c-bg) 50%, transparent));
    }

    .qm-sidebar-pin-btn {
        background: transparent;
        border: none;
        color: var(--c-sub);
        cursor: pointer;
        padding: 4px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        flex-shrink: 0;
        opacity: 0;
        transform: scale(0.8);
    }

    .qm-pwa-desktop-sidebar:hover .qm-sidebar-pin-btn {
        opacity: 1;
        transform: scale(1);
    }

    html.qm-sidebar-pinned .qm-sidebar-pin-btn {
        opacity: 1;
        transform: scale(1);
        color: var(--brand);
        background: var(--c-surface);
    }

    /* Posicionamiento del pin cuando el sidebar está colapsado */
    html.qm-sidebar-collapsed .qm-sidebar-pin-btn,
    html.qm-sidebar-dynamic .qm-pwa-desktop-sidebar:not(:hover) .qm-sidebar-pin-btn {
        position: absolute;
        top: 54px;
        left: 50%;
        transform: translate(-50%, 0) scale(0.8);
        z-index: 10;
    }

    html.qm-sidebar-collapsed .qm-pwa-desktop-sidebar:hover .qm-sidebar-pin-btn {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }

    .qm-sidebar-pin-btn:hover {
        color: var(--c-text-primary);
        background: var(--c-surface);
    }

    /* Lógica de conmutación de ícono para los 3 estados */
    .qm-sidebar-pin-btn svg { display: none; }
    html.qm-sidebar-pinned .qm-sidebar-pin-btn .icon-pinned { display: block; }
    html.qm-sidebar-dynamic .qm-sidebar-pin-btn .icon-dynamic { display: block; }
    html.qm-sidebar-collapsed .qm-sidebar-pin-btn .icon-collapsed { display: block; }

    .qm-sidebar-brand-name {
        font-family: var(--font-head);
        font-size: 18px;
        font-weight: 800;
        color: var(--c-text-primary);
        margin: 0;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .qm-sidebar-brand-sub {
        font-family: var(--font-body);
        font-size: 10px;
        color: var(--c-sub);
        margin: 4px 0 0;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .qm-sidebar-nav {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1;
    }

    .qm-sidebar-item {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px;
        border-radius: 14px;
        text-decoration: none;
        color: var(--nav-text);
        font-family: var(--font-body);
        font-size: 14px;
        font-weight: 500;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        cursor: pointer;
        width: 100%;
        box-sizing: border-box;
    }

    .qm-sidebar-item:active {
        transform: scale(0.97);
    }

    .qm-sidebar-item:hover {
        background: var(--c-surface);
        color: var(--nav-active);
    }

    .qm-sidebar-item.active {
        color: var(--nav-active);
    }

    .qm-sidebar-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        color: inherit;
        transition: transform 0.2s;
        flex-shrink: 0;
        width: 24px;
    }

    .qm-sidebar-label {
        color: inherit;
        white-space: nowrap;
        opacity: 1;
        transition: opacity 0.2s;
    }

    .qm-sidebar-brand-info,
    .qm-sidebar-user-info {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .qm-sidebar-item.active .qm-sidebar-icon,
    .qm-sidebar-item.active .qm-sidebar-label {
        color: var(--nav-active);
    }

    .qm-sidebar-item.active .qm-sidebar-icon {
        transform: scale(1.1);
    }

    .qm-sidebar-footer {
        border-top: 1px solid var(--nav-border);
        padding-top: 20px;
        margin-top: 20px;
        position: relative;
        z-index: 2;
        width: 100%;
        box-sizing: border-box;
    }

    /* Ocultar etiquetas en modo colapsado o dinámico sin hover */
    html.qm-sidebar-dynamic .qm-pwa-desktop-sidebar:not(:hover) .qm-sidebar-label,
    html.qm-sidebar-dynamic .qm-pwa-desktop-sidebar:not(:hover) .qm-sidebar-brand-info,
    html.qm-sidebar-dynamic .qm-pwa-desktop-sidebar:not(:hover) .qm-sidebar-user-info,
    html.qm-sidebar-collapsed .qm-pwa-desktop-sidebar .qm-sidebar-label,
    html.qm-sidebar-collapsed .qm-pwa-desktop-sidebar .qm-sidebar-brand-info,
    html.qm-sidebar-collapsed .qm-pwa-desktop-sidebar .qm-sidebar-user-info {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Bubble indicator para el sidebar en PC */
    .qm-sidebar-bubble-indicator {
        position: absolute;
        left: 0;
        width: 100%;
        height: 48px;
        background: var(--c-surface);
        border: 1px solid var(--c-bdr);
        border-radius: 12px;
        z-index: 0;
        transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        pointer-events: none;
    }

    /* Contenedor principal de la Shell en PC */
    #qm-pwa-shell {
        display: block;
        overflow: hidden;
        width: 100vw;
        height: 100vh;
        position: relative;
        background: var(--c-bg);
    }

    #qm-pwa-slots-container {
        display: block; margin-left: var(--desktop-sidebar-w); width: calc(100vw - var(--desktop-sidebar-w));
        max-width: calc(100vw - var(--desktop-sidebar-w));
        height: 100vh; overflow: hidden; transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-sizing: border-box;
    }
    #qm-pwa-slots-container > .qm-pwa-overlay-screen,
    #qm-pwa-slots-container > #qm-slot-0,
    #qm-pwa-slots-container > #qm-slot-1,
    #qm-pwa-slots-container > #qm-slot-2,
    #qm-pwa-slots-container > #qm-slot-3,
    #qm-pwa-slots-container > #qm-slot-4,
    #qm-pwa-slots-container > .qm-pwa-overlay-screen#qm-slot-0,
    #qm-pwa-slots-container > .qm-pwa-overlay-screen#qm-slot-1,
    #qm-pwa-slots-container > .qm-pwa-overlay-screen#qm-slot-2,
    #qm-pwa-slots-container > .qm-pwa-overlay-screen#qm-slot-3,
    #qm-pwa-slots-container > .qm-pwa-overlay-screen#qm-slot-4 {
        position: absolute; inset: 0; width: 100%; max-width: 100%; flex: 1 1 100%;
        height: 100%; max-height: 100%; padding: 0; margin: 0;
        display: block; box-sizing: border-box; overflow-y: auto; overflow-x: hidden;
    }
    #qm-pwa-slots-container > .qm-pwa-overlay-screen:not(.active) { display: none; }

    /* Slots de pantalla completa sin márgenes restrictivos */
    #qm-pwa-slots-container > #qm-slot-0 { padding: 0; overflow-y: auto; height: 100%; max-height: 100%; box-sizing: border-box; width: 100%; max-width: 100%; }
    #qm-pwa-slots-container > #qm-slot-1,
    #qm-pwa-slots-container > .qm-pwa-overlay-screen#qm-slot-1,
    #qm-pwa-slots-container > #qm-slot-2 { padding: 0; overflow: hidden; width: 100%; max-width: 100%; }
    #qm-slot-0 > *, #qm-slot-1 > *, #qm-slot-2 > * { max-width: none; }

    /* Slots centrados para formularios y vistas ejecutivas */
    #qm-slot-3, #qm-slot-4 { padding: 40px; }
    #qm-slot-3 > *, #qm-slot-4 > * { max-width: 1100px; margin-left: auto; margin-right: auto; box-sizing: border-box; }

    /* Vista Stage deep links en escritorio */
    body.qm-pwa-deep-active #qm-pwa-stage {
        margin-left: var(--desktop-sidebar-w); width: calc(100vw - var(--desktop-sidebar-w)); display: block;
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.qm-pwa-deep-active .qm-pwa-secondary-nav {
        left: var(--desktop-sidebar-w); width: calc(100vw - var(--desktop-sidebar-w)); display: flex;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}


/* === _layout-secondary-nav.css === */
/* ================================================================
   4. BARRA SECUNDARIA SUPERIOR (Deep links)
   ================================================================ */
.qm-pwa-secondary-nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-h) + var(--safe-t));
    background: color-mix(in srgb, var(--nav-bg) 85%, transparent);
    border-bottom: 1px solid transparent;
    z-index: 50;
    /* Capa 50-99: UI secundaria (deep links) */
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    padding-top: var(--safe-t);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease-in-out;
    box-sizing: border-box;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.qm-pwa-secondary-nav.active {
    transform: translateY(0);
    opacity: 1;
    border-bottom-color: var(--nav-border);
}

.qm-pwa-secondary-nav.qm-os-nav-mode {
    z-index: 101;
    /* Capa 101: encima de qm-os-window-manager (100) */
}

.qm-sec-btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--nav-text);
    font-size: 15px;
    font-family: var(--font-body);
    font-weight: 500;
    padding: 10px 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.qm-sec-btn-back:active {
    color: var(--nav-active);
}

.qm-sec-title {
    flex: 1;
    text-align: center;
    color: var(--nav-active);
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* Padding cuando la barra superior está activa */
body.qm-pwa-deep-active .qm-current-view,
body.qm-pwa-deep-active #qm-page-content {
    padding-top: calc(var(--header-pad-t) + var(--safe-t));
}

/* === _layout-overlays.css === */
/* ================================================================
   OVERLAY SCREENS (Slots locales, Iframe Overlay, Window Manager Base)
   ================================================================ */

@media (max-width: 768px) {
    #qm-pwa-slots-container {
        display: flex;
        flex-direction: row;
        width: 500vw;
        height: 100%;
        transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
        will-change: transform;
    }

    #qm-pwa-slots-container.qm-tab-0 { transform: translateX(0vw); }
    #qm-pwa-slots-container.qm-tab-1 { transform: translateX(-100vw); }
    #qm-pwa-slots-container.qm-tab-2 { transform: translateX(-200vw); }
    #qm-pwa-slots-container.qm-tab-3 { transform: translateX(-300vw); }
    #qm-pwa-slots-container.qm-tab-4 { transform: translateX(-400vw); }
}

.qm-window-loader-fallback {
    padding: 60px;
    text-align: center;
    font-family: var(--font-body);
    color: var(--c-sub);
}

#qm-pwa-slots-container > .qm-pwa-overlay-screen,
.qm-pwa-overlay-screen {
    position: relative;
    inset: auto;
    background: var(--c-bg);
    color: var(--c-text);
    z-index: 1; /* Capa 0-9: contenido de la shell */
    width: 100vw;
    max-width: 100vw;
    flex: 0 0 100vw;
    flex-shrink: 0;
    display: block;
    height: 100dvh;
    padding-bottom: 0;
    overflow-y: auto;
    touch-action: pan-y pan-x;
    overscroll-behavior: contain;
    isolation: isolate;
    backface-visibility: hidden;
    box-sizing: border-box;
}

/* Slot 0 layout: Inicio Inmersivo con Plaza OS-Sheet */
#qm-pwa-slots-container > #qm-slot-0,
#qm-slot-0.qm-pwa-overlay-screen,
#qm-slot-0 {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Slot 1 layout: Contenedor Inmersivo de Mapa Territorial y Bottom-Sheet */
#qm-pwa-slots-container > #qm-slot-1,
#qm-slot-1.qm-pwa-overlay-screen,
#qm-slot-1 {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: none;
}

/* Slot 2 layout: Contenedor Flexbox del Asistente IA */
#qm-pwa-slots-container > #qm-slot-2,
#qm-slot-2.qm-pwa-overlay-screen,
#qm-slot-2 {
    padding: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.qm-keyboard-open #qm-slot-2,
.qm-keyboard-open #qm-slot-2 {
    padding: 0;
    padding-bottom: 0;
}

.qm-pwa-iframe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 200; /* Capa 200-299: iframe overlay, sobre el window manager */
    background: var(--c-bg);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    visibility: hidden;
}

.qm-pwa-iframe-overlay.active {
    transform: translateX(0);
    visibility: visible;
}

.qm-pwa-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

@media (min-width: 768px) {
    .qm-pwa-iframe-overlay {
        left: 260px;
        width: calc(100% - 260px);
    }
}

/* ================================================================
   TOOL OVERLAY — Herramientas dentro de la PWA
   ================================================================ */
#qm-os-window-manager {
    position: fixed;
    inset: 0;
    z-index: 100; /* Capa 100-199: ventanas del OS, sobre la navegacion */
    background: var(--c-bg);
    color: var(--c-text);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
}

#qm-os-window-manager.active {
    transform: translateX(0);
    visibility: visible;
}

.qm-os-window-body {
    padding-top: calc(var(--nav-h) + var(--safe-t));
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
    min-height: 100%;
    box-sizing: border-box;
    font-family: var(--font-body);
}

@media (min-width: 769px) {
    #qm-os-window-manager {
        left: 0;
        width: 100vw;
        background: color-mix(in srgb, var(--c-bg) 85%, transparent);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .qm-os-window-body {
        max-width: 980px;
        margin: 32px auto;
        background: var(--c-surface);
        border: 1px solid var(--c-bdr);
        border-radius: 24px;
        box-shadow: 0 20px 60px color-mix(in srgb, var(--c-bg) 60%, transparent);
        padding: 32px 40px 48px;
    }
}

/* ================================================================
   OVERLAY CONTEXT — Ajustes para apps standalone dentro del overlay
   ================================================================ */

#qm-os-window-body {
    display: flex;
    flex-direction: column;
}
#qm-os-window-body .qm-mayorista-app,
#qm-os-window-body .qm-atomic-pos,
#qm-os-window-body .qm-driver-pwa-container {
    height: 100%;
    min-height: 0;
    flex: 1;
}

/* CRM Admin dentro del window manager */
#qm-os-window-body .qm-portal-crm-wrapper {
    height: 100%;
    margin: 0;
    flex: 1;
}
#qm-os-window-body #qm-crm-app {
    height: 100%;
    margin-top: 0;
    border-radius: 0;
}

/* Suprimir botones de navegacion propios del standalone */
#qm-os-window-body .qm-pos-header .qm-btn-cerrar,
#qm-os-window-body .qm-driver-pwa-header button[onclick*="location.href"],
#qm-os-window-body .qm-driver-pwa-header button[onclick*="site_url"] {
    display: none;
}

/* ================================================================
   OVERLAY MI NEGOCIO & ADMIN PORTAL
   ================================================================ */
.qm-ov-neg-tabs { display: flex; border-bottom: 1px solid var(--c-bdr); padding: 0 16px; gap: 0; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; background: var(--c-bg); z-index: 2; }
.qm-ov-neg-tab { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--c-sub); padding: 12px 18px; border: none; border-bottom: 2px solid transparent; background: none; cursor: pointer; white-space: nowrap; transition: color 0.2s, border-color 0.2s; -webkit-appearance: none; }
.qm-ov-neg-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.qm-ov-neg-panel { display: none; padding: 20px; }
.qm-ov-neg-panel.active { display: block; }
.qm-ov-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.qm-ov-stat-card { background: var(--c-card); border: 1px solid var(--c-bdr); border-radius: 14px; padding: 16px; }
.qm-ov-stat-label { font-family: var(--font-body); font-size: 11px; font-weight: 700; color: var(--c-sub); text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 6px; }
.qm-ov-stat-value { font-family: var(--font-head); font-size: 26px; font-weight: 800; color: var(--c-text-primary); margin: 0; }
.qm-ov-chart-wrap { background: var(--c-card); border: 1px solid var(--c-bdr); border-radius: 14px; padding: 16px; margin-bottom: 20px; }
.qm-ov-chart-title { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--c-sub); margin: 0 0 16px; }
.qm-ov-prod-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-bdr); }
.qm-ov-prod-item:last-child { border-bottom: none; }
.qm-ov-prod-img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--c-surface); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--c-sub); }
.qm-ov-prod-name { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--c-text-primary); margin: 0 0 2px; }
.qm-ov-prod-price { font-family: var(--font-body); font-size: 12px; color: var(--c-sub); margin: 0; }
.qm-ov-prod-actions { margin-left: auto; }
.qm-ov-stock-btn { font-family: var(--font-body); font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 8px; border: none; cursor: pointer; transition: all 0.2s; -webkit-appearance: none; }
.qm-ov-stock-btn.on  { background: color-mix(in srgb, var(--brand) 18%, var(--c-surface)); color: var(--brand); }
.qm-ov-stock-btn.off { background: var(--c-surface); color: var(--c-sub); border: 1px solid var(--c-bdr); }
.qm-ov-info-row { background: var(--c-card); border: 1px solid var(--c-bdr); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.qm-ov-info-label { font-family: var(--font-body); font-size: 11px; font-weight: 700; color: var(--c-sub); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 4px; }
.qm-ov-info-value { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--c-text-primary); margin: 0; }

.qm-admin-card:active { transform: scale(0.96); background: var(--c-bg); }
.qm-admin-card:hover { border-color: var(--brand); }

/* ================================================================
   OVERLAY MIS PEDIDOS (100% Tokens de Tema CSS)
   ================================================================ */
.qm-ov-orders-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 20px 24px; }
.qm-ov-order-card { background: var(--c-card); border: 1px solid var(--c-bdr); border-radius: 14px; padding: 16px; transition: transform 0.2s ease, border-color 0.2s ease; }
.qm-ov-order-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.qm-ov-order-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.qm-ov-order-negocio { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--c-text-primary); margin: 0; flex: 1; }
.qm-ov-order-badge { font-family: var(--font-body); font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.qm-ov-order-detail { font-family: var(--font-body); font-size: 13px; color: var(--c-sub); margin: 4px 0; line-height: 1.5; }
.qm-ov-order-meta { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-bdr); }
.qm-ov-order-meta span { font-family: var(--font-body); font-size: 11px; color: var(--c-muted); }
.qm-ov-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 24px; text-align: center; color: var(--c-sub); }
.qm-ov-guest-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; gap: 16px; box-sizing: border-box; }
.qm-ov-guest-icon { width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 12%, var(--c-surface)); display: flex; align-items: center; justify-content: center; color: var(--brand); }
.qm-ov-guest-title { font-family: var(--font-head); font-size: 18px; font-weight: 800; color: var(--c-text-primary); margin: 0; }
.qm-ov-guest-desc { font-family: var(--font-body); font-size: 13px; color: var(--c-sub); max-width: 380px; margin: 0; line-height: 1.4; }

@media (min-width: 769px) {
    .qm-ov-orders-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
    .qm-ov-stat-grid { grid-template-columns: repeat(3, 1fr); }
}


/* === _bottom-nav.css === */
/* ================================================================
   BOTTOM NAVIGATION: ISLA FLOTANTE UNIVERSAL (LIQUID GLASS)
   ================================================================ */

.qm-pwa-bottom-nav {
    display: flex;
    flex-wrap: nowrap;
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(calc(100% - 24px), 430px);
    height: var(--nav-h);
    padding: 4px 6px;
    padding-bottom: 4px;
    border-radius: 9999px;
    border: 1px solid color-mix(in srgb, var(--nav-border) 40%, rgba(255, 255, 255, 0.45));
    background: color-mix(in srgb, var(--nav-bg) 68%, transparent);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    backdrop-filter: blur(24px) saturate(190%);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 25; /* Capa 25: Navegación flotante por encima del contenido */
    justify-content: space-around;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

/* Ocultamiento reactivo con traslación fluida */
.qm-pwa-bottom-nav.hidden {
    transform: translate(-50%, calc(100% + 40px));
}

#qm-pwa-shell .qm-nav-item,
.qm-pwa-bottom-nav .qm-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--nav-text);
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s, transform 0.2s, background 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    height: calc(100% - 4px);
    min-width: 0;
    position: relative;
    border-radius: 9999px;
    margin: 2px 2px;
    padding: 3px 2px;
    box-sizing: border-box;
}

#qm-pwa-shell .qm-nav-item:active,
.qm-pwa-bottom-nav .qm-nav-item:active {
    transform: scale(0.92);
}

#qm-pwa-shell .qm-nav-item.active,
.qm-pwa-bottom-nav .qm-nav-item.active {
    color: var(--nav-active);
    background: color-mix(in srgb, var(--nav-active) 12%, transparent);
}

#qm-pwa-shell .qm-nav-item .qn-icon,
.qm-pwa-bottom-nav .qm-nav-item .qn-icon {
    margin-bottom: 3px;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qm-pwa-shell .qm-nav-item.active .qn-icon,
.qm-pwa-bottom-nav .qm-nav-item.active .qn-icon {
    transform: scale(1.12);
    color: var(--nav-active);
}

.qm-nav-badge {
    position: absolute;
    top: 3px;
    right: 20%;
    background: var(--badge);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--nav-bg);
    box-sizing: border-box;
}

/* FAB Central — slot índice 2 */
#qm-pwa-shell .qm-nav-item[data-tab="2"],
.qm-pwa-bottom-nav .qm-nav-item[data-tab="2"] {
    background: var(--nav-bg);
    color: var(--brand);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    margin: 0 4px;
    transform: translateY(-8px);
    border: 2px solid color-mix(in srgb, var(--nav-border) 40%, rgba(255, 255, 255, 0.45));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    z-index: 2;
    transition: background 0.25s ease, color 0.25s ease, transform 0.15s, box-shadow 0.2s;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.qm-nav-item[data-tab="2"] .qn-label { display: none; }
.qm-nav-item[data-tab="2"] .qn-icon  { margin-bottom: 0; transform: scale(1.0); color: inherit; }
.qm-nav-item[data-tab="2"]:active    { transform: translateY(-8px) scale(0.92); }

#qm-pwa-shell .qm-nav-item[data-tab="2"].active,
.qm-pwa-bottom-nav .qm-nav-item[data-tab="2"].active {
    background: var(--brand);
    color: var(--nav-bg, #ffffff);
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}

#qm-pwa-shell .qm-nav-item[data-tab="2"].active .qn-icon,
.qm-pwa-bottom-nav .qm-nav-item[data-tab="2"].active .qn-icon {
    color: inherit;
}



/* === _kernel-popups.css === */
/* ================================================================
   KERNEL POPUPS, TOASTS & BOTTOM-SHEETS SYSTEM (window.qmOS)
   ================================================================ */

.qm-os-toast-container {
    position: fixed;
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 420px;
}

.qm-os-toast {
    background: var(--c-card);
    color: var(--c-text-primary, var(--c-text));
    border: 1px solid var(--c-bdr);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--c-bg) 18%, transparent);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.qm-os-toast-visible { opacity: 1; transform: translateY(0) scale(1); }
.qm-os-toast-icon {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qm-os-toast-info .qm-os-toast-icon { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.qm-os-toast-success .qm-os-toast-icon { background: color-mix(in srgb, var(--badge) 15%, transparent); color: var(--badge); }
.qm-os-toast-warning .qm-os-toast-icon { background: color-mix(in srgb, var(--fab-on) 15%, transparent); color: var(--fab-on); }
.qm-os-toast-danger .qm-os-toast-icon { background: color-mix(in srgb, var(--fab-off) 15%, transparent); color: var(--fab-off); }

.qm-os-toast-content { flex: 1; min-width: 0; }
.qm-os-toast-title { font-family: var(--font-head); font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.qm-os-toast-msg { font-size: 13px; color: var(--c-sub); line-height: 1.3; }

/* Modal de Confirmación */
.qm-os-modal-backdrop {
    position: fixed; inset: 0;
    background: color-mix(in srgb, var(--c-bg) 50%, transparent);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 9995;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; visibility: hidden;
    transition: all 0.25s ease;
}
.qm-os-modal-active { opacity: 1; visibility: visible; }
.qm-os-modal-dialog {
    background: var(--c-card);
    color: var(--c-text-primary, var(--c-text));
    border: 1px solid var(--c-bdr);
    border-radius: 24px;
    width: 100%; max-width: 380px;
    padding: 22px; box-sizing: border-box;
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px color-mix(in srgb, var(--c-bg) 20%, transparent);
}
.qm-os-modal-active .qm-os-modal-dialog { transform: scale(1); }

.qm-os-modal-close-btn {
    background: transparent; border: none; outline: none;
    color: var(--c-sub); width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; margin: 0; transition: all 0.2s ease;
}
.qm-os-modal-close-btn:hover { background: var(--c-surface); color: var(--c-text-primary, var(--c-text)); }

.qm-fb-submit-btn {
    background: transparent; border: none; outline: none;
    color: var(--brand); width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; margin: 0; flex-shrink: 0; transition: all 0.2s ease;
}
.qm-fb-submit-btn:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }

.qm-os-modal-title { font-family: var(--font-head); font-size: 17px; font-weight: 800; margin: 0 0 10px 0; }
.qm-os-modal-body { font-size: 14px; color: var(--c-sub); line-height: 1.45; margin-bottom: 20px; }
.qm-os-modal-footer { display: flex; gap: 10px; justify-content: flex-end; }
.qm-os-modal-btn {
    padding: 10px 18px; border-radius: 18px; font-size: 13px; font-weight: 600;
    cursor: pointer; border: 1px solid var(--c-bdr);
    background: var(--c-surface); color: var(--c-text-primary, var(--c-text));
    transition: all 0.2s ease;
}
.qm-os-modal-btn.qm-btn-primary { background: var(--brand); color: var(--c-card); border-color: var(--brand); }
.qm-os-modal-btn.qm-btn-danger { background: var(--fab-off); color: var(--c-card); border-color: var(--fab-off); }

/* Bottom-Sheet Contextual */
.qm-os-sheet-backdrop {
    position: fixed; inset: 0;
    background: color-mix(in srgb, var(--c-bg) 50%, transparent);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex; flex-direction: column; justify-content: flex-end;
    opacity: 0; visibility: hidden; transition: all 0.25s ease;
}
.qm-os-sheet-active { opacity: 1; visibility: visible; }
.qm-os-sheet-dialog {
    background: var(--c-card);
    color: var(--c-text-primary, var(--c-text));
    border-top-left-radius: 28px; border-top-right-radius: 28px;
    padding: 20px 16px calc(20px + var(--safe-b));
    width: 100%; box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    max-height: 80vh; overflow-y: auto;
}
.qm-os-sheet-active .qm-os-sheet-dialog { transform: translateY(0); }
.qm-os-sheet-header {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text-primary, var(--c-text));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--c-bdr);
}
.qm-os-sheet-title {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 800;
    color: var(--c-text-primary, var(--c-text));
}
.qm-os-sheet-close {
    background: transparent;
    border: none;
    outline: none;
    color: var(--c-sub);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: background 0.2s ease, color 0.2s ease;
}
.qm-os-sheet-close:hover {
    background: var(--c-surface);
    color: var(--c-text-primary, var(--c-text));
}
.qm-os-sheet-list { display: flex; flex-direction: column; gap: 4px; }
.qm-os-sheet-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 14px 16px; border-radius: 16px;
    background: transparent; border: none;
    color: var(--c-text-primary, var(--c-text)); font-family: var(--font-body);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background 0.18s ease; text-align: left;
}
.qm-os-sheet-item:active, .qm-os-sheet-item:hover { background: var(--c-surface); }
.qm-os-sheet-item-danger { color: var(--fab-off); }
.qm-os-sheet-icon { display: flex; align-items: center; justify-content: center; color: inherit; }
.qm-os-sheet-cancel {
    margin-top: 12px; width: 100%; padding: 14px;
    border-radius: 20px; background: var(--c-surface);
    border: 1px solid var(--c-bdr); color: var(--c-text-primary, var(--c-text));
    font-family: var(--font-body); font-size: 14px; font-weight: 700; cursor: pointer;
}

/* Prompt y Custom Dialog Extensions */
.qm-os-prompt-dialog, .qm-os-custom-dialog { max-width: 440px; }
.qm-os-prompt-message { font-size: 13.5px; color: var(--c-sub); margin-bottom: 12px; line-height: 1.4; }
.qm-os-prompt-input {
    width: 100%; box-sizing: border-box; padding: 12px 14px;
    border-radius: 14px; border: 1px solid var(--c-bdr);
    background: var(--c-bg); color: var(--c-text-primary, var(--c-text));
    font-family: var(--font-body); font-size: 14px; outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.qm-os-prompt-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.qm-os-prompt-textarea { min-height: 84px; resize: vertical; }

/* ── Adaptaciones de Popups y Toasts para Escritorio (>= 769px) ── */
@media (min-width: 769px) {
    .qm-os-toast-container {
        top: 24px;
        bottom: auto;
        left: auto;
        right: 24px;
        transform: none;
        max-width: 380px;
        width: auto;
    }

    .qm-os-sheet-backdrop {
        justify-content: center;
        align-items: center;
        padding: 24px;
    }

    .qm-os-sheet-dialog {
        max-width: 480px;
        margin: auto;
        border-radius: 24px;
        border: 1px solid var(--c-bdr);
        box-shadow: 0 20px 60px color-mix(in srgb, var(--c-bg) 60%, transparent);
        transform: scale(0.92);
    }

    .qm-os-sheet-active .qm-os-sheet-dialog {
        transform: scale(1);
    }
}



/* === _kernel-select.css === */
/* ================================================================
   KERNEL SELECT & BOTTOM-SHEET PICKER (window.qmOS.select)
   ================================================================ */

.qm-os-select-sheet-dialog {
    max-height: 84vh;
    display: flex;
    flex-direction: column;
}

.qm-os-select-search-wrap {
    position: relative;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.qm-os-select-search-icon {
    position: absolute;
    left: 14px;
    color: var(--c-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#qm-pwa-shell .qm-os-select-search-input,
.qm-os-select-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px 12px 38px;
    border-radius: 14px;
    border: 1px solid var(--c-bdr);
    background: var(--c-surface);
    color: var(--c-text-primary, var(--c-text));
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#qm-pwa-shell .qm-os-select-search-input:focus,
.qm-os-select-search-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.qm-os-select-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(75vh - 160px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

.qm-os-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--c-text-primary, var(--c-text));
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
    text-align: left;
    box-sizing: border-box;
}

.qm-os-select-item:hover, .qm-os-select-item:active {
    background: var(--c-surface);
}

.qm-os-select-item-active {
    background: color-mix(in srgb, var(--brand) 10%, var(--c-card));
    border-color: color-mix(in srgb, var(--brand) 28%, transparent);
    color: var(--brand);
    font-weight: 700;
}

.qm-os-select-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.qm-os-select-subtext {
    font-size: 12px;
    color: var(--c-sub);
    font-weight: 400;
}

.qm-os-select-check {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    flex-shrink: 0;
}

.qm-os-select-empty {
    text-align: center;
    padding: 24px 12px;
    font-size: 13.5px;
    color: var(--c-sub);
}

/* Native Select Accessible Hidden & Custom Trigger */
.qm-native-select-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.qm-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--c-bdr);
    background: var(--c-card);
    color: var(--c-text-primary, var(--c-text));
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.qm-select-trigger:hover, .qm-select-trigger:focus-visible {
    border-color: var(--brand);
    outline: none;
}

.qm-select-trigger[aria-expanded="true"] {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.qm-select-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qm-select-trigger-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-sub);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.qm-select-trigger[aria-expanded="true"] .qm-select-trigger-chevron {
    transform: rotate(180deg);
}

.qm-select-trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    flex-shrink: 0;
}


/* === _kernel-sheet.css === */
/* ================================================================
   PRIMITIVA DEL KERNEL OS: TARJETA DESLIZABLE UNIVERSAL (QM-OS-SHEET)
   ================================================================ */

.qm-os-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: var(--c-card);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border: 1px solid var(--c-bdr);
    border-bottom: none;
    box-shadow: 0 -8px 32px color-mix(in srgb, var(--c-bg) 75%, transparent);
    z-index: 22; /* Capa 22: Por encima del mapa y feed, coordinada con la navbar flotante */
    display: flex;
    flex-direction: column;
    will-change: transform;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 0.25s ease;
    box-sizing: border-box;
    height: 100dvh;
    max-height: 100dvh;
}

/* Confinamiento de tarjetas dentro de viewports relativos del SO */
.qm-s0-viewport .qm-os-sheet,
.qm-s1-stage .qm-os-sheet,
.qm-os-viewport .qm-os-sheet {
    position: absolute;
    inset: 0;
    height: 100%;
    max-height: 100%;
}

/* Modificadores de Estado */
.qm-os-sheet.is-minimized {
    transform: translate3d(0, calc(100% - 68px), 0);
}

.qm-os-sheet.is-peek {
    transform: translate3d(0, calc(100% - 92px), 0);
}

.qm-os-sheet.is-half {
    transform: translate3d(0, 50%, 0);
}

.qm-os-sheet.is-expanded {
    transform: translate3d(0, 0, 0);
    border-radius: 0;
    border-top-color: transparent;
}

.qm-os-sheet.is-closed {
    transform: translate3d(0, 100%, 0);
    pointer-events: none;
}

.qm-os-sheet.is-dragging {
    transition: none;
}

/* Tirador Gestual Táctil */
.qm-os-sheet-handle {
    width: 100%;
    padding: 12px 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

.qm-os-sheet-bar {
    width: 44px;
    height: 5px;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--c-text-primary) 22%, transparent);
    transition: background 0.2s ease, width 0.2s ease;
}

.qm-os-sheet-handle:active .qm-os-sheet-bar,
.qm-os-sheet.is-dragging .qm-os-sheet-bar {
    background: var(--brand);
    width: 52px;
}

/* Cabecera y Contenido de la Tarjeta */
.qm-os-sheet .qm-os-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 18px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--c-bdr) 45%, transparent);
    flex-shrink: 0;
}

.qm-os-sheet .qm-os-sheet-title {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text-primary);
    margin: 0;
}

.qm-os-sheet .qm-os-sheet-body,
.qm-os-sheet .qm-os-sheet-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 18px calc(var(--nav-h) + var(--safe-b) + 32px);
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}


/* === _components.css === */
/* ================================================================
   NÚCLEO DEL SISTEMA OPERATIVO — 4 PRIMITIVAS VISUALES UNIVERSALES
   ================================================================ */

/* ── 1. QM-BUTTON: ACCIONES PRIMARIAS, SECUNDARIAS Y CIRCULARES ── */
.qm-btn,
.qm-btn-primary,
.qm-btn-secondary,
.qm-btn-ghost,
.qm-btn-circle,
.qm-btn-icon,
.qm-ob-continue-btn,
.qm-auth-primary-btn,
.qm-funnel-btn,
#qm-chat-send-btn,
#qm-s2-send-btn,
#qm-s3-track-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 9999px;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease;
}
.qm-btn:active,
.qm-btn-primary:active,
.qm-btn-secondary:active,
.qm-btn-ghost:active,
.qm-btn-circle:active,
.qm-btn-icon:active,
.qm-ob-continue-btn:active,
.qm-auth-primary-btn:active,
.qm-funnel-btn:active,
#qm-chat-send-btn:active,
#qm-s2-send-btn:active,
#qm-s3-track-btn:active {
    transform: scale(0.96);
}
.qm-btn-primary,
.qm-ob-continue-btn,
.qm-auth-primary-btn,
.qm-funnel-btn.qm-btn-primary,
#qm-chat-send-btn,
#qm-s2-send-btn,
#qm-s3-track-btn {
    background: var(--brand);
    color: #ffffff;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 30%, transparent);
}
.qm-gradient-active .qm-btn-primary,
.qm-gradient-active .qm-ob-continue-btn,
.qm-gradient-active .qm-auth-primary-btn,
.qm-gradient-active .qm-funnel-btn.qm-btn-primary,
.qm-gradient-active #qm-chat-send-btn,
.qm-gradient-active #qm-s3-track-btn,
.qm-gradient-active .qm-btn-circle.active,
.qm-gradient-active .qm-btn-circle.qm-btn-primary,
.qm-gradient-active .qm-btn-icon.active,
.qm-gradient-active .qm-btn-icon.qm-btn-primary {
    background: var(--theme-grad-action);
    color: #ffffff;
    box-shadow: var(--theme-glow-action);
}
.qm-btn-secondary,
.qm-funnel-btn.qm-btn-secondary {
    background: var(--c-surface);
    color: var(--c-text-primary);
    border: 1px solid var(--c-bdr);
}
.qm-btn-ghost {
    background: transparent;
    color: var(--c-text-primary);
    border: 1px solid transparent;
}
.qm-btn-ghost:hover {
    background: var(--c-surface);
}
.qm-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}
.qm-btn-lg {
    padding: 16px 28px;
    font-size: 16px;
}
.qm-btn-pill {
    border-radius: 9999px;
    padding: 8px 18px;
    font-size: 13px;
}
.qm-btn-circle,
.qm-btn-icon,
#qm-s2-send-btn {
    border-radius: 50%;
    padding: 0;
    width: 44px;
    height: 44px;
    aspect-ratio: 1/1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── 2. QM-SEGMENTED: CONTROLES DE PÍLDORA, MODOS Y TABS ── */
.qm-segmented-control,
.qm-ob-theme-pill,
.qm-s1-mode-switcher {
    display: inline-flex;
    background: var(--c-surface);
    border-radius: 9999px;
    padding: 4px;
    border: 1px solid var(--c-bdr);
    gap: 4px;
    box-sizing: border-box;
}
.qm-segmented-item,
.qm-ob-pill-btn,
.qm-s1-mode-btn,
.qm-s0-cat-btn,
.qm-plaza-filter-btn,
.qm-s1-cat-btn,
.qm-s4-theme-pill {
    background: transparent;
    border: none;
    padding: 7px 16px;
    border-radius: 9999px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--c-sub);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qm-segmented-item:active,
.qm-ob-pill-btn:active,
.qm-s1-mode-btn:active,
.qm-s0-cat-btn:active,
.qm-plaza-filter-btn:active,
.qm-s1-cat-btn:active,
.qm-s4-theme-pill:active {
    transform: scale(0.95);
}
.qm-segmented-item:hover,
.qm-ob-pill-btn:hover {
    color: var(--c-text-primary);
}
.qm-segmented-item.active,
.qm-ob-pill-btn.active,
.qm-s1-mode-btn.active,
.qm-s0-cat-btn.active,
.qm-plaza-filter-btn.active,
.qm-s1-cat-btn.active,
.qm-s4-theme-pill.active {
    background: var(--brand);
    color: #ffffff;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 35%, transparent);
}
.qm-gradient-active .qm-segmented-item.active,
.qm-gradient-active .qm-ob-pill-btn.active,
.qm-gradient-active .qm-s1-mode-btn.active,
.qm-gradient-active .qm-s0-cat-btn.active,
.qm-gradient-active .qm-plaza-filter-btn.active,
.qm-gradient-active .qm-s1-cat-btn.active,
.qm-gradient-active .qm-s4-theme-pill.active {
    background: var(--theme-grad-triad);
    color: #ffffff;
    box-shadow: var(--theme-glow-ambient);
}

/* ── 3. QM-FIELD: CAMPOS DE ENTRADA, FORMULARIOS Y DROPDOWNS ── */
.qm-field:not(.qm-s0-search-input):not(.qm-s1-search-input):not(.qm-os-select-search-input),
#qm-pwa-shell .qm-field:not(.qm-s0-search-input):not(.qm-s1-search-input):not(.qm-os-select-search-input),
#qm-pwa-shell input:not([type="checkbox"]):not([type="radio"]):not(.qm-s0-search-input):not(.qm-s1-search-input):not(.qm-os-select-search-input),
#qm-pwa-shell select,
#qm-pwa-shell textarea,
.qm-ob-select,
.qm-s2-textarea,
.qm-s3-input {
    width: 100%;
    background: var(--c-card);
    border: 1px solid var(--c-bdr);
    color: var(--c-text-primary);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#qm-pwa-shell input[type="file"],
.qm-field[type="file"] {
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    background: var(--c-surface);
}
#qm-pwa-shell input[type="file"]::file-selector-button,
.qm-field[type="file"]::file-selector-button {
    background: var(--brand);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-right: 12px;
    transition: filter 0.2s ease;
}
#qm-pwa-shell input[type="file"]::file-selector-button:hover,
.qm-field[type="file"]::file-selector-button:hover {
    filter: brightness(1.1);
}
.qm-field:focus,
#qm-pwa-shell input:focus,
#qm-pwa-shell select:focus,
#qm-pwa-shell textarea:focus,
.qm-ob-select:focus,
.qm-s0-search-input:focus,
.qm-s1-search-input:focus,
.qm-s2-textarea:focus,
.qm-s3-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 30%, transparent);
}
.qm-gradient-active .qm-field:focus,
.qm-gradient-active #qm-pwa-shell input:focus,
.qm-gradient-active #qm-pwa-shell select:focus,
.qm-gradient-active #qm-pwa-shell textarea:focus,
.qm-gradient-active .qm-ob-select:focus,
.qm-gradient-active .qm-s0-search-input:focus,
.qm-gradient-active .qm-s1-search-input:focus,
.qm-gradient-active .qm-s2-textarea:focus,
.qm-gradient-active .qm-s3-input:focus {
    border-color: var(--brand);
    box-shadow: var(--theme-glow-focus);
}

/* ── 4. QM-SURFACE: TARJETAS, PANELES Y VENTANAS (FONDOS SIEMPRE PLANOS) ── */
.qm-surface,
.qm-card,
.qm-s0-cat-item,
.qm-s0-item-card,
.qm-plaza-card,
.qm-s1-place-card,
.qm-s3-info-panel,
.qm-s3-card,
.qm-s4-card,
.qm-s4-vip-card,
.qm-ob-typo-panel,
.qm-window-sheet,
.qm-window-dialog,
.qm-os-window,
.qm-os-inline-window,
.qm-fb-publisher-bar {
    background-color: var(--c-card);
    border: 1px solid var(--c-bdr);
    border-radius: 18px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.qm-gradient-active .qm-surface,
.qm-gradient-active .qm-card,
.qm-gradient-active .qm-s0-cat-item,
.qm-gradient-active .qm-s0-item-card,
.qm-gradient-active .qm-plaza-card,
.qm-gradient-active .qm-s1-place-card,
.qm-gradient-active .qm-s3-info-panel,
.qm-gradient-active .qm-s3-card,
.qm-gradient-active .qm-s4-card,
.qm-gradient-active .qm-s4-vip-card,
.qm-gradient-active .qm-ob-typo-panel,
.qm-gradient-active .qm-window-sheet,
.qm-gradient-active .qm-window-dialog,
.qm-gradient-active .qm-os-window,
.qm-gradient-active .qm-os-inline-window,
.qm-gradient-active .qm-fb-publisher-bar {
    background-color: var(--c-card);
    border: 1.5px solid color-mix(in srgb, var(--brand) 40%, var(--c-bdr));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* Chatbot embebido en Slot 2 */
#qm-organic-window {
    z-index: 1; border-radius: 0; padding-bottom: 0; box-sizing: border-box;
    position: relative; top: auto; left: auto; right: auto; width: 100%; height: 100%;
    max-height: none; flex-direction: column; transform: none; visibility: visible; display: flex; box-shadow: none;
}
.qm-chat-embedded-mode .qm-o-header, .qm-chat-embedded-mode .qm-o-close { display: none; }

/* Islas de ventanas del SO en Chatbot */
#qm-os-window-body .qm-os-native-header { display: none; }
.qm-os-inline-window {
    width: 100%; max-width: 100%; box-sizing: border-box; margin: 12px 0; padding: 14px;
    background: var(--c-card); border: 1px solid var(--c-bdr); border-radius: 16px;
    box-shadow: 0 4px 20px color-mix(in srgb, var(--c-text-primary) 8%, transparent);
    display: flex; flex-direction: column; height: auto; min-height: max-content;
    overflow: visible; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.qm-os-inline-window .qm-os-inline-header {
    display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px;
    margin-bottom: 12px; border-bottom: 1px solid var(--c-bdr); width: 100%; box-sizing: border-box; flex-shrink: 0;
}
.qm-os-inline-window .qm-os-inline-title {
    font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--c-text-primary); display: flex; align-items: center; gap: 6px;
}
.qm-os-inline-window .qm-os-btn-expand {
    background: var(--c-surface); border: 1px solid var(--c-bdr); color: var(--brand);
    font-family: var(--font-body); font-size: 11px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 8px;
    box-shadow: none; outline: none; height: auto; min-height: 0; line-height: 1; transition: all 0.15s ease;
}
.qm-os-inline-window .qm-os-btn-expand:hover { border-color: var(--brand); background: var(--c-card); }
.qm-os-inline-window .qm-os-native-header { display: none; }
.qm-os-inline-window .qm-mkt-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px; max-height: 420px; overflow-y: auto; width: 100%; box-sizing: border-box; padding-right: 2px;
}
.qm-os-inline-window .qm-b2b-form-card { padding: 10px; max-height: 480px; overflow-y: auto; }


/* === _pwa-onboarding.css === */
/* ================================================================
   ONBOARDING OVERLAY — Pantalla 0 (Personalización visual)
   Diseño de Alta Gama: Liquid Glass, Neón Ambient Glow & Tríada Armónica
   ================================================================ */
.qm-onboarding-overlay {
    position: fixed; inset: 0; z-index: 1;
    background: var(--c-bg);
    display: flex; align-items: stretch; justify-content: center;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.qm-ob-inner {
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column; justify-content: space-between;
    gap: 20px; padding: 44px 24px 28px; box-sizing: border-box; min-height: 100dvh;
}

/* Header */
.qm-ob-header { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.qm-ob-title {
    font-family: var(--font-head); font-size: clamp(22px, 5vw, 28px);
    font-weight: 800; color: var(--c-text-primary); margin: 0; line-height: 1.2; letter-spacing: -0.5px;
}
.qm-ob-sub { font-family: var(--font-body); font-size: 14px; color: var(--c-sub); margin: 0; line-height: 1.4; }
.qm-ob-notice {
    font-family: var(--font-body); font-size: 13px; color: var(--c-sub);
    margin: 4px auto 0; line-height: 1.45; max-width: 360px; opacity: 0.85;
}

/* ── Píldora de modos (Claro / Oscuro / Automático) ────────────── */
.qm-ob-theme-pill-container { display: flex; justify-content: center; }
.qm-ob-theme-pill {
    display: inline-flex; background: var(--c-surface);
    border-radius: 9999px; padding: 4px; border: 1px solid var(--c-bdr);
    gap: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.qm-ob-pill-btn {
    background: transparent; border: none; padding: 8px 18px;
    border-radius: 9999px; font-family: var(--font-body); font-size: 13px; font-weight: 600;
    color: var(--c-sub); cursor: pointer; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}
.qm-ob-pill-btn:hover { color: var(--c-text-primary); }
.qm-ob-pill-btn.active {
    background: var(--theme-grad-action);
    color: #ffffff;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--brand) 40%, transparent);
}

/* ── Fila de Switch de Acabado Vibrante ────────────────────────── */
.qm-ob-gradient-toggle-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; background: var(--c-surface);
    border: 1px solid var(--c-bdr);
    border-radius: 9999px; box-sizing: border-box; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.qm-gradient-active .qm-ob-gradient-toggle-card {
    border-color: color-mix(in srgb, var(--brand) 60%, var(--c-bdr));
    box-shadow: 0 0 18px color-mix(in srgb, var(--brand) 30%, transparent);
}
.qm-ob-toggle-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--c-text-primary); }
.qm-ob-toggle-right { display: flex; align-items: center; gap: 12px; }
.qm-ob-toggle-status { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--c-sub); transition: color 0.25s ease; }
.qm-ob-toggle-status.active { color: var(--c-text-primary); }

/* ── Grid Auto-Adaptativo para N Paletas (Sin :nth-child ni transforms) ── */
.qm-ob-presets-grid {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 16px 14px; max-width: 360px; margin: 0 auto; width: 100%; box-sizing: border-box;
}
.qm-ob-bubble-wrapper {
    flex: 0 0 98px; display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.qm-ob-bubble-wrapper:hover { transform: scale(1.05); }

.qm-ob-bubble {
    width: 98px; height: 48px; border-radius: 9999px;
    border: 1.5px solid var(--preset-border, var(--c-bdr));
    box-sizing: border-box; overflow: hidden; position: relative;
    background: var(--preset-gradient, var(--c-surface));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.qm-ob-bubble.active {
    border-color: #ffffff; transform: scale(1.05);
    box-shadow: 0 0 24px var(--preset-glow, color-mix(in srgb, var(--brand) 80%, transparent)), 0 0 45px color-mix(in srgb, var(--preset-border, var(--brand)) 40%, transparent);
}
.qm-ob-bubble-label {
    font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--c-text-primary); letter-spacing: 0.2px;
}

/* ── Panel de Tipografía ──────────────────────────────────────── */
.qm-ob-typo-panel {
    background: var(--c-surface); border-radius: 24px; padding: 18px;
    border: 1px solid var(--c-bdr);
    display: flex; flex-direction: column; gap: 14px; transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.qm-gradient-active .qm-ob-typo-panel {
    border-color: color-mix(in srgb, var(--brand) 40%, var(--c-bdr));
    box-shadow: 0 0 20px color-mix(in srgb, var(--brand) 20%, transparent);
}
.qm-ob-typo-preview {
    background: var(--c-card); border: 1px dashed var(--c-bdr);
    border-radius: 14px; padding: 16px; text-align: center; font-size: 14px; font-weight: 700;
    color: var(--c-text-primary); transition: all 0.2s ease; min-height: 48px;
    display: flex; align-items: center; justify-content: center;
}
.qm-ob-typo-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qm-ob-typo-control { display: flex; flex-direction: column; gap: 6px; }
.qm-ob-typo-label {
    font-family: var(--font-body); font-size: 11px; font-weight: 700; color: var(--c-sub);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.qm-ob-select,
.qm-select-trigger.qm-ob-select {
    width: 100%; background: var(--c-card);
    border: 1px solid var(--c-bdr);
    color: var(--c-text-primary); border-radius: 12px; padding: 10px 14px;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; outline: none; box-sizing: border-box; cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.qm-ob-select:focus,
.qm-select-trigger.qm-ob-select:focus,
.qm-select-trigger.qm-ob-select[aria-expanded="true"] {
    border-color: var(--brand);
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 35%, transparent);
}

.qm-select-trigger.qm-phone-country-select {
    background: transparent;
    border: none;
    padding: 10px 4px;
    max-width: 140px;
    flex-shrink: 0;
}
.qm-select-trigger.qm-phone-country-select .qm-select-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 600;
}

/* ── Footer ───────────────────────────────────────────────────── */
.qm-ob-footer { padding-top: 6px; }
.qm-ob-continue-btn {
    width: 100%;
    background: var(--theme-grad-action);
    color: #ffffff; border: none; border-radius: 9999px; padding: 18px 24px;
    font-family: var(--font-head); font-size: 16px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: var(--theme-glow-action);
    transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.qm-ob-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px color-mix(in srgb, var(--brand) 70%, transparent), 0 4px 14px color-mix(in srgb, var(--brand) 45%, transparent);
    filter: brightness(1.05);
}
.qm-ob-continue-btn:active { transform: scale(0.98); }


/* === _pwa-funnel.css === */
/* ================================================================
   PWA EMBUTIDO DE ONBOARDING Y REGISTRO (PANTALLAS 1 A 2 Y BASE)
   Diseño de Alta Gama: Liquid Glass, Tríada Armónica & Cero FOUC
   ================================================================ */

/* ── Ocultar nav inferior via CSS puro cuando los overlays están activos ── */
body:has(#qm-onboarding-overlay[style*="flex"]) #qm-pwa-bottom-nav,
body:has(#qm-funnel-overlay[style*="flex"])      #qm-pwa-bottom-nav {
    display: none;
    pointer-events: none;
}

body.qm-onboarding-active #qm-pwa-bottom-nav {
    display: none;
    pointer-events: none;
}

.qm-funnel-overlay {
    position: fixed;
    inset: 0;
    z-index: 105;
    background: var(--c-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px 32px;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.qm-funnel-overlay > .qm-funnel-step {
    width: 100%;
    max-width: 480px;
}

.qm-funnel-overlay.active {
    opacity: 1;
}

.qm-funnel-step {
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: calc(100dvh - 80px);
    opacity: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.qm-funnel-step.qm-funnel-active {
    display: flex;
    opacity: 1;
}

.qm-funnel-header {
    text-align: center;
    margin-top: 5vh;
    margin-bottom: auto;
}

.qm-funnel-title {
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 800;
    color: var(--c-text-primary);
    margin: 0 0 10px 0;
}

.qm-funnel-sub {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--c-sub);
    margin: 0 auto;
    max-width: 320px;
    line-height: 1.4;
}

/* Opciones de la pantalla 1 */
.qm-funnel-options-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 360px;
    margin: auto auto 5vh auto;
}

.qm-funnel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    border-radius: 16px;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.qm-funnel-btn:active {
    transform: scale(0.97);
}

.qm-btn-primary {
    background: var(--brand);
    color: var(--c-bg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.qm-btn-secondary {
    background: var(--c-surface);
    color: var(--c-text-primary);
    border: 1px solid var(--c-bdr);
}

.qm-funnel-btn-text {
    background: transparent;
    color: var(--c-sub);
    border: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s;
}

.qm-funnel-btn-text:hover {
    color: var(--c-text-primary);
}

/* Pantalla 2: Onda de Sonido y Input */
.qm-soundwave-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    height: 60px;
    margin: auto;
}

.qm-soundwave-bar {
    width: 4px;
    height: 4px;
    background: var(--brand);
    border-radius: 2px;
    transition: height 0.1s ease-out;
}

.qm-input-container {
    display: flex;
    align-items: center;
    background: var(--c-surface);
    border: 1px solid var(--c-bdr);
    border-radius: 18px;
    padding: 6px 10px 6px 20px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto auto auto;
    transition: border-color 0.2s;
}

.qm-input-container:focus-within {
    border-color: var(--brand);
}

.qm-funnel-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--c-text-primary);
    padding: 10px 0;
}

#qm-step-phone-otp-wrapper {
    display: none;
    opacity: 0;
    margin-top: 15px;
}

#qm-input-phone-otp {
    text-align: center;
    letter-spacing: 4px;
}

.qm-funnel-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--c-bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.qm-funnel-circle-btn:active {
    transform: scale(0.9);
}


/* === _pwa-funnel-steps.css === */
/* ================================================================
   PWA EMBUTIDO DE ONBOARDING Y REGISTRO (PANTALLAS 3 Y 4)
   Diseño de Alta Gama: Liquid Glass, Tríada Armónica & Cero FOUC
   ================================================================ */

/* Pantalla 3: Segmentación de Roles (Lista Vertical) */
.qm-roles-scroll-wrapper {
    width: 100%;
    overflow-y: auto;
    max-height: 50vh;
    padding: 10px 0;
    margin: auto;
    -webkit-overflow-scrolling: touch;
}

.qm-roles-scroll-wrapper::-webkit-scrollbar {
    width: 4px;
}
.qm-roles-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--c-bdr);
    border-radius: 4px;
}

.qm-roles-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    width: 100%;
}

.qm-role-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 20px;
    gap: 16px;
    width: 100%;
    height: auto;
    background: var(--c-surface);
    border: 1px solid var(--c-bdr);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    transform: translateY(10px);
}

.qm-role-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.qm-role-card.active {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 8%, var(--c-surface));
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    transform: translateY(-4px);
}

.qm-role-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand) 10%, transparent);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qm-role-card.active .qm-role-icon {
    background: var(--brand);
    color: var(--c-bg);
}

.qm-role-text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
    padding-right: 8px;
}

.qm-role-title {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text-primary);
    text-align: left;
}

.qm-role-desc {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--c-sub);
    line-height: 1.3;
}

.qm-funnel-footer {
    width: 100%;
    max-width: 360px;
    margin: 0 auto auto auto;
}

/* Pantalla 4: Procedencia */
.qm-procedencia-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
    max-width: 360px;
    margin: auto;
}

.qm-procedencia-btn {
    flex: 1;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: var(--c-surface);
    border: 1px solid var(--c-bdr);
    border-radius: 24px;
    cursor: pointer;
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text-primary);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.qm-procedencia-btn:hover,
.qm-procedencia-btn:active {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 8%, var(--c-surface));
    transform: translateY(-4px);
}

.qm-procedencia-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--brand) 10%, transparent);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}


/* === _pwa-funnel-voice.css === */
/* ================================================================
   PWA EMBUTIDO DE ONBOARDING Y REGISTRO (PANTALLAS 5 A 6 Y VOZ)
   Diseño de Alta Gama: Liquid Glass, Tríada Armónica & Cero FOUC
   ================================================================ */

/* Pantalla 5: IA Climax Subsections */
.qm-ai-pause-container {
    display: none;
    flex-direction: column;
    height: 100%;
}

.qm-ai-countdown-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    gap: 30px;
}

.qm-ai-fallback-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    text-align: center;
    gap: 20px;
}

.qm-ai-success-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    text-align: center;
    gap: 20px;
    width: 100%;
    max-width: 360px;
}

.qm-active-substep {
    display: flex;
}

/* Cronómetro Circular */
.qm-countdown-circle-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qm-countdown-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.qm-countdown-bg {
    fill: none;
    stroke: var(--c-bdr);
    stroke-width: 6;
}

.qm-countdown-progress {
    fill: none;
    stroke: var(--brand);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.qm-countdown-circle-wrapper.tension {
    animation: countdownTensionPulse 1s infinite alternate;
}

@keyframes countdownTensionPulse {
    0%   { transform: scale(1); filter: drop-shadow(0 0 0px transparent); }
    100% { transform: scale(1.03); filter: drop-shadow(0 0 10px var(--brand)); }
}

.qm-countdown-timer-text {
    font-family: var(--font-head);
    font-size: 48px;
    font-weight: 800;
    color: var(--c-text-primary);
    position: relative;
    z-index: 2;
}

.qm-countdown-mic-icon {
    position: absolute;
    bottom: -10px;
    background: var(--brand);
    color: var(--c-bg);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 3;
}

.pulse-mic {
    animation: micActivePulse 1.5s infinite;
}

@keyframes micActivePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.qm-countdown-label {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--c-text-primary);
}

/* Fallback de Teclado */
.qm-fallback-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--c-text-primary);
    margin: 0;
}

.qm-fallback-sub {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--c-sub);
    margin: 0;
    max-width: 280px;
}

/* Éxito */
.qm-success-shield {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--c-success) 12%, transparent);
    color: var(--c-success);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleInSuccess 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleInSuccess {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.qm-success-title {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text-primary);
    margin: 0;
}

.qm-success-summary {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--c-sub);
    background: var(--c-surface);
    border: 1px solid var(--c-bdr);
    border-radius: 16px;
    padding: 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Pantalla 6: Cierre */
.qm-closing-icon-wrapper {
    color: var(--c-success);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.qm-closing-action-container {
    width: 100%;
    max-width: 360px;
    margin: auto auto 5vh auto;
}

.qm-btn-whatsapp-active {
    background: var(--c-success);
    color: var(--c-text-primary);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--c-success) 30%, transparent);
    animation: pulseWhatsAppBtn 2s infinite;
}

@keyframes pulseWhatsAppBtn {
    0% { transform: scale(1); box-shadow: 0 8px 25px color-mix(in srgb, var(--c-success) 30%, transparent); }
    50% { transform: scale(1.02); box-shadow: 0 8px 30px color-mix(in srgb, var(--c-success) 50%, transparent); }
    100% { transform: scale(1); box-shadow: 0 8px 25px color-mix(in srgb, var(--c-success) 30%, transparent); }
}

/* ── Estilos para selector de país en Onboarding ── */
#qm-select-phone-country {
    padding: 10px 18px 10px 8px;
    max-width: 90px;
    width: 90px;
    box-sizing: border-box;
    background-color: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--c-text-primary);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#qm-select-phone-country option {
    background-color: var(--c-surface);
    color: var(--c-text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 12px 16px;
    display: block;
    width: auto;
}


/* === _b2b-forms.css === */
/* ================================================================
   B2B & ONBOARDING FORMS — PWA SHELL
   ================================================================ */

.chat-form-container {
    padding: 6px 0 16px;
    width: 100%;
    box-sizing: border-box;
}

.chat-form-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 18px;
    padding: 0 10px;
}

.chat-form-progress-bar {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--c-bdr);
    transform: translateY(-50%);
    z-index: 1;
}

.progress-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c-bg);
    border: 2px solid var(--c-bdr);
    color: var(--c-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    position: relative;
    z-index: 2;
    transition: all 0.2s ease;
}

.progress-dot.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.progress-dot.completed {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: qmFadeIn 0.2s ease;
}

.qm-form-header {
    margin-bottom: 12px;
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-form-header-danger {
    color: var(--badge);
}

.qm-form-sub {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--c-sub);
    margin: 0 0 14px 0;
    line-height: 1.4;
}

.qm-form-submit-btn {
    width: 100%;
    background: var(--brand);
    color: #ffffff;
    border: 1px solid var(--c-bdr);
    padding: 13px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.qm-form-submit-btn:hover {
    filter: brightness(1.08);
}

.qm-form-submit-btn:active {
    transform: scale(0.98);
}

.qm-b2b-field {
    margin-bottom: 14px;
}

.qm-b2b-field label {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--c-text);
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

.qm-b2b-field input,
.qm-b2b-field select,
.qm-b2b-field textarea {
    width: 100%;
    background: var(--c-surface);
    border: 1px solid var(--c-bdr);
    color: var(--c-text-primary);
    border-radius: 10px;
    padding: 10px 12px;
    box-sizing: border-box;
    outline: none;
    font-size: 13px;
    font-family: var(--font-body);
    transition: border-color 0.15s;
}

.qm-b2b-field input[type="file"] {
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    background: var(--c-surface);
}

.qm-b2b-field input[type="file"]::file-selector-button {
    background: var(--brand);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-right: 10px;
    transition: filter 0.2s ease;
}

.qm-b2b-field input[type="file"]::file-selector-button:hover {
    filter: brightness(1.1);
}

.qm-b2b-field input:focus,
.qm-b2b-field select:focus,
.qm-b2b-field textarea:focus {
    border-color: var(--brand);
}

.qm-b2b-step-nav {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.qm-form-sec-btn {
    background: var(--c-bg);
    border: 1px solid var(--c-bdr);
    color: var(--c-sub);
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.qm-form-sec-btn:hover {
    color: var(--c-text);
    border-color: var(--brand);
}

.qm-gps-capture-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
}

.qm-gps-feedback {
    font-family: var(--font-body);
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.3;
}

.qm-b2b-welcome-note {
    display: flex;
    align-items: center;
    gap: 8px;
    background: color-mix(in srgb, var(--brand) 12%, var(--c-surface));
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--brand);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.qm-sos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.qm-sos-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: var(--c-bg);
    border: 1px solid var(--c-bdr);
    border-radius: 12px;
    color: var(--c-text);
    text-decoration: none;
    transition: all 0.15s ease;
}

.qm-sos-card:hover,
.qm-sos-card:active {
    border-color: var(--brand);
    transform: scale(0.98);
}

.qm-sos-num {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 800;
    color: var(--brand);
}

.qm-sos-label {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--c-sub);
    margin-top: 2px;
}


/* === _slot-base.css === */
/* Skeleton Loaders for Slot 0 & Slot 1 Cards while GPS/Search is loading */
@keyframes qmSkeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.qm-card-loading .qm-s1-biz-img,
.qm-card-loading .qm-s1-biz-img-placeholder {
    background: linear-gradient(90deg, var(--c-bdr) 25%, color-mix(in srgb, var(--brand) 10%, var(--c-bdr)) 37%, var(--c-bdr) 63%);
    background-size: 200% 100%;
    animation: qmSkeletonShimmer 1.5s infinite linear;
    color: transparent;
}
.qm-card-loading .qm-s1-biz-cat,
.qm-card-loading .qm-s1-biz-name,
.qm-card-loading .qm-s1-biz-excerpt {
    background: linear-gradient(90deg, var(--c-bdr) 25%, color-mix(in srgb, var(--brand) 10%, var(--c-bdr)) 37%, var(--c-bdr) 63%);
    background-size: 200% 100%;
    animation: qmSkeletonShimmer 1.5s infinite linear;
    color: transparent;
    border-radius: 4px;
}

/* Query highlight */
.qm-highlight {
    background: rgba(var(--brand-rgb), 0.3);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}

/* Lazy loaded images with smooth fade-in */
.qm-lazy-img {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}
.qm-lazy-img.loaded {
    opacity: 1;
}


/* === _slot-0.css === */
/* ================================================================
   SLOT 0 — INICIO & LA PLAZA (ORQUESTADOR MODULAR)
   Arquitectura de Primitivas Universales del SO (< 350 líneas)
   ================================================================ */





/* === _slot-0-catalog.css === */
/* ================================================================
   SLOT 0 — CATÁLOGO DE NEGOCIOS & FILTROS DE CATEGORÍAS
   Arquitectura de Primitivas Universales del SO (< 220 líneas)
   100% Tokens de Tema CSS (Regla 9)
   ================================================================ */

.qm-s0-catalog-wrapper { width: 100%; }

.qm-s0-catalog-search-wrap {
    display: flex; gap: 12px; margin-bottom: 18px; align-items: center; width: 100%;
}

.qm-s0-search-inner {
    position: relative; flex: 1; min-width: 0; display: flex; align-items: center;
}

.qm-s0-search-icon {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    color: var(--c-sub); pointer-events: none; z-index: 2; display: flex; align-items: center;
}

#qm-pwa-shell .qm-s0-search-input,
#qm-pwa-shell #qm-s0-cat-search,
#qm-pwa-shell input.qm-s0-search-input {
    width: 100%; box-sizing: border-box; background: var(--c-card);
    border: 1px solid var(--c-bdr); border-radius: 28px; padding: 12px 16px 12px 48px;
    color: var(--c-text-primary); font-family: var(--font-body); font-size: 15px;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s; height: 52px;
}

#qm-pwa-shell .qm-s0-search-input:focus,
#qm-pwa-shell #qm-s0-cat-search:focus,
#qm-pwa-shell input.qm-s0-search-input:focus {
    border-color: var(--brand); box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 30%, transparent);
}

#qm-pwa-shell .qm-s0-search-input::placeholder,
#qm-pwa-shell #qm-s0-cat-search::placeholder,
#qm-pwa-shell input.qm-s0-search-input::placeholder { color: var(--c-sub); }

.qm-s0-view-switcher {
    position: relative; flex-shrink: 0; display: flex; background: var(--c-surface);
    border: 1px solid var(--c-bdr); border-radius: 14px; padding: 2px; height: 44px;
    box-sizing: border-box; width: 90px;
}

#qm-pwa-shell .qm-view-btn {
    position: relative; z-index: 1; background: transparent; border: none; padding: 0;
    border-radius: 12px; color: var(--c-sub); cursor: pointer; transition: color 0.2s;
    display: flex; align-items: center; justify-content: center; width: 50%; height: 100%;
}

#qm-pwa-shell .qm-view-btn.active { color: var(--brand); }

.qm-s0-view-bubble {
    position: absolute; top: 2px; left: 2px; height: calc(100% - 4px); width: calc(50% - 2px);
    background: var(--c-card); border-radius: 12px; z-index: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); pointer-events: none;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--c-bg) 50%, transparent); border: 1px solid var(--c-bdr); box-sizing: border-box;
}

.qm-s0-view-switcher.is-list .qm-s0-view-bubble { transform: translateX(100%); }

.qm-s0-catalog-cats {
    display: inline-flex; background: var(--c-surface); border-radius: 9999px;
    padding: 4px; border: 1px solid var(--c-bdr); gap: 4px; box-sizing: border-box;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-bottom: 18px; max-width: 100%;
}
.qm-s0-catalog-cats::-webkit-scrollbar { display: none; }

.qm-s0-cat-btn {
    background: transparent; border: none; padding: 7px 16px; border-radius: 9999px;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--c-sub);
    cursor: pointer; transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-tap-highlight-color: transparent; display: inline-flex; align-items: center;
    gap: 6px; white-space: nowrap;
}
.qm-s0-cat-btn:hover { color: var(--c-text-primary); }
.qm-s0-cat-btn.active {
    background: var(--brand); color: var(--c-card);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 35%, transparent);
}

.qm-s0-catalog-container { display: grid; gap: 16px; }

.qm-s0-catalog-container.view-netflix {
    display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; gap: 16px;
    margin-left: -18px; margin-right: -18px; padding: 0 18px 12px; box-sizing: border-box;
}
.qm-s0-catalog-container.view-netflix::-webkit-scrollbar { display: none; }

.qm-s0-catalog-container.view-list {
    grid-template-columns: 1fr; gap: 12px; margin-left: 0; margin-right: 0;
    padding-left: 0; padding-right: 0;
}

.qm-s0-cat-item {
    position: relative; background: var(--c-card); border: 1px solid var(--c-bdr);
    border-radius: 24px; overflow: hidden; display: flex;
    transition: transform 0.2s, box-shadow 0.2s; -webkit-tap-highlight-color: transparent;
    cursor: pointer; box-shadow: 0 4px 16px color-mix(in srgb, var(--c-bg) 40%, transparent);
}
.qm-s0-cat-item:active { transform: scale(0.98); }

/* Vista Cuadrícula Netflix */
.view-netflix .qm-s0-cat-item {
    flex: 0 0 148px; scroll-snap-align: start; flex-direction: column;
}
.view-netflix .qm-s0-cat-img-box {
    position: relative; width: 100%; aspect-ratio: 4/5; overflow: hidden; background: var(--c-surface);
}
.view-netflix .qm-s0-cat-img { width: 100%; height: 100%; object-fit: cover; }
.view-netflix .qm-s0-cat-img-ph {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 30%, var(--c-surface)) 0%, var(--c-card) 100%);
    color: var(--brand); display: flex; align-items: center; justify-content: center;
}

#qm-pwa-shell .qm-s0-catalog-container.view-netflix .qm-s0-cat-item .qm-s0-cat-actions {
    position: absolute; top: 8px; right: 8px; display: flex; flex-direction: row; gap: 6px; z-index: 10;
}
#qm-pwa-shell .qm-s0-cat-item .qm-cat-action-fav,
#qm-pwa-shell .qm-s0-cat-item .qm-cat-action-follow {
    width: 32px; height: 32px; border-radius: 50%;
    background: color-mix(in srgb, var(--c-surface) 85%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--c-bdr); color: var(--c-text-primary);
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
#qm-pwa-shell .qm-s0-cat-item .qm-cat-action-fav:hover,
#qm-pwa-shell .qm-s0-cat-item .qm-cat-action-follow:hover {
    transform: scale(1.08); border-color: var(--brand); color: var(--brand);
}
#qm-pwa-shell .qm-s0-cat-item .qm-cat-action-fav.active {
    color: var(--badge); border-color: var(--badge);
    background: color-mix(in srgb, var(--badge) 20%, var(--c-surface));
}

/* Píldora Glassmorphism de Categoría */
.qm-s0-cat-badge-pill {
    position: absolute; bottom: 8px; left: 8px; z-index: 10;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 9999px;
    background: color-mix(in srgb, var(--c-surface) 80%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--c-bdr));
    color: var(--c-text-primary); font-family: var(--font-body);
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--c-bg) 50%, transparent);
    pointer-events: none; max-width: calc(100% - 16px);
}
.qm-s0-cat-badge-pill svg {
    color: var(--brand); flex-shrink: 0;
}
.qm-s0-cat-badge-pill span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.view-netflix .qm-s0-cat-body {
    padding: 10px 12px; display: flex; flex-direction: column; gap: 3px;
    background: var(--c-card); border-top: 1px solid var(--c-bdr); min-height: 65px; box-sizing: border-box;
}
.view-netflix .qm-s0-cat-name {
    color: var(--c-text-primary); font-family: var(--font-head); font-size: 14px;
    font-weight: 800; margin: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qm-s0-cat-subtext {
    font-size: 11.5px; color: var(--c-sub); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qm-s0-cat-meta-row {
    display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--c-sub); margin-top: 4px; font-weight: 600;
}
.qm-s0-cat-rating { color: var(--brand); font-weight: 700; }
.qm-s0-cat-bullet { opacity: 0.5; }

/* Vista Lista */
.view-list .qm-s0-cat-item {
    flex: 0 0 100%; width: 100%; flex-direction: row; padding: 12px; gap: 12px; align-items: center; border-radius: 16px;
}
.view-list .qm-s0-cat-img-box {
    width: 64px; height: 64px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--c-surface);
}
.view-list .qm-s0-cat-img { width: 100%; height: 100%; object-fit: cover; }
.view-list .qm-s0-cat-body {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; background: transparent; padding: 0;
}
.view-list .qm-s0-cat-name {
    font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--c-text-primary); margin: 0;
}

/* Paginación */
.qm-s0-pagination-wrap {
    display: none; align-items: center; justify-content: center; gap: 12px;
    margin-top: 18px; margin-bottom: 12px; width: 100%;
}
#qm-pwa-shell .qm-s0-page-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--c-card); border: 1px solid var(--c-bdr); color: var(--c-text-primary);
    padding: 8px 16px; border-radius: 20px; font-family: var(--font-body); font-size: 13px;
    font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.qm-s0-page-text {
    font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--c-sub); padding: 0 4px;
}

/* ── Adaptaciones de Escritorio para Slot 0 (>= 769px Full-Bleed) ── */
@media (min-width: 769px) {
    .qm-s0-viewport {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 28px;
        padding: 16px 32px 48px;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin: 0;
        align-items: start;
        overflow-x: hidden;
    }

    /* Columna 1 (Izquierda): La Plaza (CUERPO PRINCIPAL FULL-BLEED) */
    .qm-s0-viewport #qm-s0-plaza-sheet {
        grid-column: 1; grid-row: 1;
        position: relative; inset: auto; transform: none; margin: 0;
        max-width: 100%; min-width: 0;
        border-radius: 20px; border: 1px solid var(--c-bdr); background: var(--c-surface);
        box-shadow: 0 4px 24px color-mix(in srgb, var(--c-bg) 40%, transparent);
        padding: 24px 32px; height: fit-content; max-height: none; z-index: 5;
        width: 100%; box-sizing: border-box;
    }

    .qm-s0-viewport #qm-s0-plaza-sheet.is-peek,
    .qm-s0-viewport #qm-s0-plaza-sheet.is-half,
    .qm-s0-viewport #qm-s0-plaza-sheet.is-expanded,
    .qm-s0-viewport #qm-s0-plaza-sheet.is-minimized,
    .qm-s0-viewport #qm-s0-plaza-sheet.is-closed {
        position: relative; inset: auto; width: 100%; max-width: 100%; margin: 0; height: auto; transform: none; max-height: none;
    }

    #qm-s0-plaza-sheet .qm-os-sheet-handle,
    #qm-s0-plaza-sheet .qm-os-sheet-bar,
    #qm-s0-plaza-sheet .qm-os-sheet-handle-zone { display: none; }
    #qm-s0-plaza-sheet .qm-os-sheet-content { padding: 0; }

    /* Columna 2 (Derecha): Catálogo Comercial (BARRA LATERAL DERECHA STICKY) */
    .qm-s0-viewport .qm-s0-commercial-layer {
        grid-column: 2; grid-row: 1;
        position: sticky; top: 20px;
        padding: 18px; width: 100%; max-width: 380px; box-sizing: border-box;
        background: var(--c-surface); border: 1px solid var(--c-bdr);
        border-radius: 20px;
        box-shadow: 0 4px 24px color-mix(in srgb, var(--c-bg) 40%, transparent);
        max-height: calc(100vh - 40px); overflow-y: auto; overflow-x: hidden;
        z-index: 10;
    }

    .qm-s0-viewport .qm-s0-catalog-search-wrap {
        display: flex; gap: 8px; margin-bottom: 12px; align-items: center; width: 100%; box-sizing: border-box;
    }

    .qm-s0-viewport #qm-s0-cat-search {
        height: 44px; font-size: 13px; padding: 8px 12px 8px 38px; border-radius: 22px;
    }
    .qm-s0-viewport .qm-s0-search-icon { left: 12px; }

    .qm-s0-viewport .qm-s0-view-switcher {
        width: 76px; height: 40px; border-radius: 12px; padding: 2px;
    }

    .qm-s0-viewport .qm-s0-catalog-cats {
        display: flex; width: 100%; max-width: 100%; box-sizing: border-box;
        overflow-x: auto; scrollbar-width: none; gap: 4px; padding: 3px; margin-bottom: 14px;
    }
    .qm-s0-viewport .qm-s0-cat-btn {
        padding: 5px 12px; font-size: 12px; gap: 4px;
    }

    .qm-s0-viewport .qm-s0-catalog-container.view-netflix {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow-x: hidden; margin: 0; padding: 0; gap: 10px; width: 100%; box-sizing: border-box;
    }

    .qm-s0-viewport .qm-s0-catalog-container.view-netflix .qm-s0-cat-item {
        flex: none; width: 100%; min-width: 0; scroll-snap-align: none;
        border-radius: 18px; box-sizing: border-box;
        transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .qm-s0-viewport .qm-s0-catalog-container.view-netflix .qm-s0-cat-item:hover {
        transform: translateY(-3px); border-color: var(--brand);
        box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 20%, transparent);
    }

    .qm-s0-viewport .qm-s0-catalog-container.view-list {
        display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; margin: 0; padding: 0;
    }
}

@media (min-width: 1920px) {
    .qm-s0-viewport {
        grid-template-columns: minmax(0, 1fr) 400px;
        gap: 32px;
        padding: 20px 40px 64px;
    }
    .qm-s0-viewport .qm-s0-commercial-layer {
        max-width: 400px;
    }
}


/* === _slot-0-hero.css === */
/* ================================================================
   SLOT 0 — HERO & HISTORIAS / STORIES CAROUSEL
   Arquitectura de Primitivas Universales del SO
   ================================================================ */

#qm-slot-0 {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background: var(--c-bg);
}

.qm-s0-hero {
    flex: 0 0 auto;
    background: var(--c-card);
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--c-bdr);
    border-radius: 0;
    padding: calc(var(--safe-t, 0px) + 14px) 18px 12px;
    margin: 0;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

.qm-s0-viewport {
    position: relative;
    flex: 1 0 auto;
    width: 100%;
    min-height: 0;
    overflow: visible;
    box-sizing: border-box;
}

.qm-s0-commercial-layer {
    position: relative;
    width: 100%;
    padding: 14px 18px 0;
    box-sizing: border-box;
}

.qm-s0-hero-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.qm-s0-hero-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.qm-s0-hero-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qm-s0-location-pin {
    color: var(--c-text-primary);
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.qm-s0-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 500;
    color: var(--brand);
    margin: 0;
    line-height: 1.1;
}

.qm-s0-sub {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--c-sub);
    opacity: 0.8;
    margin: 0;
    line-height: 1.2;
}

.qm-s0-hero-right-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#qm-pwa-shell .qm-s0-active-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand);
    color: #ffffff;
    border-radius: 9999px;
    padding: 6px 14px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--brand) 75%, var(--c-bdr));
    cursor: pointer;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 25%, transparent);
    transition: transform 0.2s ease, background 0.25s ease, box-shadow 0.25s ease;
}

#qm-pwa-shell .qm-s0-active-badge-pill:not(.active) {
    background: var(--c-surface);
    color: var(--c-sub);
    border-color: var(--c-bdr);
    box-shadow: none;
}

.qm-gradient-active #qm-pwa-shell .qm-s0-active-badge-pill.active {
    background: var(--theme-grad-action);
    box-shadow: var(--theme-glow-action);
}

.qm-s0-user-avatar-top {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-bdr);
}

.qm-s0-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qm-s0-avatar-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-sub);
}

/* Stories Carousel (Layout Spec v2.0) */
.qm-s0-stories-section {
    flex: 0 0 auto;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-bdr);
    margin: 0;
    padding: 10px 0;
    z-index: 10;
}

.qm-s0-stories-wrap {
    margin: 0;
    padding: 0 18px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    mask-image: linear-gradient(to right, transparent 0px, black 18px, black calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0px, black 18px, black calc(100% - 24px), transparent 100%);
}

.qm-s0-stories-wrap::-webkit-scrollbar {
    display: none;
}

.qm-s0-stories {
    display: flex;
    gap: 14px;
}

.qm-s0-stories-section.qm-mode-social .qm-s0-story[data-author-type="business"] {
    display: none;
}

.qm-s0-story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    flex-shrink: 0;
    width: 60px;
    cursor: pointer;
    scroll-snap-align: start;
    position: relative;
}

.qm-story-tu {
    order: -100;
}

.qm-s0-story-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2.5px solid var(--brand);
    padding: 2px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: visible;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qm-s0-story:hover .qm-s0-story-ring {
    transform: scale(1.05);
}

.qm-story-tu-ring {
    border: 2px solid color-mix(in srgb, var(--brand) 40%, transparent);
}

.qm-story-plus-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--brand);
    color: #ffffff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--c-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.qm-s0-story-ph-gradient {
    width: 100%; height: 100%; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 60%, var(--c-surface)) 100%);
    display: flex; align-items: center; justify-content: center; color: var(--c-card);
}

.qm-s0-story-img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; box-sizing: border-box;
}

.qm-s0-story-placeholder {
    width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--c-surface); color: var(--c-sub);
}

.qm-s0-story-name {
    font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--c-text-primary);
    text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}

/* Anillo de historia vista */
.qm-s0-story-ring.seen { border-color: var(--c-bdr); opacity: 0.7; }

/* Badges de historias */
.qm-story-count-badge {
    position: absolute; top: -2px; right: -4px; background: var(--brand); color: var(--c-card);
    font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 100px;
    display: flex; align-items: center; justify-content: center; border: 2px solid var(--c-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); z-index: 10; padding: 0 3px;
}

.qm-story-price-badge {
    position: absolute; bottom: 18px; left: -2px; background: var(--badge); color: var(--c-card);
    font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 6px; border: 1.5px solid var(--c-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); z-index: 10; white-space: nowrap; max-width: 52px;
    overflow: hidden; text-overflow: ellipsis;
}

.qm-story-dist-badge {
    font-size: 9px; font-weight: 600; color: var(--c-sub); text-align: center; white-space: nowrap;
    line-height: 1; margin-top: -2px;
}

.qm-story-dist-badge:empty { display: none; }

/* ── Hero & Stories en Escritorio y Ultrawide (>= 769px Full-Bleed) ── */
@media (min-width: 769px) {
    .qm-s0-hero {
        padding: 14px 32px;
        background: var(--c-card);
        border-bottom: 1px solid var(--c-bdr);
        width: 100%;
        box-sizing: border-box;
    }
    .qm-s0-hero-header-row {
        width: 100%;
        max-width: none;
        margin: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .qm-s0-stories-section {
        padding: 16px 32px 8px;
        background: transparent;
        border-bottom: none;
        width: 100%;
        box-sizing: border-box;
    }
    .qm-s0-stories-wrap {
        width: 100%;
        max-width: none;
        margin: 0;
        box-sizing: border-box;
    }
    .qm-s0-stories { gap: 16px; }
    .qm-s0-story-ring { width: 56px; height: 56px; }
}



/* === _slot-0-plaza-feed.css === */
/* ================================================================
   SLOT 0 — LA PLAZA (MURO COMUNITARIO, FEED Y TARJETAS)
   Arquitectura de Primitivas Universales del SO (< 220 líneas)
   100% Tokens de Tema CSS (Cero Colores Hardcodeados)
   ================================================================ */

/* Tarjeta Deslizable OS-Sheet de La Plaza */
#qm-s0-plaza-sheet {
    position: relative; width: 100%; border-top-left-radius: 24px; border-top-right-radius: 24px;
    border: 1px solid var(--c-bdr); border-bottom: none; background: var(--c-card);
    box-shadow: 0 -8px 32px color-mix(in srgb, var(--c-bg) 75%, transparent);
    z-index: 10; display: flex; flex-direction: column; margin-top: 20px;
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + 36px);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 0.25s ease; box-sizing: border-box;
}
#qm-s0-plaza-sheet.is-peek,
#qm-s0-plaza-sheet.is-minimized,
#qm-s0-plaza-sheet.is-closed {
    position: relative; inset: auto; width: 100%; height: auto; max-height: none; transform: none; z-index: 10;
}
#qm-s0-plaza-sheet.is-expanded {
    position: absolute; inset: 0; width: 100%; height: 100%; z-index: 30; transform: translate3d(0, 0, 0);
    border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: transparent; margin-top: 0;
}
#qm-s0-plaza-sheet.is-dragging { transition: none; }
#qm-s0-plaza-sheet .qm-os-sheet-content {
    flex: 1 1 auto; overflow: visible; padding: 6px 16px calc(var(--nav-h) + var(--safe-b) + 36px); box-sizing: border-box;
}

/* ── Módulo 1: Compositor Elevado ───────────────────────────────────── */
.qm-plaza-composer-card {
    display: flex; align-items: center; gap: 12px; background: var(--c-surface);
    border: 1px solid var(--c-bdr); border-radius: 20px; padding: 12px 14px; cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; box-sizing: border-box;
}
.qm-plaza-composer-card:hover {
    border-color: var(--brand); box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 15%, transparent);
}
.qm-plaza-composer-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    background: var(--c-card); border: 1px solid var(--c-bdr); display: flex; align-items: center; justify-content: center;
}
.qm-plaza-user-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.qm-plaza-user-avatar-ph { color: var(--c-sub); display: flex; align-items: center; justify-content: center; }
.qm-plaza-composer-text { flex: 1; min-width: 0; }
.qm-plaza-composer-title {
    font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--c-text-primary); line-height: 1.2;
}
.qm-plaza-composer-sub {
    font-family: var(--font-body); font-size: 11.5px; color: var(--c-sub); margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qm-plaza-btn-publish {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 9999px;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}

/* ── Módulo 2: Hero Territorial (Banner Nocturno / Colonial) ────────── */
.qm-plaza-hero-banner {
    display: flex; justify-content: space-between; align-items: center;
    background: color-mix(in srgb, var(--brand) 10%, var(--c-surface));
    border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--c-bdr));
    border-radius: 22px; padding: 16px 18px; position: relative; overflow: hidden; margin-top: 14px; box-sizing: border-box;
}
.qm-plaza-hero-info { flex: 1; min-width: 0; z-index: 2; }
.qm-plaza-hero-tag {
    font-family: var(--font-head); font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
    color: var(--brand); text-transform: uppercase; display: block;
}
.qm-plaza-hero-heading {
    font-family: var(--font-head); font-size: 17px; font-weight: 800; line-height: 1.25; color: var(--c-text-primary); margin: 4px 0 0;
}
.qm-plaza-hero-art { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; position: relative; z-index: 2; }
.qm-plaza-hero-scenery { position: relative; color: color-mix(in srgb, var(--brand) 30%, var(--c-text-primary)); opacity: 0.85; }
.qm-plaza-scenery-glow {
    position: absolute; inset: -10px; z-index: -1;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 45%, transparent) 0%, transparent 70%);
}
.qm-plaza-hero-location-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 9999px;
    background: color-mix(in srgb, var(--c-bg) 80%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--c-bdr); font-size: 11px; font-weight: 600; color: var(--c-text-primary); white-space: nowrap;
}

/* ── Módulo 3: Hub de Comunidades / Parches ─────────────────────────── */
.qm-plaza-communities-hub { margin-top: 18px; }
.qm-plaza-hub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.qm-plaza-hub-title {
    font-family: var(--font-head); font-size: 12px; font-weight: 800; letter-spacing: 0.06em;
    color: var(--c-sub); text-transform: uppercase;
}
.qm-plaza-see-all-btn {
    background: transparent; border: none; font-family: var(--font-body); font-size: 12px; font-weight: 600;
    color: var(--c-text-primary); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 4px;
    transition: color 0.2s ease;
}
.qm-plaza-see-all-btn:hover { color: var(--brand); }
.qm-plaza-communities-carousel {
    display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 4px 0 8px;
}
.qm-plaza-communities-carousel::-webkit-scrollbar { display: none; }
.qm-community-card {
    flex: 0 0 114px; border-radius: 18px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center;
    text-align: center; cursor: pointer; border: 1px solid var(--c-bdr); background: var(--c-surface);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; box-sizing: border-box;
}
.qm-community-card:hover { transform: translateY(-2px); }
.qm-community-card.active { border-color: var(--brand); box-shadow: 0 0 0 1.5px var(--brand); }
.qm-community-card-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.qm-community-card-name { font-family: var(--font-head); font-size: 13.5px; font-weight: 700; color: var(--c-text-primary); margin-bottom: 4px; }
.qm-community-card-meta { font-size: 10px; line-height: 1.3; color: var(--c-sub); }
.qm-community-card.card-eventos { background: color-mix(in srgb, var(--brand) 18%, var(--c-surface)); color: var(--brand); }
.qm-community-card.card-avisos { background: color-mix(in srgb, var(--badge) 18%, var(--c-surface)); color: var(--badge); }
.qm-community-card.card-descuentos { background: color-mix(in srgb, var(--fab-on) 18%, var(--c-surface)); color: var(--fab-on); }
.qm-community-card.card-moteros { background: color-mix(in srgb, var(--brand) 12%, var(--c-surface)); color: var(--c-text-primary); }

.qm-plaza-explore-communities-btn {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
    border: 1px dashed var(--c-bdr); background: var(--c-surface); color: var(--c-text-primary); margin-top: 10px;
    cursor: pointer; text-align: left; transition: border-color 0.2s ease, background-color 0.2s ease; box-sizing: border-box;
}
.qm-plaza-explore-communities-btn:hover {
    border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--c-surface));
}
.qm-plaza-explore-icon {
    width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 15%, var(--c-card));
    color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qm-plaza-explore-text strong { display: block; font-family: var(--font-head); font-size: 13px; color: var(--c-text-primary); }
.qm-plaza-explore-text span { font-size: 11px; color: var(--c-sub); }

/* ── Módulo 4: Filtros de Segmentación (Tabs del SO PWA) ───────────── */
.qm-plaza-tabs-nav.qm-segmented-control {
    display: flex;
    width: 100%;
    margin-top: 18px;
    margin-bottom: 14px;
}
.qm-plaza-tabs-nav .qm-segmented-item {
    flex: 1;
    justify-content: center;
    text-align: center;
}

/* ── Módulo 5: Feed de Publicaciones Enriquecidas ───────────────────── */
.qm-plaza-feed-list { margin-top: 10px; }
.qm-plaza-card {
    background: var(--c-card); border: 1px solid var(--c-bdr); border-radius: 20px; padding: 16px;
    margin-bottom: 14px; color: var(--c-text-primary); box-shadow: 0 4px 20px color-mix(in srgb, var(--c-bg) 40%, transparent);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.qm-plaza-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.qm-plaza-card-author-wrap { display: flex; align-items: center; gap: 10px; }
.qm-plaza-author-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--c-bdr); flex-shrink: 0; }
.qm-plaza-author-avatar-ph {
    width: 38px; height: 38px; border-radius: 50%; background: var(--c-surface); color: var(--brand);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qm-plaza-card-author-meta { display: flex; flex-direction: column; gap: 2px; }
.qm-plaza-card-author-row { display: flex; align-items: center; gap: 8px; }
.qm-plaza-card-author-name { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--c-text-primary); }
.qm-plaza-card-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 9999px;
    background: color-mix(in srgb, var(--brand) 20%, var(--c-surface)); color: var(--brand);
    border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--c-bdr));
}
.qm-plaza-card-badge.tag-descuentos {
    background: color-mix(in srgb, var(--fab-on) 20%, var(--c-surface)); color: var(--fab-on);
    border-color: color-mix(in srgb, var(--fab-on) 35%, var(--c-bdr));
}
.qm-plaza-card-badge.tag-avisos {
    background: color-mix(in srgb, var(--badge) 20%, var(--c-surface)); color: var(--badge);
    border-color: color-mix(in srgb, var(--badge) 35%, var(--c-bdr));
}
.qm-plaza-card-time { font-size: 11px; color: var(--c-sub); }
.qm-plaza-card-options-btn {
    width: 32px; height: 32px; border-radius: 50%; background: transparent; border: none; color: var(--c-sub);
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.qm-plaza-card-body {
    font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--c-text-primary);
    margin-bottom: 10px; word-break: break-word;
}
.qm-plaza-post-location-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px;
    background: var(--c-surface); border: 1px solid var(--c-bdr); font-size: 11.5px; font-weight: 500;
    color: var(--c-sub); margin-bottom: 10px; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease;
}
.qm-plaza-post-location-chip:hover { color: var(--brand); border-color: var(--brand); }
.qm-plaza-card-img-wrap {
    width: 100%; aspect-ratio: 16 / 9; margin-bottom: 12px; border-radius: 14px; overflow: hidden; background: var(--c-surface);
}
.qm-plaza-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qm-plaza-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--c-bdr); }
.qm-plaza-action-btn {
    display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none;
    padding: 6px 10px; border-radius: 10px; color: var(--c-sub); font-family: var(--font-body);
    font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.qm-plaza-action-btn:hover { background: var(--c-surface); color: var(--brand); }
.qm-plaza-action-btn.active { color: var(--brand); }
.qm-plaza-action-btn.active svg { fill: var(--brand); }

/* ── Módulo 6: Gestión Administrativa de Comunidades ───────────────── */
.qm-admin-communities-overlay { padding: 16px; }
.qm-adm-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.qm-adm-title { font-family: var(--font-head); font-size: 18px; font-weight: 800; color: var(--c-text-primary); margin: 0 0 2px; }
.qm-adm-subtitle { font-size: 12px; color: var(--c-sub); margin: 0; }
.qm-adm-btn-new { font-size: 12px; padding: 6px 12px; }
.qm-adm-tabs { width: 100%; margin-bottom: 14px; }
.qm-adm-tabs .qm-segmented-item { flex: 1; justify-content: center; }
.qm-adm-empty { text-align: center; padding: 32px 16px; color: var(--c-sub); font-size: 13px; }
.qm-adm-empty-title { margin: 0 0 4px; font-weight: 700; color: var(--c-text-primary); }
.qm-adm-list { display: flex; flex-direction: column; gap: 10px; }
.qm-adm-card { border: 1px solid var(--c-bdr); border-radius: 14px; padding: 12px; }
.qm-adm-card-pending { border-color: color-mix(in srgb, var(--badge) 40%, var(--c-bdr)); }
.qm-adm-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qm-adm-ico-pending { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--badge) 20%, var(--c-surface)); color: var(--badge); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qm-adm-card-meta { flex: 1; min-width: 0; }
.qm-adm-card-name { font-size: 14px; color: var(--c-text-primary); display: block; }
.qm-adm-card-date { font-size: 11px; color: var(--c-sub); }
.qm-adm-card-desc { font-size: 12.5px; color: var(--c-text); margin: 0 0 10px; line-height: 1.4; }
.qm-adm-card-actions { display: flex; gap: 8px; justify-content: flex-end; }
.qm-adm-btn-reject { font-size: 12px; padding: 6px 14px; background: var(--c-surface); color: var(--c-sub); border: 1px solid var(--c-bdr); }
.qm-adm-btn-approve { font-size: 12px; padding: 6px 14px; }
.qm-adm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qm-adm-row-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qm-adm-ico-approved { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 18%, var(--c-surface)); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qm-adm-row-text { min-width: 0; }
.qm-adm-row-title { font-size: 13.5px; color: var(--c-text-primary); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-adm-row-sub { font-size: 11px; color: var(--c-sub); }
.qm-adm-btn-delete { font-size: 11px; padding: 4px 10px; background: var(--c-surface); color: var(--badge); border: 1px solid var(--c-bdr); }
.qm-adm-ico-status { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qm-adm-ico-status.st-approved { background: color-mix(in srgb, var(--brand) 18%, var(--c-surface)); color: var(--brand); }
.qm-adm-ico-status.st-pending { background: color-mix(in srgb, var(--badge) 18%, var(--c-surface)); color: var(--badge); }
.qm-adm-ico-status.st-rejected { background: color-mix(in srgb, var(--c-sub) 18%, var(--c-surface)); color: var(--c-sub); }
.qm-adm-status-tag { font-size: 11px; font-weight: 700; }
.qm-adm-status-tag.st-approved { color: var(--brand); }
.qm-adm-status-tag.st-pending { color: var(--badge); }
.qm-adm-status-tag.st-rejected { color: var(--c-sub); }
.qm-adm-row-actions { display: flex; gap: 6px; }
.qm-adm-btn-approve-sm { font-size: 11px; padding: 4px 10px; }

/* Utilidad oculta */
.qm-hidden { display: none; }

/* === _slot-0-plaza-modal.css === */
/* ================================================================
   SLOT 0 — LA PLAZA (MODAL DE DETALLE, COMENTARIOS Y REACCIONES)
   Arquitectura de Primitivas Universales del SO (< 200 líneas)
   ================================================================ */

/* Modal Detalle y Comentarios */
.qm-plaza-detail-dialog {
    max-width: 520px;
    width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
}

.qm-plaza-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-bdr);
    background: var(--c-surface);
}

.qm-plaza-detail-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.qm-plaza-comments-section {
    margin-top: 18px;
    border-top: 1px solid var(--c-bdr);
    padding-top: 14px;
}

.qm-plaza-comments-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-primary);
    margin: 0 0 12px 0;
}

.qm-plaza-comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.qm-plaza-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.qm-plaza-comment-bubble {
    flex: 1;
    background: var(--c-surface);
    border-radius: 14px;
    padding: 8px 12px;
}

.qm-plaza-comment-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-primary);
}

.qm-plaza-comment-time {
    font-size: 10px;
    color: var(--c-sub);
}

.qm-plaza-comment-text {
    font-size: 12px;
    color: var(--c-text-primary);
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.qm-plaza-detail-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--c-bdr);
    background: var(--c-card);
}

.qm-plaza-comment-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.qm-plaza-comment-input {
    flex: 1;
    height: 38px;
    border-radius: 20px;
    border: 1px solid var(--c-bdr);
    padding: 0 14px;
    font-family: var(--font-body);
    font-size: 13px;
    background: var(--c-bg);
    color: var(--c-text-primary);
    outline: none;
}

.qm-plaza-comment-input:focus {
    border-color: var(--brand);
}

/* Reacciones Popover */
.qm-plaza-reactions-popover {
    position: fixed;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--c-card);
    border: 1px solid var(--c-bdr);
    padding: 6px 10px;
    border-radius: 30px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(6px) scale(0.92);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.qm-plaza-reactions-popover.qm-popover-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.qm-plaza-reaction-popover-item {
    position: relative;
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.qm-plaza-reaction-popover-item:hover {
    transform: scale(1.3);
    background: var(--c-surface);
}

.qm-reaction-tooltip {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--c-card);
    color: var(--c-text-primary);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.qm-plaza-reaction-popover-item:hover .qm-reaction-tooltip {
    opacity: 1;
}


/* === _slot-0-plaza.css === */
/* ================================================================
   SLOT 0 — LA PLAZA (ORQUESTADOR MODULAR)
   Arquitectura de Primitivas Universales del SO (< 350 líneas)
   ================================================================ */





/* === _slot-1.css === */
/* ================================================================
   SLOT 1 — EXPLORAR / LA PLAZA VIVA (DIRECTORIO 2D Y SPLAT 3D)
   Arquitectura de Primitivas Universales del SO (< 280 líneas)
   ================================================================ */




#qm-slot-1 {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100vw;
    max-width: 100vw;
    flex: 0 0 100vw;
    flex-shrink: 0;
    height: 100dvh;
    padding-bottom: calc(var(--nav-h) + var(--safe-b));
    overflow: hidden;
    background: var(--c-bg);
    box-sizing: border-box;
}

#qm-s1-explorar {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.qm-s1-viewport {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* ── Encabezado Territorial y Conmutador de Lentes ── */
.qm-s1-header {
    position: sticky; top: 0; z-index: 10;
    background: var(--c-bg);
    padding: calc(var(--safe-t, 12px) + 8px) 14px 8px;
    border-bottom: 1px solid var(--c-bdr);
    display: flex; flex-direction: column; gap: 8px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.qm-s1-header-top { display: flex; justify-content: space-between; align-items: center; }
.qm-s1-title-group { display: flex; flex-direction: column; }
.qm-s1-title {
    font-family: var(--font-head); font-size: 18px; font-weight: 800;
    color: var(--c-text-primary); margin: 0; letter-spacing: -0.3px;
}
.qm-s1-subtitle {
    font-family: var(--font-body); font-size: 10px; font-weight: 500;
    color: var(--c-sub); margin-top: 1px; display: flex; align-items: center; gap: 4px;
}

/* Mode Switcher Pills [ 2D Mapa | 3D Paseo ] */
.qm-s1-mode-switcher {
    display: inline-flex; background: var(--c-surface);
    border: 1px solid var(--c-bdr); border-radius: 9999px; padding: 3px; gap: 3px;
}
.qm-s1-mode-btn {
    border: none; background: transparent; color: var(--c-sub);
    border-radius: 9999px; padding: 6px 12px; font-family: var(--font-head);
    font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex;
    align-items: center; gap: 5px; transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.qm-s1-mode-btn.active {
    background: var(--brand); color: var(--c-card);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent);
}

/* ── Viewport y Vistas ── */
.qm-s1-viewport { position: relative; width: 100%; min-height: calc(100dvh - 120px); overflow: hidden; }
.qm-s1-view { display: none; width: 100%; height: 100%; overflow: hidden; }
.qm-s1-view.qm-s1-view-active { display: block; }

/* ── Vista 2D: Directorio / Plaza Viva ── */
.qm-s1-search-wrap {
    display: flex; align-items: center; gap: 8px; margin: 8px 14px 4px;
}
.qm-s1-search-box { position: relative; flex: 1; }
.qm-s1-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--c-sub); pointer-events: none; display: flex; align-items: center;
}
#qm-pwa-shell .qm-s1-search-input,
#qm-pwa-shell #qm-s1-search,
#qm-pwa-shell input.qm-s1-search-input,
.qm-s1-search-input {
    width: 100%; box-sizing: border-box; padding: 9px 12px 9px 36px;
    border-radius: 12px; background: var(--c-card); border: 1px solid var(--c-bdr);
    color: var(--c-text-primary); font-family: var(--font-body); font-size: 12px;
    outline: none; transition: border-color 0.2s ease; height: 40px;
}
#qm-pwa-shell .qm-s1-search-input:focus,
#qm-pwa-shell #qm-s1-search:focus,
#qm-pwa-shell input.qm-s1-search-input:focus,
.qm-s1-search-input:focus { border-color: var(--brand); }
.qm-s1-fav-toggle-label {
    display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
    font-family: var(--font-body); font-size: 11px; font-weight: 600;
    color: var(--c-sub); white-space: nowrap; background: var(--c-surface);
    border: 1px solid var(--c-bdr); border-radius: 12px; padding: 7px 10px;
    -webkit-tap-highlight-color: transparent;
}
.qm-s1-fav-toggle {
    accent-color: var(--brand); cursor: pointer; width: 13px; height: 13px; margin: 0;
}
.qm-s1-fav-toggle-text { display: inline-flex; align-items: center; gap: 3px; }
.qm-s1-cats-wrap { padding: 4px 14px; }
.qm-s1-cats {
    display: inline-flex; background: var(--c-surface); border-radius: 9999px;
    padding: 3px; border: 1px solid var(--c-bdr); gap: 4px; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; box-sizing: border-box;
}
.qm-s1-cats::-webkit-scrollbar { display: none; }
.qm-s1-cat-btn {
    flex-shrink: 0; background: transparent; border: none; border-radius: 9999px;
    padding: 6px 14px; font-family: var(--font-body); font-size: 11px; font-weight: 600;
    color: var(--c-sub); cursor: pointer; transition: all 0.2s ease;
    white-space: nowrap; -webkit-tap-highlight-color: transparent;
    display: inline-flex; align-items: center; gap: 5px;
}
.qm-s1-cat-btn svg {
    flex-shrink: 0;
}
.qm-s1-cat-btn.active {
    background: var(--brand); color: var(--c-card);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent);
}

/* Grid de Lugares 2D */
.qm-s1-places-grid, #qm-s1-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    padding: 8px 14px calc(var(--safe-b, 10px) + 80px); box-sizing: border-box;
}
.qm-s1-place-card {
    background: var(--c-card); border: 1px solid var(--c-bdr);
    border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
    transition: transform 0.18s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.qm-s1-place-card:active { transform: scale(0.97); }
.qm-s1-place-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--c-surface); display: block; }
.qm-s1-place-thumb-ph {
    width: 100%; aspect-ratio: 16/10; display: flex; align-items: center;
    justify-content: center; background: var(--c-surface); color: var(--c-sub);
}
.qm-s1-place-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.qm-s1-place-badge-row { display: flex; justify-content: space-between; align-items: center; }
.qm-s1-place-cat {
    font-family: var(--font-body); font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--brand);
}
.qm-s1-biz-fav {
    border: 1px solid var(--c-bdr); background: var(--c-surface); color: var(--c-sub);
    border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 0.2s ease;
}
.qm-s1-biz-fav.active {
    background: var(--brand); color: #ffffff; border-color: var(--brand);
}
.qm-s1-place-title {
    font-family: var(--font-head); font-size: 13px; font-weight: 700;
    color: var(--c-text-primary); margin: 0; line-height: 1.25;
}

/* Estado Vacío de Slot 1 */
.qm-s1-empty {
    grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 32px 16px;
    background: var(--c-card); border: 1px solid var(--c-bdr);
    border-radius: 18px; margin-top: 6px;
}
.qm-s1-empty-icon { color: var(--brand); margin-bottom: 10px; }
.qm-s1-empty-title {
    font-family: var(--font-head); font-size: 15px; font-weight: 700;
    color: var(--c-text-primary); margin: 0 0 4px 0;
}
.qm-s1-empty-desc {
    font-family: var(--font-body); font-size: 11px; color: var(--c-sub);
    max-width: 280px; margin: 0 0 16px 0; line-height: 1.4;
}
.qm-s1-empty-btn {
    background: var(--brand); border: none; border-radius: 18px; padding: 8px 16px;
    font-family: var(--font-head); font-size: 11px; font-weight: 700; color: #ffffff;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent);
    transition: transform 0.18s ease; -webkit-tap-highlight-color: transparent;
}
.qm-s1-empty-btn:active { transform: scale(0.96); }
.qm-s1-empty-search {
    text-align: center; padding: 30px 15px; color: var(--c-sub);
    font-size: 13px; line-height: 1.5;
}

/* ── Vista 3D: Gaussian Splatting Viewer ── */
#qm-s1-view-3d {
    position: relative; width: 100%; height: calc(100dvh - 120px);
    min-height: 380px; background: var(--c-bg); overflow: hidden;
}
.qm-splat-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.qm-splat-canvas { width: 100%; height: 100%; display: block; }

/* Loader 3D */
.qm-splat-loader {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--c-bg); z-index: 20; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: var(--c-text-primary);
    transition: opacity 0.3s ease;
}
.qm-splat-spinner {
    width: 36px; height: 36px; border: 3px solid color-mix(in srgb, var(--c-text-primary) 10%, transparent);
    border-radius: 50%; border-top-color: var(--brand); animation: qmSplatSpin 0.8s linear infinite;
}
@keyframes qmSplatSpin { to { transform: rotate(360deg); } }
.qm-splat-loader-title {
    margin-top: 14px; font-family: var(--font-head); font-weight: 700; font-size: 12px;
}
.qm-splat-loader-progress {
    margin-top: 4px; font-family: monospace; font-size: 10px; color: var(--brand);
}

/* HUD Superior 3D */
.qm-splat-hud {
    position: absolute; top: 10px; left: 10px; right: 10px; display: flex;
    justify-content: space-between; align-items: center; z-index: 10; pointer-events: none;
}
.qm-splat-hud-card {
    background: color-mix(in srgb, var(--c-card) 75%, transparent);
    border: 1px solid var(--c-bdr); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 10px; padding: 5px 10px; color: var(--c-text-primary); pointer-events: auto;
}
.qm-splat-hud-title { font-family: var(--font-head); font-size: 11px; font-weight: 700; margin: 0; }
.qm-splat-hud-meta { font-family: monospace; font-size: 8px; color: var(--c-sub); margin-top: 1px; }
.qm-splat-hud-btn-exit {
    background: color-mix(in srgb, var(--brand) 20%, transparent);
    border: 1px solid var(--brand); color: var(--brand); border-radius: 8px;
    padding: 5px 10px; font-family: var(--font-head); font-size: 10px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 4px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: auto;
}

/* Joysticks Táctiles Móviles Ergonomía */
.qm-splat-touch-zone {
    position: absolute; bottom: calc(var(--safe-b, 10px) + 70px); left: 0; right: 0;
    display: flex; justify-content: space-between; padding: 0 16px; pointer-events: none; z-index: 12;
}
.qm-splat-joy-box {
    width: 85px; height: 85px; border-radius: 50%; background: color-mix(in srgb, var(--c-surface) 60%, transparent);
    border: 2px solid var(--c-bdr); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    position: relative; display: flex; align-items: center; justify-content: center; pointer-events: auto;
}
.qm-splat-joy-stick {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 50%, var(--c-surface)) 0%, var(--c-card) 100%);
    border: 2px solid var(--c-bdr); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.qm-splat-joy-label {
    position: absolute; bottom: -14px; font-family: var(--font-body);
    font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--c-sub);
}


/* === _slot-1-map.css === */
/* ================================================================
   SLOT 1 — MAPA TERRITORIAL DINÁMICO & BOTTOM-SHEET (< 250 LÍNEAS)
   Primitivas PWA: Glassmorphism, Curvas Fluidas y Anclaje Espacial
   ================================================================ */

/* ── 1. VIEWPORT Y CONTENEDOR DEL MAPA (CAPA 1) ── */
#qm-s1-view-2d {
    position: absolute; inset: 0; width: 100%; height: 100%;
    overflow: hidden; background: var(--c-bg);
}

.qm-s1-map-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    min-height: 100%; z-index: 1; background: var(--c-bg);
}

.qm-map-filter-defs {
    position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none;
}

/* ── 2. BUSCADOR MINIMALISTA FLOTANTE (CAPA 15) ── */
.qm-s1-search-floating {
    position: absolute; top: 10px; left: 12px; right: 12px; z-index: 15;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.qm-s1-search-floating.hidden { opacity: 0; pointer-events: none; transform: translateY(-20px); }

.qm-s1-search-glass-inner {
    position: relative; display: flex; align-items: center; gap: 8px;
    background: color-mix(in srgb, var(--c-surface) 88%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--c-bdr); border-radius: 9999px; padding: 4px 6px 4px 12px;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--c-bg) 50%, transparent);
    pointer-events: auto; transition: all 0.25s ease;
}
.qm-s1-search-glass-inner .qm-s1-search-icon {
    position: absolute; left: 14px; color: var(--c-sub);
    pointer-events: none; display: flex; align-items: center;
}
#qm-pwa-shell .qm-s1-search-glass-inner .qm-s1-search-input {
    flex: 1; background: transparent; border: none; box-shadow: none;
    color: var(--c-text-primary); font-family: var(--font-body);
    font-size: 13px; font-weight: 500; padding: 8px 8px 8px 30px;
    height: 38px; outline: none;
}

.qm-s1-filter-btn, .qm-s1-gps-btn {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--c-bdr); background: var(--c-surface);
    color: var(--c-sub); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease;
}
.qm-s1-filter-btn.active, .qm-s1-filter-btn:active, .qm-s1-gps-btn:active {
    background: var(--brand); color: var(--c-card); border-color: var(--brand); transform: scale(0.96);
}

.qm-s1-cats-float {
    display: flex; pointer-events: none; max-width: 100%; max-height: 0;
    opacity: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; gap: 6px; padding: 0 2px;
    margin-top: 0; transform: translateY(-6px);
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.qm-s1-cats-float.active {
    pointer-events: auto; max-height: 48px; opacity: 1; padding: 2px 2px; margin-top: 6px; transform: translateY(0);
}
.qm-s1-cats-float .qm-s1-cats { display: flex; gap: 6px; background: transparent; padding: 0; border: none; }
.qm-s1-cats-float .qm-s1-cat-btn {
    background: color-mix(in srgb, var(--c-surface) 90%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--c-bdr); border-radius: 9999px; padding: 6px 14px;
    font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--c-text-primary);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--c-bg) 40%, transparent);
    transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 5px;
}
.qm-s1-cats-float .qm-s1-cat-btn.active {
    background: var(--brand); color: var(--c-card); border-color: var(--brand);
}

/* ── 3. MARCADORES DE MAPA SVG CON ANCLAJE ESPACIAL ABSOLUTO A 60 FPS ── */
.maplibregl-marker, #qm-pwa-shell .maplibregl-marker {
    position: absolute; top: 0; left: 0; margin: 0; padding: 0; border: none;
    background: transparent; will-change: transform; transition: none; pointer-events: auto;
}

.qm-map-pin-anchor, #qm-pwa-shell .qm-map-pin-anchor {
    position: absolute; top: 0; left: 0; width: 38px; height: 44px;
    margin: 0; padding: 0; display: flex; align-items: center; justify-content: center;
    transition: none; cursor: pointer; user-select: none; -webkit-user-select: none; will-change: transform;
}
.qm-map-pin-wrap {
    position: relative; width: 38px; height: 44px; display: flex;
    align-items: center; justify-content: center; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.qm-map-pin-div { background: transparent; border: none; padding: 0; margin: 0; }

.qm-map-pin-inner {
    position: relative; width: 100%; height: 100%; display: flex;
    align-items: center; justify-content: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
    transform-origin: 50% 100%;
}
.qm-map-pin-anchor:hover .qm-map-pin-inner,
.qm-map-pin-anchor.active .qm-map-pin-inner,
.qm-map-pin-wrap:hover .qm-map-pin-inner,
.qm-map-pin-wrap.active .qm-map-pin-inner {
    transform: scale(1.22) translateY(-4px); z-index: 1000;
}

.qm-map-pin-svg {
    position: absolute; inset: 0; width: 100%; height: 100%; color: var(--brand);
    filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--brand) 40%, transparent)); pointer-events: none;
}
.qm-map-pin-icon-inner {
    position: relative; z-index: 2; top: -5px; color: var(--c-card);
    display: flex; align-items: center; justify-content: center; pointer-events: none;
}

/* Mini-Píldora Glassmorphism de Categoría / Local Flotante sobre el Pin */
.qm-map-pin-pill {
    position: absolute; bottom: calc(100% + 4px); left: 50%;
    transform: translateX(-50%) translateY(2px) scale(0.92); opacity: 0; pointer-events: none;
    background: color-mix(in srgb, var(--c-surface) 92%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--c-bdr));
    border-radius: 9999px; padding: 3px 8px; white-space: nowrap;
    display: flex; align-items: center; gap: 4px;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--c-bg) 60%, transparent);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1001;
}
.qm-map-pin-anchor:hover .qm-map-pin-pill,
.qm-map-pin-anchor.active .qm-map-pin-pill,
.qm-map-pin-wrap:hover .qm-map-pin-pill,
.qm-map-pin-wrap.active .qm-map-pin-pill {
    opacity: 1; transform: translateX(-50%) translateY(0) scale(1);
}
.qm-map-pin-pill-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--brand); flex-shrink: 0; }
.qm-map-pin-pill-icon svg { width: 12px; height: 12px; }
.qm-map-pin-pill-title {
    font-family: var(--font-head); font-size: 10.5px; font-weight: 700;
    color: var(--c-text-primary); max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}
.qm-map-pin-pill-sep { color: var(--c-muted); font-size: 10px; font-weight: 700; }
.qm-map-pin-pill-cat {
    font-family: var(--font-body); font-size: 9px; font-weight: 600;
    color: var(--brand); text-transform: uppercase; letter-spacing: 0.3px;
}

/* Indicador GPS del Usuario con Radar Concéntrico a 0px de Desfase */
.qm-map-user-container, #qm-pwa-shell .qm-map-user-container {
    position: absolute; top: 0; left: 0; width: 36px; height: 36px;
    margin: 0; padding: 0; display: block; pointer-events: none;
    will-change: transform; transition: none; box-sizing: border-box;
}
.qm-map-user-radar {
    position: absolute; top: 50%; left: 50%; width: 32px; height: 32px;
    border-radius: 50%; background: color-mix(in srgb, var(--brand) 30%, transparent);
    transform: translate(-50%, -50%) scale(0.3);
    animation: qmRadarPulse 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    pointer-events: none; box-sizing: border-box;
}
.qm-map-user-radar.qm-radar-delayed { animation-delay: 1.2s; }
.qm-map-user-core {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 14px; height: 14px; background: var(--brand); border: 2.5px solid var(--c-card);
    border-radius: 50%; box-shadow: 0 0 10px color-mix(in srgb, var(--brand) 90%, transparent);
    z-index: 2; pointer-events: none; box-sizing: border-box;
}
@keyframes qmRadarPulse {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0.85; }
    70% { transform: translate(-50%, -50%) scale(1.6); opacity: 0.20; }
    100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

/* Píldora Flotante de Ruta Turn-by-Turn */
.qm-s1-route-pill {
    position: absolute; top: 75px; left: 50%; transform: translateX(-50%);
    z-index: 30; background: color-mix(in srgb, var(--c-surface) 94%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--c-bdr); border-radius: 24px; padding: 10px 16px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--c-bg) 60%, transparent);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0; pointer-events: none; transform: translate(-50%, -10px);
}
.qm-s1-route-pill.active { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.qm-s1-route-info { display: flex; flex-direction: column; gap: 4px; }
.qm-s1-route-modes { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.qm-s1-route-mode-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    background: color-mix(in srgb, var(--c-bg) 60%, transparent);
    border: 1px solid var(--c-bdr); border-radius: 9999px; padding: 4px 10px;
    font-size: 11px; font-weight: 600; color: var(--c-sub);
    white-space: nowrap; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0;
}
.qm-s1-route-mode-btn span { white-space: nowrap; line-height: 1; }
.qm-s1-route-mode-btn svg { flex-shrink: 0; }
.qm-s1-route-mode-btn.active, .qm-s1-route-mode-btn:active {
    background: var(--brand); color: var(--c-card); border-color: var(--brand);
}
.qm-s1-route-meta { font-size: 10.5px; font-weight: 500; color: var(--c-sub); white-space: nowrap; }
.qm-s1-route-btn-close {
    background: color-mix(in srgb, var(--c-bg) 60%, transparent);
    border: 1px solid var(--c-bdr); color: var(--c-text-primary);
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease; flex-shrink: 0;
}
.qm-s1-route-btn-close:hover { background: var(--brand); color: var(--c-card); }

/* ── 4. MAPLIBRE GL Y LEAFLET PWA THEME, ZOOM & MARCADORES ── */
#qm-pwa-shell .maplibregl-map,
#qm-pwa-shell .leaflet-container {
    background: var(--c-bg); font-family: var(--font-body); touch-action: none; width: 100%; height: 100%;
}
#qm-pwa-shell .maplibregl-canvas { outline: none; }

#qm-pwa-shell .maplibregl-ctrl-top-right,
#qm-pwa-shell .leaflet-control-zoom {
    position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
    margin: 0; border: 1px solid var(--c-bdr); border-radius: 20px;
    overflow: hidden; box-shadow: 0 6px 20px color-mix(in srgb, var(--c-bg) 50%, transparent);
    display: flex; flex-direction: column; z-index: 10;
}
#qm-pwa-shell .maplibregl-ctrl-group {
    background: color-mix(in srgb, var(--c-surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: none; border-radius: 20px; overflow: hidden; margin: 0; box-shadow: none;
}
#qm-pwa-shell .maplibregl-ctrl-group button,
#qm-pwa-shell .leaflet-control-zoom a {
    background: color-mix(in srgb, var(--c-surface) 92%, transparent);
    color: var(--c-text-primary); border: none; border-bottom: 1px solid var(--c-bdr);
    width: 36px; height: 36px; line-height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; transition: all 0.2s ease;
}
#qm-pwa-shell .maplibregl-ctrl-group button:last-child,
#qm-pwa-shell .leaflet-control-zoom a:last-child { border-bottom: none; }
#qm-pwa-shell .maplibregl-ctrl-group button:hover,
#qm-pwa-shell .leaflet-control-zoom a:hover,
#qm-pwa-shell .leaflet-control-zoom a:active { background: var(--brand); color: var(--c-card); }
#qm-pwa-shell .maplibregl-ctrl-attrib,
#qm-pwa-shell .leaflet-control-attribution { display: none; }

/* Nomenclatura Tipográfica Nativa PWA */
#qm-pwa-shell .qm-map-label-wrapper { background: transparent; border: none; pointer-events: none; }
#qm-pwa-shell .qm-map-native-label {
    display: inline-block; font-family: var(--font-body); font-size: 11px; font-weight: 600;
    letter-spacing: 0.03em; color: var(--c-text-primary); white-space: nowrap; user-select: none;
    text-shadow: -1px -1px 0 var(--c-bg), 1px -1px 0 var(--c-bg), -1px 1px 0 var(--c-bg), 1px 1px 0 var(--c-bg), 0 2px 4px color-mix(in srgb, var(--c-bg) 80%, transparent);
}
#qm-pwa-shell .qm-map-native-label.secondary { font-size: 10px; font-weight: 500; color: var(--c-muted); }
#qm-pwa-shell .qm-map-native-label.landmark { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; }

/* ── 8. BOTÓN FLOTANTE RECENTRAR EN MÓVIL (ASISTENCIA AL CONDUCTOR) ── */
.qm-s1-recenter-fab {
    position: absolute; bottom: calc(142px + 16px); right: 14px; z-index: 25;
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    border-radius: 9999px; background: color-mix(in srgb, var(--c-surface) 90%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--c-bdr));
    color: var(--c-text-primary); font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
    box-shadow: 0 6px 22px color-mix(in srgb, var(--c-bg) 60%, transparent);
    opacity: 0; pointer-events: none; transform: scale(0.85);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none; -webkit-tap-highlight-color: transparent;
}
.qm-s1-recenter-fab.active { opacity: 1; pointer-events: auto; transform: scale(1); }
.qm-s1-recenter-fab:active { transform: scale(0.94); background: var(--brand); color: var(--c-card); }

@media (min-width: 769px) {
    #qm-pwa-shell .qm-s1-recenter-fab,
    #qm-s1-recenter-fab { display: none; }
}

/* ── 9. ALERTA DEL PILOTO DE NAVEGACIÓN (CONTRAVÍA / DESVÍO) ── */
.qm-s1-pilot-alert {
    position: absolute; top: 76px; left: 50%; z-index: 30;
    transform: translateX(-50%) translateY(-12px) scale(0.92);
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 16px; border-radius: 9999px;
    background: color-mix(in srgb, var(--brand) 92%, var(--c-surface));
    color: var(--c-card); font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 45%, transparent);
    border: 1px solid color-mix(in srgb, var(--c-card) 25%, transparent);
    opacity: 0; pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap; user-select: none;
}
.qm-s1-pilot-alert.active {
    opacity: 1; pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
    animation: qm-pulse-warning 1.8s infinite ease-in-out;
}
@keyframes qm-pulse-warning {
    0%, 100% { box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 45%, transparent); }
    50% { box-shadow: 0 12px 32px color-mix(in srgb, var(--brand) 70%, transparent); }
}

/* Badge de Estado de Tráfico en Píldora de Ruta */
.qm-s1-traffic-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 700;
    background: color-mix(in srgb, var(--c-surface) 85%, transparent);
    color: var(--c-text-primary); border: 1px solid var(--c-bdr);
}
.qm-s1-traffic-badge.fluid { color: var(--badge); }
.qm-s1-traffic-badge.moderate { color: var(--nav-active); }
.qm-s1-traffic-badge.heavy { color: var(--brand); animation: qm-pulse-warning 2s infinite ease-in-out; }




/* === _slot-1-sheet.css === */
/* ================================================================
   SLOT 1 — BOTTOM-SHEET & CATÁLOGO DE COMERCIOS (< 130 LÍNEAS)
   Primitivas PWA: Gestos Aislados, Cards Fluidas y Glassmorphism
   ================================================================ */

/* ── 1. BOTTOM-SHEET DESLIZABLE AISLADO (CAPA 20) ── */
.qm-s1-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 20;
    height: 75vh;
    max-height: calc(100% - 70px);
    background: color-mix(in srgb, var(--c-surface) 95%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--c-bdr);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -8px 32px color-mix(in srgb, var(--c-bg) 75%, transparent);
    display: flex; flex-direction: column;
    transform: translateY(calc(100% - 142px));
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
    touch-action: none;
    will-change: transform;
}

.qm-s1-sheet.is-peek,
.qm-s1-sheet.is-minimized,
.qm-s1-sheet.is-closed {
    transform: translateY(calc(100% - 142px));
}
.qm-s1-sheet.is-half { transform: translateY(calc(100% - 340px)); }
.qm-s1-sheet.is-expanded { transform: translateY(0); }

.qm-s1-sheet-handle-zone {
    flex-shrink: 0;
    padding: 10px 16px 8px;
    cursor: grab;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

.qm-s1-sheet-handle-bar {
    width: 42px; height: 5px;
    border-radius: 9999px; background: var(--c-bdr);
    transition: background-color 0.2s ease;
}

.qm-s1-sheet:hover .qm-s1-sheet-handle-bar { background: var(--brand); }

.qm-s1-sheet-header-info {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
}

.qm-s1-sheet-title {
    font-family: var(--font-head); font-size: 13px; font-weight: 700;
    color: var(--c-text-primary);
}

.qm-s1-sheet-toggle-btn {
    background: var(--c-surface); border: 1px solid var(--c-bdr);
    color: var(--c-sub); width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.25s ease, background 0.2s;
}

.qm-s1-sheet.is-peek .qm-s1-sheet-toggle-btn { transform: rotate(180deg); }

.qm-s1-sheet-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 4px 12px calc(var(--nav-h) + var(--safe-b) + 32px);
    box-sizing: border-box;
}

/* ── 2. TARJETAS DEL CATÁLOGO EN BOTTOM-SHEET ── */
.qm-s1-sheet .qm-s1-places-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0;
}

.qm-s1-card-img-box { position: relative; width: 100%; aspect-ratio: 16/10; overflow: hidden; border-radius: 12px 12px 0 0; }

.qm-s1-cat-badge-pill,
.qm-s1-place-cat-badge {
    position: absolute; bottom: 6px; left: 6px; z-index: 5;
    display: inline-flex; align-items: center; gap: 4px;
    background: color-mix(in srgb, var(--c-surface) 80%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--c-bdr));
    border-radius: 9999px;
    padding: 2px 7px; font-family: var(--font-body); font-size: 9.5px; font-weight: 700;
    color: var(--c-text-primary);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--c-bg) 40%, transparent);
    pointer-events: none; max-width: calc(100% - 12px);
}
.qm-s1-cat-badge-pill svg,
.qm-s1-place-cat-badge svg {
    color: var(--brand); flex-shrink: 0;
}
.qm-s1-cat-badge-pill span,
.qm-s1-place-cat-badge span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.qm-s1-fav-toggle {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: auto;
}

.qm-s1-card-actions {
    display: flex; gap: 4px; align-items: center; margin-top: 6px; width: 100%;
}
.qm-s1-btn-open {
    flex: 1; min-width: 0; padding: 6px 8px; font-size: 11px; font-weight: 700;
    border-radius: 9999px; white-space: nowrap; text-align: center;
}
.qm-s1-btn-open span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qm-s1-btn-route {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 8px; font-size: 10.5px; font-weight: 600; border-radius: 9999px;
    background: color-mix(in srgb, var(--c-surface) 90%, transparent);
    color: var(--brand); border: 1px solid var(--c-bdr);
    white-space: nowrap; transition: all 0.2s ease; flex-shrink: 0;
}
.qm-s1-btn-route:active {
    background: var(--brand); color: var(--c-card); border-color: var(--brand);
}

/* ── 3. ARQUITECTURA SPLIT-SCREEN PARA ESCRITORIO (>= 769px) ── */
@media (min-width: 769px) {
    #qm-slot-1 {
        width: 100%;
        max-width: none;
        flex: 1 1 100%;
        height: 100vh;
        max-height: 100vh;
        padding-bottom: 0;
        overflow: hidden;
    }

    #qm-s1-explorar {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #qm-s1-header {
        flex-shrink: 0;
        padding: 14px 24px;
        background: var(--c-surface);
        border-bottom: 1px solid var(--c-bdr);
    }

    #qm-s1-viewport {
        flex: 1;
        min-height: 0;
        height: calc(100vh - 65px);
        width: 100%;
        position: relative;
        overflow: hidden;
    }

    #qm-s1-view-2d {
        display: flex;
        flex-direction: row;
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    /* El Bottom-Sheet móvil se convierte en Panel Lateral de Directorio */
    .qm-s1-sheet {
        position: relative;
        width: 420px;
        min-width: 380px;
        max-width: 460px;
        height: 100%;
        max-height: 100%;
        inset: auto;
        transform: none;
        border-radius: 0;
        border-top: none;
        border-right: 1px solid var(--c-bdr);
        background: var(--c-surface);
        z-index: 15;
        display: flex;
        flex-direction: column;
        box-shadow: 4px 0 24px color-mix(in srgb, var(--c-bg) 60%, transparent);
        order: 1;
        overflow: hidden;
    }

    .qm-s1-sheet.is-peek,
    .qm-s1-sheet.is-minimized,
    .qm-s1-sheet.is-half,
    .qm-s1-sheet.is-expanded,
    .qm-s1-sheet.is-closed {
        transform: none;
    }

    .qm-s1-sheet-handle-zone {
        cursor: default;
        padding: 16px 20px 12px;
        border-bottom: 1px solid var(--c-bdr);
        align-items: flex-start;
    }

    .qm-s1-sheet-handle-bar {
        display: none;
    }

    .qm-s1-sheet-toggle-btn {
        display: none;
    }

    .qm-s1-sheet-title {
        font-size: 14px;
        font-weight: 800;
    }

    .qm-s1-sheet-content {
        flex: 1;
        height: 100%;
        padding: 16px;
        padding-bottom: 40px;
        overflow-y: auto;
    }

    .qm-s1-sheet #qm-s1-grid,
    .qm-s1-sheet .qm-s1-places-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 0;
        width: 100%;
    }

    .qm-s1-place-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 14px;
        padding: 12px;
        border-radius: 14px;
        transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
        box-sizing: border-box;
    }

    .qm-s1-place-card:hover {
        transform: translateY(-2px);
        border-color: var(--brand);
        box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 15%, transparent);
    }

    .qm-s1-card-img-box {
        width: 100px;
        height: 75px;
        aspect-ratio: auto;
        border-radius: 10px;
        flex-shrink: 0;
        position: relative;
        overflow: hidden;
    }

    .qm-s1-place-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .qm-s1-place-title {
        font-family: var(--font-head);
        font-size: 14px;
        font-weight: 700;
        color: var(--c-text-primary);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .qm-s1-card-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .qm-s1-btn-open,
    .qm-s1-btn-route {
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 8px;
    }

    /* Buscador flotante adaptado a la barra superior del mapa */
    .qm-s1-search-floating {
        position: absolute;
        top: 16px;
        left: 440px;
        z-index: 25;
        max-width: 520px;
        width: calc(100% - 470px);
    }

    /* Lienzo de mapa interactivo ocupa todo el panel derecho */
    #qm-s1-map-canvas {
        flex: 1;
        height: 100%;
        position: relative;
        inset: auto;
        order: 2;
    }

    /* Modo 3D en escritorio */
    #qm-s1-view-3d {
        width: 100%;
        height: 100%;
    }
}



/* === _slot-2.css === */
/* ================================================================
   SLOT 2 — ASISTENTE IA & CHATBOT (ORQUESTADOR MODULAR)
   Arquitectura de Primitivas Universales del SO (< 350 líneas)
   ================================================================ */





/* === _slot-2-mobile.css === */
/* ================================================================
   SLOT 2 — CHAT MOBILE, BURBUJAS, PLANTILLAS Y MODAL OTP
   Arquitectura de Primitivas Universales del SO (< 280 líneas)
   ================================================================ */

#qm-pwa-slots-container > #qm-slot-2,
#qm-slot-2.qm-pwa-overlay-screen,
#qm-slot-2 {
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background: var(--nav-bg);
    padding: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.qm-s2-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 0;
    position: relative;
    box-sizing: border-box;
    flex: 1 1 auto;
    overflow: hidden;
}

/* Header del Asistente en Mobile */
.qm-s2-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(var(--safe-t) + 12px) 16px 12px;
    border-bottom: 1px solid var(--c-bdr); background: var(--c-card);
    flex-shrink: 0; z-index: 10;
}
.qm-s2-header-left { display: flex; align-items: center; gap: 12px; }
.qm-s2-header-icon {
    background: var(--brand); color: var(--c-card); width: 36px; height: 36px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qm-s2-header-title {
    margin: 0; font-family: var(--font-head); font-size: 16px;
    font-weight: 700; color: var(--c-text-primary); line-height: 1.2;
}
.qm-s2-header-sub {
    margin: 2px 0 0; font-family: var(--font-body); font-size: 11px; color: var(--c-sub);
}

/* Modal OTP Backdrop y Card */
.qm-s2-otp-modal-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: color-mix(in srgb, var(--c-bg) 85%, transparent); z-index: 99;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; text-align: center; backdrop-filter: blur(10px);
}
.qm-s2-otp-modal-card {
    max-width: 320px; width: 100%; padding: 24px 20px;
    border-radius: 24px; display: flex; flex-direction: column; align-items: center;
}
.qm-s2-otp-modal-title { margin: 0 0 8px; font-family: var(--font-head); font-size: 20px; color: var(--c-text-primary); }
.qm-s2-otp-modal-sub { margin: 0 0 20px; font-family: var(--font-body); font-size: 13px; color: var(--c-sub); line-height: 1.4; }
.qm-s2-otp-form { width: 100%; }
.qm-s2-form-group { margin-bottom: 12px; text-align: left; }
.qm-s2-form-label { font-family: var(--font-body); font-size: 12px; color: var(--c-sub); display: block; margin-bottom: 6px; font-weight: 600; }
.qm-s2-guest-select {
    width: 100%; background: var(--c-surface); border: 1px solid var(--c-bdr);
    color: var(--c-text-primary); border-radius: 12px; padding: 10px 12px;
    font-family: var(--font-body); font-size: 13px; outline: none; box-sizing: border-box;
}
.qm-s2-phone-input {
    width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px;
    border: 1px solid var(--c-bdr); background: var(--c-surface);
    color: var(--c-text-primary); font-family: var(--font-body); font-size: 15px;
    margin-bottom: 12px; text-align: center;
}
.qm-s2-code-input {
    width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px;
    border: 1px solid var(--c-bdr); background: var(--c-surface);
    color: var(--c-text-primary); font-family: var(--font-body); font-size: 22px;
    letter-spacing: 6px; text-align: center; margin-bottom: 12px;
}
.qm-s2-otp-submit-btn { width: 100%; margin-bottom: 8px; }
.qm-s2-otp-cancel-btn { width: 100%; }

/* Banner Modo Invitado */
.qm-s2-guest-banner-mobile {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; margin-bottom: 12px; border-radius: 14px;
    background: var(--c-card); border: 1px solid var(--c-bdr);
}
.qm-s2-guest-banner-text { font-family: var(--font-body); font-size: 12px; color: var(--c-text-primary); line-height: 1.4; }

/* Historial del Chat */
.qm-s2-chat-history {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 14px;
    background: var(--nav-bg); box-sizing: border-box; -webkit-overflow-scrolling: touch;
}

/* Burbujas del Chat */
.qm-s2-bubble.qm-s2-bot {
    align-self: flex-start; width: 100%; max-width: 90%;
    background: var(--c-card); border: 1px solid var(--c-bdr);
    border-radius: 18px 18px 18px 4px; padding: 14px 16px;
    color: var(--c-text-primary); font-family: var(--font-body);
    font-size: 13.5px; line-height: 1.5; box-sizing: border-box;
}
.qm-s2-bubble.qm-s2-user {
    align-self: flex-end; max-width: 85%;
    background: color-mix(in srgb, var(--brand) 15%, var(--c-surface));
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
    border-radius: 18px 18px 4px 18px; padding: 12px 16px;
    color: var(--c-text-primary); font-family: var(--font-body);
    font-size: 13.5px; line-height: 1.5; box-sizing: border-box;
}
.qm-s2-bubble-greeting {
    display: flex; align-items: center; margin-bottom: 6px;
    color: var(--brand); font-family: var(--font-head); font-size: 14px;
}

/* Respuestas Rápidas */
.qm-s2-quick-replies {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
}
.qm-s2-quick-reply-btn {
    background: var(--c-surface);
    border: 1px solid var(--c-bdr);
    color: var(--c-text-primary);
    border-radius: 12px;
    padding: 10px 14px;
    text-align: left;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}
.qm-s2-quick-reply-btn:active {
    transform: scale(0.98);
    background: color-mix(in srgb, var(--brand) 15%, var(--c-surface));
    border-color: var(--brand);
}

/* Panel de Plantillas */
.qm-s2-templates-panel {
    background: var(--c-card); border-top: 1px solid var(--c-bdr);
    padding: 12px 14px; max-height: 200px; overflow-y: auto;
}
.qm-s2-templates-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.qm-s2-templates-title {
    font-family: var(--font-head); font-size: 13px; font-weight: 700;
    color: var(--c-text-primary); display: flex; align-items: center; gap: 6px;
}
.qm-s2-templates-close { width: 28px; height: 28px; }
.qm-s2-templates-list { display: flex; flex-direction: column; gap: 6px; }
.qm-s2-template-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--c-surface); border: 1px solid var(--c-bdr);
    border-radius: 10px; padding: 8px 10px; cursor: pointer;
}
.qm-s2-template-info { flex: 1; min-width: 0; }
.qm-s2-template-title-text {
    font-family: var(--font-head); font-size: 12px; font-weight: 700;
    color: var(--c-text-primary); margin: 0 0 2px;
}
.qm-s2-template-preview-text {
    font-family: var(--font-body); font-size: 11px; color: var(--c-sub);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0;
}
.qm-s2-template-delete-btn {
    background: transparent; border: none; color: var(--c-sub);
    cursor: pointer; padding: 4px; border-radius: 4px; display: flex;
    align-items: center; justify-content: center;
}
.qm-s2-template-delete-btn:hover { color: var(--brand); }
.qm-s2-templates-actions { margin-top: 8px; }
.qm-s2-templates-btn-add { width: 100%; }

.qm-s2-add-template-form {
    display: flex; flex-direction: column; gap: 8px;
    border-top: 1px solid var(--c-bdr); padding-top: 8px; margin-top: 8px;
}
.qm-template-input, .qm-template-textarea {
    width: 100%; box-sizing: border-box; background: var(--c-surface);
    border: 1px solid var(--c-bdr); border-radius: 8px; padding: 6px 10px;
    font-family: var(--font-body); color: var(--c-text-primary); outline: none;
}
.qm-template-input:focus, .qm-template-textarea:focus { border-color: var(--brand); }
.qm-template-input { font-size: 12px; font-weight: 600; }
.qm-template-textarea { font-size: 11px; resize: none; }
.qm-template-form-buttons { display: flex; justify-content: flex-end; gap: 8px; }

/* Área de Input y Barra de Herramientas */
.qm-s2-input-area {
    padding: 10px 14px calc(var(--nav-h) + var(--safe-b) + 26px);
    border: none;
    border-top: 1px solid var(--nav-border);
    border-radius: 0;
    background: var(--nav-bg);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
    z-index: 10;
    box-shadow: none;
    transition: padding-bottom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Compensación de holgura en Modo iPhone (Isla Flotante Liquid Glass) */
body:has(.qm-ios-floating-nav) .qm-s2-input-area,
body.qm-ios-floating-active .qm-s2-input-area {
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + 38px);
}

body.qm-keyboard-open .qm-s2-input-area,
.qm-keyboard-open .qm-s2-input-area {
    padding: 10px 14px max(8px, env(safe-area-inset-bottom, 0px));
}
.qm-s2-attach-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--c-bdr);
    background: var(--c-card);
    color: var(--c-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.qm-s2-attach-btn:active {
    transform: scale(0.92);
    background: color-mix(in srgb, var(--brand) 15%, var(--c-surface));
    border-color: var(--brand);
}
.qm-s2-textarea {
    flex: 1;
    background: var(--c-card);
    border: 1px solid var(--c-bdr);
    border-radius: 20px;
    padding: 10px 14px;
    color: var(--c-text-primary);
    font-family: var(--font-body);
    font-size: 13.5px;
    resize: none;
    overflow-y: hidden;
    min-height: 38px;
    max-height: 100px;
    box-sizing: border-box;
    outline: none;
}
.qm-s2-send-btn,
#qm-s2-send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: var(--brand);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
}
.qm-s2-send-btn:active,
#qm-s2-send-btn:active {
    transform: scale(0.92);
}
.qm-s2-send-btn svg,
.qm-s2-send-btn .qm-icon,
.qm-s2-send-btn .qm-svg-icon,
#qm-s2-send-btn svg,
#qm-s2-send-btn .qm-icon,
#qm-s2-send-btn .qm-svg-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2.2;
    display: block;
    margin-left: 2px;
    pointer-events: none;
}


/* === _slot-2-desktop.css === */
/* ================================================================
   SLOT 2 — CHAT TWO-PANEL DESKTOP
   Arquitectura de Primitivas Universales del SO (< 250 líneas)
   ================================================================ */

@media (min-width: 769px) {
    .qm-s2-desktop-grid {
        display: grid;
        grid-template-columns: 320px 1fr;
        height: 100%;
        width: 100%;
    }

    .qm-s2-sidebar {
        display: flex;
        flex-direction: column;
        background: color-mix(in srgb, var(--c-surface) 90%, transparent);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-right: 1px solid var(--c-bdr);
        padding: 24px 20px;
        box-sizing: border-box;
        overflow-y: auto;
        height: 100vh;
    }
    .qm-s2-sidebar-header {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 28px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--c-bdr);
    }
    .qm-s2-sidebar-avatar {
        width: 44px; height: 44px;
        background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--c-surface)));
        border-radius: 14px;
        display: flex; align-items: center; justify-content: center;
        color: var(--c-card);
        box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent);
    }
    .qm-s2-sidebar-title {
        font-family: var(--font-head);
        font-size: 16px; font-weight: 700;
        color: var(--c-text-primary); margin: 0;
    }
    .qm-s2-sidebar-status {
        font-family: var(--font-body);
        font-size: 11px; color: var(--c-sub);
        margin: 2px 0 0;
        display: flex; align-items: center; gap: 6px;
    }
    .qm-s2-online-dot {
        width: 7px; height: 7px;
        background: var(--badge);
        border-radius: 50%;
        display: inline-block;
        box-shadow: 0 0 6px var(--badge);
        animation: qmPulseOnline 2s ease-in-out infinite;
    }
    @keyframes qmPulseOnline {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
    }
    .qm-s2-sidebar-section {
        margin-bottom: 24px;
    }
    .qm-s2-sidebar-section-label {
        font-family: var(--font-head);
        font-size: 10px; font-weight: 700;
        letter-spacing: 1.5px; text-transform: uppercase;
        color: var(--c-muted);
        margin: 0 0 12px;
    }
    .qm-s2-sidebar-topics {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .qm-s2-topic-btn {
        display: flex; align-items: center; gap: 10px;
        background: var(--c-surface);
        border: 1px solid var(--c-bdr);
        border-radius: 12px;
        padding: 11px 14px;
        color: var(--c-text-primary);
        font-family: var(--font-body);
        font-size: 13px; font-weight: 500;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        text-align: left;
    }
    .qm-s2-topic-btn:hover {
        background: color-mix(in srgb, var(--brand) 15%, var(--c-surface));
        border-color: var(--brand);
        color: var(--c-text-primary);
        transform: translateX(4px);
    }
    .qm-s2-topic-btn svg { flex-shrink: 0; color: var(--brand); }

    .qm-s2-sidebar-guest {
        background: color-mix(in srgb, var(--brand) 10%, var(--c-surface));
        border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
        border-radius: 14px;
        padding: 16px;
        text-align: center;
        margin-bottom: 20px;
    }
    .qm-s2-sidebar-guest svg { color: var(--brand); margin-bottom: 8px; }
    .qm-s2-sidebar-guest p {
        font-family: var(--font-body);
        font-size: 12px; color: var(--c-sub);
        margin: 0 0 12px;
    }
    .qm-s2-sidebar-link-btn {
        background: var(--brand); color: var(--c-card);
        border: none; border-radius: 8px;
        padding: 8px 16px;
        font-family: var(--font-head);
        font-size: 12px; font-weight: 600;
        cursor: pointer;
        transition: opacity 0.2s;
    }
    .qm-s2-sidebar-link-btn:hover { opacity: 0.85; }

    .qm-s2-sidebar-footer-info {
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid var(--c-bdr);
        text-align: center;
    }
    .qm-s2-sidebar-footer-info p {
        font-family: var(--font-head);
        font-size: 11px; font-weight: 700;
        letter-spacing: 1px; text-transform: uppercase;
        color: var(--brand);
        margin: 0 0 4px;
    }
    .qm-s2-sidebar-footer-info small {
        font-family: var(--font-body);
        font-size: 10px; color: var(--c-muted);
    }

    /* Chat Main Panel */
    #qm-slot-2 .qm-s2-main {
        display: flex;
        flex-direction: column;
        height: 100vh;
        max-width: 960px;
        margin: 0 auto;
        width: 100%;
        position: relative;
        background: var(--c-surface);
        box-sizing: border-box;
        border-left: 1px solid var(--c-bdr);
        border-right: 1px solid var(--c-bdr);
        box-shadow: 0 0 40px color-mix(in srgb, var(--c-bg) 60%, transparent);
    }
    #qm-slot-2 .qm-s2-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 24px;
        border-bottom: 1px solid var(--c-bdr);
        background: var(--c-card);
        flex-shrink: 0;
    }
    .qm-s2-header-left {
        display: flex; align-items: center; gap: 12px;
    }
    .qm-s2-header-icon {
        background: var(--brand); color: var(--c-card);
        width: 36px; height: 36px;
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
    }
    .qm-s2-header-title {
        margin: 0; font-family: var(--font-head);
        font-size: 16px; font-weight: 700;
        color: var(--c-text-primary);
    }
    .qm-s2-header-sub {
        margin: 0; font-family: var(--font-body);
        font-size: 11px; color: var(--c-sub);
    }

    #qm-slot-2 .qm-s2-chat-history {
        flex: 1;
        overflow-y: auto;
        padding: 24px 32px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        background: var(--c-bg);
    }

    .qm-s2-guest-banner-mobile { display: none; }

    /* Premium Bubbles on Desktop */
    .qm-s2-bubble.qm-s2-bot {
        align-self: flex-start;
        max-width: 860px;
        width: 100%;
        box-sizing: border-box;
        background: var(--c-card);
        border: 1px solid var(--c-bdr);
        border-radius: 18px 18px 18px 4px;
        padding: 20px 24px;
        color: var(--c-text-primary);
        font-family: var(--font-body);
        font-size: 14px; line-height: 1.6;
        box-shadow: 0 2px 10px color-mix(in srgb, var(--c-text-primary) 5%, transparent);
    }
    .qm-s2-bubble.qm-s2-user {
        align-self: flex-end;
        max-width: 650px;
        background: color-mix(in srgb, var(--brand) 15%, var(--c-surface));
        border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
        border-radius: 18px 18px 4px 18px;
        padding: 14px 18px;
        color: var(--c-text-primary);
        font-family: var(--font-body);
        font-size: 14px; line-height: 1.6;
        box-shadow: 0 2px 8px color-mix(in srgb, var(--c-text-primary) 5%, transparent);
    }
    .qm-s2-bubble-greeting {
        display: block; margin-bottom: 8px; color: var(--brand);
    }
    .qm-s2-quick-replies {
        margin-top: 16px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    .qm-s2-quick-reply-btn {
        background: var(--c-surface);
        border: 1px solid var(--c-bdr);
        color: var(--c-text-primary);
        border-radius: 12px;
        padding: 12px 14px;
        text-align: left;
        font-family: var(--font-body);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        box-sizing: border-box;
    }
    .qm-s2-quick-reply-btn:hover {
        background: color-mix(in srgb, var(--brand) 18%, var(--c-surface));
        border-color: var(--brand);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 20%, transparent);
    }
    .qm-s2-quick-reply-btn svg {
        flex-shrink: 0;
        color: var(--brand);
        width: 16px;
        height: 16px;
    }

    /* Input Area Desktop */
    #qm-slot-2 .qm-s2-input-area {
        padding: 16px 24px;
        border: none;
        border-top: 1px solid var(--c-bdr);
        border-radius: 0;
        box-shadow: none;
        background: var(--c-surface);
        display: flex; gap: 12px; align-items: center;
        position: sticky; bottom: 0;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
        z-index: 10;
    }
    .qm-s2-attach-btn {
        width: 44px; height: 44px;
        flex-shrink: 0; border-radius: 50%;
        border: 1px solid var(--c-bdr);
        background: var(--c-card);
        color: var(--c-text-primary); cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        transition: background 0.2s;
    }
    .qm-s2-attach-btn:hover { background: color-mix(in srgb, var(--brand) 20%, var(--c-surface)); }
    .qm-s2-textarea {
        flex: 1;
        background: var(--c-card);
        border: 1px solid var(--nav-border);
        border-radius: 20px;
        padding: 12px 16px;
        color: var(--c-text-primary);
        font-family: var(--font-body);
        font-size: 14px;
        resize: none; overflow-y: hidden;
        min-height: 44px; max-height: 120px;
        box-sizing: border-box;
        transition: border-color 0.2s;
        outline: none;
    }
    .qm-s2-textarea:focus { border-color: var(--brand); }
    .qm-s2-send-btn,
    #qm-s2-send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        flex-shrink: 0;
        border-radius: 50%;
        border: none;
        background: var(--brand);
        color: var(--c-card);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        box-sizing: border-box;
    }
    .qm-s2-send-btn:hover,
    #qm-s2-send-btn:hover {
        filter: brightness(1.15);
    }
    .qm-s2-send-btn svg,
    .qm-s2-send-btn .qm-icon,
    .qm-s2-send-btn .qm-svg-icon,
    #qm-s2-send-btn svg,
    #qm-s2-send-btn .qm-icon,
    #qm-s2-send-btn .qm-svg-icon {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        stroke: var(--c-card);
        fill: none;
        stroke-width: 2.2;
        display: block;
        margin-left: 2px;
        pointer-events: none;
    }
}


/* === _slot-3.css === */
/* ================================================================
   SLOT 3 — VIAJES & LOGÍSTICA (RADAR Y STEPPER)
   Arquitectura de Primitivas Universales del SO (< 250 líneas)
   ================================================================ */

@media (min-width: 769px) {
    .qm-s3-desktop-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        max-width: 1100px;
        margin: 0 auto;
        padding: 30px 40px;
        box-sizing: border-box;
    }

    .qm-s3-col-left {
        padding-right: 30px;
        border-right: 1px solid var(--c-bdr);
    }
    .qm-s3-col-right {
        padding-left: 30px;
    }

    .qm-s3-radar-wrap {
        padding: 40px 20px 30px;
    }
    .qm-s3-radar {
        width: 220px; height: 220px;
    }

    /* Info Panel (desktop FAQ) */
    .qm-s3-info-panel {
        display: block;
        background: var(--c-card);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--c-bdr);
        border-radius: 18px;
        padding: 20px;
        margin-top: 20px;
    }
    .qm-s3-info-title {
        font-family: var(--font-head);
        font-size: 14px; font-weight: 700;
        color: var(--c-text-primary); margin: 0 0 16px;
        display: flex; align-items: center; gap: 8px;
    }
    .qm-s3-info-title svg { color: var(--brand); }
    .qm-s3-info-items { display: flex; flex-direction: column; gap: 14px; }
    .qm-s3-info-item {
        display: flex; align-items: flex-start; gap: 12px;
    }
    .qm-s3-info-icon {
        width: 32px; height: 32px;
        background: color-mix(in srgb, var(--brand) 15%, var(--c-surface));
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        color: var(--brand); flex-shrink: 0;
    }
    .qm-s3-info-label {
        font-family: var(--font-head);
        font-size: 13px; font-weight: 600;
        color: var(--c-text-primary); margin: 0 0 2px;
    }
    .qm-s3-info-desc {
        font-family: var(--font-body);
        font-size: 11px; color: var(--c-sub); margin: 0;
    }

    /* Empty state placeholder for right column */
    .qm-s3-empty-state {
        display: flex;
        flex-direction: column;
        align-items: center; justify-content: center;
        text-align: center;
        padding: 60px 20px;
        height: 100%;
        min-height: 300px;
    }
    .qm-s3-empty-icon {
        color: var(--brand);
        opacity: 0.6;
        margin-bottom: 20px;
        animation: qmFloatIcon 3s ease-in-out infinite;
    }
    @keyframes qmFloatIcon {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }
    .qm-s3-empty-title {
        font-family: var(--font-head);
        font-size: 20px; font-weight: 700;
        color: var(--c-text-primary); margin: 0 0 8px;
    }
    .qm-s3-empty-desc {
        font-family: var(--font-body);
        font-size: 14px; color: var(--c-sub);
        max-width: 280px; margin: 0;
    }
}

@media (max-width: 768px) {
    .qm-s3-info-panel { display: none; }
    .qm-s3-empty-state { display: none; }
    .qm-s3-desktop-grid { display: block; }
    .qm-s3-col-left { padding-right: 0; border-right: none; }
    .qm-s3-col-right { padding-left: 0; }
}

/* ================================================================
   SLOT 3 — VIAJES (RADAR + STEPPER)
   ================================================================ */
.qm-s3-header {
    padding: calc(var(--safe-t) + 20px) 20px 16px;
    background: linear-gradient(160deg, var(--nav-bg) 0%, color-mix(in srgb, var(--brand) 15%, var(--nav-bg)) 100%);
}
.qm-s3-title {
    font-family: var(--font-head); font-size: 22px;
    font-weight: 800; color: var(--c-text-primary); margin: 0 0 6px;
}
.qm-s3-sub {
    font-family: var(--font-body); font-size: 13px;
    color: var(--c-sub); margin: 0;
}

/* Radar */
.qm-s3-radar-wrap {
    display: flex; align-items: center; justify-content: center;
    padding: 30px 20px 20px;
}
.qm-s3-radar {
    position: relative;
    width: 180px; height: 180px;
}
.qm-s3-radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--brand) 40%, transparent);
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    animation: qmRadarPulse 2.4s ease-out infinite;
}
.qm-s3-radar-ring:nth-child(1) { width:  60px; height:  60px; animation-delay: 0s;    opacity: 0.9; }
.qm-s3-radar-ring:nth-child(2) { width: 110px; height: 110px; animation-delay: 0.8s;  opacity: 0.6; }
.qm-s3-radar-ring:nth-child(3) { width: 160px; height: 160px; animation-delay: 1.6s;  opacity: 0.3; }
@keyframes qmRadarPulse {
    0%   { opacity: 0.8; transform: translate(-50%,-50%) scale(0.85); }
    60%  { opacity: 0.4; }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(1); }
}
.qm-s3-radar-center {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 44px; height: 44px;
    background: var(--brand);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 20px color-mix(in srgb, var(--brand) 50%, transparent);
}

/* Tracker form */
.qm-s3-form-section {
    padding: 0 20px 20px;
}
.qm-s3-input-group { display: flex; gap: 8px; }
.qm-s3-input {
    flex: 1;
    background: var(--c-card);
    border: 1.5px solid var(--c-bdr);
    border-radius: 14px;
    padding: 12px 16px;
    font-family: var(--font-body); font-size: 14px;
    color: var(--c-text-primary); outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.qm-s3-input:focus { border-color: var(--brand); }
.qm-s3-input::placeholder { color: var(--c-sub); }
.qm-s3-track-btn {
    background: var(--brand); color: #ffffff;
    border: none; border-radius: 14px;
    padding: 12px 20px;
    font-family: var(--font-body); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: opacity 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.qm-s3-track-btn:active { opacity: 0.8; }

/* Stepper resultado */
#qm-s3-result { padding: 20px; display: none; }
.qm-s3-order-header {
    background: var(--c-card);
    border: 1px solid var(--c-bdr);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}
.qm-s3-order-id {
    font-family: var(--font-head); font-size: 13px;
    color: var(--c-sub); margin: 0 0 4px;
}
.qm-s3-order-status {
    font-family: var(--font-head); font-size: 18px;
    font-weight: 700; color: var(--brand); margin: 0;
}
.qm-s3-stepper { display: flex; flex-direction: column; gap: 0; }
.qm-s3-step {
    display: flex; align-items: flex-start; gap: 14px;
    position: relative;
}
.qm-s3-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px; top: 36px;
    width: 2px; height: calc(100% - 20px);
    background: var(--c-bdr);
}
.qm-s3-step.done::after  { background: var(--brand); }
.qm-s3-step-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--c-card);
    border: 2px solid var(--c-bdr);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--c-sub);
    transition: all 0.3s;
    z-index: 1;
}
.qm-s3-step.done .qm-s3-step-dot {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}
.qm-s3-step.current .qm-s3-step-dot {
    background: var(--c-card);
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent);
    animation: qmStepPulse 1.5s ease-in-out infinite;
}
@keyframes qmStepPulse {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
    50%       { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 10%, transparent); }
}
.qm-s3-step-body { padding: 6px 0 24px; }
.qm-s3-step-label {
    font-family: var(--font-head); font-size: 14px;
    font-weight: 600; color: var(--c-text-primary); margin: 0 0 2px;
}
.qm-s3-step.pending .qm-s3-step-label { color: var(--c-sub); }
.qm-s3-step-time {
    font-family: var(--font-body); font-size: 11px;
    color: var(--c-sub); margin: 0;
}
#qm-s3-no-result {
    text-align: center; padding: 20px;
    display: none;
}
#qm-s3-no-result p {
    font-family: var(--font-body); font-size: 14px;
    color: var(--c-sub); margin: 8px 0;
}


/* === _slot-4.css === */
/* ================================================================
   SLOT 4 — PERFIL (TARJETA VIP, HERRAMIENTAS Y PREFERENCIAS)
   Arquitectura de Primitivas Universales del SO (< 280 líneas)
   ================================================================ */

@media (min-width: 769px) {
    #qm-slot-4 .qm-s4-wrap {
        max-width: 1100px;
        margin: 0 auto;
        padding: 40px;
    }

    .qm-s4-vip-card {
        max-width: none;
        margin: 0;
        transition: transform 0.3s ease, box-shadow 0.4s ease;
    }
    .qm-s4-vip-card:hover { transform: translateY(-4px); }

    .qm-s4-tools-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .qm-s4-tool-btn { transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
    .qm-s4-tool-btn:hover {
        transform: translateY(-4px);
        border-color: var(--brand);
        box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 20%, transparent);
    }

    .qm-s4-card {
        background: var(--c-card);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--c-bdr);
        transition: border-color 0.2s;
    }
    .qm-s4-card:hover { border-color: var(--brand); }
    .qm-s4-row { transition: all 0.15s; }
    .qm-s4-row:hover {
        background: color-mix(in srgb, var(--brand) 8%, transparent);
        padding-left: 20px;
    }

    .qm-s4-theme-pills { gap: 10px; }
    .qm-s4-theme-pill:hover {
        background: color-mix(in srgb, var(--brand) 10%, transparent);
        transform: translateY(-2px);
    }

    .qm-s4-guest-block {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

.qm-s4-wrap { padding: calc(var(--safe-t) + 16px) 16px 120px; }

/* VIP Card */
.qm-s4-vip-card {
    background: linear-gradient(135deg,
        var(--c-surface) 0%,
        color-mix(in srgb, var(--brand) 20%, var(--c-surface)) 50%,
        var(--c-card) 100%);
    border-radius: 22px;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--c-bdr);
}
.qm-s4-vip-card.qm-vip-cacique {
    border: 2px solid var(--badge);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 15px color-mix(in srgb, var(--badge) 40%, transparent);
}
.qm-s4-vip-card.qm-vip-baquiano {
    border: 2px solid var(--brand);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 10px color-mix(in srgb, var(--brand) 25%, transparent);
}
.qm-s4-vip-card.qm-vip-civil {
    border: 1px solid var(--c-bdr);
}

.qm-s4-vip-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}
.qm-s4-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--brand); color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-size: 20px; font-weight: 700;
    flex-shrink: 0; object-fit: cover;
    border: 2px solid var(--c-card);
}
.qm-s4-user-info { flex: 1; min-width: 0; }
.qm-s4-user-name {
    font-family: var(--font-head); font-size: 17px; font-weight: 800;
    color: var(--c-text-primary); margin: 0 0 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qm-s4-user-email {
    font-family: var(--font-body); font-size: 12px;
    color: var(--c-sub); margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qm-s4-vip-badge {
    background: var(--brand); color: #ffffff;
    border-radius: 12px; padding: 4px 10px;
    font-family: var(--font-head); font-size: 11px; font-weight: 800;
    letter-spacing: 0.5px; flex-shrink: 0;
}

.qm-s4-vip-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 1px; background: var(--c-bdr);
    border-radius: 14px; overflow: hidden;
    position: relative; z-index: 1;
}
.qm-s4-stat {
    background: var(--c-card);
    padding: 12px 8px; text-align: center;
}
.qm-s4-stat-num {
    font-family: var(--font-head); font-size: 20px;
    font-weight: 800; color: var(--c-text-primary); display: block;
}
.qm-s4-stat-lbl {
    font-family: var(--font-body); font-size: 10px;
    color: var(--c-sub); display: block; margin-top: 2px;
}

/* Settings cards */
.qm-s4-section-title {
    font-family: var(--font-head); font-size: 14px;
    font-weight: 700; color: var(--c-sub);
    letter-spacing: 0.5px; text-transform: uppercase;
    margin: 0 0 10px 4px;
}
.qm-s4-card {
    background: var(--c-card); border: 1px solid var(--c-bdr);
    border-radius: 18px; overflow: hidden; margin-bottom: 20px;
}
.qm-s4-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--c-bdr);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}
.qm-s4-row:last-child { border-bottom: none; }
.qm-s4-row:active { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.qm-s4-row-icon {
    width: 36px; height: 36px;
    background: color-mix(in srgb, var(--brand) 12%, var(--c-surface));
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: var(--brand); flex-shrink: 0;
}
.qm-s4-row-body { flex: 1; min-width: 0; }
.qm-s4-row-label {
    font-family: var(--font-body); font-size: 14px;
    font-weight: 500; color: var(--c-text-primary); margin: 0;
}
.qm-s4-row-sub {
    font-family: var(--font-body); font-size: 11px;
    color: var(--c-sub); margin: 2px 0 0;
}
.qm-s4-row-arrow { color: var(--c-muted); }

/* Mis Herramientas Grid (Mobile-first & Desktop) */
.qm-s4-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.qm-s4-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    border-radius: 16px;
    background: var(--c-card);
    border: 1px solid var(--c-bdr);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}
.qm-s4-tool-btn:active {
    transform: scale(0.97);
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 6%, var(--c-card));
}
.qm-s4-tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand) 12%, var(--c-surface));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    margin-bottom: 12px;
    flex-shrink: 0;
}
.qm-s4-tool-label {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text-primary);
    margin: 0 0 2px 0;
    line-height: 1.25;
}
.qm-s4-tool-sub {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    color: var(--c-sub);
    margin: 0;
    line-height: 1.3;
}
.qm-s4-tool-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--brand);
    color: #ffffff;
    border-radius: 9999px;
    padding: 2px 8px;
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Theme toggle pills */
.qm-s4-theme-pills {
    display: flex; gap: 6px; padding: 4px; margin: 0 16px 14px;
    background: color-mix(in srgb, var(--c-surface) 75%, var(--c-card));
    border: 1px solid var(--c-bdr); border-radius: 14px;
    box-sizing: border-box;
}
.qm-s4-theme-pill {
    flex: 1; background: transparent;
    border: 1px solid transparent; border-radius: 10px;
    padding: 8px 4px; display: flex; flex-direction: column;
    align-items: center; gap: 4px; cursor: pointer;
    font-family: var(--font-body); font-size: 11px; font-weight: 600;
    color: var(--c-sub); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}
.qm-s4-theme-pill.active {
    background: var(--c-card);
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* Guest / OTP Login */
.qm-s4-guest-block {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--c-surface)) 0%, var(--c-card) 100%);
    border: 1px solid var(--c-bdr); border-radius: 18px;
    padding: 24px 20px; text-align: center; margin-bottom: 24px;
}
.qm-s4-guest-title {
    font-family: var(--font-head); font-size: 18px;
    font-weight: 700; color: var(--c-text-primary); margin: 12px 0 6px;
}
.qm-s4-guest-sub {
    font-family: var(--font-body); font-size: 13px;
    color: var(--c-sub); margin: 0 0 20px;
}
.qm-s4-otp-form { display: flex; flex-direction: column; gap: 10px; }
.qm-s4-otp-input {
    background: var(--c-surface); border: 1.5px solid var(--c-bdr);
    border-radius: 14px; padding: 13px 16px; font-family: var(--font-body);
    font-size: 16px; color: var(--c-text-primary); outline: none;
    text-align: center; letter-spacing: 2px; transition: border-color 0.2s;
    box-sizing: border-box; width: 100%;
}
.qm-s4-otp-input:focus { border-color: var(--brand); }
.qm-s4-otp-btn {
    background: var(--brand); color: #ffffff;
    border: none; border-radius: 14px; padding: 14px;
    font-family: var(--font-head); font-size: 15px; font-weight: 700;
    cursor: pointer; transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.qm-s4-otp-btn:active { opacity: 0.85; }
.qm-s4-logout-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: transparent; border: 1.5px solid var(--c-bdr);
    border-radius: 14px; padding: 13px; font-family: var(--font-body);
    font-size: 14px; font-weight: 500; color: var(--brand); cursor: pointer;
    width: 100%; transition: background 0.2s; -webkit-tap-highlight-color: transparent;
    text-decoration: none; box-sizing: border-box;
}

.qm-s4-b2b-form-overlay {
    animation: qmFadeInOverlay 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes qmFadeInOverlay {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}


/* === _market-windows.css === */
/* ================================================================
   VENTANAS DE MERCADO & STORIES (ORQUESTADOR MODULAR)
   Arquitectura de Primitivas Universales del SO (< 350 líneas)
   ================================================================ */





/* === _market-windows-profile.css === */
/* ================================================================
   VENTANAS DE MERCADO — PERFIL DE NEGOCIO Y PRODUCTOS
   Arquitectura de Primitivas Universales del SO (< 280 líneas)
   ================================================================ */

.qm-os-native-header {
    display: flex;
    align-items: center;
    height: var(--nav-h);
    padding: 0 16px;
    border-bottom: 1px solid var(--nav-border);
    background: var(--nav-bg);
    color: var(--nav-text);
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-top: calc(-1 * var(--safe-t));
    padding-top: var(--safe-t);
    box-sizing: border-box;
}

.qm-os-btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--nav-text);
    font-size: 15px;
    font-family: var(--font-body);
    font-weight: 500;
    padding: 10px 8px 10px 0;
    cursor: pointer;
    transition: color 0.2s;
}
.qm-os-btn-back:active { color: var(--nav-active); }

.qm-os-title {
    flex: 1;
    text-align: center;
    color: var(--nav-active);
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 32px;
}

.qm-mkt-loading { display: flex; justify-content: center; padding: 40px; }

.qm-mkt-profile { font-family: var(--font-body); color: var(--c-text-primary); padding: 8px 12px 24px; }

/* Cabecera estilo perfil social */
.qm-mkt-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.qm-mkt-avatar {
    width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2.5px solid var(--brand); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 25%, transparent);
}
.qm-mkt-avatar-ph {
    display: flex; align-items: center; justify-content: center;
    background: var(--c-card); color: var(--c-sub);
}
.qm-mkt-head-info { min-width: 0; flex: 1; }
.qm-mkt-name { font-family: var(--font-head); font-size: 19px; font-weight: 800; color: var(--c-text-primary); margin-bottom: 2px; }
.qm-mkt-cat { font-size: 13px; color: var(--c-sub); margin-top: 3px; font-weight: 500; }
.qm-mkt-stats { display: flex; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--c-sub); align-items: center; flex-wrap: wrap; }
.qm-mkt-stats b { color: var(--c-text-primary); font-size: 12.5px; }

.qm-mkt-badge-open {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
    border-radius: 9999px; font-size: 11px; font-weight: 700;
    background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand);
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.qm-mkt-badge-closed {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
    border-radius: 9999px; font-size: 11px; font-weight: 700;
    background: var(--c-surface); color: var(--c-sub); border: 1px solid var(--c-bdr);
}

.qm-mkt-desc {
    font-size: 13.5px; color: var(--c-text-primary); line-height: 1.5;
    margin-bottom: 16px; padding: 12px 16px; border-radius: 16px;
    background: var(--c-card); border: 1px solid var(--c-bdr);
}

/* Calificación por estrellas */
.qm-mkt-rating-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-radius: 16px; margin-bottom: 16px;
    background: var(--c-card); border: 1px solid var(--c-bdr);
}
.qm-mkt-rating-label { font-size: 13px; font-weight: 700; color: var(--c-text-primary); }
.qm-mkt-star-picker { display: flex; gap: 6px; align-items: center; }
.qm-star-btn {
    cursor: pointer; color: var(--c-sub); opacity: 0.45;
    transition: transform 0.15s ease, opacity 0.15s ease, color 0.15s ease;
    display: inline-flex; align-items: center; justify-content: center;
}
.qm-star-btn:hover, .qm-star-btn.active {
    opacity: 1; color: var(--brand); transform: scale(1.15);
}

/* Acciones y Botones del Perfil */
.qm-mkt-actions { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.qm-mkt-actions .qm-btn { flex: 1 1 calc(50% - 8px); min-width: 110px; }
.qm-mkt-owner-notice { margin-bottom: 12px; }
.qm-mkt-owner-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border-radius: 9999px; font-size: 12px; font-weight: 700;
    color: var(--brand); background: var(--c-card); border: 1px solid var(--c-bdr);
}

/* Fila de stories del negocio */
.qm-mkt-stories { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.qm-mkt-stories::-webkit-scrollbar { display: none; }
.qm-mkt-story-circle {
    width: 58px; height: 58px; border-radius: 50%; padding: 2px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--c-surface)));
    border: none; cursor: pointer;
}
.qm-mkt-story-circle img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--c-bg); display: block;
}

/* Selector de Categorías de Productos */
.qm-mkt-category-nav {
    display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin-bottom: 16px;
    scrollbar-width: none; background: var(--c-surface); border-radius: 9999px; border: 1px solid var(--c-bdr);
}
.qm-mkt-category-nav::-webkit-scrollbar { display: none; }
.qm-mkt-cat-chip {
    background: transparent; border: none; padding: 6px 14px; border-radius: 9999px;
    font-size: 12px; font-weight: 600; color: var(--c-sub); cursor: pointer;
    white-space: nowrap; transition: all 0.2s ease;
}
.qm-mkt-cat-chip:hover, .qm-mkt-cat-chip.active {
    background: var(--c-card); color: var(--c-text-primary); box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Catálogo de Productos del Negocio */
.qm-mkt-section-title { font-size: 15px; font-weight: 800; color: var(--c-text-primary); margin: 16px 0 10px; }
.qm-mkt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qm-mkt-prod {
    display: flex; flex-direction: column; background: var(--c-card);
    border: 1px solid var(--c-bdr); border-radius: 16px; overflow: hidden;
    padding: 0; text-align: left; cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.qm-mkt-prod:active { transform: scale(0.97); }
.qm-mkt-prod-img-wrap {
    width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
    background: var(--c-surface); display: flex; align-items: center; justify-content: center;
}
.qm-mkt-prod-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qm-mkt-prod-ph { color: var(--c-sub); display: flex; align-items: center; justify-content: center; }
.qm-mkt-prod-info { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.qm-mkt-prod-name { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--c-text-primary); line-height: 1.25; }
.qm-mkt-prod-price { font-family: var(--font-body); font-size: 13px; font-weight: 800; color: var(--brand); margin-top: auto; }
.qm-mkt-empty { text-align: center; padding: 28px 16px; color: var(--c-sub); border-radius: 16px; margin-top: 10px; }


/* === _market-windows-story.css === */
/* ================================================================
   VENTANAS DE MERCADO — VISOR FULLSCREEN DE STORIES Y STICKERS
   Arquitectura de Primitivas Universales del SO (< 280 líneas)
   ================================================================ */

#qm-os-window-manager.qm-os-story-mode #qm-os-window-body.qm-os-window-body {
    padding: 0; margin: 0; height: 100vh; max-width: 100%;
}
#qm-os-window-manager.qm-os-story-mode .qm-os-native-header,
#qm-pwa-secondary-nav.qm-story-hidden {
    display: none;
}

.qm-mkt-story-full-container {
    position: relative; width: 100%; height: 100vh; min-height: 100vh;
    background: var(--c-bg); overflow: hidden; display: flex;
    flex-direction: column; justify-content: space-between; font-family: var(--font-body);
}

.qm-mkt-story-top-progress {
    position: absolute; top: 8px; left: 12px; right: 12px; z-index: 25;
}
.qm-mkt-story-progress-bar {
    height: 3px; background: var(--brand); border-radius: 10px; width: 0%;
    box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 60%, transparent);
    animation: qmStoryProgress 4s linear forwards;
}

@keyframes qmStoryProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.qm-mkt-story-top-nav {
    position: absolute; top: 20px; left: 12px; right: 12px; z-index: 25;
    display: flex; justify-content: space-between; align-items: center;
}
.qm-mkt-story-biz-info {
    display: flex; align-items: center; gap: 10px;
    background: color-mix(in srgb, var(--c-surface) 75%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--c-bdr); border-radius: 100px; padding: 6px 14px;
    color: var(--c-text-primary); cursor: pointer; text-align: left;
}
.qm-mkt-story-biz-info img, .qm-mkt-story-biz-info .qm-mkt-avatar-ph {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
}
.qm-mkt-story-biz-text b {
    font-size: 13px; display: block; color: var(--c-text-primary); line-height: 1.2;
}
.qm-mkt-story-biz-text span {
    font-size: 11px; color: var(--c-sub); display: flex; align-items: center; gap: 4px;
}
.qm-mkt-story-close-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: color-mix(in srgb, var(--c-surface) 75%, transparent);
    backdrop-filter: blur(12px); border: 1px solid var(--c-bdr);
    color: var(--c-text-primary); font-size: 22px; display: flex;
    align-items: center; justify-content: center; cursor: pointer;
}

.qm-mkt-story-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--c-bg);
}

.qm-mkt-story-backdrop,
.qm-mkt-story-backdrop-img {
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    background-size: cover;
    background-position: center;
    object-fit: cover;
    filter: blur(28px) brightness(0.65) saturate(140%);
    -webkit-filter: blur(28px) brightness(0.65) saturate(140%);
    transform: scale(1.1);
    z-index: 1;
    pointer-events: none;
}

.qm-mkt-story-hero-img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: auto;
}

.qm-mkt-story-media-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-surface);
    color: var(--c-sub);
    position: relative;
    z-index: 2;
}

.qm-mkt-story-overlay-gradient {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c-bg) 65%, transparent) 0%, transparent 25%, transparent 65%, var(--c-bg) 100%);
}

.qm-mkt-story-glass-card {
    position: absolute; bottom: 20px; left: 16px; right: 16px; z-index: 20;
    padding: 20px; border-radius: 24px;
    background: color-mix(in srgb, var(--c-card) 85%, transparent);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--c-bdr); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    color: var(--c-text-primary);
}
.qm-mkt-story-price-pill {
    display: inline-block; padding: 4px 14px; background: var(--brand);
    color: #ffffff; font-weight: 800; font-size: 16px; border-radius: 100px;
    margin-bottom: 8px; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent);
}
.qm-mkt-story-title {
    font-size: 22px; font-weight: 800; color: var(--c-text-primary);
    margin: 0 0 6px 0; line-height: 1.25;
}
.qm-mkt-story-desc {
    font-size: 14px; line-height: 1.45; color: var(--c-sub); margin-bottom: 16px;
}
.qm-mkt-story-action { width: 100%; }

/* Sticker Flotante Inclinado de Producto */
.qm-mkt-story-sticker-wrap {
    position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%);
    z-index: 15; pointer-events: auto; display: flex; align-items: center;
    justify-content: center; width: 80%; max-width: 260px;
}

.qm-mkt-story-sticker-link { display: block; text-decoration: none; cursor: pointer; }

.qm-mkt-story-sticker-card {
    position: relative; transform: rotate(-4.5deg); padding: 8px;
    background: var(--c-card); border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--c-bdr);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qm-mkt-story-sticker-img {
    width: 100%; max-height: 180px; object-fit: cover; border-radius: 14px; display: block;
}

.qm-mkt-story-sticker-body {
    padding: 8px 6px 4px; text-align: left; color: var(--c-text-primary);
}

.qm-mkt-story-sticker-title {
    font-size: 15px; font-weight: 800; margin: 0 0 2px 0;
    color: var(--c-text-primary); line-height: 1.2;
}

.qm-mkt-story-sticker-price {
    font-size: 14px; font-weight: 800; color: var(--brand); display: inline-block;
}

.qm-mkt-story-sticker-label {
    position: absolute; bottom: -10px; right: 12px; background: var(--brand);
    color: #ffffff; font-size: 11px; font-weight: 800; padding: 3px 10px;
    border-radius: 100px; text-transform: uppercase; letter-spacing: 0.5px;
    border: 2px solid var(--c-card); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent);
    display: inline-flex; align-items: center; gap: 4px;
}

.qm-mkt-story-user-dist {
    position: absolute; bottom: 110px; right: 16px;
    background: color-mix(in srgb, var(--c-surface) 75%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: var(--c-sub); font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 100px; display: inline-flex;
    align-items: center; gap: 4px; pointer-events: none; border: 1px solid var(--c-bdr);
}

/* Visor Flotante de Historias */
.qm-mkt-story-viewer {
    position: fixed; inset: 0; z-index: 999;
    background: var(--c-bg); display: flex; align-items: center;
    justify-content: center; overflow: hidden;
}
.qm-mkt-story-viewer img {
    position: relative; z-index: 2; max-width: 100%;
    max-height: 80vh; object-fit: contain;
}
.qm-mkt-story-caption {
    position: absolute; bottom: 24px; left: 20px; right: 20px; z-index: 10;
    padding: 14px 18px; background: color-mix(in srgb, var(--c-card) 85%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: 16px; border: 1px solid var(--c-bdr);
    color: var(--c-text-primary); font-size: 14px; text-align: center;
}
.qm-mkt-story-close {
    position: absolute; top: calc(env(safe-area-inset-top, 0px) + 16px); right: 16px;
    z-index: 15; width: 38px; height: 38px; border-radius: 50%;
    background: color-mix(in srgb, var(--c-surface) 75%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--c-bdr); color: var(--c-text-primary);
    font-size: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}


/* === _utilities.css === */
.qm-highlight {
    background: rgba(var(--brand-rgb), 0.3);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}

/* Lazy loaded images with smooth fade-in */
.qm-lazy-img {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}
.qm-lazy-img.loaded {
    opacity: 1;
}

/* OVERRIDES DEFINITIVOS PARA DESKTOP */
@media (min-width: 769px) {
    #qm-pwa-slots-container {
        flex-direction: column;
        width: calc(100vw - 260px);
        height: calc(5 * 100vh);
    }
    .qm-pwa-overlay-screen {
        width: calc(100vw - 260px);
        height: 100vh;
    }
    #qm-slot-2 {
        display: flex;
        width: calc(100vw - 260px);
        height: 100vh;
    }
}


/* === _gradient-glow.css === */
/* ================================================================
   SISTEMA AUTOMÁTICO DE GRADIENTES ARMÓNICOS Y GLOW (.qm-gradient-active)
   Arquitectura de Primitivas Universales a Nivel de Sistema Operativo
   CERO selectores comodín (no [class*="..."]), CERO colores hardcodeados.
   100% derivado de los tokens del tema y las 4 primitivas del SO.
   ================================================================ */

/* ── 1. COMPONENTE REUTILIZABLE: SWITCH (.qm-switch) ── */
.qm-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.qm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.qm-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--c-surface);
    border: 1.5px solid var(--c-bdr);
    transition: background 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
    border-radius: 26px;
    box-sizing: border-box;
}
.qm-switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    top: 50%;
    transform: translateY(-50%);
    left: 2.5px;
    background-color: #ffffff;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s, box-shadow 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Switch Activo: Tríada armónica automática */
.qm-switch input:checked + .qm-switch-slider {
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 50%, var(--c-surface)) 0%, var(--brand) 100%);
    border-color: var(--brand);
    box-shadow: 0 0 16px color-mix(in srgb, var(--brand) 70%, transparent), 0 0 28px color-mix(in srgb, var(--brand) 35%, transparent);
}
.qm-switch input:checked + .qm-switch-slider::before {
    transform: translateY(-50%) translateX(22px);
    background-color: #ffffff;
    box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 80%, transparent), 0 2px 5px rgba(0, 0, 0, 0.25);
}

/* Fila de configuración de apariencia en Slot 4 */
.qm-s4-gradient-row {
    padding: 12px 16px;
    border-top: 1px solid var(--c-bdr);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.qm-s4-gradient-title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-primary);
    margin: 0 0 2px;
}
.qm-s4-gradient-desc {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--c-sub);
    margin: 0;
}

/* ================================================================
   2. APLICACIÓN MODULAR SOBRE LAS 4 PRIMITIVAS DEL SO
   ================================================================ */

/* ── PRIMITIVA 1: BOTONES PRIMARIOS Y ACCIONES (QM-BUTTON) ── */
.qm-gradient-active .qm-btn-primary,
.qm-gradient-active .qm-btn-primary-sm,
.qm-gradient-active .qm-ob-continue-btn,
.qm-gradient-active .qm-s4-otp-btn,
.qm-gradient-active #qm-chat-send-btn,
.qm-gradient-active #qm-s2-send-btn,
.qm-gradient-active #qm-s3-track-btn,
.qm-gradient-active .qm-auth-primary-btn,
.qm-gradient-active .qm-s2-auth-card button,
.qm-gradient-active #qm-s2-guest-link-box button {
    background: var(--theme-grad-action);
    color: #ffffff;
    border: 1.5px solid color-mix(in srgb, var(--brand) 85%, #ffffff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.qm-gradient-active #qm-s2-send-btn svg,
.qm-gradient-active #qm-s2-send-btn .qm-icon,
.qm-gradient-active #qm-s2-send-btn .qm-svg-icon {
    stroke: #ffffff;
    fill: none;
}

/* ── PRIMITIVA 2: PÍLDORAS ACTIVAS Y CONTROLES SEGMENTADOS (QM-SEGMENTED) ── */
.qm-gradient-active .qm-ob-pill-btn.active,
.qm-gradient-active .qm-s0-active-badge-pill,
.qm-gradient-active .qm-s0-cat-btn.active,
.qm-gradient-active .qm-plaza-filter-btn.active,
.qm-gradient-active .qm-s1-mode-btn.active,
.qm-gradient-active .qm-s1-cat-btn.active,
.qm-gradient-active .qm-s4-theme-pill.active {
    background: var(--theme-grad-triad);
    color: #ffffff;
    border: 1.5px solid var(--brand);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent);
}

/* ── PRIMITIVA 3: SUPERFICIES Y TARJETAS (QM-SURFACE) ── */
/* FONDOS SIEMPRE SÓLIDOS: Cero degradados sobre el contenido */
.qm-gradient-active .qm-card,
.qm-gradient-active .qm-s0-cat-item,
.qm-gradient-active .qm-plaza-card,
.qm-gradient-active .qm-s1-place-card,
.qm-gradient-active .qm-s3-info-panel,
.qm-gradient-active .qm-s4-card,
.qm-gradient-active .qm-window-sheet,
.qm-gradient-active .qm-window-dialog,
.qm-gradient-active .qm-os-window,
.qm-gradient-active .qm-os-inline-window,
.qm-gradient-active .qm-fb-publisher-bar {
    background-color: var(--c-card);
    border: 1.5px solid color-mix(in srgb, var(--brand) 40%, var(--c-bdr));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* ── PRIMITIVA 4: CAMPOS DE ENTRADA EN FOCO (QM-FIELD) ── */
.qm-gradient-active input:focus,
.qm-gradient-active select:focus,
.qm-gradient-active textarea:focus,
.qm-gradient-active .qm-s0-search-input:focus,
.qm-gradient-active .qm-s1-search-input:focus,
.qm-gradient-active .qm-s2-textarea:focus,
.qm-gradient-active .qm-s3-input:focus {
    border: 1.5px solid var(--brand);
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--brand) 35%, transparent);
}

/* ── ELEMENTOS CIRCULARES: AROS DE HISTORIAS Y BOTONES FLOTANTES (FAB) ── */
.qm-gradient-active .qm-s0-story-ring,
.qm-gradient-active .qm-story-tu-ring {
    border: 2px solid var(--brand);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent);
}

/* ── SLOT 1: MAPA TERRITORIAL, CALLES LUMINOSAS Y PINES CON GLOW VIBRANTE ── */
.qm-gradient-active #qm-pwa-shell .leaflet-tile-pane,
#qm-pwa-shell.qm-gradient-active .leaflet-tile-pane,
.qm-gradient-active .qm-s1-map-canvas .leaflet-tile-pane {
    filter: url(#qm-s1-glow-filter)
            drop-shadow(0 0 3px color-mix(in srgb, var(--brand) 65%, transparent))
            drop-shadow(0 0 10px color-mix(in srgb, var(--brand) 35%, transparent));
}
.qm-gradient-active:not([data-theme="dark"]) #qm-pwa-shell .leaflet-tile-pane,
[data-theme="light"].qm-gradient-active #qm-pwa-shell .leaflet-tile-pane,
[data-theme="light"] #qm-pwa-shell.qm-gradient-active .leaflet-tile-pane {
    filter: url(#qm-s1-glow-light-filter)
            drop-shadow(0 0 2px color-mix(in srgb, var(--brand) 55%, transparent))
            drop-shadow(0 0 8px color-mix(in srgb, var(--brand) 25%, transparent));
}
.qm-gradient-active #qm-pwa-shell .leaflet-overlay-pane canvas,
.qm-gradient-active #qm-pwa-shell .leaflet-overlay-pane svg {
    filter: drop-shadow(0 0 3px color-mix(in srgb, var(--brand) 80%, transparent))
            drop-shadow(0 0 8px color-mix(in srgb, var(--brand) 40%, transparent));
}
.qm-gradient-active .qm-map-pin-anchor,
.qm-gradient-active .qm-map-pin-wrap {
    filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--brand) 50%, transparent));
}
.qm-gradient-active .qm-map-pin-anchor:hover,
.qm-gradient-active .qm-map-pin-anchor.active,
.qm-gradient-active .qm-map-pin-wrap:hover,
.qm-gradient-active .qm-map-pin-wrap.active {
    filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--brand) 70%, transparent));
}
.qm-gradient-active #qm-pwa-shell .leaflet-control-zoom {
    border-color: color-mix(in srgb, var(--brand) 60%, var(--c-bdr));
    box-shadow: 0 0 18px color-mix(in srgb, var(--brand) 28%, transparent), 0 6px 20px rgba(0, 0, 0, 0.3);
}
.qm-gradient-active #qm-pwa-shell .leaflet-control-zoom a:hover,
.qm-gradient-active #qm-pwa-shell .leaflet-control-zoom a:active {
    background: var(--theme-grad-action);
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 70%, transparent);
}
.qm-gradient-active .qm-s1-search-glass-inner {
    border: 1.5px solid color-mix(in srgb, var(--brand) 45%, var(--c-bdr));
    box-shadow: 0 6px 24px color-mix(in srgb, var(--brand) 22%, transparent);
}
.qm-gradient-active .qm-s1-filter-btn,
.qm-gradient-active .qm-s1-gps-btn,
.qm-gradient-active .qm-s1-sheet-toggle-btn {
    border: 1.5px solid color-mix(in srgb, var(--brand) 40%, var(--c-bdr));
}
.qm-gradient-active .qm-s1-filter-btn:active,
.qm-gradient-active .qm-s1-gps-btn:active {
    background: var(--theme-grad-action);
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 50%, transparent);
}
.qm-gradient-active .qm-s1-sheet {
    border-top: 1.5px solid color-mix(in srgb, var(--brand) 50%, var(--c-bdr));
    box-shadow: 0 -8px 32px color-mix(in srgb, var(--brand) 18%, rgba(0, 0, 0, 0.25));
}
.qm-gradient-active .qm-s1-sheet-handle-bar {
    background: color-mix(in srgb, var(--brand) 65%, var(--c-bdr));
    box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 45%, transparent);
}
.qm-gradient-active .qm-s1-btn-open {
    background: var(--theme-grad-action);
    color: #ffffff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent);
}

.qm-gradient-active #qm-pwa-bottom-nav .qm-nav-item.active:not([data-tab="2"]) {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, transparent) 0%, color-mix(in srgb, var(--brand) 30%, transparent) 100%);
    border: 1px solid var(--brand);
    border-radius: 12px;
    margin: 4px;
    box-shadow: none;
    color: var(--brand);
}

.qm-gradient-active .qm-ios-floating-nav .qm-nav-item.active:not([data-tab="2"]) {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, transparent) 0%, color-mix(in srgb, var(--brand) 30%, transparent) 100%);
    border: 1px solid var(--brand);
    border-radius: 9999px;
    margin: 2px 2px;
    box-shadow: none;
    color: var(--brand);
}

#qm-pwa-shell .qm-gradient-active .qm-nav-item[data-tab="2"],
.qm-gradient-active #qm-pwa-shell .qm-nav-item[data-tab="2"],
.qm-gradient-active .qm-nav-item[data-tab="2"],
.qm-gradient-active .qm-nav-item[data-tab="2"].active,
.qm-gradient-active .qm-s0-fab-plaza,
.qm-gradient-active .qm-fab-chat-btn {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    border: 2px solid var(--nav-bg);
    box-shadow: 0 0 0 2px var(--brand), 0 4px 14px rgba(0, 0, 0, 0.2);
}

.qm-gradient-active .qm-s2-input-area {
    border-radius: 0;
    border: none;
    border-top: 1px solid color-mix(in srgb, var(--brand) 30%, var(--c-bdr));
    box-shadow: none;
    background: var(--nav-bg);
}

/* ── MENSAJES EN CHATBOT ── */
.qm-gradient-active .qm-s2-bubble.qm-s2-user,
.qm-gradient-active .qm-msg-user {
    background: var(--theme-grad-action);
    border: 1.5px solid color-mix(in srgb, var(--brand) 70%, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #ffffff;
}

