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

/* ── Toggle buttons (keyboard shortcuts) ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}
.toggle-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;
}
.toggle-btn.active {
  background: #fff;
  color: #1e3a5f;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* ── Accordion body wrapper — polished dark finish matching piano ── */
.accordion-body {
  position: relative;
  background: linear-gradient(160deg, #181818 0%, #080808 100%);
  border-radius: 1rem;
  padding: 14px 16px 18px;
  box-shadow:
    inset 0 2px 12px rgba(255,255,255,0.06),
    inset 0 -4px 20px rgba(0,0,0,0.6),
    0 8px 32px rgba(0,0,0,0.28);
}
.accordion-body::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.05) 0%, transparent 55%);
  pointer-events: none;
  border-radius: 1rem;
}

/* ── 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 ── */
.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, #ffffff 0%, #f0f0f0 100%);
  border-left: 1px solid #bbb;
  border-bottom: 2px solid #aaa;
  border-right: none;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: inset -1px 0 0 rgba(0,0,0,0.05), 0 5px 10px rgba(0,0,0,0.40);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.05s, transform 0.05s;
  box-sizing: border-box;
  z-index: 1;
}
.key-white:last-child { border-right: 1px solid #bbb; }
.key-white:active,
.key-white.struck {
  background: linear-gradient(180deg, #e8e8e8 0%, #d8d8d8 100%);
  transform: scaleY(0.988) translateY(1px);
}
.key-white.dimmed { opacity: 0.30; }

/* ── Black (accidental) keys ── */
.key-black {
  position: absolute;
  top: 0;
  background: linear-gradient(180deg, #222 0%, #000 100%);
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-shadow: 2px 6px 12px rgba(0,0,0,0.80), inset 1px 0 1px rgba(255,255,255,0.10);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.05s, transform 0.05s;
  z-index: 2;
  box-sizing: border-box;
}
.key-black:active,
.key-black.struck {
  background: linear-gradient(180deg, #444 0%, #111 100%);
  transform: scaleY(0.97) translateY(1px);
}
.key-black.dimmed { opacity: 0.30; }

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

.key-white .lbl-note { color: rgba(30,20,10,0.72); }
.key-white .lbl-kb   { color: rgba(60,40,10,0.30); }
.key-black .lbl-note { color: rgba(255,240,220,0.90); }
.key-black .lbl-kb   { color: rgba(255,255,255,0.28); }

/* ── Loading bar ── */
.loading-bar {
  background: #f3f4f6;
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
}
.loading-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  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.32s ease-out forwards;
}
@keyframes keyRip {
  from { opacity: 0.45; transform: scale(1); }
  to   { opacity: 0;    transform: scale(1.55); }
}

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