/* ============================================================
   Repertoire — tool-specific styles.
   Loaded after shared/tokens.css and shared/shell.css.
   ============================================================ */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- home ---------- */
.home-intro { margin-bottom: 34px; }
.home-intro p { color: var(--ink-2); font-size: 1.02rem; }

.fam { margin-bottom: 26px; }
.fam-name {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2);
  margin: 0 0 10px;
}
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.inst-tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--ink);
  transition: border-color 140ms ease-out, transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.inst-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.inst-tile b { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.inst-tile span { color: var(--ink-2); font-size: 0.85rem; }
.inst-tile.empty { opacity: 0.5; cursor: default; background: none; }
.inst-tile.empty:hover { border-color: var(--line); transform: none; }
.home-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- browse layout ---------- */
.browse-top { margin-bottom: 20px; }
.browse-top h1 { margin-bottom: 4px; }
.crumb { color: var(--ink-2); margin: 0 0 10px; }
.browse-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.browse-tools input[type="search"] {
  flex: 1 1 220px; min-width: 0; font: inherit; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}

.browse-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .browse-grid { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- filter rail ---------- */
/* The rail is a <details> so it can collapse on a phone. On desktop the
   summary is hidden and it's always open — a filter panel you have to unfold
   on a 1280px screen would be pointless friction. */
.rail-wrap { position: sticky; top: 74px; }
.rail-toggle { display: none; }
.rail {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 18px;
}

@media (max-width: 900px) {
  .rail-wrap { position: static; }
  .rail-toggle {
    display: flex; align-items: center; gap: 7px; cursor: pointer;
    list-style: none; user-select: none;
    border: 1px solid var(--line); background: var(--surface);
    border-radius: var(--radius); padding: 10px 16px;
    font-weight: 600; color: var(--ink);
  }
  .rail-toggle::-webkit-details-marker { display: none; }
  .rail-toggle::before { content: "☰"; color: var(--ink-2); }
  .rail-toggle i {
    font-style: normal; font-size: 0.78rem; font-variant-numeric: tabular-nums;
    background: var(--accent); color: var(--accent-ink);
    border-radius: 999px; padding: 1px 8px;
  }
  .rail-wrap[open] .rail-toggle { margin-bottom: 10px; }
  .rail-wrap:not([open]) .rail { display: none; }
}

.rail-row { margin-bottom: 16px; }
.rail-row:last-child { margin-bottom: 0; }
/* :not(.check) — the checkbox rows are labels too, and the uppercase heading
   treatment turns their sentence-case wording into shouting. */
.rail-row > label:not(.check) {
  display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 7px;
}
.rail select {
  width: 100%; font: inherit; font-size: 0.94rem; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink);
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  border-radius: 999px; padding: 4px 11px; font-size: 0.87rem;
  display: inline-flex; align-items: center; gap: 5px;
  transition: border-color 130ms ease-out, color 130ms ease-out;
}
.pill i { font-style: normal; font-size: 0.76rem; color: var(--ink-2); opacity: 0.75; font-variant-numeric: tabular-nums; }
.pill:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.on i { color: var(--accent-ink); opacity: 0.8; }
.pill.sub { font-size: 0.83rem; }
.pill.empty, .pill:disabled { opacity: 0.4; cursor: default; }

.checks { display: grid; gap: 9px; }
.check { display: flex; align-items: start; gap: 8px; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.check input { margin-top: 3px; flex: none; accent-color: var(--accent); }

/* ---------- results ---------- */
.results { display: grid; gap: 14px; }
.nudge { color: var(--ink-2); font-size: 0.92rem; margin-bottom: 6px; }

.piece {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.piece-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.piece-title { font-size: 1.18rem; margin: 0 0 2px; }
.piece-artist { color: var(--ink-2); margin: 0; font-size: 0.94rem; }
.piece-artist .album { font-style: italic; }

.star {
  flex: none; border: 1px solid var(--line); background: var(--bg);
  border-radius: 999px; width: 38px; height: 38px; font-size: 1.15rem;
  color: var(--ink-2); line-height: 1;
  transition: border-color 130ms ease-out, color 130ms ease-out;
}
.star:hover { border-color: var(--accent); color: var(--accent); }
.star.on { color: var(--accent); border-color: var(--accent); background: var(--surface-2); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0 12px; }
.chip {
  font-size: 0.78rem; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent;
  white-space: nowrap;
}
.chip.genre { background: none; border-color: var(--line); }
.chip.role { background: none; border-color: var(--line); font-weight: 600; color: var(--ink); }
.chip.tag { background: none; border-color: var(--accent); color: var(--accent); }
.chip.warnchip { background: var(--warn-tint); color: var(--warn); font-weight: 600; }
.chip.unreviewed { background: none; border-color: var(--warn); color: var(--warn); font-weight: 600; }
.chip.diff { font-weight: 600; color: var(--ink); }
.chip.diff.d1, .chip.diff.d2 { background: var(--ok-tint); color: var(--ok); }
.chip.diff.d3 { background: var(--surface-2); }
.chip.diff.d4, .chip.diff.d5 { background: var(--bad-tint); color: var(--bad); }
.chip.band { background: none; border-color: var(--line); }

/* The whole card is now chips + one paragraph + the listen link, so the
   paragraph carries the weight and gets a little more room to breathe. */
.verdict {
  margin: 0 0 12px; font-size: 0.97rem; line-height: 1.5;
  color: var(--ink-2); max-width: none;
}
.verdict b { font-weight: 700; }
.verdict.v-strong b { color: var(--ok); }
.verdict.v-solid b { color: var(--ink); }
.verdict.v-conditional b { color: var(--warn); }

.teacher-note {
  color: var(--ink-2); font-size: 0.9rem; margin: 0 0 16px;
}

.listen { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 14px; align-items: start; }
.yt { flex: 1 1 300px; max-width: 420px; margin: 0; }

/* The poster is a real <button>, so it's keyboard-reachable and announces
   itself, which a bare clickable div would not. */
.yt-lite {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  padding: 0; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: var(--surface-2); cursor: pointer;
}
/* hqdefault is 4:3 with letterboxing baked in; cover crops it back to 16:9. */
.yt-lite img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-btn {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 39px;
  border-radius: 10px; background: rgb(0 0 0 / 0.62);
  transition: background 140ms ease-out, transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.yt-btn::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 0; height: 0; border-style: solid;
  border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff;
}
.yt-lite:hover .yt-btn { background: #e62117; transform: scale(1.06); }
.yt-lite:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.yt-frame { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
.yt-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.yt figcaption { margin-top: 6px; font-size: 0.85rem; }
.yt figcaption a { color: var(--ink-2); }
.yt figcaption a:hover { color: var(--accent); }

/* ---------- empty state ---------- */
.empty-state {
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 30px 28px; text-align: center;
}
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--ink-2); margin-left: auto; margin-right: auto; }
.empty-state .btn { margin: 4px 4px 0; }

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .browse-tools { gap: 8px; }
  .browse-tools input[type="search"] { flex: 1 1 100%; }
  .piece { padding: 15px 16px; }
  .inst-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .yt { flex-basis: 100%; }
}
