/* ── Scale Finder ── */
.tool-page:has(.sf-container) { max-width: 100%; }
.sf-container { display: flex; flex-direction: column; align-items: center; max-width: 960px; width: 100%; margin: 0 auto; gap: 14px; }
.sf-instruments { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.sf-instrument-btn { background: #1a1d2e; color: #888; border: 1.5px solid #2a2d3a; border-radius: 10px; padding: 7px 18px; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; }
.sf-instrument-btn:hover { color: #ccc; border-color: #555; }
.sf-instrument-btn.active { background: #1e2a40; color: #7cb8ff; border-color: #3a6ea5; }
.sf-board-wrap { width: 100%; overflow-x: auto; border-radius: 10px; background: #13151e; border: 1.5px solid #2a2d3a; padding: 12px 10px; display: grid; place-items: center; min-height: 260px; }
#sf-canvas { display: block; cursor: pointer; max-width: 100%; }
.sf-mute-hint { font-size: 0.72rem; color: #555; text-align: center; margin-top: -6px; }
.sf-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sf-btn { background: #1a1d2e; color: #c0c0c0; border: 1.5px solid #2a2d3a; border-radius: 10px; padding: 8px 18px; font-size: 0.8rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; }
.sf-btn:hover { background: #252838; color: #fff; border-color: #555; }
.sf-results { width: 100%; }
.sf-selected-notes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; min-height: 30px; align-items: center; }
.sf-note-badge { display: inline-flex; align-items: center; gap: 4px; background: #1e2a40; color: #7cb8ff; border: 1px solid #3a6ea5; border-radius: 10px; padding: 3px 10px 3px 12px; font-size: 0.8rem; font-weight: 600; }
.sf-note-badge .remove { cursor: pointer; opacity: 0.5; font-size: 0.75rem; margin-left: 2px; padding: 2px 4px; border-radius: 50%; }
.sf-note-badge .remove:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.sf-no-match { text-align: center; color: #555; font-size: 0.82rem; padding: 20px 0; }

/* Two-column layout */
.sf-results-columns { display: flex; gap: 20px; align-items: flex-start; }
.sf-results-col-scales { flex: 1 1 50%; min-width: 0; }
.sf-results-col-songs { flex: 1 1 50%; min-width: 0; }

/* Section titles */
.sf-section-title {
  font-size: 0.72rem; font-weight: 700; color: #888;
  margin-top: 0; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 2px solid #2a2d3a; padding-bottom: 6px;
}

/* Grids — paired rows share height via subgrid-like approach */
.sf-results-grid, .sf-songs-grid { display: flex; flex-direction: column; gap: 10px; }

/* Hidden + show more */
.sf-hidden { display: none; }
.sf-show-more {
  display: block; width: 100%; margin-top: 10px; padding: 8px 0;
  border: 1.5px solid #2a2d3a; border-radius: 10px; background: #13151f;
  color: #888; font-size: 0.72rem; font-weight: 600; cursor: pointer;
  text-align: center; transition: all 0.15s;
}
.sf-show-more:hover { background: #2a2d3a; border-color: #555; color: #ccc; }

/* Shared card base */
.sf-match-card {
  background: #181b28; border: 1.5px solid #2a2d3a; border-radius: 10px;
  padding: 12px 14px; transition: border-color 0.2s;
  display: flex; flex-direction: column; gap: 6px;
}
.sf-match-card:hover { border-color: #444; }
.sf-match-card.exact { border-color: #408840; background: #141e14; }
.sf-match-card.best { border-color: #d08020; background: #1e1a14; }

/* Card internals */
.sf-match-header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sf-match-key { font-size: 0.82rem; font-weight: 700; color: #e0e0e0; }
.sf-match-pct { margin-left: auto; font-size: 0.68rem; color: #666; font-weight: 600; white-space: nowrap; }
.sf-song-meta { font-size: 0.68rem; color: #888; }
.sf-card-section { font-size: 0.68rem; color: #7a8a9a; font-weight: 600; white-space: nowrap; }
.sf-chord-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sf-card-key { font-size: 0.68rem; color: #7a8a9a; margin-top: 4px; font-weight: 600; }

/* Chord display on song cards */
.sf-card-chords { font-size: 0.7rem; color: #b0c0d0; font-weight: 600; line-height: 1.5; }
.sf-card-roman { font-size: 0.65rem; color: #8a7ab0; font-weight: 600; font-style: italic; }
.sf-match-notes { display: flex; gap: 4px; flex-wrap: wrap; }
.sf-match-note { padding: 2px 7px; border-radius: 10px; font-size: 0.62rem; font-weight: 600; }
.sf-note-match { background: #1c3a1c; border: 1px solid #408840; color: #a0e0a0; }
.sf-note-unselected { background: #1a1d27; border: 1.5px solid #2a2d3a; color: #666; }
.sf-note-extra { background: #3a1c1c; border: 1px solid #884040; color: #e0a0a0; }
.sf-match-detail { font-size: 0.68rem; color: #777; line-height: 1.5; }
.sf-match-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.sf-card-link, .sf-card-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 0.78rem; font-weight: 600; text-decoration: none;
  background: #1a1d2e; border: 1.5px solid #2a2d3a; color: #c0c0c0;
  transition: all 0.15s; cursor: pointer; font-family: inherit;
}
.sf-card-link:hover, .sf-card-btn:hover { background: #252838; border-color: #555; color: #fff; }
.sf-card-btn svg { width: 12px; height: 12px; fill: currentColor; flex-shrink: 0; }

/* API disclaimer + Search Again footer */
.sf-api-footer {
  margin-top: 14px; padding: 10px 12px;
  border: 1.5px solid #2a2d3a; border-radius: 10px; background: #10121a;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.sf-api-disclaimer {
  font-size: 0.65rem; color: #555; line-height: 1.5; text-align: center;
}
.sf-btn-refresh {
  padding: 6px 16px; border-radius: 10px;
  border: 1px solid #3a6ea5; background: #1a1d2e; color: #7cb8ff;
  font-size: 0.72rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.sf-btn-refresh:hover { background: #252838; border-color: #5a9ed5; color: #a0d0ff; }

/* ---- Jazz Standards section header ---- */
.sf-jazz-header {
  font-size: 0.68rem; color: #7cb8ff; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px; padding-top: 4px;
  border-bottom: 2px solid #2a2d3a; padding-bottom: 6px;
}

/* ---- Responsive ---- */
@media (max-width: 800px) {
  .sf-results-columns { flex-direction: column; }
}
@media (max-width: 600px) {
  .sf-instrument-btn { padding: 5px 12px; font-size: 0.75rem; }
  .sf-btn { padding: 6px 12px; font-size: 0.75rem; }
}
