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);
}

/* ── Mode buttons ── */
.mode-btn {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.mode-btn.active {
  background: #fff;
  color: #92400e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* ── Reverb toggle ── */
.reverb-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}
.reverb-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.reverb-btn.active {
  background: #fff;
  color: #92400e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* ── Scale selects ── */
.scale-select {
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.scale-select:focus { border-color: #d97706; }

/* ── Violin body wrapper ── */
.violin-body {
  position: relative;
  background: linear-gradient(160deg, #2c1a08 0%, #160c02 100%);
  border-radius: 1rem;
  padding: 14px 16px 18px;
  box-shadow:
    inset 0 2px 8px rgba(255,180,80,0.06),
    inset 0 -4px 20px rgba(0,0,0,0.4),
    0 8px 32px rgba(0,0,0,0.2);
}
.violin-body::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(220,140,40,0.06) 0%, transparent 60%);
  pointer-events: none;
  border-radius: 1rem;
}

/* ── Open string chips ── */
.open-strings-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.open-string-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,200,100,0.25);
  border-radius: 5px;
  padding: 3px 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
  touch-action: manipulation;
}
.open-string-chip:active,
.open-string-chip.struck { background: rgba(255,180,60,0.28); }
.open-string-chip .os-label { font-size: 8px; color: rgba(255,200,100,0.7); font-weight: 700; }
.open-string-chip .os-note  { font-size: 11px; color: rgba(255,255,255,0.9); font-weight: 700; }
.open-string-chip .os-kb    { font-size: 9px; color: rgba(255,180,60,0.5); font-weight: 600; margin-top: 1px; }

/* ── Piano keyboard scroll wrapper ── */
.piano-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  padding-bottom: 4px;
  position: relative;
  z-index: 1;
}
.piano-scroll::-webkit-scrollbar { height: 4px; }
.piano-scroll::-webkit-scrollbar-track { background: transparent; }
.piano-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── Piano keyboard container ──
   White keys: laid out left-to-right as normal flow children
   Black keys: position:absolute, placed by JS using left offset
   Container height = white key height (JS sets via --nat-h CSS var)
── */
.piano-keys {
  position: relative;
  display: flex;
  align-items: stretch;
  width: max-content;
}

/* ── White (natural) keys ── */
.key-white {
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ede5d8 0%, #c8b898 100%);
  border-left: 1px solid #9a8060;
  border-bottom: 1px solid #9a8060;
  border-right: none;
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-shadow: inset -1px 0 0 rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.06s, transform 0.06s;
  box-sizing: border-box;
  z-index: 1;
}
.key-white:last-child { border-right: 1px solid #9a8060; }
.key-white:active,
.key-white.struck {
  background: linear-gradient(180deg, #f5c870 0%, #d09828 100%);
  transform: scaleY(0.985) translateY(1px);
}
.key-white.dimmed { opacity: 0.28; }

/* open string marker dot */
.key-white.open-str::before {
  content: '●';
  position: absolute;
  top: 7px; left: 50%; transform: translateX(-50%);
  font-size: 7px; color: #d97706;
  pointer-events: none;
}

/* ── Black (accidental) keys — absolutely positioned ── */
.key-black {
  position: absolute;
  top: 0;
  background: linear-gradient(180deg, #3d2810 0%, #180d04 100%);
  border: 1px solid #0a0500;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 2px 5px 8px rgba(0,0,0,0.7), inset 1px 0 1px rgba(255,255,255,0.07);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.06s, transform 0.06s;
  z-index: 2;
  box-sizing: border-box;
}
.key-black:active,
.key-black.struck {
  background: linear-gradient(180deg, #b07820 0%, #6a4808 100%);
  transform: scaleY(0.97) translateY(1px);
}
.key-black.dimmed { opacity: 0.28; }
.key-black.open-str::before {
  content: '●';
  position: absolute;
  top: 4px; left: 50%; transform: translateX(-50%);
  font-size: 6px; color: #f59e0b;
  pointer-events: none;
}

/* ── Key labels (bottom of each key) ── */
.key-lbl {
  position: absolute;
  bottom: 5px;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  gap: 1px;
}
.lbl-note { font-size: 8px;  font-weight: 700; line-height: 1.1; }
.lbl-sol  { font-size: 7px;  font-weight: 600; line-height: 1.1; }
.lbl-kb   { font-size: 6px;  font-family: monospace; line-height: 1.1; }

.key-white .lbl-note { color: rgba(50,25,5,0.80); }
.key-white .lbl-sol  { color: rgba(100,55,10,0.65); }
.key-white .lbl-kb   { color: rgba(80,40,5,0.30); }
.key-black .lbl-note { color: rgba(255,215,150,0.88); }
.key-black .lbl-sol  { color: rgba(210,165,80,0.72); }
.key-black .lbl-kb   { color: rgba(255,255,255,0.22); }

/* ── Loading bar ── */
.loading-bar {
  background: #f3f4f6;
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
}
.loading-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  border-radius: 6px;
  width: 0%;
  transition: width 0.3s ease;
}
.loading-bar.done { display: none; }

/* ── Ripple ── */
.key-ripple {
  position: fixed;
  border-radius: 4px;
  pointer-events: none;
  z-index: 50;
  animation: keyRip 0.35s ease-out forwards;
}
@keyframes keyRip {
  from { opacity: 0.5; transform: scale(1); }
  to   { opacity: 0;   transform: scale(1.6); }
}

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