/* Fretnetic — styles for Chords, Arpeggios, Chord Finder and Chord ↔ Scale views (views-a). */

/* ---------- Shared bits ---------- */
.view-chords .voicing-row,
.view-arpeggios .voicing-row { padding: 4px 2px 8px; }
.view-chords .voicing-card,
.view-arpeggios .voicing-card { flex: none; font: inherit; color: inherit; }
.view-chords .field,
.view-arpeggios .field,
.view-chord-finder .field,
.view-chord-scales .field { max-width: 100%; }

/* ---------- Chords ---------- */
.ch-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.ch-quick-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.ch-quick-btn:hover { color: var(--text); border-color: var(--border-strong); }
.ch-quick-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.ch-body > .card + .card { margin-top: 0; }
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ch-name { font-size: 34px; line-height: 1.1; }
.ch-facts { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 14px 0; }
.ch-fact { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ch-formula { display: flex; gap: 6px; flex-wrap: wrap; }
.ch-deg { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 50%; font-weight: 700; font-family: var(--font-display); background: color-mix(in srgb, var(--c) 22%, var(--surface-2)); border: 2px solid var(--c); }
.ch-steps { color: var(--text-2); padding-top: 6px; }
.ch-links { padding-top: 12px; border-top: 1px solid var(--border); }
.ch-board-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 32px; margin-bottom: 8px; font-size: 14px; }
.ch-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ch-hint { font-size: 13px; margin: 0 0 8px; }
.ch-more { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ch-more-title { font-size: 15px; margin-bottom: 6px; }
.ch-group { margin-top: 10px; }
.ch-group-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-family: var(--font); }
.ch-slash { color: var(--text); font-family: var(--font-display); font-weight: 700; }

/* ---------- Arpeggios ---------- */
.arp-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.arp-name { font-size: 28px; }
.arp-name .faint { font-size: 18px; font-weight: 500; }
.arp-sub { gap: 8px 12px; }
.arp-posinfo { font-size: 13px; }
.arp-player-row { display: flex; align-items: flex-end; gap: 14px 20px; flex-wrap: wrap; }
.arp-tempo { min-width: 180px; flex: 1; max-width: 320px; }
.arp-tempo .field-label b { color: var(--text); }
.arp-status { font-size: 13px; min-height: 20px; align-self: center; }
.arp-hint { font-size: 13px; margin-bottom: 8px; }
.arp-tips { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.arp-tips b { color: var(--text); }
.arp-body > .card + .card { margin-top: 0; }

/* ---------- Chord Finder ---------- */
.cf-input { margin-bottom: 16px; }
.cf-hint { font-size: 13px; margin: 0; }
.cf-strings { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.cf-str { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.cf-str small { font-size: 11px; color: var(--text-3); font-weight: 600; }
.cf-str b { font-family: var(--font-display); }
.cf-str:hover { border-color: var(--accent); }
.cf-str.muted-str b { color: var(--text-3); }
.cf-examples { gap: 6px; }
.cf-notes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cf-note { padding: 10px 4px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 13px; }
.cf-note:hover { border-color: var(--border-strong); }
.cf-note.on { background: var(--select); color: var(--select-ink); border-color: var(--select); }
.cf-results { display: flex; flex-direction: column; gap: 16px; }
.cf-results > .card + .card { margin-top: 0; }
.cf-best-grid { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.cf-best-grid > .stack { flex: 1; min-width: 0; align-items: flex-start; }
.cf-best-name { font-size: 38px; line-height: 1.05; }
.cf-diagram { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cf-diagram .chord-diagram { width: 180px; }
.cf-diagram .vc-meta { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.cf-formula { display: flex; gap: 5px; flex-wrap: wrap; }
.cf-deg { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 7px; border-radius: 999px; font-weight: 700; font-size: 13px; background: color-mix(in srgb, var(--c) 24%, var(--surface-2)); border: 1.5px solid var(--c); }
.cf-deg.missing { background: transparent; border-style: dashed; color: var(--text-3); }
.cf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cf-match { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: border-color .15s, transform .15s; }
.cf-match:hover { border-color: var(--accent); transform: translateY(-1px); }
.cf-match-head { display: flex; flex-direction: column; }
.cf-match-head b { font-family: var(--font-display); font-size: 18px; }
.cf-match-head .faint { font-size: 12px; }

/* ---------- Chord ↔ Scale ---------- */
.cs-body > .card + .card { margin-top: 0; }
.cs-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cs-detail-head > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cs-title { font-size: 24px; }
.cs-title .faint { font-weight: 500; font-size: 18px; }
.cs-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cs-sec-head .card-title { display: flex; align-items: center; gap: 8px; }
.cs-hint { font-size: 13px; }
.cs-summary-line { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }
.cs-summary-line b { color: var(--text-2); }
.cs-tones { display: flex; flex-wrap: wrap; gap: 5px; }
.cs-tone { display: inline-flex; flex-direction: column; align-items: center; min-width: 40px; padding: 4px 6px 3px; border-radius: 9px; border: 1.5px solid var(--border-strong); background: var(--surface-2); }
.cs-tone b { font-size: 14px; font-family: var(--font-display); line-height: 1.2; }
.cs-tone small { font-size: 10px; font-weight: 700; color: color-mix(in srgb, var(--text) 82%, transparent); }
.cs-tone.chord { background: color-mix(in srgb, var(--c) 26%, var(--surface-2)); border-color: var(--c); }
.cs-tone.tension { border-style: dashed; }
.cs-tone.avoid { border-color: var(--bad); border-style: dashed; }
.cs-tone.avoid small { color: var(--bad-text); }
.cs-scale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cs-scale-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
.cs-scale-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.cs-scale-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cs-scale-card .cs-tones { gap: 4px; }
.cs-scale-card .cs-tone { min-width: 30px; padding: 3px 4px 2px; }
.cs-scale-card .cs-tone b { font-size: 13px; }
.cs-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; }
.cs-card-head b { font-family: var(--font-display); font-size: 15px; }
.cs-chord-block { display: flex; flex-direction: column; gap: 6px; }
.cs-block-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-family: var(--font); }
.cs-chord-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cs-chord-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; min-width: 0; transition: border-color .15s, transform .15s; }
.cs-chord-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.cs-chord-card.active { border-color: var(--accent); background: var(--accent-soft); }
.cs-chord-card small { font-size: 10.5px; text-align: center; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cs-roman { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--accent); }
.cs-chord-name { font-size: 14px; overflow-wrap: anywhere; text-align: center; }
.cs-pick-info { font-size: 14px; margin: 0; gap: 8px; }
/* Legend swatches + avoid-note marker on the fretboard */
.cs-key-solid { background: linear-gradient(135deg, hsl(350 85% 56%), hsl(205 68% 52%)); }
.legend i.cs-key-ghost { background: var(--fb-ghost); border: 1.5px solid var(--text-3); }
.legend i.cs-key-avoid { background: transparent; border: 1.5px dashed var(--bad); }
.fb-marker.cs-avoid circle, .fb-marker.cs-avoid rect { stroke: var(--bad); stroke-dasharray: 3 2.5; stroke-width: 2; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cs-chord-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .ch-name { font-size: 28px; }
  .cf-best-name { font-size: 30px; }
  .cf-notes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cf-strings { gap: 4px; }
  .cf-str { padding: 6px 2px; }
  .cf-str small { font-size: 10px; white-space: nowrap; }
  .cs-chord-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-scale-grid, .cf-list { grid-template-columns: 1fr; }
  .cf-diagram { width: 100%; }
  .arp-tempo { max-width: none; }
}
