/* ────────────────────────────────────────────────────────────
   LoboGelido – Discord Server Designer v2.5 – Davana Industrial
   ──────────────────────────────────────────────────────────── */

:root {
    --bg-primary:    #121519;
    --bg-secondary:  #181c22;
    --bg-tertiary:   #0e1013;
    --bg-floating:   #20252d;
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --brand:         #3b82f6;
    --brand-hover:   #2563eb;
    --brand-glow:    rgba(59, 130, 246, 0.25);
    --accent-cyan:   #06b6d4;
    --green:         #10b981;
    --yellow:        #f59e0b;
    --red:           #ef4444;
    --red-hover:     #dc2626;
    --border:        #262b34;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --header-bg:     #0e1013;
    --radius:        8px;
    --radius-sm:     5px;
    --font-mono:     'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ─── Light Theme (Davana Clean Industrial) ─────────────────── */
[data-theme="light"] {
    --bg-primary:    #f8fafc;
    --bg-secondary:  #ffffff;
    --bg-tertiary:   #f1f5f9;
    --bg-floating:   #ffffff;
    --text-primary:  #0f172a;
    --text-secondary:#475569;
    --text-muted:    #64748b;
    --brand:         #2563eb;
    --brand-hover:   #1d4ed8;
    --brand-glow:    rgba(37, 99, 235, 0.2);
    --accent-cyan:   #0891b2;
    --green:         #059669;
    --yellow:        #d97706;
    --red:           #dc2626;
    --red-hover:     #b91c1c;
    --border:        #e2e8f0;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --header-bg:     #ffffff;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
[data-theme="light"] #topbar {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] #statusbar {
    background: #f1f5f9;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}
[data-theme="light"] .main-tab-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .main-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .home-stat-card,
[data-theme="light"] .home-pillar-card,
[data-theme="light"] .home-preset-card,
[data-theme="light"] .help-guide-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .home-stat-card:hover,
[data-theme="light"] .home-pillar-card:hover,
[data-theme="light"] .home-preset-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 15px rgba(37, 99, 235, 0.08);
}
[data-theme="light"] .home-preset-card:hover {
    background: #ffffff;
}
[data-theme="light"] .pillar-icon,
[data-theme="light"] .home-preset-icon {
    background: #f8fafc;
    border-color: #e2e8f0;
}
[data-theme="light"] .help-guide-header {
    background: #f8fafc;
}
[data-theme="light"] .help-guide-body {
    background: #ffffff;
}
[data-theme="light"] .connection-status {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* Light Theme: Message Designer Polish */
[data-theme="light"] .msgdesigner-card {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .msgdesigner-card-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
    color: #0f172a;
}
[data-theme="light"] .msgdesigner-card-header:hover {
    background: rgba(37, 99, 235, 0.06);
}
[data-theme="light"] .msg-embed-box {
    background: #ffffff;
    border-color: #cbd5e1;
    border-left-color: #2563eb !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .msg-embed-box-header {
    border-bottom-color: #e2e8f0;
    color: #0f172a;
}
[data-theme="light"] .msg-field-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}
[data-theme="light"] .md-toolbar {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
[data-theme="light"] .md-btn {
    color: #334155;
}
[data-theme="light"] .md-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
[data-theme="light"] .msgdesigner-editor .prop-input,
[data-theme="light"] .msgdesigner-editor .prop-textarea {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}
[data-theme="light"] .msgdesigner-editor .prop-label {
    color: #475569;
}
[data-theme="light"] .color-preset-bar {
    background: #e2e8f0;
    border-color: #cbd5e1;
}
[data-theme="light"] .msgdesigner-view-modes {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
[data-theme="light"] .msg-layout-btn {
    color: #475569;
}
[data-theme="light"] .msg-layout-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}
[data-theme="light"] .webhook-bar {
    background: #ffffff;
    border-bottom-color: #e2e8f0;
}
[data-theme="light"] .webhook-target-bar {
    background: #f8fafc;
    border-top-color: #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Custom Sleek Industrial Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #272d37;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* ─── Top Bar ──────────────────────────────────────────────── */
#topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    padding: 0 18px;
    height: 50px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}
.topbar-left h1 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-left h1 small {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--brand);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ─── Theme Toggle Button ───────────────────────────────────── */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle-btn:hover {
    background: var(--bg-floating);
    color: var(--text-primary);
    border-color: var(--brand);
    transform: translateY(-1px);
}

/* ─── i18n Language Selector Dropdown ────────────────────────────── */
.lang-selector-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-toggle-btn:hover {
    background: var(--bg-floating);
    color: var(--text-primary);
    border-color: var(--brand);
    transform: translateY(-1px);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 145px;
    background: var(--bg-floating);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}

.lang-option:hover {
    background: var(--brand);
    color: #ffffff;
}

.lang-flag {
    font-size: 14px;
}

.lang-name {
    flex: 1;
}

.lang-tag {
    font-size: 10px;
    font-family: var(--font-mono);
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
}

/* ─── Icon & Emoji Studio Styles ─────────────────────────────────── */
.icon-shape-btn.active,
.icon-frame-btn.active,
.icon-badge-btn.active {
    background: linear-gradient(135deg, #00f0ff, #ff007f) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 12px rgba(0, 240, 255, 0.35);
}

.icon-frame-btn, .icon-badge-btn {
    transition: all 0.15s ease;
}

.icon-frame-btn:hover, .icon-badge-btn:hover {
    border-color: #00f0ff;
    transform: translateY(-1px);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    position: relative;
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-dot.connecting { background: var(--yellow); animation: blink 1s infinite; box-shadow: 0 0 6px var(--yellow); }
.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}
@keyframes blink { 50% { opacity: 0.3; } }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    padding: 7px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:hover {
    background: var(--bg-floating);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}
.btn-danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-danger:hover {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}
.btn-sm { padding: 4px 11px; font-size: 12px; }

/* ─── Main Layout ──────────────────────────────────────────── */
#app {
    display: flex;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 50px - 46px - 24px);
    max-height: calc(100vh - 50px - 46px - 24px);
    overflow: hidden;
}

/* ─── Toolbox ───────────────────────────────────────────────── */
#toolbox {
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.22s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
#toolbox.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right-color: transparent !important;
    pointer-events: none;
    visibility: hidden;
}
.toolbox-inner {
    width: 200px;
    min-width: 200px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
.panel-header {
    padding: 10px 12px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; color: var(--text-muted);
    letter-spacing: 0.5px; background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 6px;
}
.toolbox-header {
    justify-content: space-between;
}
.toolbox-collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.toolbox-collapse-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Floating Reopen Button on Canvas left border */
.toolbox-floating-reopen {
    display: none;
    position: absolute;
    left: 0;
    top: 12px;
    z-index: 25;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 6px 6px 0;
    padding: 8px 4px 10px 3px;
    cursor: pointer;
    color: var(--text-muted);
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.35);
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s, transform 0.15s, border-color 0.15s;
    user-select: none;
}
.toolbox-floating-reopen:hover {
    background: var(--bg-tertiary);
    color: var(--brand);
    border-color: var(--brand);
    transform: translateX(2px);
}
.floating-reopen-arrow {
    font-size: 11px;
    font-weight: 700;
}
.floating-reopen-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.toolbox-floating-reopen:hover .floating-reopen-title {
    color: var(--text-primary);
}
#app.toolbox-collapsed .toolbox-floating-reopen {
    display: flex;
}

/* Toggle button in Navigation Tab Bar */
.toolbox-toggle-nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.toolbox-toggle-nav-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}
.toolbox-toggle-nav-btn.active {
    color: #fff;
    background: rgba(88, 101, 242, 0.25);
    border-color: var(--brand);
}
.nav-toggle-icon {
    font-size: 14px;
    line-height: 1;
}
.nav-toggle-label {
    display: none;
    font-size: 12px;
    font-weight: 600;
}
#app.toolbox-collapsed .nav-toggle-label {
    display: inline;
}

.tool-section { padding: 6px 8px; }
.tool-section-title {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: var(--text-muted); padding: 8px 8px 4px; letter-spacing: 0.8px;
}
.tool-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 7px 10px; background: transparent; border: 1px solid transparent;
    border-radius: var(--radius-sm); color: var(--text-secondary);
    font-size: 12px; cursor: pointer; text-align: left;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}
.tool-btn:hover {
    background: var(--bg-primary);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.06);
}
.tool-btn.btn-accent {
    color: #fff;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    font-weight: 700; font-size: 13px; padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.tool-btn.btn-accent:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
}
.tool-btn.btn-danger {
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.06);
}
.tool-btn.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
.tool-icon { font-size: 14px; width: 18px; text-align: center; }

/* ─── Designer (Center) ─────────────────────────────────────── */
#designer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    position: relative;
}
.server-name-input {
    background: transparent; border: 1px solid transparent;
    color: var(--text-primary); font-size: 12px; font-weight: 600;
    padding: 2px 8px; border-radius: var(--radius-sm);
    margin-left: auto; width: 180px; text-align: right;
}
.server-name-input:hover { border-color: var(--border); }
.server-name-input:focus { border-color: var(--brand); outline: none; background: var(--bg-tertiary); }
#treeContainer { flex: 1; overflow-y: auto; padding: 6px; }

/* ─── Tree ──────────────────────────────────────────────────── */
.tree { min-height: 80px; }
.tree-category { margin-bottom: 2px; border-radius: var(--radius); background: var(--bg-secondary); overflow: hidden; }
.tree-cat-header {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px; cursor: pointer; font-size: 11px;
    font-weight: 700; text-transform: uppercase; color: var(--text-muted);
    letter-spacing: 0.5px; transition: background 0.15s;
}
.tree-cat-header:hover { background: var(--bg-primary); }
.tree-cat-header.selected { background: rgba(88,101,242,0.2); color: var(--brand); }
.tree-cat-header .cat-arrow { transition: transform 0.15s; font-size: 9px; }
.tree-cat-header .cat-arrow.collapsed { transform: rotate(-90deg); }
.cat-actions, .ch-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.tree-cat-header:hover .cat-actions,
.tree-channel:hover .ch-actions,
.role-item:hover .ch-actions { opacity: 1; }

.tree-channels { padding: 0 0 2px 0; }
.tree-channels.collapsed { display: none; }

.tree-channel {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px 5px 24px; cursor: pointer; font-size: 13px;
    color: var(--text-secondary); transition: background 0.15s, color 0.15s;
    border-radius: var(--radius-sm); margin: 1px 4px;
}
.tree-channel:hover { background: var(--bg-primary); color: var(--text-primary); }
.tree-channel.selected { background: rgba(88,101,242,0.2); color: #fff; }
.ch-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-type { font-size: 9px; color: var(--text-muted); background: var(--bg-tertiary); padding: 1px 5px; border-radius: 3px; }
.ch-badges { display: flex; gap: 3px; }
.ch-badge {
    font-size: 9px; padding: 1px 4px; border-radius: 3px;
    background: rgba(88,101,242,0.2); color: var(--brand);
}
.ch-badge.msg-badge { background: rgba(87,242,135,0.2); color: var(--green); }
.ch-badge.thread-badge { background: rgba(254,231,92,0.2); color: var(--yellow); }

/* ─── Tree: Messages & Threads (nested) ─────────────────────── */
.tree-msg, .tree-thread {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 42px; cursor: pointer; font-size: 12px;
    color: var(--text-muted); transition: background 0.15s;
    border-radius: var(--radius-sm); margin: 1px 4px;
}
.tree-msg:hover, .tree-thread:hover { background: var(--bg-primary); color: var(--text-secondary); }
.tree-msg.selected, .tree-thread.selected { background: rgba(88,101,242,0.15); color: var(--text-primary); }
.tree-msg .ch-actions, .tree-thread .ch-actions { opacity: 0; }
.tree-msg:hover .ch-actions, .tree-thread:hover .ch-actions { opacity: 1; }

.action-btn {
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 12px; padding: 2px 4px;
    border-radius: 3px; transition: background 0.15s, color 0.15s;
}
.action-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.action-btn.delete:hover { color: var(--red); }

/* ─── Roles ─────────────────────────────────────────────────── */
.roles-header { border-top: 1px solid var(--border); }
.roles-container { padding: 6px; max-height: 120px; overflow-y: auto; }
.role-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px; cursor: pointer; border-radius: var(--radius-sm);
    transition: background 0.15s; font-size: 12px;
}
.role-item:hover { background: var(--bg-secondary); }
.role-item.selected { background: rgba(88,101,242,0.2); }
.role-color { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.role-name { flex: 1; }

/* ─── Properties ────────────────────────────────────────────── */
#properties {
    width: 300px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.22s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
#properties.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-left-color: transparent !important;
    pointer-events: none;
    visibility: hidden;
}
.properties-inner {
    width: 300px;
    min-width: 300px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
.properties-header {
    justify-content: space-between;
}
.properties-collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.properties-collapse-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Floating Reopen Button on Canvas right border */
.properties-floating-reopen {
    display: none;
    position: absolute;
    right: 0;
    top: 12px;
    z-index: 25;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 8px 3px 10px 4px;
    cursor: pointer;
    color: var(--text-muted);
    box-shadow: -3px 3px 10px rgba(0, 0, 0, 0.35);
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s, transform 0.15s, border-color 0.15s;
    user-select: none;
}
.properties-floating-reopen:hover {
    background: var(--bg-tertiary);
    color: var(--brand);
    border-color: var(--brand);
    transform: translateX(-2px);
}
.properties-floating-reopen:hover .floating-reopen-title {
    color: var(--text-primary);
}
#app.properties-collapsed .properties-floating-reopen {
    display: flex;
}

/* Toggle button in Navigation Tab Bar (right side) */
.properties-toggle-nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.properties-toggle-nav-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}
.properties-toggle-nav-btn.active {
    color: #fff;
    background: rgba(88, 101, 242, 0.25);
    border-color: var(--brand);
}
#app.properties-collapsed .properties-toggle-nav-btn .nav-toggle-label {
    display: inline;
}

#propsContent { padding: 12px; }
.prop-group { margin-bottom: 14px; }
.prop-label {
    display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 5px; letter-spacing: 0.8px;
}
.prop-input, .prop-select, .prop-textarea {
    width: 100%; padding: 8px 10px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 13px; font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.prop-input:focus, .prop-select:focus, .prop-textarea:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}
.prop-textarea { resize: vertical; min-height: 55px; }
.prop-checkbox {
    display: flex; align-items: center; gap: 8px; font-size: 12px;
    color: var(--text-secondary); cursor: pointer; padding: 3px 0;
}
.prop-checkbox input[type="checkbox"] { accent-color: var(--brand); width: 14px; height: 14px; }
.prop-section-title {
    font-size: 11px; font-weight: 700; color: var(--brand);
    margin: 12px 0 6px; padding-top: 8px; border-top: 1px solid var(--border);
}
.prop-item {
    display: flex; align-items: center; gap: 6px; padding: 4px 6px;
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    margin-bottom: 4px; font-size: 12px; cursor: pointer;
}
.prop-item:hover { background: var(--bg-primary); }
.prop-item .item-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.prop-add-btn {
    width: 100%; padding: 5px; background: transparent; border: 1px dashed var(--border);
    border-radius: var(--radius-sm); color: var(--text-muted); font-size: 11px;
    cursor: pointer; transition: all 0.15s;
}
.prop-add-btn:hover { border-color: var(--brand); color: var(--brand); background: rgba(88,101,242,0.05); }

/* Embed preview in properties */
.embed-preview {
    border-left: 3px solid var(--brand); background: var(--bg-tertiary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 8px 10px; margin: 6px 0; font-size: 12px;
}
.embed-preview .embed-title { font-weight: 700; margin-bottom: 4px; }
.embed-preview .embed-desc { color: var(--text-secondary); }

/* ─── Usability 2.5: Davana Industrial Dashboard & Components ─── */
/* ─── Davana Full-Width Hero Slider ─────────────────────────── */
#tabPaneHome {
    padding: 0 !important;
    display: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box;
}
#tabPaneHome.active {
    display: block !important;
}

.home-slider-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 0 32px 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(10, 13, 18, 0.95) 0%, rgba(14, 18, 25, 0.88) 45%, rgba(18, 24, 34, 0.65) 100%),
                url('/static/tech_bg.gif') center/cover no-repeat;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}

.home-slider-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #3b82f6);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
    z-index: 5;
}

[data-theme="light"] .home-slider-container {
    background: linear-gradient(90deg, rgba(248, 250, 252, 0.96) 0%, rgba(241, 245, 249, 0.90) 45%, rgba(226, 232, 240, 0.70) 100%),
                url('/static/tech_bg.gif') center/cover no-repeat;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.home-slider-track {
    position: relative;
    width: 100%;
    min-height: 470px;
    height: 470px;
}

.home-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(30px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 80px 0 100px;
}

.home-slide.active {
    position: absolute;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.home-slide-content {
    max-width: 840px;
    text-align: left;
    z-index: 2;
}

.home-slide-title {
    font-size: 38px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 14px 0;
    line-height: 1.18;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.home-slide-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px 0;
    max-width: 680px;
}

.home-slide-tags {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.slide-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
}

[data-theme="light"] .slide-tag {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.home-slide-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

/* Davana-Style Rectangular Edge Arrows */
.home-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 90px;
    background: rgba(14, 18, 25, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.home-slider-arrow.prev {
    left: 0;
    border-left: none;
    border-radius: 0 8px 8px 0;
}

.home-slider-arrow.next {
    right: 0;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

.home-slider-arrow:hover {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-50%) scale(1.05);
}

[data-theme="light"] .home-slider-arrow {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border-color: #cbd5e1;
}
[data-theme="light"] .home-slider-arrow:hover {
    background: var(--brand);
    color: #ffffff;
}

/* Davana-Style Round Dots */
.home-slider-dots {
    position: absolute;
    bottom: 20px;
    left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.slider-dot:hover {
    background: rgba(255, 255, 255, 0.55);
    transform: scale(1.2);
}

.slider-dot.active {
    background: var(--brand);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 10px var(--brand);
    transform: scale(1.25);
}

[data-theme="light"] .slider-dot {
    background: rgba(15, 23, 42, 0.2);
}
[data-theme="light"] .slider-dot.active {
    background: var(--brand);
    border-color: #ffffff;
}

/* Davana Large Hero Buttons */
.btn-hero-primary {
    padding: 12px 28px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    border-radius: 4px !important;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-hero-primary:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6) !important;
}

.btn-hero-secondary {
    padding: 12px 24px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(4px) !important;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    transform: translateY(-2px) !important;
}

[data-theme="light"] .btn-hero-secondary {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #cbd5e1 !important;
}

.home-hero {
    text-align: center;
    max-width: 980px;
    margin: 16px auto 36px auto;
    position: relative;
}
.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 5px 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 4px;
    color: #60a5fa;
    margin-bottom: 16px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}
.hero-badge-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 8px var(--brand);
    animation: heroPulse 1.8s infinite;
}
@keyframes heroPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}
.home-hero-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.25;
    letter-spacing: -0.5px;
}
.home-hero-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 700px;
}
.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto 36px auto;
}
.home-stat-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s, transform 0.2s;
}
.home-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s, box-shadow 0.2s;
}
.home-stat-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}
.home-stat-card:hover::before {
    background: var(--brand);
    box-shadow: 0 0 10px var(--brand);
}
.home-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.home-stat-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.home-stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.home-stat-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-stat-card .btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
}
.home-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    max-width: 1100px;
    margin: 0 auto 40px auto;
}
.home-pillar-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.22s ease,
                box-shadow 0.22s ease;
}
.home-pillar-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
    transition: background 0.22s ease, box-shadow 0.22s ease;
}
.home-pillar-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.15);
}
.home-pillar-card:hover::before {
    background: var(--brand);
    box-shadow: 0 0 12px var(--brand);
}
.pillar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.pillar-icon {
    font-size: 30px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pillar-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.pillar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px 0;
    letter-spacing: -0.2px;
}
.pillar-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 22px 0;
    flex: 1;
}
.home-section-header {
    max-width: 1100px;
    margin: 0 auto 18px auto;
}
.home-section-kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--brand);
    margin-bottom: 4px;
}
.home-section-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}
.home-section-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
.home-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto 36px auto;
}
.home-preset-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.home-preset-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.2s;
}
.home-preset-card:hover {
    background: #1c2128;
    border-color: var(--brand);
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.home-preset-card:hover::before {
    background: var(--brand);
}
.home-preset-icon {
    font-size: 26px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.home-preset-info {
    flex: 1;
}
.home-preset-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.home-preset-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}
.home-preset-arrow {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: bold;
    transition: color 0.15s, transform 0.15s;
}
.home-preset-card:hover .home-preset-arrow {
    color: var(--brand);
    transform: translateX(3px);
}

/* Help Guide Styles */
.help-guide-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}
.help-guide-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
    font-weight: 700;
    color: #f1f5f9;
    transition: background 0.15s, color 0.15s;
}
.help-guide-header:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #ffffff;
}
.help-guide-body {
    padding: 18px 22px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}
.help-guide-body p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}
.help-guide-body p:last-child {
    margin-bottom: 0;
}
.help-guide-body ul,
.help-guide-body ol {
    margin: 10px 0 14px 0;
    padding-left: 22px;
}
.help-guide-body ul li,
.help-guide-body ol li {
    margin-bottom: 7px;
    line-height: 1.6;
    padding-left: 2px;
}
.help-guide-body ul li:last-child,
.help-guide-body ol li:last-child {
    margin-bottom: 0;
}
.help-guide-body code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--brand);
    font-size: 12px;
}

/* ─── Help Hint Buttons & Elegant Tooltip ─── */
.help-hint-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border-radius: 50%;
    background: rgba(88, 101, 242, 0.14);
    border: 1px solid rgba(88, 101, 242, 0.38);
    color: #8ea1e1;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    margin: 0 4px;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    user-select: none;
}

.help-hint-btn:hover {
    background: #5865f2;
    border-color: #5865f2;
    color: #ffffff;
    transform: scale(1.18);
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.65);
}

.help-hint-btn:active {
    transform: scale(0.95);
}

/* Tooltip elegante - Posicionado hacia abajo para evitar recortes de overflow */
.help-hint-btn .help-hint-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #111827;
    border: 1px solid rgba(88, 101, 242, 0.55);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(88, 101, 242, 0.35);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100000;
}

.help-hint-btn .help-hint-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #111827 transparent;
}

.help-hint-btn:hover .help-hint-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Alineación para botones en el extremo derecho */
.msgdesigner-actions-right .help-hint-btn .help-hint-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-4px);
}
.msgdesigner-actions-right .help-hint-btn .help-hint-tooltip::after {
    left: auto;
    right: 8px;
    transform: none;
}
.msgdesigner-actions-right .help-hint-btn:hover .help-hint-tooltip {
    transform: translateX(0) translateY(0);
}

/* Animación de resalte pulsante */
@keyframes helpCardPulseAnim {
    0% {
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.8);
        border-color: #5865f2;
    }
    40% {
        box-shadow: 0 0 25px 6px rgba(88, 101, 242, 0.85), 0 0 35px rgba(121, 40, 202, 0.5);
        border-color: #818cf8;
        transform: translateY(-2px);
    }
    100% {
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
        border-color: var(--border);
        transform: translateY(0);
    }
}

.help-highlight-pulse {
    animation: helpCardPulseAnim 2.4s ease-out;
}

/* ─── Compact Webhook Bar Trigger & Status Pill ─── */
.btn-webhook-trigger {
    background: var(--bg-secondary);
    border: 1px solid rgba(88, 101, 242, 0.45);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.btn-webhook-trigger:hover {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.12);
}
.webhook-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
    transition: all 0.2s ease;
}
.webhook-dot.configured {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}
.target-msg-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.45);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 11px;
    color: #facc15;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.target-msg-pill:hover {
    background: rgba(234, 179, 8, 0.25);
}
.target-msg-pill .pill-close {
    font-size: 14px;
    font-weight: 900;
    margin-left: 2px;
    opacity: 0.8;
}
.target-msg-pill .pill-close:hover {
    opacity: 1;
    color: #ef4444;
}
.topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

/* Toolbox Context Panels */
.toolbox-context-panel {
    display: flex;
    flex-direction: column;
}

/* ─── Usability: Quick Start Launchpad & Presets ──────────── */
.launchpad-container {
    max-width: 860px;
    width: 100%;
    margin: 20px auto;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.launchpad-header {
    margin-bottom: 24px;
}
.launchpad-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}
.launchpad-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
.launchpad-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    text-align: left;
}
.launchpad-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.launchpad-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.launchpad-card.card-featured {
    border-color: rgba(121, 40, 202, 0.5);
    background: linear-gradient(145deg, rgba(121, 40, 202, 0.08), rgba(88, 101, 242, 0.08));
}
.launchpad-card.card-featured:hover {
    border-color: #7928ca;
    box-shadow: 0 6px 20px rgba(121, 40, 202, 0.3);
}
.bot-vip-lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.35);
    cursor: help;
}
.launchpad-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.badge-magic {
    background: linear-gradient(135deg, #7928ca, #5865f2);
    color: #fff;
}
.badge-popular {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.4);
}
.badge-social {
    background: rgba(88, 101, 242, 0.2);
    color: #5865f2;
    border: 1px solid rgba(88, 101, 242, 0.4);
}
.badge-pro {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.4);
}
.launchpad-card-icon {
    font-size: 28px;
    margin-bottom: 10px;
}
.launchpad-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.launchpad-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 14px;
    flex: 1;
}
.launchpad-card-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-align: center;
}
.launchpad-footer-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* Empty State Embeds Launchpad */
.empty-embed-launchpad {
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    margin: 10px 0;
}
.preset-embed-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}
.preset-chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.preset-chip:hover {
    border-color: var(--brand);
    background: rgba(88, 101, 242, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

/* ─── Empty States ──────────────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 40px; color: var(--text-muted); text-align: center;
}
.empty-state p { font-size: 15px; }
.empty-state .subtitle { font-size: 12px; margin-top: 6px; }
.empty-state-small { padding: 14px; color: var(--text-muted); font-size: 12px; text-align: center; }

/* ─── Status Bar (Davana Industrial Telemetry) ───────────────── */
#statusbar {
    display: flex; justify-content: space-between; align-items: center;
    background: #090b0e; color: var(--text-secondary); padding: 0 16px;
    height: 24px; font-size: 11px; flex-shrink: 0;
    font-family: var(--font-mono);
    border-top: 1px solid var(--border);
    letter-spacing: 0.3px;
}
#statusbar span { display: inline-flex; align-items: center; gap: 6px; }

/* ─── Modals (Davana Industrial) ────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 1000; justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; }
.modal {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.65), 0 0 30px rgba(59, 130, 246, 0.08);
}
.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}
.modal-wide { max-width: 660px; }
.modal-ai-studio {
    max-width: 740px !important;
    width: 100% !important;
}

.ai-tabs-nav {
    display: flex;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .ai-tabs-nav {
    background: rgba(0, 0, 0, 0.03);
}

.ai-tab-pill {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.ai-tab-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border);
}

.ai-tab-pill.active {
    background: linear-gradient(135deg, rgba(121, 40, 202, 0.18), rgba(59, 130, 246, 0.18));
    border-color: rgba(121, 40, 202, 0.5);
    color: #c084fc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .ai-tab-pill.active {
    background: rgba(121, 40, 202, 0.1);
    color: #7928ca;
    border-color: #7928ca;
}

.ai-form-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

.ai-form-card:hover {
    border-color: var(--brand);
    background: rgba(59, 130, 246, 0.05);
}

[data-theme="light"] .ai-form-card {
    background: #ffffff;
    border-color: #e2e8f0;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: #ffffff; letter-spacing: -0.2px; }
.modal-close {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 22px; cursor: pointer; transition: color 0.15s, transform 0.15s;
    line-height: 1;
}
.modal-close:hover { color: #ffffff; transform: scale(1.15); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.modal-hint { color: var(--text-muted); font-size: 11px; margin-top: 6px; }
.modal-body label {
    display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 5px; letter-spacing: 0.8px;
}
.modal-body a { color: var(--brand); text-decoration: none; }
.modal-body a:hover { text-decoration: underline; }
.input-full, .input-med {
    padding: 9px 12px; background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-full { width: 100%; }
.input-med { flex: 1; }
.input-full:focus, .input-med:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

/* ─── Bot Manager ───────────────────────────────────────────── */
.bot-add-form { display: flex; gap: 6px; margin-bottom: 12px; }
.bot-list { display: flex; flex-direction: column; gap: 4px; }
.bot-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--bg-tertiary); border-radius: var(--radius); transition: background 0.15s;
}
.bot-item:hover { background: var(--bg-primary); }
.bot-item .bot-info { flex: 1; }
.bot-item .bot-name { font-weight: 600; font-size: 13px; }
.bot-item .bot-meta { font-size: 11px; color: var(--text-muted); }
.bot-item .bot-actions { display: flex; gap: 4px; }

/* ─── Guild List ────────────────────────────────────────────── */
.guild-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(88, 101, 242, 0.45) rgba(0, 0, 0, 0.25);
}
.guild-list::-webkit-scrollbar {
    width: 6px;
}
.guild-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}
.guild-list::-webkit-scrollbar-thumb {
    background: rgba(88, 101, 242, 0.5);
    border-radius: 4px;
}
.guild-list::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}
.guild-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    background: var(--bg-tertiary); border: 2px solid transparent;
    border-radius: var(--radius); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.guild-item:hover { background: var(--bg-primary); }
.guild-item.selected { border-color: var(--brand); background: rgba(88,101,242,0.1); }
.guild-icon {
    width: 36px; height: 36px; border-radius: 50%; background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--text-muted);
    flex-shrink: 0; overflow: hidden;
}
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-info { flex: 1; }
.guild-name { font-weight: 600; font-size: 13px; }
.guild-meta { font-size: 11px; color: var(--text-muted); }

/* ─── Template List ─────────────────────────────────────────── */
.template-list { display: flex; flex-direction: column; gap: 4px; }
.template-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; background: var(--bg-tertiary); border-radius: var(--radius);
    cursor: pointer; transition: background 0.15s;
}
.template-item:hover { background: var(--bg-primary); }
.template-name { font-weight: 600; font-size: 13px; }
.template-meta { font-size: 11px; color: var(--text-muted); }
.template-actions { display: flex; gap: 4px; }

/* ─── Deploy Log ────────────────────────────────────────────── */
.deploy-log { margin-top: 12px; background: var(--bg-tertiary); border-radius: var(--radius); overflow: hidden; }
.deploy-log-header { padding: 6px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.deploy-log pre {
    padding: 10px; font-family: 'Consolas', monospace; font-size: 11px;
    color: var(--green); max-height: 200px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word;
}

/* ─── Checkbox ──────────────────────────────────────────────── */
.checkbox-label {
    display: flex !important; align-items: center; gap: 8px;
    font-size: 12px !important; color: var(--text-secondary);
    cursor: pointer; text-transform: none !important; font-weight: 400 !important;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--brand); width: 14px; height: 14px; }

/* ─── Scrollbars ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ─── Drag ──────────────────────────────────────────────────── */
.dragging { opacity: 0.4; }
.drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; }

/* ─── Emoji Picker ──────────────────────────────────────────── */
.emoji-picker {
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px; margin-top: 6px;
    max-height: 280px; overflow-y: auto;
}
.emoji-picker-header {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    color: var(--text-muted); padding: 4px 0 6px; letter-spacing: 0.5px;
}
.emoji-group-title {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    padding: 6px 0 3px; border-top: 1px solid var(--border); margin-top: 4px;
}
.emoji-group-title:first-of-type { border-top: none; margin-top: 0; }
.emoji-grid {
    display: flex; flex-wrap: wrap; gap: 2px;
}
.emoji-btn {
    width: 32px; height: 32px; font-size: 18px;
    background: transparent; border: none; border-radius: var(--radius-sm);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.1s, transform 0.1s;
}
.emoji-btn:hover {
    background: var(--bg-primary); transform: scale(1.2);
}

/* Structure Emoji Picker Dedicated Styles (Anti-Shrink & Full Visibility) */
.structure-emoji-picker {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    margin-top: 6px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    box-sizing: border-box;
}
.structure-emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 4px 0 8px 0;
    width: 100%;
    box-sizing: border-box;
}
.structure-emoji-btn {
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 1;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.12s ease, background 0.12s ease;
    user-select: none;
    flex-shrink: 0;
}
.structure-emoji-btn:hover {
    background: var(--bg-primary);
    transform: scale(1.22);
}


/* ─── Main Tabs Navigation (Davana Industrial) ──────────────── */
.main-tabs-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 46px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.main-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.main-tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.06);
}
.main-tab-btn.active {
    background: var(--bg-secondary);
    color: #ffffff;
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.main-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--brand);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--brand);
}
.main-tab-btn .badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}
.tab-pane {
    display: none; flex: 1; flex-direction: column; overflow: hidden; min-height: 0;
}
.tab-pane.active { display: flex; }

/* ─── Tree Thread Nesting & Connectors ──────────────────────── */
.tree-thread {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 8px 3px 12px; margin: 1px 4px 1px 48px;
    border-left: 2px solid var(--border);
    font-size: 12px; color: var(--text-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.tree-thread:hover { background: var(--bg-primary); color: var(--text-secondary); }
.tree-thread.selected { background: rgba(88,101,242,0.18); color: #fff; border-left-color: var(--brand); }
.tree-thread .thread-connector { color: var(--border); font-size: 11px; margin-right: 2px; }
.tree-thread .ch-name { font-size: 11px; }

/* ─── Roles Tab Layout ──────────────────────────────────────── */
.roles-tab-body {
    display: flex; flex: 1; overflow: hidden; background: var(--bg-primary); min-height: 0;
}
.roles-tab-sidebar {
    width: 260px; border-right: 1px solid var(--border);
    background: var(--bg-secondary); overflow-y: auto; padding: 8px;
    display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
}
.roles-tab-detail {
    flex: 1; overflow-y: auto; padding: 16px 20px;
}
.role-card-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}
.role-card-item:hover { background: var(--bg-primary); }
.role-card-item.selected {
    background: rgba(88,101,242,0.15); border-color: var(--brand);
}
.role-card-item .role-name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.role-actions { margin-left: auto; display: flex; gap: 4px; }

.perm-category-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    color: var(--brand); letter-spacing: 0.5px; margin: 16px 0 8px;
    padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.perm-category-title:first-child { margin-top: 0; }
.perm-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px; margin-bottom: 12px;
}
.perm-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12px; cursor: pointer; transition: border-color 0.15s;
}
.perm-card:hover { border-color: var(--brand); }
.perm-card input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }

/* ─── Diseñador de Mensajes / LoboHook ──────────────────────── */
.webhook-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #1e1f22;
    border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
}
.webhook-label-group {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.webhook-badge {
    font-size: 11px; font-weight: 700; color: var(--brand);
    letter-spacing: 0.5px; white-space: nowrap;
}
.webhook-url-input {
    font-size: 12px; font-family: monospace;
}

.msgdesigner-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 10px; flex-wrap: wrap;
    position: relative; z-index: 10; overflow: visible;
}
.msgdesigner-actions-left, .msgdesigner-actions-right {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.msg-layout-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.msg-layout-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.msg-layout-btn.active {
    background: var(--brand) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}
.msgdesigner-workspace {
    display: flex;
    flex: 1 1 0;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}
.msgdesigner-editor {
    flex: 1.25;
    overflow-y: scroll !important;
    overflow-x: hidden;
    padding: 22px 26px 140px 26px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    height: 100%;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #5865f2 #1e1f22;
}
.msgdesigner-preview-pane {
    flex: 1;
    overflow-y: scroll !important;
    overflow-x: auto;
    padding: 22px 24px 140px 24px;
    background: #232428;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    height: 100%;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #5865f2 #1e1f22;
}
[data-theme="light"] .msgdesigner-preview-pane {
    background: #eaecf0;
}

/* Custom Scrollbars (Sliders) */
.msgdesigner-editor::-webkit-scrollbar,
.msgdesigner-preview-pane::-webkit-scrollbar,
.roles-tab-sidebar::-webkit-scrollbar,
.roles-tab-detail::-webkit-scrollbar,
#treeContainer::-webkit-scrollbar,
#toolbox::-webkit-scrollbar,
.toolbox-inner::-webkit-scrollbar,
#properties::-webkit-scrollbar,
.properties-inner::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
.msgdesigner-editor::-webkit-scrollbar-track,
.msgdesigner-preview-pane::-webkit-scrollbar-track,
.roles-tab-sidebar::-webkit-scrollbar-track,
.roles-tab-detail::-webkit-scrollbar-track,
#treeContainer::-webkit-scrollbar-track,
.toolbox-inner::-webkit-scrollbar-track,
#properties::-webkit-scrollbar-track,
.properties-inner::-webkit-scrollbar-track {
    background: #1e1f22;
    border-radius: 6px;
}
.msgdesigner-editor::-webkit-scrollbar-thumb,
.msgdesigner-preview-pane::-webkit-scrollbar-thumb,
.roles-tab-sidebar::-webkit-scrollbar-thumb,
.roles-tab-detail::-webkit-scrollbar-thumb,
#treeContainer::-webkit-scrollbar-thumb,
#toolbox::-webkit-scrollbar-thumb,
.toolbox-inner::-webkit-scrollbar-thumb,
#properties::-webkit-scrollbar-thumb,
.properties-inner::-webkit-scrollbar-thumb {
    background: #5865f2;
    border-radius: 6px;
    border: 2px solid #1e1f22;
}
.msgdesigner-editor::-webkit-scrollbar-thumb:hover,
.msgdesigner-preview-pane::-webkit-scrollbar-thumb:hover,
.roles-tab-sidebar::-webkit-scrollbar-thumb:hover,
.roles-tab-detail::-webkit-scrollbar-thumb:hover,
#treeContainer::-webkit-scrollbar-thumb:hover,
#toolbox::-webkit-scrollbar-thumb:hover,
.toolbox-inner::-webkit-scrollbar-thumb:hover,
#properties::-webkit-scrollbar-thumb:hover,
.properties-inner::-webkit-scrollbar-thumb:hover {
    background: #7983f5;
}

/* ─── Contenedores Dinámicos de Diseñador de Mensajes ───────── */
.msgdesigner-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.msgdesigner-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
}
.msgdesigner-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    user-select: none;
}
.msgdesigner-card-header:hover {
    background: rgba(59, 130, 246, 0.08);
}
.msgdesigner-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: auto;
    overflow: visible;
}
.msg-embeds-container, .msg-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: auto;
    overflow: visible;
}

/* Scoped inputs inside msgdesigner-editor for generous breathing room */
.msgdesigner-editor .prop-group {
    margin-bottom: 16px;
}
.msgdesigner-editor .prop-label {
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.msgdesigner-editor .prop-input,
.msgdesigner-editor .prop-select {
    height: 40px;
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
}
.msgdesigner-editor .prop-textarea {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

/* ─── Image Input Group & Image Picker Modal ───────────────── */
.image-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.image-input-group .prop-input {
    flex: 1;
}
.btn-img-picker {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, border-color 0.15s;
}
.btn-img-picker:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: var(--brand);
    color: #fff;
}

.img-source-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    border: 1px solid var(--border);
}
.img-source-tab {
    flex: 1;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.img-source-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.img-source-tab.active {
    background: var(--brand);
    color: #fff;
}

.drop-zone {
    border: 2px dashed rgba(88, 101, 242, 0.4);
    background: rgba(88, 101, 242, 0.05);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--brand);
    background: rgba(88, 101, 242, 0.12);
    transform: scale(1.01);
}

.cloud-helper-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-top: 8px;
    line-height: 1.4;
}

/* Preset Banners & Dividers Gallery */
.preset-filter-btn, .msg-preset-filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.preset-filter-btn:hover, .msg-preset-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--brand);
}
.preset-filter-btn.active, .msg-preset-filter-btn.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-weight: 700;
}
.preset-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 10px;
    max-height: 270px;
    overflow-y: auto;
    padding: 4px;
    margin-top: 8px;
}
.preset-asset-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
}
.preset-asset-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.preset-asset-card.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand);
}
.preset-asset-thumb {
    width: 100%;
    height: 60px;
    object-fit: cover;
    background: #111;
    display: block;
}
.preset-asset-thumb.divider-thumb {
    height: 30px;
}
.preset-asset-info {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bg-tertiary);
}
.preset-asset-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preset-asset-tag {
    font-size: 9px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ─── AI Progress Bar & Countdown Timer ──────────────────────── */
@keyframes spinAnimation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin {
    display: inline-block;
    animation: spinAnimation 1s linear infinite;
}

.ai-progress-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.2s ease;
}
.ai-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}
.ai-progress-phase {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 7px;
}
.ai-countdown-badge {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    font-weight: 800;
    color: var(--brand);
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.35);
    padding: 2px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-progress-track {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7928ca 0%, #3b82f6 50%, #00d26a 100%);
    transition: width 0.2s ease-out;
    box-shadow: 0 0 10px rgba(121, 40, 202, 0.6);
    border-radius: 999px;
}

.img-picker-preview-box {
    margin-top: 14px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
}
.img-picker-preview-box img {
    max-height: 150px;
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #1e1f22;
    padding: 4px;
    border: 1px solid var(--border);
}

/* Color Dot Presets */
.color-dot {
    transition: transform 0.15s, border-color 0.15s;
}
.color-dot:hover {
    transform: scale(1.2);
    border-color: #ffffff !important;
}

/* Message Templates Grid */
.template-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px; margin-top: 10px; max-height: 420px; overflow-y: auto; padding: 4px;
}
.template-grid::-webkit-scrollbar { width: 8px; }
.template-grid::-webkit-scrollbar-thumb { background: #4e5058; border-radius: 4px; }
.msg-tmpl-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column;
    justify-content: space-between; transition: border-color 0.15s, transform 0.15s;
}
.msg-tmpl-card:hover {
    border-color: var(--brand); transform: translateY(-2px);
}
.msg-tmpl-header {
    display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px;
}
.msg-tmpl-title {
    font-weight: 700; font-size: 14px; color: var(--text-primary);
}
.msg-tmpl-desc {
    font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 12px;
    word-break: break-word; min-height: 34px;
}
.msg-tmpl-footer {
    display: flex; justify-content: space-between; align-items: center; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.msg-tmpl-badges {
    display: flex; gap: 4px;
}

.preview-header-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: var(--text-muted); letter-spacing: 0.5px; margin-bottom: 12px;
}
.card-arrow { transition: transform 0.15s; font-size: 11px; color: var(--text-muted); }
.card-arrow.collapsed { transform: rotate(-90deg); }

/* Embed Box in Editor */
.dh-embed-box, .msg-embed-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--brand);
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 18px;
    position: relative;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}
.dh-embed-box-header, .msg-embed-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.dh-field-row, .msg-field-row {
    display: flex; gap: 10px; align-items: center; margin-bottom: 10px;
}
.dh-button-row, .msg-button-row {
    display: flex; gap: 10px; align-items: center; margin-bottom: 10px;
    background: var(--bg-primary); padding: 10px 14px; border-radius: 8px;
    border: 1px solid var(--border);
}

/* ─── Discord Live Preview Styling ──────────────────────────── */
.discord-chat-container {
    background: #313338; border-radius: 10px; padding: 20px;
    color: #dbdee1; font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35); max-width: 620px; width: 100%; box-sizing: border-box;
}
.discord-msg-row {
    display: flex; gap: 14px; align-items: flex-start;
}
.discord-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0; background: #5865f2;
}
.discord-msg-body { flex: 1; min-width: 0; }
.discord-author-header {
    display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px;
}
.discord-author-name {
    font-weight: 600; font-size: 15px; color: #f2f3f5;
}
.discord-bot-badge {
    background: #5865f2; color: #fff; font-size: 9px;
    font-weight: 700; padding: 1px 4px; border-radius: 3px;
    line-height: 1.2; text-transform: uppercase;
}
.discord-timestamp {
    font-size: 11px; color: #949ba4;
}
.discord-content {
    font-size: 14px; line-height: 1.375; color: #dbdee1;
    word-break: break-word; white-space: pre-wrap; margin-bottom: 6px;
}
.discord-content:empty { display: none; }

/* Discord Embed View */
.discord-embed {
    display: grid; grid-template-columns: 1fr auto;
    background: #2b2d31; border-radius: 6px;
    border-left: 4px solid #5865f2; padding: 12px 16px;
    margin-top: 8px; max-width: 520px; width: 100%; box-sizing: border-box; font-size: 13px;
    gap: 10px;
}
.discord-embed-left { min-width: 0; }
.discord-embed-author {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: #f2f3f5; margin-bottom: 4px;
}
.discord-embed-author img {
    width: 20px; height: 20px; border-radius: 50%;
}
.discord-embed-title {
    font-size: 15px; font-weight: 700; color: #00a8fc;
    margin-bottom: 6px; text-decoration: none; word-break: break-word;
}
.discord-embed-desc {
    font-size: 13px; line-height: 1.35; color: #dbdee1;
    white-space: pre-wrap; word-break: break-word; margin-bottom: 8px;
}
.discord-embed-fields {
    display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 8px;
}
.discord-embed-field {
    min-width: 120px; flex: 1 1 100%; word-break: break-word;
}
.discord-embed-field.inline { flex: 1 1 140px; max-width: calc(50% - 8px); }
.discord-field-name {
    font-weight: 700; font-size: 12px; color: #f2f3f5; margin-bottom: 2px;
}
.discord-field-value {
    font-size: 12px; color: #dbdee1; white-space: pre-wrap;
}
.discord-embed-image {
    max-width: 100%; max-height: 280px; border-radius: 4px;
    margin-top: 8px; object-fit: cover; display: block; width: 100%;
}
.discord-embed-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-top: 8px;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
}
.discord-embed-images-grid .discord-embed-image {
    margin-top: 0;
    height: 145px;
    max-height: 145px;
    width: 100%;
    object-fit: cover;
    border-radius: 3px;
}
.discord-embed-thumb {
    width: 80px; height: 80px; border-radius: 4px;
    object-fit: cover; margin-left: 8px;
}
.discord-embed-footer {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: #949ba4; margin-top: 8px;
}
.discord-embed-footer img {
    width: 18px; height: 18px; border-radius: 50%;
}

/* Discord Buttons & Action Rows (Components) */
.discord-buttons-row {
    display: flex; flex-direction: column; gap: 6px; margin-top: 8px; width: 100%; max-width: 520px;
}
.discord-action-row {
    display: flex; flex-wrap: nowrap; gap: 5px; width: 100%; align-items: center; box-sizing: border-box;
}
.discord-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 5px 8px; background: #4e5058; color: #fff;
    border-radius: 4px; font-size: 11.5px; font-weight: 500;
    text-decoration: none; transition: background 0.15s; cursor: pointer;
    border: none; min-width: 0; flex: 0 1 calc(20% - 4px); max-width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box;
}
.discord-btn span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.discord-btn:hover { background: #6d6f78; color: #fff; }
.discord-btn .btn-ext-icon { font-size: 10px; opacity: 0.75; flex-shrink: 0; }

/* ─── Markdown Toolbar ───────────────────────────────────────── */
.md-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.md-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 3px 6px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    user-select: none;
}
.md-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}
.md-toolbar + .prop-textarea {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* ─── Color Preset Bar ───────────────────────────────────────── */
.color-preset-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    border: 1px solid var(--border);
}
.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.15s, border-color 0.15s;
    display: inline-block;
}
.color-dot:hover {
    transform: scale(1.3);
    border-color: #fff;
}

/* ─── VIP / Freemium Modal & Badges ──────────────────────────── */
.vip-badge-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b 55%, #ea580c);
    color: #1f1300;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55), 0 4px 14px rgba(245, 158, 11, 0.4);
    animation: vip-btn-pulse 2.6s ease-in-out infinite;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.vip-badge-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    animation: vip-btn-shine 3.4s ease-in-out infinite;
    pointer-events: none;
}
.vip-badge-btn:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.08);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.55);
}
.vip-badge-btn.unlocked {
    color: #fff;
    background: linear-gradient(135deg, #34d399, #10b981 55%, #0891b2);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    animation: none;
    cursor: default;
}
.vip-badge-btn.unlocked:hover { transform: none; filter: none; }
.vip-badge-btn.unlocked-dev {
    color: #1f1300;
    background: linear-gradient(135deg, #fde68a, #fbbf24 45%, #f59e0b 75%, #ea580c);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.55), 0 4px 14px rgba(245, 158, 11, 0.45);
}
.vip-badge-btn.unlocked-admin {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6 55%, #6d28d9);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.5), 0 4px 14px rgba(109, 40, 217, 0.4);
}
@keyframes vip-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5), 0 4px 14px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0), 0 4px 14px rgba(245, 158, 11, 0.4); }
}
@keyframes vip-btn-shine {
    0%, 55% { left: -60%; }
    100% { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
    .vip-badge-btn, .vip-badge-btn::after { animation: none; }
}
.vip-modal-box {
    text-align: center;
    padding: 10px 0;
}
.vip-icon-large {
    font-size: 48px;
    margin-bottom: 8px;
}
.vip-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}
.vip-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}
.vip-perks-list {
    text-align: left;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vip-perk-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}
.vip-donate-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}
.btn-donate {
    background: #ff5e5b;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-donate:hover {
    opacity: 0.9;
}

/* ─── Discohook Pro Features (Theme, Mobile, Counters, Timestamp) ── */
.discord-chat-container.light-theme {
    background: #ffffff;
    color: #313338;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.discord-chat-container.light-theme .discord-author-name {
    color: #060607;
}
.discord-chat-container.light-theme .discord-timestamp {
    color: #747f8d;
}
.discord-chat-container.light-theme .discord-content {
    color: #2e3338;
}
.discord-chat-container.light-theme .discord-embed {
    background: #f2f3f5;
}
.discord-chat-container.light-theme .discord-embed-author {
    color: #060607;
}
.discord-chat-container.light-theme .discord-embed-desc {
    color: #2e3338;
}
.discord-chat-container.light-theme .discord-field-name {
    color: #060607;
}
.discord-chat-container.light-theme .discord-field-value {
    color: #2e3338;
}
.discord-chat-container.light-theme .discord-embed-footer {
    color: #747f8d;
}

.discord-chat-container.mobile-view {
    max-width: 360px !important;
    padding: 10px !important;
    border: 2px dashed #5865f2;
}
.discord-chat-container.mobile-view .discord-embed {
    max-width: 100% !important;
}
.discord-chat-container.mobile-view .discord-embed-field.inline {
    flex: 1 1 100% !important;
}

.char-counter {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.char-counter.warning {
    color: #fee75c;
}
.char-counter.danger {
    color: #ed4245;
}

.webhook-target-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    font-size: 12px;
    flex-wrap: wrap;
}
.target-msg-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(88, 101, 242, 0.2);
    color: var(--brand);
}
.target-msg-badge.active-edit {
    background: rgba(237, 66, 69, 0.2);
    color: #ed4245;
}

.embed-timestamp-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.timestamp-select {
    padding: 3px 6px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

/* ─── Thread Preview Card ────────────────────────────────────── */
.discord-thread-card {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #2b2d31;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    font-size: 13px;
    max-width: 520px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.discord-chat-container.light-theme .discord-thread-card {
    background: #f2f3f5;
    border-color: rgba(0,0,0,0.08);
}
.discord-thread-icon {
    font-size: 15px;
    color: #949ba4;
}
.discord-thread-name {
    font-weight: 700;
    color: #f2f3f5;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.discord-chat-container.light-theme .discord-thread-name {
    color: #060607;
}
.discord-thread-meta {
    font-size: 11px;
    color: #949ba4;
    white-space: nowrap;
}

/* ─── Field Card Vertical Layout ────────────────────────────── */
.msg-field-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.msg-field-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ─── Grouped Section Toolbar ────────────────────────────────── */
.md-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid var(--border);
    margin-right: 4px;
}
.md-toolbar-group:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}
.md-btn-pill {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-radius: 5px !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    font-size: 11.5px !important;
}
.md-btn-pill:hover {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
}

/* ─── Emoji Picker Modal ─────────────────────────────────────── */
.emoji-modal-categories {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.emoji-cat-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}
.emoji-cat-btn.active, .emoji-cat-btn:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
}
.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
    user-select: none;
}
.emoji-item:hover {
    background: rgba(88, 101, 242, 0.25);
    transform: scale(1.22);
}

/* ─── Timestamp Picker Modal ─────────────────────────────────── */
.ts-picker-preview-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin: 12px 0;
}
.ts-formats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 10px;
}
.ts-format-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.ts-format-card:hover {
    border-color: var(--brand);
    background: rgba(88, 101, 242, 0.08);
}
.ts-tag-code {
    font-family: monospace;
    font-size: 11px;
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--brand);
}

/* ─── Mention Helper Modal ───────────────────────────────────── */
.mention-chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.mention-chip-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
}
.mention-chip-btn:hover {
    border-color: var(--brand);
    background: rgba(88, 101, 242, 0.1);
}

/* ─── Discord Authentication & RBAC User Menu ─────────────────────── */
.btn-discord-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #5865f2;
    color: #ffffff !important;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.35);
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    border: none;
    cursor: pointer;
}
.btn-discord-login:hover {
    background: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.45);
}

.user-profile-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 3px 10px 3px 4px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}
.user-profile-pill:hover {
    background: var(--bg-tertiary);
    border-color: var(--brand);
}
.user-profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border);
}
.user-profile-name {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.role-badge-tag {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.role-badge-dev {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.role-badge-admin {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}
.role-badge-vip, .role-badge-vip_pro, .role-badge-agency_starter, .role-badge-agency {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}
.role-badge-user {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.user-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
    min-width: 230px;
    z-index: 1000;
    display: none;
    padding: 6px;
    animation: fadeInDown 0.15s ease-out;
}
.user-profile-dropdown.show {
    display: block;
}
.user-profile-dropdown-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.user-profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    border: none;
    width: 100%;
    background: transparent;
    text-align: left;
}
.user-profile-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--brand);
}
.user-profile-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ─── Marketplace de Plantillas Oficiales (Diseño Amplio & Espacioso) ──────────── */
.mkt-hero-banner {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.12), rgba(168, 85, 247, 0.14));
    border: 1px solid rgba(88, 101, 242, 0.28);
    border-radius: 14px;
    padding: 28px 34px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}
.mkt-hero-text {
    max-width: 760px;
}
.mkt-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.35);
    border-radius: 20px;
    color: #93c5fd;
    margin-bottom: 12px;
}
.mkt-hero-heading {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.25;
}
.mkt-hero-subheading {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.mkt-vip-header-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    font-weight: 800;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.mkt-vip-header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

/* Controls Card (Toolbar) */
.mkt-controls-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.mkt-controls-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.mkt-search-wrapper {
    flex: 1;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
}
.mkt-search-icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
}
.mkt-search-input {
    width: 100%;
    height: 42px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 16px 0 40px;
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mkt-search-input:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}
.mkt-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mkt-select-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px 10px;
    height: 42px;
}
.mkt-select-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
}
.mkt-select-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.mkt-count-badge {
    background: rgba(88, 101, 242, 0.15);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(88, 101, 242, 0.3);
    white-space: nowrap;
}

/* Categories Bar */
.mkt-categories-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.mkt-cat-pill {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mkt-cat-pill:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}
.mkt-cat-pill.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.35);
}

/* Templates Grid */
.mkt-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 26px;
}

/* Template Card */
.mkt-template-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.mkt-template-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}
.mkt-template-card.vip-card {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.03) 0%, var(--bg-secondary) 100%);
}
.mkt-template-card.vip-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25);
}

.mkt-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.mkt-card-icon-frame {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(88, 101, 242, 0.12);
    border: 1px solid rgba(88, 101, 242, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.mkt-template-card.vip-card .mkt-card-icon-frame {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
}
.mkt-card-title-group {
    flex: 1;
    min-width: 0;
}
.mkt-card-category {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.mkt-card-title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}
.mkt-card-badge-wrap {
    flex-shrink: 0;
}

.mkt-card-summary {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 16px 0;
    min-height: 38px;
}

/* Micro Stats Bar */
.mkt-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.mkt-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.mkt-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.mkt-stat-value {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-primary);
}
.mkt-stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

/* Tags */
.mkt-tags-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.mkt-tag-pill {
    background: rgba(88, 101, 242, 0.08);
    color: var(--brand);
    border: 1px solid rgba(88, 101, 242, 0.2);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
}

/* Badges */
.mkt-badge-free {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    display: inline-block;
}
.mkt-badge-vip {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
    display: inline-block;
}

/* Card Footer */
.mkt-card-footer {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: auto;
}
.mkt-btn-preview {
    flex: 1;
    font-weight: 700;
    font-size: 12.5px;
    padding: 9px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.mkt-btn-preview:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}
.mkt-btn-use {
    flex: 1.25;
    font-weight: 800;
    font-size: 12.5px;
    padding: 9px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.mkt-btn-vip {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.mkt-btn-vip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5);
}

/* ─── Segmented Tier Switcher for Templates ─── */
.mkt-tier-switcher {
    display: inline-flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 4px;
}
.mkt-tier-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.mkt-tier-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.mkt-tier-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.mkt-tier-btn[data-tier="free"].active {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}
.mkt-tier-btn[data-tier="vip"].active {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.35);
}

/* ─── Clear Division Sections (VIP vs Free) ─── */
.mkt-section-wrapper {
    margin-bottom: 40px;
}
.mkt-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.mkt-section-header.vip-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.08);
}
.mkt-section-header.free-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 95, 70, 0.04));
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.06);
}
.mkt-section-title-wrap {
    flex: 1;
    min-width: 260px;
}
.mkt-section-title {
    margin: 0 0 6px 0;
    font-size: 19px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mkt-section-header.vip-section .mkt-section-title {
    color: #fef3c7;
}
.mkt-section-header.free-section .mkt-section-title {
    color: #ecfdf5;
}
[data-theme="light"] .mkt-section-header.vip-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.08));
    border-color: rgba(217, 119, 6, 0.45);
}
[data-theme="light"] .mkt-section-header.vip-section .mkt-section-title {
    color: #92400e;
}
[data-theme="light"] .mkt-section-header.free-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.07));
    border-color: rgba(5, 150, 105, 0.45);
}
[data-theme="light"] .mkt-section-header.free-section .mkt-section-title {
    color: #065f46;
}
#msgPresetsList .launchpad-card-badge {
    position: static;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 8px;
}
.mkt-section-badge-vip {
    font-size: 11px;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.mkt-section-badge-free {
    font-size: 11px;
    font-weight: 800;
    background: #10b981;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.mkt-section-sub {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── Interactive Discord Embed Wireframe ─── */
.ai-wireframe-card {
    background: #2b2d31;
    border-left: 4px solid var(--brand);
    border-radius: 6px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    position: relative;
    user-select: none;
}
.ai-wireframe-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.ai-wireframe-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
}
.ai-wf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    display: inline-block;
}
.ai-wireframe-thumb-slot {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    border: 2px dashed rgba(88, 101, 242, 0.45);
    background: rgba(88, 101, 242, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ai-wireframe-thumb-slot:hover {
    border-color: var(--brand);
    background: rgba(88, 101, 242, 0.18);
    transform: scale(1.03);
}
.ai-wireframe-thumb-slot.has-image {
    border-style: solid;
    border-color: var(--brand);
}
.ai-wireframe-thumb-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ai-wireframe-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}
.ai-wireframe-desc {
    font-size: 12px;
    color: #dbdee1;
    line-height: 1.5;
    margin-bottom: 14px;
}
.ai-wireframe-banner-slot {
    width: 100%;
    min-height: 115px;
    max-height: 160px;
    border-radius: 8px;
    border: 2px dashed rgba(88, 101, 242, 0.45);
    background: rgba(88, 101, 242, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
    margin-bottom: 14px;
    text-align: center;
    padding: 10px;
}
.ai-wireframe-banner-slot:hover {
    border-color: var(--brand);
    background: rgba(88, 101, 242, 0.18);
    transform: translateY(-2px);
}
.ai-wireframe-banner-slot.has-image {
    border-style: solid;
    border-color: var(--brand);
    padding: 0;
}
.ai-wireframe-banner-slot img {
    width: 100%;
    height: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
}
.ai-wireframe-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.ai-wireframe-footer-slot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px dashed rgba(88, 101, 242, 0.5);
    background: rgba(88, 101, 242, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ai-wireframe-footer-slot:hover {
    border-color: var(--brand);
    transform: scale(1.1);
}
.ai-wireframe-footer-slot.has-image {
    border-style: solid;
    border-color: var(--brand);
}
.ai-wireframe-footer-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ai-wf-placeholder {
    color: var(--brand);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.ai-wf-placeholder-mini {
    font-size: 12px;
    color: var(--brand);
}
.ai-wf-clear-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.15s;
    z-index: 5;
}
.ai-wf-clear-btn:hover {
    transform: scale(1.15);
    background: #dc2626;
}
.ai-wf-clear-btn.mini {
    width: 16px;
    height: 16px;
    font-size: 10px;
    top: -4px;
    right: -4px;
}

/* ─── Mi Espacio (Dashboard) Styles ──────────────────────────────── */
.myspace-hero-card {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.12), rgba(121, 40, 202, 0.12));
    border: 1px solid rgba(88, 101, 242, 0.25);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}
.myspace-hero-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}
.myspace-hero-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2.5px solid var(--brand);
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
    object-fit: cover;
    background: var(--bg-secondary);
}
.myspace-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.myspace-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.myspace-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}
.myspace-section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.myspace-section-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin: 3px 0 0 0;
    line-height: 1.4;
}
.myspace-guilds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    max-height: 520px;
    overflow-y: auto;
    padding: 4px 6px 4px 2px;
    scrollbar-width: thin;
}
.myspace-guilds-grid > [style*="grid-column"] { grid-column: 1 / -1; }
.myspace-guild-search {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.myspace-guild-search:focus { outline: none; border-color: var(--brand); }
.myspace-view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.myspace-view-toggle button {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.myspace-view-toggle button + button { border-left: 1px solid var(--border); }
.myspace-view-toggle button.active { background: var(--brand); color: #fff; }
/* Vista en lista: una fila compacta por servidor */
.myspace-guilds-grid.list-mode { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.myspace-guilds-grid.list-mode .myspace-guild-card {
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    gap: 14px;
}
.myspace-guilds-grid.list-mode .myspace-guild-card:hover { transform: none; }
.myspace-guilds-grid.list-mode .myspace-guild-card > div:first-child {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.myspace-guilds-grid.list-mode .myspace-guild-header { flex: 0 1 280px; min-width: 0; }
.myspace-guilds-grid.list-mode .myspace-guild-icon { width: 38px; height: 38px; font-size: 14px; }
.myspace-guilds-grid.list-mode .myspace-guild-stats { margin-top: 0 !important; flex: 1; background: transparent; border: none; padding: 0; }
.myspace-guilds-grid.list-mode .myspace-guild-actions { grid-template-columns: repeat(3, auto); }
.myspace-guilds-grid.list-mode .myspace-guild-actions .btn { padding: 6px 12px; }
.myspace-guild-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}
.myspace-guild-card:hover {
    border-color: rgba(88, 101, 242, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.myspace-guild-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.myspace-guild-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--brand);
}
.myspace-guild-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.myspace-guild-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
.myspace-guild-actions .btn {
    font-size: 11px;
    padding: 6px 4px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
}
.myspace-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}
.myspace-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s ease;
    gap: 10px;
}
.myspace-item-card:hover {
    border-color: var(--brand);
}
.myspace-two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 28px;
}
.myspace-section { min-width: 0; }
.myspace-section-header > div:first-child { flex: 1 1 220px; min-width: 0; }
.myspace-section-header > div:last-child { flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.myspace-section-header .badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.myspace-section-header .badge.badge-warning {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
}
.myspace-section-header .btn { white-space: nowrap; }
.myspace-guild-stats { flex-wrap: wrap; gap: 6px 14px; justify-content: flex-start; }
.myspace-guild-stats > span { white-space: nowrap; }
.myspace-item-card .btn { white-space: nowrap; }
.myspace-role-card {
    border-radius: 12px;
    padding: 18px 22px;
    border: 1px solid var(--border);
}
.myspace-role-dev {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.08));
    border-color: rgba(245, 158, 11, 0.3);
}
.myspace-role-admin {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(109, 40, 217, 0.08));
    border-color: rgba(139, 92, 246, 0.3);
}
.myspace-role-vip {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(88, 101, 242, 0.08));
    border-color: rgba(6, 182, 212, 0.3);
}
.myspace-role-user {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.06));
    border-color: rgba(59, 130, 246, 0.25);
}



/* ─── Image Picker Modal High Z-Index ─── */
#imagePickerModal {
    z-index: 10500 !important;
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

@keyframes pulse-badge-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.7), 0 0 16px rgba(239, 68, 68, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 16px rgba(239, 68, 68, 1), 0 0 28px rgba(239, 68, 68, 0.7);
        transform: scale(1.06);
    }
}

.ai-wf-click-badge {
    position: absolute;
    top: -10px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    animation: pulse-badge-glow 1.8s infinite;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.ai-wf-click-badge.banner-badge {
    top: -11px;
    right: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, #7928ca, #3b82f6);
    box-shadow: 0 0 12px rgba(121, 40, 202, 0.8);
    font-size: 10px;
    padding: 4px 12px;
}

.wireframe-zone-thumb,
.ai-wireframe-thumb-slot {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    border: 2px dashed rgba(88, 101, 242, 0.75);
    background: rgba(88, 101, 242, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.wireframe-zone-thumb:hover,
.ai-wireframe-thumb-slot:hover {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.22);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
    transform: scale(1.03);
}

.wireframe-zone-banner,
.ai-wireframe-banner-slot {
    width: 100%;
    min-height: 125px;
    max-height: 170px;
    border-radius: 10px;
    border: 2px dashed rgba(88, 101, 242, 0.75);
    background: rgba(88, 101, 242, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.wireframe-zone-banner:hover,
.ai-wireframe-banner-slot:hover {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.2);
    box-shadow: 0 0 24px rgba(88, 101, 242, 0.5);
    transform: translateY(-2px);
}

.wireframe-zone-thumb.has-image,
.wireframe-zone-banner.has-image,
.ai-wireframe-thumb-slot.has-image,
.ai-wireframe-banner-slot.has-image {
    border-style: solid;
    border-color: rgba(88, 101, 242, 0.9);
}

.wireframe-zone-thumb.has-image .ai-wf-click-badge,
.wireframe-zone-banner.has-image .ai-wf-click-badge {
    display: none;
}

.ai-wf-overlay-controls {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
    backdrop-filter: blur(2px);
    z-index: 8;
}
.wireframe-zone-thumb.has-image:hover .ai-wf-overlay-controls,
.wireframe-zone-banner.has-image:hover .ai-wf-overlay-controls {
    display: flex;
}

.wireframe-remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    transition: transform 0.15s;
}
.wireframe-remove-btn:hover {
    transform: scale(1.15);
    background: #dc2626;
}

/* Sample Carousel & Chips */
.ai-sample-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 4px;
}
.ai-sample-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}
.ai-sample-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}
.ai-sample-card img {
    width: 100%;
    height: 48px;
    object-fit: cover;
}
.ai-sample-label {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 6px;
    text-align: center;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-sample-carousel.thumbs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ai-sample-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.ai-sample-chip:hover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.15);
    color: #fff;
    transform: scale(1.04);
}

/* ─── Responsive & Wireframe Fixes for Small Screens & Badges ─── */

/* 1. Wireframe Badge & Overflow Fix (no clipping) */
.wireframe-zone-banner,
.ai-wireframe-banner-slot {
    overflow: visible !important;
}

.ai-wf-click-badge.banner-badge {
    position: absolute !important;
    top: -12px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 25 !important;
}

.wireframe-zone-thumb,
.ai-wireframe-thumb-slot {
    overflow: visible !important;
}

.wireframe-zone-thumb .ai-wf-click-badge {
    position: absolute !important;
    top: -10px !important;
    right: -8px !important;
    z-index: 25 !important;
}

/* 2. Thumbnail Overlay Controls (clean fit in 88px box) */
.ai-wf-overlay-controls.thumb-overlay {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.72) !important;
    display: none;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px !important;
    z-index: 20 !important;
    backdrop-filter: blur(2px) !important;
}

.wireframe-zone-thumb.has-image:hover .ai-wf-overlay-controls.thumb-overlay {
    display: flex !important;
}

.wireframe-zone-thumb .wireframe-remove-btn {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 13px !important;
    border-radius: 50% !important;
    z-index: 22 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.wireframe-zone-thumb .btn-wf-change {
    background: #5865f2 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 4px 8px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5) !important;
    transition: transform 0.15s, background 0.15s !important;
    white-space: nowrap !important;
}

.wireframe-zone-thumb .btn-wf-change:hover {
    background: #4752c4 !important;
    transform: scale(1.06) !important;
}

/* 3. Responsive Topbar Rules (prevent button cramming) */
.btn-cluster-files {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.btn-text-short {
    display: none;
}

/* Pantallas medianas (Portátiles 1366px, monitores de 14", ventanas divididas) */
@media (max-width: 1400px) {
    .msgdesigner-topbar {
        padding: 8px 12px !important;
        gap: 6px !important;
    }
    .msgdesigner-actions-left,
    .msgdesigner-actions-right {
        gap: 5px !important;
    }
    .btn-text-full {
        display: none !important;
    }
    .btn-text-short {
        display: inline !important;
    }
    .msgdesigner-topbar .btn-sm {
        padding: 4px 8px !important;
        font-size: 11.5px !important;
    }
    .msg-layout-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }
}

/* Pantallas pequeñas (<= 1150px): Ahorro máximo de espacio */
@media (max-width: 1150px) {
    .msgdesigner-topbar {
        padding: 6px 10px !important;
        gap: 5px !important;
    }
    .btn-text-compact {
        display: none !important;
    }
    .btn-ai-pill {
        display: none !important;
    }
    .msgdesigner-topbar .btn-sm {
        padding: 4px 6px !important;
        font-size: 11px !important;
    }
    .msg-layout-btn {
        padding: 4px 6px !important;
        font-size: 10px !important;
    }
    .topbar-divider {
        display: none !important;
    }
}

/* Pantallas muy compactas (<= 980px): Separación en 2 filas limpias */
@media (max-width: 980px) {
    .msgdesigner-topbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 8px 10px !important;
    }
    .msgdesigner-actions-left {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .msgdesigner-actions-right {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding-top: 6px !important;
    }
}

/* ─── Fix Wireframe Image Bleed & Strict Box Sizing ─── */
.wireframe-zone-banner,
.ai-wireframe-banner-slot {
    width: 100% !important;
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    border-radius: 8px !important;
    border: 2px dashed rgba(88, 101, 242, 0.75) !important;
    background: rgba(88, 101, 242, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.wireframe-zone-banner img,
#wireframeBannerImg {
    width: 100% !important;
    height: 150px !important;
    max-height: 150px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 6px !important;
}

.wireframe-zone-thumb,
.ai-wireframe-thumb-slot {
    width: 88px !important;
    height: 88px !important;
    min-width: 88px !important;
    min-height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
    border-radius: 8px !important;
    border: 2px dashed rgba(88, 101, 242, 0.75) !important;
    background: rgba(88, 101, 242, 0.1) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.wireframe-zone-thumb img,
#wireframeThumbImg {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 6px !important;
}

.ai-wf-overlay-controls.banner-overlay {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 6px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    z-index: 20 !important;
    backdrop-filter: blur(2px) !important;
}

.wireframe-zone-banner.has-image:hover .ai-wf-overlay-controls.banner-overlay {
    display: flex !important;
}

/* ─── Hide Empty Images to Avoid Broken Icon ─── */
#wireframeBannerImg,
#wireframeThumbImg,
.wireframe-zone-banner:not(.has-image) img,
.wireframe-zone-thumb:not(.has-image) img {
    display: none !important;
}

.wireframe-zone-banner.has-image #wireframeBannerImg {
    display: block !important;
    width: 100% !important;
    height: 150px !important;
    max-height: 150px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
}

.wireframe-zone-thumb.has-image #wireframeThumbImg {
    display: block !important;
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
}

.wireframe-zone-banner.has-image #wireframeBannerPreviewText,
.wireframe-zone-thumb.has-image #wireframeThumbPreviewText {
    display: none !important;
}

.wireframe-zone-banner:not(.has-image) #wireframeBannerPreviewText {
    display: flex !important;
}

.wireframe-zone-thumb:not(.has-image) #wireframeThumbPreviewText {
    display: flex !important;
}

/* ─── High-Hierarchy AI Generator Button ─── */
.btn-ai-prominent {
    background: linear-gradient(135deg, #7928ca 0%, #5865f2 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 2px 10px rgba(121, 40, 202, 0.45) !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}
.btn-ai-prominent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(121, 40, 202, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}
.btn-ai-prominent:active {
    transform: translateY(0);
}
.btn-ai-pill {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ai-sparkle-icon {
    font-size: 13px;
    display: inline-block;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.6));
}

/* ─── Añadir Objetos (Discord Interactive Components) ─── */
/* Asegurar que el card de objetos no recorte el menú emergente */
#cardMsgButtons {
    overflow: visible !important;
}
#cardMsgEmbeds .msgdesigner-card-body,
#cardMsgButtons .msgdesigner-card-body {
    overflow: visible !important;
    position: relative;
}

.dropdown-trigger-wrapper {
    position: relative;
    display: inline-block;
    overflow: visible !important;
}

.add-objects-dropdown, .add-objects-dropdown-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    background: #2b2d31;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    z-index: 99999 !important;
    min-width: 280px;
    padding: 6px 0;
    box-sizing: border-box;
    animation: fadeInDropdown 0.15s ease-out;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-obj-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #dbdee1;
    transition: all 0.12s ease;
    user-select: none;
}

.dropdown-obj-item:hover {
    background: rgba(88, 101, 242, 0.22);
    color: #ffffff;
    padding-left: 20px;
}

.dropdown-obj-item:active {
    background: var(--brand);
}

.msg-obj-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.msg-obj-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Discord Live Preview Components */
.discord-btn-primary {
    background: #5865f2 !important;
    color: #fff !important;
}
.discord-btn-primary:hover {
    background: #4752c4 !important;
}

.discord-btn-secondary {
    background: #4e5058 !important;
    color: #fff !important;
}
.discord-btn-secondary:hover {
    background: #6d6f78 !important;
}

.discord-btn-success {
    background: #248046 !important;
    color: #fff !important;
}
.discord-btn-success:hover {
    background: #1a6334 !important;
}

.discord-btn-danger {
    background: #da373c !important;
    color: #fff !important;
}
.discord-btn-danger:hover {
    background: #a12828 !important;
}

.discord-select-menu {
    background: #2b2d31;
    border: 1px solid #1e1f22;
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.discord-select-menu:hover {
    border-color: #3f4147;
    background: #313338;
}


/* ─── Trigger de Selector de Emojis / Iconos para Botones y Opciones ─── */
.btn-emoji-trigger {
    position: absolute;
    right: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    line-height: 1;
    opacity: 0.65;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 2;
}
.btn-emoji-trigger:hover {
    opacity: 1;
    transform: scale(1.22);
}
#compEmojiPickerGrid button:hover {
    background: var(--bg-hover) !important;
    transform: scale(1.15);
    border-color: var(--blurple) !important;
}


/* ─── Cards de la Galería de Iconos de WoW ─── */
.wow-icon-card:hover {
    border-color: #ff73fa !important;
    background: var(--bg-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}


/* ─── Barra Compacta de Flujos y Estudio de Decisiones (Puntos 1, 5 y 6) ─── */
.component-flow-compact-bar {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(88, 101, 242, 0.06);
    border: 1px solid rgba(88, 101, 242, 0.25);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.component-flow-compact-bar:hover {
    border-color: rgba(88, 101, 242, 0.45) !important;
    background: rgba(88, 101, 242, 0.1) !important;
}

[data-theme="light"] .component-flow-compact-bar {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}
[data-theme="light"] .component-flow-compact-bar:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

/* Botones de Configurar Flujo (Alto contraste en Dark y Light) */
.btn-config-flow {
    padding: 3px 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.28), rgba(168, 85, 247, 0.28)) !important;
    border: 1px solid rgba(88, 101, 242, 0.5) !important;
    color: #c7d2fe !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
    border-radius: 5px !important;
    transition: all 0.18s ease !important;
}
.btn-config-flow:hover {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.45), rgba(168, 85, 247, 0.45)) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

[data-theme="light"] .btn-config-flow {
    background: #4f46e5 !important;
    border: 1px solid #4338ca !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3) !important;
}
[data-theme="light"] .btn-config-flow:hover {
    background: #4338ca !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4) !important;
}

.btn-config-flow-opt {
    padding: 2px 8px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    background: rgba(88, 101, 242, 0.18) !important;
    border: 1px solid rgba(88, 101, 242, 0.4) !important;
    color: #93c5fd !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
}
.btn-config-flow-opt:hover {
    background: rgba(88, 101, 242, 0.35) !important;
    color: #ffffff !important;
}

[data-theme="light"] .btn-config-flow-opt {
    background: #e0e7ff !important;
    border: 1px solid #818cf8 !important;
    color: #3730a3 !important;
    font-weight: 800 !important;
}
[data-theme="light"] .btn-config-flow-opt:hover {
    background: #c7d2fe !important;
    color: #1e1b4b !important;
}

.badge-steps-count {
    background: rgba(88, 101, 242, 0.25) !important;
    color: #93c5fd !important;
    font-size: 10px !important;
    padding: 1px 6px !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
}
[data-theme="light"] .badge-steps-count {
    background: #e0e7ff !important;
    color: #3730a3 !important;
    border: 1px solid #c7d2fe !important;
}

/* Píldoras de Acciones (Chips) */
.flow-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

/* Dark Mode Pills */
.flow-pill-wait           { background: rgba(245, 158, 11, 0.18); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.35); }
.flow-pill-check          { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.flow-pill-add_role       { background: rgba(34, 197, 94, 0.18);  color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.35); }
.flow-pill-remove_role    { background: rgba(239, 68, 68, 0.18);  color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.35); }
.flow-pill-toggle_role    { background: rgba(168, 85, 247, 0.18); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.35); }
.flow-pill-send_message   { background: rgba(88, 101, 242, 0.18); color: #5865f2; border: 1px solid rgba(88, 101, 242, 0.35); }
.flow-pill-send_webhook   { background: rgba(6, 182, 212, 0.18);  color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.35); }
.flow-pill-create_thread  { background: rgba(236, 72, 153, 0.18); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.35); }
.flow-pill-set_variable   { background: rgba(20, 184, 166, 0.18); color: #14b8a6; border: 1px solid rgba(20, 184, 166, 0.35); }
.flow-pill-delete_message { background: rgba(220, 38, 38, 0.18);  color: #dc2626; border: 1px solid rgba(220, 38, 38, 0.35); }
.flow-pill-stop           { background: rgba(249, 115, 22, 0.18); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.35); }
.flow-pill-noop           { background: rgba(100, 116, 139, 0.18);color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.35); }
.flow-pill-more           { background: rgba(255, 255, 255, 0.08);color: var(--text-secondary); border: 1px solid var(--border); font-size: 9.5px; font-weight: 800; }

/* Light Mode Pills (Máxima legibilidad y contraste) */
[data-theme="light"] .flow-pill-wait           { background: #fef3c7 !important; color: #b45309 !important; border-color: #fcd34d !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-check          { background: #f3e8ff !important; color: #6b21a8 !important; border-color: #d8b4fe !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-add_role       { background: #dcfce7 !important; color: #15803d !important; border-color: #86efac !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-remove_role    { background: #fee2e2 !important; color: #b91c1c !important; border-color: #fca5a5 !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-toggle_role    { background: #ede9fe !important; color: #5b21b6 !important; border-color: #c4b5fd !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-send_message   { background: #e0e7ff !important; color: #3730a3 !important; border-color: #a5b4fc !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-send_webhook   { background: #ecfeff !important; color: #0e7490 !important; border-color: #67e8f9 !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-create_thread  { background: #fce7f3 !important; color: #be185d !important; border-color: #f9a8d4 !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-set_variable   { background: #fef9c3 !important; color: #854d0e !important; border-color: #fde047 !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-delete_message { background: #f1f5f9 !important; color: #334155 !important; border-color: #cbd5e1 !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-stop           { background: #ffedd5 !important; color: #c2410c !important; border-color: #fdba74 !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-noop           { background: #f1f5f9 !important; color: #334155 !important; border-color: #cbd5e1 !important; font-weight: 800 !important; }
[data-theme="light"] .flow-pill-more           { background: #e2e8f0 !important; color: #0f172a !important; border-color: #cbd5e1 !important; font-weight: 800 !important; }

/* ─── Modal Exclusivo de Flujos: .modal-flow-studio ─── */
.modal-flow-studio {
    max-width: 920px !important;
    width: 95vw !important;
    height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #1e1f22 !important;
    border: 1px solid rgba(88, 101, 242, 0.35) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(88, 101, 242, 0.15) !important;
    animation: flowModalFadeIn 0.2s ease-out;
}
.modal-flow-studio .modal-header {
    padding: 14px 20px !important;
    background: #2b2d31 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}
.modal-flow-studio .modal-header h2 {
    color: #ffffff !important;
}
.modal-flow-studio .modal-header small {
    color: #94a3b8 !important;
}
.modal-flow-studio .modal-body {
    flex: 1 !important;
    padding: 16px 20px !important;
    overflow-y: auto !important;
    background: #1e1f22 !important;
    position: relative !important;
}
.modal-flow-studio .modal-footer {
    padding: 12px 20px !important;
    background: #2b2d31 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.flow-modal-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(168, 85, 247, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(88, 101, 242, 0.4);
}

.flow-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    flex-wrap: wrap;
}

.flow-modal-target-title {
    color: #c7d2fe;
    font-weight: 800;
}

.flow-empty-state {
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    margin-top: 10px;
}

#flowModalCountBadge {
    background: rgba(88, 101, 242, 0.2) !important;
    color: #93c5fd !important;
}

/* Light Theme Adaptations for .modal-flow-studio */
[data-theme="light"] .modal-flow-studio {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 30px rgba(88, 101, 242, 0.08) !important;
}
[data-theme="light"] .modal-flow-studio .modal-header {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .modal-flow-studio .modal-header h2 {
    color: #0f172a !important;
}
[data-theme="light"] .modal-flow-studio .modal-header small {
    color: #475569 !important;
}
[data-theme="light"] .modal-flow-studio .modal-body {
    background: #f8fafc !important;
}
[data-theme="light"] .modal-flow-studio .modal-footer {
    background: #f1f5f9 !important;
    border-top: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .flow-modal-icon-badge {
    background: #e0e7ff !important;
    border-color: #a5b4fc !important;
}
[data-theme="light"] .flow-modal-toolbar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
[data-theme="light"] .flow-modal-target-title {
    color: #4338ca !important;
}
[data-theme="light"] .flow-empty-state {
    background: #ffffff !important;
    border: 2px dashed #cbd5e1 !important;
}
[data-theme="light"] #flowModalCountBadge {
    background: #e0e7ff !important;
    color: #3730a3 !important;
    border: 1px solid #c7d2fe !important;
}

/* Action Cards in Light Mode */
.flow-action-card {
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}
.flow-action-card:hover {
    border-color: rgba(255, 255, 255, 0.22);
}
[data-theme="light"] .flow-action-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .flow-action-card:hover {
    border-color: #94a3b8 !important;
}
[data-theme="light"] .flow-action-card input,
[data-theme="light"] .flow-action-card select {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Rule Pill & Sample Titles */
[data-theme="light"] #actionRowsUsagePill {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}
.ai-sample-title-banner {
    color: #93c5fd;
}
[data-theme="light"] .ai-sample-title-banner {
    color: #1d4ed8 !important;
}
.ai-sample-title-thumb {
    color: #c084fc;
}
[data-theme="light"] .ai-sample-title-thumb {
    color: #7e22ce !important;
}

@keyframes flowModalFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Dropdown Menus en Tema Claro (Punto Menú Desplegable) ─── */
[data-theme="light"] .add-objects-dropdown,
[data-theme="light"] .add-objects-dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .dropdown-menu-title {
    color: #64748b !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .dropdown-obj-item {
    color: #1e293b !important;
    font-weight: 600 !important;
}

[data-theme="light"] .dropdown-obj-item:hover {
    background: #f1f5f9 !important;
    color: #4f46e5 !important;
}


/* ═════════════════════════════════════════════════════════════════════
   SISTEMA DE TÍTULOS, SUBTÍTULOS, VIÑETAS, SANGRÍA Y VISIBILIDAD (LOBOHOOK #7)
   ═════════════════════════════════════════════════════════════════════ */

/* ─── Botones de Formato Rápido en Toolbar ─── */
.md-btn-heading {
    font-weight: 800 !important;
    font-family: inherit;
    color: var(--text-primary);
    padding: 3px 5px !important;
}
.md-btn-heading:hover {
    color: var(--brand) !important;
    background: var(--bg-secondary) !important;
}
.md-btn-list {
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 6px !important;
}
[data-theme="light"] .md-btn-heading {
    color: #1e293b !important;
}
[data-theme="light"] .md-btn-heading:hover {
    color: #2563eb !important;
}

/* ─── Títulos y Subtítulos en Discord (H1, H2, H3, -#) ─── */
.discord-h1 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 8px 0 4px 0;
    color: #f2f3f5;
    letter-spacing: -0.2px;
}
.discord-h1 img,
.discord-h1 .discord-custom-emoji {
    width: 26px !important;
    height: 26px !important;
    vertical-align: -3px !important;
}
.discord-h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin: 6px 0 3px 0;
    color: #f2f3f5;
}
.discord-h2 img,
.discord-h2 .discord-custom-emoji {
    width: 22px !important;
    height: 22px !important;
    vertical-align: -2px !important;
}
.discord-h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin: 5px 0 2px 0;
    color: #f2f3f5;
}
.discord-h3 img,
.discord-h3 .discord-custom-emoji {
    width: 18px !important;
    height: 18px !important;
    vertical-align: -2px !important;
}
.discord-subtext {
    font-size: 11.5px;
    opacity: 0.75;
    display: block;
    margin: 2px 0;
    line-height: 1.3;
    color: #949ba4;
}

/* ─── Viñetas, Listas Numeradas y Sangría en Discord ─── */
.discord-list-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 2px 0;
    line-height: 1.4;
    word-break: break-word;
}
.discord-list-item.bullet-level-1 {
    margin-left: 6px;
}
.discord-list-item.bullet-level-2 {
    margin-left: 24px;
}
.discord-list-item.bullet-level-3 {
    margin-left: 42px;
}
.discord-list-item.ordered {
    margin-left: 6px;
    gap: 6px;
}
.discord-bullet {
    font-size: 13px;
    color: #dbdee1;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
}
.discord-list-item.bullet-level-2 .discord-bullet {
    font-size: 11px;
    color: #949ba4;
}
.discord-num {
    font-size: 13px;
    font-weight: 600;
    color: #dbdee1;
    min-width: 18px;
    flex-shrink: 0;
    user-select: none;
}
.discord-list-content {
    flex: 1;
    min-width: 0;
}

/* ─── Citas y Sangrías de Bloque ─── */
.discord-quote {
    border-left: 3px solid #4e5058;
    padding: 2px 0 2px 10px;
    margin: 6px 0;
    opacity: 0.95;
    line-height: 1.45;
    color: #dbdee1;
}
.discord-quote.discord-blockquote {
    border-left: 4px solid #4e5058;
    padding: 4px 0 4px 12px;
}

/* ─── Previsualizador de Discord en Tema Claro ─── */
.discord-chat-container.light-theme .discord-h1,
.discord-chat-container.light-theme .discord-h2,
.discord-chat-container.light-theme .discord-h3 {
    color: #060607 !important;
}
.discord-chat-container.light-theme .discord-subtext {
    color: #747f8d !important;
}
.discord-chat-container.light-theme .discord-bullet,
.discord-chat-container.light-theme .discord-num {
    color: #4f545c !important;
}
.discord-chat-container.light-theme .discord-quote {
    border-left-color: #c4c9ce !important;
    color: #2e3338 !important;
}

/* ─── Fix de Visibilidad: Configuración Visual del Embed & Wireframe ─── */
.ai-wf-highlight-banner {
    background: linear-gradient(90deg, rgba(88,101,242,0.18), rgba(121,40,202,0.18));
    border: 1px solid rgba(88,101,242,0.4);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-wf-highlight-text {
    color: #e2e8f0;
}
.ai-wf-highlight-text strong {
    color: #ffffff;
}
.ai-wf-badge-interactive {
    background: rgba(88,101,242,0.18);
    color: #93c5fd;
    border: 1px solid rgba(88,101,242,0.4);
}
.ai-sample-showcase-box {
    background: rgba(0,0,0,0.22);
}

/* Modo Claro: Alto Contraste en Configuración Visual */
[data-theme="light"] .ai-embed-media-box {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}
[data-theme="light"] .ai-wf-highlight-banner {
    background: #eef2ff !important;
    border: 1px solid #a5b4fc !important;
}
[data-theme="light"] .ai-wf-highlight-text {
    color: #1e1b4b !important;
}
[data-theme="light"] .ai-wf-highlight-text strong {
    color: #312e81 !important;
}
[data-theme="light"] .ai-wf-highlight-text em {
    color: #4338ca !important;
    font-weight: 600;
}
[data-theme="light"] .ai-wf-badge-interactive {
    background: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #93c5fd !important;
}
[data-theme="light"] .ai-sample-showcase-box {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* ─── Módulo: Decora tu Servidor por Temporada ───────────────────────── */
.seasonal-theme-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    user-select: none;
}
.seasonal-theme-card:hover {
    border-color: #ea580c;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.2);
}
.seasonal-theme-card.selected {
    border-color: #ea580c !important;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.12), rgba(147, 51, 234, 0.12)) !important;
    box-shadow: 0 0 0 2px #ea580c, 0 4px 16px rgba(234, 88, 12, 0.25) !important;
}
.seasonal-theme-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.seasonal-theme-icon {
    font-size: 26px;
    line-height: 1;
}
.seasonal-theme-title {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-primary);
}
.seasonal-theme-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
    flex: 1;
}
.seasonal-theme-emojis {
    display: flex;
    gap: 5px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
    align-items: center;
    width: fit-content;
}
.seasonal-target-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.seasonal-target-card:hover {
    border-color: var(--brand);
    background: rgba(88, 101, 242, 0.08);
}
.seasonal-target-card.active {
    border-color: #ea580c;
    background: rgba(234, 88, 12, 0.12);
    box-shadow: 0 0 0 1px #ea580c;
}
.seasonal-chip-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.seasonal-chip-btn:hover {
    color: var(--text-primary);
    border-color: #ea580c;
}
.seasonal-chip-btn.active {
    background: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.35);
}

.seasonal-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.seasonal-preview-split {
    display: flex;
    align-items: stretch;
    gap: 12px;
}
.seasonal-preview-col {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.seasonal-preview-col.decorated {
    border-color: rgba(234, 88, 12, 0.4);
    background: rgba(234, 88, 12, 0.05);
}
.seasonal-col-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    margin-bottom: 4px;
}
.seasonal-sample-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.seasonal-sample-item {
    font-family: var(--font-code, monospace);
    font-size: 11.5px;
    color: var(--text-primary);
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.seasonal-preview-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
}

/* Modo claro para Decorador Estacional */
[data-theme="light"] .seasonal-theme-card {
    background: #ffffff;
    border-color: #cbd5e1;
}
[data-theme="light"] .seasonal-theme-card.selected {
    background: #fff7ed !important;
    border-color: #ea580c !important;
}
[data-theme="light"] .seasonal-theme-emojis {
    background: #f1f5f9;
}
[data-theme="light"] .seasonal-target-card {
    background: #ffffff;
    border-color: #cbd5e1;
}
[data-theme="light"] .seasonal-target-card.active {
    background: #fff7ed;
    border-color: #ea580c;
}
[data-theme="light"] .seasonal-chip-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}
[data-theme="light"] .seasonal-chip-btn:hover {
    color: #0f172a;
    border-color: #ea580c;
}
[data-theme="light"] .seasonal-preview-col {
    background: #ffffff;
    border-color: #cbd5e1;
}
[data-theme="light"] .seasonal-preview-col.decorated {
    background: #fffbf5;
    border-color: #fb923c;
}
[data-theme="light"] .seasonal-col-header {
    color: #1e293b !important;
    border-bottom-color: #e2e8f0;
}
[data-theme="light"] .seasonal-sample-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
    color: #0f172a !important;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════════════
   LoboHook #8: Centro de Novedades & Desglose de Sistemas en Vista Previa
   ═══════════════════════════════════════════════════════════════════════ */

/* Showcase Hub & Novedad Cards */
.home-showcase-hub {
    position: relative;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-novedad-card {
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.22s ease,
                box-shadow 0.22s ease;
}

.home-novedad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    border-color: rgba(88, 101, 242, 0.65) !important;
}

/* Light theme for Novedades */
[data-theme="light"] .home-showcase-hub {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .home-novedad-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .home-novedad-card:hover {
    background: #ffffff !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08) !important;
    border-color: #3b82f6 !important;
}

/* Systems Breakdown Cards in Preview Modals */
.sys-breakdown-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.sys-breakdown-card:hover {
    border-color: rgba(88, 101, 242, 0.5);
    transform: translateY(-1px);
}

.sys-breakdown-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--card-accent, #5865F2);
}

.sys-condition-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sys-branch-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    line-height: 1.45;
}

.sys-branch-tag {
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.4px;
}

/* Light Theme for Systems Breakdown */
[data-theme="light"] .sys-breakdown-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .sys-breakdown-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .sys-condition-box {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}


/* ==========================================================================
   ⚡ HERO PROMPT BAR: CONSTRUCTOR DE SERVIDORES CON IA (LoboHook #10)
   ========================================================================== */
.home-hero-prompt-card {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-hero-prompt-card:hover {
    border-color: rgba(88, 101, 242, 0.45) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28) !important;
}

.hero-prompt-input-wrapper:focus-within {
    border-color: #5865F2 !important;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25), 0 6px 24px rgba(0, 0, 0, 0.22) !important;
}

.hero-prompt-btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(88, 101, 242, 0.6) !important;
}

.hero-prompt-btn-generate:active {
    transform: translateY(1px);
}

.hero-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.hero-chip-btn:hover {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.5);
    color: var(--brand);
    transform: translateY(-1px);
}

.hero-chip-btn.context-chip {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    animation: heroChipFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-chip-btn.context-chip:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-1px);
}

.hero-chip-btn.selected,
.hero-chip-btn.context-chip.selected {
    background: rgba(88, 101, 242, 0.28);
    border-color: #5865F2;
    color: #fff;
    box-shadow: 0 0 14px rgba(88, 101, 242, 0.45);
    transform: translateY(-1px);
}

@keyframes heroChipFadeIn {
    from { opacity: 0; transform: translateY(4px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-step-item {
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.hero-step-item.active {
    background: rgba(88, 101, 242, 0.2);
    border-color: var(--brand);
    color: #38bdf8;
    box-shadow: 0 0 8px rgba(88, 101, 242, 0.3);
}

.hero-step-item.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

/* Light Theme for Hero Prompt Bar */
[data-theme="light"] .home-hero-prompt-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .hero-prompt-input-wrapper {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .hero-chip-btn {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

[data-theme="light"] .hero-chip-btn:hover {
    background: #e0e7ff !important;
    border-color: #6366f1 !important;
    color: #4338ca !important;
}

[data-theme="light"] .hero-prompt-options {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

[data-theme="light"] .hero-select-compact {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .hero-step-item {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}


/* ═══════════════════════════════════════════════════════════════════
   🌐 SAAS SITE FOOTER (MODERNO, MULTILINGÜE Y RESPONSIVE)
   ═══════════════════════════════════════════════════════════════════ */
.site-saas-footer {
    margin-top: 48px;
    background: linear-gradient(180deg, rgba(20, 24, 33, 0.6) 0%, rgba(13, 16, 23, 0.98) 100%);
    border-top: 1px solid var(--border);
    padding: 48px 36px 48px 36px;
    color: var(--text-secondary);
    position: relative;
    overflow: visible;
    flex-shrink: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

/* ─── Soporte de Footer Global en Todas las Pestañas ─────────── */
#tabPaneStructure,
#tabPaneRoles,
#tabPaneMsgDesigner {
    overflow-y: auto !important;
}

#tabPaneStructure #treeContainer,
#tabPaneRoles .roles-tab-body,
#tabPaneMsgDesigner .msgdesigner-workspace {
    min-height: calc(100vh - 120px);
    flex-shrink: 0;
}

.site-saas-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(88, 101, 242, 0.5), rgba(6, 182, 212, 0.5), transparent);
}

.site-footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.05fr 1fr;
    gap: 28px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer-payments-bar {
    max-width: 1240px;
    margin: 22px auto 0 auto;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-payments-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-primary);
}

.footer-payment-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Modales Legales */
.terms-tab-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.terms-tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.terms-tab-btn.active {
    background: linear-gradient(135deg, #5865F2, #38bdf8);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.35);
}

.terms-pane-content {
    max-height: 440px;
    overflow-y: auto;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.terms-pane-content h3 {
    color: var(--text-primary);
    font-size: 14px;
    margin: 14px 0 6px 0;
}

.terms-pane-content p {
    margin: 0 0 10px 0;
}

.terms-pane-content ul {
    margin: 6px 0 12px 0;
    padding-left: 20px;
}

.terms-pane-content li {
    margin-bottom: 5px;
}

.terms-alert-box {
    background: rgba(88, 101, 242, 0.08);
    border-left: 3px solid #5865F2;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin: 12px 0;
    font-size: 12px;
}

.site-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-footer-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-footer-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(88, 101, 242, 0.4);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.site-footer-title {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.site-footer-badge {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 800;
    color: #5865F2;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.site-footer-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    max-width: 340px;
}

.site-footer-trust-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.trust-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.site-footer-heading {
    margin: 0 0 16px 0;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    position: relative;
}

.site-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.site-footer-links li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.site-footer-links li a:hover {
    color: #38bdf8;
    transform: translateX(3px);
}

.site-footer-bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
}

.site-footer-copy {
    color: var(--text-muted);
}

.site-footer-badges-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 3px 10px;
    border-radius: 12px;
}

.status-dot-green {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
    display: inline-block;
}

.footer-lang-pills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 2px 4px;
    border-radius: 8px;
}

.footer-lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.footer-lang-btn:hover {
    background: rgba(88, 101, 242, 0.2);
    color: var(--text-primary);
}

/* Soporte Tema Claro */
[data-theme="light"] .site-saas-footer {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%) !important;
    border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .site-footer-inner {
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .site-footer-title,
[data-theme="light"] .site-footer-heading {
    color: #0f172a !important;
}

[data-theme="light"] .site-footer-desc,
[data-theme="light"] .site-footer-links li a {
    color: #475569 !important;
}

[data-theme="light"] .site-footer-links li a:hover {
    color: #0284c7 !important;
}

[data-theme="light"] .trust-badge {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

[data-theme="light"] .site-footer-payments-bar {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

[data-theme="light"] .pay-badge {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

[data-theme="light"] .terms-pane-content {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

[data-theme="light"] .terms-pane-content h3 {
    color: #0f172a !important;
}

@media (max-width: 1080px) {
    .site-footer-inner {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .site-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .site-footer-inner {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════════════════════════════
   📚 ESTILOS DIDÁCTICOS Y GRÁFICOS DEL CENTRO DE APRENDIZAJE
   ═══════════════════════════════════════════════════════════════════ */
.help-search-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.help-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 1.5px solid rgba(88, 101, 242, 0.4);
    border-radius: 10px;
    padding: 10px 16px;
    transition: all 0.2s ease;
}

.help-search-input-wrap:focus-within {
    border-color: #5865F2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25);
}

.help-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.help-pills-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.help-pill-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.help-pill-btn:hover {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.4);
    color: var(--text-primary);
}

.help-pill-btn.active {
    background: linear-gradient(135deg, #5865F2, #8b5cf6);
    border-color: #5865F2;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.35);
}

/* Gráfico Pipeline Horizontal (Infografía Superior) */
.didactic-pipeline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
    position: relative;
}

.pipeline-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pipeline-card:hover {
    transform: translateY(-2px);
    border-color: rgba(88, 101, 242, 0.5);
}

.pipeline-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.pipeline-step-1 { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.pipeline-step-2 { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.pipeline-step-3 { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

.pipeline-card h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.pipeline-card p {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Gráfico Didáctico de Comparación Visual (❌ vs ✅) */
.didactic-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 14px 0;
}

.compare-box {
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 12.5px;
    line-height: 1.5;
}

.compare-box.bad {
    background: rgba(239, 68, 68, 0.08);
    border: 1.5px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.compare-box.good {
    background: rgba(16, 185, 129, 0.08);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.compare-box-title {
    font-size: 13.5px;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-box.bad .compare-box-title { color: #ef4444; }
.compare-box.good .compare-box-title { color: #10b981; }

/* Wireframe Visual Didáctico de Embed */
.didactic-embed-wireframe {
    background: #1e1f22;
    border-left: 5px solid #5865F2;
    border-radius: 8px;
    padding: 18px 20px;
    margin: 16px 0;
    font-family: system-ui, -apple-system, sans-serif;
    position: relative;
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

.wireframe-tag {
    display: inline-block;
    background: rgba(88, 101, 242, 0.25);
    border: 1px dashed rgba(88, 101, 242, 0.6);
    color: #c7d2fe;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.wireframe-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.wireframe-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.wireframe-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 14px;
}

.wireframe-fields-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.wireframe-field-col {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 8px 10px;
}

.wireframe-field-col .f-title {
    font-size: 11.5px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 3px;
}

.wireframe-field-col .f-val {
    font-size: 11.5px;
    color: #94a3b8;
}

.wireframe-banner-demo {
    width: 100%;
    height: 75px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1e1b4b, #312e81, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e7ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.wireframe-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Gráfico Didáctico de Flujo Condicional (Check & Wait) */
.didactic-flow-tree {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 16px 0;
}

.flow-step-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flow-arrow-down {
    text-align: center;
    color: var(--brand);
    font-size: 16px;
    margin: 6px 0;
    font-weight: 900;
}

.flow-split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 6px;
}

.flow-branch {
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.45;
}

.flow-branch.pass {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.flow-branch.fail {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

/* Soporte Tema Claro para Gráficos Didácticos */
[data-theme="light"] .didactic-pipeline .pipeline-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .pipeline-card h4 {
    color: #0f172a !important;
}

[data-theme="light"] .pipeline-card p {
    color: #475569 !important;
}

[data-theme="light"] .help-search-container {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

[data-theme="light"] .help-search-input-wrap {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .help-pill-btn {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

[data-theme="light"] .didactic-flow-tree {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

[data-theme="light"] .flow-step-box {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

@media (max-width: 800px) {
    .didactic-pipeline {
        grid-template-columns: 1fr;
    }
    .didactic-compare-grid {
        grid-template-columns: 1fr;
    }
    .wireframe-fields-row {
        grid-template-columns: 1fr;
    }
}

/* ─── Temas de Temporada de la Web (acentos sutiles; la paleta base no cambia) ─── */
.topbar-logo-wrap { position: relative; display: inline-flex; align-items: center; }
.topbar-season-badge { position: absolute; top: -7px; right: -8px; font-size: 13px; line-height: 1; pointer-events: none; display: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
[data-season] .topbar-season-badge { display: block; animation: seasonBadgeFloat 3.2s ease-in-out infinite; }
@keyframes seasonBadgeFloat { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-2px) rotate(6deg); } }
[data-season] #topbar { position: relative; border-bottom-color: var(--brand); }
[data-season] #topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--brand), var(--accent-cyan), var(--brand), transparent); opacity: 0.85; }
[data-season] .topbar-icon { border-color: var(--brand); box-shadow: 0 0 10px var(--brand-glow); }
[data-season] #btnSeasonToggle { border-color: var(--brand); color: var(--text-primary); }
.season-dropdown-menu { width: 200px; max-height: 70vh; overflow-y: auto; }
.season-option.active { background: var(--brand-glow); outline: 1px solid var(--brand); }
.season-option.active:hover { background: var(--brand); }
@media (prefers-reduced-motion: reduce) { [data-season] .topbar-season-badge { animation: none; } }
[data-season="halloween"] { --brand: #ea580c; --brand-hover: #c2410c; --brand-glow: rgba(234,88,12, 0.28); --accent-cyan: #a855f7; }
[data-season="halloween"] .topbar-season-badge::before { content: "🎃"; }
[data-season="terror"] { --brand: #dc2626; --brand-hover: #b91c1c; --brand-glow: rgba(220,38,38, 0.28); --accent-cyan: #7f1d1d; }
[data-season="terror"] .topbar-season-badge::before { content: "🩸"; }
[data-season="christmas"] { --brand: #dc2626; --brand-hover: #b91c1c; --brand-glow: rgba(220,38,38, 0.28); --accent-cyan: #22c55e; }
[data-season="christmas"] .topbar-season-badge::before { content: "🎄"; }
[data-season="summer"] { --brand: #d97706; --brand-hover: #b45309; --brand-glow: rgba(217,119,6, 0.28); --accent-cyan: #06b6d4; }
[data-season="summer"] .topbar-season-badge::before { content: "🏖️"; }
[data-season="spring"] { --brand: #ec4899; --brand-hover: #db2777; --brand-glow: rgba(236,72,153, 0.28); --accent-cyan: #a78bfa; }
[data-season="spring"] .topbar-season-badge::before { content: "🌸"; }
[data-season="autumn"] { --brand: #c2410c; --brand-hover: #9a3412; --brand-glow: rgba(194,65,12, 0.28); --accent-cyan: #d97706; }
[data-season="autumn"] .topbar-season-badge::before { content: "🍂"; }
[data-season="cyberpunk"] { --brand: #c026d3; --brand-hover: #a21caf; --brand-glow: rgba(192,38,211, 0.28); --accent-cyan: #22d3ee; }
[data-season="cyberpunk"] .topbar-season-badge::before { content: "⚡"; }
[data-season="valentines"] { --brand: #e11d48; --brand-hover: #be123c; --brand-glow: rgba(225,29,72, 0.28); --accent-cyan: #fb7185; }
[data-season="valentines"] .topbar-season-badge::before { content: "💘"; }
[data-season="stpatricks"] { --brand: #16a34a; --brand-hover: #15803d; --brand-glow: rgba(22,163,74, 0.28); --accent-cyan: #facc15; }
[data-season="stpatricks"] .topbar-season-badge::before { content: "🍀"; }
[data-season="carnival"] { --brand: #9333ea; --brand-hover: #7e22ce; --brand-glow: rgba(147,51,234, 0.28); --accent-cyan: #f59e0b; }
[data-season="carnival"] .topbar-season-badge::before { content: "🎭"; }
[data-season="lunar_new_year"] { --brand: #dc2626; --brand-hover: #b91c1c; --brand-glow: rgba(220,38,38, 0.28); --accent-cyan: #fbbf24; }
[data-season="lunar_new_year"] .topbar-season-badge::before { content: "🏮"; }

/* ─── Slider del inicio con fondo de temporada (emojis animados, solo con data-season) ─── */
[data-season] .home-slider-container { overflow: hidden; box-shadow: inset 0 0 140px var(--brand-glow), 0 10px 36px rgba(0, 0, 0, 0.45); }
[data-season] .home-slider-container::before { background: linear-gradient(90deg, var(--brand), var(--accent-cyan), var(--brand)); box-shadow: 0 0 15px var(--brand-glow); }
[data-season] .home-slider-track { z-index: 2; }
[data-season] .home-slider-container::after { content: var(--season-rain); position: absolute; left: 0; right: 0; top: -480px; height: 960px; z-index: 1; pointer-events: none; white-space: pre; overflow: hidden; font-size: 22px; line-height: 40px; opacity: 0.28; animation: seasonRain 26s linear infinite; }
@keyframes seasonRain { from { transform: translateY(0); } to { transform: translateY(480px); } }
@media (prefers-reduced-motion: reduce) { [data-season] .home-slider-container::after { animation: none; } }
@media (max-width: 720px) { [data-season] .home-slider-container::after { font-size: 18px; opacity: 0.2; } }
[data-season="halloween"] { --season-rain: "          🦇       🎃         🦇       👻            🎃        🦇\A        🎃        👻                   🎃         🎃       👻                  🎃\A       👻          🦇                   🎃         👻               👻\A           🎃            🦇         👻        👻       👻            🦇                   🦇\A                    🦇               🎃           👻             🎃               👻                     🦇\A                    🦇        🎃                      🦇           🦇          🦇                   🎃        👻\A                🦇                 👻                     👻                    🎃        🦇                     👻        🎃\A               👻                    🦇                  👻                 🎃                    🦇           👻         🦇\A            🦇          👻             🦇                  🦇        🎃\A                  👻              🎃                   👻              👻                   🦇                  🎃\A        🎃          🎃             🎃                     👻           🦇\A      🎃                   👻                 👻                🎃                      👻       🦇\A          🦇       🎃         🦇       👻            🎃        🦇\A        🎃        👻                   🎃         🎃       👻                  🎃\A       👻          🦇                   🎃         👻               👻\A           🎃            🦇         👻        👻       👻            🦇                   🦇\A                    🦇               🎃           👻             🎃               👻                     🦇\A                    🦇        🎃                      🦇           🦇          🦇                   🎃        👻\A                🦇                 👻                     👻                    🎃        🦇                     👻        🎃\A               👻                    🦇                  👻                 🎃                    🦇           👻         🦇\A            🦇          👻             🦇                  🦇        🎃\A                  👻              🎃                   👻              👻                   🦇                  🎃\A        🎃          🎃             🎃                     👻           🦇\A      🎃                   👻                 👻                🎃                      👻       🦇"; }
[data-season="terror"] { --season-rain: "                  🕷️                  🕷️         🕷️                  🩸            🩸            🕷️           🩸\A       🩸      💀          💀         🕷️      🩸            💀\A          💀              🕷️                 🕷️         🩸                     🕷️                     🕷️\A        🩸         💀                💀              🕷️           💀      🩸\A                 🩸      💀               💀        💀              💀                 🩸                 🩸\A                      🕷️             💀            🩸                  💀             🩸                      🕷️                 💀\A      🕷️                     🕷️            💀                 🕷️                 🕷️\A             🩸             🕷️            🕷️            🕷️      🕷️\A                 💀        💀         🕷️            🕷️           🕷️                🩸                  🕷️\A        💀           🩸          🩸          💀                    💀          💀\A                     💀                 🩸          🩸      💀         💀          🕷️            🩸\A              🩸               💀             💀                🕷️                   🩸\A                  🕷️                  🕷️         🕷️                  🩸            🩸            🕷️           🩸\A       🩸      💀          💀         🕷️      🩸            💀\A          💀              🕷️                 🕷️         🩸                     🕷️                     🕷️\A        🩸         💀                💀              🕷️           💀      🩸\A                 🩸      💀               💀        💀              💀                 🩸                 🩸\A                      🕷️             💀            🩸                  💀             🩸                      🕷️                 💀\A      🕷️                     🕷️            💀                 🕷️                 🕷️\A             🩸             🕷️            🕷️            🕷️      🕷️\A                 💀        💀         🕷️            🕷️           🕷️                🩸                  🕷️\A        💀           🩸          🩸          💀                    💀          💀\A                     💀                 🩸          🩸      💀         💀          🕷️            🩸\A              🩸               💀             💀                🕷️                   🩸"; }
[data-season="christmas"] { --season-rain: "                 🎄                      🎄                      ❄️          ⭐                      ❄️\A           ⭐      ❄️           ❄️                     ⭐         ⭐       🎄\A                      ⭐                     ❄️       ❄️            🎄       ❄️                      🎄      ❄️\A                ⭐                      ⭐                      ❄️              🎄                      ⭐                     ⭐\A                      🎄            🎄          🎄         🎄                    🎄\A             🎄        ❄️               ❄️          ⭐                 ❄️\A          🎄             ⭐         🎄                     ❄️             ❄️                   ⭐\A                🎄            🎄                ❄️                 ❄️                ⭐                    🎄\A      🎄                ⭐               ⭐        ❄️             ❄️        🎄              ❄️\A              ❄️                   ⭐              🎄          ⭐                      ⭐\A                ❄️              ❄️           🎄        🎄      ⭐        🎄\A             ❄️              ❄️                    ❄️                ⭐                   🎄\A                 🎄                      🎄                      ❄️          ⭐                      ❄️\A           ⭐      ❄️           ❄️                     ⭐         ⭐       🎄\A                      ⭐                     ❄️       ❄️            🎄       ❄️                      🎄      ❄️\A                ⭐                      ⭐                      ❄️              🎄                      ⭐                     ⭐\A                      🎄            🎄          🎄         🎄                    🎄\A             🎄        ❄️               ❄️          ⭐                 ❄️\A          🎄             ⭐         🎄                     ❄️             ❄️                   ⭐\A                🎄            🎄                ❄️                 ❄️                ⭐                    🎄\A      🎄                ⭐               ⭐        ❄️             ❄️        🎄              ❄️\A              ❄️                   ⭐              🎄          ⭐                      ⭐\A                ❄️              ❄️           🎄        🎄      ⭐        🎄\A             ❄️              ❄️                    ❄️                ⭐                   🎄"; }
[data-season="summer"] { --season-rain: "          ☀️                      🌴             ☀️           🏖️       ☀️            🏖️               🌴\A               🏖️                      🌴           🏖️                 ☀️              ☀️\A      🌴                      🌴            🌴                     ☀️                    ☀️\A                   🌴                     🌴                  🌴               🌴            ☀️                ☀️          🏖️\A       ☀️      ☀️              🏖️           ☀️        🌴                  🌴\A               🌴             🌴               ☀️                    ☀️           🏖️                    ☀️              🏖️\A                ☀️       🏖️            🏖️           ☀️                🏖️        🏖️\A                      🌴            ☀️                      ☀️        🏖️        ☀️                  🌴\A                  ☀️               🏖️             ☀️                      ☀️                  🏖️\A                     ☀️               🌴          ☀️                      🌴                   🌴                      ☀️                      🌴\A      🌴             ☀️      ☀️          🌴                 ☀️                  🏖️       🌴\A             🏖️              ☀️                    ☀️                      🌴        🌴\A          ☀️                      🌴             ☀️           🏖️       ☀️            🏖️               🌴\A               🏖️                      🌴           🏖️                 ☀️              ☀️\A      🌴                      🌴            🌴                     ☀️                    ☀️\A                   🌴                     🌴                  🌴               🌴            ☀️                ☀️          🏖️\A       ☀️      ☀️              🏖️           ☀️        🌴                  🌴\A               🌴             🌴               ☀️                    ☀️           🏖️                    ☀️              🏖️\A                ☀️       🏖️            🏖️           ☀️                🏖️        🏖️\A                      🌴            ☀️                      ☀️        🏖️        ☀️                  🌴\A                  ☀️               🏖️             ☀️                      ☀️                  🏖️\A                     ☀️               🌴          ☀️                      🌴                   🌴                      ☀️                      🌴\A      🌴             ☀️      ☀️          🌴                 ☀️                  🏖️       🌴\A             🏖️              ☀️                    ☀️                      🌴        🌴"; }
[data-season="summer"] .home-slider-container::after { animation-direction: reverse; }
[data-season="spring"] { --season-rain: "        🦋                     🌷        🌷             🦋            🌸                    🌷                  🌸\A               🌸            🌸          🌷              🦋               🦋          🌸\A       🌷              🦋         🦋            🦋                     🌷                      🌷\A                    🌷         🦋            🌷        🌷      🌷                    🌸\A                    🌷                  🌸            🌸        🌸                      🌷                 🌸                      🌷\A                 🌸                     🌷                  🌸           🌸                     🦋\A                  🌷          🌷                 🌷                🌸                🌸                🌷\A         🌸      🦋               🌷                 🌸                  🌷        🌷\A              🌸              🌸       🦋               🦋          🌸              🌷\A                🌸                 🌷      🦋                  🦋            🦋        🌸                   🌷\A          🦋               🌷       🦋          🌸                     🌷                🌷               🌷\A              🌷             🌷                     🦋                  🌸           🦋           🌸            🦋\A        🦋                     🌷        🌷             🦋            🌸                    🌷                  🌸\A               🌸            🌸          🌷              🦋               🦋          🌸\A       🌷              🦋         🦋            🦋                     🌷                      🌷\A                    🌷         🦋            🌷        🌷      🌷                    🌸\A                    🌷                  🌸            🌸        🌸                      🌷                 🌸                      🌷\A                 🌸                     🌷                  🌸           🌸                     🦋\A                  🌷          🌷                 🌷                🌸                🌸                🌷\A         🌸      🦋               🌷                 🌸                  🌷        🌷\A              🌸              🌸       🦋               🦋          🌸              🌷\A                🌸                 🌷      🦋                  🦋            🦋        🌸                   🌷\A          🦋               🌷       🦋          🌸                     🌷                🌷               🌷\A              🌷             🌷                     🦋                  🌸           🦋           🌸            🦋"; }
[data-season="autumn"] { --season-rain: "             🍁                🍁                   🍂            🍂        🍂                🍂\A             🍁              🍂      🍁                  🍁                      🍂                  🍁\A       🍁              🍁          🍂        🍁             🍁                  🍁\A               🍂          🍂                   🍁                     🍂        🍁                      🍁\A             🍂             🍂          🍂                    🍂       🍂          🍂\A       🍁          🍁                      🍁         🍂        🍁                      🍂                  🍁\A      🍂               🍁              🍁             🍁                      🍂\A             🍂                   🍁       🍂            🍁                   🍂              🍂                   🍁\A                     🍂                🍁                 🍁            🍂               🍂\A                     🍂               🍂             🍁             🍁               🍂\A                     🍂             🍁                   🍂          🍁       🍂      🍂                   🍂\A       🍂                  🍁                🍂        🍂                🍂           🍁       🍁\A             🍁                🍁                   🍂            🍂        🍂                🍂\A             🍁              🍂      🍁                  🍁                      🍂                  🍁\A       🍁              🍁          🍂        🍁             🍁                  🍁\A               🍂          🍂                   🍁                     🍂        🍁                      🍁\A             🍂             🍂          🍂                    🍂       🍂          🍂\A       🍁          🍁                      🍁         🍂        🍁                      🍂                  🍁\A      🍂               🍁              🍁             🍁                      🍂\A             🍂                   🍁       🍂            🍁                   🍂              🍂                   🍁\A                     🍂                🍁                 🍁            🍂               🍂\A                     🍂               🍂             🍁             🍁               🍂\A                     🍂             🍁                   🍂          🍁       🍂      🍂                   🍂\A       🍂                  🍁                🍂        🍂                🍂           🍁       🍁"; }
[data-season="cyberpunk"] { --season-rain: "                  💠                💠           ⚡      ⚡              ⚡                 💠         ⚡\A                 💠                   ⚡       💠            💠                    ⚡                💠\A                     ⚡                   ⚡                  ⚡                  ⚡                    ⚡       💠            ⚡\A                💠              💠       💠                💠               ⚡        ⚡             ⚡\A                    💠              💠                     ⚡                     ⚡      💠          ⚡\A                💠                 ⚡                      ⚡                  ⚡             💠        ⚡\A                ⚡                   ⚡        💠        ⚡         💠                     💠\A             ⚡                   💠             ⚡               💠              💠\A              💠            💠             ⚡             ⚡          💠            💠\A                  💠             ⚡         💠       ⚡      💠\A                    💠       💠             ⚡       ⚡            ⚡\A                      ⚡                    💠      ⚡                 ⚡       💠                ⚡\A                  💠                💠           ⚡      ⚡              ⚡                 💠         ⚡\A                 💠                   ⚡       💠            💠                    ⚡                💠\A                     ⚡                   ⚡                  ⚡                  ⚡                    ⚡       💠            ⚡\A                💠              💠       💠                💠               ⚡        ⚡             ⚡\A                    💠              💠                     ⚡                     ⚡      💠          ⚡\A                💠                 ⚡                      ⚡                  ⚡             💠        ⚡\A                ⚡                   ⚡        💠        ⚡         💠                     💠\A             ⚡                   💠             ⚡               💠              💠\A              💠            💠             ⚡             ⚡          💠            💠\A                  💠             ⚡         💠       ⚡      💠\A                    💠       💠             ⚡       ⚡            ⚡\A                      ⚡                    💠      ⚡                 ⚡       💠                ⚡"; }
[data-season="cyberpunk"] .home-slider-container::after { animation-direction: reverse; }
[data-season="valentines"] { --season-rain: "            💕       💘      💕                   💕           💕\A            💘                     💕        💕         💕          💘\A           💕              💕               💕                   💘               💕                   💕      💕\A            💕                  💘      💕           💕         💘                  💕                    💘\A      💘          💕        💕                      💘          💕\A           💘        💘                  💕            💕          💘                     💕\A                  💘           💘                  💘                     💘            💘\A                      💘                  💕         💘             💘       💘                💘\A                    💕                   💕             💕                  💕                    💕           💘\A                     💕             💕                    💘                     💕         💘\A                 💕                 💘                    💘       💘        💕\A                      💘       💕          💘        💘            💘                     💕           💘\A            💕       💘      💕                   💕           💕\A            💘                     💕        💕         💕          💘\A           💕              💕               💕                   💘               💕                   💕      💕\A            💕                  💘      💕           💕         💘                  💕                    💘\A      💘          💕        💕                      💘          💕\A           💘        💘                  💕            💕          💘                     💕\A                  💘           💘                  💘                     💘            💘\A                      💘                  💕         💘             💘       💘                💘\A                    💕                   💕             💕                  💕                    💕           💘\A                     💕             💕                    💘                     💕         💘\A                 💕                 💘                    💘       💘        💕\A                      💘       💕          💘        💘            💘                     💕           💘"; }
[data-season="valentines"] .home-slider-container::after { animation-direction: reverse; }
[data-season="stpatricks"] { --season-rain: "                 🍀           🍀              🍀          🍀                      🍀\A              🍀                🍀       🍀           🍀           🍀\A                🍀           🍀         🍀                 🍀                      🍀              🍀                 🍀\A                 🍀                 🍀        🍀             🍀       🍀                      🍀\A                🍀       🍀          🍀                   🍀                      🍀       🍀\A             🍀      🍀      🍀               🍀                      🍀             🍀\A               🍀            🍀                     🍀          🍀             🍀                    🍀        🍀\A              🍀              🍀       🍀                    🍀             🍀      🍀       🍀\A           🍀           🍀         🍀            🍀                   🍀                      🍀\A           🍀        🍀       🍀      🍀                   🍀        🍀           🍀\A              🍀       🍀                🍀       🍀                   🍀\A            🍀                      🍀           🍀             🍀           🍀            🍀\A                 🍀           🍀              🍀          🍀                      🍀\A              🍀                🍀       🍀           🍀           🍀\A                🍀           🍀         🍀                 🍀                      🍀              🍀                 🍀\A                 🍀                 🍀        🍀             🍀       🍀                      🍀\A                🍀       🍀          🍀                   🍀                      🍀       🍀\A             🍀      🍀      🍀               🍀                      🍀             🍀\A               🍀            🍀                     🍀          🍀             🍀                    🍀        🍀\A              🍀              🍀       🍀                    🍀             🍀      🍀       🍀\A           🍀           🍀         🍀            🍀                   🍀                      🍀\A           🍀        🍀       🍀      🍀                   🍀        🍀           🍀\A              🍀       🍀                🍀       🍀                   🍀\A            🍀                      🍀           🍀             🍀           🍀            🍀"; }
[data-season="carnival"] { --season-rain: "             🎉                     🎉                      🎭      🎉             🎉            🎉\A        🎭          🎭      🎭         🎭                 🎭      🎭       🎭\A       🎭       🎭                 🎭        🎉         🎭            🎭         🎭\A        🎉                     🎭          🎭            🎉                🎉\A              🎭                 🎉               🎭                 🎉                      🎉               🎭\A      🎉                      🎭                 🎉       🎭        🎉           🎉\A                      🎭               🎭      🎉                     🎭                     🎭\A                 🎉           🎉            🎭                     🎭         🎭                     🎭\A                🎉         🎉                  🎭                   🎭                 🎭               🎉                   🎭\A             🎉          🎭                 🎉                      🎭                    🎉           🎉\A              🎭          🎉                    🎭                      🎭              🎉          🎭\A                🎉           🎭                🎭              🎭           🎭\A             🎉                     🎉                      🎭      🎉             🎉            🎉\A        🎭          🎭      🎭         🎭                 🎭      🎭       🎭\A       🎭       🎭                 🎭        🎉         🎭            🎭         🎭\A        🎉                     🎭          🎭            🎉                🎉\A              🎭                 🎉               🎭                 🎉                      🎉               🎭\A      🎉                      🎭                 🎉       🎭        🎉           🎉\A                      🎭               🎭      🎉                     🎭                     🎭\A                 🎉           🎉            🎭                     🎭         🎭                     🎭\A                🎉         🎉                  🎭                   🎭                 🎭               🎉                   🎭\A             🎉          🎭                 🎉                      🎭                    🎉           🎉\A              🎭          🎉                    🎭                      🎭              🎉          🎭\A                🎉           🎭                🎭              🎭           🎭"; }
[data-season="lunar_new_year"] { --season-rain: "                  🏮          🧧               🧧              🏮         🏮\A            🧧                    🏮      🧧                   🏮                      🧧                    🏮\A              🧧      🏮                   🧧             🏮           🏮\A                   🧧              🏮                   🏮                  🏮              🧧                     🧧\A                   🏮                🏮                  🧧         🏮              🏮\A            🧧         🧧            🧧                      🏮                 🧧\A                    🏮           🧧                      🏮                 🏮              🧧                  🧧\A      🏮                   🧧                 🧧         🏮               🧧\A             🧧                    🏮           🏮        🏮                     🏮          🧧                   🧧\A          🧧                 🏮              🧧              🧧           🧧      🧧\A             🧧                🧧                     🧧        🧧          🧧                  🏮\A                🏮                      🧧      🏮            🏮               🧧\A                  🏮          🧧               🧧              🏮         🏮\A            🧧                    🏮      🧧                   🏮                      🧧                    🏮\A              🧧      🏮                   🧧             🏮           🏮\A                   🧧              🏮                   🏮                  🏮              🧧                     🧧\A                   🏮                🏮                  🧧         🏮              🏮\A            🧧         🧧            🧧                      🏮                 🧧\A                    🏮           🧧                      🏮                 🏮              🧧                  🧧\A      🏮                   🧧                 🧧         🏮               🧧\A             🧧                    🏮           🏮        🏮                     🏮          🧧                   🧧\A          🧧                 🏮              🧧              🧧           🧧      🧧\A             🧧                🧧                     🧧        🧧          🧧                  🏮\A                🏮                      🧧      🏮            🏮               🧧"; }
[data-season="lunar_new_year"] .home-slider-container::after { animation-direction: reverse; }

/* ─── Temas de temporada en modo claro: más contraste sobre fondo blanco (los colores base están pensados para el oscuro) ─── */
[data-theme="light"][data-season="halloween"]  { --brand: #c2410c; --brand-hover: #9a3412; --accent-cyan: #7e22ce; }
[data-theme="light"][data-season="christmas"]  { --accent-cyan: #15803d; }
[data-theme="light"][data-season="summer"]     { --brand: #b45309; --brand-hover: #92400e; --accent-cyan: #0e7490; }
[data-theme="light"][data-season="spring"]     { --brand: #db2777; --brand-hover: #be185d; --accent-cyan: #7c3aed; }
[data-theme="light"][data-season="autumn"]     { --accent-cyan: #b45309; }
[data-theme="light"][data-season="cyberpunk"]  { --accent-cyan: #0e7490; }
[data-theme="light"][data-season="valentines"] { --accent-cyan: #e11d48; }
[data-theme="light"][data-season="stpatricks"] { --brand: #15803d; --brand-hover: #166534; --accent-cyan: #a16207; }
[data-theme="light"][data-season="carnival"]   { --accent-cyan: #b45309; }
[data-theme="light"][data-season="lunar_new_year"] { --accent-cyan: #b45309; }
[data-theme="light"][data-season] .home-slider-container { box-shadow: inset 0 0 120px var(--brand-glow), 0 8px 24px rgba(15, 23, 42, 0.12); }
[data-theme="light"][data-season] .home-slider-container::after { opacity: 0.2; }

/* ─── Diseño adaptable (spec 013): solo ≤1024 px; el escritorio no cambia ─── */
.narrow-editor-notice { position: fixed; left: 12px; right: 12px; bottom: 36px; z-index: 3000; padding: 10px 14px; border-radius: 10px; background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); font-size: 13px; text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }
@media (max-width: 1024px) {
    #topbar { padding: 0 12px; }
    .topbar-right { gap: 6px; }
    .topbar-left { flex-shrink: 0; }
    .topbar-right { min-width: 0; overflow-x: auto; scrollbar-width: none; }
    .topbar-right::-webkit-scrollbar { display: none; }
    .topbar-right > * { flex-shrink: 0; }
    /* La barra desliza en horizontal y recortaba los desplegables (idioma, temporada): se anclan a la pantalla */
    .lang-dropdown-menu { position: fixed; top: 52px; right: 8px; }
    .main-tabs-header { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
    .main-tabs-header::-webkit-scrollbar { display: none; }
    .main-tab-btn { flex-shrink: 0; white-space: nowrap; padding: 0 12px; }
    .home-slide { padding: 0 64px; }
    .mkt-templates-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
}
@media (max-width: 720px) {
    body { height: 100dvh; }
    #app { height: calc(100dvh - 50px - 46px - 24px); max-height: calc(100dvh - 50px - 46px - 24px); position: relative; }
    #topbar { gap: 8px; }
    .topbar-left { flex-shrink: 0; gap: 8px; min-width: 0; }
    .topbar-left h1 small { display: none; }
    .topbar-right { min-width: 0; overflow-x: auto; scrollbar-width: none; flex-shrink: 1; }
    .topbar-right::-webkit-scrollbar { display: none; }
    .topbar-right > * { flex-shrink: 0; }
    #themeToggleLabel { display: none; }
    #statusbar { padding: 0 10px; gap: 8px; overflow: hidden; white-space: nowrap; }
    #statusText { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    #statsText { flex-shrink: 0; }
    .main-tabs-header { padding: 0 8px; gap: 2px; }
    .main-tab-btn { padding: 0 10px; font-size: 12px; }
    /* Paneles laterales: superpuestos a pantalla completa, sin empujar el contenido */
    #toolbox:not(.collapsed), #properties:not(.collapsed) { position: absolute; top: 0; bottom: 0; z-index: 900; width: min(86vw, 320px); box-shadow: 0 0 40px rgba(0, 0, 0, 0.55); }
    #toolbox:not(.collapsed) { left: 0; }
    #properties:not(.collapsed) { right: 0; }
    #app:not(.toolbox-collapsed)::before, #app:not(.properties-collapsed)::before { content: ""; position: absolute; inset: 0; z-index: 800; background: rgba(0, 0, 0, 0.45); }
    /* Inicio */
    .home-slider-track { height: auto; min-height: 560px; }
    .home-slide { padding: 24px 48px; align-items: flex-start; overflow-y: auto; }
    .home-slider-arrow { width: 32px; height: 32px; }
    .home-slider-arrow.prev { left: 6px; }
    .home-slider-arrow.next { right: 6px; }
    .home-slide-title { font-size: 26px; line-height: 1.15; }
    .home-slide-subtitle { font-size: 14px; }
    .home-slide-actions { flex-wrap: wrap; gap: 8px; }
    .home-slide-actions .btn { flex: 1 1 100%; }

    /* Páginas de lectura: nada puede ser más ancho que la pantalla */
    #tabPanePricing, #tabPaneTemplates, #tabPaneHelp, #tabPaneHome { overflow-x: hidden; }
    #tabPaneTemplates, #tabPaneHelp, #tabPaneMySpace, #tabPaneBotModules { padding: 16px 14px 32px 14px !important; }
    #tabPaneMySpace { overflow-x: hidden; }
    .myspace-two-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
    .myspace-section { padding: 16px 14px; }
    .myspace-hero-card { padding: 16px; margin-bottom: 16px; }
    .myspace-hero-actions { width: 100%; }
    .myspace-item-card { flex-wrap: wrap; }
    .myspace-guilds-grid { grid-template-columns: minmax(0, 1fr); }
    .myspace-guilds-grid.list-mode .myspace-guild-card { flex-direction: column; align-items: stretch; }
    .myspace-guilds-grid.list-mode .myspace-guild-card > div:first-child { flex-direction: column; align-items: stretch; gap: 8px; }
    .myspace-guilds-grid.list-mode .myspace-guild-actions { grid-template-columns: 1fr 1fr 1fr; }
    .myspace-item-card > div:last-child { width: 100%; justify-content: flex-end; }
    #tabPanePricing > *, #tabPaneTemplates > *, #tabPaneHelp > *, .pricing-page, .pricing-page > * { max-width: 100%; min-width: 0; box-sizing: border-box; }
    .mkt-hero-banner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .mkt-hero-text { width: 100%; }
    .mkt-controls-card, .mkt-controls-top { flex-wrap: wrap; gap: 8px; }
    .mkt-search-wrapper { min-width: 0; width: 100%; flex: 1 1 100%; }
    .mkt-vip-header-btn { white-space: normal; }
    .mkt-templates-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    #tabPaneHelp *, #tabPaneTemplates * { min-width: 0; overflow-wrap: anywhere; }
    #tabPaneHelp > div, #tabPaneTemplates > div { width: 100%; }
    .mkt-search-input { width: 100%; min-width: 0; }
    .mkt-categories-bar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
    .mkt-cat-pill { flex-shrink: 0; white-space: nowrap; }
}

/* ─── Editores en móvil (spec 016): solo ≤720 px; escritorio y tablet no cambian ─── */
.msg-layout-mobile-label, .roles-back-bar { display: none; }
@media (max-width: 720px) {
    /* Mensajes: una columna, pestañas Editar | Vista previa */
    .msgdesigner-topbar { flex-wrap: nowrap !important; overflow-x: auto; gap: 8px !important; padding: 8px 10px !important; scrollbar-width: none; }
    .msgdesigner-topbar::-webkit-scrollbar { display: none; }
    .msgdesigner-topbar > *, .msgdesigner-actions-left, .msgdesigner-actions-right { flex-shrink: 0; flex-wrap: nowrap !important; }
    .msgdesigner-actions-left > *, .msgdesigner-actions-right > * { flex-shrink: 0; }
    #layoutBtnSplit { display: none !important; }
    .msg-layout-btn .btn-text-full { display: none !important; }
    .msg-layout-btn .msg-layout-mobile-label { display: inline; }
    .msg-layout-btn { min-height: 36px; padding: 4px 12px; }
    .msgdesigner-workspace { flex-direction: column; }
    .msgdesigner-editor { padding: 14px 12px 100px 12px; border-right: none; max-width: 100% !important; width: 100%; box-sizing: border-box; }
    .msgdesigner-preview-pane { padding: 14px 10px 100px 10px; width: 100%; box-sizing: border-box; }
    .msgdesigner-editor [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .msgdesigner-editor input, .msgdesigner-editor select, .msgdesigner-editor textarea { max-width: 100%; box-sizing: border-box; min-height: 38px; }
    .msgdesigner-editor .prop-row, .msgdesigner-editor .prop-field-row { flex-wrap: wrap; }
    /* Roles: lista → detalle en dos pasos */
    .roles-tab-body { flex-direction: column; }
    .roles-tab-sidebar { width: 100%; border-right: none; flex-shrink: 1; }
    .roles-tab-detail { padding: 12px 12px 80px 12px; }
    .roles-tab-body:not(.roles-detail-open) .roles-tab-detail { display: none; }
    .roles-tab-body.roles-detail-open .roles-tab-sidebar { display: none; }
    .roles-tab-body.roles-detail-open .roles-back-bar { display: block; padding: 8px 12px 0 12px; background: var(--bg-primary); }
    .roles-tab-detail [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .role-card-item { padding: 10px 12px; }
    /* Servidor y Roles: botones de acción siempre visibles y táctiles */
    .cat-actions, .ch-actions, .tree-msg .ch-actions, .tree-thread .ch-actions { opacity: 1; }
    .tree-cat-header, .tree-channel, .tree-msg, .tree-thread { flex-wrap: wrap; }
    .cat-actions, .ch-actions, .role-actions { flex: 0 0 auto; justify-content: flex-end; gap: 2px; margin-left: auto; }
    .action-btn { min-width: 38px; min-height: 38px; font-size: 14px; }
    .panel-header { flex-wrap: wrap; gap: 8px; height: auto; min-height: 40px; }
    .server-name-input { max-width: 100%; }
    /* Modales a todo el ancho */
    .modal { max-width: 96vw !important; width: 96vw; max-height: 92dvh; overflow-y: auto; }
}

/* ─── Iconos, Bot PRO y Plantillas en móvil (spec 017): solo ≤720 px; escritorio y tablet no cambian ─── */
@media (max-width: 720px) {
    /* Mensajes: sin la franja de color del embed, más espacio útil */
    .msg-embed-box { border-left-width: 1px !important; border-left-color: var(--border) !important; padding: 12px 10px; }
    .msgdesigner-editor { padding: 10px 8px 100px 8px; gap: 12px; }
    /* Editor de Iconos: una columna, lienzo arriba y controles debajo */
    #iconEditorModal .modal { width: 100vw !important; max-width: 100vw !important; max-height: 100dvh !important; height: 100dvh; border-radius: 0 !important; }
    #iconEditorModal .modal-header { padding: 10px 14px !important; }
    #iconEditorModal .modal-body { flex-direction: column !important; gap: 16px !important; padding: 12px !important; }
    #iconEditorModal .modal-body > div { flex: none !important; width: 100%; min-width: 0; box-sizing: border-box; }
    #iconEditorModal .modal-body > div:first-child > div:first-child { width: min(100%, 340px) !important; height: auto !important; aspect-ratio: 1 / 1; }
    #iconEditorCanvas { touch-action: none; }
    #iconEditorModal [style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
    #iconEditorModal .btn { min-height: 40px; }
    #iconEditorModal .modal-footer { flex-wrap: wrap !important; padding: 10px 12px !important; }
    #iconEditorModal .modal-footer > div { flex-wrap: wrap; width: 100%; justify-content: center; }
    #iconEditorModal .modal-footer .btn { flex: 1 1 auto; white-space: normal; }
    #iconEditorModal .icon-res-btn { min-height: 34px; padding: 4px 10px !important; }
    #iconEditorModal input[type="range"] { min-height: 32px; }
    /* Bot PRO */
    #tabPaneBotModules > div[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; }
    #tabPaneBotModules .btn { min-height: 42px; max-width: 100% !important; width: 100%; box-sizing: border-box; white-space: normal; }
    #tabPaneBotModules .home-stat-card { padding: 14px !important; min-width: 0; }
    #tabPaneBotModules .home-stat-card > div:first-child { flex-wrap: wrap; gap: 6px; }
    #tabPaneBotModules .panel-header { flex-direction: column; align-items: flex-start; }
    #tabPaneBotModules input, #tabPaneBotModules select { min-height: 40px; max-width: 100%; box-sizing: border-box; }
    #botModulesModal [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
    #botModulesModal input, #botModulesModal select, #botModulesModal .btn { min-height: 40px; max-width: 100%; box-sizing: border-box; }
    /* Plantillas: catálogo, vista previa y plantillas de mensaje */
    #templatePreviewModal .modal, #templateActionChoiceModal .modal, #saveMsgTemplateModal .modal, #loadMsgTemplateModal .modal { width: 96vw !important; max-width: 96vw !important; max-height: 92dvh; overflow-y: auto; box-sizing: border-box; }
    #templateActionChoiceModal .modal { padding: 16px 14px !important; }
    #templatePreviewModal .modal-header { padding: 12px 14px !important; }
    #templatePreviewModal .modal-body { padding: 12px 14px !important; }
    #templatePreviewModal .modal-body > div:first-child { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    #templatePreviewModal .modal-body > div:first-child .btn { flex-shrink: 0; white-space: nowrap; min-height: 40px; }
    #previewModalPaneStructure { grid-template-columns: minmax(0, 1fr) !important; max-height: none !important; }
    #previewModalPaneStructure > div { height: auto !important; }
    #previewModalChannelsTree, #previewModalRolesList { max-height: 260px; flex: none !important; }
    #previewModalPaneSystems { max-height: none !important; }
    #previewModalSystemsList { grid-template-columns: minmax(0, 1fr) !important; }
    #templatePreviewModal .modal-footer { padding: 12px 14px !important; }
    #templatePreviewModal .modal-footer > div { width: 100%; }
    #templatePreviewModal .modal-footer .btn { flex: 1 1 100%; min-height: 42px; }
    #saveMsgTemplateModal .modal-footer .btn, #loadMsgTemplateModal .modal-footer .btn { min-height: 42px; }
    #newMsgTemplateName { min-height: 42px; box-sizing: border-box; }
    #msgTemplatesList { grid-template-columns: minmax(0, 1fr) !important; }
    #tabPaneTemplates .btn { min-height: 40px; }
    .mkt-controls-card > *, .mkt-controls-top, .mkt-categories-bar { width: 100%; max-width: 100%; box-sizing: border-box; }
}

/* ─── Página «Planes y Precios» (spec 006) ─── */
.pricing-page { max-width: 1180px; margin: 0 auto; }
.pricing-hero { margin-bottom: 18px; }
.pricing-section-title { font-size: 15px; font-weight: 800; color: var(--text-primary); margin: 26px 0 10px; }
.plan-card { position: relative; }
.plan-popular-badge { align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: 0.4px; color: #1f1300; background: linear-gradient(135deg, #fbbf24, #f59e0b); padding: 2px 8px; border-radius: 10px; margin-bottom: 8px; }
.plan-current-badge { align-self: flex-start; font-size: 10px; font-weight: 800; color: #052e16; background: #34d399; padding: 2px 8px; border-radius: 10px; margin-bottom: 8px; }
.plan-card.is-current { outline: 2px solid #34d399; outline-offset: -2px; }
.plans-compare-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.plans-compare { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 680px; }
.plans-compare th, .plans-compare td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: center; color: var(--text-secondary); }
.plans-compare th:first-child, .plans-compare td:first-child { text-align: left; font-weight: 700; color: var(--text-primary); position: sticky; left: 0; background: var(--bg-secondary); }
.plans-compare thead th { color: var(--text-primary); font-weight: 800; background: var(--bg-tertiary); }
.plans-compare tr:last-child td { border-bottom: none; }
.plans-compare .is-current-col { background: rgba(52, 211, 153, 0.10); }
.pricing-faq-item { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); margin-bottom: 8px; }
.pricing-faq-item summary { cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.pricing-faq-answer { padding: 0 14px 12px; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
@media (max-width: 720px) { #tabPanePricing { padding: 18px 14px 40px 14px !important; } }



/* ─── Puerta de entrada y «Ruta de entrada» (specs 019-022) ─────── */
.gate-card { margin-top: 14px; border: 1px solid rgba(88,101,242,0.45); border-radius: 12px; background: linear-gradient(180deg, rgba(88,101,242,0.10), rgba(88,101,242,0.03)); padding: 14px; display: grid; gap: 14px; }
.gate-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gate-card-icon { font-size: 28px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: rgba(88,101,242,0.22); flex: none; }
.gate-card-headtext { flex: 1; min-width: 180px; }
.gate-card-title { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.gate-card-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; }
.gate-help-btn { border: 1px solid rgba(88,101,242,0.5); background: rgba(88,101,242,0.15); color: #c9cdfb; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.gate-help-btn:hover { background: rgba(88,101,242,0.3); }
.gate-section { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: rgba(0,0,0,0.18); border: 1px solid var(--border-subtle); }
.gate-section-title { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.gate-hint { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.gate-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.gate-check input { margin-top: 3px; flex: none; }
.gate-check strong { display: block; font-size: 13px; color: var(--text-primary); font-weight: 700; text-transform: none; letter-spacing: 0; }
.gate-check small { display: block; font-size: 11.5px; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.gate-roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.gate-roles-grid label, .gate-rules-label { display: grid; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.gate-roles-grid input, .gate-rules-label textarea { width: 100%; box-sizing: border-box; }

.gate-route { border: 2px solid #f59e0b; border-radius: 12px; background: linear-gradient(135deg, rgba(245,158,11,0.16), rgba(168,85,247,0.10)); box-shadow: 0 0 0 4px rgba(245,158,11,0.08); overflow: hidden; }
.gate-route-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 800; color: var(--text-primary); background: linear-gradient(90deg, rgba(245,158,11,0.30), rgba(168,85,247,0.22)); }
.gate-route-summary::-webkit-details-marker { display: none; }
.gate-route-summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.gate-route:not([open]) .gate-route-summary::after { transform: rotate(-90deg); }
.gate-route-icon { font-size: 22px; }
.gate-route-name { font-size: 15px; }
.gate-vip-badge { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.gate-route-count { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.gate-route-body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.gate-locked { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: rgba(245,158,11,0.14); font-size: 12px; color: var(--text-primary); }
.gate-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gate-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: var(--step-color, #64748b); }
.gate-chip.missing { background: transparent; color: #f59e0b; border: 1px dashed #f59e0b; }
.gate-arrow { color: var(--text-muted); font-weight: 800; }
.gate-steps { display: grid; gap: 10px; }
.gate-step { --step-color: #64748b; display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,0.22); border: 1px solid var(--border-subtle); border-left: 5px solid var(--step-color); }
.gate-step[data-kind="verification"] { --step-color: #16a34a; }
.gate-step[data-kind="welcome"] { --step-color: #5865f2; }
.gate-step[data-kind="rules"] { --step-color: #e67e22; }
.gate-step[data-kind="roles"] { --step-color: #9b59b6; }
.gate-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.gate-step-num { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--step-color); color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.gate-step-name { font-size: 13px; font-weight: 800; color: var(--text-primary); }
.gate-step-found { color: var(--text-secondary); }
.gate-step input[type="text"], .gate-step textarea, .gate-step select { max-width: 100%; box-sizing: border-box; }
.gate-step > input[type="text"], .gate-step textarea { width: 100%; }
.gate-look { border-top: 1px dashed var(--border-subtle); padding-top: 6px; }
.gate-look summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.gate-look-grid { display: grid; gap: 8px; margin-top: 8px; }
.gate-look-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.gate-look-row input[type="text"] { flex: 1; min-width: 160px; }
.gate-look-row input[type="color"] { width: 38px; height: 28px; padding: 0; border: none; background: none; cursor: pointer; }
.gate-embed-preview { border-left: 4px solid var(--embed-color, #5865f2); background: #2b2d31; border-radius: 4px; padding: 8px 10px; color: #dbdee1; font-size: 12px; display: grid; gap: 3px; }
.gate-embed-preview .t { font-weight: 800; color: #fff; font-size: 13px; }
.gate-embed-preview .d { color: #b5bac1; }
.gate-embed-preview .f { font-size: 10.5px; color: #949ba4; margin-top: 3px; }
.gate-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gate-status { font-size: 12px; line-height: 1.45; color: var(--text-secondary); }
@media (max-width: 600px) {
    .gate-card { padding: 10px; }
    .gate-route-summary { padding: 10px; }
    .gate-route-body { padding: 10px; }
    .gate-look-row input[type="text"] { min-width: 120px; }
}

[data-theme="light"] .gate-section { background: rgba(15,23,42,0.04); }
[data-theme="light"] .gate-step { background: rgba(15,23,42,0.045); }
[data-theme="light"] .gate-help-btn { color: #3b4cc9; }
[data-theme="light"] .gate-card-title, [data-theme="light"] .gate-step-name, [data-theme="light"] .gate-check strong, [data-theme="light"] .gate-route-summary { color: #0f172a; }

/* Aviso amarillo de compatibilidad: legible también en tema claro */
[data-theme="light"] .compat-notice { color: #7c2d12 !important; background: rgba(245,158,11,0.16) !important; border-color: rgba(180,83,9,0.45) !important; }
[data-theme="light"] .compat-notice-title { color: #9a3412 !important; }

/* Ayuda de la puerta de entrada (spec 023) */
.help-sub { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 8px 0; background: var(--bg-primary); overflow: hidden; }
.help-sub > summary { cursor: pointer; padding: 11px 14px; font-weight: 800; font-size: 13px; color: var(--text-primary); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.help-sub > summary::-webkit-details-marker { display: none; }
.help-sub > summary::after { content: "▾"; transition: transform .2s; color: var(--text-muted); }
.help-sub[open] > summary::after { transform: rotate(180deg); }
.help-sub[open] > summary { border-bottom: 1px solid var(--border); background: var(--bg-tertiary); }
.help-sub-body { padding: 12px 14px; }
.help-sub-body > :last-child { margin-bottom: 0; }
.help-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 14px; }
.help-chip { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; color: var(--text-primary); }
.help-chip-arrow { color: var(--text-muted); font-size: 12px; }
.help-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12.5px; }
.help-table th, .help-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.help-table th { background: var(--bg-tertiary); color: var(--text-primary); }
.help-pre { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; white-space: pre-wrap; margin: 6px 0 0; }
@media (max-width: 600px) { .help-table { display: block; overflow-x: auto; } }

/* Inicio: fila «Lo último» (spec 024) */
.home-latest-hub { margin-bottom: 32px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; }
.home-latest-head h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--text-primary); }
.home-latest-head p { margin: 0 0 16px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.home-latest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.home-latest-card { background: var(--bg-tertiary); border: 1px solid var(--border); border-top: 3px solid var(--lc); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.home-latest-top { display: flex; justify-content: space-between; align-items: center; }
.home-latest-icon { font-size: 24px; }
.home-latest-vip { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 4px; color: #f59e0b; background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.4); }
.home-latest-card h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--text-primary); }
.home-latest-card p { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-secondary); flex: 1; }
.home-latest-btn { margin-top: 6px; width: 100%; font-weight: 700; border: 1px solid var(--lc); color: var(--text-primary); background: var(--bg-secondary); }

/* Aviso de tiempo al dar acceso a los miembros actuales (spec 025 B) */
.gate-time-notice { margin: -2px 0 8px 28px; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; color: #fcd34d; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); }
[data-theme="light"] .gate-time-notice { color: #92400e; }

/* ─── Índice de la Ayuda (spec 041) ─── */
.help-index { margin: 0 0 22px 0; padding: 18px 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; }
.help-index-title { margin: 0 0 4px 0; font-size: 17px; font-weight: 800; color: var(--text-primary); }
.help-index-sub { margin: 0 0 14px 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.help-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.help-index-group { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.help-index-group h4 { margin: 0 0 8px 0; font-size: 13.5px; font-weight: 800; color: var(--text-primary); cursor: pointer; }
.help-index-group h4:hover { color: var(--brand); }
.help-index-group ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.help-index-group a { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; font-size: 12.5px; line-height: 1.4; color: var(--text-secondary); text-decoration: none; }
.help-index-group a:hover { background: var(--brand-glow); color: var(--text-primary); }
.help-index-num { flex: 0 0 auto; min-width: 20px; font-weight: 800; color: var(--brand); font-family: var(--font-mono); font-size: 11.5px; }
.help-guide-title[data-num]::before { content: attr(data-num) ". "; color: var(--brand); }

/* Editor de iconos: el pie de acciones no debe salirse del modal */
.ie-footer-group .btn { white-space: nowrap; }
