/* ==========================================================================
   PALETA DE DISEÑO EDITORIAL: OFF WHITE, IVORY, NUDE & OBSIDIAN
   ========================================================================== */

:root {
    /* Paleta Oficial */
    --color-off-white: #FDFCF8;
    --color-ivory: #F3F0E9;
    --color-nude: #E3DBCC;
    --color-obsidian: #101010;

    /* Superficies y Fondos */
    --bg-main: #101010;
    --bg-surface: #151515;
    --bg-surface-elevated: #1e1e1e;
    --bg-surface-hover: #262626;
    --bg-input: #181818;
    
    /* Acentos */
    --accent-primary: #E3DBCC;
    --accent-primary-hover: #F3F0E9;
    --accent-primary-glow: rgba(227, 219, 204, 0.22);
    
    --accent-ivory: #F3F0E9;
    --accent-off-white: #FDFCF8;
    --accent-danger: #e06c75;
    --accent-warning: #e5c07b;
    
    /* Tipografía y Textos */
    --text-primary: #FDFCF8;
    --text-secondary: #E3DBCC;
    --text-muted: #8e897f;
    --text-dark: #101010;
    
    /* Bordes y Líneas */
    --border-subtle: rgba(227, 219, 204, 0.12);
    --border-focus: #E3DBCC;
    --border-strong: rgba(227, 219, 204, 0.25);
    
    /* Burbujas de Chat */
    --bubble-outgoing: #E3DBCC;
    --bubble-outgoing-text: #101010;
    --bubble-incoming: #1b1b1b;
    --bubble-incoming-text: #FDFCF8;
    
    /* Radios */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    /* Fuentes */
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Sombras */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 24px rgba(227, 219, 204, 0.15);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Tipografía */
h1, h2, h3, h4, .font-serif {
    font-family: var(--font-serif);
    letter-spacing: -0.01em;
}

.brand-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 600;
}

.font-mono {
    font-family: var(--font-mono);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(227, 219, 204, 0.18);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(227, 219, 204, 0.35);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.925rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    user-select: none;
}

.btn-primary {
    background: var(--color-nude);
    color: var(--color-obsidian);
    box-shadow: 0 4px 14px rgba(227, 219, 204, 0.2);
}
.btn-primary:hover {
    background: var(--color-ivory);
    color: var(--color-obsidian);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(243, 240, 233, 0.3);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--color-off-white);
    border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
    color: var(--color-nude);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-icon:hover {
    background: var(--bg-surface-hover);
    color: var(--color-off-white);
}

/* Form inputs */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--color-nude);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--color-off-white);
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}
.form-control:focus {
    border-color: var(--color-nude);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    background-color: #202020;
}
.form-control::placeholder {
    color: var(--text-muted);
}
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E3DBCC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}
select.form-control option {
    background-color: #1a1a1a;
    color: var(--color-off-white);
    padding: 8px;
}

/* Badges & Pills */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    line-height: 1.2;
}

.badge-unread {
    background: var(--color-nude);
    color: var(--color-obsidian);
    box-shadow: 0 0 10px rgba(227, 219, 204, 0.35);
}

.badge-online {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-nude);
    box-shadow: 0 0 8px rgba(227, 219, 204, 0.6);
    border: 2px solid var(--bg-surface);
}

.badge-offline {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
    border: 2px solid var(--bg-surface);
}

/* ==========================================================================
   LAYOUT PRINCIPAL DEL CHAT
   ========================================================================== */

.chat-app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--bg-main);
    position: relative;
}

/* Sidebar */
.chat-sidebar {
    width: 380px;
    min-width: 320px;
    max-width: 450px;
    height: 100%;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    position: relative;
    z-index: 100;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
    flex: 1;
    min-width: 0;
}
.user-profile-badge:hover {
    background: var(--bg-surface-hover);
}

.avatar-wrapper {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    overflow: visible;
    flex-shrink: 0;
}
.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-surface-elevated);
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.user-meta-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.user-meta-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-off-white);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-meta-handle {
    font-size: 0.8rem;
    color: var(--color-nude);
    font-family: var(--font-mono);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
}

.desktop-header-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.mobile-header-actions {
    display: none;
}

.mobile-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface-elevated, #1c1c1f);
    border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.15));
    border-radius: var(--radius-lg);
    padding: 8px;
    min-width: 240px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--border-strong);
    z-index: 9999;
    animation: fadeIn 0.15s ease-out;
    backdrop-filter: blur(20px);
}

.mobile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    text-decoration: none;
}

.mobile-dropdown-item:hover, .mobile-dropdown-item:active {
    background: var(--bg-surface-hover);
    color: var(--color-off-white);
}

.mobile-dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 6px 0;
}

.mobile-fab {
    display: none;
}

.bottom-sheet-grabber {
    display: none;
}

/* Search bar sidebar */
.sidebar-search-box {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-input {
    padding-left: 40px;
    font-size: 0.875rem;
    border-radius: var(--radius-full);
}

/* Conversation list */
.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.conversation-item:hover {
    background: var(--bg-surface-hover);
}
.conversation-item.active {
    background: var(--bg-surface-elevated);
    border-color: rgba(227, 219, 204, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}
.conversation-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.conversation-title {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--color-off-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.conversation-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.conversation-preview {
    font-size: 0.825rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-item.active .conversation-preview {
    color: var(--color-ivory);
}

/* ==========================================================================
   VENTANA PRINCIPAL DE CHAT
   ========================================================================== */

.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-main);
    position: relative;
}

/* Chat Header */
.chat-main-header {
    height: 70px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    z-index: 5;
}

.chat-target-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.chat-target-name {
    font-size: 1.15rem;
    font-weight: 600;
    font-family: var(--font-serif);
    letter-spacing: 0.02em;
    color: var(--color-off-white);
}
.chat-target-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-target-status.online {
    color: var(--color-nude);
}

/* Messages stream */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: var(--bg-main);
}

/* Message bubbles */
.message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 75%;
}

.message-row.outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-row.incoming {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
    box-shadow: var(--shadow-sm);
}

.message-row.outgoing .message-bubble {
    background: var(--bubble-outgoing);
    color: var(--bubble-outgoing-text);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(227, 219, 204, 0.15);
}

.message-row.incoming .message-bubble {
    background: var(--bubble-incoming);
    color: var(--bubble-incoming-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.message-sender-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-nude);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.725rem;
}

.message-row.outgoing .message-meta {
    color: var(--bubble-outgoing-text);
    opacity: 0.8;
}

.message-row.incoming .message-meta {
    color: var(--text-muted);
}

.read-check-icon {
    font-size: 0.85rem;
    display: inline-flex;
    color: currentColor;
    font-weight: bold;
}

/* Media attachments */
.message-image-preview {
    max-width: 320px;
    max-height: 300px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 6px;
    display: block;
    object-fit: cover;
    transition: transform 0.2s ease;
    border: 1px solid var(--border-subtle);
}
.message-image-preview:hover {
    transform: scale(1.02);
}

.message-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    min-width: 240px;
}

.message-document-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}
.message-document-badge:hover {
    background: rgba(0, 0, 0, 0.22);
}

/* Quote / Reply Preview */
.message-quote-box {
    border-left: 3px solid var(--color-nude);
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.825rem;
}
.quote-sender {
    font-weight: 700;
    color: var(--color-nude);
}
.quote-text {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Typing indicator */
.typing-indicator-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    align-self: flex-start;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--color-nude);
    border-radius: var(--radius-full);
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Chat Input Bar */
.chat-input-wrapper {
    padding: 16px 24px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.chat-input-field-container {
    flex: 1;
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}
.chat-input-field-container:focus-within {
    border-color: var(--color-nude);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.reply-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(227, 219, 204, 0.06);
    font-size: 0.825rem;
}

.attachment-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(227, 219, 204, 0.05);
}

.chat-textarea {
    width: 100%;
    max-height: 140px;
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--color-off-white);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    line-height: 1.45;
}

.audio-recorder-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: rgba(227, 219, 204, 0.08);
    border: 1px solid rgba(227, 219, 204, 0.25);
    border-radius: var(--radius-lg);
}
.recording-pulse {
    width: 12px;
    height: 12px;
    background: var(--color-nude);
    border-radius: var(--radius-full);
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

/* ==========================================================================
   MODALES Y DIÁLOGOS
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 16, 16, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

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

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-backdrop.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-size: 1.35rem;
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 600;
    color: var(--color-off-white);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Placeholder Empty state */
.empty-chat-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}
.empty-icon-shield {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--color-nude);
    box-shadow: var(--shadow-glow);
    border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================================================== */

.mobile-back-btn {
    display: none !important;
}

/* Tablets and small laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    .chat-sidebar {
        width: 320px;
        min-width: 290px;
    }
    
    .message-row {
        max-width: 82%;
    }
}

/* Mobile Devices (Smartphones & Small Tablets - max-width: 768px) */
@media (max-width: 768px) {
    html, body {
        height: 100%;
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior-y: none;
        -webkit-tap-highlight-color: transparent;
    }

    .chat-app-container {
        height: 100vh;
        height: 100dvh;
        width: 100vw;
        position: relative;
        overflow: hidden;
    }

    /* Sidebar full screen on mobile */
    .chat-sidebar {
        position: absolute;
        inset: 0;
        width: 100vw;
        min-width: 100vw;
        max-width: 100vw;
        height: 100%;
        height: 100dvh;
        z-index: 20;
        border-right: none;
        transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.2s ease;
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* When a chat is selected, sidebar slides off to the left */
    .chat-app-container.chat-selected .chat-sidebar {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }

    /* Chat main area full screen on mobile */
    .chat-main-area {
        position: absolute;
        inset: 0;
        width: 100vw;
        height: 100%;
        height: 100dvh;
        z-index: 10;
        transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.2s ease;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
    }

    /* When a chat is selected, main area slides in */
    .chat-app-container.chat-selected .chat-main-area {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        z-index: 30;
    }

    /* Sidebar Header on Mobile */
    .sidebar-header {
        padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
        gap: 8px;
    }

    .desktop-header-actions {
        display: none !important;
    }

    .mobile-header-actions {
        display: flex !important;
        align-items: center;
        gap: 4px;
        position: relative;
    }

    .user-profile-badge {
        padding: 4px 6px;
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .avatar-wrapper {
        width: 38px;
        height: 38px;
    }

    .user-meta-name {
        font-size: 0.88rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-meta-handle {
        font-size: 0.72rem;
    }

    .sidebar-header .btn-icon {
        width: 36px;
        height: 36px;
    }

    /* Mobile Floating Action Button (FAB) */
    .mobile-fab {
        display: flex !important;
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 20px;
        width: 54px;
        height: 54px;
        border-radius: 50%;
        background: var(--color-nude);
        color: var(--color-obsidian);
        border: none;
        box-shadow: 0 8px 24px rgba(227, 219, 204, 0.4), 0 4px 12px rgba(0, 0, 0, 0.5);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 50;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-fab:active {
        transform: scale(0.92);
    }

    .chat-app-container.chat-selected .mobile-fab {
        display: none !important;
    }

    /* Search bar in sidebar */
    .sidebar-search-box {
        padding: 8px 12px;
    }

    .search-input {
        height: 38px;
        font-size: 0.85rem;
        padding-left: 36px;
    }

    .search-icon {
        left: 12px;
        width: 15px;
        height: 15px;
    }

    /* Conversation Items */
    .conversation-list {
        padding: 6px 8px calc(80px + env(safe-area-inset-bottom, 0px));
        gap: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .conversation-item {
        padding: 10px 12px;
        gap: 12px;
        border-radius: var(--radius-md);
    }

    .conversation-item .avatar-wrapper {
        width: 44px;
        height: 44px;
    }

    .conversation-title {
        font-size: 0.9rem;
    }

    .conversation-preview {
        font-size: 0.8rem;
    }

    .conversation-time {
        font-size: 0.7rem;
    }

    /* Chat Active Header */
    .chat-main-header {
        height: calc(58px + env(safe-area-inset-top, 0px));
        padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px;
    }

    .mobile-back-btn {
        display: inline-flex !important;
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: var(--radius-full);
        margin-right: 2px;
        color: var(--color-nude);
        flex-shrink: 0;
    }

    .chat-target-info {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .chat-target-info .avatar-wrapper {
        width: 38px;
        height: 38px;
    }

    .chat-target-name {
        font-size: 0.92rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .chat-target-status {
        font-size: 0.7rem;
    }

    /* Chat Messages Stream */
    .chat-messages-container {
        padding: 10px 10px 6px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .message-row {
        max-width: 90%;
        gap: 6px;
    }

    .message-bubble {
        padding: 9px 12px;
        font-size: 0.92rem;
        line-height: 1.4;
        border-radius: 14px;
    }

    .message-image-preview {
        max-width: 100%;
        max-height: 220px;
        border-radius: 10px;
    }

    .message-audio-player {
        min-width: 170px;
        max-width: 100%;
        padding: 6px 8px;
        gap: 6px;
    }

    .message-document-badge {
        padding: 8px 10px;
        max-width: 100%;
    }

    .message-quote-box {
        padding: 4px 8px;
        font-size: 0.78rem;
        margin-bottom: 6px;
    }

    /* Reactions popover on Mobile */
    .reactions-popover {
        top: -48px;
        max-width: calc(100vw - 32px);
        gap: 2px;
        padding: 3px 6px;
    }

    .reaction-choice-btn {
        font-size: 1.15rem;
        padding: 4px 3px;
        touch-action: manipulation;
    }

    /* Chat Input Bar on Mobile */
    .chat-input-wrapper {
        padding: 6px 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        gap: 4px;
        background: var(--bg-surface);
    }

    .chat-input-field-container {
        border-radius: 18px;
    }

    .chat-textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
        min-height: 36px;
        max-height: 90px;
        padding: 7px 10px;
        line-height: 1.35;
    }

    .chat-input-wrapper .btn-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .chat-input-wrapper .btn-primary {
        height: 36px;
        min-width: 36px;
        padding: 0 10px;
        border-radius: 18px;
    }

    .audio-recorder-panel {
        padding: 6px 8px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .reply-preview-bar, .attachment-preview-bar {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    /* Modals as Native Bottom Sheets on Mobile */
    .bottom-sheet-grabber {
        display: block !important;
        width: 38px;
        height: 4px;
        background: rgba(227, 219, 204, 0.28);
        border-radius: 4px;
        margin: 10px auto 2px;
        flex-shrink: 0;
    }

    .modal-backdrop {
        padding: 0 !important;
        align-items: flex-end !important;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(10px);
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh !important;
        max-height: 88dvh !important;
        border-radius: 24px 24px 0 0 !important;
        display: flex;
        flex-direction: column;
        animation: slideUpMobile 0.25s cubic-bezier(0.33, 1, 0.68, 1) !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
        border-bottom: none !important;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
            opacity: 0.8;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-header {
        padding: 12px 16px 8px;
    }

    .modal-title {
        font-size: 1.15rem;
    }

    .modal-body {
        padding: 14px 16px;
        overflow-y: auto;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }

    .form-control {
        font-size: 16px !important; /* Prevents iOS auto-zoom */
        padding: 10px 14px;
    }

    /* Settings modal tabs on mobile */
    #modal-settings .modal-content > div:nth-child(3) {
        scrollbar-width: none;
    }
    #modal-settings .modal-content > div:nth-child(3)::-webkit-scrollbar {
        display: none;
    }

    /* Empty state */
    .empty-chat-state {
        padding: 24px 16px;
    }

    .empty-chat-state img {
        height: 64px !important;
    }

    .empty-chat-state h2 {
        font-size: 1.4rem !important;
    }
}

/* Extra small mobile screens (max-width: 380px) */
@media (max-width: 380px) {
    .sidebar-header {
        padding: calc(6px + env(safe-area-inset-top, 0px)) 6px 6px;
    }

    .user-profile-badge {
        max-width: 140px;
    }

    .user-meta-info {
        display: none; /* Icon avatar only on extremely narrow screen */
    }

    .sidebar-header .btn-icon {
        width: 32px;
        height: 32px;
    }

    .chat-target-name {
        max-width: 110px;
    }

    .chat-main-header {
        padding: calc(4px + env(safe-area-inset-top, 0px)) 6px 4px;
    }

    .pin-btn {
        width: 56px !important;
        height: 56px !important;
        font-size: 1.25rem !important;
    }
}

/* ==========================================================================
   TEMAS VISUALES ADICIONALES (MATRIX, AMOLED, NAVY)
   ========================================================================== */

/* 1. Tema Cyberpunk Matrix Terminal */
body.theme-matrix {
    --color-off-white: #d1ffd6;
    --color-ivory: #a3ffac;
    --color-nude: #00ff66;
    --color-obsidian: #050d08;
    --bg-main: #060e08;
    --bg-surface: #0b170e;
    --bg-surface-elevated: #112215;
    --bg-surface-hover: #172c1c;
    --bg-input: #08120a;
    --accent-primary: #00ff66;
    --accent-primary-hover: #33ff85;
    --accent-primary-glow: rgba(0, 255, 102, 0.35);
    --border-subtle: rgba(0, 255, 102, 0.2);
    --border-focus: #00ff66;
    --border-strong: rgba(0, 255, 102, 0.4);
    --bubble-outgoing: #00ff66;
    --bubble-outgoing-text: #050d08;
    --bubble-incoming: #0d1e11;
    --bubble-incoming-text: #d1ffd6;
    --text-primary: #d1ffd6;
    --text-secondary: #00ff66;
    --text-muted: #528c5c;
    --font-serif: 'JetBrains Mono', monospace;
}

/* 2. Tema Pure AMOLED Black */
body.theme-amoled {
    --color-off-white: #ffffff;
    --color-ivory: #f0f0f0;
    --color-nude: #d4d4d4;
    --color-obsidian: #000000;
    --bg-main: #000000;
    --bg-surface: #0a0a0a;
    --bg-surface-elevated: #141414;
    --bg-surface-hover: #1f1f1f;
    --bg-input: #0a0a0a;
    --accent-primary: #ffffff;
    --accent-primary-hover: #e5e5e5;
    --accent-primary-glow: rgba(255, 255, 255, 0.25);
    --border-subtle: rgba(255, 255, 255, 0.12);
    --border-focus: #ffffff;
    --border-strong: rgba(255, 255, 255, 0.3);
    --bubble-outgoing: #ffffff;
    --bubble-outgoing-text: #000000;
    --bubble-incoming: #121212;
    --bubble-incoming-text: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #d4d4d4;
    --text-muted: #737373;
}

/* 3. Tema Deep Cobalt Navy */
body.theme-navy {
    --color-off-white: #e0f2fe;
    --color-ivory: #bae6fd;
    --color-nude: #38bdf8;
    --color-obsidian: #030712;
    --bg-main: #030712;
    --bg-surface: #0b1329;
    --bg-surface-elevated: #132247;
    --bg-surface-hover: #1c3166;
    --bg-input: #080f20;
    --accent-primary: #38bdf8;
    --accent-primary-hover: #7dd3fc;
    --accent-primary-glow: rgba(56, 189, 248, 0.3);
    --border-subtle: rgba(56, 189, 248, 0.18);
    --border-focus: #38bdf8;
    --border-strong: rgba(56, 189, 248, 0.35);
    --bubble-outgoing: #38bdf8;
    --bubble-outgoing-text: #030712;
    --bubble-incoming: #0e1a38;
    --bubble-incoming-text: #e0f2fe;
    --text-primary: #f0f9ff;
    --text-secondary: #7dd3fc;
    --text-muted: #64748b;
}

/* 4. Tema Lilac Dream (Lila, Blanco y Amatista) */
body.theme-lilac {
    --color-off-white: #201235;
    --color-ivory: #3f2763;
    --color-nude: #8b5cf6;
    --color-obsidian: #ffffff;
    --bg-main: #f8f4fc;
    --bg-surface: #efe6f8;
    --bg-surface-elevated: #ffffff;
    --bg-surface-hover: #e4d4f4;
    --bg-input: #ffffff;
    --accent-primary: #8b5cf6;
    --accent-primary-hover: #7c3aed;
    --accent-primary-glow: rgba(139, 92, 246, 0.28);
    --border-subtle: rgba(139, 92, 246, 0.2);
    --border-focus: #8b5cf6;
    --border-strong: rgba(139, 92, 246, 0.38);
    --bubble-outgoing: #8b5cf6;
    --bubble-outgoing-text: #ffffff;
    --bubble-incoming: #ffffff;
    --bubble-incoming-text: #201235;
    --text-primary: #201235;
    --text-secondary: #5e3f8a;
    --text-muted: #8b70ab;
    --text-dark: #201235;
    --shadow-sm: 0 2px 8px rgba(94, 63, 138, 0.08);
    --shadow-md: 0 6px 18px rgba(94, 63, 138, 0.12);
    --shadow-lg: 0 16px 36px rgba(94, 63, 138, 0.18);
}

/* 5. Tema Canela & Crema (Blanco, Crema y Marrón Claro Topo Canela) */
body.theme-cinnamon {
    --color-off-white: #2c1d13;
    --color-ivory: #4a3424;
    --color-nude: #b88358;
    --color-obsidian: #ffffff;
    --bg-main: #faf6f0;
    --bg-surface: #f2e8dc;
    --bg-surface-elevated: #ffffff;
    --bg-surface-hover: #e8dbcb;
    --bg-input: #ffffff;
    --accent-primary: #b88358;
    --accent-primary-hover: #a56f43;
    --accent-primary-glow: rgba(184, 131, 88, 0.28);
    --border-subtle: rgba(184, 131, 88, 0.2);
    --border-focus: #b88358;
    --border-strong: rgba(184, 131, 88, 0.38);
    --bubble-outgoing: #b88358;
    --bubble-outgoing-text: #ffffff;
    --bubble-incoming: #ffffff;
    --bubble-incoming-text: #2c1d13;
    --text-primary: #2c1d13;
    --text-secondary: #5c3f2d;
    --text-muted: #8c6e59;
    --text-dark: #2c1d13;
    --shadow-sm: 0 2px 8px rgba(44, 29, 19, 0.08);
    --shadow-md: 0 6px 18px rgba(44, 29, 19, 0.12);
    --shadow-lg: 0 16px 36px rgba(44, 29, 19, 0.18);
}

/* 6. Tema Sage & White (Verde Salvia, Crema y Blanco) */
body.theme-sage {
    --color-off-white: #162a21;
    --color-ivory: #284b3c;
    --color-nude: #40916c;
    --color-obsidian: #ffffff;
    --bg-main: #f4f8f5;
    --bg-surface: #e5efe8;
    --bg-surface-elevated: #ffffff;
    --bg-surface-hover: #d5e5db;
    --bg-input: #ffffff;
    --accent-primary: #40916c;
    --accent-primary-hover: #2d6a4f;
    --accent-primary-glow: rgba(64, 145, 108, 0.28);
    --border-subtle: rgba(64, 145, 108, 0.2);
    --border-focus: #40916c;
    --border-strong: rgba(64, 145, 108, 0.38);
    --bubble-outgoing: #40916c;
    --bubble-outgoing-text: #ffffff;
    --bubble-incoming: #ffffff;
    --bubble-incoming-text: #162a21;
    --text-primary: #162a21;
    --text-secondary: #3b6b55;
    --text-muted: #6e9883;
    --text-dark: #162a21;
    --shadow-sm: 0 2px 8px rgba(22, 42, 33, 0.08);
    --shadow-md: 0 6px 18px rgba(22, 42, 33, 0.12);
    --shadow-lg: 0 16px 36px rgba(22, 42, 33, 0.18);
}

/* 7. Tema Nordic Frost (Blanco Puro, Azul Glaciar & Zafiro) */
body.theme-frost {
    --color-off-white: #0f172a;
    --color-ivory: #1e293b;
    --color-nude: #0284c7;
    --color-obsidian: #ffffff;
    --bg-main: #f8fafc;
    --bg-surface: #e2e8f0;
    --bg-surface-elevated: #ffffff;
    --bg-surface-hover: #cbd5e1;
    --bg-input: #ffffff;
    --accent-primary: #0284c7;
    --accent-primary-hover: #0369a1;
    --accent-primary-glow: rgba(2, 132, 199, 0.28);
    --border-subtle: rgba(2, 132, 199, 0.18);
    --border-focus: #0284c7;
    --border-strong: rgba(2, 132, 199, 0.38);
    --bubble-outgoing: #0284c7;
    --bubble-outgoing-text: #ffffff;
    --bubble-incoming: #ffffff;
    --bubble-incoming-text: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.18);
}

/* Ajustes globales para temas claros */
body.theme-lilac select.form-control option,
body.theme-cinnamon select.form-control option,
body.theme-sage select.form-control option,
body.theme-frost select.form-control option {
    background-color: #ffffff;
    color: #1e132b;
}

body.theme-lilac .form-control:focus,
body.theme-cinnamon .form-control:focus,
body.theme-sage .form-control:focus,
body.theme-frost .form-control:focus {
    background-color: #ffffff;
}

/* ==========================================================================
   COMPONENTES: REACCIONES CON EMOJIS
   ========================================================================== */
.message-bubble-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.message-bubble-wrapper:hover .reactions-trigger-btn {
    opacity: 1;
    pointer-events: auto;
}

.reactions-trigger-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    position: absolute;
    top: -12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.outgoing .reactions-trigger-btn {
    left: -12px;
}

.incoming .reactions-trigger-btn {
    right: -12px;
}

.reactions-popover {
    position: absolute;
    top: -46px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    padding: 4px 8px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    animation: fadeIn 0.15s ease-out;
}

.outgoing .reactions-popover {
    right: 0;
}

.incoming .reactions-popover {
    left: 0;
}

.reaction-choice-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 2px 5px;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.15s ease, background 0.15s ease;
    line-height: 1;
}

.reaction-choice-btn:hover {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.1);
}

.message-reactions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 2px 7px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
}

.reaction-pill.active {
    background: rgba(227, 219, 204, 0.18);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

.reaction-pill:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

/* ==========================================================================
   COMPONENTES: MENSAJES FIJADOS (PINNED)
   ========================================================================== */
.pinned-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 20;
}

.pinned-banner:hover {
    background: var(--bg-surface-elevated);
}

.pinned-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.pinned-banner-icon {
    color: var(--color-nude);
    display: flex;
    align-items: center;
}

.pinned-banner-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-banner-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-nude);
    font-weight: 700;
}

.highlight-pulse {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0% { background: rgba(227, 219, 204, 0.35); }
    100% { background: transparent; }
}

/* ==========================================================================
   COMPONENTES: BUSCADOR EN CHAT ACTIVO
   ========================================================================== */
.in-chat-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    animation: slideDown 0.2s ease-out;
}

.in-chat-search-bar input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 7px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
}

.in-chat-search-bar input:focus {
    border-color: var(--border-focus);
}

.search-results-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ==========================================================================
   COMPONENTES: VISTA ÚNICA (VIEW ONCE)
   ========================================================================== */
.view-once-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-once-card:hover {
    border-color: var(--accent-primary);
    background: rgba(227, 219, 204, 0.05);
}

.view-once-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(227, 219, 204, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-nude);
}

.view-once-destroyed {
    opacity: 0.5;
    cursor: not-allowed;
    border-style: solid;
}

/* ==========================================================================
   MODO CAMUFLAJE / BOTÓN DE PÁNICO (STEALTH)
   ========================================================================== */
.stealth-overlay {
    position: fixed;
    inset: 0;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Courier New', monospace;
    z-index: 999999;
    display: flex;
    flex-direction: column;
}

.stealth-topbar {
    background: #2d2d2d;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    border-bottom: 1px solid #3c3c3c;
}

.stealth-content {
    flex: 1;
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-y: auto;
}

/* ==========================================================================
   BLOQUEO DE PANTALLA POR PIN
   ========================================================================== */
.screen-lock-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-container {
    width: 100%;
    max-width: 320px;
    text-align: center;
    padding: 24px;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 32px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: var(--color-nude);
    border-color: var(--color-nude);
    box-shadow: 0 0 12px rgba(227, 219, 204, 0.4);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.pin-btn {
    width: 68px;
    height: 68px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pin-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-focus);
    transform: scale(1.05);
}

.pin-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   SELECTOR DE TEMAS
   ========================================================================== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.theme-card {
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    background: var(--bg-surface-elevated);
    transition: all 0.2s ease;
    text-align: left;
}

.theme-card:hover {
    border-color: var(--border-strong);
}

.theme-card.active {
    border-color: var(--color-nude);
    box-shadow: 0 0 16px rgba(227, 219, 204, 0.2);
}

.theme-swatches {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

