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

/* ── Quick builder ── */
.cf-builder-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f3f4f6;
}
.cf-builder-group { display: flex; flex-direction: column; gap: 6px; }
.cf-builder-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}
.cf-root-btns, .cf-type-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cf-root-btn, .cf-type-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.cf-root-btn:hover, .cf-type-btn:hover {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}
.cf-root-btn.active, .cf-type-btn.active {
  background: #065f46;
  border-color: #065f46;
  color: #fff;
}

/* ── Result panel ── */
.cf-result {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}
.cf-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cf-result-name {
  font-size: 2rem;
  font-weight: 700;
  color: #065f46;
  line-height: 1;
}
.cf-result-also {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 4px;
}
.cf-play-btn {
  padding: 8px 16px;
  background: #065f46;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, transform 0.06s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.cf-play-btn:hover  { background: #047857; }
.cf-play-btn:active { transform: scale(0.95); }
.cf-play-btn.playing { background: #059669; }

/* ── Note pills ── */
.cf-notes-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cf-note-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #065f46;
  cursor: pointer;
  transition: background 0.1s, transform 0.06s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cf-note-pill:hover  { background: #d1fae5; }
.cf-note-pill.active { background: #065f46; color: #fff; border-color: #065f46; }
.cf-note-pill.root   { background: #065f46; color: #fff; border-color: #065f46; }

/* ── Interval row ── */
.cf-interval-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cf-interval-chip {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.cf-interval-chip.root-chip { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }

/* ── Mini keyboard ── */
.cf-keyboard-wrap {
  overflow-x: auto;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.cf-keyboard {
  position: relative;
  display: flex;
  height: 80px;
  min-width: max-content;
  background: #1f2937;
  border-radius: 6px;
  padding: 6px 6px 0;
  user-select: none;
}
.cf-key-white {
  position: relative;
  width: 32px;
  height: 70px;
  background: linear-gradient(180deg, #f5f5f5, #e0e0e0);
  border: 1px solid #bbb;
  border-radius: 0 0 4px 4px;
  flex-shrink: 0;
  z-index: 1;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.2);
  transition: background 0.1s;
}
.cf-key-white.highlight {
  background: linear-gradient(180deg, #6ee7b7, #059669);
  border-color: #065f46;
}
.cf-key-white.highlight.root-key {
  background: linear-gradient(180deg, #065f46, #034d38);
  border-color: #022c22;
}
.cf-key-black {
  position: absolute;
  width: 20px;
  height: 44px;
  background: #1a1a1a;
  border-radius: 0 0 3px 3px;
  z-index: 2;
  top: 6px;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.5);
  transition: background 0.1s;
}
.cf-key-black.highlight {
  background: linear-gradient(180deg, #059669, #047857);
}
.cf-key-black.highlight.root-key {
  background: linear-gradient(180deg, #065f46, #034d38);
}

/* ── Info grid ── */
.cf-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .cf-info-grid { grid-template-columns: repeat(2, 1fr); }
}
.cf-info-cell {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
}
.cf-info-cell-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 3px;
}
.cf-info-cell-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
}

/* ── Empty state ── */
.cf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 0;
  gap: 8px;
  margin-bottom: 18px;
}
.cf-empty-icon { font-size: 2.5rem; }
.cf-empty-text { font-size: 0.82rem; color: #9ca3af; }

/* ── Popular chords ── */
.cf-popular-section { margin-top: 4px; }
.cf-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 8px;
}
.cf-popular-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cf-popular-btn {
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.cf-popular-btn:hover {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

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