/* ====================================================================
   PIANO & KEYBOARD TRAINER STUDIO - STUDIO PRO LIGHT 2.0
   macOS Glassmorphism, Titanium Metal Gradient & Bento Grid
   ==================================================================== */

:root {
  --font-sans: 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Cores macOS Studio Pro Light */
  --bg-desktop: #ECEEF2;
  --window-bg: rgba(255, 255, 255, 0.84);
  --glass-bg: rgba(255, 255, 255, 0.80);
  --glass-border: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.08);

  /* Titânio Escovado (Sidebar) */
  --sidebar-gradient: linear-gradient(180deg, #DCE0E4 0%, #CCD1D7 100%);
  --sidebar-border: rgba(180, 185, 195, 0.5);

  /* Acentos Apple Pro */
  --accent-blue: #007AFF;
  --accent-blue-hover: #0062CC;
  --accent-amber: #FF9500;
  --amber-glow: rgba(255, 149, 0, 0.45);
  --accent-green: #34C759;
  --accent-red: #FF3B30;
  --accent-purple: #AF52DE;
  
  /* Textos */
  --text-main: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(210, 215, 225, 0.6);

  /* Traffic lights */
  --tl-red: #FF5F56;
  --tl-yellow: #FFBD2E;
  --tl-green: #27C93F;

  /* Teclado Cores */
  --white-key-bg: #FFFFFF;
  --white-key-border: #D1D5DB;
  --black-key-bg: #1F2937;
  --rh-color: #34C759; /* Mão Direita (Verde Apple) */
  --lh-color: #007AFF; /* Mão Esquerda (Azul Apple) */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Regra utilitária fundamental */
.hidden {
  display: none !important;
}

.nav-item * {
  pointer-events: none;
}

.mobile-nav-item * {
  pointer-events: none;
}

.sidebar-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 90;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.hidden {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-desktop);
  background-image: 
    radial-gradient(at 0% 0%, rgba(200, 215, 240, 0.5) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(225, 230, 245, 0.6) 0px, transparent 50%);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

/* Janela Principal Estilo macOS */
.macos-window {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--window-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Barra Superior da Janela macOS */
.window-titlebar {
  height: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(246, 247, 249, 0.85);
  border-bottom: 1px solid rgba(210, 215, 225, 0.6);
  user-select: none;
  flex-shrink: 0;
}

.traffic-lights {
  display: flex;
  gap: 8px;
  width: 80px;
}

.traffic-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: opacity 0.2s;
}

.traffic-btn:hover { opacity: 0.8; }
.traffic-btn.red { background: var(--tl-red); border: 1px solid rgba(0,0,0,0.1); }
.traffic-btn.yellow { background: var(--tl-yellow); border: 1px solid rgba(0,0,0,0.1); }
.traffic-btn.green { background: var(--tl-green); border: 1px solid rgba(0,0,0,0.1); }

.window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.title-badge {
  font-size: 10px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent-blue);
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 600;
}

.engine-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #34C759;
  background: rgba(52, 199, 89, 0.12);
  padding: 3px 9px;
  border-radius: 10px;
  font-weight: 600;
}

/* Corpo da Janela */
.window-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Sidebar Metálica (Titânio Escovado) */
.sidebar-metal {
  width: 230px;
  background: var(--sidebar-gradient);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  user-select: none;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 18px 10px;
  border-bottom: 1px solid rgba(160, 165, 175, 0.35);
  margin-bottom: 12px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #1D1D1F 0%, #444850 100%);
  color: #FFF;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.brand-info h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-info p {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: #33363B;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nav-icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
  opacity: 0.85;
}

.nav-counter {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--text-secondary);
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(160, 165, 175, 0.35);
}

.volume-slider-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.macos-range {
  flex: 1;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* Área de Conteúdo Principal */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #F8F9FB;
  overflow: hidden;
  position: relative;
}

/* Top Bar Flutuante */
.floating-topbar {
  margin: 4px 8px 3px 8px;
  padding: 4px 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  user-select: none;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.floating-topbar::-webkit-scrollbar { display: none; }

.topbar-metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.3px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.score-val { color: #007AFF; }
.combo-val { color: #FF9500; }
.acc-val { color: #34C759; }

/* Tag de Feedback de Acorde / Hit */
.hit-feedback-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px;
}

.chord-detect-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #FFF;
  background: linear-gradient(135deg, #007AFF 0%, #AF52DE 100%);
  padding: 3px 10px;
  border-radius: 14px;
  box-shadow: 0 0 12px rgba(0, 122, 255, 0.4);
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.amber-glow-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #FFF;
  background: linear-gradient(135deg, #FF9500 0%, #FF5F56 100%);
  padding: 3px 10px;
  border-radius: 14px;
  box-shadow: 0 0 14px var(--amber-glow);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Seletores de Visão */
.view-selectors {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.macos-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(190, 195, 205, 0.8);
  border-radius: 8px;
  padding: 4px 24px 4px 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%226%22%20viewBox%3D%220%200%2010%206%22%3E%3Cpath%20fill%3D%22%236E6E73%22%20d%3D%22M0%200l5%206%205-6z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px 5px;
}

.sustain-pedal-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-tertiary);
  transition: all 0.15s ease;
}

.sustain-pedal-indicator.active {
  background: rgba(52, 199, 89, 0.15);
  color: #28A745;
  border: 1px solid rgba(52, 199, 89, 0.4);
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.3);
}

.panic-btn {
  transition: all 0.15s ease;
}
.panic-btn:hover {
  background: rgba(255, 59, 48, 0.15) !important;
  transform: scale(1.08);
}

/* ÁREA CENTRAL: SPLIT-SCREEN DINÂMICO */
.split-viewport {
  flex: 1;
  display: flex;
  margin: 4px 10px 4px 10px;
  background: #F1F3F6;
  border-radius: 14px;
  border: 1px solid rgba(215, 220, 230, 0.8);
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.split-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: #FAFBFD;
}

.split-pane.pane-left {
  border-right: 1px solid rgba(215, 220, 230, 0.8);
}

/* MODO SYNTHESIA: TECLADO ALINHADO DIRETAMENTE EMBAIXO DAS NOTAS */
.split-viewport.synthesia-mode {
  flex-direction: column;
}

.split-viewport.synthesia-mode .split-pane.pane-left {
  flex: 1 1 auto;
  min-height: 0;
  border-right: none;
  border-bottom: 2px solid rgba(255, 149, 0, 0.7);
}

.split-viewport.synthesia-mode .split-pane.pane-right {
  flex: 0 0 160px;
  height: 160px;
  min-height: 130px;
  max-height: 200px;
  border-left: none;
  background: #0E121C;
}

.split-viewport.synthesia-mode .split-pane.pane-right .pane-header {
  display: none !important; /* Em modo Synthesia, o teclado cola perfeitamente na base da esteira */
}

.pane-header {
  height: 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(240, 243, 247, 0.85);
  border-bottom: 1px solid rgba(220, 225, 235, 0.7);
  user-select: none;
}

.pane-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pane-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas dos Modos */
.game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* MODO 4: TECLADO VIRTUAL INTERATIVO (PIANO KEYBED COM ALINHAMENTO GEOMÉTRICO) */
.keyboard-interactive-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #0E121C;
  user-select: none;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

.piano-keybed {
  width: 100%;
  height: 100%;
  position: relative;
  background: #111520;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  box-sizing: border-box;
}

.white-key {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F6F8 88%, #DDE1E8 100%);
  border: 1px solid #B0B5C0;
  border-top: none;
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
  transition: background 0.08s, transform 0.05s;
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.08), inset 0 2px 2px rgba(255,255,255,0.8);
  z-index: 1;
}

.white-key:hover {
  background: linear-gradient(180deg, #FBFBFB 0%, #EEF1F5 100%);
}

.white-key.active-rh {
  background: linear-gradient(180deg, #D4EDDA 0%, #34C759 100%) !important;
  box-shadow: 0 0 16px rgba(52, 199, 89, 0.8), inset 0 0 8px rgba(255,255,255,0.6);
  transform: translateY(2px);
}

.white-key.active-lh {
  background: linear-gradient(180deg, #D1E7DD 0%, #007AFF 100%) !important;
  box-shadow: 0 0 16px rgba(0, 122, 255, 0.8), inset 0 0 8px rgba(255,255,255,0.6);
  transform: translateY(2px);
}

.black-key {
  position: absolute;
  top: 0;
  height: 62%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #2D333F 0%, #151820 100%);
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 4px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 4px;
  transition: background 0.08s, transform 0.05s;
  box-shadow: 0 3px 6px rgba(0,0,0,0.45), inset 0 1px 1px rgba(255,255,255,0.15);
  z-index: 3;
}

.black-key:hover {
  background: linear-gradient(180deg, #3A4252 0%, #1C202B 100%);
}

.black-key.active-rh {
  background: linear-gradient(180deg, #28A745 0%, #1B692F 100%) !important;
  box-shadow: 0 0 16px rgba(52, 199, 89, 0.9);
  transform: translateY(2px);
}

.black-key.active-lh {
  background: linear-gradient(180deg, #007AFF 0%, #004BBB 100%) !important;
  box-shadow: 0 0 16px rgba(0, 122, 255, 0.9);
  transform: translateY(2px);
}

/* Modo Didático (Esperar Você Tocar / Wait Mode Key Pulse) */
.white-key.wait-pulse {
  background: linear-gradient(180deg, #FFF9C4 0%, #FFD60A 100%) !important;
  box-shadow: 0 0 20px #FFD60A, inset 0 0 12px rgba(255, 214, 10, 0.9) !important;
  border-color: #FFD60A !important;
  animation: waitPulseKey 0.8s infinite alternate ease-in-out;
  z-index: 2;
}

.black-key.wait-pulse {
  background: linear-gradient(180deg, #CC9A06 0%, #FFD60A 100%) !important;
  box-shadow: 0 0 24px #FFD60A, inset 0 0 10px rgba(255, 255, 255, 0.7) !important;
  border-color: #FFF !important;
  animation: waitPulseKey 0.8s infinite alternate ease-in-out;
  z-index: 4;
}

@keyframes waitPulseKey {
  0% { transform: translateY(0); filter: brightness(1.05); }
  100% { transform: translateY(3px); filter: brightness(1.45); }
}

.key-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  pointer-events: none;
}

.black-key .key-label {
  color: #A0A5B0;
  font-size: 8px;
}

.finger-badge {
  position: absolute;
  top: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.finger-badge.rh { background: #34C759; }
.finger-badge.lh { background: #007AFF; }

/* BARRA DE TRANSPORTE FLUTUANTE INFERIOR */
.floating-transport-bar {
  margin: 2px 8px 3px 8px;
  padding: 4px 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  z-index: 10;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.floating-transport-bar::-webkit-scrollbar { display: none; }

.transport-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.transport-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(190, 195, 205, 0.7);
  background: #FFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.12s;
}

.transport-btn:hover { background: #F0F2F5; transform: translateY(-1px); }
.transport-btn.play-btn {
  background: var(--accent-blue);
  color: #FFF;
  border-color: var(--accent-blue);
}
.transport-btn.play-btn:hover { background: var(--accent-blue-hover); }

.transport-btn.btn-listen-guide {
  width: auto;
  min-width: 84px;
  height: 32px;
  padding: 0 10px;
  gap: 5px;
  font-weight: 600;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 122, 255, 0.4);
  background: rgba(0, 122, 255, 0.08);
  color: var(--accent-blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.transport-btn.btn-listen-guide:hover {
  background: rgba(0, 122, 255, 0.18);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.transport-btn.btn-listen-guide.active {
  background: var(--accent-blue);
  color: #FFF;
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
  font-weight: 700;
}

.transport-btn.btn-wait-mode {
  width: auto;
  min-width: 82px;
  height: 32px;
  padding: 0 10px;
  gap: 5px;
  font-weight: 600;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 149, 0, 0.45);
  background: rgba(255, 149, 0, 0.08);
  color: #D97706;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.transport-btn.btn-wait-mode:hover {
  background: rgba(255, 149, 0, 0.18);
  border-color: #FF9500;
  transform: translateY(-1px);
}

.transport-btn.btn-wait-mode.active {
  background: #FF9500;
  color: #FFF;
  border-color: #FF9500;
  box-shadow: 0 2px 10px rgba(255, 149, 0, 0.45);
  font-weight: 700;
}

/* Metrônomo Visual (4 LEDs 1-2-3-4) */
.metro-led-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.08);
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  user-select: none;
}

.metro-led {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-tertiary);
  transition: all 0.08s ease;
}

.metro-led.active-downbeat {
  background: #FF9500 !important;
  color: #000 !important;
  box-shadow: 0 0 10px #FF9500, 0 0 18px rgba(255, 149, 0, 0.8) !important;
  transform: scale(1.22);
}

.metro-led.active-beat {
  background: #34C759 !important;
  color: #000 !important;
  box-shadow: 0 0 8px #34C759, 0 0 14px rgba(52, 199, 89, 0.8) !important;
  transform: scale(1.15);
}

/* Banner de Importação MIDI (Drag & Drop) */
.songs-import-banner {
  border: 2px dashed rgba(0, 122, 255, 0.35);
  border-radius: 12px;
  padding: 16px 20px;
  background: rgba(0, 122, 255, 0.04);
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.songs-import-banner.drag-over {
  border-color: var(--accent-blue);
  background: rgba(0, 122, 255, 0.12);
  transform: scale(1.01);
}

.songs-import-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.songs-import-icon {
  font-size: 32px;
  line-height: 1;
}

.songs-import-text {
  flex: 1;
  min-width: 220px;
}

.songs-import-text h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.songs-import-text p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.bpm-control-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFF;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(200, 205, 215, 0.8);
}

.bpm-display {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.bpm-label { font-size: 8.5px; font-weight: 800; color: var(--text-tertiary); }
.bpm-number { font-family: var(--font-mono); font-size: 14px; font-weight: 800; color: var(--text-main); }
.bpm-unit { font-size: 9px; font-weight: 600; color: var(--text-tertiary); }

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

.bpm-step-btn {
  background: #F0F2F5;
  border: 1px solid #D5DAE0;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.metronome-vol-divider {
  width: 1px;
  height: 20px;
  background: rgba(200, 205, 215, 0.8);
  margin: 0 4px;
}

.metronome-vol-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 2px;
}

.metro-vol-icon {
  font-size: 11px;
  line-height: 1;
}

.metronome-vol-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  min-width: 30px;
}

.metronome-vol-slider {
  cursor: pointer;
}

/* STATUS BAR INFERIOR */
.native-statusbar {
  height: 24px;
  min-height: 24px;
  background: #EBECEF;
  border-top: 1px solid rgba(200, 205, 215, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 10.5px;
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

.status-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #999;
  display: inline-block;
  margin-right: 4px;
}

.status-dot.connected {
  background: #34C759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.7);
}

/* OVERLAYS BENTO GRID */
.view-overlay-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(245, 247, 250, 0.97);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.view-overlay-layer.hidden {
  display: none !important;
}

.overlay-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: fadeInPanel 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay-panel.hidden {
  display: none !important;
}

@keyframes fadeInPanel {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.close-overlay-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bento-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s, box-shadow 0.15s;
}

.bento-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.bento-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.bento-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

/* RESPONSIVIDADE E MOBILE */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-pane-switcher {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 3px;
  margin: 4px 10px;
}

.mobile-pane-pill {
  flex: 1;
  background: transparent;
  border: none;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.mobile-pane-pill.active {
  background: #FFF;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(25px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 80;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #8E8E93;
  gap: 3px;
}

.mobile-nav-item.active { color: var(--accent-blue); }

@media (max-width: 880px) {
  .mobile-menu-btn { display: inline-block; }
  .traffic-lights { display: none; }
  .sidebar-metal {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .sidebar-metal.mobile-drawer-open { transform: translateX(0); }
  .mobile-bottom-nav { display: flex; }
  .main-content { padding-bottom: 64px; }
  .mobile-pane-switcher { display: flex; }
  .split-viewport { flex-direction: column; }
  .split-pane.pane-left.mobile-hidden,
  .split-pane.pane-right.mobile-hidden {
    display: none !important;
  }
  .bento-grid { grid-template-columns: 1fr; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .window-titlebar { display: none; }
  .floating-topbar { margin: 2px 6px; padding: 2px 6px; }
  .floating-transport-bar { margin: 2px 6px; padding: 2px 6px; }
  .main-content { padding-bottom: 50px; }
  .mobile-bottom-nav { height: 48px; }
  .split-viewport { flex-direction: row; }
}

/* ====================================================================
   EXTENSÕES VISUAIS: GRAND STAFF, DAW MATRIX, HARMONIZER & GEAR LAB
   ==================================================================== */

/* Grand Staff (Pauta Dupla em Tempo Real) */
.grand-staff-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grand-staff-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* DAW Harmonic Matrix (Matriz de Arpejos & Graus Harmônicos) */
.daw-matrix-container {
  width: 100%;
  height: 100%;
  padding: 14px;
  background: #141822;
  color: #FFF;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
}

.daw-matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.daw-matrix-title {
  font-size: 13px;
  font-weight: 700;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.daw-matrix-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.daw-btn-preset {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #CBD5E1;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.daw-btn-preset:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

.daw-btn-preset.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #FFF;
}

.daw-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.daw-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.daw-row-label {
  width: 80px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  text-align: right;
  padding-right: 8px;
  flex-shrink: 0;
}

.daw-steps {
  display: flex;
  gap: 4px;
  flex: 1;
}

.daw-step-cell {
  flex: 1;
  height: 28px;
  min-width: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.08s, transform 0.08s, box-shadow 0.08s;
  position: relative;
}

.daw-step-cell:nth-child(4n+1) {
  border-left: 2px solid rgba(255, 149, 0, 0.6);
}

.daw-step-cell:hover {
  background: rgba(255, 255, 255, 0.14);
}

.daw-step-cell.active {
  background: linear-gradient(135deg, #007AFF 0%, #00C6FF 100%);
  border-color: #38BDF8;
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.6);
}

.daw-step-cell.playhead {
  outline: 2px solid #FF9500;
  outline-offset: -1px;
  box-shadow: inset 0 0 8px rgba(255, 149, 0, 0.6);
}

.daw-step-cell.active.playhead {
  background: linear-gradient(135deg, #FF9500 0%, #FFCC00 100%);
  border-color: #FFF;
  box-shadow: 0 0 14px #FF9500;
}

/* Harmonizer Slots */
.progression-slot {
  flex: 1;
  min-width: 130px;
  background: #FFF;
  border: 1.5px solid rgba(200, 205, 215, 0.8);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.progression-slot.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(0, 122, 255, 0.25);
  background: #F4F8FF;
}

.slot-bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.slot-chord-select {
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 24px 6px 8px;
}

/* Live MIDI Monitor Box no Gear Lab */
.midi-monitor-box {
  background: #111520;
  border-radius: 12px;
  padding: 12px;
  color: #FFF;
  font-family: var(--font-mono);
  font-size: 11px;
  height: 160px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.midi-log-row {
  display: flex;
  gap: 12px;
  padding: 2px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.midi-log-row.note-on { color: #34C759; }
.midi-log-row.note-off { color: #8E8E93; }
.midi-log-row.cc { color: #FF9500; }

.btn-primary {
  background: var(--accent-blue);
  color: #FFF;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  transition: background 0.12s;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

/* Toast Notificações macOS */
.macos-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(29, 29, 31, 0.92);
  color: #FFF;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 9999;
  opacity: 0;
  transition: all 0.22s ease-out;
  pointer-events: none;
}

.macos-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Indicador LED RX de atividade MIDI */
.midi-rx-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(142, 142, 147, 0.2);
  color: #8E8E93;
  letter-spacing: 0.5px;
  transition: all 0.08s ease;
  user-select: none;
}

.midi-rx-indicator.active {
  background: #34C759 !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(52, 199, 89, 0.8) !important;
}

.midi-troubleshoot-box {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.midi-guide-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.midi-guide-item:last-child {
  border-bottom: none;
}

.midi-guide-tag {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent-blue);
  white-space: nowrap;
}

/* ====================================================================
   STUDIO EAR LAB (TREINO DE OUVIDO & PERCEPÇÃO MUSICAL)
   ==================================================================== */
.ear-feedback-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
}

.ear-feedback-banner.neutral {
  background: rgba(0, 113, 227, 0.06);
  border-color: rgba(0, 113, 227, 0.2);
}

.ear-feedback-banner.correct {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.4);
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.15);
}

.ear-feedback-banner.wrong {
  background: rgba(255, 59, 48, 0.12);
  border-color: rgba(255, 59, 48, 0.4);
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.15);
}

.ear-feedback-icon {
  font-size: 28px;
  line-height: 1;
}

.ear-feedback-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ear-feedback-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.ear-feedback-text span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Teclado do Ear Lab */
.ear-keyboard-wrapper {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
}

.ear-piano-keybed {
  position: relative;
  height: 130px;
  margin: 0 auto;
  user-select: none;
}

.ear-piano-key {
  position: absolute;
  top: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
  transition: background 0.1s, transform 0.05s, box-shadow 0.15s;
  border-radius: 0 0 5px 5px;
}

.ear-piano-key.white {
  height: 130px;
  background: #FFF;
  border: 1px solid #D1D5DB;
  border-top: none;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.ear-piano-key.black {
  height: 82px;
  background: #1F2937;
  color: #FFF;
  z-index: 2;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.ear-piano-key .key-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.ear-piano-key.black .key-name {
  font-size: 9px;
  color: #9CA3AF;
}

/* Feedback States */
.ear-piano-key.ear-tonic {
  background: #0071E3 !important;
  color: #FFF !important;
  box-shadow: 0 0 12px rgba(0, 113, 227, 0.7) !important;
}

.ear-piano-key.ear-correct {
  background: #34C759 !important;
  color: #000 !important;
  box-shadow: 0 0 16px rgba(52, 199, 89, 0.9) !important;
  animation: earPulseGreen 0.4s ease;
}

.ear-piano-key.ear-wrong {
  background: #FF3B30 !important;
  color: #FFF !important;
  box-shadow: 0 0 16px rgba(255, 59, 48, 0.9) !important;
  animation: earShakeRed 0.4s ease;
}

@keyframes earPulseGreen {
  0% { transform: scale(1); }
  50% { transform: scale(0.97) translateY(2px); }
  100% { transform: scale(1); }
}

@keyframes earShakeRed {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ====================================================================
   PAD LAYER DUAL SOUND & CONTROLS
   ==================================================================== */
.pad-layer-btn {
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--bg-card);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pad-layer-btn:hover {
  background: rgba(175, 82, 222, 0.08);
  border-color: rgba(175, 82, 222, 0.4);
}

.pad-layer-btn.active {
  background: linear-gradient(135deg, rgba(175, 82, 222, 0.18), rgba(0, 113, 227, 0.15)) !important;
  border-color: #AF52DE !important;
  color: #AF52DE !important;
  box-shadow: 0 0 10px rgba(175, 82, 222, 0.35) !important;
}

.pad-layer-btn.active #padLayerStatusText {
  color: #AF52DE !important;
  font-weight: 800;
}

.pad-quick-controls, .arp-quick-controls {
  animation: fadeInQuick 0.2s ease;
}

.arp-btn {
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--bg-card);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.arp-btn:hover {
  background: rgba(255, 45, 85, 0.08);
  border-color: rgba(255, 45, 85, 0.4);
}

.arp-btn.active {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.18), rgba(255, 149, 0, 0.15)) !important;
  border-color: #FF2D55 !important;
  color: #FF2D55 !important;
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.35) !important;
}

.arp-btn.active #arpStatusText {
  color: #FF2D55 !important;
  font-weight: 800;
}

@keyframes fadeInQuick {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Switch Toggle Component */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

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

.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D1D5DB;
  transition: .3s;
  border-radius: 22px;
}

.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.switch-toggle input:checked + .slider {
  background-color: #AF52DE;
}

.switch-toggle input:checked + .slider:before {
  transform: translateX(20px);
}



