/* Riffs + songs: lists and detail pages. */

/* list */
.sg-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
/* row 1: search + Saved; row 2: the filter groups */
.sg-search { flex: 1 1 calc(100% - 110px); }
.sg-filters .seg { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.sg-filters .seg button { flex-shrink: 0; }
.sg-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sg-thead, .sg-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 76px; gap: 16px; align-items: center; padding: 0 16px; }
.sg-thead { height: 38px; border-bottom: 1px solid var(--line); background: var(--surface-2); font: 500 12px var(--font); color: var(--faint); }
.sg-thead > :last-child, .sg-lvl { justify-self: end; }
.sg-count { margin-left: 4px; font-family: var(--mono); color: var(--muted); }
.sg-item { position: relative; min-height: 56px; padding-top: 8px; padding-bottom: 8px; border-top: 1px solid var(--line); }
.sg-item:first-child { border-top: 0; }
.sg-item:hover { background: var(--surface-2); }
/* The title link covers the whole row; explainers sit above it so they open instead of navigating. */
.sg-link { color: inherit; }
.sg-link:hover { text-decoration: none; }
.sg-link::after { content: ''; position: absolute; inset: 0; }
.sg-item .xp, .sg-diffbtn { position: relative; z-index: 1; }
.sg-diffbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; margin: -6px -6px -6px 0; padding: 0; border: 0; background: none; border-radius: var(--radius-sm); cursor: help; }
.sg-diffbtn:hover { background: var(--surface-3); }
.sg-item-main { min-width: 0; display: flex; flex-direction: column; }
.sg-item-main b { font: 500 14.5px/1.35 var(--font); }
.sg-item-main span, .sg-meta { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-meta { color: var(--muted); }
.sg-meta .xp { text-decoration: none; }
.sg-meta .xp:hover { color: var(--text); }
.sg-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; background: var(--muted); }
.sg-dot-clean { background: #4db8e8; }
.sg-dot-acoustic { background: var(--good); }
.sg-dot-drive { background: var(--accent); }
.sg-dot-distortion { background: var(--hot); }
.sg-lvl { display: flex; align-items: center; gap: 8px; }
.sg-star { color: var(--hot); font-size: 13px; }
.sg-table .empty { padding: 40px 16px; }
@media (max-width: 600px) {
  .sg-thead { display: none; }
  .sg-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main lvl" "meta lvl"; gap: 2px 12px; padding: 10px 14px; }
  .sg-item-main { grid-area: main; }
  .sg-meta { grid-area: meta; }
  .sg-lvl { grid-area: lvl; }
}

/* detail */
.sg-title-row { display: flex; align-items: flex-start; gap: 4px; }
.sg-fav { font-size: 22px; flex-shrink: 0; }
.sg-fav[aria-pressed="true"] { color: var(--hot); }
.sg-block { margin-top: 32px; }
.sg-block > .label, .sg-techs .label { display: block; margin-bottom: 10px; }
.sg-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sg-notes { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sg-techs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.sg-techs .label { width: 100%; margin: 0; }
.sg-tips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.sg-below { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 32px; }
.sg-source { font-size: 12.5px; margin: 18px 0 0; }
.sg-source a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); }

/* song: chord shapes, with the diagram's own name replaced by a tappable one in the same spot */
.sg-chords { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 -6px; }
.sg-chord-cell { position: relative; }
.sg-chord .cd-name { visibility: hidden; }
.sg-chord-cell > .xp { position: absolute; z-index: 1; top: 4px; left: 50%; transform: translateX(-50%); font: 600 14px/1.3 var(--font-display); white-space: nowrap; }
.sg-chord { display: block; padding: 6px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; color: inherit; }
.sg-chord:hover { background: var(--surface); }
.sg-chord:active { background: var(--accent-soft); }
.sg-chord .chord-svg { width: 92px; }

/* song: chord chart */
.sg-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.sg-bar { height: 48px; display: flex; align-items: center; padding: 0 12px; background: var(--surface); border-radius: var(--radius-sm); font: 600 16px var(--font-display); }
@media (min-width: 900px) { .sg-bars { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

@media (max-width: 720px) { .sg-below { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 520px) {
  .sg-diff button { padding: 0 8px; }
  .sg-bar { height: 42px; padding: 0 8px; font-size: 15px; }
  .sg-chord .chord-svg { width: 76px; }
  .sg-chord { padding: 4px; }
  .sg-chord-cell > .xp { top: 2px; font-size: 12px; }
}
.sg-n { margin-left: 6px; font: 500 12px var(--mono); color: var(--faint); }

/* Long lists: paged, levels numbered, bars that hold two chords. */
.sg-more { display: flex; justify-content: center; margin-top: 14px; }
.sg-more:empty { display: none; }
.sg-lvn { margin-right: 5px; font: 600 12px var(--mono); color: var(--faint); }
.sg-diff button[aria-pressed="true"] .sg-lvn { color: inherit; }
.sg-half { align-self: stretch; width: 1px; margin: 10px 10px; background: var(--line-strong); }
.sg-bar:has(.sg-half) { padding: 0 8px; font-size: 14px; overflow: hidden; }
@media (max-width: 520px) { .sg-half { margin: 10px 5px; } .sg-bar:has(.sg-half) { padding: 0 5px; font-size: 12.5px; } }
.sg-span { margin-bottom: 12px; }
.sg-practise { margin: 0; color: var(--muted); }
.sg-practise .label { display: block; margin-bottom: 4px; }
