/* ==========================================================================
   SchemCAD — CAD PRO Hardware Repair Bench & Overlay Suite
   File: frontend/cad_pro_bench.css
   Zero-dependency dark engineering workstation aesthetic (.cpb-* namespace)
   ========================================================================== */

/* ---------- 1. Synchronized Canvas Overlay & Floating Clear HUD ---------- */
#cadProOverlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  display: block;
}

.cpb-overlay-hud {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(11, 16, 26, 0.92);
  border: 1px solid rgba(34, 211, 238, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 14px rgba(34, 211, 238, 0.18);
  color: #e2e8f0;
  font-family: var(--sans, "Inter", system-ui, -apple-system, sans-serif);
  font-size: 12px;
  font-weight: 600;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.cpb-overlay-hud.hidden {
  display: none !important;
}

.cpb-overlay-hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
  flex-shrink: 0;
}

.cpb-overlay-hud-btn {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.cpb-overlay-hud-btn:hover {
  background: rgba(239, 68, 68, 0.32);
  color: #ffffff;
}

/* ---------- 2. Toolbar FPC / ISP Button ---------- */
.cpb-toolbar-btn {
  border-color: rgba(16, 185, 129, 0.42) !important;
  color: #6ee7b7 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(245, 158, 11, 0.10)) !important;
  font-weight: 600;
}

.cpb-toolbar-btn:hover {
  border-color: rgba(52, 211, 153, 0.78) !important;
  color: #ecfdf5 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(245, 158, 11, 0.18)) !important;
}

/* ---------- 3. Inspector Injections (Jumper Card & Connector Button) ---------- */
.cpb-fpc-insp-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 7px;
  border: 1px solid rgba(52, 211, 153, 0.58);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.20), rgba(245, 158, 11, 0.18));
  color: #fef3c7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.14);
  transition: filter 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.cpb-fpc-insp-btn:hover {
  filter: brightness(1.1);
  border-color: #fbbf24;
}

.cpb-fpc-insp-btn:active {
  transform: translateY(1px);
}

.cpb-jumper-card {
  border: 1px solid rgba(34, 211, 238, 0.42) !important;
  background: linear-gradient(180deg, rgba(14, 29, 47, 0.92), rgba(11, 17, 28, 0.96)) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.cpb-jumper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.cpb-jumper-title {
  font-size: 12px;
  font-weight: 700;
  color: #67e8f9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cpb-jumper-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
  line-height: 1.35;
}

.cpb-jumper-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cpb-jumper-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #f1f5f9;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.cpb-jumper-row:hover {
  background: rgba(34, 211, 238, 0.13);
  border-color: rgba(34, 211, 238, 0.62);
}

.cpb-jumper-row.is-active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.20), rgba(251, 191, 36, 0.15));
  border-color: #fbbf24;
}

.cpb-jumper-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cpb-jumper-ref {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.cpb-jumper-dist {
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 11.5px;
  font-weight: 700;
  color: #fde047;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.34);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.cpb-jumper-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
}

.cpb-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cpb-tag--smd {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

.cpb-tag--tp {
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.38);
}

.cpb-tag--ic {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

.cpb-tag--bga {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.38);
}

.cpb-tag--side-same {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.34);
}

.cpb-tag--side-opp {
  background: rgba(245, 158, 11, 0.17);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.42);
}

/* ---------- 4. Standalone / Mobile Modal Shell Fallback ---------- */
.cpb-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1320;
  background: rgba(3, 7, 15, 0.76);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.cpb-modal-shell {
  width: min(1040px, 100%);
  height: min(760px, calc(100vh - 24px));
  background: #0b1019;
  border: 1px solid #29384e;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cpb-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}

.cpb-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cpb-modal-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #04130d;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.cpb-modal-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cpb-modal-close {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.cpb-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(248, 113, 113, 0.5);
}

.cpb-modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .cpb-modal-backdrop {
    padding: 0;
  }
  .cpb-modal-shell {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
}

/* ---------- 5. Suite Root Layout & Navigation Tabs ---------- */
.cpb-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0b1019;
  color: #e2e8f0;
  font-family: var(--sans, "Inter", system-ui, -apple-system, sans-serif);
  font-size: 12.5px;
  overflow: hidden;
}

.cpb-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #0f1724;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.cpb-tab {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.cpb-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.cpb-tab.active {
  color: #67e8f9;
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.42);
}

.cpb-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 13px 14px 18px;
}

.cpb-pane {
  display: none;
}

.cpb-pane.active {
  display: block;
}

/* ---------- 6. Shared Controls, Inputs, Buttons & Cards ---------- */
.cpb-ControlsBar,
.cpb-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
}

.cpb-input,
.cpb-select {
  background: #111927;
  color: #f1f5f9;
  border: 1px solid #29384e;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.14s ease;
}

.cpb-input:focus,
.cpb-select:focus {
  border-color: #38bdf8;
}

.cpb-input--grow {
  flex: 1 1 200px;
  min-width: 150px;
}

.cpb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #2e4059;
  background: #162133;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, filter 0.14s ease;
}

.cpb-btn:hover {
  background: #1e2d45;
  border-color: #476288;
}

.cpb-btn--primary {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
  font-weight: 700;
}

.cpb-btn--primary:hover {
  filter: brightness(1.1);
}

.cpb-btn--emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: rgba(52, 211, 153, 0.68);
  color: #03150e;
  font-weight: 700;
}

.cpb-btn--emerald:hover {
  filter: brightness(1.08);
}

.cpb-btn--amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.22));
  border-color: rgba(251, 191, 36, 0.52);
  color: #fde68a;
}

.cpb-btn--sm {
  padding: 4px 8px;
  font-size: 11.5px;
}

.cpb-seg {
  display: inline-flex;
  background: #0f1724;
  border: 1px solid #26354b;
  border-radius: 6px;
  overflow: hidden;
}

.cpb-seg-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.cpb-seg-btn.active {
  background: #1d3557;
  color: #67e8f9;
}

.cpb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.cpb-pill {
  background: #121b2b;
  color: #94a3b8;
  border: 1px solid #253449;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cpb-pill:hover {
  color: #e2e8f0;
  border-color: #3b5273;
}

.cpb-pill.active {
  background: rgba(14, 165, 233, 0.20);
  color: #7dd3fc;
  border-color: #38bdf8;
}

.cpb-card {
  background: #111927;
  border: 1px solid #223147;
  border-radius: 8px;
  padding: 11px 13px;
  margin-bottom: 10px;
}

.cpb-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.cpb-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.cpb-empty {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  background: rgba(17, 25, 39, 0.65);
  border: 1px dashed #29384e;
  border-radius: 8px;
  line-height: 1.5;
}

.cpb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.cpb-kpi {
  background: #111927;
  border: 1px solid #24344c;
  border-radius: 8px;
  padding: 9px 11px;
}

.cpb-kpi-val {
  font-size: 18px;
  font-weight: 800;
  color: #38bdf8;
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
}

.cpb-kpi-lbl {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ---------- 7. Feature #2: 2-Column Borneo/JC FPC Connector Table ---------- */
.cpb-fpc-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  background: #101826;
  border: 1px solid #223147;
  border-radius: 7px;
  margin-bottom: 10px;
}

.cpb-fpc-bar-outer {
  flex: 1;
  height: 7px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.cpb-fpc-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #22d3ee);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.cpb-fpc-dual-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #24344c;
  border-radius: 8px;
  background: #0d1420;
  padding: 8px;
}

.cpb-fpc-pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.cpb-fpc-spine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  background: #172030;
  border-left: 2px solid #eab308;
  border-right: 2px solid #eab308;
  border-radius: 2px;
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #fde047;
}

.cpb-fpc-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #121c2d;
  border: 1px solid #1f2e45;
  cursor: pointer;
  min-width: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.cpb-fpc-cell:hover {
  background: #192841;
  border-color: #38bdf8;
}

.cpb-fpc-cell.is-checked {
  background: rgba(16, 185, 129, 0.11);
  border-color: rgba(16, 185, 129, 0.42);
}

.cpb-fpc-cell--empty {
  background: rgba(15, 23, 42, 0.35);
  border-style: dashed;
  cursor: default;
}

.cpb-fpc-chk {
  width: 15px;
  height: 15px;
  accent-color: #10b981;
  cursor: pointer;
  flex-shrink: 0;
}

.cpb-fpc-pinnum {
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.cpb-fpc-net {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 11.5px;
  color: #e2e8f0;
}

.cpb-fpc-mv {
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #fde047;
  flex-shrink: 0;
}

/* Role Badges */
.cpb-role {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.cpb-role--pwr {
  background: rgba(239, 68, 68, 0.20);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.42);
}

.cpb-role--gnd {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.cpb-role--nc {
  background: rgba(148, 163, 184, 0.16);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.30);
}

.cpb-role--mipi {
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.cpb-role--bus {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.cpb-role--sig {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.40);
}

@media (max-width: 720px) {
  .cpb-fpc-pair-row {
    grid-template-columns: 1fr;
  }
  .cpb-fpc-spine {
    display: none;
  }
}

/* ---------- 8. Feature #7: ISP eMMC / UFS Pinout Cards ---------- */
.cpb-isp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
}

.cpb-isp-card {
  background: #111927;
  border: 1px solid #24344c;
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 12px;
}

.cpb-isp-badge {
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  color: #0b1019;
}

/* ---------- 9. Feature #9: Board Diff Combobox & Tables ---------- */
.cpb-diff-pickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.cpb-combo-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cpb-combo-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.cpb-combo-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 210px;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  margin-top: 2px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.cpb-combo-list.hidden {
  display: none;
}

.cpb-combo-opt {
  padding: 6px 10px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.cpb-combo-opt:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #ffffff;
}

.cpb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cpb-table th {
  text-align: left;
  padding: 7px 9px;
  background: #0f1724;
  color: #94a3b8;
  border-bottom: 1px solid #24344c;
  font-weight: 700;
  font-size: 11px;
}

.cpb-table td {
  padding: 6px 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
}

.cpb-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* ---------- 10. Feature #3: Burned IC Pinout Builder ---------- */
.cpb-pin-rules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 7px;
  margin: 8px 0 10px;
}

.cpb-pin-rule {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #0f1724;
  border: 1px solid #26354b;
  border-radius: 6px;
  padding: 5px 7px;
}

.cpb-pin-rule input {
  width: 52px;
  background: #162133;
  color: #f8fafc;
  border: 1px solid #334663;
  border-radius: 4px;
  padding: 4px 6px;
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 12px;
}

.cpb-pin-rule select {
  flex: 1;
  background: #162133;
  color: #67e8f9;
  border: 1px solid #334663;
  border-radius: 4px;
  padding: 4px 5px;
  font-size: 12px;
  font-weight: 700;
}

.cpb-ic-pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 4px;
  margin-top: 8px;
}

.cpb-ic-pin-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #0d1420;
  border: 1px solid #1e293b;
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 11px;
}

.cpb-ic-pin-cell.is-hit {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #ecfdf5;
}

/* ---------- 11. Feature #4: Interactive GPU VRAM SVG Diagram ---------- */
.cpb-vram-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

@media (max-width: 820px) {
  .cpb-vram-layout {
    grid-template-columns: 1fr;
  }
}

.cpb-gpu-svg-box {
  background: #0c131f;
  border: 1px solid #24344c;
  border-radius: 9px;
  padding: 10px;
}

.cpb-gpu-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.cpb-vram-chip {
  cursor: pointer;
  transition: filter 0.15s ease;
}

.cpb-vram-chip:hover rect.cpb-vram-body {
  stroke: #67e8f9;
  stroke-width: 2.2;
}

.cpb-vram-chip.is-selected rect.cpb-vram-body {
  fill: #0f3a4a;
  stroke: #fbbf24;
  stroke-width: 2.8;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.65));
}

.cpb-vram-chan-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.cpb-vram-chan-btn {
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid #2b3d59;
  background: #131d2e;
  color: #cbd5e1;
  cursor: pointer;
}

.cpb-vram-chan-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1019;
  border-color: #fde047;
}

/* ---------- 12. Feature #6: EC Programmer Code Block ---------- */
.cpb-ec-code {
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", Consolas, monospace);
  font-size: 12px;
  line-height: 1.5;
  color: #a7f3d0;
  background: #080d15;
  border: 1px solid #1e3a34;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 7px 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
