/* Audio Library tab (2026-10-28). Every class starts with al- so nothing else in the app can touch it, and every colour is one of
   the app's own tokens, so it follows the look the app wears (the warm ink one live, the cinema one if that ships). The layout is
   the "Both together" one Joe chose from mocks/audio-library-board: the track list, a filter panel beside it, the kinds as words
   on top, a click on a row opens its notes underneath. */
.al {
  --al-disp: var(--display, "Avenir Next Condensed", "Arial Narrow", -apple-system, sans-serif);
  --al-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --al-dim: var(--dim, #918880);          /* a choice that would give nothing: still readable (4.5 to 1), just quieter */
  --al-need: var(--signal, var(--red));   /* the one colour that means "this needs you" */
}
.al-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.al button { font: inherit; }
.al-link { background: none; border: 0; padding: 0; color: var(--red); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; cursor: pointer; }

/* kind words on top, and the line that says what is showing */
.al-rail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; margin: 0 0 8px; }
.al-lab { font: 700 11px var(--al-disp); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); min-width: 64px; }
.al-w { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0 5px; color: var(--muted); font-size: 14px; cursor: pointer; }
.al-w i { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; margin-left: 3px; }
.al-w:hover { color: var(--ink); }
.al-w.on { color: var(--ink); border-bottom-color: var(--red); font-weight: 600; }
.al-w.zero:not(.on) { color: var(--al-dim); }
.al-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: 13px; margin: 6px 0 12px; min-height: 22px; }
.al-sum b { color: var(--ink); font-weight: 600; }

/* the filter panel beside the list */
.al-both { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.al-panel { display: grid; gap: 16px; position: sticky; top: 12px; padding-top: 8px; }
.al-panel-body { display: grid; gap: 16px; }
.al-panel fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; min-width: 0; }
.al-panel legend { font: 700 11px var(--al-disp); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 6px; }
.al-panel label { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0; padding: 5px 0; color: var(--muted); cursor: pointer; }
.al-panel label:hover, .al-panel label:has(input:checked) { color: var(--ink); }
.al-panel label i { margin-left: auto; font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; }
.al-panel label.zero { color: var(--al-dim); }
.al-panel input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-content: center; width: 16px; height: 16px; margin: 0; padding: 0; border: 1.5px solid var(--muted); border-radius: 3px; background: transparent; cursor: pointer; }
.al-panel input[type="checkbox"]:checked { background: var(--red); border-color: var(--red); }
.al-panel input[type="checkbox"]:checked::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg); transform: rotate(-45deg) translate(1px, -1px); }
.al-panel input[type="checkbox"]:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.al-fold { display: none; justify-self: center; }
.al-panel .al-link[data-al-clear] { justify-self: start; }

/* the list */
.al-lh, .al-row { display: grid; grid-template-columns: minmax(0, 1.7fr) 150px minmax(0, 1.2fr) 150px; gap: 16px; align-items: center; }
.al-lh { font: 700 11px var(--al-disp); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.al-row { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.al-row:hover, .al-row:focus-within, .al-row.open { background: var(--panel); }
.al-ti { min-width: 0; }
.al-open { display: flex; align-items: flex-start; gap: 8px; width: 100%; background: none; border: 0; padding: 0; text-align: left; color: var(--ink); cursor: pointer; }
.al-tx { display: block; min-width: 0; flex: 1; }
.al-tx strong { font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.al-tx small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.al-chev { flex: none; width: 8px; margin-top: 6px; color: var(--muted); transition: transform 0.15s; }
.al-chev::before { content: ""; display: block; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.al-open:hover .al-chev { color: var(--ink); }
.al-open[aria-expanded="true"] .al-chev { transform: rotate(90deg); color: var(--ink); }
.al-tag { display: inline-block; font: 700 10.5px var(--al-disp); letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); vertical-align: 2px; margin-left: 8px; white-space: nowrap; }
.al-tag.need { color: var(--al-need); border-color: var(--red-dim); background: var(--red-dim); }
.al-tm { font: 13px/1.35 var(--al-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.al-nt { color: var(--muted); font-size: 13px; line-height: 1.35; }
.al-none { color: var(--al-dim); font-size: 13px; }
.al-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.al-gw { color: var(--muted); font-size: 13px; }
.al-gw.on { color: var(--ink); }
.al-more { color: var(--muted); font-size: 12px; }
.al-ac { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.al-listen { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 7px 12px; min-height: 36px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.al-listen:hover { color: var(--ink); border-color: var(--muted); }
.al-edit { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 7px 6px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: 0; }
.al-row:hover .al-edit, .al-row:focus-within .al-edit, .al-edit:focus-visible { opacity: 1; }
.al-edit:hover { color: var(--ink); }
@media (hover: none) { .al-edit { opacity: 1; } }

/* the notes that open under a row */
.al-xp { margin: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 2px 12px 16px 30px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.al-xp dt { font: 700 10.5px var(--al-disp); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.al-xp dd { margin: 0; overflow-wrap: anywhere; }
.al-empty { padding: 36px 8px; color: var(--muted); }
.al-empty b { color: var(--ink); display: block; margin-bottom: 4px; font-size: 16px; }

/* add and edit a track */
.al-modal { max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; }

@media (max-width: 860px) {
  .al-both { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .al-panel { position: static; }
  .al-fold { display: block; }
  .al-panel-body[data-open="false"] { display: none; }
  .al-lh { display: none; }
  .al-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ti ac" "us us" "gd gd"; gap: 6px 12px; }
  .al-ti { grid-area: ti; } .al-us { grid-area: us; } .al-gd { grid-area: gd; } .al-ac { grid-area: ac; }
  .al-us:has(.al-none) { display: none; }
  .al-edit { opacity: 1; }
  .al-rail { gap: 2px 18px; }
  .al-xp { grid-template-columns: minmax(0, 1fr); padding-left: 12px; }
}
