/* The piece-list pages (/pieces/): built by scripts/piece-pages.mjs, run by pieces.js. Loaded on those pages only.
   The list's own styles (lines, sizes, the picker) are in piecelist.css, shared with the home page's piece box. */
[hidden] { display: none !important; } /* the adder, "Clear all filters" and the rest: hidden wins over their display */
.pk { margin: 0 0 6px; color: var(--accent); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.pk a { color: inherit; text-decoration: underline; text-decoration-color: rgba(217, 164, 65, 0.4); text-underline-offset: 3px; }
.crumbs { margin: 0 0 14px; }
.x-title { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(2.1rem, 5.5vw, 3.4rem); line-height: 1.05; }
.x-ver { margin: 6px 0 0; color: var(--muted); }
.small { color: var(--muted); font-size: 0.86rem; margin: 10px 0 0; line-height: 1.5; }
.d-facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.d-facts li { padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.88rem; color: var(--muted); }
.d-facts b { color: var(--ink); font-weight: 600; }
.d-facts li.d-need { border: 0; padding-left: 4px; padding-right: 4px; } /* a link, not a fact: no pill */
/* the piece: heading and photo, then the list with its card beside it */
.d-piece { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "head photo" "list side"; gap: 26px 36px; padding-top: 26px; }
.d-head { grid-area: head; align-self: end; }
.d-photo { grid-area: photo; margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; align-self: end; }
.d-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-list { grid-area: list; }
.d-side { grid-area: side; align-self: start; position: sticky; top: calc(var(--nav-h) + 18px); }
.d-list h2 { margin: 0 0 4px; font-family: var(--f-display); font-size: 1.6rem; }
.d-list > p { margin: 0 0 14px; color: var(--muted); }
.d-card { padding: 20px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); }
.d-count { margin: 0 0 12px; font-size: 1rem; }
.d-card .btn { width: 100%; justify-content: center; }
.d-card .btn + .btn { margin-top: 8px; }
/* every list is a guide, not a guarantee (Alex, 9 Nov 2026): under the facts, before anyone relies on it */
.d-guide { margin: 14px 0 0; max-width: 760px; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }
.d-guide b { color: var(--ink); font-weight: 600; }
/* the points to talk through: up top, under the players, since they change what people pick */
.d-talk { margin: 16px 0 0; padding: 12px 16px; background: var(--accent-tint); border: 1px solid var(--line-2); border-radius: var(--radius); max-width: 760px; }
.d-talk h2 { margin: 0 0 4px; font-family: var(--f-body); font-size: 0.95rem; font-weight: 600; }
.d-talk ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.92rem; line-height: 1.45; }
.d-after { margin: 10px 0 0; font-size: 0.9rem; }
.d-after a { color: var(--accent); }
.btn.is-done, .btn.is-done:disabled { background: transparent; color: var(--ok); border-color: var(--ok); opacity: 1; }
@media (hover: hover) { .btn.is-done:hover { background: transparent; color: var(--ok); text-decoration: line-through; } } /* tap again: off */
.nav__quote.flash { box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.35); transition: box-shadow 0.3s; }
.d-bar { display: none; }
.d-print-only { display: none; }
@media (max-width: 860px) {
  .d-piece { grid-template-columns: 1fr; grid-template-areas: "head" "list" "side"; gap: 22px; padding-top: 18px; }
  .d-photo { display: none; } /* on a phone it came three screens down, under everything */
  .d-side { position: static; }
  .d-card [data-add] { display: none; }
  .d-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: rgba(20, 16, 13, 0.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); }
  .d-bar span { font-size: 0.9rem; color: var(--muted); min-width: 0; }
  .d-bar .btn { flex: none; white-space: nowrap; }
  .d-bar-see { color: var(--accent); font-weight: 600; }
  .d-facts { gap: 2px 0; margin-top: 10px; }
  .d-facts li { border: 0; padding: 0; font-size: 0.9rem; }
  .d-facts li + li::before { content: "·"; margin: 0 7px; color: var(--muted); }
  /* the players on a line of their own, the rest under them with no dot at the start (Alex, 15 Nov 2026) */
  .d-facts .d-players { flex-basis: 100%; }
  .d-facts .d-players + li { padding-left: 0; }
  .d-facts .d-players + li::before { content: none; }
  body.d-page { padding-bottom: 76px; }
}
/* the hub and composer pages */
.d-hubhead { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: end; padding-top: 26px; }
.d-hubhead figure { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; }
.d-hubhead img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-hub { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 30px; align-items: start; padding-top: 22px; }
.d-filters { position: sticky; top: calc(var(--nav-h) + 14px); max-height: calc(100vh - var(--nav-h) - 28px); overflow: auto; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); }
.d-filters > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.d-filters > summary::-webkit-details-marker { display: none; }
.d-filters > summary span { color: var(--accent); }
.d-f { display: grid; gap: 6px; margin-top: 16px; }
.d-f > b { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.d-f { min-width: 0; }
.d-f select, .d-f input[type=search] { max-width: 100%; min-width: 0; font: inherit; font-size: 0.92rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 10px; width: 100%; }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.d-chip { position: relative; }
.d-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.d-chip span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.85rem; }
.d-chip span small { color: var(--muted); margin-left: 3px; }
.d-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.d-chip input:checked + span small { color: var(--accent-ink); }
.d-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.d-chip.is-none span { opacity: 0.4; } /* a type with nothing for the search and filters chosen */
.d-chip.is-none input { cursor: default; }
#dClear { margin-top: 16px; width: 100%; }
.d-kit { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.d-kit summary { cursor: pointer; font-size: 0.92rem; }
.d-kit summary span { color: var(--accent); }
.d-kit summary b { font-weight: 400; }
/* "What can be played with only these" / "Pieces that use all of these" (pieces.js) */
.d-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 8px; }
.d-mode label { display: flex; cursor: pointer; }
.d-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.d-mode span { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 0.85rem; line-height: 1.3; }
.d-mode input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.d-mode input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.d-kit .small { margin: 8px 0 0; font-size: 0.8rem; }
.d-auxown { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 0.88rem; cursor: pointer; }
.d-auxown input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.d-auxown small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.d-kitfam { margin-top: 12px; }
.d-kitfam > b { display: block; margin-bottom: 6px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.d-kitfam > b:has(+ .d-kitset) { display: inline; }
.d-kitset { margin: 0 0 6px 6px; padding: 2px 9px; font: inherit; font-size: 0.78rem; color: var(--accent); background: none; border: 1px dashed var(--line-2); border-radius: 999px; cursor: pointer; }
.d-kitset:hover { border-color: var(--accent); }
.d-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.d-top p { margin: 0; color: var(--muted); }
/* "Within reach" and "Our instruments" (the hub, under the instrument filter) */
.d-near { margin: 28px 0 22px; padding-top: 18px; border-top: 2px solid rgba(217, 164, 65, 0.55); scroll-margin-top: calc(var(--nav-h) + 12px); }
.d-near__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; }
.d-near__bar h2 { margin: 0; font-family: var(--f-display); font-size: 1.6rem; }
.d-near__bar p { margin: 2px 0 0; color: var(--muted); }
.d-near__bar .btn { flex: none; }
#dNearBody { margin-top: 14px; }
.d-near__opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
.d-near__seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.d-az--near { margin-top: 6px; }
.d-L--near { scroll-margin-top: calc(var(--nav-h) + 12px); }
#dNearAZ { scroll-margin-top: calc(var(--nav-h) + 12px); }
.d-near__seg button { font: inherit; font-size: 0.88rem; color: var(--ink); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.d-near__seg button small { color: var(--muted); margin-left: 3px; }
.d-near__seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.d-near__seg button[aria-pressed="true"] small { color: var(--accent-ink); }
.d-near__seg button:disabled { opacity: 0.4; cursor: default; }
/* its letters in the plain body font, smaller, to tell them from the main list's (Alex, 12 Nov 2026) */
.d-near .d-L--near { margin-top: 18px; font-family: var(--f-body); font-weight: 700; font-size: 1.4rem; line-height: 1.2; align-items: center; }
.d-near .d-L--near .d-up { margin-bottom: 0; }
.d-near .d-comp h4 { margin: 0 0 2px; font-family: var(--f-display); font-size: 1.05rem; }
.d-rows--near li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.d-near .d-comp .d-rows--near a:not(.btn) { display: inline; padding: 0; border: 0; color: var(--ink); text-decoration: none; }
.d-rows--near a span { font-size: 0.98rem; }
.d-rows--near a span small { display: inline; margin: 0 0 0 4px; }
.d-rows--near a:hover span { color: var(--accent); }
.d-near__need { display: block; margin: 1px 0 0; color: var(--muted); font-size: 0.85rem; }
.d-near .d-comp .d-rows--near .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; font-size: 0.82rem; white-space: nowrap; }
.d-near .d-comp .d-rows--near .btn--ghost { border: 1px solid var(--line-2); } /* "Ask us": a link, so the list's link rules reach it */
.d-rows--near .btn.is-done { background: transparent; color: var(--accent); border-color: var(--accent); }
.d-near-jump { font-size: 0.88rem; color: var(--accent); }
.d-gear { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.d-gear__ok { font-size: 0.86rem; color: var(--accent); }
.d-gear-use { margin: 0 0 14px; font-size: 0.9rem; color: var(--muted); }
.d-top select { font: inherit; font-size: 0.88rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; }
.d-az { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 6px; }
.d-az a { min-width: 30px; padding: 4px 6px; text-align: center; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.d-az a:hover { background: var(--bg-3); color: var(--accent); }
.d-az a.is-empty { opacity: 0.25; pointer-events: none; }
.d-letter, #dAZ { scroll-margin-top: calc(var(--nav-h) + 12px); }
.d-L { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.d-up { font-family: var(--f-body); font-size: 0.82rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; margin-bottom: 4px; white-space: nowrap; }
.d-up:hover, .d-up:focus-visible { color: var(--accent); border-color: var(--accent); }
.d-L { margin: 26px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--line-2); font-family: var(--f-display); font-size: 2.6rem; line-height: 1; color: var(--accent); }
.d-cols { columns: 2 300px; column-gap: 36px; }
.d-comp { break-inside: avoid; margin: 0 0 18px; }
.d-comp h3 { margin: 0 0 2px; font-family: var(--f-display); font-size: 1.2rem; }
.d-comp h3 a { color: var(--ink); text-decoration: none; }
.d-comp h3 a:hover { color: var(--accent); }
.d-comp .d-rows { border-top: 0; }
.d-comp .d-rows a { padding: 6px 0; border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, 1fr) auto; }
.d-comp .d-rows span { font-size: 0.98rem; }
.d-comp .d-rows span small { display: inline; margin: 0 0 0 4px; }
.d-comp .d-rows a:hover span { color: var(--accent); }
.d-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.d-rows a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 12px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.d-rows a:hover b, .d-rows a:focus-visible b { color: var(--accent); }
.d-rows b { font-family: var(--f-display); font-size: 1.12rem; font-weight: 600; }
.d-rows small { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.d-rows i { font-style: normal; color: var(--accent); font-size: 0.78rem; }
.d-rows em { font-style: normal; color: var(--muted); font-size: 0.88rem; text-align: right; max-width: 11em; }
/* a composer's symphonies that need only timpani: one row on the hub, and their own page (Alex, 13 Nov 2026) */
.d-comp .d-rows .d-set span { font-weight: 600; }
/* Musicals chosen alone (pieces.js): titles big, composers small, in the same order */
.d-hub--titles .d-comp h3 { font-family: inherit; font-size: 0.85rem; font-weight: 400; margin: 6px 0 0; }
.d-hub--titles .d-comp h3 a { color: var(--muted); }
.d-hub--titles .d-comp .d-rows span { font-family: var(--f-display); font-size: 1.2rem; line-height: 1.3; }
.d-hub--titles .d-comp .d-rows span small { font-family: var(--f-body); font-size: 0.85rem; }
.d-comp .d-rows .d-set span small { font-weight: 400; }
.d-same { margin: 16px 0 0; padding: 12px 16px; background: var(--accent-tint); border: 1px solid var(--line-2); border-radius: var(--radius); max-width: 760px; }
.d-same h2 { margin: 0 0 4px; font-family: var(--f-body); font-size: 0.95rem; font-weight: 600; }
.d-same ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: 0.95rem; line-height: 1.45; }
.d-same small { display: inline; margin-left: 6px; color: var(--muted); font-size: 0.85rem; }
.d-same small::before { content: "· "; }
.d-setsec { padding-top: 8px; }
.d-setlist { max-width: 760px; }
.d-setlist .d-rows--near { border-top: 1px solid var(--line); }
.d-setlist .d-rows--near a:not(.btn) { display: inline; padding: 0; border: 0; color: var(--ink); text-decoration: none; }
.d-setlist .d-rows--near .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; min-width: 84px; padding: 0 14px; font-size: 0.85rem; white-space: nowrap; }
.d-setmore { margin: 18px 0 0; max-width: 760px; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 860px) {
  .d-hubhead { grid-template-columns: 1fr; padding-top: 18px; }
  .d-hubhead figure { display: none; }
  .d-hub { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .d-filters { position: static; max-height: none; min-width: 0; }
  .d-hub > .d-f { margin-top: 0; } /* the search, above the folded filters (pieces.js) */
  .d-hub > .d-f input[type=search] { font-size: 1rem; padding: 12px 14px; }
  .d-L { font-size: 2.2rem; margin-top: 20px; }
}
/* printed: just the list as it stands, with how to reach us */
@media print {
  .nav, .footer, .x-cta, .x-more, .x-faq, .crumbs, .skip, .d-photo, .d-side, .d-bar, .d-addbtn, .d-adder, .d-step, .d-opts, .d-out, .d-rm, .d-need { display: none !important; }
  .d-name { text-decoration: none; }
  body { background: #fff; color: #111; padding: 0 !important; }
  .section { padding: 0 !important; max-width: none; }
  .d-piece { display: block; }
  .pk, .pk a { color: #8a5a12; }
  .x-ver, .small, .d-lines small { color: #555; }
  .d-facts li { border-color: #bbb; color: #333; } .d-facts b { color: #111; }
  .d-lines { border-color: #ccc; } .d-lines li { display: block; border-color: #ddd; padding: 7px 0; break-inside: avoid; }
  .d-lines li.off { display: none; }
  .d-lines li.off, .d-lines li label { opacity: 1; }
  .d-qty { display: inline; }
  .d-qty:empty { display: none; }
  .d-tag { border-color: #8a5a12; color: #8a5a12; }
  .d-print-only { display: block; }
  .d-talk { margin: 10px 0 14px; padding: 8px 12px; border: 0; border-left: 3px solid #8a5a12; border-radius: 0; background: #f6f1e8; color: #111; }
  .d-print-foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #ccc; font-size: 0.82rem; color: #444; }
  .d-guide { margin: 8px 0 0; font-size: 0.82rem; color: #444; } .d-guide b { color: #111; }
}
/* "Save list as PDF / Spreadsheet" (Alex, 16 Nov 2026): in the card under "Add to your list"; on a phone also a line under
   the guide, since the card comes after the whole list */
.d-save { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.d-save span { font-size: 0.9rem; color: var(--muted); margin-right: 2px; }
.d-card .d-save .btn { width: auto; flex: 1; margin: 0; }
.d-save-top { display: none; margin: 10px 0 0; font-size: 0.9rem; color: var(--muted); }
.d-save-top .link { font-weight: 600; }
@media (max-width: 860px) { .d-save-top { display: block; } }
@media print { .d-save-top { display: none !important; } }
