/* ============================================================
   style.css — Evocal Studio UI
   Dark instrument aesthetic: black/charcoal + gold/amber accents
   Fonts: JetBrains Mono (values) + Inter (labels)
   Copyright 2026 Blues Prince Media
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #080810;
  --surface:      #10101c;
  --surface2:     #16162a;
  --surface3:     #1e1e38;
  --border:       #2a2a4a;
  --border-glow:  #3d3d70;

  --gold:         #c4a35a;
  --gold-light:   #d9be7f;
  --gold-dim:     #a68a3a;
  --amber:        #e8821a;

  --text:         #e8e8f0;
  --text-dim:     #7070a0;
  --text-muted:   #3a3a60;

  --active-glow:  0 0 18px rgba(196, 163, 90, 0.45);
  --card-shadow:  0 4px 24px rgba(0,0,0,0.5);

  --radius:       6px;
  --radius-lg:    12px;
  --font-mono:    'JetBrains Mono', monospace;
  --font-ui:      'Inter', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ─────────────────────────────────────────────── */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 0 16px 32px;
  overflow-x: hidden;
}

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 18px;
  letter-spacing: 0.18em;
}

.logo-mark {
  font-size: 22px;
  color: var(--gold);
  opacity: 0.9;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px var(--gold));
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(212, 160, 23, 0.5);
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.25em;
  margin-top: 4px;
}

.logo-byline {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 3px;
  font-weight: 300;
}

.app-main {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Cards / Panels ─────────────────────────────────────────── */
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--card-shadow);
}

/* ── Labels ─────────────────────────────────────────────────── */
.ctrl-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

/* ── Pitch Section ──────────────────────────────────────────── */
.pitch-section {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 22px 28px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border-color: var(--border-glow);
}

.pitch-display-wrap {
  flex-shrink: 0;
  text-align: center;
}

.pitch-display-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.note-display {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  transition: color 0.1s, text-shadow 0.1s;
  min-width: 120px;
}

.note-display.detected {
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(212, 160, 23, 0.6);
}

.freq-display {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.pitch-meters {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cents-row, .level-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meter-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  width: 28px;
  flex-shrink: 0;
}

.pitch-meter-track {
  flex: 1;
  height: 6px;
  background: var(--surface3);
  border-radius: 3px;
  position: relative;
  overflow: visible;
}

.pitch-meter-center {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 2px;
  height: 10px;
  background: var(--border-glow);
  transform: translateX(-50%);
  border-radius: 1px;
}

.pitch-meter-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: left 0.08s, width 0.08s;
  /* JS sets style.left and style.width directly each frame */
  left: 50%;
  width: 2px;
}

.cents-readout {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  min-width: 36px;
  text-align: right;
}

.level-canvas {
  flex: 1;
  border-radius: 3px;
  display: block;
  background: var(--surface3);
}

/* ── Controls Section (Key + Mode) ─────────────────────────── */
.controls-section {
  display: flex;
  gap: 20px;
}

.control-group {
  flex: 1;
}

.ctrl-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237070a0' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ctrl-select:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.15);
}

.ctrl-select option {
  background: var(--surface2);
}

/* ── Button Group Controls ──────────────────────────────────── */
.btn-controls-section {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-group-wrap {
  flex: 1;
  min-width: 160px;
}

.btn-group {
  display: flex;
  gap: 4px;
}

.btn-toggle {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 7px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}

.btn-toggle:hover {
  border-color: var(--border-glow);
  color: var(--text);
  background: var(--surface3);
}

.btn-toggle.active {
  background: rgba(212, 160, 23, 0.12);
  border-color: var(--gold-dim);
  color: var(--gold-light);
  box-shadow: var(--active-glow);
}

/* ── Voice Cards ─────────────────────────────────────────────── */
.voice-cards-section {
  padding: 16px;
}

.voice-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

@media (max-width: 600px) {
  .voice-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

.voice-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.voice-card.active {
  border-color: var(--gold-dim);
  box-shadow: 0 0 12px rgba(212, 160, 23, 0.15);
}

.voice-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.voice-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.voice-indicator.active {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.voice-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  flex: 1;
}

.voice-note {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
  min-width: 28px;
  text-align: right;
}

.voice-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-row label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  min-width: 28px;
  letter-spacing: 0.08em;
}

.voice-wave {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 5px;
  border-radius: 3px;
  cursor: pointer;
}

.voice-detune, .voice-vol {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  cursor: pointer;
  border: none;
}

.voice-detune::-webkit-slider-thumb,
.voice-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(212,160,23,0.5);
  transition: transform 0.1s;
}

.voice-detune::-webkit-slider-thumb:hover,
.voice-vol::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.detune-val {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  min-width: 24px;
  text-align: right;
}

/* ── Mix Section ─────────────────────────────────────────────── */
.mix-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mix-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mix-row .ctrl-label {
  margin: 0;
  min-width: 58px;
}

.mix-end-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  min-width: 24px;
}

.mix-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(to right, var(--gold-dim), var(--amber));
  border-radius: 2px;
  cursor: pointer;
}

.mix-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-light);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(212,160,23,0.6);
  transition: transform 0.1s, box-shadow 0.1s;
}

.mix-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(212,160,23,0.8);
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  min-width: 36px;
  text-align: right;
}

/* FM Toggle */
.fm-row {
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.fm-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  display: flex;
  align-items: center;
  width: 36px;
  height: 20px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(212, 160, 23, 0.2);
  border-color: var(--gold-dim);
}

.toggle-knob {
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  margin: 0 2px;
  transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked + .toggle-track .toggle-knob {
  transform: translateX(16px);
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

/* ── Diagnostics Bar ─────────────────────────────────────────── */
.diagnostics-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  margin-top: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  overflow-x: auto;
  white-space: nowrap;
}

.diag-item b {
  color: var(--gold);
  font-weight: 500;
}

.diag-warn {
  color: #ff6b35 !important;
}

.diag-sep {
  color: var(--border-glow);
  font-weight: 300;
}

/* ── Chart Active Toggle ─────────────────────────────────────── */
.chart-active-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Sensitivity Section ──────────────────────────────────────── */
.sensitivity-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sensitivity-header {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ── Start Button ─────────────────────────────────────────────── */
.start-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.start-btn {
  width: 200px;
  padding: 16px 0;
  background: transparent;
  border: 2px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(212,160,23,0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}

.start-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: var(--active-glow);
}

.start-btn:hover::before { opacity: 1; }

.start-btn.active {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 24px rgba(232, 130, 26, 0.4);
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 18px rgba(232, 130, 26, 0.3); }
  50%       { box-shadow: 0 0 32px rgba(232, 130, 26, 0.6); }
}

.status-bar {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-align: center;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.app-main > section {
  animation: fadeIn 0.4s ease both;
}

.app-main > section:nth-child(1) { animation-delay: 0.05s; }
.app-main > section:nth-child(2) { animation-delay: 0.10s; }
.app-main > section:nth-child(3) { animation-delay: 0.15s; }
.app-main > section:nth-child(4) { animation-delay: 0.20s; }
.app-main > section:nth-child(5) { animation-delay: 0.25s; }

/* ── Header Layout (auth) ──────────────────────────────────── */
.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 780px;
  position: relative;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-area {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.auth-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.auth-btn.signed-in {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.auth-user-email {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Modal Overlay ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

.modal-panel-wide {
  width: 780px;
  max-width: 95vw;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text); }

/* ── Auth Form ─────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.15);
}

.auth-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #e85454;
  padding: 8px 10px;
  background: rgba(232, 84, 84, 0.08);
  border: 1px solid rgba(232, 84, 84, 0.2);
  border-radius: var(--radius);
}

.auth-error.hidden { display: none; }

.auth-submit {
  width: 100%;
  padding: 12px 0;
  font-size: 13px;
}

.auth-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.text-dim {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.auth-link {
  background: none;
  border: none;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.auth-link:hover { color: var(--gold-light); }

/* ── Patch Editor ──────────────────────────────────────────── */
.patch-editor {
  display: flex;
  gap: 20px;
  min-height: 400px;
}

.patch-sidebar {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patch-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.patch-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 500px;
}

.patch-list-item {
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.patch-list-item:hover {
  border-color: var(--border-glow);
  color: var(--text);
}

.patch-list-item.active {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(212, 160, 23, 0.06);
}

.patch-edit-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.patch-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .patch-editor { flex-direction: column; }
  .patch-sidebar { width: 100%; }
  .patch-section-grid { grid-template-columns: 1fr; }
}

.patch-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctrl-label-sm {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.effects-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.effect-group {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.patch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.patch-actions-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.patch-public-toggle {
  flex-shrink: 0;
}

/* ── Small Buttons ─────────────────────────────────────────── */
.btn-sm {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm:hover {
  border-color: var(--border-glow);
  color: var(--text);
}

.btn-gold {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.btn-gold:hover {
  background: rgba(212, 160, 23, 0.1);
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-danger {
  border-color: rgba(232, 84, 84, 0.3);
  color: rgba(232, 84, 84, 0.7);
}

.btn-danger:hover {
  background: rgba(232, 84, 84, 0.08);
  border-color: #e85454;
  color: #e85454;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-outline:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

/* ── Start Row (patches + start + sessions) ────────────────── */
.start-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── Chord Chart Section ───────────────────────────────────── */
.chart-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-header .ctrl-label { margin: 0; }

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

.chart-tempo-slider {
  width: 80px;
}

/* Text Input */
.chart-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: var(--radius);
  resize: vertical;
  min-height: 44px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chart-input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.15);
}

.chart-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.chart-input-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Grid */
.chart-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
}

.chart-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.chart-bar-row {
  display: grid;
  gap: 6px;
}

.chart-bar-cell {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 60px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-bar-cell:hover {
  border-color: var(--border-glow);
}

.chart-bar-cell.chart-bar-active {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(212, 160, 23, 0.3);
  background: rgba(212, 160, 23, 0.05);
}

.bar-number {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
  position: absolute;
  top: 4px;
  left: 6px;
}

.bar-chords {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  padding-top: 6px;
  letter-spacing: 0.02em;
}

.bar-tones {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.05em;
}

/* Section headers */
.chart-section-header {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.chart-section-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.chart-label-known {
  color: var(--gold);
  border-left: 3px solid var(--gold-dim);
  padding-left: 8px;
}

.chart-label-custom {
  color: var(--text-dim);
  border-left: 3px solid var(--border);
  padding-left: 8px;
}

/* Repeat brackets */
.chart-repeat-start,
.chart-repeat-end {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  padding: 2px 6px;
}

.repeat-dots {
  color: var(--gold-dim);
}

/* Inline cell editing */
.chart-cell-input {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 3px;
  text-align: center;
  outline: none;
  margin-top: 4px;
}

/* Chart controls */
.chart-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chart-controls .btn-group-wrap {
  min-width: auto;
}

.chart-toggles {
  display: flex;
  gap: 6px;
}

.chart-bar-count-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.chart-bar-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.hidden { display: none !important; }

/* ── .ai Branding ──────────────────────────────────────────── */
.logo-dot {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 2px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Top Row: Pitch + Level (side by side) ──────────────────── */
.top-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border-color: var(--border-glow);
}

.pitch-panel {
  text-align: center;
  min-width: 160px;
}

.level-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

/* ── Compact Controls Bar ──────────────────────────────────── */
.controls-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 18px;
  flex-wrap: wrap;
}

.controls-bar .control-group {
  flex: 0 1 auto;
  min-width: 80px;
}

.controls-bar .btn-group-wrap {
  flex: 0 1 auto;
  min-width: auto;
}

.controls-bar .btn-group {
  gap: 3px;
}

.controls-bar .btn-toggle {
  padding: 6px 8px;
  font-size: 10px;
}

/* ── 2-Column Main Grid (Voice Cards + Mixer) ──────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.voice-cards-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--card-shadow);
}

.mixer-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mixer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mixer-row .ctrl-label {
  margin: 0;
  min-width: 50px;
  font-size: 8px;
}

.voice-type-row {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.voice-type-row .btn-group {
  gap: 3px;
}

.voice-type-row .btn-toggle {
  padding: 5px 8px;
  font-size: 9px;
}

.sensitivity-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Vowel slider — gradient from warm to cool */
.vowel-slider {
  background: linear-gradient(to right, #e8821a, var(--gold), #5a7aff, #4a4abb) !important;
}

@media (max-width: 700px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .top-row {
    grid-template-columns: 1fr;
  }
  .controls-bar {
    gap: 10px;
  }
}

/* ── Drum Loop Slots ───────────────────────────────────────── */
.drums-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
}

.drums-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drums-header .ctrl-label { margin: 0; }

.drums-vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drums-vol-slider {
  width: 80px;
}

.drum-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.drum-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-mono);
}

.drum-slot:hover {
  border-color: var(--border-glow);
  background: var(--surface3);
}

.drum-slot.active {
  border-color: var(--gold);
  background: rgba(212, 160, 23, 0.08);
  box-shadow: 0 0 14px rgba(212, 160, 23, 0.25);
}

.drum-slot-icon {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.15s;
}

.drum-slot.active .drum-slot-icon {
  color: var(--gold-light);
}

.drum-slot-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.drum-slot.active .drum-slot-name {
  color: var(--gold-light);
}

@keyframes pulse-drum {
  0%, 100% { box-shadow: 0 0 12px rgba(212, 160, 23, 0.2); }
  50%       { box-shadow: 0 0 20px rgba(212, 160, 23, 0.45); }
}

.drum-slot.active {
  animation: pulse-drum 1.5s ease-in-out infinite;
}

/* ── MIDI Indicator ────────────────────────────────────────── */
.midi-indicator {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.midi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.2s, box-shadow 0.2s;
}

.midi-dot.connected {
  background: #4aff6a;
  box-shadow: 0 0 6px #4aff6a;
}

.midi-dot.active {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

/* ── Activate Page ─────────────────────────────────────────── */
.activate-section {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.activate-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.activate-heading {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 4px;
}

.activate-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.activate-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.activate-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212, 160, 23, 0.1);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activate-step-text {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.activate-step-text strong {
  color: var(--gold);
}

.activate-step-text code,
.activate-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--surface2);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: inline-block;
  margin-top: 4px;
}

.license-card {
  padding: 16px;
  margin-bottom: 10px;
  background: var(--surface2);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.license-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.license-product {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
}

.btn-gold {
  background: rgba(212, 160, 23, 0.15);
  color: var(--gold);
  border: 1px solid rgba(212, 160, 23, 0.3);
  cursor: pointer;
}

.btn-gold:hover {
  background: rgba(212, 160, 23, 0.25);
  border-color: var(--gold);
}

.activate-success {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(212, 160, 23, 0.15);
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 14px 28px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

/* ── Shared Footer ─────────────────────────────────────────── */
.site-footer {
  width: 100%;
  max-width: 780px;
  text-align: center;
  padding: 32px 0 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.site-footer-brand {
  color: var(--text-dim);
}

.site-footer-sep {
  color: var(--border-glow);
}

.site-footer-link {
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer-link:hover {
  color: var(--gold);
}

/* ── Hold Button ─────────────────────────────────────────── */
.hold-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 12px 28px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.hold-btn:hover {
  border-color: var(--border-glow);
}

.hold-btn.active {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(212, 160, 23, 0.15);
  box-shadow: var(--active-glow);
}

/* ── Notation Display (THIRI 1.2) ────────────────────────── */
.notation-section {
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
}

.notation-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.notation-chord {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
}

.notation-voicing-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.notation-canvas {
  min-height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
}

.notation-canvas svg {
  background: transparent;
}

/* Override VexFlow default colors for dark theme.
   Elements VexFlow styles inline (note heads/stems get style="...") keep
   their color — the old blanket !important also killed the gold lead note. */
.notation-canvas svg line:not([style*="stroke"]),
.notation-canvas svg path:not([style*="stroke"]) {
  stroke: var(--text-dim);
}

.notation-canvas svg text {
  fill: var(--text-dim) !important;
}

/* ── Chord Pads (THIRI 1.2) ──────────────────────────────── */
.pads-section {
  padding: 16px 22px;
}

.pads-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pads-key-display {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.pads-layout {
  display: flex;
  gap: 10px;
}

.pads-toggle-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
}

.pad-toggle {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pad-toggle.active {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: rgba(212, 160, 23, 0.12);
  box-shadow: var(--active-glow);
}

.pad-toggle-spacer {
  min-height: 38px;
}

.pads-grid-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pad-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.chord-pad {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  user-select: none;
}

.chord-pad:hover {
  border-color: var(--border-glow);
  background: var(--surface3);
}

.chord-pad.active {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(212, 160, 23, 0.15);
  box-shadow: var(--active-glow);
}

.chord-pad .pad-symbol {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

.chord-pad .pad-label {
  font-size: 7px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.pad-row-diatonic .chord-pad {
  border-bottom-width: 2px;
  border-bottom-color: var(--gold-dim);
}

@media (max-width: 640px) {
  .pad-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Effects Section (THIRI 1.1) ─────────────────────────── */
.effects-section {
  padding: 16px 22px;
}

.effects-row-header {
  margin-bottom: 12px;
}

.effects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.effect-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.effect-block > .ctrl-label-sm {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.effect-block .mixer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.effect-block .mixer-row .ctrl-label-sm {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  min-width: 32px;
  flex-shrink: 0;
}

.effect-block .mix-slider {
  flex: 1;
  min-width: 0;
}

.effect-block .slider-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold-dim);
  min-width: 42px;
  text-align: right;
}

.effect-block .ctrl-select {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .effects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPACT SIGNAL-FLOW LAYOUT (2026-08 redesign)
   Transport on top → input → harmony brain → voices → FX/output.
   ═══════════════════════════════════════════════════════════════════════════ */

.app-main.compact { max-width: 1400px; margin: 0 auto; padding: 0.75rem 1rem 2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.app-main.compact section { margin: 0; }

/* Transport bar — sticky, always reachable */
.transport-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-panel, #12121c); border: 1px solid var(--border, #2a2a3a);
  border-radius: 10px; padding: 0.6rem 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
}
.transport-bar .start-btn { margin: 0; padding: 0.55rem 1.6rem; font-size: 0.9rem; }
.transport-bar .hold-btn { margin: 0; padding: 0.55rem 1rem; }
.transport-bar .control-group { display: flex; align-items: center; gap: 0.45rem; }
.transport-input .ctrl-select { max-width: 200px; }
.transport-tempo .mix-slider { width: 110px; }
.transport-status { flex: 1 1 160px; text-align: right; background: none; border: none; padding: 0; font-size: 0.72rem; opacity: 0.8; }

/* Row 1: input */
.io-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0.75rem; align-items: stretch; }
.conditioning-panel {
  background: var(--bg-panel, #12121c); border: 1px solid var(--border, #2a2a3a);
  border-radius: 10px; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.35rem;
}
.io-row .pitch-panel { padding: 0.75rem 1rem; }
.io-row .note-display { font-size: 2.2rem; line-height: 1.1; }
.io-row .freq-display { font-size: 0.8rem; }

/* Row 2: harmony brain */
.harmony-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0.75rem; align-items: stretch; }
.harmony-row .chart-section, .harmony-row .pads-section { height: 100%; }

/* Row 4: FX + voicing out */
.out-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 0.75rem; align-items: stretch; }
.out-row .notation-section { display: flex; flex-direction: column; }
.out-row .notation-canvas { flex: 1; min-height: 120px; }

/* Density pass */
.app-main.compact .mixer-row { padding: 0.15rem 0; gap: 0.5rem; }
.app-main.compact .effect-block { padding: 0.6rem 0.75rem; }
.app-main.compact .controls-bar { padding: 0.6rem 1rem; }

@media (max-width: 1100px) {
  .io-row { grid-template-columns: 1fr 1fr; }
  .io-row .pitch-panel { grid-column: 1 / -1; }
  .harmony-row, .out-row { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .io-row { grid-template-columns: 1fr; }
  .transport-bar { gap: 0.6rem; }
  .transport-status { flex-basis: 100%; text-align: left; }
}

/* Slim header for the compact demo layout */
body:has(.app-main.compact) .app-header { padding: 0.6rem 1rem 0.4rem; }
body:has(.app-main.compact) .app-header .logo-text { font-size: 1.5rem; }
body:has(.app-main.compact) .app-header .logo-mark { font-size: 1.1rem; }
body:has(.app-main.compact) .app-header .logo-dot { font-size: 0.9rem; }
body:has(.app-main.compact) .logo-sub { font-size: 0.6rem; margin-top: 0.15rem; }

/* ═══════ Transport clock — beat LEDs, bar:beat readout, START states ═══════ */
.beat-cluster { display: flex; align-items: center; gap: 8px; }
.beat-leds { display: flex; gap: 5px; }
.beat-led {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border);
  transition: background 0.05s, box-shadow 0.05s;
}
.beat-led.on {
  background: var(--gold);
  border-color: var(--gold-dim);
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.7);
}
.beat-led.accent {
  background: var(--gold-light);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(245, 197, 66, 0.9);
}
.bar-beat-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-light);
  min-width: 42px;
  text-align: left;
}
.start-btn.arming {
  border-color: #e8a821;
  color: #e8a821;
  animation: pulse-border 1s infinite;
}
.start-btn.error {
  border-color: #e85454;
  color: #e85454;
}

/* ═══════ Rotary knobs (js/knob.js builds the SVG) ═══════ */
.knob-rack {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px 14px;
  padding: 4px 0;
}
.knob-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
/* The native range input stays for wiring but is invisible */
.knob-wrap input[type="range"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.knob-svg {
  cursor: ns-resize;
  outline: none;
  display: block;
}
.knob-svg:focus-visible {
  filter: drop-shadow(0 0 5px rgba(245, 197, 66, 0.6));
}
.knob-svg.knob-dragging {
  filter: drop-shadow(0 0 8px rgba(212, 160, 23, 0.55));
}
.knob-groove {
  stroke: var(--surface3);
  stroke-width: 3;
  stroke-linecap: round;
}
.knob-value-arc {
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
}
.knob-dot {
  fill: var(--gold-light);
}
.knob-cap {
  fill: var(--surface2);
  stroke: var(--border-glow);
  stroke-width: 1;
}
.knob-center-tick {
  stroke: var(--text-muted);
  stroke-width: 1.5;
}
.knob-readout {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold-light);
  min-height: 12px;
  text-align: center;
}
.knob-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Mixer column knob cluster: big MIX flanked by small knobs */
.mixer-knobs {
  justify-content: center;
  align-items: center;
  gap: 12px 18px;
}
.master-row { margin-top: 6px; }

/* BPM numeric field (replaces the 260-step slider) */
.bpm-input {
  width: 58px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.bpm-input::-webkit-inner-spin-button { opacity: 1; }
.bpm-input:focus { border-color: var(--gold); }

/* Voice-card knob row: detune knob beside a mini volume fader */
.voice-knob-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.voice-vol-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Firefox parity for the remaining faders (was: unstyled default) */
.mix-slider::-moz-range-track,
.voice-vol::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--gold-dim), var(--amber));
  border: none;
}
.mix-slider::-moz-range-thumb,
.voice-vol::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-light);
  border: none;
  box-shadow: 0 0 10px rgba(212, 160, 23, 0.4);
}

/* Momentary trigger flash — pads pulse distinctly from their latched state */
@keyframes pad-flash {
  0%   { background: rgba(245, 197, 66, 0.45); box-shadow: 0 0 16px rgba(245, 197, 66, 0.8); }
  100% { background: rgba(212, 160, 23, 0.12); box-shadow: var(--active-glow); }
}
.chord-pad.flash { animation: pad-flash 0.16s ease-out; }

/* HOLD reads as a latched LED, not just another gold button */
.hold-btn.active::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 8px rgba(245, 197, 66, 0.9);
  vertical-align: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .chord-pad.flash { animation: none; }
  .start-btn.active, .start-btn.arming { animation: none; }
}

/* ═══════ Demo funnel strip — the app must never dead-end ═══════ */
.header-brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: inherit;
}
.demo-funnel {
  width: 100%;
  max-width: 780px;
  margin-top: 14px;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.demo-funnel-pitch {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-dim);
  flex: 1 1 260px;
  line-height: 1.5;
}
.demo-funnel-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.demo-funnel-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.demo-funnel-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold-light);
}
.demo-funnel-btn-primary {
  background: rgba(212, 160, 23, 0.12);
  border-color: var(--gold-dim);
  color: var(--gold-light);
  box-shadow: var(--active-glow);
}
.demo-funnel-btn-primary:hover {
  background: rgba(212, 160, 23, 0.22);
  border-color: var(--gold);
}
