/* ============================================================
   app.css — Circuit Designer Pro — Styles for all new UI
   Supplements the existing style.css with styles for:
   - Debug panel, Watch list, Error list
   - Command palette (Ctrl+K)
   - Mini-map
   - Breakpoint panel
   - Wire properties panel
   - Align/distribute toolbar
   - Project bar
   - Simulation status
   - Truth table generator
   ============================================================ */

/* ── Debug Panel ─────────────────────────────────────────── */
#debug-panel {
  position: fixed;
  right: 0;
  top: 56px;
  bottom: 0;
  width: 280px;
  background: #0a0e14;
  border-left: 1px solid #1e3a50;
  z-index: 150;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

#debug-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #1e3a50;
  color: #00d4ff;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 1px;
}

.debug-section-title {
  color: #4a6080;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 8px 12px 4px;
  border-bottom: 1px solid rgba(30,58,80,0.5);
  text-transform: uppercase;
}

#debug-section-watch,
#debug-section-errors,
#debug-section-trace,
#debug-section-truthtable {
  border-bottom: 1px solid #1a2a3a;
  padding-bottom: 8px;
}

#watch-actions, #trace-actions {
  display: flex;
  gap: 4px;
  padding: 4px 12px;
  flex-wrap: wrap;
}

/* ── Watch List Table ────────────────────────────────────── */
.watch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.watch-table th {
  color: #4a6080;
  font-weight: bold;
  padding: 3px 6px;
  text-align: left;
  border-bottom: 1px solid #1a2a3a;
}

.watch-table td {
  padding: 3px 6px;
  border-bottom: 1px solid rgba(26,42,58,0.3);
}

.watch-row.watch-changed {
  background: rgba(255,204,0,0.08);
}

.watch-label { color: #c8d8f0; }
.watch-val { font-weight: bold; }
.watch-prev { color: #4a6080; }

.watch-remove {
  background: none;
  border: none;
  color: #ff4444;
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
}

/* ── Error List ──────────────────────────────────────────── */
.error-item {
  padding: 3px 12px;
  line-height: 1.4;
}

/* ── Truth Table Generator ───────────────────────────────── */
#truthtable-container {
  padding: 4px 12px;
  max-height: 300px;
  overflow-y: auto;
}

.truth-table-gen {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.truth-table-gen th {
  padding: 3px 8px;
  font-weight: bold;
  border-bottom: 1px solid #2a4060;
}

.truth-table-gen th.tt-input { color: #39ff14; }
.truth-table-gen th.tt-output { color: #00d4ff; }

.truth-table-gen td {
  padding: 2px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(26,42,58,0.3);
}

.truth-table-gen td.tt-high { color: #39ff14; font-weight: bold; }
.truth-table-gen td.tt-low { color: #ff4444; }
.truth-table-gen td.tt-null { color: #4a6080; }

/* ── Command Palette ─────────────────────────────────────── */
#command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

#command-palette-box {
  background: #0d1320;
  border: 1px solid #2a4060;
  border-radius: 8px;
  width: 500px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}

#command-palette-input {
  width: 100%;
  padding: 12px 16px;
  background: #0a0e14;
  border: none;
  border-bottom: 1px solid #1e3a50;
  color: #c8d8f0;
  font: 14px 'JetBrains Mono', monospace;
  outline: none;
  box-sizing: border-box;
}

#command-palette-input::placeholder {
  color: #4a6080;
}

#command-palette-list {
  max-height: 350px;
  overflow-y: auto;
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.1s;
}

.cp-item:hover, .cp-item.cp-selected {
  background: rgba(0, 212, 255, 0.08);
}

.cp-category {
  color: #4a6080;
  font-size: 8px;
  font-weight: bold;
  text-transform: uppercase;
  min-width: 70px;
  letter-spacing: 0.5px;
}

.cp-label {
  color: #c8d8f0;
  font-size: 12px;
  flex: 1;
}

.cp-shortcut {
  color: #4a6080;
  font-size: 9px;
  background: rgba(42,64,96,0.3);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #2a4060;
}

.cp-empty {
  padding: 16px;
  text-align: center;
  color: #4a6080;
  font-size: 11px;
}

/* ── Mini-map ────────────────────────────────────────────── */
#minimap-container {
  position: fixed;
  bottom: 50px;
  right: 8px;
  z-index: 100;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #1e3a50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

#minimap-canvas {
  display: block;
}

/* ── Breakpoint Panel ────────────────────────────────────── */
#breakpoint-panel {
  border-top: 1px solid #1a2a3a;
  padding: 8px 0;
}

#breakpoint-title {
  color: #ff4444;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 0 12px 4px;
}

#breakpoint-list {
  padding: 0 12px;
}

#breakpoint-add-row {
  display: flex;
  gap: 4px;
  padding: 4px 12px;
}

.bp-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 9px;
}

.bp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.bp-label {
  color: #c8d8f0;
  flex: 1;
}

.bp-cond {
  color: #4a6080;
  font-size: 8px;
}

.bp-toggle, .bp-remove {
  background: none;
  border: 1px solid #2a4060;
  color: #4a6080;
  font-size: 8px;
  padding: 1px 4px;
  cursor: pointer;
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.bp-toggle:hover { color: #c8d8f0; }
.bp-remove:hover { color: #ff4444; border-color: #ff4444; }

/* ── Wire Properties Panel ───────────────────────────────── */
#wire-props {
  border-top: 1px solid #1a2a3a;
  padding: 8px 0;
}

#wire-props-title {
  color: #ffcc00;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 0 12px 4px;
}

#wire-props select {
  font-family: 'JetBrains Mono', monospace;
}

/* ── Align/Distribute Toolbar ────────────────────────────── */
.align-btn {
  background: #0a1520;
  border: 1px solid #2a4060;
  color: #c8d8f0;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  min-width: 28px;
  text-align: center;
}

.align-btn:hover {
  background: #1a2a3a;
  border-color: #00d4ff;
  color: #00d4ff;
}

/* ── Simulation Status Bar ───────────────────────────────── */
#sim-status {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(13, 19, 32, 0.95);
  border: 1px solid #2a4060;
  border-radius: 6px;
  padding: 6px 16px;
  font: bold 10px 'JetBrains Mono', monospace;
}

#sim-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* ── Project Bar ─────────────────────────────────────────── */
#project-bar .design-action {
  padding: 3px 8px;
}

/* ── Undo/Redo above palette ──────────────────────────────── */
#hud-right-top {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 4px;
}

.hud-action-btn {
  background: rgba(10, 20, 35, 0.7);
  border: 1px solid #2a4060;
  color: #4a6080;
  font-size: 16px;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1;
}

.hud-action-btn:hover {
  color: #c8d8f0;
  border-color: #00d4ff;
}

/* ── Palette Tabs (top-right) ─────────────────────────────── */
#palette-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 4px;
}

.palette-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #4a6080;
  font: bold 9px 'JetBrains Mono', monospace;
  letter-spacing: 1px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.palette-tab:hover {
  color: #c8d8f0;
}

.palette-tab.active {
  color: #00d4ff;
  border-bottom-color: #00d4ff;
}

#palette-tab-content {
  min-height: 32px;
}

.palette-panel {
  display: none;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.palette-panel.active {
  display: flex;
}

/* ── Component Palette chips ─────────────────────────────── */

.palette-chip {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 5px;
  font: bold 11px 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
  letter-spacing: 0.5px;
}

.palette-chip:hover {
  box-shadow: 0 0 10px rgba(0,212,255,0.3);
}

.palette-chip.active {
  box-shadow: 0 0 14px rgba(0,212,255,0.5);
}

.palette-io {
  background: rgba(10, 42, 74, 0.6);
  border: 1.5px solid #1e6fa0;
  color: #39ff14;
}
.palette-io:hover, .palette-io.active {
  border-color: #39ff14;
  background: rgba(57, 255, 20, 0.08);
}

.palette-gate {
  background: rgba(14, 31, 51, 0.6);
  border: 1.5px solid #2a5a90;
  color: #a0c8ff;
}
.palette-gate:hover, .palette-gate.active {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.08);
}

.palette-ff {
  background: rgba(18, 13, 34, 0.6);
  border: 1.5px solid #5a2a9a;
  color: #c080ff;
}
.palette-ff:hover, .palette-ff.active {
  border-color: #a060ff;
  background: rgba(160, 96, 255, 0.08);
}

.palette-block {
  background: rgba(10, 26, 26, 0.6);
  border: 1.5px solid #1a8a6a;
  color: #20d4a0;
}
.palette-block:hover, .palette-block.active {
  border-color: #20d4a0;
  background: rgba(32, 212, 160, 0.08);
}

/* Memory tab chips — purple to match the rendered component colour. */
.palette-panel[data-panel="memory"] .palette-chip {
  border-color: #5a3d8a;
  color: #c0a0f0;
  background: rgba(40, 20, 70, 0.6);
}
.palette-panel[data-panel="memory"] .palette-chip:hover,
.palette-panel[data-panel="memory"] .palette-chip.active {
  border-color: #c0a0f0;
  background: rgba(192, 160, 240, 0.12);
}

.palette-tool {
  background: rgba(0, 40, 60, 0.6);
  border: 1.5px solid #0080c0;
  color: #00d4ff;
}
.palette-tool:hover, .palette-tool.active {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.12);
}

.palette-sep {
  width: 1px;
  height: 20px;
  background: #1e3a50;
  margin: 0 2px;
}

.palette-chip[draggable="true"] {
  cursor: grab;
}
.palette-chip[draggable="true"]:active {
  cursor: grabbing;
}

/* ── Quick Toolbar (below header, left of center) ────────── */
#quick-toolbar {
  position: fixed;
  top: 56px;
  left: 190px;
  z-index: 120;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  background: rgba(10, 14, 20, 0.85);
  border-bottom: 1px solid #1a2a3a;
  border-right: 1px solid #1a2a3a;
  border-radius: 0 0 8px 0;
}

/* ── Design Tool Groups ──────────────────────────────────── */
.design-tool-separator {
  height: 1px;
  background: #1e3a50;
  margin: 6px 0 2px;
}

.design-tool-group-label {
  color: #4a6080;
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 2px 8px;
  text-transform: uppercase;
}

.design-tool-gate {
  color: #a0c8ff !important;
  border-color: #2a5a90 !important;
}

.design-tool-gate.active,
.design-tool-gate:hover {
  background: rgba(0, 100, 200, 0.15) !important;
  border-color: #00d4ff !important;
}

.design-tool-ff {
  color: #c080ff !important;
  border-color: #5a2a9a !important;
}

.design-tool-ff.active,
.design-tool-ff:hover {
  background: rgba(160, 96, 255, 0.15) !important;
  border-color: #a060ff !important;
}

/* ── Memory Inspector Panel ──────────────────────────────── */
/* Panel uses `top` positioning + flex column so the body scrolls internally
   and the resize grip stays anchored to the panel's visible bottom-right
   corner (not the scroll content bottom). */
#mem-inspector {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 340px;
  height: 45vh;
  min-width: 220px;
  min-height: 150px;
  max-width: 95vw;
  max-height: 95vh;
  background: #0a0e14;
  border: 1px solid #5a3d8a;
  border-left: none;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  z-index: 160;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

/* Minimal resize grip in the panel's top-right corner.
   Three soft diagonal dashes; subtle by default, glows on hover.
   Dragging: up → panel grows upward, right → panel widens. */
#mem-resize-grip {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  cursor: nesw-resize;
  border-radius: 4px;
  background: transparent;
  z-index: 20;
  transition: background 0.15s ease-out;
}
#mem-resize-grip::before {
  content: '';
  position: absolute;
  inset: 4px;
  background-image:
    linear-gradient(45deg,
      transparent 0 28%,
      rgba(192,160,240,0.7) 28% 36%,
      transparent 36% 52%,
      rgba(192,160,240,0.7) 52% 60%,
      transparent 60% 76%,
      rgba(192,160,240,0.7) 76% 84%,
      transparent 84%);
  transition: background-image 0.15s ease-out;
  pointer-events: none;
}
#mem-resize-grip:hover {
  background: rgba(192,160,240,0.12);
}
#mem-resize-grip:hover::before {
  background-image:
    linear-gradient(45deg,
      transparent 0 28%,
      #e0c8ff 28% 36%,
      transparent 36% 52%,
      #e0c8ff 52% 60%,
      transparent 60% 76%,
      #e0c8ff 76% 84%,
      transparent 84%);
}

#mem-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #3a2060;
  color: #c0a0f0;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 1px;
  background: #0a0e14;
  flex: 0 0 auto;
}

#mem-inspector-header > div {
  display: flex;
  gap: 6px;
}

/* Readable header buttons — scales with panel tier. */
#mem-inspector-header button {
  font-size: 0.95em !important;
  padding: 0.35em 0.8em;
  letter-spacing: 0.5px;
  font-weight: bold;
  border-width: 1px;
}

#mem-inspector-body {
  padding: 4px 0;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

/* ── Pipeline Panel ──────────────────────────────────────── */
#pipeline-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 440px;
  height: 45vh;
  min-width: 320px;
  min-height: 150px;
  max-width: 95vw;
  max-height: 95vh;
  background: #0a0e14;
  border: 1px solid #2a6a8a;
  border-right: none;
  border-top-left-radius: 8px;
  z-index: 160;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;                /* base — modulated by _applyPipelineFontTier */
  color: #cfe6f0;
  display: flex;
  flex-direction: column;
}
#pipeline-panel.hidden { display: none; }

#pipeline-resize-grip {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  border-radius: 4px;
  background: transparent;
  z-index: 20;
  transition: background 0.15s ease-out;
}
#pipeline-resize-grip::before {
  content: '';
  position: absolute;
  inset: 4px;
  background-image:
    linear-gradient(135deg,
      transparent 0 28%,
      rgba(143,212,255,0.7) 28% 36%,
      transparent 36% 52%,
      rgba(143,212,255,0.7) 52% 60%,
      transparent 60% 76%,
      rgba(143,212,255,0.7) 76% 84%,
      transparent 84%);
}
#pipeline-resize-grip:hover { background: rgba(143,212,255,0.12); }
#pipeline-resize-grip:hover::before {
  background-image:
    linear-gradient(135deg,
      transparent 0 28%,
      #cfe6f0 28% 36%,
      transparent 36% 52%,
      #cfe6f0 52% 60%,
      transparent 60% 76%,
      #cfe6f0 76% 84%,
      transparent 84%);
}

#pipeline-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8em 1.2em 0.8em 2.6em; /* left pad clears the grip */
  border-bottom: 1px solid #2a4060;
  color: #8fd4ff;
  font-weight: bold;
  font-size: 1.1em;
  letter-spacing: 1px;
  flex: 0 0 auto;
}
#pipeline-panel-header > div { display: flex; gap: 6px; }

/* Override the tiny inline font-size on header buttons — scales with panel tier. */
#pipeline-panel-header button {
  font-size: 0.95em !important;
  padding: 0.35em 0.8em;
  letter-spacing: 0.5px;
  font-weight: bold;
  border-width: 1px;
}
#pipeline-panel-header #btn-stageview-toggle {
  background: #0d2030;
  border-color: #2a6a8a;
  color: #8fd4ff;
}
#pipeline-panel-header #btn-stageview-toggle.active {
  background: #163a5a;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(143,212,255,0.6);
}

#pipeline-panel-summary {
  padding: 0.8em 1.2em;
  border-bottom: 1px solid #1a3040;
  font-size: 1em;
  color: #8fd4ff;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.3em 1.2em;
}
#pipeline-panel-summary .k { color: #567; }
#pipeline-panel-summary .v { color: #cfe6f0; text-align: right; font-weight: bold; }
#pipeline-panel-summary .warn { color: #ffa028; }

#pipeline-panel-body {
  padding: 0.4em 0;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.pipe-stage-row {
  display: flex;
  align-items: center;
  padding: 0.6em 1.2em;
  border-bottom: 1px solid #10202c;
  font-size: 1em;
  gap: 0.8em;
  cursor: default;
}
.pipe-stage-row.bottleneck {
  background: #2a1010;
  border-left: 3px solid #ff5050;
}
.pipe-stage-idx {
  font-weight: bold;
  color: #8fd4ff;
  min-width: 3.6em;
}
.pipe-stage-row.bottleneck .pipe-stage-idx { color: #ff8080; }
.pipe-stage-depth { min-width: 5.6em; color: #cfe6f0; }
.pipe-stage-count { min-width: 6em; color: #678; }
.pipe-stage-badges { display: inline-flex; gap: 3px; min-width: 2.6em; }
.pipe-badge {
  display: inline-block;
  width: 1.2em; height: 1.2em;
  border-radius: 3px;
  font-size: 0.75em;
  font-weight: bold;
  text-align: center;
  line-height: 1.2em;
}
.pipe-badge-stall { background: #2a3a10; color: #c0ff50; border: 1px solid #5a7a20; }
.pipe-badge-flush { background: #2a1020; color: #ff80c0; border: 1px solid #7a2060; }
.pipe-badge-elastic { background: #2a2010; color: #ffc070; border: 1px solid #7a6020; }
.pipe-stage-bar {
  flex: 1 1 auto;
  height: 0.8em;
  background: #0d1820;
  border-radius: 2px;
  overflow: hidden;
}
.pipe-stage-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #2a6a8a, #8fd4ff);
}
.pipe-stage-row.bottleneck .pipe-stage-bar > div {
  background: linear-gradient(90deg, #8a2a2a, #ff8080);
}
#btn-stageview-toggle.active, #btn-pipeline-toggle.active {
  background: #163a5a !important;
  color: #ffffff !important;
  box-shadow: 0 0 6px rgba(143,212,255,0.6);
}
.pipe-stage-row { cursor: pointer; }
.pipe-stage-row:hover { background: #0e1820; }
.pipe-stage-row.active-hl { outline: 1px solid #8fd4ff; background: #0a1a28; }
.pipe-empty { padding: 2em 1.2em; color: #567; text-align: center; font-size: 1em; }

.pipe-violations-header {
  margin-top: 0.6em;
  padding: 0.5em 1.2em;
  font-weight: bold;
  color: #ff8080;
  border-top: 1px solid #2a0a0a;
  border-bottom: 1px solid #2a0a0a;
  background: #1a0808;
  font-size: 0.95em;
  letter-spacing: 1px;
}
.pipe-violation-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6em;
  padding: 0.5em 1.2em;
  border-bottom: 1px solid #180505;
  cursor: pointer;
  font-size: 0.9em;
  color: #ffb0b0;
  transition: background 0.15s;
}
.pipe-violation-row:hover { background: #2a1010; }
.pvi-stages { font-weight: bold; color: #ff8080; }
.pvi-names { color: #cfe6f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvi-missing { color: #ff5050; font-size: 0.85em; }

.pipe-hazards-header {
  margin-top: 0.6em;
  padding: 0.5em 1.2em;
  font-weight: bold;
  color: #ffc080;
  border-top: 1px solid #2a1a08;
  border-bottom: 1px solid #2a1a08;
  background: #1a1008;
  font-size: 0.95em;
  letter-spacing: 1px;
}
.pipe-hazard-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.7em;
  padding: 0.6em 1.2em 0.3em 1.2em;
  cursor: pointer;
  font-size: 1em;
  color: #ffd8a0;
  transition: background 0.15s;
}
.pipe-hazard-row:hover { background: #2a1a08; }
.pipe-hazard-fix {
  padding: 0 1.2em 0.7em 2.6em;
  border-bottom: 1px solid #1a1208;
  color: #c4b48c;
  font-size: 0.95em;
  line-height: 1.35;
  font-style: italic;
}
.pipe-hz-type {
  display: inline-block;
  min-width: 3em;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.95em;
  letter-spacing: 0.6px;
  text-align: center;
  background: #2a1a08;
  color: #ffd8a0;
  border: 1px solid #4a3010;
}
.pipe-hz-type.hz-raw      { background: #2a1a08; color: #ff9028; border-color: #5a3010; }
.pipe-hz-type.hz-war      { background: #2a2008; color: #ffc840; border-color: #5a4010; }
.pipe-hz-type.hz-waw      { background: #2a0a20; color: #ff5fb0; border-color: #5a1060; }
.pipe-hz-type.hz-loop     { background: #2a0808; color: #ff5050; border-color: #5a1010; }
.pipe-hz-type.hz-loaduse  { background: #201a2a; color: #b090ff; border-color: #40306a; margin-left: 4px; }

.pipe-prog-header {
  margin-top: 0.6em;
  padding: 0.5em 1.2em;
  font-weight: bold;
  color: #b090ff;
  border-top: 1px solid #1a1230;
  border-bottom: 1px solid #1a1230;
  background: #10081a;
  font-size: 0.95em;
  letter-spacing: 1px;
}
.pipe-prog-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 1.2em;
  border-bottom: 1px solid #100818;
  font-size: 0.95em;
  color: #d0c0ff;
}
.pipe-prog-names   { color: #cfe6f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 0.92em; }
.pipe-prog-pc      { color: #7088a0; font-size: 0.85em; margin-right: 3px; }
.pipe-prog-arrow   { color: #b090ff; margin: 0 4px; font-weight: bold; }
.pipe-prog-reg     { color: #ffa028; font-weight: bold; font-size: 0.9em; padding: 1px 6px; border-radius: 3px; background: #2a1a08; border: 1px solid #4a3010; }
.pipe-prog-bubbles { color: #ff8080; font-size: 0.88em; font-style: italic; min-width: 4.5em; text-align: right; }
.pipe-prog-bubbles.ok   { color: #6a9a70; font-style: normal; }
.pipe-prog-bubbles.info { color: #7088a0; font-style: normal; font-size: 0.82em; }
.pipe-prog-clean   { padding: 0.8em 1.2em; color: #6a9a70; font-size: 0.92em; font-style: italic; }

.mem-row {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  border-bottom: 1px solid #1a1228;
  cursor: pointer;
  transition: background 0.15s;
}

.mem-row:hover {
  background: #1a1430;
}

.mem-row-label {
  color: #c0a0f0;
  font-weight: bold;
  min-width: 60px;
}

.mem-row-type {
  color: #9880c8;
  font-size: 0.8em;
  min-width: 40px;
}

.mem-row-size {
  color: #a088d0;
  font-size: 0.9em;
  min-width: 36px;
}

.mem-row-value {
  color: #39ff14;
  font-weight: bold;
  margin-left: auto;
  font-size: 1.1em;
}

.mem-row-binary {
  color: #8098b8;
  font-size: 0.9em;
  margin-left: 8px;
  min-width: 50px;
  text-align: right;
}

.mem-row-edit {
  width: 50px;
  padding: 1px 4px;
  background: #161e2e;
  border: 1px solid #3a4a60;
  border-radius: 3px;
  color: #39ff14;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1em;
  font-weight: bold;
  text-align: center;
  margin-left: 6px;
}

.mem-row-edit:focus {
  border-color: #a078e0;
  outline: none;
}

.mem-comp-header {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid #2a1a40;
  cursor: pointer;
  background: #0e0a18;
  transition: background 0.15s;
}

.mem-comp-header:hover {
  background: #1a1430;
}

.mem-bits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 5px 12px 8px;
  border-bottom: 1px solid #1a1228;
}

.mem-bit-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 30px;
  padding: 3px 5px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}

.mem-bit-cell:hover {
  border-color: #a078e0;
}

.mem-bit-on {
  background: #1a2a10;
  border-color: #2a4a18;
}

.mem-bit-off {
  background: #10101a;
  border-color: #1a1a28;
}

.mem-bit-label {
  font-size: 0.7em;
  color: #9880c8;
  font-weight: bold;
}

.mem-bit-val {
  font-size: 1.2em;
  font-weight: bold;
}

.mem-bit-on .mem-bit-val {
  color: #39ff14;
}

.mem-bit-off .mem-bit-val {
  color: #666;
}

.mem-empty {
  color: #3a2060;
  text-align: center;
  padding: 20px 12px;
  font-style: italic;
}

.mem-ram-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 2px;
  padding: 4px 12px 8px;
}

.mem-ram-cell {
  background: #161228;
  border: 1px solid #2a1a40;
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 0.8em;
  text-align: center;
  color: #a088d0;
}

.mem-ram-cell-active {
  color: #39ff14;
  border-color: #5a3d8a;
}

.mem-ram-addr {
  color: #8060b8;
  font-size: 0.7em;
  display: block;
}

.mem-regfile-table {
  padding: 4px 12px 8px;
  border-bottom: 1px solid #1a1228;
}

.mem-regfile-row {
  display: flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 1px;
  background: #10101a;
  cursor: pointer;
  transition: background 0.15s;
}

.mem-regfile-row:hover {
  background: #1a1430;
}

.mem-regfile-active {
  background: #14200e;
}

.mem-regfile-name {
  color: #b098e0;
  font-weight: bold;
  font-size: 0.9em;
  min-width: 28px;
}

.mem-regfile-val {
  color: #39ff14;
  font-weight: bold;
  font-size: 1em;
  min-width: 50px;
}

.mem-regfile-bin {
  color: #8098b8;
  font-size: 0.9em;
  margin-left: auto;
}

#mem-inspector::-webkit-scrollbar { width: 6px; }
#mem-inspector::-webkit-scrollbar-track { background: #0a0e14; }
#mem-inspector::-webkit-scrollbar-thumb { background: #3a2060; border-radius: 3px; }

/* ── Context Menu ───────────────────────────────────────── */
#context-menu {
  position: fixed;
  z-index: 400;
  background: #0d1320;
  border: 1px solid #2a4060;
  border-radius: 6px;
  padding: 4px 0;
  min-width: 150px;
  font: 11px 'JetBrains Mono', monospace;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.ctx-item {
  padding: 6px 14px;
  color: #c8d8f0;
  cursor: pointer;
  transition: background 0.1s;
}

.ctx-item:hover {
  background: #1a2a40;
}

.ctx-danger {
  color: #ff4444;
}

.ctx-danger:hover {
  background: #2a1010;
}

.ctx-sep {
  height: 1px;
  background: #1e3a50;
  margin: 3px 8px;
}

/* ── Keyboard Shortcuts Panel ───────────────────────────── */
#shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

#shortcuts-modal {
  background: #0a0e14;
  border: 1px solid #2a4060;
  border-radius: 10px;
  width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  font-family: 'JetBrains Mono', monospace;
}

#shortcuts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #1e3a50;
  color: #00d4ff;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 1px;
}

#shortcuts-body {
  overflow-y: auto;
  padding: 8px 16px 16px;
}

.sc-group-title {
  color: #4a6080;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 12px 0 4px;
  text-transform: uppercase;
}

.sc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.sc-action {
  color: #c8d8f0;
  font-size: 11px;
}

.sc-key {
  background: #161e2e;
  border: 1px solid #2a3a50;
  border-radius: 3px;
  padding: 2px 8px;
  color: #00d4ff;
  font-size: 10px;
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

.sc-edit-btn {
  background: none;
  border: 1px solid #2a3a50;
  color: #4a6080;
  font: 8px 'JetBrains Mono', monospace;
  padding: 1px 5px;
  border-radius: 2px;
  cursor: pointer;
}

.sc-edit-btn:hover { color: #ffa028; border-color: #ffa028; }

.sc-reset-btn {
  background: none;
  border: 1px solid #3a2020;
  color: #ff6666;
  font: 8px 'JetBrains Mono', monospace;
  padding: 1px 5px;
  border-radius: 2px;
  cursor: pointer;
}

.sc-reset-btn:hover { background: #2a1010; }

/* ── Palette Search ─────────────────────────────────────── */
#palette-search {
  width: 90px;
  margin: 0;
  padding: 2px 6px;
  background: #0a1520;
  border: 1px solid #1e3040;
  border-radius: 3px;
  color: #c8d8f0;
  font: 10px 'JetBrains Mono', monospace;
  outline: none;
  transition: width 0.2s, border-color 0.2s;
}

#palette-search:focus {
  width: 160px;
  border-color: #00d4ff;
}

#palette-search::placeholder {
  color: #2a4060;
}

/* ── Wire Tooltip ───────────────────────────────────────── */
#wire-tooltip {
  position: fixed;
  z-index: 300;
  background: rgba(10, 14, 20, 0.95);
  border: 1px solid #e0a030;
  border-radius: 5px;
  padding: 6px 12px;
  font: bold 13px 'JetBrains Mono', monospace;
  color: #e0a030;
  pointer-events: none;
  white-space: nowrap;
  max-width: 350px;
}

/* ── CU Editor Modal ────────────────────────────────────── */
#cu-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

#cu-editor-modal {
  background: #0a0e14;
  border: 2px solid #ffa028;
  border-radius: 12px;
  width: 850px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  font-family: 'JetBrains Mono', monospace;
}

#cu-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 2px solid #4a3020;
  color: #ffa028;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
}

#cu-editor-header > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

#cu-opcount-select {
  font: bold 12px 'JetBrains Mono', monospace !important;
  background: #1a1410 !important;
  border: 2px solid #ffa028 !important;
  color: #ffa028 !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  cursor: pointer;
}

#cu-editor-table-wrap {
  overflow-y: auto;
  flex: 1;
  max-height: 70vh;
}

#cu-editor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#cu-editor-table th {
  color: #8a6830;
  font-size: 12px;
  font-weight: bold;
  padding: 10px 10px;
  text-align: center;
  border-bottom: 2px solid #3a2010;
  position: sticky;
  top: 0;
  background: #0a0e14;
}

#cu-editor-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #1a1208;
  text-align: center;
}

.cu-op {
  color: #8a6020;
  font-weight: bold;
  width: 50px;
  font-size: 13px;
  white-space: nowrap;
}

.cu-drag-handle {
  cursor: grab;
  color: #3a2818;
  font-size: 14px;
  margin-right: 4px;
  transition: color 0.15s;
  user-select: none;
}

.cu-drag-handle:hover {
  color: #ffa028;
}

#cu-editor-table tr[draggable] {
  transition: opacity 0.15s, background 0.15s;
}

.cu-row-dragging {
  opacity: 0.3;
}

.cu-row-dragover {
  background: #2a1a08 !important;
  box-shadow: 0 -2px 0 #ffa028 inset;
}

.cu-name-input {
  width: 75px;
  padding: 4px 6px;
  background: #161210;
  border: 1px solid #3a2818;
  border-radius: 3px;
  color: #ffa028;
  font: bold 13px 'JetBrains Mono', monospace;
  text-align: center;
}

.cu-aluop-input {
  width: 42px;
  padding: 4px 6px;
  background: #161210;
  border: 1px solid #3a2818;
  border-radius: 3px;
  color: #c8d8f0;
  font: 13px 'JetBrains Mono', monospace;
  text-align: center;
}

.cu-check {
  width: 20px;
  height: 20px;
  accent-color: #ffa028;
  cursor: pointer;
}

.cu-hex {
  color: #5a7090;
  font-size: 12px;
}

/* ── ROM View Tabs ──────────────────────────────────────── */
.rom-tab {
  font: bold 9px 'JetBrains Mono', monospace;
  padding: 3px 10px;
  background: #0a1520;
  border: 1px solid #2a4060;
  color: #4a6080;
  cursor: pointer;
  transition: all 0.15s;
}

.rom-tab:first-child { border-radius: 3px 0 0 3px; }
.rom-tab:last-child { border-radius: 0 3px 3px 0; }
.rom-tab:not(:first-child) { border-left: none; }

.rom-tab.active {
  background: #1a2a40;
  color: #00d4ff;
  border-color: #00d4ff;
}

.rom-tab:hover:not(.active) {
  color: #8090a8;
}

/* ── ROM Code View ──────────────────────────────────────── */
#rom-code-view {
  flex: 1;
  width: 100%;
  min-height: 350px;
  background: #0a0e14;
  border: none;
  border-top: 1px solid #1e3a50;
  color: #c8d8f0;
  font: 14px 'JetBrains Mono', monospace;
  padding: 16px 20px;
  resize: none;
  outline: none;
  line-height: 1.7;
  tab-size: 4;
}

#rom-error-bar {
  background: #1a0808;
  border-top: 1px solid #4a1010;
  color: #ff4444;
  font: 11px 'JetBrains Mono', monospace;
  padding: 6px 16px;
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
}

#rom-code-view::selection {
  background: rgba(0, 212, 255, 0.2);
}

/* ── ROM Editor Modal ───────────────────────────────────── */
#rom-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

#rom-editor-modal {
  background: #0a0e14;
  border: 1px solid #5a3d8a;
  border-radius: 10px;
  width: 90vw;
  max-width: 1200px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  font-family: 'JetBrains Mono', monospace;
}

#rom-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #3a2060;
  color: #c0a0f0;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
}

#rom-editor-header > div { display: flex; gap: 6px; }

#rom-editor-table-wrap {
  overflow-y: auto;
  flex: 1;
  max-height: 50vh;
}

#rom-editor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

#rom-editor-table th {
  color: #4a6080;
  font-size: 8px;
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid #1a1228;
  position: sticky;
  top: 0;
  background: #0a0e14;
}

#rom-editor-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #0e0a18;
}

.rom-addr { color: #5a4080; font-weight: bold; width: 40px; }
.rom-hex { color: #39ff14; font-weight: bold; }
.rom-asm { color: #c8d8f0; }

.rom-hex-input, .rom-asm-input {
  width: 70px;
  padding: 1px 4px;
  background: #161e2e;
  border: 1px solid #2a3a50;
  border-radius: 2px;
  color: #39ff14;
  font: 10px 'JetBrains Mono', monospace;
}

.rom-asm-input {
  width: 140px;
  color: #c8d8f0;
}

.rom-del-btn {
  background: none;
  border: 1px solid #3a2020;
  color: #ff4444;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  cursor: pointer;
}

.rom-del-btn:hover { background: #2a1010; }

#rom-editor-builder {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-top: 1px solid #3a2060;
  align-items: center;
}

#rom-editor-builder select {
  font: 10px 'JetBrains Mono', monospace;
  background: #161e2e;
  border: 1px solid #2a3a50;
  color: #c8d8f0;
  padding: 2px 4px;
  border-radius: 2px;
}

/* ── Retime Suggestion Banner (top, prominent) ────────────── */
#retime-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #0d1820 0%, #0a0e14 100%);
  border: 2px solid #5a8a3d;
  border-radius: 10px;
  padding: 18px 26px;
  min-width: 560px;
  max-width: 860px;
  z-index: 400;
  font-family: 'JetBrains Mono', monospace;
  color: #c0f0a0;
  box-shadow: 0 6px 28px rgba(0,255,120,0.22), 0 0 0 4px rgba(90,138,61,0.12);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas: 'title actions' 'body actions';
  gap: 8px 24px;
}
#retime-banner.hidden { display: none; }
#retime-banner-title {
  grid-area: title;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #8ad44a;
}
#retime-banner-body {
  grid-area: body;
  font-size: 16px;
  line-height: 1.6;
  color: #cfe6f0;
}
#retime-banner-body .r-desc   { color: #fff; font-weight: bold; font-size: 18px; margin-bottom: 6px; letter-spacing: 0.3px; }
#retime-banner-body .r-metric { color: #8ad44a; font-weight: bold; }
#retime-banner-body .r-before { color: #ff8080; text-decoration: line-through; }
#retime-banner-body .r-arrow  { color: #8fd4ff; margin: 0 6px; font-weight: bold; }
#retime-banner-actions {
  grid-area: actions;
  align-self: center;
  display: flex;
  gap: 10px;
}
#retime-banner-actions button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: bold;
  padding: 10px 22px;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 0.8px;
}
#btn-retime-accept {
  background: #1a3a10;
  border: 1px solid #5a8a3d;
  color: #c0f0a0;
}
#btn-retime-accept:hover { background: #2a5a20; box-shadow: 0 0 10px rgba(90,138,61,0.5); }
#btn-retime-reject {
  background: #2a1010;
  border: 1px solid #5a3030;
  color: #f0a0a0;
}
#btn-retime-reject:hover { background: #3a1818; }

/* ── Retime Applied Banner (bottom, success) ───────────────── */
#retime-applied-banner {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: linear-gradient(180deg, #1a3a10 0%, #122a08 100%);
  border: 2px solid #8ad44a;
  border-radius: 10px;
  padding: 18px 32px;
  min-width: 480px;
  z-index: 600;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 6px 30px rgba(138,212,74,0.35), 0 0 0 5px rgba(138,212,74,0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#retime-applied-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#retime-applied-banner .r-text {
  font-size: 17px;
  color: #e8ffd0;
  font-weight: bold;
  letter-spacing: 0.3px;
  line-height: 1.4;
}
#retime-applied-banner .r-text .r-hint {
  display: block;
  font-size: 13px;
  color: #8ad44a;
  font-weight: normal;
  margin-top: 3px;
  letter-spacing: 0.5px;
}
#retime-applied-banner.failed {
  background: linear-gradient(180deg, #3a1010 0%, #2a0808 100%);
  border-color: #d47070;
  box-shadow: 0 6px 30px rgba(212,80,80,0.35), 0 0 0 5px rgba(212,80,80,0.1);
}
#retime-applied-banner.failed .r-text   { color: #ffd0d0; }
#retime-applied-banner.failed .r-hint   { color: #ff8080; }

/* ── Examples Modal ──────────────────────────────────────── */
#examples-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

#examples-modal {
  background: #0a0e14;
  border: 1px solid #5a3d8a;
  border-radius: 10px;
  width: 96vw;
  max-width: 1700px;
  height: 92vh;
  max-height: 94vh;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
}

#examples-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #3a2060;
  color: #c0a0f0;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  background: #0a0e14;
  z-index: 1;
}

#examples-list {
  padding: 8px;
}

.example-card {
  padding: 14px 16px;
  margin: 0;
  border: 1px solid #1a1228;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.example-card:hover {
  background: #1a1430;
  border-color: #5a3d8a;
}

.example-card-title {
  color: #c0a0f0;
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.example-card-desc {
  color: #8a9ab0;
  font-size: 11px;
  line-height: 1.5;
}

.example-card-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.example-tag {
  font-size: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.example-tag-beginner {
  background: #0a2a1a;
  color: #39ff14;
  border: 1px solid #1a4a2a;
}

.example-tag-intermediate {
  background: #1a1a30;
  color: #6a8aff;
  border: 1px solid #2a2a50;
}

.example-tag-advanced {
  background: #2a1a10;
  color: #ffa028;
  border: 1px solid #4a3020;
}

.example-tag-component {
  background: #10101a;
  color: #5a6a80;
  border: 1px solid #1a1a28;
}

.examples-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 8px 0 8px;
  border-bottom: 1px solid #2a1a40;
  position: sticky;
  top: 38px;
  background: #0a0e14;
  z-index: 1;
}
.examples-tab {
  flex: 1;
  background: transparent;
  color: #6a7a90;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.examples-tab:hover {
  color: #c0a0f0;
  background: #140a28;
}
.examples-tab.active {
  color: #c0a0f0;
  background: #1a1430;
  border-color: #3a2060;
  border-bottom-color: #1a1430;
  margin-bottom: -1px;
}
.examples-tab-count {
  background: #2a1a40;
  color: #a080d0;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: bold;
}
.examples-tab.active .examples-tab-count {
  background: #3a2060;
  color: #d8b8ff;
}
.examples-cards {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .examples-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .examples-cards { grid-template-columns: 1fr; }
}
.examples-empty {
  padding: 40px 20px;
  text-align: center;
  color: #5a6a80;
  font-size: 11px;
}

/* ── General Fixes ───────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* Scrollbar styling for dark theme */
#debug-panel::-webkit-scrollbar,
#command-palette-list::-webkit-scrollbar,
#truthtable-container::-webkit-scrollbar {
  width: 6px;
}

#debug-panel::-webkit-scrollbar-track,
#command-palette-list::-webkit-scrollbar-track,
#truthtable-container::-webkit-scrollbar-track {
  background: #0a0e14;
}

#debug-panel::-webkit-scrollbar-thumb,
#command-palette-list::-webkit-scrollbar-thumb,
#truthtable-container::-webkit-scrollbar-thumb {
  background: #2a4060;
  border-radius: 3px;
}
