/* ==========================================================================
   sen · lab — piel
   Noche índigo, líneas finas y luz tenue: la misma familia que la portada,
   llevada a una herramienta densa y tranquila.
   ========================================================================== */

:root {
  /* Cielo */
  --bg: #05050e;
  --bg-2: #0a0a19;
  --panel: #0e0e20;
  --panel-2: #11112a;
  --glass: rgba(11, 11, 27, 0.88);

  /* Trazos y velos (blanco lila con transparencia) */
  --line: rgba(220, 210, 255, 0.23);
  --line-2: rgba(220, 210, 255, 0.36);
  --line-3: rgba(220, 210, 255, 0.54);
  --fill: rgba(220, 210, 255, 0.07);
  --fill-2: rgba(220, 210, 255, 0.14);
  --sink: rgba(0, 0, 8, 0.32);

  /* Tinta */
  --ink: #fbfaf7;
  --ink-2: #f2eff8;
  --muted: #d7d4e6;
  --dim: #b6b3cf;

  /* Luz */
  --accent: #c3b4ff;
  --accent-soft: rgba(195, 180, 255, 0.13);
  --accent-line: rgba(195, 180, 255, 0.48);
  --accent-ink: #0b0918;
  --aqua: #9fe6dc;
  --live: #ffd08a;
  --warn: #ffbf7a;
  --danger: #ff8d9e;
  --iris: linear-gradient(100deg, #cdb8ff 0%, #f5f1ff 42%, #ffc9e8 64%, #b7f3ea 100%);

  /* Letra */
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --track: 0.16em;

  /* Forma */
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 18px;
  --h: 28px;
  --h-sm: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.92), 0 0 60px -32px rgba(160, 140, 255, 0.45);

  /* Medidas de la línea de tiempo (las lee el JS) */
  --head-w: 200px;
  --row-h: 58px;
  --ruler-h: 30px;
  --radius: 8px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(55% 45% at 10% -8%, rgba(139, 61, 255, 0.18), transparent 70%),
    radial-gradient(45% 40% at 94% -6%, rgba(31, 182, 255, 0.09), transparent 70%),
    radial-gradient(45% 40% at 58% 52%, rgba(98, 70, 220, 0.06), transparent 70%),
    radial-gradient(70% 50% at 55% 118%, rgba(26, 214, 176, 0.08), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 13px/1.45 var(--font);
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

/* Grano muy fino, como el cielo de la portada. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Polvo de estrellas: muy tenue, solo se ve donde la interfaz deja ver el cielo. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.36;
  background-image: url("stars.svg"), url("stars.svg");
  background-size: 600px 600px, 930px 930px;
  background-position: 0 0, 217px 141px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.7) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.7) 100%);
  animation: twinkle 9s ease-in-out infinite alternate;
  will-change: opacity;
}

@keyframes twinkle {
  from {
    opacity: 0.28;
  }

  to {
    opacity: 0.45;
  }
}

::selection {
  background: rgba(195, 180, 255, 0.3);
  color: #fff;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.warn {
  color: var(--warn);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

:focus-visible {
  outline: 1.5px solid var(--focus, var(--accent));
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

/* ------------------------------------------------------------ iconos */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  pointer-events: none;
}

/* ------------------------------------------------------------ arranque */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.6em;
  text-transform: lowercase;
  animation: boot-breathe 2.6s ease-in-out infinite;
}

@keyframes boot-breathe {
  50% {
    opacity: 0.35;
  }
}

.unsupported {
  max-width: 560px;
  margin: 14vh auto;
  padding: 0 24px;
  color: var(--ink-2);
  line-height: 1.6;
}

.unsupported h1 {
  margin: 0 0 24px;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.5em;
  text-transform: lowercase;
}

.unsupported a {
  color: var(--accent);
}

/* ------------------------------------------------------------ botones */

.btn,
.icon-btn,
.chip,
.play {
  border: 1px solid var(--line-2);
  background: var(--fill);
  border-radius: var(--r);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s, filter 0.16s;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--h);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.btn .i {
  width: 14px;
  height: 14px;
  margin-left: -2px;
}

.btn:hover,
.icon-btn:hover,
.chip:hover {
  background: var(--fill-2);
  border-color: var(--line-3);
  color: var(--ink);
}

.btn--primary {
  background: var(--iris);
  background-size: 160% 100%;
  background-position: 0% 50%;
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 0 22px -8px rgba(197, 139, 255, 0.7);
  transition: background-position 0.5s var(--ease), box-shadow 0.2s, filter 0.2s;
}

.btn--primary:hover {
  background: var(--iris);
  background-size: 160% 100%;
  background-position: 100% 50%;
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 0 26px -6px rgba(197, 139, 255, 0.85);
}

.btn--quiet {
  background: transparent;
  color: var(--muted);
}

.btn--quiet:hover {
  background: var(--fill-2);
}

/* En la cabecera, las acciones secundarias son solo texto. */
.topbar .btn--quiet,
.tl-addrow .btn--quiet {
  border-color: transparent;
}

.btn--danger {
  color: var(--danger);
}

.btn:disabled,
.icon-btn:disabled {
  opacity: 0.32;
  cursor: default;
  background: transparent;
  border-color: transparent;
}

.icon-btn {
  width: var(--h);
  height: var(--h);
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.icon-btn:hover {
  border-color: transparent;
}

a.icon-btn {
  color: var(--muted);
  text-decoration: none;
}

a.icon-btn:hover {
  color: var(--ink);
}

.dialog a {
  color: var(--accent);
}

.icon-btn--small {
  width: var(--h-sm);
  height: var(--h-sm);
  border-radius: var(--r-sm);
  font-size: 12px;
}

.icon-btn--small .i {
  width: 13px;
  height: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.chip .i {
  width: 13px;
  height: 13px;
}

.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: #f3f0ff;
  box-shadow: 0 0 16px -6px rgba(195, 180, 255, 0.6);
}

/* ------------------------------------------------------------ disposición */

.lab {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 14, 0.86);
}

.topbar {
  position: relative;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(205, 184, 255, 0.55) 18%, rgba(255, 255, 255, 0.6) 40%, rgba(255, 201, 232, 0.5) 62%, rgba(183, 243, 234, 0.45) 82%, transparent 100%);
  background-size: 200% 100%;
  opacity: 0.85;
  pointer-events: none;
  animation: shimmer 24s ease-in-out infinite;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.back .i {
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ease), color 0.2s;
}

.back span {
  padding-left: 0.1em;
  margin-right: -0.42em;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.42em;
  text-transform: lowercase;
  background: var(--iris);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(200, 160, 255, 0.35));
  animation: shimmer 18s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.back:hover {
  color: var(--ink);
}

.back:hover .i {
  transform: translateX(-2px);
}

.title {
  flex: 0 1 260px;
  min-width: 120px;
}

.title--album input {
  font-weight: 600;
}

.title--theme input {
  color: var(--muted);
}

.theme-nav {
  display: flex;
  flex: none;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.theme-select {
  display: flex;
  min-width: 0;
}

.theme-select select {
  width: 174px;
  min-width: 96px;
  max-width: 22vw;
  text-overflow: ellipsis;
}

.theme-new {
  margin-left: 4px;
  white-space: nowrap;
}

.title input {
  width: 100%;
  height: 30px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 0 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  transition: background 0.16s, border-color 0.16s;
}

.title input:hover,
.title input:focus {
  border-color: var(--line-2);
  background: var(--fill);
  outline: none;
}

.title input:focus {
  border-color: var(--accent-line);
}

.save-state {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: save-pulse 1.2s ease-in-out infinite;
}

.save-state.is-error {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

@keyframes save-pulse {
  50% {
    opacity: 0.3;
  }
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Pequeño portal de color de la portada: vuelve a los ambientes. */
.ambient-orb {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  margin-right: 2px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.95) 0 10%, rgba(255, 255, 255, 0.16) 23%, transparent 42%),
    conic-gradient(from 210deg, #8b3dff, #e0399a, #1fb6ff, #1ad6b0, #f2a24b, #8b3dff);
  box-shadow:
    0 0 12px rgba(197, 139, 255, 0.55),
    inset 0 0 5px rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: orb-breathe 7s ease-in-out infinite;
}

.ambient-orb::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #f7f4ff;
  box-shadow: 0 0 7px rgba(224, 184, 255, 0.9);
}

.ambient-orb:hover {
  transform: scale(1.12);
  box-shadow:
    0 0 18px rgba(197, 139, 255, 0.85),
    inset 0 0 5px rgba(255, 255, 255, 0.45);
}

@keyframes orb-breathe {
  0%,
  100% { opacity: 0.78; }
  50% { opacity: 1; }
}

.topbar__actions .btn--primary {
  margin-left: 6px;
}

.menu {
  position: relative;
  display: flex;
}

.menu__trigger {
  border-radius: 50%;
}

.menu__trigger[aria-expanded="true"] {
  background: var(--fill-2);
  color: var(--ink);
}

.menu__pop {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 2px;
  min-width: 244px;
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.menu__pop[hidden] {
  display: none;
}

.menu__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, box-shadow 0.16s;
}

.menu__item:hover {
  background: var(--fill-2);
}

.menu__item:focus-visible {
  background: var(--fill-2);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 18px -10px rgba(197, 139, 255, 0.8);
}

.menu__label {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.menu__meta {
  color: var(--dim);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.menu__item--primary .menu__label {
  color: var(--accent);
}

.menu__item--danger .menu__label {
  color: var(--danger);
}

.menu__item:disabled {
  opacity: 0.38;
  cursor: default;
}

.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 21, 0.82);
  flex-wrap: wrap;
}

.play {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--iris);
  background-size: 200% 100%;
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 20px -6px rgba(197, 139, 255, 0.8);
}

.play .i {
  width: 15px;
  height: 15px;
  stroke-width: 1.2;
}

.play .i--play {
  margin-left: 2px;
}

.play:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 26px -4px rgba(197, 139, 255, 0.95);
}

.play[aria-pressed="true"] {
  background: linear-gradient(135deg, #ffe6b5, #ffc08f);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 24px -4px rgba(255, 196, 130, 0.85);
}

.clock {
  min-width: 150px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

.field-inline select,
.field-inline input {
  letter-spacing: 0.005em;
  text-transform: none;
}

/* ------------------------------------------------------------ campos */

select,
input[type="text"],
input[type="number"],
textarea {
  height: 26px;
  background-color: var(--fill);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0 8px;
  font-size: 12px;
  color: var(--ink);
  transition: border-color 0.16s, background-color 0.16s;
}

select:hover,
input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover {
  border-color: var(--line-3);
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--accent-line);
  outline: none;
}

select:focus-visible,
input[type="text"]:focus-visible,
input[type="number"]:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d7d4e6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 11px 11px;
  cursor: pointer;
}

option,
optgroup {
  background: #0d0d20;
  color: var(--ink);
}

input[type="number"]::-webkit-inner-spin-button {
  opacity: 0.3;
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

textarea {
  width: 100%;
  height: auto;
  padding: 6px 8px;
  line-height: 1.5;
  resize: vertical;
}

/* Deslizadores: un hilo fino y una perla de luz. */
input[type="range"] {
  --thumb: var(--accent);
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  background: transparent;
  cursor: pointer;
  accent-color: var(--thumb);
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: var(--line-3);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--thumb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--thumb) 16%, transparent), 0 0 10px color-mix(in srgb, var(--thumb) 50%, transparent);
  transition: box-shadow 0.16s, transform 0.16s;
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--thumb) 20%, transparent), 0 0 14px color-mix(in srgb, var(--thumb) 65%, transparent);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: var(--line-3);
}

input[type="range"]::-moz-range-progress {
  height: 2px;
  border-radius: 2px;
  background: var(--thumb);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--thumb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--thumb) 16%, transparent), 0 0 10px color-mix(in srgb, var(--thumb) 50%, transparent);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* Casillas como interruptores. */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: inline-block;
  width: 26px;
  height: 15px;
  margin: 0;
  flex: none;
  vertical-align: middle;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--fill-2);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s var(--ease), background 0.18s, box-shadow 0.18s;
}

input[type="checkbox"]:checked {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

input[type="checkbox"]:checked::before {
  transform: translateX(11px);
  background: var(--iris);
  box-shadow: 0 0 8px rgba(197, 139, 255, 0.85);
}

input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin: 0;
  flex: none;
  border: 1px solid var(--line-3);
  border-radius: 50%;
  vertical-align: -1px;
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

input[type="radio"]:checked {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 2.5px, transparent 3px);
  box-shadow: 0 0 8px rgba(195, 180, 255, 0.55);
}

input[type="color"] {
  width: 40px;
  height: 24px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--fill);
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}

input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 3px;
}

.volume input {
  width: 90px;
}

.zoom {
  display: inline-flex;
  gap: 2px;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.zoom .icon-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
}

.zoom .icon-btn .i {
  width: 14px;
  height: 14px;
}

.compact-only {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: 210px 1fr 330px;
  min-height: 0;
}

.library,
.inspector {
  overflow: auto;
  background: rgba(12, 12, 30, 0.74);
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.library {
  background:
    radial-gradient(120% 45% at 0% 100%, rgba(26, 214, 176, 0.07), transparent 70%),
    rgba(12, 12, 30, 0.74);
  background-attachment: local, scroll;
  border-right: 1px solid var(--line);
  padding: 12px 8px 24px;
}

.inspector {
  background:
    radial-gradient(110% 40% at 100% 0%, rgba(139, 61, 255, 0.1), transparent 70%),
    rgba(12, 12, 30, 0.74);
  border-left: 1px solid var(--line);
  padding: 14px 16px 32px;
}

.compact-list {
  display: none;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 28px;
  padding: 4px 14px;
  border-top: 1px solid var(--line);
  background: rgba(5, 5, 14, 0.86);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.statusbar .warn {
  color: var(--warn);
}

.statusbar .spacer {
  flex: 1;
}

.meter {
  display: grid;
  gap: 2px;
  width: 120px;
  background:
    linear-gradient(var(--fill-2) 0 0) top / 100% 3px no-repeat,
    linear-gradient(var(--fill-2) 0 0) bottom / 100% 3px no-repeat;
}

.meter i {
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #8fe3d6 0%, #b8acff 58%, #ffd08a 80%, #ff8d9e 92%);
  clip-path: inset(0 calc(100% - var(--v, 0%)) 0 0);
  border-radius: 2px;
  filter: drop-shadow(0 0 3px rgba(184, 172, 255, 0.5));
}

.load-high {
  color: var(--danger);
}

/* ------------------------------------------------------------ biblioteca */

.lib-group {
  margin-bottom: 6px;
}

.lib-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 6px;
  padding: 5px 2px;
  font-size: 10px;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-sm);
  transition: color 0.16s;
}

.lib-group__title::-webkit-details-marker {
  display: none;
}

.lib-group__title::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin: 0 1px 0 2px;
  border-right: 1.3px solid currentColor;
  border-bottom: 1.3px solid currentColor;
  color: var(--dim);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}

.lib-group[open] > .lib-group__title::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.lib-group__title:hover {
  color: var(--ink);
}

.lib-group__title:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

.lib-group__body {
  padding: 0 0 4px;
}

.lib-subgroup {
  margin: 0 0 3px 11px;
  border-left: 1px solid var(--line);
  padding-left: 4px;
}

.lib-subgroup__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 6px 2px;
  padding: 3px 0;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.lib-subgroup__title::-webkit-details-marker {
  display: none;
}

.lib-subgroup__title::before {
  content: "";
  flex: none;
  width: 4px;
  height: 4px;
  margin: 0 1px 0 2px;
  border-right: 1.2px solid currentColor;
  border-bottom: 1.2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}

.lib-subgroup[open] > .lib-subgroup__title::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.lib-subgroup__title:hover {
  color: var(--ink);
}

.lib-subgroup__title:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

.lib-subgroup__body {
  padding: 0 0 2px;
}

.lib-item {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--r);
  padding: 1px 2px;
  transition: background 0.14s;
}

.lib-item:hover {
  background: var(--fill-2);
}

.lib-item[draggable="true"] {
  cursor: grab;
}

.lib-play {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.14s, background 0.14s;
}

.lib-play .i {
  width: 11px;
  height: 11px;
  margin-left: 1px;
}

.lib-item:hover .lib-play {
  color: var(--muted);
}

.lib-play:hover {
  color: var(--c, var(--ink)) !important;
  background: color-mix(in srgb, var(--c, #fff) 14%, transparent);
}

.lib-add {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 5px 4px;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
}

.lib-item:hover .lib-add {
  color: var(--ink);
}

.lib-add .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent);
  flex: none;
}

.lib-template {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: var(--r);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.lib-template:hover {
  background: var(--fill-2);
  color: var(--ink);
}

.lib-template small {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--dim);
}

/* ------------------------------------------------------------ línea de tiempo */

.timeline {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tl-scroll {
  position: relative;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

.tl-content {
  position: relative;
  min-height: 100%;
}

.tl-rulerbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  height: var(--ruler-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.tl-corner {
  position: sticky;
  left: 0;
  z-index: 2;
  width: var(--head-w);
  flex: none;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

.tl-ruler {
  position: relative;
  flex: 1;
  cursor: text;
  touch-action: none;
}

.tl-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--line-2);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--dim);
  padding: 3px 0 0 5px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.tl-tick--minor {
  top: 21px;
  border-color: var(--line);
}

.tl-region {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(195, 180, 255, 0.1);
  border-left: 1px solid var(--accent-line);
  border-right: 1px solid var(--accent-line);
  pointer-events: none;
}

.tl-region.is-on {
  background: rgba(195, 180, 255, 0.22);
  border-color: var(--accent);
}

.tl-row {
  display: flex;
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
}

.tl-row.is-selected .tl-head {
  background: color-mix(in srgb, var(--c, #c3b4ff) 9%, var(--panel));
}

.tl-row.is-selected .tl-lane {
  background: color-mix(in srgb, var(--c, #c3b4ff) 3%, transparent);
}

.tl-head {
  position: sticky;
  left: 0;
  z-index: 4;
  width: var(--head-w);
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px 4px 12px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-left: 2px solid var(--c);
}

.tl-name {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.tl-name small {
  color: var(--dim);
  font-size: 11px;
  font-weight: 400;
  margin-left: 6px;
}

.tl-ctrls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tl-ms {
  width: 20px;
  height: 18px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.tl-ms:hover {
  border-color: var(--line-3);
  color: var(--ink);
}

.tl-ms.tl-del {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.tl-ms.tl-del .i {
  width: 13px;
  height: 13px;
  stroke-width: 1.5;
}

.tl-ms.tl-del:hover {
  background: rgba(255, 141, 158, 0.12);
  border-color: rgba(255, 141, 158, 0.45);
  color: #ffc2cc;
}

.tl-ms[aria-pressed="true"].tl-mute {
  background: rgba(255, 141, 158, 0.16);
  color: #ffc2cc;
  border-color: rgba(255, 141, 158, 0.5);
}

.tl-ms[aria-pressed="true"].tl-solo {
  background: rgba(255, 208, 138, 0.16);
  color: #ffe3b0;
  border-color: rgba(255, 208, 138, 0.5);
}

.tl-meter {
  flex: none;
  height: 2px;
  background: var(--fill-2);
  border-radius: 2px;
  overflow: hidden;
}

.tl-volbox {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

input[type="range"].tl-vol {
  --thumb: var(--c);
  flex: 1;
  min-width: 40px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.tl-vol::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -4px;
}

.tl-vol::-moz-range-thumb {
  width: 10px;
  height: 10px;
}

.tl-vol:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tl-voltext {
  flex: none;
  width: 44px;
  text-align: right;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tl-meter i {
  display: block;
  height: 100%;
  width: var(--v, 0%);
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
}

.tl-lane {
  position: relative;
  flex: 1;
  touch-action: none;
}

.tl-automation {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.tl-automation path {
  fill: none;
  stroke: var(--live);
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
  opacity: 0.85;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px rgba(255, 208, 138, 0.5));
}

.tl-auto {
  margin-left: 6px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: rgba(255, 208, 138, 0.13);
  color: var(--live) !important;
  font-size: 9.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
}

.tl-lane.is-drop {
  background: rgba(195, 180, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.tl-end {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed var(--line-3);
  pointer-events: none;
  z-index: 3;
}

.tl-after {
  position: absolute;
  top: var(--ruler-h);
  bottom: 0;
  right: 0;
  background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(220, 210, 255, 0.018) 6px 12px);
  pointer-events: none;
}

.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid var(--live);
  box-shadow: 0 0 8px 0.5px rgba(255, 208, 138, 0.55);
  z-index: 5;
  pointer-events: none;
}

.tl-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--live);
  filter: drop-shadow(0 0 4px rgba(255, 208, 138, 0.8));
}

.tl-playhead::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 11px;
  background: linear-gradient(90deg, transparent, rgba(255, 208, 138, 0.07), transparent);
}

.tl-marquee {
  position: absolute;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-xs);
  background: rgba(195, 180, 255, 0.07);
  z-index: 7;
  pointer-events: none;
}

.tl-addrow,
.tl-masterrow {
  display: flex;
  height: 40px;
  border-bottom: 1px solid var(--line);
}

.tl-addrow .tl-head,
.tl-masterrow .tl-head {
  border-left-color: transparent;
}

.tl-addrow .btn {
  justify-content: flex-start;
  color: var(--dim);
}

.tl-addrow .btn:hover {
  color: var(--ink);
}

.tl-masterrow .tl-name {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
}

.tl-masterrow .tl-name:hover {
  color: var(--ink);
}

/* Línea de duración del maestro: el extremo se arrastra para estirar el tema. */
.tl-stretch {
  position: absolute;
  left: 0;
  top: 50%;
  height: 1px;
  min-width: 6px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(195, 180, 255, 0.12), var(--accent-line) 65%, var(--accent));
}

.tl-stretch::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--accent-line);
}

.tl-stretch-label {
  position: absolute;
  right: 18px;
  top: -17px;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel);
  color: var(--dim);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.tl-stretch-handle {
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(195, 180, 255, 0.8);
  cursor: ew-resize;
  z-index: 5;
}

.tl-stretch-handle:hover,
.tl-stretch-handle:focus-visible {
  background: #fff;
  outline: none;
}

/* Elementos */

.el {
  position: absolute;
  top: 6px;
  bottom: 6px;
  min-width: 6px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--c) 15%, #08081a);
  overflow: hidden;
  cursor: grab;
  text-align: left;
  color: var(--ink);
  z-index: 1;
  --focus: var(--c);
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s;
}

.el:hover {
  background: color-mix(in srgb, var(--c) 22%, #08081a);
  border-color: color-mix(in srgb, var(--c) 80%, transparent);
}

.el.is-selected {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92) inset, 0 0 18px -3px color-mix(in srgb, var(--c) 80%, transparent);
  z-index: 2;
}

.el.is-dragging {
  opacity: 0.75;
  cursor: grabbing;
}

.el-env {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.el-env path {
  fill: color-mix(in srgb, var(--c) 26%, transparent);
  stroke: var(--c);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.el-wave {
  position: absolute;
  inset: 16px 0 2px;
  width: 100%;
  height: calc(100% - 18px);
  pointer-events: none;
}

.el-wave path {
  fill: color-mix(in srgb, var(--c) 50%, transparent);
}

.el.has-wave .el-env path {
  fill: none;
  stroke-dasharray: 3 2;
  opacity: 0.8;
}

.el-label {
  position: relative;
  display: block;
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 6, 0.9), 0 0 6px rgba(0, 0, 6, 0.6);
}

.el-chords {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.el-chord {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
  padding: 3px 4px;
  box-sizing: border-box;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 6, 0.9), 0 0 6px rgba(0, 0, 6, 0.65);
}

.el-chord:first-child {
  border-left: 0;
}

.el-dots {
  position: absolute;
  inset: 18px 0 2px;
  pointer-events: none;
}

.el-dots i {
  position: absolute;
  width: 3px;
  height: 3px;
  margin-left: -1px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 4px var(--c);
}

.el-h {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: ew-resize;
  z-index: 2;
}

.el-h--l {
  left: 0;
}

.el-h--r {
  right: 0;
}

.el--hit {
  border-radius: var(--r-xs) var(--r-sm) var(--r-sm) var(--r-xs);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, transparent) 0 4px, transparent 4px 8px);
}

.el--hit::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
}

.el-ghost {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border: 1px dashed color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: var(--r-sm);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, transparent) 0 5px, transparent 5px 10px);
  pointer-events: none;
}

/* ------------------------------------------------------------ inspector */

.ins-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.ins-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  flex: 1;
}

.ins-head h2 small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-top: 3px;
}

.ins-head--bare {
  justify-content: flex-end;
  margin-bottom: 0;
  min-height: 0;
}

.ins-close {
  display: none;
}

.ins-section {
  border-top: 1px solid var(--line);
  padding: 14px 0 8px;
}

.ins-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
}

.ins-section h3::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: radial-gradient(circle, #f4f1ff 0 1px, transparent 1.5px);
  box-shadow: 0 0 6px rgba(197, 139, 255, 0.55);
}

.ins-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.ctl {
  display: grid;
  grid-template-columns: 1fr 74px;
  grid-template-areas: "label value" "slider slider";
  align-items: center;
  column-gap: 8px;
  margin-bottom: 10px;
}

.ctl > label,
.ctl > .ctl-label {
  grid-area: label;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
}

.ctl > input[type="number"],
.ctl > .ctl-value {
  grid-area: value;
  width: 100%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ctl > input[type="range"] {
  grid-area: slider;
  width: 100%;
  margin: 4px 0 0;
}

.ctl--row {
  grid-template-columns: 1fr auto;
  grid-template-areas: "label value";
}

.ctl--row > select,
.ctl--row > input[type="text"],
.ctl--row > .ctl-value {
  grid-area: value;
  max-width: 190px;
}

.ctl--pair {
  grid-template-columns: 1fr 70px 70px;
  grid-template-areas: "label a b";
}

.ctl.ctl--pair > :nth-child(2) {
  grid-area: a;
}

.ctl.ctl--pair > :nth-child(3) {
  grid-area: b;
}

.ctl-block {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.ctl-block > .ctl-label {
  color: var(--muted);
  font-size: 12px;
  user-select: none;
}

.ctl-unit {
  color: var(--dim);
  font-size: 10.5px;
}

.ctl > .ctl-value:has(.ctl-seed) {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ctl-seed {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.keyboard {
  position: relative;
  height: 64px;
  margin: 6px 0 8px;
  user-select: none;
  touch-action: manipulation;
}

.key {
  position: absolute;
  top: 0;
  border: 1px solid #12122a;
  border-radius: 0 0 var(--r-xs) var(--r-xs);
  cursor: pointer;
  padding: 0;
  transition: background 0.08s, box-shadow 0.12s;
}

.key--white {
  height: 64px;
  background: linear-gradient(180deg, #cfcbdd 0%, #ebe8f2 70%, #e2deec 100%);
  z-index: 1;
}

.key--white:hover {
  background: linear-gradient(180deg, #d9d5e8 0%, #f6f4fb 70%, #ece8f5 100%);
}

.key--black {
  height: 38px;
  background: linear-gradient(180deg, #1d1c36 0%, #0d0d1c 100%);
  border-color: #050510;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.05);
  z-index: 2;
}

.key--black:hover {
  background: linear-gradient(180deg, #2a2848 0%, #14132a 100%);
}

.key.is-on {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(195, 180, 255, 0.6);
}

.key--white span {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  font-size: 9px;
  color: #5a5672;
  text-align: center;
}

.oct {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.curve-editor,
.roll {
  display: block;
  width: 100%;
  background: var(--sink);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  touch-action: none;
}

.curve-editor {
  height: 70px;
  cursor: crosshair;
}

.curve-editor path {
  fill: rgba(195, 180, 255, 0.14);
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.curve-editor circle {
  fill: var(--accent);
  cursor: grab;
}

.roll {
  height: 150px;
  cursor: cell;
}

.help {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.5;
  margin: 2px 0 10px;
}

.ins-empty {
  color: var(--muted);
}

/* ------------------------------------------------------------ modo compacto */

.compact-track {
  border: 1px solid var(--line);
  border-left: 2px solid var(--c);
  border-radius: var(--r-lg);
  margin: 10px;
  background: rgba(11, 11, 26, 0.72);
  overflow: hidden;
}

.compact-track header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
}

.compact-track header .tl-name {
  flex: 1;
}

.compact-track header label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.compact-track header input {
  width: 60px;
}

.compact-el {
  display: grid;
  grid-template-columns: 1fr repeat(3, 64px);
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.compact-el.is-selected {
  background: color-mix(in srgb, var(--c, #c3b4ff) 9%, transparent);
}

.compact-el button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}

.compact-el input {
  width: 100%;
  color: var(--ink);
}

.compact-el label {
  display: grid;
  gap: 2px;
  font-size: 10px;
  color: var(--dim);
}

.compact-add {
  padding: 6px 8px 10px;
}

@media (max-width: 1200px) {
  .title {
    flex-basis: 200px;
  }

  .theme-select select {
    width: 150px;
  }
}

@media (max-width: 899px) {
  :root {
    --head-w: 140px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .timeline {
    display: none;
  }

  .compact-list {
    display: block;
    overflow: auto;
    min-height: 0;
    padding-bottom: 80px;
  }

  .compact-only {
    display: inline-flex;
  }

  .sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 72vh;
    z-index: 30;
    border: 1px solid var(--line-2);
    border-bottom: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(130%);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.7);
    transform: translateY(105%);
    transition: transform 0.24s var(--ease);
  }

  .sheet.is-open {
    transform: none;
  }

  .ins-close {
    display: inline-grid;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .back {
    border-right: 0;
    padding-right: 0;
  }

  .topbar__actions {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 4px;
  }

  .topbar__actions .btn {
    padding: 0 8px;
  }

  .title--album,
  .title--theme {
    flex: 1 1 130px;
    min-width: 100px;
  }

  .theme-nav {
    flex: 1 1 100%;
  }

  .theme-select {
    flex: 1 1 120px;
  }

  .theme-select select {
    width: 100%;
    max-width: none;
  }

  .theme-new {
    margin-left: 0;
  }

  .volume,
  .zoom,
  .statusbar #st-lufs,
  .statusbar #st-key {
    display: none;
  }
}

/* ------------------------------------------------------------ diálogos */

.dialog {
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  color: var(--ink);
  padding: 22px 24px 20px;
  width: min(640px, calc(100vw - 24px));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dialog::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cdb8ff 25%, #fff 50%, #ffc9e8 70%, transparent);
  opacity: 0.6;
  pointer-events: none;
}

.dialog::backdrop {
  background: rgba(3, 3, 10, 0.66);
  backdrop-filter: blur(3px);
}

.dialog h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.dialog .muted,
.dialog .warn {
  font-size: 12px;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.presets {
  border: 0;
  padding: 0;
  margin: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.presets legend {
  color: var(--dim);
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

.presets label {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 7px 11px;
  background: var(--fill);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.presets label:hover {
  border-color: var(--line-3);
  color: var(--ink);
}

.presets input {
  margin: 0 8px 0 0;
}

.presets label:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: #f3f0ff;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.export-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.export-grid select,
.export-grid input {
  height: 30px;
  color: var(--ink);
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress__bar {
  flex: 1;
  height: 3px;
  background: var(--fill-2);
  border-radius: 3px;
  overflow: hidden;
}

.progress__bar i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--iris);
  box-shadow: 0 0 10px rgba(197, 139, 255, 0.8);
}

.export-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--fill);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
}

.export-result strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
}

.export-result strong .i {
  width: 14px;
  height: 14px;
  color: var(--aqua);
  stroke-width: 2;
}

.drop-hint {
  position: fixed;
  inset: 12px;
  border: 1px dashed var(--accent-line);
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 14, 0.82);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 120px -40px rgba(195, 180, 255, 0.5);
  z-index: 50;
  color: var(--ink-2);
  font-size: 14px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid var(--line-2);
  padding: 9px 16px;
  border-radius: var(--r-lg);
  z-index: 60;
  max-width: min(560px, calc(100vw - 24px));
  font-size: 12.5px;
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: toast-in 0.22s var(--ease);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}

.toast.is-error {
  border-color: rgba(255, 141, 158, 0.45);
  color: #ffd0d7;
}

/* Con el teclado abierto, los avisos suben para no taparlo. */
body:has(.perform:not([hidden])) .toast {
  top: 104px;
  bottom: auto;
}

/* ------------------------------------------------------------ cambios de nota y teclado */

.btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: #f3f0ff;
}

.perf-rec {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.perf-rec--icon {
  width: 36px;
  justify-content: center;
  padding: 0;
}

.perf-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.15s, box-shadow 0.15s;
}

.perf-rec[aria-pressed="true"] .perf-rec-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 141, 158, 0.2), 0 0 10px var(--danger);
}

.key--white .key-name {
  bottom: 3px;
  font-size: 8px;
  color: #77738f;
}

.key .key-hint {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  pointer-events: none;
}

.key--white .key-hint {
  top: 3px;
  bottom: auto;
  color: #4a4663;
  font-weight: 600;
}

.key--black .key-hint {
  top: 2px;
  color: var(--accent);
  font-size: 8px;
}

.el-changes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.el-changes i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(5, 5, 14, 0.3);
}

.note-changes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 10px;
  max-height: 190px;
  overflow: auto;
}

.note-change {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 6px;
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 12px;
}

.note-change__timebox {
  display: flex;
  align-items: center;
  gap: 3px;
}

.note-change__time {
  width: 62px;
  height: 24px;
  padding: 0 5px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--sink);
  color: var(--accent);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.note-change__notes {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--sink);
  color: var(--ink);
}

.note-change__time:focus,
.note-change__notes:focus {
  border-color: var(--accent-line);
  outline: none;
}

.note-change__time:disabled {
  opacity: 0.7;
  cursor: default;
}

.note-change--base {
  border-color: rgba(195, 180, 255, 0.22);
  background: rgba(195, 180, 255, 0.05);
}

/* Una fila de Notas con la etiqueta del acorde delante del campo de notas. */
.note-change--with-chord {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.note-change__chord {
  max-width: 82px;
  height: 24px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.note-change__chord:hover,
.note-change__chord:focus-visible {
  border-color: var(--accent-line);
  background: rgba(195, 180, 255, 0.22);
  color: #f3f0ff;
  outline: none;
}

.note-change__chord:disabled {
  border-style: dashed;
  background: transparent;
  color: var(--dim);
  cursor: default;
}

.note-change__spacer {
  width: 20px;
  height: 20px;
}

/* Fila de notas sin tiempo (notas de una nube o de un golpe). */
.note-change--set {
  grid-template-columns: 1fr auto;
  padding: 4px 6px;
}

.note-change--single {
  grid-template-columns: 1fr;
}

.note-change__count {
  min-width: 34px;
  color: var(--dim);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.note-change__notes--wrap {
  display: block;
  height: auto;
  padding: 3px 7px;
  resize: none;
  overflow: hidden;
  font: inherit;
  line-height: 1.45;
  field-sizing: content;
  min-height: calc(1.45em + 8px);
}

.note-change__notes::placeholder {
  color: var(--dim);
}

.note-change__notes--static {
  display: flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid transparent;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.note-change__actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.note-change .icon-btn {
  width: 20px;
  height: 20px;
}

.note-change__play:hover {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

.note-change .icon-btn .i {
  width: 12px;
  height: 12px;
}

.note-change .icon-btn:hover {
  color: var(--danger);
  background: rgba(255, 141, 158, 0.12);
}

.note-change-add {
  align-self: flex-start;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px dashed var(--line-3);
  border-radius: var(--r);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.note-change-add .i {
  width: 14px;
  height: 14px;
}

.note-change-add:hover {
  border-style: solid;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* Ventana flotante del modo teclado: cristal oscuro, como el selector de duración de la portada. */
.perform {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 55;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(760px, calc(100vw - 24px));
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(20, 19, 44, 0.9), rgba(8, 8, 20, 0.93));
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
}

.perform::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cdb8ff 25%, #fff 50%, #ffc9e8 70%, transparent);
  opacity: 0.7;
}

.perform__top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.perform__head {
  display: flex;
  gap: 9px;
  align-items: center;
  white-space: nowrap;
}

.perform__head b {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.perform__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 10px var(--accent);
}

.perform[data-mode="record"] .perform__dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 141, 158, 0.16), 0 0 10px var(--danger);
  animation: perform-pulse 1s infinite;
}

@keyframes perform-pulse {
  50% {
    opacity: 0.25;
  }
}

.perform__detail {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perform__notes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.perform__note,
.perform__silence {
  padding: 2px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--fill);
  font-size: 11.5px;
}

.perform__note {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: #f3f0ff;
}

.perform__silence {
  color: var(--dim);
  border-style: dashed;
  background: transparent;
}

.perform__exit {
  min-height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  margin-left: auto;
}

.perform__prog-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perform__progressions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.perform__progression-label {
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

.perform__types {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--sink);
}

.perform__type {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.perform__type:hover {
  color: var(--ink);
}

.perform__type[aria-pressed="true"] {
  background: var(--accent-soft);
  color: #f3f0ff;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.perform__progression-select {
  flex: 1;
  min-width: 160px;
  max-width: none;
  height: 32px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background-color: var(--sink);
  color: var(--ink);
}

.perform__step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 9px 0 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--sink);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  cursor: text;
  transition: border-color 0.16s;
}

.perform__step:focus-within {
  border-color: var(--accent-line);
}

.perform__step-input {
  width: 50px;
  height: 24px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.perform__step-input:focus {
  outline: none;
}

.perform__step-unit {
  color: var(--dim);
}

.perform__transport {
  width: 32px;
  height: 32px;
  min-height: 0;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 16px -6px rgba(195, 180, 255, 0.7);
}

.perform__transport .i {
  width: 13px;
  height: 13px;
  margin: 0;
}

.perform__transport .i--play {
  margin-left: 2px;
}

.perform__transport:hover {
  border-color: var(--accent);
  background: rgba(195, 180, 255, 0.22);
  color: #fff;
}

.perform__transport.is-playing {
  background: rgba(255, 141, 158, 0.16);
  border-color: rgba(255, 141, 158, 0.55);
  color: #ffc2cc;
  box-shadow: 0 0 16px -6px rgba(255, 141, 158, 0.8);
}

.perform__apply {
  height: 32px;
  padding: 0 12px;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: transparent;
  color: var(--accent);
}

.perform__apply:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: #f3f0ff;
}

.perform__prog-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.perform__prog-cards {
  display: flex;
  flex: 0 1 auto;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.perform__prog-card {
  position: relative;
  flex: 0 0 auto;
  min-width: 94px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 22px 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--fill);
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s, transform 0.15s, background 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.perform__prog-card:hover {
  border-color: var(--line-3);
  background: var(--fill-2);
}

.perform__prog-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.perform__prog-card.is-drop-before::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 2px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.perform__prog-cards.is-drop-end::after {
  content: "";
  flex: 0 0 2px;
  align-self: stretch;
  margin: 3px 0;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.perform__prog-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.perform__prog-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.perform__prog-remove .i {
  width: 10px;
  height: 10px;
  stroke-width: 2;
}

.perform__prog-remove:hover,
.perform__prog-remove:focus-visible {
  opacity: 1;
  color: #fff;
  background: rgba(255, 141, 158, 0.2);
  outline: none;
}

.perform__prog-edit {
  position: absolute;
  top: 20px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.perform__prog-edit .i {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

.perform__prog-edit:hover,
.perform__prog-edit:focus-visible {
  opacity: 1;
  color: #fff;
  background: var(--accent-soft);
  outline: none;
}

.perform__prog-card.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 0 22px -8px rgba(195, 180, 255, 0.8), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.perform__prog-card--note {
  min-width: 66px;
}

.perform__prog-card b {
  font-size: 13.5px;
  font-weight: 600;
}

.perform__prog-notes {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.perform__prog-keys {
  display: flex;
  gap: 3px;
  margin-top: 3px;
}

.perform__prog-keys kbd {
  min-width: 16px;
  padding: 1px 3px;
  border: 1px solid var(--line-3);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--sink);
  color: var(--ink-2);
  font: 10px/1.3 var(--mono);
  text-align: center;
}

/* --------------------------------------------------- añadir a la progresión */

.perform__add-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.perform__add {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px dashed var(--line-3);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.perform__add .i {
  width: 15px;
  height: 15px;
}

.perform__add:hover,
.perform__add:focus-visible,
.perform__add[aria-expanded="true"] {
  border-style: solid;
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: 0 0 16px -4px rgba(195, 180, 255, 0.6);
  outline: none;
}

.perform__add[aria-expanded="true"] .i {
  transform: rotate(45deg);
}

.perform__add .i {
  transition: transform 0.2s var(--ease);
}

.perform__add:active {
  transform: scale(0.94);
}

.perform__add-menu {
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 10px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #0e0d22;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.perform__add-menu[hidden] {
  display: none;
}

.perform__add-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 300px);
  overflow: auto;
  scrollbar-width: thin;
}

.perform__add-menu::after {
  content: "";
  position: absolute;
  left: var(--add-arrow, 12px);
  right: auto;
  bottom: -5px;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: #0e0d22;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}

.perform__add-title {
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

.perform__add-hint {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.perform__add-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--sink);
}

.perform__add-tab {
  height: 22px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.perform__add-tab:hover {
  color: var(--ink);
}

.perform__add-tab[aria-pressed="true"] {
  background: var(--accent-soft);
  color: #f3f0ff;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.perform__add-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perform__add-choice {
  display: grid;
  grid-template-columns: 20px 48px 1fr 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.perform__add-choice:hover,
.perform__add-choice:focus-visible {
  border-color: var(--line-2);
  background: var(--fill-2);
  outline: none;
}

.perform__add-choice b {
  font-size: 13px;
  font-weight: 600;
}

.perform__add-choice-notes {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.perform__add-choice-plus {
  display: grid;
  place-items: center;
  color: var(--dim);
}

.perform__add-choice-plus .i {
  width: 13px;
  height: 13px;
}

.perform__add-choice:hover .perform__add-choice-plus {
  color: var(--accent);
}

.perform__add-notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 4px;
}

.perform__add-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--fill);
  color: var(--ink);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.perform__add-note:hover,
.perform__add-note:focus-visible {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  outline: none;
}

.perform__add-note b {
  font-size: 12px;
  font-weight: 600;
}

.perform__add-fields {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.perform__add-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.perform__add-field > span {
  color: var(--dim);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.perform__add-field--grow {
  flex: 1;
}

.perform__add-select {
  height: 28px;
  padding: 0 22px 0 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background-color: var(--sink);
  color: var(--ink);
  font-size: 11px;
}

.perform__add-confirm {
  height: 28px;
  min-height: 0;
  padding: 0 11px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: #f3f0ff;
  font-size: 11px;
  white-space: nowrap;
}

.perform__add-confirm:hover {
  border-color: var(--accent);
  background: rgba(195, 180, 255, 0.22);
}

.perform__add-preview {
  min-height: 13px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* Editor de las notas de una tarjeta de la progresión. */
.perform__edit-menu {
  position: fixed;
  left: 8px;
  top: 8px;
  right: auto;
  bottom: auto;
  z-index: 70;
  width: min(330px, calc(100vw - 16px));
}

.perform__edit-menu::after {
  display: none;
}

.perform__edit-input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--sink);
  color: var(--ink);
}

.perform__edit-input:focus {
  border-color: var(--accent-line);
  outline: none;
}

.perform__edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.perform__edit-action {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  white-space: nowrap;
}

.perform__edit-action .i {
  width: 12px;
  height: 12px;
}

.perform__edit-play {
  margin-left: auto;
  color: var(--accent);
}

.perform__keyboard {
  margin-top: 2px;
  padding: 8px 8px 6px;
  border-radius: var(--r-lg);
  background: var(--sink);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.4), inset 0 0 0 1px var(--line);
}

.perform__keyboard .keyboard {
  height: 58px;
  margin: 0;
}

.perform__keyboard .key--white {
  height: 58px;
}

.perform__keyboard .key--black {
  height: 34px;
}

.perform__keyboard .key.is-on {
  box-shadow: 0 0 0 1px rgba(195, 180, 255, 0.8), 0 0 18px rgba(195, 180, 255, 0.55);
}

@media (max-width: 899px) {
  .perform {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    transform: none;
    padding: 12px;
  }

  .perform__top {
    flex-wrap: wrap;
  }

  .perform__notes {
    order: 3;
    flex-basis: 100%;
  }

  .perform__exit {
    margin-left: auto;
  }

  .perform__progression-select {
    min-width: 0;
    flex-basis: 100%;
    order: 2;
  }

  .perform__progression-label {
    order: 0;
  }

  .perform__types {
    order: 1;
  }

  .perform__step,
  .perform__transport,
  .perform__apply {
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
