:root {
            --bg-color: #0b1120;
            --panel-bg: #e2e8f0;
            --panel-border: #475569;
            --canaleta-bg: #64748b;
            --din-metal: #cbd5e1;
            --text-main: #0f172a;
            --accent-blue: #2563eb;
            --accent-cyan: #06b6d4;
            --accent-green: #10b981;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: #f8fafc;
            padding-bottom: 60px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* --- CABEÇALHO DE NAVEGAÇÃO SUPERIOR --- */
        .top-navbar {
            position: sticky;
            top: 0;
            width: 100%;
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding: 12px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        }

        .nav-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .btn-back {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.08);
            color: #f8fafc;
            text-decoration: none;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 600;
            border: 1px solid rgba(255, 255, 255, 0.15);
            transition: all 0.2s ease;
        }

        .btn-back:hover {
            background: rgba(255, 255, 255, 0.18);
            transform: translateX(-2px);
            color: #38bdf8;
            border-color: #38bdf8;
        }

        .nav-title {
            display: flex;
            flex-direction: column;
        }

        .nav-title h1 {
            font-size: 1.15rem;
            font-weight: 700;
            color: #ffffff;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-title span {
            font-size: 0.8rem;
            color: #94a3b8;
        }

        .nav-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .btn-action {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: #2563eb;
            color: white;
            text-decoration: none;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.88rem;
            font-weight: 600;
            border: 1px solid #3b82f6;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-action:hover {
            background: #1d4ed8;
            box-shadow: 0 0 14px rgba(37, 99, 235, 0.5);
        }

        /* --- BARRA DE FILTROS E CONTROLES --- */
        .controls-bar {
            width: 100%;
            max-width: 1200px;
            margin: 20px auto 10px;
            padding: 0 20px;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 16px;
        }

        .filter-group {
            display: flex;
            gap: 8px;
            background: rgba(30, 41, 59, 0.7);
            padding: 4px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .filter-btn {
            background: transparent;
            border: none;
            color: #94a3b8;
            padding: 6px 14px;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .filter-btn.active, .filter-btn:hover {
            background: #3b82f6;
            color: white;
        }

        .view-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
            color: #cbd5e1;
        }

        /* --- ÁREA PRINCIPAL DOS QUADROS --- */
        .content-container {
            width: 100%;
            max-width: 1200px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 45px;
            padding: 10px 20px 40px;
        }

        /* ESCALA INDUSTRIAL: 1mm físico = 1.2 pixels */
        .panel-400x400 { width: 480px; }
        .panel-500x400 { width: 480px; }
        .panel-600x500 { width: 600px; }

        .panel {
            background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 50%, #94a3b8 100%);
            border: 6px solid #475569;
            border-radius: 8px;
            padding: 24px 28px;
            box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.8);
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            transition: opacity 0.3s;
        }

        /* Parafusos metálicos de fixação nos 4 cantos da placa de montagem */
        .panel .corner-screw {
            position: absolute;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: radial-gradient(circle, #f8fafc 25%, #64748b 80%);
            border: 1px solid #334155;
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.7), 0 1px 2px rgba(255,255,255,0.6);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .panel .corner-screw::after {
            content: '';
            width: 8px;
            height: 1.5px;
            background: #1e293b;
            transform: rotate(45deg);
        }
        .screw-tl { top: 8px; left: 8px; }
        .screw-tr { top: 8px; right: 8px; }
        .screw-bl { bottom: 8px; left: 8px; }
        .screw-br { bottom: 8px; right: 8px; }

        .panel-header {
            text-align: center;
            border-bottom: 2px solid #64748b;
            padding-bottom: 12px;
            margin-bottom: 18px;
            width: 100%;
        }

        .panel-header h2 {
            margin: 0;
            color: #0f172a;
            font-size: 1.3rem;
            font-weight: 800;
            letter-spacing: -0.3px;
        }

        .panel-header p {
            margin: 4px 0 0;
            color: #991b1b;
            font-size: 12px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .panel-badge {
            background: #0f172a;
            color: #38bdf8;
            font-size: 11px;
            padding: 2px 8px;
            border-radius: 4px;
            font-weight: 700;
        }

        /* --- CANALETAS INDUSTRIAIS COM RANHURAS --- */
        .canaleta {
            width: 100%;
            height: 22px;
            background: repeating-linear-gradient(90deg, #94a3b8, #94a3b8 10px, #475569 10px, #475569 14px);
            border: 1.5px solid #334155;
            margin-bottom: 3px;
            border-radius: 2px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 8.5px;
            color: #ffffff;
            font-weight: 800;
            letter-spacing: 1px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
            box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0,0,0,0.15);
            user-select: none;
        }

        /* Larguras úteis de trilho DIN */
        .din-rail-310 { width: 372px; } /* 310mm * 1.2px = 372px */
        .din-rail-410 { width: 492px; } /* 410mm * 1.2px = 492px */

        /* --- TRILHO DIN TS-35 INDUSTRIAL DE AÇO ZINCADO PERFURADO --- */
        .din-rail {
            height: 72px;
            background: linear-gradient(180deg, #94a3b8 0%, #cbd5e1 25%, #f8fafc 50%, #cbd5e1 75%, #64748b 100%);
            border-top: 3px solid #475569;
            border-bottom: 3px solid #475569;
            margin: 0 0 4px 0;
            display: flex;
            align-items: center;
            padding: 0 2px;
            gap: 2px;
            position: relative;
            box-sizing: border-box;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255,255,255,0.7);
            justify-content: flex-start;
        }

        /* Furos oblongos centrais do trilho TS-35 */
        .din-rail::before {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            height: 10px;
            background: repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(15, 23, 42, 0.3) 18px, rgba(15, 23, 42, 0.3) 34px);
            pointer-events: none;
            z-index: 1;
        }

        /* --- COMPONENTES BASE --- */
        .comp {
            height: 66px;
            border-radius: 3px;
            flex-shrink: 0;
            box-sizing: border-box;
            position: relative;
            z-index: 2;
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.6);
        }

        .comp:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
            z-index: 10;
        }

        .screw-dot {
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: radial-gradient(circle, #f8fafc 30%, #64748b 90%);
            border: 1px solid #1e293b;
            box-shadow: inset 0 1px 1px rgba(0,0,0,0.6);
        }

        .led-indicator {
            width: 4px;
            height: 4px;
            border-radius: 50%;
            display: inline-block;
            box-shadow: 0 0 5px currentColor;
        }
        .led-green { background: #22c55e; color: #22c55e; }
        .led-red { background: #ef4444; color: #ef4444; }
        .led-blue { background: #3b82f6; color: #3b82f6; }

        .comp-dim-badge {
            font-size: 5px;
            font-weight: 700;
            color: #fef08a;
            background: rgba(0, 0, 0, 0.75);
            padding: 0 2px;
            border-radius: 2px;
            align-self: center;
            letter-spacing: 0.3px;
        }

        /* ==============================================================
           1. MÓDULO ESP32 EM EXPANSION BOARD DIN (60mm largura x 86mm altura)
           Baseado fidedignamente no board verde com réguas de bornes e NodeMCU preto
           ============================================================== */
        .hw-esp32 {
            width: 72px; /* 60mm * 1.2px = 72px */
            height: 66px;
            background: #15803d; /* Base / suporte de trilho DIN verde */
            border: 1.5px solid #14532d;
            border-radius: 4px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 2px;
            position: relative;
            box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.4);
        }

        /* Orelhas/garras de encaixe DIN TS-35 nas extremidades */
        .hw-esp32::before, .hw-esp32::after {
            content: '';
            position: absolute;
            left: 10px;
            right: 10px;
            height: 2px;
            background: #14532d;
            border-radius: 1px;
        }
        .hw-esp32::before { top: -2px; }
        .hw-esp32::after { bottom: -2px; }

        /* Placa base interna branca do adaptador DIN */
        .hw-esp32-pcb-carrier {
            width: 100%;
            height: 100%;
            background: #f8fafc;
            border: 1px solid #cbd5e1;
            border-radius: 2px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1px;
            box-sizing: border-box;
            position: relative;
            overflow: hidden;
        }

        /* Colunas laterais de bornes verdes Phoenix Contact (15 bornes de cada lado) */
        .hw-esp32-side-terminals {
            width: 14px;
            height: 100%;
            background: #16a34a;
            border: 1px solid #15803d;
            border-radius: 1px;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            align-items: center;
            padding: 1px 0;
            box-sizing: border-box;
        }
        .hw-esp32-screw-terminal {
            width: 10px;
            height: 5px;
            background: #22c55e;
            border: 0.5px solid #15803d;
            border-radius: 1px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .hw-esp32-screw-terminal::after {
            content: '';
            width: 4px;
            height: 1px;
            background: #1e293b;
        }

        /* Placa central preta NodeMCU ESP32 (30 pinos, 28mm x 51mm) */
        .hw-esp32-nodemcu {
            width: 36px;
            height: 98%;
            background: #09090b;
            border: 1px solid #27272a;
            border-radius: 3px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 2px 1px;
            box-sizing: border-box;
            position: relative;
            box-shadow: 0 2px 5px rgba(0,0,0,0.7);
        }

        /* 4 furos metálicos nos cantos do NodeMCU */
        .hw-esp32-hole {
            position: absolute;
            width: 3px;
            height: 3px;
            border-radius: 50%;
            background: #cbd5e1;
            border: 0.5px solid #52525b;
        }
        .hole-tl { top: 1px; left: 1px; }
        .hole-tr { top: 1px; right: 1px; }
        .hole-bl { bottom: 1px; left: 1px; }
        .hole-br { bottom: 1px; right: 1px; }

        /* Antena PCB preta no topo */
        .hw-esp32-pcb-antenna {
            width: 26px;
            height: 6px;
            background: #18181b;
            border: 0.5px solid #3f3f46;
            border-radius: 1px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .hw-esp32-pcb-antenna::after {
            content: '';
            width: 20px;
            height: 2px;
            background: repeating-linear-gradient(90deg, #d97706, #d97706 2px, #18181b 2px, #18181b 4px);
            opacity: 0.85;
        }

        /* Módulo metálico blindado ESP-WROOM-32 */
        .hw-esp32-metal-shield {
            width: 28px;
            height: 19px;
            background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 50%, #94a3b8 100%);
            border: 1px solid #64748b;
            border-radius: 2px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: inset 0 1px 2px rgba(255,255,255,0.9), 0 1px 2px rgba(0,0,0,0.4);
            position: relative;
        }
        .hw-esp32-shield-text {
            font-size: 4px;
            font-weight: 900;
            color: #0f172a;
            letter-spacing: -0.2px;
            line-height: 1;
            text-align: center;
        }
        .hw-esp32-shield-sub {
            font-size: 3px;
            font-weight: 700;
            color: #334155;
            letter-spacing: -0.1px;
            line-height: 1;
        }

        /* LEDs SMD centrais e Chip USB-Serial */
        .hw-esp32-middle-section {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1px;
        }
        .hw-esp32-leds-row {
            display: flex;
            gap: 5px;
            align-items: center;
        }
        .hw-esp32-ch340-chip {
            width: 15px;
            height: 5px;
            background: #18181b;
            border: 0.5px solid #3f3f46;
            border-radius: 1px;
            position: relative;
        }
        .hw-esp32-ch340-chip::before, .hw-esp32-ch340-chip::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 1px;
            background: repeating-linear-gradient(90deg, #cbd5e1, #cbd5e1 1px, transparent 1px, transparent 2px);
        }
        .hw-esp32-ch340-chip::before { top: -1px; }
        .hw-esp32-ch340-chip::after { bottom: -1px; }

        /* Base: Conector Micro-USB e botões EN / BOOT */
        .hw-esp32-bottom-row {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            padding: 0 1px;
            box-sizing: border-box;
        }
        .hw-esp32-btn {
            width: 4px;
            height: 4px;
            background: #3f3f46;
            border: 0.5px solid #71717a;
            border-radius: 1px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .hw-esp32-btn::after {
            content: '';
            width: 2px;
            height: 2px;
            background: #e4e4e7;
            border-radius: 50%;
        }
        .hw-esp32-usb-port {
            width: 9px;
            height: 5px;
            background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%);
            border: 0.5px solid #475569;
            border-bottom: none;
            border-radius: 1px 1px 0 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .hw-esp32-usb-port::after {
            content: '';
            width: 5px;
            height: 2px;
            background: #0f172a;
            border-radius: 0.5px;
        }

        /* 2. FONTE 12V (Mean Well HDR-30-12, Largura: 35mm = 42px) */
        .hw-fonte-12v {
            width: 42px;
            background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
            border: 1px solid #030712;
            color: #f3f4f6;
        }
        .hw-fonte-top-terminals {
            height: 11px;
            background: #111827;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 4px;
            border-bottom: 1px solid #374151;
        }
        .hw-fonte-bot-terminals {
            height: 11px;
            background: #111827;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 4px;
            border-top: 1px solid #374151;
        }
        .hw-fonte-center-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            align-items: center;
            padding: 2px 2px;
            background: repeating-linear-gradient(90deg, #1f2937, #1f2937 4px, #111827 4px, #111827 5px);
        }
        .hw-fonte-brand {
            font-size: 6.5px;
            font-weight: 900;
            color: #38bdf8;
            letter-spacing: 0.5px;
            background: #111827;
            padding: 0 3px;
            border-radius: 2px;
        }
        .hw-fonte-model {
            font-size: 5px;
            font-weight: 700;
            color: #e5e7eb;
            background: #111827;
            padding: 0 2px;
            border-radius: 1px;
        }
        .hw-fonte-status {
            display: flex;
            align-items: center;
            gap: 3px;
            background: #111827;
            padding: 0 3px;
            border-radius: 2px;
        }
        .hw-fonte-status span {
            font-size: 4.5px;
            color: #86efac;
            font-weight: 700;
        }

        /* 3. FONTE 5V (Mean Well HDR-15-5, Largura: 17.5mm = 21px) */
        .hw-fonte-5v {
            width: 21px;
            background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
            border: 1px solid #030712;
            color: #f3f4f6;
        }
        .hw-fonte-5v .hw-fonte-brand { font-size: 5px; }
        .hw-fonte-5v .hw-fonte-model { font-size: 4px; }

        /* 4. MÓDULO OPTOACOPLADOR (8, 12, 16 CH) */
        .hw-opto-base {
            background: #14532d;
            border: 1px solid #052e16;
        }
        .hw-opto-8 { width: 91px; }   /* 76mm * 1.2 */
        .hw-opto-12 { width: 132px; } /* 110mm * 1.2 */
        .hw-opto-16 { width: 173px; } /* 144mm * 1.2 */

        .hw-opto-terminals-top, .hw-opto-terminals-bot {
            height: 11px;
            background: #166534;
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding: 0 2px;
            border-bottom: 1px solid #15803d;
        }
        .hw-opto-terminals-bot {
            border-bottom: none;
            border-top: 1px solid #15803d;
        }
        .hw-opto-phoenix-block {
            width: 7px;
            height: 9px;
            background: #22c55e;
            border: 1px solid #15803d;
            border-radius: 1px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .hw-opto-pcb-center {
            flex: 1;
            background: #052e16;
            margin: 1px 2px;
            border-radius: 2px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 2px 4px;
        }
        .hw-opto-chips-row {
            display: flex;
            justify-content: space-around;
            align-items: center;
        }
        .hw-opto-chip-dip {
            width: 7px;
            height: 8px;
            background: #0f172a;
            border: 1px solid #334155;
            border-radius: 1px;
            position: relative;
        }
        .hw-opto-chip-dip::before {
            content: '';
            position: absolute;
            top: 1px;
            left: 2px;
            width: 2px;
            height: 2px;
            border-radius: 50%;
            background: #64748b;
        }
        .hw-opto-leds-row {
            display: flex;
            justify-content: space-around;
            align-items: center;
        }
        .hw-opto-header-text {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 5.5px;
            font-weight: 800;
            color: #bbf7d0;
            text-shadow: 0 1px 1px #000;
        }

        /* 5. MÓDULO RELÉ SSR (8, 12, 16 CH) */
        .hw-ssr-base {
            background: #7f1d1d;
            border: 1px solid #450a0a;
        }
        .hw-ssr-8 { width: 156px; }  /* 130mm * 1.2 */
        .hw-ssr-12 { width: 228px; } /* 190mm * 1.2 */
        .hw-ssr-16 { width: 300px; } /* 250mm * 1.2 */

        .hw-ssr-terminals-top {
            height: 12px;
            background: #0f172a;
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding: 0 3px;
            border-bottom: 1px solid #450a0a;
        }
        .hw-ssr-power-block {
            width: 10px;
            height: 10px;
            background: #0284c7;
            border: 1px solid #0369a1;
            border-radius: 1px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .hw-ssr-body-center {
            flex: 1;
            background: #450a0a;
            margin: 1px 3px;
            border-radius: 2px;
            display: flex;
            align-items: center;
            justify-content: space-around;
            padding: 2px 3px;
            gap: 2px;
        }
        .hw-ssr-unit {
            flex: 1;
            height: 100%;
            background: linear-gradient(180deg, #991b1b 0%, #1c1917 100%);
            border: 1px solid #ef4444;
            border-radius: 1px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 1px 0;
        }
        .hw-ssr-unit span {
            font-size: 4px;
            font-weight: 800;
            color: #fecaca;
            text-align: center;
            line-height: 1;
        }
        .hw-ssr-terminals-bot {
            height: 10px;
            background: #1c1917;
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding: 0 4px;
            border-top: 1px solid #450a0a;
        }

        /* 6. BORNES DE PASSAGEM PAREADOS (Cinza Fase + Azul Neutro c/ Cap X2 por Circuito) */
        .hw-borne-base {
            display: flex;
            background: #e2e8f0;
            border: 1px solid #475569;
            overflow: hidden;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        .hw-b-paired-8  { width: 106px; }  /* 8 pares (16 vias) = 96px + 10px endplates = 80mm + 10mm postes */
        .hw-b-paired-12 { width: 154px; }  /* 12 pares (24 vias) = 144px + 10px endplates = 120mm + 10mm postes */
        .hw-b-paired-24 { width: 298px; }  /* 24 pares (48 vias) = 288px + 10px endplates = 240mm + 10mm postes */
        .hw-b-paired-40 { width: 490px; }  /* 40 pares (80 vias) = 480px + 10px endplates = 400mm + 10mm postes */

        .hw-borne-pair {
            display: flex;
            position: relative;
            border-right: 1.5px solid #0f172a;
        }
        /* Marcador/Terminal do Capacitor X2 0.47uF conectando os dois bornes do par */
        .hw-borne-pair::after {
            content: 'X2';
            position: absolute;
            top: 2px;
            left: 50%;
            transform: translateX(-50%);
            background: #eab308;
            color: #713f12;
            font-size: 3.5px;
            font-weight: 900;
            padding: 0 1px;
            border-radius: 1px;
            z-index: 2;
            line-height: 5px;
            pointer-events: none;
            border: 0.5px solid #ca8a04;
        }

        .hw-borne-slice {
            width: 6px;
            flex-shrink: 0;
            background: #64748b;
            border-right: 0.5px solid #475569;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 2px 0;
        }
        .hw-borne-slice.blue-slice {
            background: #0284c7;
            border-right: none;
        }
        .hw-borne-marker {
            width: 4.5px;
            height: 7px;
            background: #ffffff;
            border-radius: 1px;
            font-size: 3.5px;
            color: #0f172a;
            font-weight: 900;
            text-align: center;
            line-height: 7px;
        }
        .hw-borne-endplate {
            width: 5px;
            background: #334155;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        /* 7. PROTEÇÕES AC (MCB / DPS / DR) */
        .hw-prot22 { width: 130px; } /* 108mm * 1.2 */
        .hw-prot34 { width: 238px; } /* 198mm * 1.2 */

        .hw-prot-container {
            display: flex;
            width: 100%;
            height: 100%;
            background: #f1f5f9;
            border: 1px solid #94a3b8;
            border-radius: 3px;
            overflow: hidden;
        }
        .hw-prot-module {
            flex: 1;
            border-right: 1px solid #cbd5e1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 2px 1px;
            background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
        }
        .hw-prot-module:last-child { border-right: none; }
        .hw-prot-name {
            font-size: 5.5px;
            font-weight: 800;
            color: #0f172a;
            text-align: center;
            line-height: 1.1;
        }
        .hw-prot-switch {
            width: 7px;
            height: 16px;
            background: #1e293b;
            border-radius: 1px;
            border: 1px solid #000;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            padding-top: 1px;
        }
        .hw-prot-switch-tip {
            width: 5px;
            height: 6px;
            background: #ea580c;
            border-radius: 1px;
        }
        .hw-prot-window {
            width: 6px;
            height: 3px;
            background: #22c55e;
            border: 1px solid #15803d;
            border-radius: 1px;
        }

        /* --- GUIA E LEGENDA DE HARDWARE --- */
        .specs-guide-card {
            width: 100%;
            max-width: 1200px;
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        }

        .guide-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 16px;
            margin-top: 16px;
        }

        .guide-item {
            background: rgba(15, 23, 42, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .guide-item h4 {
            color: #38bdf8;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .guide-item p {
            color: #cbd5e1;
            font-size: 0.8rem;
            line-height: 1.4;
        }

        /* --- TOOLTIP FLUTUANTE DE INSPEÇÃO --- */
        #tooltip {
            position: fixed;
            background: rgba(15, 23, 42, 0.95);
            color: #f8fafc;
            border: 1px solid #38bdf8;
            padding: 10px 14px;
            border-radius: 8px;
            font-size: 0.8rem;
            pointer-events: none;
            z-index: 2000;
            display: none;
            box-shadow: 0 10px 25px rgba(0,0,0,0.6);
            max-width: 260px;
            line-height: 1.4;
        }

        /* ==========================================================================
           OTIMIZAÇÕES DE RESPONSIVIDADE MOBILE FIRST (TELAS PEQUENAS E TABLETS)
           ========================================================================== */
        @media (max-width: 768px) {
            body {
                overflow-x: hidden;
                width: 100%;
            }

            .controls-bar {
                margin: 12px auto 8px;
                padding: 0 12px;
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
            }

            .filter-group {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                padding: 6px;
                white-space: nowrap;
                scrollbar-width: thin;
                display: flex;
                gap: 6px;
            }

            .filter-btn {
                flex-shrink: 0;
                padding: 8px 12px;
                font-size: 0.8rem;
            }

            .view-toggle {
                font-size: 0.75rem;
                justify-content: center;
                text-align: center;
            }

            .content-container {
                padding: 6px 8px 30px;
                gap: 25px;
                width: 100%;
                max-width: 100vw;
                box-sizing: border-box;
                overflow-x: hidden;
            }

            /* Container com scroll horizontal dedicado por painel para não estourar a viewport */
            .panel {
                max-width: 100%;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                padding: 16px 12px;
                border-width: 4px;
                box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
            }

            /* Dica visual em mobile para indicar possibilidade de arraste */
            .panel::before {
                content: '↔ Deslize lateralmente para inspecionar os trilhos';
                display: block;
                width: 100%;
                text-align: center;
                font-size: 0.72rem;
                color: #64748b;
                font-weight: 600;
                margin-bottom: 8px;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }

            .panel-header h2 {
                font-size: 1.05rem;
                line-height: 1.3;
            }

            .panel-header p {
                font-size: 11px;
                flex-wrap: wrap;
            }

            .specs-guide-card {
                padding: 16px;
                border-radius: 8px;
                margin: 0 8px;
                max-width: calc(100vw - 16px);
            }

            .guide-grid {
                grid-template-columns: 1fr;
                gap: 10px;
            }
        }

        @media (max-width: 480px) {
            .filter-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }

            .panel-header h2 {
                font-size: 0.95rem;
            }

            .canaleta {
                font-size: 7px;
            }
        }

