/* styles.css – canvas 3000x3000 + scroll global + GUI fija a la izquierda */

/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Permitimos scroll global en el documento */
.mandalas-page {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #181818;
  color: #f5f5f5;
  min-width: 1300px;
  min-height: 700px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Contenedor raíz solo para agrupar */
.app-root {
  position: relative;
  padding: 0;
  z-index: 10;
  margin: 0;
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: clamp(320px, var(--controls-panel-w, 420px), 80vw) 1fr;
}

/* Contenedor del canvas: tamaño LÓGICO 3000x3000 */
.canvas-scroll {
  position: relative;
  overflow: auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.canvas-container {
  width: 100%;
  height: 100%;
}

.canvas-scroll-chords {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: calc(100vh - 60px);
  overflow: auto;
}
.canvas-container-chords {
  width: 100%;
  height: 100%;
}

/* Canvas de dibujo: ocupa todo el contenedor */
#bcm_canvas {
  width: 100%;
  height: 100%;
  display: block;
}
/* --- PANEL DE CONTROLES FIJO A LA IZQUIERDA (25% ancho) --- */

.controls-panel {
  position: sticky;
  top: 0;
  left: 0;
  width: auto;
  height: 100%;
  min-height: 0;

  padding: 10px 14px;
  margin: 0;

  background: #181818;
  border-right: 1px solid #444;

  /* Hint to the browser that form controls inside should use dark UI */
  color-scheme: dark;

  overflow-y: auto; /* scroll interno si la GUI es alta */
  overflow-x: hidden;
  z-index: 10;
}

.controls-panel-columns {
  display: flex;
  gap: 14px;
  height: 100%;
  min-width: 0;
}

.controls-panel-col {
  flex: 1 1 0;
  min-width: 260px;
  min-width: 0;
}

.controls-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
}

.controls-resize-handle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.controls-panel.hidden {
  display: none;
}

.controls-panel h1 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 10px;
  font-size: 12px;
  color: #a0a0b5;
}

/* Bloques dentro del panel */

.block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #262636;
}

.block-gallery-buttons{
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #262636;
}

.block h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e0e0ff;
}

.hint {
  margin: 0 0 6px;
  font-size: 11px;
  color: #b0b0c8;
}

.hint code {
  font-family: "JetBrains Mono", Consolas, monospace;
  background: #1e1e2a;
  padding: 1px 4px;
  border-radius: 3px;
}

/* Textarea para BRANCHES */
.branches-colored-input {
  position: relative;
  width: 100%;
  background: #181819;
  border: 1px solid #272738;
  border-radius: 6px;
}

.branches-colored-input__overlay {
  position: absolute;
  inset: 0;
  padding: 6px;
  border-radius: 6px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  pointer-events: none;
  color: #f5f5ff;
}

.branches-colored-input__overlay::-webkit-scrollbar {
  width: 0;
  height: 0;
}

textarea#branchesInput {
  width: 100%;
  min-height: 105px;
  resize: horizontal; /* or: both */
  overflow: auto;
  border-radius: 6px;
  border: none;
  padding: 6px;
  background: transparent;
  color: transparent;
  caret-color: #f5f5ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  position: relative;
  z-index: 1;
}

textarea#vueltasInput {
  width: 100%;
  min-height: 250px;
  resize: horizontal; /* or: both */
  overflow: auto;
  border-radius: 6px;
  border: 1px solid #272738;
  padding: 6px;
  background: #181819;
  color: #f5f5ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

textarea#branchesInput:focus {
  outline: 1px solid #4f7dff;
  border-color: #4f7dff;
}

.idem-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  flex-wrap: wrap;
}

.idem-row label {
  font-size: 11px;
  color: #9090b0;
  white-space: nowrap;
}

.idem-row input[type="number"] {
  width: 52px;
  padding: 2px 5px;
  font-size: 12px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: #e0e0ff;
}

.idem-row--sliders {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.idem-slider-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.idem-slider-field label {
  min-width: 75px;
  font-size: 11px;
  color: #9090b0;
  white-space: nowrap;
}

.idem-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.idem-slider-wrap input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #333;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.idem-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--slider-color, #00aae4);
  border: none;
  cursor: pointer;
}

.idem-slider-value {
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #e0e0e0;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Campos genéricos */

.field {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 6px;
  font-size: 11px;
}

.field label {
  flex: 0 0 auto;
  min-width: 75px;
}

.field input[type="range"] {
  flex: 1;
}

.controls-panel input:not([type="range"]):not([type="checkbox"]):not(
    [type="radio"]
  ):not([type="color"]),
.controls-panel textarea {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.field input[type="text"] {
  border-radius: 6px;
  border: 1px solid #272738;
  padding: 6px;
  background: #181819;
  color: #f5f5ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.field select {
  flex: 1 1 auto;
  border-radius: 6px;
  border: 1px solid #272738;
  padding: 6px 28px 6px 10px;
  background-color: #181819;
  color: #f5f5ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  -webkit-appearance: none;
  appearance: none;

  /* Simple chevron using gradients so we don't depend on external assets */
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(245, 245, 255, 0.8) 50%),
    linear-gradient(135deg, rgba(245, 245, 255, 0.8) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 55%,
    calc(100% - 10px) 55%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

.field select:hover {
  border-color: #3a3a56;
}

.field select:focus {
  outline: 1px solid #4f7dff;
  border-color: #4f7dff;
}

.field select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dropdown list colors (browser support varies; helps on some platforms) */
.controls-panel select option,
.controls-panel select optgroup {
  background: #181819;
  color: #f5f5ff;
}

.field input[type="range"] {
  flex: 1.2 1 auto;
}

.field-value {
  width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: #d0d0e8;
}

.checkbox-field {
  margin-top: 10px;
}

.checkbox-field label {
  font-size: 12px;
}

select#styleSelect {
  flex: 1 1 auto;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #272738;
  background: #181822;
  color: #f5f5ff;
  font-size: 11px;
}

button#btnRedraw,
button#saveColors,
button#saveToGallery,
button#updateBtn,
button#copyChords {
  flex: 1 1 0;
  width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #242633;
  color: var(--fg);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}

button#btnApplyBranches{
  flex: 1 1 0;
  width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(128, 207, 71, 0.4);
  background: rgba(128, 207, 71, 0.4);
  color: var(--fg);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}


button#btnReset,
button#btnApply,
button#btnSave,
button#btnDownloadPng,
button#btnCopyPng,
button#btnIncidence,
button#btnConnectionsSummary,
#saveColors,
button#saveToGallery,
button#updateBtn,
button#copyChords {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #242633;
  color: var(--fg);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}

button#btnRedraw:hover,

button#btnReset:hover,
button#btnApply:hover,
button#btnSave:hover,
button#btnDownloadPng:hover,
button#btnCopyPng:hover,
button#btnIncidence:hover,
button#btnConnectionsSummary:hover,
#saveColors:hover,
button#saveToGallery:hover,
button#updateBtn:hover,
button#copyChords:hover {
  background: #2d3040;
}

button#btnApplyBranches:hover{
  background: rgba(128, 207, 71, 0.6);
}

button#btnRedraw:active,
button#btnApplyBranches:active,
button#btnReset:active,
button#btnApply:active,
button#btnSave:active,
button#btnDownloadPng:active,
button#btnCopyPng:active,
button#btnIncidence:active,
button#btnConnectionsSummary:active,
#saveColors:active,
button#saveToGallery:active,
button#updateBtn:active,
button#copyChords:active {
  transform: scale(0.97);
}

/* Color pickers */

.field input[type="color"] {
  width: 38px;
  height: 20px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid #3a3a4a;
  background: #1a1a22;
}

/* Slider color*/
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}
/* Track (WebKit: Chrome, Edge, Safari) */
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #242833; /* dark background */
  box-shadow: 0 0 0 1px #1f2933; /* subtle outline */
}
/* Thumb (WebKit) */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--slider-color); /* blue center */
  border: 3px solid #1f2933; /* dark ring */
  box-shadow: 0 0 0 1px #1f2933; /* outer halo to blend with track */
  margin-top: -6px; /* centers thumb on 6px track */
}
/* Track (Firefox) */
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #242833;
  box-shadow: 0 0 0 1px #1f2933;
}
/* Thumb (Firefox) */
input[type="range"]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--slider-color);
  border: 3px solid #1f2933;
  box-shadow: 0 0 0 1px #1f2933;
}
/* Optional: focus ring */
input[type="range"]:focus-visible {
  outline: none;
}
input[type="range"]:focus-visible::-webkit-slider-thumb,
input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px #2563eb;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--slider-color);
  cursor: pointer;
}

.export-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.export-buttons button {
  flex: 1 1 0;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #242633;
  color: var(--fg);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}

.export-buttons button:hover {
  background: #2d3040;
}

.export-buttons button:active {
  transform: scale(0.97);
}

/* Unified action buttons row */
.action-buttons-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: nowrap;
}

.action-buttons-row button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #242633;
  color: var(--fg);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.05s;
}

.action-buttons-row button:hover {
  background: #2d3040;
}

.action-buttons-row button:active {
  transform: scale(0.97);
}

.action-buttons-row button#btnReset {
  flex: 0 0 auto;
  padding: 5px 8px;
}

/* pop over */
.vi-logo-wrap {
  position: relative;
  display: inline-block;
}

.vi-hotkeys-popover {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 10px;

  background: rgba(10, 10, 10, 0.95);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 12px;

  min-width: 280px;
  max-width: 420px;
  z-index: 50;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.vi-logo-wrap:hover .vi-hotkeys-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.vi-hotkeys-title {
  font-size: 12px;
  color: #ddd;
  margin-bottom: 8px;
}

.vi-hotkeys-grid {
  display: grid;
  gap: 6px;
}

.vi-hotkeys-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 10px;
}

.vi-kbd {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #151515;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.vi-hotkeys-label {
  color: #bbb;
  font-size: 12px;
}

.vi-logo {
  background: #1a1a1a;
  width: 400px;
  height: auto;
  display: block;
}

.hl-div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 150px));
  column-gap: 4px;
  row-gap: 8px;
}

.hl-card {
  display: flex;
  width: fit-content;
  gap: 4px;
}

.hl-card input[type="text"] {
  border-radius: 6px;
  width: 30%;
  border: 1px solid #272738;
  padding: 6px;
  background: #181819;
  color: #f5f5ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.hl-chord-div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hl-chord-card {
  display: flex;
  gap: 10px;
}

.hl-chord-card input[type="text"] {
  border-radius: 6px;
  width: 30%;
  border: 1px solid #272738;
  padding: 6px;
  background: #181819;
  color: #f5f5ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

/* Color tab table */
.color-table {
  width: 100%;
  border-collapse: collapse;
}

.color-table td {
  padding: 2px 2px;
  vertical-align: middle;
}

.color-table tr:hover {
  background: rgba(100, 170, 255, 0.04);
}

.color-row-empty td {
  opacity: 0.5;
}

.color-table-input {
  width: 100%;
  background: #181819;
  color: #f5f5ff;
  border: 1px solid #888;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}

.eye-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  opacity: 0.8;
}

.eye-toggle:hover {
  opacity: 1;
  background: rgba(100, 170, 255, 0.1);
}

.gallery-overlay {
  position: fixed;
  position: absolute;
  width: 100%;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 200;
  overflow: auto;
  display: none;
}

.is-visible {
  display: flex;
}

.gallery-overlay .graph-page {
  width: 100%;
  margin: 0 auto;
}

.gallery-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 210;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.gallery-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Layout Tooltip Styles - matching mandalas popover */
.layout-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px;
  min-width: 320px;
  max-width: 400px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s,
    visibility 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vi-logo-wrap:hover .layout-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.layout-tooltip-title {
  font-size: 12px;
  color: #ddd;
  margin-bottom: 8px;
}

.layout-tooltip-content {
  display: grid;
  gap: 6px;
}

.layout-tooltip-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 8px;
}

.layout-tooltip-algo {
  background: #444;
  color: #4ade80;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
}

.layout-tooltip-desc {
  color: #bbb;
  font-size: 12px;
  line-height: 1.3;
}

/* ── Field group ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #262636;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}

.field-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #7070a0;
  margin: 0 0 2px;
}

/* CSS Tester: prominent element number prefix on field-group labels.
   Targets the leading digits in "NNN — description" labels. */
.field-group-label::first-line {
  /* fallback selector — ::first-line doesn't fit a number-only highlight,
     so we rely on .field-group-num for the in-text styled span. */
}
.field-group-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  padding: 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(180deg, #1f2a36 0%, #14202c 100%);
  border: 1px solid #5bd6ff;
  border-radius: 999px;
  box-shadow:
    0 0 0 2px rgba(91, 214, 255, 0.08),
    0 0 12px rgba(91, 214, 255, 0.25);
  letter-spacing: 0;
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

/* ── Tab reset button ── */
.tab-reset-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 5px 8px;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #242633;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tab-reset-btn:hover {
  background: #2c2e44;
  border-color: rgba(220, 60, 60, 0.6);
  color: #ff9090;
  transform: scale(1.01);
}

/* ── Informe ── */
.informe-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid #262636;
  border-radius: 6px;
  margin-top: 8px;
}

.informe-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #7070a0;
  margin: 0 0 4px;
}

.informe-ring {
  display: flex;
  gap: 6px;
  font-size: 11px;
  flex-wrap: wrap;
}

.informe-ring--block {
  flex-direction: column;
  gap: 2px;
}

.informe-ring-label {
  color: #8080b0;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.informe-ring-chords {
  color: #d0d0f0;
  word-break: break-all;
  font-size: 11px;
  line-height: 1.5;
}

.informe-list {
  font-size: 11px;
  color: #d0d0f0;
  margin: 0;
  word-break: break-all;
  line-height: 1.5;
}

.informe-repeat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #d0d0f0;
}

.informe-repeat-count {
  color: #7070a0;
  font-variant-numeric: tabular-nums;
}

/* ── Hotkeys ── */
.hotkeys-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hotkeys-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hotkeys-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #7070a0;
  margin: 0 0 3px;
}

.hotkey-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.hotkey-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border: 1px solid rgba(255,255,255,0.3);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: #e0e0ff;
  white-space: nowrap;
  cursor: default;
}

.hotkey-key.hotkey-clickable {
  cursor: pointer;
}

.hotkey-key.hotkey-clickable:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.5);
}

/* ── Pestañas ── */
.tabs-block {
  padding-top: 0;
}

.tabs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 2px 0;
  margin-bottom: 0;
  border-bottom: 1px solid #333;
}

.tab-btn {
  position: relative;
  padding: 5px 11px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  border: 1px solid #333;
  border-bottom-color: #333;
  background: #1e1e1e;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  z-index: 1;
  transition: background 0.12s, color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* Prevent layout shift: all tabs always reserve bold width */
  font-variation-settings: "wght" 600;
}

.tab-btn:hover {
  background: #252525;
  color: #bbb;
}

.tab-btn.active {
  background: #181818;
  border-color: #333;
  border-bottom-color: #181818;
  color: #e0e0e0;
  font-weight: 600;
  z-index: 2;
}

.conn-table .conn-input {
  width: 58px;
  padding: 2px 4px;
}
.conn-table .conn-thickness {
  width: 44px;
}
.conn-table td {
  padding: 2px 3px;
}

.tab-btn.tab-modified {
  background: #1a3a5c;
  color: #e8f0ff;
}
.tab-btn.tab-modified.active {
  background: #1e4a7a;
  color: #ffffff;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}

/* ── Disabled field ── */
.field-disabled input[type="range"] {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Informe ── */
.informe-type-group {
  font-size: 11px;
  padding: 2px 0;
  line-height: 1.5;
}

.informe-repeat-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 0;
  font-size: 11px;
}

.informe-repeat-chords {
  color: #c0c0e0;
  flex: 1;
  line-height: 1.5;
}

.informe-missing-group {
  display: flex;
  flex-direction: column;
  margin: 4px 0 2px;
  font-size: 11px;
}

.informe-missing-label {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.informe-missing-chords {
  line-height: 1.6;
}

/* ── Conexiones tab ── */
.conn-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: nowrap;
}

.conn-input {
  width: 72px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  border: 1px solid #888;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: #e0e0ff;
  min-width: 0;
}

.conn-input:focus {
  outline: 1px solid #4f7dff;
  border-color: #4f7dff;
}

.conn-sep {
  color: #5050a0;
  font-size: 12px;
  flex-shrink: 0;
}

.conn-active-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #9090b0;
  cursor: pointer;
  flex-shrink: 0;
}

.conn-thickness {
  width: 40px;
  padding: 2px 2px;
  font-size: 11px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: #e0e0e0;
  flex-shrink: 0;
}

.conn-dimmed-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

/* ── Icon toggle buttons (not tabs) ── */
.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #888;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.icon-toggle:hover {
  background: #252525;
  color: #bbb;
}

.icon-toggle.active {
  background: #252535;
  color: #8cf;
  border-color: #456;
}

/* ── Mode buttons (equidistant/manual) ── */
.mode-btn {
  flex: 1;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #888;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.mode-btn:hover {
  background: #252525;
  color: #bbb;
}

.mode-btn.active {
  background: #252535;
  color: #e0e0e0;
  border-color: #456;
}

/* ── Visual ring editor ── */
.ring-editor-svg {
  width: 100%;
  background: #111;
  border-radius: 8px;
  border: 1px solid #333;
  margin: 4px auto;
  display: block;
  touch-action: none;
}

.ring-editor-info {
  font-size: 10px;
  color: #888;
  text-align: center;
  margin: 4px 0;
}

.ring-editor-info p {
  margin: 2px 0;
}

/* ── Style preview row ── */
.style-preview-row {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  justify-content: center;
}
.style-preview-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 3px 2px 2px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #151518;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  min-width: 0;
}
.style-preview-btn:hover {
  border-color: #555;
  background: #1e1e28;
}
.style-preview-btn.active {
  border-color: #6af;
  background: #1a1a30;
}
.style-preview-num {
  font-size: 9px;
  color: #666;
  line-height: 1;
}
.style-preview-btn.active .style-preview-num {
  color: #6af;
}

/* ── Estilo per-ring sub-tabs ── */
.estilo-ring-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 8px;
}

.estilo-ring-tab {
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 4px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.estilo-ring-tab:hover {
  background: #252525;
  color: #bbb;
}

.estilo-ring-tab.active {
  background: #242633;
  border-color: #444;
  color: #e0e0e0;
  font-weight: 600;
}

.estilo-ring-hint {
  font-size: 10px;
  color: #6060a0;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.estilo-ring-clear {
  font-size: 10px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  color: #7070b0;
  cursor: pointer;
  padding: 1px 6px;
}

.estilo-ring-clear:hover {
  border-color: rgba(255,100,100,0.4);
  color: #ff8888;
}

.estilo-slider-field {
  margin-bottom: 2px !important;
}

.estilo-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.estilo-slider-label {
  min-width: 80px;
  max-width: 80px;
  font-size: 10px;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.estilo-slider-range {
  flex: 1;
  min-width: 0;
}

.slider-reset-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  border-radius: 3px;
}

.slider-reset-icon:hover {
  opacity: 1;
  background: rgba(255, 80, 80, 0.12);
}

.estilo-slider-value {
  width: 52px;
  min-width: 52px;
  background: #1a1a2a;
  color: #fff;
  border: 1px solid #888;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11px;
  text-align: right;
}

/* ── Animación tab section labels ── */
.anim-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6060a0;
  margin: 10px 0 4px;
}

/* ── Combination table (semitones × total) ── */
.comb-table-wrap {
  max-height: 320px;
  overflow: auto;
  margin-top: 4px;
  border: 1px solid #272738;
  border-radius: 6px;
  background: #131316;
}

.comb-table {
  border-collapse: collapse;
  font-size: 10px;
  font-family: "JetBrains Mono", Consolas, monospace;
  white-space: nowrap;
}

.comb-table th,
.comb-table td {
  border: 1px solid #272738;
  padding: 2px 0;
  text-align: center;
  min-width: 22px;
  width: 22px;
}

.comb-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1a1a2a;
  color: #888;
  font-weight: 600;
}

.comb-table-corner {
  position: sticky;
  left: 0;
  z-index: 3 !important;
  background: #1a1a2a !important;
}

.comb-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #1a1a2a;
  color: #888;
  font-weight: 600;
  min-width: 26px;
}

.comb-table-sel-col {
  background: #1a2a3a !important;
  color: #6af !important;
}

.comb-table-sel-row {
  background: #1a2a3a !important;
  color: #6af !important;
}

.comb-table-cell {
  cursor: pointer;
  transition: background 0.1s;
  color: #666;
}

.comb-table-cell:hover {
  background: #2a2a4a !important;
  color: #fff !important;
}

.comb-table-cell.comb-ok {
  color: #5a8;
}

.comb-table-cell.comb-repeat {
  color: #844;
}

.comb-table-cell.comb-current {
  background: #2a3a5a;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px #4f7dff;
}

/* ── Excepciones table ── */
.exc-table-wrap {
  overflow-x: auto;
  margin-top: 2px;
}

.exc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.exc-table th,
.exc-table td {
  border: 1px solid #272738;
  text-align: center;
  padding: 5px 4px;
}

.exc-table thead th {
  background: #242633;
  color: #888;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 6px;
}

.exc-table-branch {
  background: #242633;
  color: #bbb;
  font-weight: 600;
  font-size: 10px;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exc-table-cell {
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}

.exc-table-cell:hover {
  background: #2a2a4a !important;
}

.exc-table-cell.active {
  font-weight: 700;
}

.exc-row-deleted {
  opacity: 0.4;
}

.exc-row-deleted .exc-table-branch {
  text-decoration: line-through;
}

/* ─── BCM Branding Logo Glow ─────────────────────────────────── */
.bcm-logo-wrap {
  position: relative;
  cursor: pointer;
  width: 100%;
}
.bcm-logo-sharp {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.4s ease;
}
.bcm-logo-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.bcm-logo-glow-1 { filter: blur(4px) brightness(1.8) saturate(1.4); }
.bcm-logo-glow-2 { filter: blur(14px) brightness(2) saturate(1.2); }
.bcm-logo-glow-3 { filter: blur(35px) brightness(2.2) saturate(1); }
.bcm-logo-wrap:hover .bcm-logo-sharp {
  filter: brightness(1.15) saturate(0.85);
}
.bcm-logo-wrap:hover .bcm-logo-glow-1 { opacity: 0.7; }
.bcm-logo-wrap:hover .bcm-logo-glow-2 { opacity: 0.45; }
.bcm-logo-wrap:hover .bcm-logo-glow-3 { opacity: 0.25; }
