body { font-family: Inter, sans-serif; }

.tool-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 3px 12px rgba(0,0,0,.04);
}

/* ── Preset bar ── */
.synth-preset-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.synth-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  flex-shrink: 0;
}
.synth-preset-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.preset-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.preset-pill:hover { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.preset-pill.active { background: #065f46; border-color: #065f46; color: #fff; }

/* ── Synth panel: 4 modules in a row ── */
.synth-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .synth-panel { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .synth-panel { grid-template-columns: 1fr; }
}

/* ── Module box ── */
.synth-module {
  background: #060f0a;
  border: 1px solid #0a2a1f;
  border-radius: 10px;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.synth-module-title {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #065f46;
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Knob row ── */
.synth-knob-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.synth-knob-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 36px;
}
.synth-knob-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

/* ── Sliders ── */
.synth-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: #0a2a1f;
  outline: none;
  cursor: pointer;
  accent-color: #065f46;
}
.synth-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #065f46;
  box-shadow: 0 0 4px rgba(124,58,237,0.6);
  cursor: grab;
}
.synth-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.synth-slider-val {
  font-size: 0.55rem;
  color: #6ee7b7;
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}

/* ── Waveform buttons ── */
.synth-waveform-btns {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: wrap;
}
.wave-btn {
  width: 30px; height: 24px;
  border: 1px solid #0a2a1f;
  border-radius: 5px;
  background: #061a12;
  color: #6b7280;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 3px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.wave-btn svg { width: 100%; height: 100%; }
.wave-btn:hover { background: #0a2a1f; color: #6ee7b7; border-color: #065f46; }
.wave-btn.active { background: #065f46; color: #fff; border-color: #065f46; }

/* ── ADSR canvas ── */
.adsr-canvas {
  width: 100%;
  height: 60px;
  border-radius: 6px;
  background: #040f09;
  display: block;
}

/* ── Filter + LFO type buttons ── */
.filt-btn, .lfo-btn {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid #0a2a1f;
  background: #061a12;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.filt-btn:hover, .lfo-btn:hover { background: #0a2a1f; color: #6ee7b7; }
.filt-btn.active, .lfo-btn.active { background: #065f46; color: #fff; border-color: #065f46; }

/* ── Octave control ── */
.oct-btn {
  width: 22px; height: 22px;
  border: 1px solid #0a2a1f;
  border-radius: 5px;
  background: #061a12;
  color: #6ee7b7;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.oct-btn:hover { background: #065f46; color: #fff; }
.oct-display {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6ee7b7;
  min-width: 18px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 4px;
  background: #040f09;
  border-radius: 4px;
  border: 1px solid #0a2a1f;
}

/* ── Keyboard ── */
.synth-keyboard-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px 4px;
}
.synth-keyboard {
  display: flex;
  position: relative;
  height: 110px;
  min-width: max-content;
  background: #060f0a;
  border-radius: 0 0 8px 8px;
  padding: 6px 8px 0;
  border: 1px solid #0a2a1f;
  border-top: none;
  user-select: none;
}

/* White keys */
.syn-key-white {
  position: relative;
  width: 38px;
  height: 100px;
  background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 100%);
  border: 1px solid #bbb;
  border-top: 3px solid #ddd;
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
  flex-shrink: 0;
  transition: background 0.05s;
  box-shadow: 1px 3px 6px rgba(0,0,0,0.35), inset 0 -1px 3px rgba(0,0,0,0.08);
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.syn-key-white:hover { background: linear-gradient(180deg, #fff 0%, #ececec 100%); }
.syn-key-white.active {
  background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transform: translateY(1px);
}
.syn-key-label {
  font-size: 8px;
  font-weight: 700;
  color: #9ca3af;
  line-height: 1;
}
.syn-key-white.active .syn-key-label { color: #065f46; }
.syn-key-kb {
  font-size: 7px;
  color: #d1d5db;
  margin-top: 1px;
  font-family: 'JetBrains Mono', monospace;
}

/* Black keys */
.syn-key-black {
  position: absolute;
  width: 24px;
  height: 62px;
  background: linear-gradient(180deg, #222 0%, #111 100%);
  border-radius: 0 0 4px 4px;
  cursor: pointer;
  z-index: 2;
  top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
  box-shadow: 1px 3px 6px rgba(0,0,0,0.6), inset 0 -1px 2px rgba(255,255,255,0.04);
  transition: background 0.05s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.syn-key-black:hover { background: linear-gradient(180deg, #333 0%, #1a1a1a 100%); }
.syn-key-black.active {
  background: linear-gradient(180deg, #047857 0%, #065f46 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  transform: translateY(1px);
}
.syn-key-black .syn-key-label { color: rgba(255,255,255,0.3); font-size: 7px; }
.syn-key-black .syn-key-kb    { color: rgba(255,255,255,0.18); font-size: 6px; }
.syn-key-black.active .syn-key-label { color: rgba(220,200,255,0.9); }

/* ── Status row ── */
.synth-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.synth-status-notes {
  font-size: 0.72rem;
  font-weight: 700;
  color: #065f46;
  font-family: 'JetBrains Mono', monospace;
  min-width: 80px;
}
.synth-status-hint {
  font-size: 0.62rem;
  color: #d1d5db;
  font-style: italic;
  margin-left: auto;
}

/* ── Fullscreen ── */
.tool-card.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  border-radius: 0 !important;
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100dvh !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 1.5rem !important;
  box-sizing: border-box !important;
}

tbody tr:nth-child(even) { background: #f9fafb; }

@media (max-width: 480px) {
  .syn-key-white { width: 30px; height: 88px; }
  .syn-key-black { width: 19px; height: 52px; }
  .synth-keyboard { height: 95px; }
}
