/* ── Excel ↔ VBA toggle (lives in the left toolbar) ── */

.compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 4px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.compare-toggle[hidden] {
  display: none;
}

.compare-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.compare-toggle-btn:hover {
  color: white;
}

.compare-toggle-btn.active {
  background: white;
  color: var(--excel-toolbar);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* When the VBA pill is the active mode, repaint the toolbar to the
   classic VBE blue so the panel reads as a distinct editor, not Excel. */
.excel-panel.mode-vba .excel-toolbar {
  background: #1f3864;
}

.excel-panel.mode-vba .compare-toggle-btn.active {
  color: #1f3864;
}

/* Hide formula bar in VBA mode — there's no cell selection to show. */
.excel-panel.mode-vba .formula-bar {
  display: none;
}

/* ── VBA code panel ── */

/* Styled to feel like the actual VBA editor (VBE):
   white background, Courier New text, grey selection margin on the left,
   and default-black for everything except keywords (blue) and comments
   (green). VBE itself doesn't color strings or numbers. */
.vba-container {
  flex: 1 1 auto;
  margin: 0;
  padding: 12px 14px 12px 36px;
  background: #ffffff;
  border-left: 28px solid #e7e7e7;
  border-bottom: 1px solid var(--border);
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  line-height: 1.4;
  color: #000000;
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre;
  tab-size: 4;
  -moz-tab-size: 4;
  min-height: 220px;
  margin-left: 0;
}

.vba-container[hidden] {
  display: none;
}

.vba-container code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  color: inherit;
}

/* VBE-faithful token colors: only keywords (blue) and comments (green)
   get a color in the real editor. Identifiers, strings, and numbers
   render in the default text color (black). */
.vba-tok-keyword { color: #0000ff; }
.vba-tok-type    { color: #0000ff; }
.vba-tok-string  { color: #000000; }
.vba-tok-comment { color: #008000; }
.vba-tok-number  { color: #000000; }
