:root {
    --bg-dark: #090d16;
    --bg-panel: #111827;
    --bg-panel-hover: #1e293b;
    --border-color: #1f293d;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #38bdf8;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
}

/* 1. Master Header Toolbar (50px) */
.app-header {
    height: 50px;
    background: #0d1117;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 20;
    flex-shrink: 0;
}

.header-left-zone {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

/* Botón Volver a la Web Principal */
.btn-return-home {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #c9d1d9;
    padding: 0.38rem 0.8rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    user-select: none;
}

.btn-return-home .logo-circle {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(88, 166, 255, 0.15);
    overflow: hidden;
    padding: 2px;
}

.btn-return-home .logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.btn-return-home:hover {
    background: rgba(88, 166, 255, 0.12);
    border-color: rgba(88, 166, 255, 0.45);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.2);
    transform: translateX(-2px);
}

.brand-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.brand-titles {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-titles h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
}

.version-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Master Telemetría Bar */
.telemetry-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.7);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.telemetry-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 0.4rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.telemetry-chip:last-child {
    border-right: none;
}

.chip-label {
    font-size: 0.55rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.chip-value {
    font-size: 0.82rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
}

.chip-value.highlight {
    color: #10b981;
}

.chip-value.highlight-cyan {
    color: #00e5ff !important;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

/* Header Right Zone (Presets & Export) */
.header-right-zone {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

/* 2. Workbench Sub-toolbar (Herramientas de Lienzo - 42px) */
.workbench-subbar {
    height: 42px;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    z-index: 15;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.workbench-subbar::-webkit-scrollbar {
    display: none;
}

.subbar-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.subbar-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    white-space: nowrap;
}

.subbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.2rem;
    flex-shrink: 0;
}

.subbar-spacer {
    flex-grow: 1;
}

.cad-select {
    background-color: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.38rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: var(--font-sans);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cad-select:focus, .cad-select:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.color-picker {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.workbench-subbar input[type="range"] {
    width: 80px;
    height: 4px;
    cursor: pointer;
    accent-color: #38bdf8;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    white-space: nowrap;
}

/* 3. Sistema de Botones Top-Tier Premium */
.btn {
    padding: 0.42rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    user-select: none;
    line-height: 1.2;
}

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

/* Primario: Azul Eléctrico Pro */
.btn-primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: 1px solid #38bdf8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #1d4ed8);
    border-color: #7dd3fc;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}

/* Secundario: Obsidian Dark Glass */
.btn-secondary {
    background: rgba(30, 41, 59, 0.65);
    color: #e2e8f0;
    border: 1px solid rgba(71, 85, 105, 0.5);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #ffffff;
    border-color: rgba(148, 163, 184, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

/* Artistas: Oro Ámbar Vintage Destacado */
.btn-artist {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid #fbbf24;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.35);
}

.btn-artist:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #fde68a;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

/* Foto HD: Cyan Esmeralda Studio */
.btn-photo {
    background: linear-gradient(135deg, #0891b2, #0284c7);
    color: #ffffff;
    border: 1px solid #38bdf8;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.btn-photo:hover {
    background: linear-gradient(135deg, #0e7490, #0369a1);
    border-color: #7dd3fc;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.5);
    transform: translateY(-1px);
}

/* Danger / Reset: Crimson Ruby */
.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* ==========================================================================
   Menú Maestro Desplegable - The Guitar Notebook (Estudio & Rigs)
   ========================================================================== */
.master-menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-master-menu {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    color: #f1f5f9;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 0.42rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-master-menu:hover,
.btn-master-menu.active {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.95), rgba(30, 41, 59, 0.95));
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.btn-master-menu .chevron-indicator {
    transition: transform 0.2s ease;
    opacity: 0.75;
}

.btn-master-menu.active .chevron-indicator {
    transform: rotate(180deg);
    opacity: 1;
}

.master-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 295px;
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 10px;
    padding: 0.65rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9), 0 0 20px rgba(56, 189, 248, 0.15);
    z-index: 600;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    animation: masterDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes masterDropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.menu-brand-header {
    display: flex;
    flex-direction: column;
    padding: 0.35rem 0.5rem 0.45rem;
}

.menu-brand-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #f1f5f9;
}

.menu-brand-sub {
    font-size: 0.62rem;
    color: #38bdf8;
    font-weight: 600;
}

.dropdown-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.3rem 0;
}

.dropdown-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: #64748b;
    padding: 0.35rem 0.5rem 0.15rem;
    text-transform: uppercase;
}

.dropdown-menu-item {
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
}

.dropdown-menu-item:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #ffffff;
    transform: translateX(2px);
}

.dropdown-menu-item .item-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
}

.dropdown-menu-item .item-text-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dropdown-menu-item .item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.25;
}

.dropdown-menu-item:hover .item-title {
    color: #38bdf8;
}

.dropdown-menu-item .item-desc {
    font-size: 0.66rem;
    color: #94a3b8;
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu-item .item-pill {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.dropdown-menu-item .item-pill.amber {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.dropdown-menu-item .item-pill.green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.dropdown-menu-item .item-pill.gold {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.5);
}

.dropdown-user-session-card {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.dropdown-user-session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-user-email-text {
    font-size: 0.72rem;
    color: #cbd5e1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-user-actions-row {
    display: flex;
    gap: 0.35rem;
}

.dropdown-mini-btn {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: #94a3b8;
    border-radius: 4px;
    padding: 0.28rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.dropdown-mini-btn:hover {
    color: #ffffff;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.dropdown-mini-btn.danger:hover {
    color: #fca5a5;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}


/* 4. Área de Trabajo Principal */
.workbench {
    display: flex;
    flex: 1;
    height: calc(100vh - 92px);
    overflow: hidden;
}

/* Barra Lateral / Catálogo */
.sidebar {
    width: 320px;
    min-width: 320px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 20;
}

.sidebar.collapsed {
    margin-left: -320px;
    pointer-events: none;
}

.sidebar-header {
    padding: 0.85rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
}

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

/* Buscador */
.search-box-container {
    padding: 0.5rem 1rem 0.25rem;
}

.cad-search-input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.65rem;
    border-radius: 5px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.cad-search-input:focus {
    border-color: var(--accent-blue);
}

/* Filtros de Categorías */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem 1rem 0.5rem;
}

.cat-pill {
    background-color: var(--bg-dark);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cat-pill:hover {
    color: #ffffff;
    border-color: var(--text-muted);
}

.cat-pill.active {
    background-color: rgba(56, 189, 248, 0.2);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    font-weight: 600;
}

/* Leyenda de Jacks */
.jacks-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.8rem;
    background: rgba(15, 23, 42, 0.7);
    margin: 0.25rem 1rem 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

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

.in-dot { background-color: #10b981; box-shadow: 0 0 5px #10b981; }
.out-dot { background-color: #0284c7; box-shadow: 0 0 5px #0284c7; }
.pwr-dot { background-color: #f59e0b; box-shadow: 0 0 5px #f59e0b; }
.fx-dot { background-color: #a855f7; box-shadow: 0 0 5px #a855f7; }

.formula-banner {
    background: rgba(15, 23, 42, 0.8);
    margin: 0.25rem 1rem 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 5px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.formula-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-family: var(--font-mono);
}

.formula-banner code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-primary);
}

.catalog-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pedal-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pedal-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pedal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.pedal-card-header strong {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-family: var(--font-mono);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: var(--bg-panel-hover);
    color: var(--text-muted);
}

.badge.distortion { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.badge.overdrive { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge.reverb { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.badge.delay { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge.fuzz { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge.modulation { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.badge.dynamics { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.badge.preamp { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
.badge.amplifier { background: rgba(202, 138, 4, 0.25); color: #fef08a; border: 1px solid rgba(202, 138, 4, 0.4); }
.badge.cabinet { background: rgba(100, 116, 139, 0.25); color: #e2e8f0; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge.filter, .badge.wah { background: rgba(192, 132, 252, 0.2); color: #c084fc; }
.badge.tuner { background: rgba(148, 163, 184, 0.2); color: #f8fafc; }
.badge.multieffect { background: rgba(56, 189, 248, 0.25); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); font-weight: 700; }
.badge.switcher { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); font-weight: 700; }
.badge.board { background: rgba(148, 163, 184, 0.2); color: #38bdf8; }
.badge.midi, .badge.controller { background: rgba(168, 85, 247, 0.25); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); font-weight: 700; }
.badge.rack, .badge.rack_case { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); font-weight: 700; }
.badge.power_supply, .badge.power { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); font-weight: 700; }
.badge.wireless { background: rgba(6, 182, 212, 0.25); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); font-weight: 700; }
.badge.utility, .badge.3_series { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }

.pedal-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.4rem;
}

.pedal-card-specs {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Viewport Canvas */
.canvas-viewport {
    flex: 1;
    position: relative;
    background-color: #0f172a;
    overflow: hidden;
}

#cad-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Barra Flotante de Herramientas y Navegación CAD (Studio Glassmorphism) */
.canvas-nav-dock {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 0.3rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 5;
}

.dock-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    user-select: none;
}

.dock-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.dock-btn.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.dock-btn.highlight-dock {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.6);
}

.dock-btn.highlight-dock:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #ffffff;
}

.dock-btn.icon-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.dock-separator {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 0.2rem;
}

.canvas-hints {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    display: flex;
    gap: 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    pointer-events: none;
}

.hint-item kbd {
    background: var(--bg-panel-hover);
    color: var(--accent-blue);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   HUD Flotante de Acciones Rápidas de Pedal (Quick HUD)
   ========================================================================== */
.pedal-quick-hud {
    position: absolute;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.2);
    transform: translate(-50%, -100%);
    pointer-events: auto;
    user-select: none;
    animation: fadeInHud 0.15s ease-out;
}

@keyframes fadeInHud {
    from { opacity: 0; transform: translate(-50%, -90%); }
    to { opacity: 1; transform: translate(-50%, -100%); }
}

.hud-drag-pill {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hud-btn {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.hud-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

.hud-btn-danger {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
    color: #f87171;
}

.hud-btn-danger:hover {
    background: #dc2626;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   Menú Contextual Avanzado de Equipos (Right-Click Context Menu)
   ========================================================================== */
.gear-context-menu {
    position: fixed;
    z-index: 300;
    width: 320px;
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.85), 0 0 25px rgba(56, 189, 248, 0.15);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    user-select: none;
    animation: scaleInMenu 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.gear-context-menu::-webkit-scrollbar {
    width: 5px;
}

.gear-context-menu::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}

.gear-context-menu::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 4px;
}

@keyframes scaleInMenu {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.ctx-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.ctx-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.ctx-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctx-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ctx-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.ctx-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ctx-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ctx-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

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

.ctx-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.4px;
}

.ctx-button-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
}

.ctx-btn-rot {
    background: var(--bg-panel-hover);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.3rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ctx-btn-rot:hover, .ctx-btn-rot.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.ctx-swatches {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
    align-items: center;
}

.ctx-swatch, .ctx-led-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.ctx-swatch:hover, .ctx-led-swatch:hover {
    transform: scale(1.15);
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.ctx-swatch.active, .ctx-led-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 12px var(--accent-blue);
    transform: scale(1.1);
}

.ctx-swatch-reset {
    grid-column: span 2;
    background: var(--bg-panel-hover);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ctx-swatch-reset:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
    border-color: var(--accent-blue);
}

.ctx-color-input {
    width: 28px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.ctx-action-list {
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ctx-action-item {
    background: transparent;
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
}

.ctx-action-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
    transform: translateX(2px);
}

.ctx-action-item .action-icon {
    font-size: 0.95rem;
}

.ctx-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

.ctx-delete-btn {
    width: 100%;
    background: rgba(220, 38, 38, 0.18);
    border: 1.5px solid rgba(220, 38, 38, 0.6);
    color: #f87171;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
}

.ctx-delete-btn:hover {
    background: #dc2626;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.55);
    transform: translateY(-1px);
}

/* ==========================================================================
   Modal Dialog para Pedalboard a Medida (Custom Pedalboard Builder)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.15s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: rgba(15, 23, 42, 0.98);
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    border-radius: 14px;
    width: 440px;
    max-width: 92vw;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.95), 0 0 35px rgba(56, 189, 248, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleInModal 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleInModal {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.7);
    background: rgba(30, 41, 59, 0.6);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.3);
}

.modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cad-input {
    background: rgba(2, 6, 23, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.85);
    border-radius: 6px;
    color: #f8fafc;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}

.cad-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(51, 65, 85, 0.7);
    background: rgba(30, 41, 59, 0.4);
}

/* Controles de Escala de Texto y Botón de Rigs de Artistas */
.text-scale-control input[type="range"] {
    width: 85px;
    cursor: pointer;
}

.btn-artist {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.btn-artist:hover {
    background: linear-gradient(135deg, #fbbf24, #b45309);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

/* Modal de Rigs de Artistas */
.artist-modal-card {
    width: 880px;
    max-width: 95vw;
    max-height: 88vh;
}

.artist-modal-body {
    overflow-y: auto;
    max-height: calc(88vh - 80px);
    padding: 1.25rem;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

/* Modal de Rigs de Artistas Legendarios - The Guitar Notebook Style */
.artist-modal-card {
    width: 960px;
    max-width: 96vw;
    max-height: 90vh;
    background: #0d1117;
    border: 1px solid #30363d;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.artist-header-titles {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.artist-header-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    color: #58a6ff;
    letter-spacing: 0.12em;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
}

.artist-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #21262d;
    margin-bottom: 0.85rem;
}

.artist-toolbar .modal-desc {
    margin-bottom: 0;
    flex: 1;
    min-width: 280px;
    font-size: 0.82rem;
    color: #8b949e;
    line-height: 1.4;
}

.artist-admin-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.artist-admin-actions .btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-family: var(--font-mono, monospace);
    border: 1px solid #30363d;
    background: #161b22;
    color: #c9d1d9;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.artist-admin-actions .btn-sm:hover {
    background: #21262d;
    border-color: #58a6ff;
    color: #ffffff;
}

.artist-search-bar {
    margin-bottom: 1rem;
}

.artist-search-bar input {
    width: 100%;
    background: #161b22;
    border: 1px solid #30363d;
    color: #f0f6fc;
    font-size: 0.85rem;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
}

.artist-search-bar input:focus {
    border-color: #58a6ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 1rem;
}

.artist-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.85rem;
    transition: all 0.2s ease;
}

.artist-card:hover {
    border-color: #58a6ff;
    background: #1c2128;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.artist-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.artist-card-monogram {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    background: #0d1117;
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.4);
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.artist-card-titles h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f0f6fc;
    margin: 0;
    line-height: 1.25;
}

.artist-card-titles .artist-sub {
    font-size: 0.72rem;
    color: #8b949e;
    font-family: var(--font-mono, monospace);
    margin-top: 0.2rem;
    display: block;
}

.artist-card-desc {
    font-size: 0.78rem;
    color: #8b949e;
    line-height: 1.45;
}

.artist-card-gear {
    font-size: 0.7rem;
    color: #58a6ff;
    background: #0d1117;
    padding: 0.45rem 0.65rem;
    border-radius: 5px;
    border: 1px solid #21262d;
    font-family: var(--font-mono, monospace);
    line-height: 1.4;
}

.artist-load-btn {
    width: 100%;
    background: #21262d;
    color: #f0f6fc;
    border: 1px solid #30363d;
    font-weight: 600;
    padding: 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font-mono, monospace);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
}

.artist-load-btn:hover {
    background: #58a6ff;
    color: #0d1117;
    border-color: #58a6ff;
}

/* Modal de Rigs Guardados por el Usuario */
.user-rigs-card {
    width: 680px;
    max-width: 95vw;
    max-height: 85vh;
}

.user-rigs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    gap: 1rem;
}

.toolbar-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.user-rigs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 52vh;
    overflow-y: auto;
    padding-top: 0.75rem;
}

.user-rig-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    transition: all 0.15s ease;
}

.user-rig-item:hover {
    border-color: #38bdf8;
    background: rgba(30, 41, 59, 0.8);
}

.user-rig-info h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f8fafc;
}

.user-rig-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: var(--font-mono);
    display: flex;
    gap: 0.85rem;
    margin-top: 0.2rem;
}

.user-rig-actions {
    display: flex;
    gap: 0.5rem;
}

.cad-textarea {
    resize: vertical;
    min-height: 70px;
}

/* ==========================================================================
   Calibración Interactiva de Knobs y Presets de Artistas en Context Menu
   ========================================================================== */
.ctx-knobs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(8, 12, 22, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 0.6rem;
}

.ctx-switches-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    padding: 0.6rem;
}

.ctx-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ctx-switch-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ctx-switch-name {
    font-size: 0.74rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #f8fafc;
}

.ctx-switch-btn-group {
    display: inline-flex;
    background: #0f172a;
    border-radius: 6px;
    padding: 2px;
    border: 1px solid #334155;
    gap: 2px;
}

.ctx-switch-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.70rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 4px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ctx-switch-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.ctx-switch-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.5);
}

.hud-btn-accent {
    background: rgba(2, 132, 199, 0.22) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    color: #38bdf8 !important;
}

.hud-btn-accent:hover {
    background: rgba(2, 132, 199, 0.45) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}

.ctx-knob-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ctx-knob-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95px;
    flex-shrink: 0;
}

.ctx-knob-name {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65px;
}

.ctx-knob-num {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.12);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    min-width: 25px;
    text-align: right;
}

.ctx-knob-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    background: #1e293b;
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ctx-knob-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #38bdf8;
    border: 2px solid #0f172a;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.ctx-knob-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #00E5FF;
}

.ctx-presets-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.ctx-presets-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.ctx-presets-list::-webkit-scrollbar {
    width: 4px;
}

.ctx-presets-list::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.4);
    border-radius: 4px;
}

.ctx-preset-btn {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f8fafc;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
}

.ctx-preset-btn:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #fbbf24;
    transform: translateX(2px);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.ctx-preset-btn .preset-tag {
    font-size: 0.68rem;
    color: #94a3b8;
    font-family: var(--font-mono);
}

/* Tooltip Flotante de Alta Definición al Girar Knobs en Canvas */
.knob-hud-tooltip {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    background: rgba(8, 12, 22, 0.95);
    backdrop-filter: blur(8px);
    border: 1.5px solid #00E5FF;
    color: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 229, 255, 0.35);
    white-space: nowrap;
    transform: translate(-50%, -130%);
    animation: fadeInTooltip 0.1s ease-out;
}

@keyframes fadeInTooltip {
    from { opacity: 0; transform: translate(-50%, -110%); }
    to { opacity: 1; transform: translate(-50%, -130%); }
}

/* ========================================================
   ESTILOS PARA SISTEMA DE CUENTAS, FULL PRO Y DOCK TOOLS
   ======================================================== */

.header-v-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0.25rem;
}

.btn-pro-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.btn-pro-badge:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.5));
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.btn-pro-badge.active-pro {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
    border-color: #10b981;
    color: #34d399;
}

.user-auth-container {
    position: relative;
}

.btn-auth {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.35);
    color: #f0f6fc;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.38rem 0.8rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-auth:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: #58a6ff;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.25);
}

.user-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 250px;
    background: #161b22;
    border: 1px solid rgba(139, 148, 158, 0.25);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
    padding: 0.6rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    animation: fadeInDropdown 0.15s ease-out;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
}

.user-email-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #f0f6fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.plan-badge-pill {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.plan-badge-pill.free {
    background: rgba(100, 116, 139, 0.25);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.4);
}

.plan-badge-pill.pro {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.4));
    color: #fbbf24;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.35rem 0;
}

.dropdown-item {
    background: none;
    border: none;
    color: #c9d1d9;
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    text-align: left;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.12s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.dropdown-item.highlight-item {
    color: #fbbf24;
    font-weight: 600;
}

.dropdown-item.highlight-item:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #fef08a;
}

.dropdown-item.danger-item {
    color: #f87171;
}

.dropdown-item.danger-item:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

button:disabled, .btn:disabled, .dock-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.auth-card {
    max-width: 420px;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(13, 17, 23, 0.6);
    padding: 0.25rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: #8b949e;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-tab.active {
    background: #21262d;
    color: #f0f6fc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-google-auth {
    width: 100%;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-google-auth:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: #64748b;
    font-size: 0.72rem;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 0.75rem;
}

.btn-auth-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.65rem;
    font-weight: 700;
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.auth-footnote {
    font-size: 0.68rem;
    color: #8b949e;
    text-align: center;
    margin-top: 1rem;
    line-height: 1.4;
}

.upgrade-card {
    max-width: 680px;
}

.pro-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pro-sparkle {
    color: #fbbf24;
    font-size: 1.2rem;
}

.upgrade-lead {
    color: #c9d1d9;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.pro-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.pro-feature-card {
    background: rgba(22, 27, 34, 0.85);
    border: 1px solid rgba(88, 166, 255, 0.18);
    border-radius: 8px;
    padding: 0.85rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.pro-feature-card .feat-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.pro-feature-card h4 {
    font-size: 0.8rem;
    color: #f0f6fc;
    margin-bottom: 0.25rem;
    font-family: var(--font-sans);
    font-weight: 600;
}

.pro-feature-card p {
    font-size: 0.72rem;
    color: #8b949e;
    line-height: 1.4;
    margin: 0;
}

.upgrade-pricing-box {
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95), rgba(13, 17, 23, 0.95));
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.15);
}

.pricing-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0d1117;
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.pricing-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.2rem;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.pricing-amount .currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fbbf24;
}

.pricing-amount .price-val {
    font-size: 2.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #ffffff;
}

.pricing-amount .period {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: 0.35rem;
}

.pricing-sub {
    font-size: 0.75rem;
    color: #8b949e;
    display: block;
    margin-bottom: 1rem;
}

.btn-buy-pro {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0d1117;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-buy-pro:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(245, 158, 11, 0.6);
}

.license-activation-box {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.license-prompt {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.5rem;
}

.license-inputs {
    display: flex;
    gap: 0.5rem;
    max-width: 440px;
    margin: 0 auto;
}

.license-inputs input {
    flex: 1;
    font-size: 0.8rem;
    text-align: center;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   OPTIMIZACIONES RESPONSIVAS & TÁCTILES PARA TABLETS Y SMARTPHONES (CAD MOBILE)
   ========================================================================== */

/* 1. Componentes del Drawer y Botones Flotantes */
.sidebar-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0.45rem;
    border-radius: 5px;
    line-height: 1;
    transition: all 0.18s ease;
}

.sidebar-close-btn:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 490;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-catalog-toggle-btn {
    display: none;
    position: absolute;
    bottom: 1.25rem;
    left: 1rem;
    z-index: 40;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: 1px solid #38bdf8;
    padding: 0.65rem 1.15rem;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45), 0 0 10px rgba(56, 189, 248, 0.3);
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-catalog-toggle-btn:active {
    transform: scale(0.96);
    background: linear-gradient(135deg, #0369a1, #1d4ed8);
}

.mobile-only-btn {
    display: none;
}

.mobile-actions-dropdown {
    position: absolute;
    top: 52px;
    right: 0.75rem;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.85), 0 0 15px rgba(56, 189, 248, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 600;
    min-width: 200px;
    animation: scaleInDropdown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleInDropdown {
    from { opacity: 0; transform: scale(0.95) translateY(-5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.mobile-act-item {
    background: transparent;
    border: none;
    color: #e2e8f0;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-act-item:hover, .mobile-act-item:active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.mobile-act-item.highlight {
    color: #00e5ff;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.2rem;
    padding-top: 0.65rem;
}

/* ==========================================================================
   2. Media Queries: Adaptabilidad Fluida por Resolución
   ========================================================================== */

/* Tablets en Landscape y Pantallas Medianas (<= 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 295px;
    }

    .telemetry-chip:nth-child(n+4) {
        display: none; /* Ocultar peso y fps en tablets para liberar espacio */
    }

    .btn-return-home span:last-child {
        display: none; /* Mantener flecha y logo TGN */
    }

    .workbench-subbar {
        padding: 0 0.5rem;
        gap: 0.45rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .workbench-subbar::-webkit-scrollbar {
        display: none;
    }

    .artist-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets en Portrait y Móviles (<= 900px) */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        width: min(340px, 86vw);
        z-index: 500;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 6px 0 30px rgba(0, 0, 0, 0.85);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: block;
    }

    .mobile-catalog-toggle-btn {
        display: inline-flex;
    }

    .telemetry-chip:nth-child(n+3) {
        display: none; /* Mostrar corriente y boards */
    }

    .canvas-nav-dock {
        top: auto;
        bottom: 1.25rem;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100vw - 130px);
        overflow-x: auto;
        padding: 0.25rem 0.4rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .canvas-nav-dock::-webkit-scrollbar {
        display: none;
    }

    .canvas-nav-dock .dock-btn span {
        display: none; /* Solo iconos para máxima compacidad y alcance */
    }

    .canvas-nav-dock .dock-btn {
        padding: 0.4rem 0.45rem;
        min-width: 34px;
        min-height: 34px;
        justify-content: center;
    }
}

/* Teléfonos y Pantallas Compactas (<= 768px) */
@media (max-width: 768px) {
    .app-header {
        padding: 0 0.5rem;
        gap: 0.4rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }

    .brand-titles h1 {
        font-size: 0.88rem;
    }

    .version-badge {
        display: none;
    }

    .telemetry-bar {
        padding: 0.18rem 0.4rem;
        gap: 0.2rem;
    }

    .chip-label {
        font-size: 0.48rem;
    }

    .chip-value {
        font-size: 0.72rem;
    }

    /* Header compacto en smartphone: botones de icono limpios sin desborde */
    #export-photo-btn span {
        display: none !important;
    }

    #export-photo-btn {
        padding: 0.42rem 0.55rem;
        min-width: 34px;
        height: 32px;
        justify-content: center;
    }

    #export-photo-btn svg {
        margin: 0 !important;
    }

    #master-menu-label,
    .chevron-indicator {
        display: none !important;
    }

    #master-menu-btn {
        padding: 0.42rem 0.55rem;
        min-width: 34px;
        height: 32px;
        justify-content: center;
    }

    #master-menu-btn svg {
        margin: 0 !important;
    }

    .header-v-divider {
        display: none;
    }

    .master-dropdown-menu {
        position: fixed;
        top: 52px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 68px);
        overflow-y: auto;
    }

    .sidebar-expand-tab {
        display: none !important;
    }

    /* Subbar con touch targets amigables y deslizamiento horizontal */
    .workbench-subbar {
        height: 42px;
        padding: 0 0.5rem;
        gap: 0.4rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    #toggle-sidebar-text {
        display: none !important;
    }

    #toggle-sidebar-btn svg {
        margin-right: 0 !important;
    }

    #board-select {
        max-width: 135px;
        font-size: 0.74rem;
        padding: 0.25rem 0.4rem;
    }

    #add-board-btn span,
    #custom-board-btn span,
    #subbar-lod-btn span,
    #undo-subbar-btn span,
    #redo-subbar-btn span,
    #clear-cables-btn span,
    #delete-selected-btn span,
    #clear-board-btn span {
        display: none !important;
    }

    #add-board-btn svg,
    #custom-board-btn svg,
    #subbar-lod-btn svg,
    #undo-subbar-btn svg,
    #redo-subbar-btn svg,
    #clear-cables-btn svg,
    #delete-selected-btn svg,
    #clear-board-btn svg {
        margin-right: 0 !important;
    }

    #add-board-btn,
    #custom-board-btn,
    #subbar-lod-btn,
    #undo-subbar-btn,
    #redo-subbar-btn,
    #clear-cables-btn,
    #delete-selected-btn,
    #clear-board-btn {
        padding: 0.35rem 0.5rem;
        min-width: 32px;
        height: 32px;
        justify-content: center;
    }

    .workbench-subbar input[type="range"] {
        width: 60px;
    }

    /* Ocultar botones redundantes en móviles (el usuario usa gestos táctiles de zoom) pero MANTENER #lod-labels-btn accesible */
    #zoom-in-btn, #zoom-out-btn, #zoom-reset-btn,
    .canvas-nav-dock .dock-separator:nth-child(n+8) {
        display: none !important;
    }

    /* Dock compacto flotante en esquina inferior derecha sin solapamientos */
    .canvas-nav-dock {
        top: auto !important;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        left: auto !important;
        right: 10px !important;
        transform: none !important;
        max-width: none !important;
        padding: 3px 5px !important;
        gap: 3px !important;
        border-radius: 8px !important;
        z-index: 50 !important;
        background: rgba(15, 23, 42, 0.94) !important;
        border: 1px solid rgba(56, 189, 248, 0.35) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8) !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
    }

    .canvas-nav-dock .dock-btn {
        min-width: 32px !important;
        height: 32px !important;
        padding: 0 5px !important;
        justify-content: center !important;
    }

    .canvas-nav-dock .dock-btn span {
        display: none !important;
    }

    .canvas-nav-dock .dock-btn svg {
        margin: 0 !important;
    }

    /* Botón flotante de catálogo en esquina inferior izquierda protegido de la barra de Safari */
    .mobile-catalog-toggle-btn {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        left: 10px !important;
        z-index: 50 !important;
        height: 36px !important;
        padding: 0 13px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        font-size: 0.8rem !important;
    }

    /* Quick HUD elevado sobre los botones flotantes móviles */
    .quick-hud {
        bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
        max-width: calc(100vw - 20px) !important;
        overflow-x: auto !important;
    }

    /* Overlay de atajos de teclado no es relevante en táctil */
    .canvas-hints {
        display: none !important;
    }

    /* Modales adaptados a pantalla completa móvil */
    .modal-card {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: 90dvh !important;
        margin: 8px !important;
    }

    .artist-modal-card {
        width: calc(100vw - 12px) !important;
        max-height: 94dvh !important;
    }

    .artist-modal-body {
        padding: 0.85rem;
        max-height: calc(94dvh - 70px);
    }

    .artist-admin-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .artist-admin-actions .btn-sm {
        justify-content: center;
        width: 100%;
    }

    .artist-grid {
        grid-template-columns: 1fr;
    }

    .pro-features-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Estilo para botón de control de rótulos LOD en la subbar */
#subbar-lod-btn {
    transition: all 0.15s ease;
}

#subbar-lod-btn.active {
    background: rgba(56, 189, 248, 0.16);
    border-color: #38bdf8;
    color: #38bdf8;
}

#subbar-lod-btn:not(.active) {
    opacity: 0.75;
    color: #94a3b8;
}

/* Teléfonos Pequeños (<= 480px) */
@media (max-width: 480px) {
    .app-header {
        padding: 0 6px !important;
        gap: 4px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .header-left-zone {
        gap: 0.3rem !important;
    }

    .btn-return-home {
        padding: 0.3rem 0.45rem !important;
        gap: 0.2rem !important;
    }

    .btn-return-home span:last-child {
        display: none !important;
    }

    .brand-titles h1 {
        font-size: 0.78rem !important;
        letter-spacing: -0.02em !important;
    }

    .header-right-zone {
        gap: 4px !important;
    }

    .brand-divider {
        display: none !important;
    }

    .logo-icon {
        display: none !important;
    }

    .telemetry-bar {
        padding: 0.15rem 0.35rem !important;
        gap: 0 !important;
        background: rgba(15, 23, 42, 0.85) !important;
    }

    .telemetry-chip:nth-child(n+2) {
        display: none !important; /* Mostrar únicamente el consumo de corriente mA */
    }

    .telemetry-chip {
        padding: 0 0.15rem !important;
        border-right: none !important;
    }

    .chip-label {
        display: none !important;
    }

    .chip-value {
        font-size: 0.72rem !important;
    }

    .chip-value.highlight-cyan::before {
        content: "⚡ " !important;
        font-size: 0.65rem !important;
        color: #38bdf8 !important;
    }

    .board-select,
    #board-select {
        max-width: 110px !important;
        font-size: 0.7rem !important;
        padding: 0.2rem 0.35rem !important;
    }

    .workbench-subbar {
        height: 38px !important;
        padding: 0 0.3rem !important;
        gap: 0.3rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Bottom-sheet menú contextual nativo móvil para equipos y cables */
    .gear-context-menu,
    #cable-context-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100vw !important;
        max-height: 78dvh !important;
        overflow-y: auto !important;
        border-radius: 18px 18px 0 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.95), 0 0 20px rgba(56, 189, 248, 0.2) !important;
        z-index: 9500 !important;
        animation: slideUpBottomSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes slideUpBottomSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .mobile-catalog-toggle-btn {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        left: 8px !important;
        padding: 0 10px !important;
        font-size: 0.75rem !important;
        height: 34px !important;
    }

    .canvas-nav-dock {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        right: 8px !important;
        padding: 2px 4px !important;
        gap: 2px !important;
    }

    .canvas-nav-dock .dock-btn {
        min-width: 30px !important;
        height: 30px !important;
        padding: 0 4px !important;
    }
}

/* =========================================================================
   HUD FLOTANTE DE CONEXIÓN DE CABLE EN VIVO (SELECTOR DE COLOR INSTANTÁNEO)
   ========================================================================= */
.cable-connecting-hud {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(56, 189, 248, 0.6);
    border-radius: 30px;
    padding: 0.45rem 0.9rem;
    box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.3);
    user-select: none;
    pointer-events: auto;
    animation: fadeInSlideDown 0.18s ease-out;
}

@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.cable-hud-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #f8fafc;
    white-space: nowrap;
}

.cable-hud-pulse {
    color: #22c55e;
    font-size: 0.85rem;
    animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
    from { opacity: 0.4; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.25); }
}

.cable-hud-palette {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cable-hud-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    outline: none;
    padding: 0;
}

.cable-hud-swatch:hover {
    transform: scale(1.25);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.cable-hud-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.85);
    transform: scale(1.2);
}

.cable-hud-picker {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    background: none;
    overflow: hidden;
}

.cable-hud-cancel {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.cable-hud-cancel:hover {
    background: rgba(239, 68, 68, 0.45);
    color: #ffffff;
}

@media (max-width: 768px) {
    .cable-connecting-hud {
        top: 60px;
        width: 92%;
        max-width: 420px;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }
    .cable-hud-swatch {
        width: 19px;
        height: 19px;
    }
}



