/* ============================================================
   Build Visualizer - Neon Schematic Styles
   ------------------------------------------------------------
   COLOR PALETTE (keep in sync with BuildVisualizer.BvColors):
     CPU      #00f0ff  (cyan)   -> .bv-rect-cpu, .bv-halo-cyan, .bv-label-cpu,
                                   .bv-pill-cyan, .bv-rect-inner (default)
     CHIPSET  #ff1f3d  (red)    -> .bv-rect-chipset, .bv-halo-red[-outer],
                                   .bv-label-chipset, .bv-pill-red,
                                   .bv-corner-accent, .bv-source-tag-pch
     MEMORY   #39ff88  (green)  -> .bv-rect-memory, .bv-halo-green, .bv-pill-green
     PCIe     #ffb347  (amber)  -> .bv-rect-gpu, .bv-halo-amber, .bv-label-gpu,
                                   .bv-pill-amber
     M.2      #b066ff  (purple) -> .bv-rect-m2, .bv-halo-purple, .bv-pill-purple

   To re-skin: update these colors AND BvColors in BuildVisualizer.razor.
   ============================================================ */

.build-visualizer-wrapper {
    position: relative;
    width: 100%;
    background: radial-gradient(ellipse at center, rgba(10, 15, 35, 0.95) 0%, rgba(5, 8, 20, 0.98) 100%);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
}

    .build-visualizer-wrapper::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 20% 30%, rgba(0, 240, 255, 0.08) 0%, transparent 40%), radial-gradient(circle at 75% 60%, rgba(255, 0, 212, 0.06) 0%, transparent 40%);
        pointer-events: none;
        z-index: 0;
    }

.build-visualizer-svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    max-height: 900px;
    display: block;
}

/* ==================== NODE RECTANGLES ==================== */
.bv-rect {
    fill: rgba(8, 14, 30, 0.85);
    stroke-width: 2.5;
}

.bv-rect-cpu        { stroke: #00f0ff; }
.bv-rect-chipset    { stroke: #ff1f3d; stroke-width: 3; }
.bv-rect-memory     { stroke: #39ff88; }
.bv-rect-gpu        { stroke: #ffb347; }
.bv-rect-m2         { stroke: #b066ff; }

/* ==================== EMPTY SLOT STATES ==================== 
   Dashed, dim borders. No filter glow. Clickable.
*/
.bv-rect-empty {
    stroke: rgba(0, 240, 255, 0.35) !important;
    stroke-dasharray: 6 6;
    stroke-width: 1.5 !important;
    fill: rgba(0, 240, 255, 0.02);
}
.bv-rect-empty-red {
    stroke: rgba(255, 31, 61, 0.4) !important;
    stroke-dasharray: 6 6;
    stroke-width: 1.5 !important;
    fill: rgba(255, 31, 61, 0.03);
}
.bv-rect-empty-green {
    stroke: rgba(57, 255, 136, 0.35) !important;
    stroke-dasharray: 5 5;
    stroke-width: 1.2 !important;
    fill: rgba(57, 255, 136, 0.02);
}
.bv-rect-empty-amber {
    stroke: rgba(255, 179, 71, 0.4) !important;
    stroke-dasharray: 6 6;
    stroke-width: 1.2 !important;
    fill: rgba(255, 179, 71, 0.02);
}
.bv-rect-empty-purple {
    stroke: rgba(176, 102, 255, 0.4) !important;
    stroke-dasharray: 5 5;
    stroke-width: 1.2 !important;
    fill: rgba(176, 102, 255, 0.02);
}
.bv-rect-blocked-amber {
    stroke: rgba(200, 60, 60, 0.45) !important;
    stroke-dasharray: 3 5;
    stroke-width: 1.2 !important;
    fill: rgba(80, 20, 20, 0.18);
}
.bv-text-blocked {
    fill: rgba(200, 60, 60, 0.55);
    font-size: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* "+" add icons inside empty slots */
.bv-add-icon {
    font-family: 'Segoe UI', sans-serif;
    font-size: 56px;
    font-weight: 200;
    fill: rgba(0, 240, 255, 0.6);
    text-shadow: 0 0 12px #00f0ff;
    transition: fill 0.2s ease;
}
.bv-add-icon-red {
    fill: rgba(255, 31, 61, 0.75);
    text-shadow: 0 0 12px #ff1f3d;
}
.bv-add-icon-small {
    font-family: 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 200;
    transition: fill 0.2s ease;
}
.bv-add-icon-green  { fill: rgba(57, 255, 136, 0.7); }
.bv-add-icon-amber  { fill: rgba(255, 179, 71, 0.8); }
.bv-add-icon-purple { fill: rgba(176, 102, 255, 0.8); }

.bv-empty-hint {
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    fill: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    pointer-events: none;
}

.bv-text-dim {
    fill: rgba(255, 255, 255, 0.35) !important;
}

/* Hover brighten for clickable empty slots */
.bv-dimm-slot:hover .bv-rect-empty-green,
.bv-pcie-slot:hover .bv-rect-empty-amber,
.bv-m2-slot:hover   .bv-rect-empty-purple {
    stroke-opacity: 1;
    fill-opacity: 0.08;
}
.bv-dimm-slot:hover .bv-add-icon-green,
.bv-pcie-slot:hover .bv-add-icon-amber,
.bv-m2-slot:hover   .bv-add-icon-purple {
    fill: #ffffff;
}
.bv-node-cpu:hover .bv-add-icon,
.bv-node-chipset:hover .bv-add-icon-red {
    fill: #ffffff;
}

/* Red Ares accent shapes layered on top of nodes */
.bv-corner-accent {
    fill: #ff1f3d;
    stroke: #ff5577;
    stroke-width: 0.5;
    animation: bv-accent-flicker 3.2s ease-in-out infinite;
}

@keyframes bv-accent-flicker {
    0%, 100% { opacity: 0.7; }
    45%      { opacity: 1; }
    50%      { opacity: 0.4; }
    55%      { opacity: 1; }
}

.bv-rect-inner {
    fill: rgba(0, 240, 255, 0.06);
    stroke: rgba(0, 240, 255, 0.4);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    animation: bv-rotate-dash 12s linear infinite;
}

.bv-rect-inner-magenta {
    fill: rgba(255, 0, 212, 0.06);
    stroke: rgba(255, 0, 212, 0.4);
}

.bv-rect-inner-red {
    fill: rgba(255, 31, 61, 0.08);
    stroke: rgba(255, 31, 61, 0.55);
}

.bv-rect-inner-green {
    fill: rgba(57, 255, 136, 0.06);
    stroke: rgba(57, 255, 136, 0.4);
}

.bv-rect-inner-amber {
    fill: rgba(255, 179, 71, 0.06);
    stroke: rgba(255, 179, 71, 0.4);
}

@keyframes bv-rotate-dash {
    to {
        stroke-dashoffset: -24;
    }
}

/* ==================== PULSING HALO ==================== 
   IMPORTANT: Only opacity + stroke-width animate.
   No transform => no diagonal drift. The halo is a fixed
   rectangle that simply brightens and dims in place.
*/
.bv-halo {
    fill: none;
    stroke-width: 1.5;
    opacity: 0;
    animation: bv-halo-pulse 2.6s ease-in-out infinite;
    pointer-events: none;
}

/* Each color gets its own keyframe so the stroke can whiten at peak while
   the class-level drop-shadow keeps the colored bloom around it.
   Result: white-hot center + neon-colored glow = TRON light-source look. */

.bv-halo-cyan      { stroke: #00f0ff; animation-name: bv-halo-pulse-cyan;    filter: drop-shadow(0 0 5px #00f0ff); }
.bv-halo-magenta   { stroke: #ff00d4; animation-name: bv-halo-pulse-magenta; filter: drop-shadow(0 0 5px #ff00d4); animation-delay: -1.3s; }
.bv-halo-red       { stroke: #ff1f3d; animation-name: bv-halo-pulse-red;     filter: drop-shadow(0 0 6px #ff1f3d); animation-duration: 2.0s; stroke-width: 2; }
.bv-halo-red-outer { stroke: #ff1f3d; animation-name: bv-halo-pulse-red;     filter: drop-shadow(0 0 6px #ff1f3d); animation-duration: 2.8s; animation-delay: -0.7s; }
.bv-halo-green     { stroke: #39ff88; animation-name: bv-halo-pulse-green;   filter: drop-shadow(0 0 5px #39ff88); animation-duration: 2.2s; }
.bv-halo-amber     { stroke: #ffb347; animation-name: bv-halo-pulse-amber;   filter: drop-shadow(0 0 5px #ffb347); animation-duration: 3.0s; }
.bv-halo-purple    { stroke: #b066ff; animation-name: bv-halo-pulse-purple;  filter: drop-shadow(0 0 5px #b066ff); animation-duration: 2.8s; }

@keyframes bv-halo-pulse {
    /* Fallback for any halo without a per-color keyframe */
    0%, 100% { opacity: 0.05; stroke-width: 1; }
    50%      { opacity: 0.75; stroke-width: 2.5; }
}

/* Slow swell in → white-hot peak → fast snap back to color → slow fade out */

@keyframes bv-halo-pulse-cyan {
    0%, 100% { opacity: 0.05; stroke: #00f0ff; stroke-width: 1;   }
    45%      { opacity: 0.80; stroke: #00f0ff; stroke-width: 2.5; }
    50%      { opacity: 1;    stroke: #eaffff; stroke-width: 1.2; }
    57%      { opacity: 0.85; stroke: #00f0ff; stroke-width: 2;   }
    70%      { opacity: 0.30; stroke: #00f0ff; stroke-width: 1.2; }
}

@keyframes bv-halo-pulse-red {
    0%, 100% { opacity: 0.05; stroke: #ff1f3d; stroke-width: 1;   }
    45%      { opacity: 0.80; stroke: #ff1f3d; stroke-width: 2.5; }
    50%      { opacity: 1;    stroke: #ffe8ea; stroke-width: 1.2; }
    57%      { opacity: 0.85; stroke: #ff1f3d; stroke-width: 2;   }
    70%      { opacity: 0.30; stroke: #ff1f3d; stroke-width: 1.2; }
}

@keyframes bv-halo-pulse-green {
    0%, 100% { opacity: 0.05; stroke: #39ff88; stroke-width: 1;   }
    45%      { opacity: 0.80; stroke: #39ff88; stroke-width: 2.5; }
    50%      { opacity: 1;    stroke: #e0fff0; stroke-width: 1.2; }
    57%      { opacity: 0.85; stroke: #39ff88; stroke-width: 2;   }
    70%      { opacity: 0.30; stroke: #39ff88; stroke-width: 1.2; }
}

@keyframes bv-halo-pulse-amber {
    0%, 100% { opacity: 0.05; stroke: #ffb347; stroke-width: 1;   }
    45%      { opacity: 0.80; stroke: #ffb347; stroke-width: 2.5; }
    50%      { opacity: 1;    stroke: #fff3e0; stroke-width: 1.2; }
    57%      { opacity: 0.85; stroke: #ffb347; stroke-width: 2;   }
    70%      { opacity: 0.30; stroke: #ffb347; stroke-width: 1.2; }
}

@keyframes bv-halo-pulse-purple {
    0%, 100% { opacity: 0.05; stroke: #b066ff; stroke-width: 1;   }
    45%      { opacity: 0.80; stroke: #b066ff; stroke-width: 2.5; }
    50%      { opacity: 1;    stroke: #f0e6ff; stroke-width: 1.2; }
    57%      { opacity: 0.85; stroke: #b066ff; stroke-width: 2;   }
    70%      { opacity: 0.30; stroke: #b066ff; stroke-width: 1.2; }
}

@keyframes bv-halo-pulse-magenta {
    0%, 100% { opacity: 0.05; stroke: #ff00d4; stroke-width: 1;   }
    45%      { opacity: 0.80; stroke: #ff00d4; stroke-width: 2.5; }
    50%      { opacity: 1;    stroke: #ffe0fb; stroke-width: 1.2; }
    57%      { opacity: 0.85; stroke: #ff00d4; stroke-width: 2;   }
    70%      { opacity: 0.30; stroke: #ff00d4; stroke-width: 1.2; }
}

/* ==================== LABELS ==================== */
.bv-label {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 2px;
    fill: #ffffff;
    text-shadow: 0 0 3px currentColor;
}

.bv-label-cpu       { fill: #00f0ff; }
.bv-label-chipset {
    fill: #ff1f3d;
    font-size: 22px;
    text-shadow: 0 0 3px #ff1f3d;
}
.bv-label-gpu       { fill: #ffb347; font-size: 18px; }

/* Socket tag inside CPU rectangle */
.bv-socket-tag {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 2px;
    fill: #00f0ff;
    text-shadow: 0 0 3px #00f0ff;
}

/* Node title (CPU full name above the rectangle) */
.bv-node-title {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 2px;
    fill: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 4px currentColor;
}
.bv-node-title-cyan { fill: #00f0ff; }

/* Slot content (capacity, etc. inside DIMM/M.2 rectangles) */
.bv-slot-content {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    fill: #ffffff;
    text-shadow: 0 0 4px currentColor;
}

.bv-slot-content-large {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 2px;
    fill: #ffffff;
    text-shadow: 0 0 1px currentColor;
}

.bv-sublabel {
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    fill: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
}

.bv-slot-label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    fill: rgba(255, 255, 255, 0.5);
}

.bv-wire-label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    fill: rgba(0, 240, 255, 0.6);
}

/* ==================== CONNECTION WIRES ==================== */
.bv-wire-base {
    pointer-events: none;
}

.bv-wire-flow {
    animation: bv-dash-flow 1.8s linear infinite;
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.6));
    pointer-events: none;
}

@keyframes bv-dash-flow {
    to {
        /* MUST equal dash+gap length from the SVG stroke-dasharray ("14 20" = 34)
           so the animation loops seamlessly. Any other value causes a visible
           snap/jump on each cycle restart. */
        stroke-dashoffset: -34;
    }
}

/* ==================== DATA PACKETS ==================== */
.bv-packet {
    opacity: 0.95;
}

/* ==================== HOVER INTERACTIONS ==================== */
.bv-node {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

    .bv-node:hover .bv-rect {
        stroke-width: 3.5;
    }

    .bv-node:hover .bv-halo {
        animation-duration: 1.2s;
    }

/* ==================== COLLAPSIBLE PANEL ==================== */
.build-visualizer-panel {
    position: relative;
    padding: 1rem;
}

.build-visualizer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}

@media (max-width: 576px) {
    .build-visualizer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .build-visualizer-header h4 {
        margin: 0;
    }
}

    .build-visualizer-header h4 {
        margin: 0;
        color: #ffffff;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .build-visualizer-header h4 i {
            color: #00f0ff;
            text-shadow: 0 0 8px #00f0ff;
        }

.build-visualizer-toggle {
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: #00f0ff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .build-visualizer-toggle:hover {
        background: rgba(0, 240, 255, 0.1);
        border-color: #00f0ff;
        box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    }

.build-visualizer-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.65rem;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #00f0ff, #ff00d4);
    color: #000;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* === appended-v5 marker === */

/* ==================== BUS PILLS (schematic bandwidth labels) ==================== */
.bv-pill {
    pointer-events: none;
}

.bv-pill-bg {
    fill: rgba(5, 8, 20, 0.92);
    stroke-width: 1;
}

.bv-pill-text {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.bv-pill-cyan       .bv-pill-bg   { stroke: #00f0ff; filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.7)); }
.bv-pill-cyan       .bv-pill-text { fill: #00f0ff; text-shadow: 0 0 4px #00f0ff; }

.bv-pill-green      .bv-pill-bg   { stroke: #39ff88; filter: drop-shadow(0 0 4px rgba(57, 255, 136, 0.7)); }
.bv-pill-green      .bv-pill-text { fill: #39ff88; text-shadow: 0 0 4px #39ff88; }

.bv-pill-amber      .bv-pill-bg   { stroke: #ffb347; filter: drop-shadow(0 0 4px rgba(255, 179, 71, 0.7)); }
.bv-pill-amber      .bv-pill-text { fill: #ffb347; text-shadow: 0 0 4px #ffb347; }

.bv-pill-amber-dim  .bv-pill-bg   { stroke: rgba(255, 179, 71, 0.45); }
.bv-pill-amber-dim  .bv-pill-text { fill: rgba(255, 179, 71, 0.55); }

.bv-pill-purple     .bv-pill-bg   { stroke: #b066ff; filter: drop-shadow(0 0 4px rgba(176, 102, 255, 0.7)); }
.bv-pill-purple     .bv-pill-text { fill: #b066ff; text-shadow: 0 0 4px #b066ff; }

.bv-pill-purple-dim .bv-pill-bg   { stroke: rgba(176, 102, 255, 0.45); }
.bv-pill-purple-dim .bv-pill-text { fill: rgba(176, 102, 255, 0.55); }

.bv-pill-red        .bv-pill-bg   { stroke: #ff1f3d; filter: drop-shadow(0 0 4px rgba(255, 31, 61, 0.8)); }
.bv-pill-red        .bv-pill-text { fill: #ff1f3d; text-shadow: 0 0 4px #ff1f3d; }

/* ==================== JUNCTION DOTS ==================== */
.bv-junction {
    opacity: 0.9;
}

/* ==================== LEGEND / OPTIMIZE OVERLAY ==================== */
.bv-top-right-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    gap: 8px;
    align-items: center;
}

.bv-legend-toggle {
    background: rgba(8, 14, 30, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.5);
    color: #00f0ff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.bv-legend-toggle:hover {
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.bv-optimize-btn {
    background: rgba(8, 14, 30, 0.85);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #60a5fa;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.bv-optimize-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.bv-legend {
    position: absolute;
    top: 50px;
    right: 12px;
    z-index: 10;
    background: rgba(5, 8, 20, 0.96);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    padding: 14px 18px;
    min-width: 260px;
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
    font-family: 'Segoe UI', sans-serif;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
}

.bv-legend-section {
    margin-bottom: 12px;
}

.bv-legend-section:last-child {
    margin-bottom: 0;
}

.bv-legend-section h6 {
    margin: 0 0 6px 0;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #00f0ff;
    text-shadow: 0 0 4px #00f0ff;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 4px;
}

.bv-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.bv-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    box-shadow: 0 0 6px currentColor;
}

.bv-legend-line {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2px solid #00f0ff;
}

.bv-legend-line.dashed {
    border-top-style: dashed;
    border-color: rgba(0, 240, 255, 0.5);
}

.bv-legend-pill {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid #ffb347;
    border-radius: 9px;
    color: #ffb347;
    font-family: 'Consolas', monospace;
    font-size: 0.7rem;
    letter-spacing: 1px;
    background: rgba(5, 8, 20, 0.92);
    margin-left: 4px;
}

.bv-legend-faint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    font-style: italic;
}

/* ============================================================
   SOURCE TAGS (CPU / PCH) on PCIe and M.2 slots
   ------------------------------------------------------------
   Small badge in the corner of each slot indicating where its
   lanes are wired. Cyan = CPU, Red = Chipset (PCH).
   ============================================================ */
.bv-source-tag rect {
    stroke-width: 0.8;
    fill: rgba(5, 8, 20, 0.85);
}
.bv-source-tag text {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}
.bv-source-tag-cpu rect { stroke: #00f0ff; filter: drop-shadow(0 0 2px rgba(0, 240, 255, 0.6)); }
.bv-source-tag-cpu text { fill: #00f0ff; }
.bv-source-tag-pch rect { stroke: #ff1f3d; filter: drop-shadow(0 0 2px rgba(255, 31, 61, 0.6)); }
.bv-source-tag-pch text { fill: #ff1f3d; }

/* Cyan pill variants (used on CPU-sourced M.2 stubs) */
.bv-pill-cyan      .bv-pill-bg   { stroke: #00f0ff; filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.7)); }
.bv-pill-cyan      .bv-pill-text { fill: #00f0ff; text-shadow: 0 0 4px #00f0ff; }
.bv-pill-cyan-dim  .bv-pill-bg   { stroke: rgba(0, 240, 255, 0.45); }
.bv-pill-cyan-dim  .bv-pill-text { fill: rgba(0, 240, 255, 0.55); }

/* Legend source tags (HTML, not SVG) */
.bv-legend-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 16px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(5, 8, 20, 0.85);
}
.bv-legend-tag-cpu { border: 1px solid #00f0ff; color: #00f0ff; box-shadow: 0 0 4px rgba(0, 240, 255, 0.6); }
.bv-legend-tag-pch { border: 1px solid #ff1f3d; color: #ff1f3d; box-shadow: 0 0 4px rgba(255, 31, 61, 0.6); }

/* Memory channel header label (e.g. "Ch.A") above each channel column */
.bv-channel-label {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    font-weight: 700;
    fill: #39ff88;
    letter-spacing: 1px;
    filter: drop-shadow(0 0 3px rgba(57, 255, 136, 0.6));
}

/* ============================================================
   ZOOM & PAN
   ------------------------------------------------------------
   Viewport: clips the canvas, captures pointer / wheel events.
   Canvas:   transformed by JS (translate + scale). Contains SVG.
   Controls: floating cluster at top-left of the wrapper.
   ============================================================ */
.bv-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 540px;
    overflow: hidden;
    cursor: grab;
    /* Disable browser-native panning/zoom so our gestures own the input. */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.bv-viewport.bv-panning {
    cursor: grabbing;
}

.bv-canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    /* Smooth GPU-accelerated transforms */
    will-change: transform;
}

/* Make the inner SVG render at its natural viewBox size; the wrapping
   canvas div is what gets scaled. */
.bv-viewport .build-visualizer-svg {
    display: block;
    width: 1400px;
    height: 900px;
    max-height: none;
}

/* ----- Floating zoom controls ----- */
.bv-zoom-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(5, 8, 20, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
    font-family: 'Consolas', monospace;
}

.bv-zoom-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: #00f0ff;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.bv-zoom-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.bv-zoom-btn:active {
    background: rgba(0, 240, 255, 0.28);
}

.bv-zoom-fit {
    font-size: 14px;
}

.bv-zoom-pct {
    min-width: 42px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    letter-spacing: 1px;
    padding: 0 4px;
}
