/* css/style.css — DTP MIXSHARE app layout. Tokens come from css/tokens.css. */

main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-page-top) 24px 96px;
  display: flex;
  flex-direction: column;
  /* Not one of the audited spaces — this separates #appShell from the footer —
     but it is the same rhythm and has always carried the same 28/20 as
     --sp-stack. Routed through it so the two cannot drift apart. */
  gap: var(--sp-stack);
}

/* Nothing may exceed the viewport width. */
img, canvas, audio, video { max-width: 100%; }

/* --- Masthead --- */

/* ★ THE APP TITLE, AND ONLY IT (v0.2.141). U67 Bold Condensed via
   --font-app-title, overriding the --font-title the h1/h2/h3 rule hands every
   heading. ONE rule for every page: index, blindtest, playlist and releases all
   put their masthead through .masthead h1.

   ⚠️ AND ITS PRE-LOGIN TWIN. index.html carries the same words in the login
   panel's <h2> because the masthead lives inside #appShell and is hidden until
   you are in — it is the same brand mark in the other state, and leaving it in a
   different face would read as a fault rather than as a decision. */
.masthead h1,
.panel.login h2 {
  font-family: var(--font-app-title);
}

.masthead h1 {
  font-size: var(--text-mast);
  line-height: 1.1;
  letter-spacing: var(--tracking);
  overflow-wrap: anywhere;
}

.subtitle {
  margin: var(--sp-subtitle) 0 0;
  color: var(--text-dim);
  font-size: var(--text-ui);
}

/* "Signed in as … Sign out" left, "Storage: X.X GB" right. Wraps to two lines on
   a narrow screen rather than clipping. */
.subtitle-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.subtitle-row .subtitle { min-width: 0; }

/* --- Login gate --- */

/* #appShell wraps everything behind the login gate — upload zone, library, and
   the header controls inside it. It has to reproduce the column gap <main>
   gives its own children. */
#appShell {
  display: flex;
  flex-direction: column;
  gap: var(--sp-stack);
}

/* The display above outranks the UA sheet's [hidden] { display: none }, so
   without this the whole app renders straight through the login gate. */
#appShell[hidden] { display: none; }

/* Pre-login the page is nothing but this panel, so it sits narrow and centred
   rather than filling the 720px column. */
#loginPanel {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

#loginPanel > h2,
#loginStatus { text-align: center; }

/* A normal stacked login form: field, field, button. */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* width, not flex-basis — in a column, `flex: 1 1 220px` would size the height. */
.login-form input,
.login-form button { width: 100%; }

/* --- Google SSO (v0.2.116) --- */

/* The primary way in, so it takes the default accent button and the full width
   the form fields have. No brand mark: this app has no logo assets and an
   inlined Google one would be the only third-party image on the page. */
.google-signin { width: 100%; }

/* The legacy passphrase form, folded away. Still reachable, no longer offered —
   it is the way back in if SSO fails, and Phase 3 deletes the whole block. */
.login-legacy { margin-top: var(--sp-login-block); }

.login-legacy > summary {
  font-family: var(--font-body);
  font-size: var(--text-ui);
  color: var(--text-dim);
  text-align: center;
  cursor: pointer;
  padding: var(--sp-gate-gap) 0;
}

.login-legacy[open] > summary { margin-bottom: var(--sp-gate-gap); }

/* Shown only to a Google identity with no account here. */
.signup-gate {
  margin-top: var(--sp-login-block);
  display: flex;
  flex-direction: column;
  gap: var(--sp-gate-gap);
}

/* ⚠️ WITHOUT THIS THE GATE IS ALWAYS OPEN. `hidden` is only a UA-stylesheet
   `display: none`, and ANY display declaration in this file outranks it — so the
   rule above quietly un-hid the panel, and every visitor would have been shown a
   box asking for the signup password. Caught by scripts/logingate-check.mjs
   measuring the real page; jsdom and a source read both say it is hidden. */
.signup-gate[hidden] { display: none; }

.signup-gate-who { font-size: var(--text-body); color: var(--text); text-align: center; margin: 0; }
.signup-gate-hint { font-size: var(--text-ui); color: var(--text-dim); text-align: center; margin: 0; }

/* --- Panels --- */

.panel > h2 {
  font-size: var(--text-body);
  color: var(--text-dim);
  letter-spacing: var(--tracking);
  margin-bottom: var(--sp-title);
}

.library-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-title);
}

.library-head h2 { margin-right: auto; }

.library-head h2 { margin-bottom: 0; }

/* Create actions get their own row under the Library line. */
/* 12px, matching the search box's own margin-bottom, so create -> search and
   search -> filters are the same gap (v0.2.23). */
.create-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: var(--sp-content); }

/* ...and the real reason that gap looked wrong. #libraryStatus sits BETWEEN the
   create bar and the search box, and .status reserves 1.5em plus a 16px top
   margin whether or not it has anything to say — which it usually does not. So
   the visible gap was 12px of margin plus ~38px of empty live region. Collapsed
   when empty; when a message does arrive it reappears and pushes the list down,
   which is what a status line is for. :empty is exact here — the only writer
   sets textContent, so there are no stray whitespace nodes to defeat it. */
#libraryStatus { margin-top: 0; }
#libraryStatus:empty { display: none; }

/* "Show info" pill at the right end of the Library line. The first three
   declarations reset the base button rule (yellow block, uppercase, tracking);
   the rest is the pill itself. */

/* Quiet text link in the masthead — resets the yellow-block button styling. */
/* `font: inherit` does not carry text-transform or letter-spacing, so without
   these two it inherits UPPERCASE + tracking from the base button rule and reads
   "SIGN OUT" mid-sentence. */
.signout {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: var(--text-dim);
  text-transform: none; letter-spacing: normal;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.signout:hover { color: var(--accent); }

/* --- Drop zone / progress surface --- */

/* Idle and busy share this geometry exactly, so switching between them never
   reflows. min-height matches .wave in css/listen.css (and the height:96 that
   js/listen.js hands wavesurfer) — the two audio surfaces read as one box. */
.dropzone {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  padding: 16px 24px;
  display: flex;
  align-items: center;              /* centres the drop prompt AND the Cancel */
  justify-content: center;
  border: 1px dashed var(--panel-border);
  background: var(--input-bg);
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  outline: none;
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease, background var(--t-fast) ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

.dropzone.dragover {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.dropzone .dz-prompt { margin: 0; }

/* Waiting on ffmpeg.wasm — the box says so itself and refuses files until ready. */
.dropzone.is-loading { cursor: default; pointer-events: none; }

/* processing state */
.dropzone.busy { border-style: solid; cursor: default; pointer-events: none; }
.dropzone.busy .cancel { pointer-events: auto; }   /* Cancel stays clickable */

/* children hidden until busy */
.bp-fill, .dropzone .cancel, .proc-foot { display: none; }
.dropzone.busy .dz-prompt { display: none; }
.dropzone.busy .bp-fill   { display: block; }
.dropzone.busy .cancel    { display: inline-block; }
.dropzone.busy .proc-foot { display: flex; }

/* The box's full-bleed layer, one per state: marching stripes while uploading,
   the waveform while playing. Identical geometry by intent. */
.bp-fill,
.play-wave { position: absolute; inset: 0; z-index: var(--z-base); }
.cancel  { position: relative; z-index: var(--z-raised); }            /* standard button, centred by the flex parent */

.proc-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-raised);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 0 10px 3px;
}

.proc-status { font-size: var(--text-ui); color: var(--text); white-space: nowrap; }

/* --- player state: a library track loaded into the box --- */

.dropzone .play-wave, .dropzone .eject, .dropzone .play-foot,
.dropzone .play-head, .dropzone .wave-play { display: none; }
.dropzone.player .play-wave  { display: block; }
.dropzone.player .play-head  { display: flex; }

/* --- The centre transport (v0.2.140) ----------------------------------------
   The SAME control the Expert card's transport uses — .play-half supplies the
   square outline, the accent colour and the 1.2em glyph — placed in the middle
   of the wave box. Only the POSITION and the size are new; nothing here restates
   how the button looks, so the two cannot drift.

   ⚠️ THE ONE LIVE TARGET IN AN INERT RECTANGLE. Every other overlay on this box
   declines the pointer so that a tap anywhere scrubs; this one must accept it,
   and sits above them all (--z-control) so the LUFS boxes cannot paint over it.
   The cost is deliberate: a tap dead centre now toggles instead of seeking. */
.dropzone.player .wave-play {
  display: inline-flex;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-control);
  width: var(--wave-play-size);
  height: var(--wave-play-size);
  /* The base button rule pads for a WORD; this one holds a glyph and is sized. */
  padding: 0;
  font-size: var(--wave-play-icon);
  pointer-events: auto;
  /* ★ ITS OWN COLOURS, not .play-half's. currentColor is what the transport's
     glyph paths are filled with, so setting `color` is what makes the icon
     black — there is no second rule reaching inside the <svg>. */
  color: var(--centre-play-icon-colour);
  border-color: var(--centre-play-border-colour);
  background: var(--centre-play-fill);
}

/* ⚠️ THE HOVER HAS TO BE RESTATED. .play-half:not(:disabled):hover washes an
   accent tint over the background at the same specificity as the rule above, so
   without this the fill dial would be overruled the moment a pointer touched it
   — and a "transparent" fill would flash yellow. Feedback still happens: the
   base button rule drops opacity on hover, which is the whole of it. */
.dropzone.player .wave-play:not(:disabled):hover {
  background: var(--centre-play-fill);
}
/* Clear of the eject ×, which owns the top-right corner here (the play card has
   no eject, so its own .play-head keeps the shared 10px). */
.dropzone.player .play-head  { padding-right: 34px; }
.dropzone.player .eject      { display: flex; }
.dropzone.player .play-foot  { display: flex; }
.dropzone.player .dz-prompt  { display: none; }
/* Clicking the box seeks here rather than opening the file picker. */
.dropzone.player { border-style: solid; cursor: pointer; }

/* .play-foot / .play-name / .play-time now live in css/tokens.css so the play
   card and the blindtest scrubber can use the identical component. Only the
   dropzone's show/hide gating stays here (above). */

/* --- THE PREVIEW PLAYER PINS TO THE TOP (v0.2.44) ---------------------------
   Same treatment as the play card's waveform (v0.2.43) and the same tokens, so
   the two float at an identical offset and can be re-dialled together.

   ★ WHY THE PANEL AND NOT #dropzone. A sticky box can only travel inside its
   own parent's content box, and #dropzone's parent is section.panel.upload —
   a ~150px sibling of the library panel. Sticky on the dropzone would hold for
   the panel's 24px of bottom padding and then leave with it, long before the
   ROW LIST starts scrolling, which is the whole point. Nothing is broken in
   that arrangement; the containing block is simply too short, and it fails
   silently, which is how this kind of thing is usually shipped by accident.
   The panel's own parent is #appShell, which spans the upload panel AND the
   library panel — so promoting the sticky one level up is all it takes, with no
   DOM change at all. See test/library-sticky.test.mjs.

   :has() gates it on a track actually being loaded. Unconditional sticky would
   park the idle drop prompt across the top of the library for the whole session.
   The selector is the same idiom .modal-backdrop:has(> .modal.is-card) has used
   since v0.2.11, so it is already load-bearing on this platform.

   No background is set: .panel is opaque (var(--panel)) by construction, which
   is what lets the rows tuck behind it.

   z-index is --z-sticky, the same level as a modal's sticky head. It has to
   outrank the LIBRARY panel, which is a later sibling and would otherwise paint
   over a pinned box. Row menus are --z-popover (60) and still open above it. */
.panel.upload:has(#dropzone.player) {
  position: sticky;
  top: var(--wave-pin-top);
  z-index: var(--z-sticky);
  border-radius: var(--wave-pin-radius);
}

/* The heading goes while the box is a player. Without this the thing floating
   at the top of the library is a panel captioned "Upload" with a mini-player
   inside it, which is not what a floating mini-player looks like.

   ⚠️ Keyed on the PLAYER state, deliberately, not on .is-pinned. Hiding it on
   pin would change the panel's height at the exact scroll position where the
   pin engages — the classic sticky oscillation, and the worst possible place
   for it on a momentum-scrolling platform. Tied to the player state it moves
   once, on a deliberate press, at the same moment the box swaps its prompt for
   a waveform. One line to restore the heading. */
.panel.upload:has(#dropzone.player) > h2 { display: none; }

/* Elevation only while genuinely pinned (js/wavepin.js). Gated on the player
   state as well as the class so a stray is-pinned can never shadow a panel that
   is not sticky in the first place. */
.panel.upload:has(#dropzone.player).is-pinned { box-shadow: var(--wave-pin-shadow); }

.eject {
  position: absolute; top: 5px; right: 6px; z-index: var(--z-overlay);
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: var(--scrim-chip); border: none; color: var(--text-dim);
  font-size: var(--text-body); line-height: 1; cursor: pointer; padding: 0;
}
.eject:hover { color: var(--accent); }

/* --- Status lines --- */

.status {
  margin: 16px 0 0;
  min-height: 1.5em;
  font-size: var(--text-ui);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* --- Track metadata editor (Details modal) --- */

.meta-edit {
  display: flex; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--panel-border); padding-top: 14px;
}
/* min-width:0 is load-bearing: a flex item defaults to min-width:auto, and the
   file input's min-content width would otherwise push this column past its
   168px basis and wrap the fields onto their own line. */
.meta-art { flex: 0 0 168px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.meta-fields { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.art-empty {
  width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--panel-border); background: var(--input-bg);
  color: var(--text-dim); font-size: var(--text-fine);
  /* Occupies the artwork's slot at the same size, so it takes the same corners
     — otherwise picking an image visibly changes the shape of the box. */
  border-radius: var(--art-radius);
}
/* The display above outranks the UA sheet's [hidden]{display:none}, so without
   this the placeholder shows underneath the artwork it is standing in for. */
.art-empty[hidden] { display: none; }

/* Native file inputs don't shrink on their own. */
.meta-file { font-family: var(--font-body); font-size: var(--text-fine); color: var(--text-dim);
             max-width: 100%; }
.meta-art-remove { padding: 7px 10px; font-size: var(--text-fine); }

.meta-label { display: flex; flex-direction: column; gap: 5px;
  font-family: var(--font-body); font-size: var(--text-micro); letter-spacing: var(--tracking);
  text-transform: uppercase; color: var(--text-dim); }
.meta-label > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meta-count { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.meta-label input, .meta-label textarea { width: 100%; }
/* ★ A CHECKBOX ROW, not a stacked field (v0.2.179). .meta-label is a column with
   `input { width: 100% }`, which stretches a checkbox across the modal and puts
   its label above it — right for a text field, wrong for a switch. This restates
   the axis and takes the width rule back for this one input. */
.meta-check { flex-direction: row; align-items: center; gap: 8px; }
.meta-check input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 0; }
.meta-check > span { justify-content: flex-start; }
.meta-label textarea {
  font-family: var(--font-body); font-size: var(--text-field);   /* 16px: iOS zoom rule */
  background: var(--input-bg); border: 1px solid var(--panel-border);
  border-radius: 0; color: var(--text); padding: 9px 12px; resize: vertical;
  text-transform: none; letter-spacing: normal;
}

.meta-preview-label { font-family: var(--font-body); font-size: var(--text-micro);
  letter-spacing: var(--tracking); text-transform: uppercase; color: var(--text-dim); }
.meta-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.meta-msg { font-family: var(--font-body); font-size: var(--text-fine); color: var(--text-dim); }
.meta-msg.is-err { color: var(--danger); }

@media (max-width: 600px) {
  .meta-art { flex: 1 1 100%; }
}

/* The raw sample count beside a detected-silence figure. */
.sil-raw { color: var(--text-dim); font-size: var(--text-micro); }
/* Filenames are arbitrary length and have no spaces to break at, so this cell
   opts out of the table's nowrap rather than pushing the modal wide. */
/* ★ IDENTIFIERS, NOT FIGURES (v0.3.0). A hash and a filename are things you
   COMPARE AGAINST something you already have, character by character from the
   left — not values you scan down a column, which is what the table's right
   alignment is for. So these two cells left-align and take the wider
   --details-id-col-w instead of the 6.4em number slot.

   ⚠️ SPECIFICITY IS A TIE, AND ORDER IS WHAT DECIDES IT. This selector and
   `.loudness-table td:not(:first-child)` in css/tokens.css are both (0,2,1) —
   :not() lends the specificity of its argument. css/style.css loads AFTER
   tokens.css on every page, so this wins. If that link order ever changes, the
   width silently reverts to 6.4em and the hash goes back to a narrow stack. */
.loudness-table td.src-file {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  width: var(--details-id-col-w);
}

/* --- Library --- */

#libraryList {
  display: flex;
  flex-direction: column;
}

/* ★ THE LOSSY-FORMAT BADGE (v0.3.x) — "MP3" / "AAC" after a track's name.
   A NEW component: the .type-badge this borrows its grammar from was removed in
   v0.2.4 and only a comment in .filter-pill survived it.

   ⚠️ DELIBERATELY NOT .filter-pill's box. That padding is sized to make a 9px
   badge a TAPPABLE control, ~21px tall to match the row icon buttons. This is a
   marker, not a control: nothing to press, so nothing to give a finger-sized
   target to. Tighter and quieter is the whole difference.

   INFORMATIONAL, NOT A WARNING. Neutral grey on purpose — lossy is a fact about
   a file, and a red or amber tint would read as a problem with the upload.

   The grammar the old badge left behind: the 3px corner and the all-caps,
   sized-down treatment, so it reads as a badge rather than as shouted text. */
.row-format-badge {
  flex: 0 0 auto;
  margin-left: var(--format-badge-gap);
  padding: var(--format-badge-pad-y) var(--format-badge-pad-x);
  border-radius: 3px;
  background: var(--format-badge-bg);
  color: var(--format-badge-ink);
  font-family: var(--font-title);
  font-size: var(--format-badge-size);
  line-height: 1;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  /* It sits on a line with the name; align to the text rather than the box. */
  vertical-align: middle;
  /* A marker, not a control — no pointer, and it must never eat a row click. */
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* --- Filter pills ----------------------------------------------------------
   Between the search box and the list. Badge language, not button language:
   the same 3px corner, all-caps and small caps size as .type-badge, so a filter
   reads as the thing it filters FOR.

   Each pill carries three custom properties, which is the whole of its identity:
     --c    the ON fill
     --ink  the ON label, chosen for contrast against --c
     --off  the OFF outline AND label
   Only MIX differs from its own badge colour when off: at #4b5763 a slate
   outline on a slate panel is nearly invisible, so it goes white. That is the
   locked mock, and the reason for it.

   Padding is what makes a 9px badge a tappable control — ~21px tall, matching
   the row icon buttons — without turning it into a chunky button. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--sp-content);
  /* ★ CENTRE, NOT STRETCH (v0.2.60).

     flex's default cross-axis alignment is `stretch`, so every child of this row
     grew to the height of the tallest one. That cost nothing while the row held
     only pills — they are all 23px — but v0.2.59 added the Autogroup switch at
     40px (7px padding + a 26px track + 7px padding), and the filter buttons
     inflated 23px -> 40px to match it. Nothing about the buttons changed; they
     were simply told to fill a taller line.

     `center` lets every child keep its intrinsic height and sit on the row's
     middle. The ROW stays 40px tall, which is fine — the space was always
     there; only the buttons stop being stretched into it.

     It fixes .filter-actions in the same stroke: that is itself a flex container
     with the default stretch, and it was being stretched to 40px, taking SPY and
     the gear up with it. Once it takes its own intrinsic height, its children
     stretch to exactly the height they already were. */
  align-items: center;
}

.filter-pill {
  flex: 0 0 auto;
  font-family: var(--font-title);
  font-size: var(--text-badge);
  letter-spacing: var(--tracking);
  line-height: 1;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 6px 11px;
  cursor: pointer;
  /* OFF: nothing but an outline and a label, both in --off. */
  background: transparent;
  color: var(--off);
  border: 1px solid var(--off);
  transition: background var(--t-fast) ease, color var(--t-fast) ease,
              border-color var(--t-fast) ease;
}

/* ON: solid, with the outline folded into the fill so the pill does not change
   size between states. */
.filter-pill.is-on {
  background: var(--c);
  color: var(--ink);
  border-color: var(--c);
}

/* Minimal, and never mistakable for the ON state: a faint wash of the pill's
   own colour. The base button rule dims on hover, so opacity is pinned back. */
.filter-pill:hover { opacity: 1; }
.filter-pill:not(.is-on):hover {
  background: color-mix(in srgb, var(--off) 14%, transparent);
}
.filter-pill.is-on:hover { opacity: .88; }
.filter-pill:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* The favourites pill carries an ICON rather than a word (see FILTER_PILLS in
   js/library.js for why it cannot be a character). It needs its own box: a
   centred flex line instead of a text line, and vertical padding trimmed so the
   taller glyph still lands on the SAME 23px pill height as MIX / A/B / SEQ —
   9px label + 6px padding + 1px border either side. Sized in em off --text-fine
   so it tracks the type scale rather than pinning a pixel. */
.filter-pill.f-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-fine);
  letter-spacing: 0;
  padding: 3px 10px;
}
/* ★ ONE EXPLICIT HEIGHT FOR ALL SIX BUTTONS ON THE ROW (v0.2.62).
   
   v0.2.61 pinned the four filter chips and left the gear and SPY on their own
   intrinsic sizes inside .filter-actions — which is precisely why the row still
   was not uniform, and why every fix that touched one side moved the other out
   of line. A DESCENDANT selector, not a child one: the chips sit directly in
   .filter-bar, the gear and SPY a level down inside .filter-actions, and this
   has to reach both.
   
   What each of the six was before this rule:
   
     heart / MIX / stack / list   26.6px   pinned by the v0.2.61 token
     SPY                          23px     intrinsic (6+1+9+1+6)
     gear                         20.6px   intrinsic, STRETCHED to 23 by
                                           .filter-actions, whose default
                                           align-items made it match SPY
   
   Now: 26.6px, all six, from one place.
   
   ⚠️ .filter-actions still has no align-items and no longer needs one — `stretch`
   only applies to a child whose cross size is `auto`, and every child here now
   has a definite height. The nested flex row simply stops mattering.
   
   box-sizing is border-box globally, so each button's own padding and border sit
   INSIDE the token: the chips keep 6px/11px, the gear keeps 3px/10px, and their
   WIDTHS are untouched. */
.filter-bar .filter-pill {
  height: var(--row-btn-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ★ NO ICON CAN FORCE A BUTTON OFF THE TOKEN.
   
   The heart is 1.25em and the stack, list and gear are 1.4em — kept as they are,
   because this build is about height and those sizes are what the row looks like
   today. The height above already wins over them (a definite height does not
   grow to its contents), so the only remaining risk is the opposite one: dial
   the token DOWN far enough and an icon would spill out of its button.
   max-height makes it shrink to fit instead, so the dial stays usable across its
   whole range rather than only upward. */
.filter-bar .filter-pill svg { max-height: 100%; flex: 0 0 auto; }

.filter-pill.f-fav svg { width: 1.25em; height: 1.25em; display: block; }


/* The two compound kinds carry an icon AND their label. Only the layout is set
   here — no colour at all — because the icon paints with currentColor and the
   chip already sets that per state (--off when idle, --ink when on). The type
   colour code below is therefore inherited, not repeated: these are the chips
   that ARE colour-coded, unlike the neutral row and button icons above.
   Corners, padding and font-size are deliberately left alone. */
.filter-pill.f-bt,
.filter-pill.f-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.filter-pill.f-bt svg,
.filter-pill.f-seq svg { width: 1.4em; height: 1.4em; display: block; }

/* The CONFIG chip is a glyph, not a word (v0.2.31), so it needs the icon-only
   box the heart already has — a centred flex line rather than a text one — and
   the 1.4em the two compound filter icons use, so the three read as one row of
   icons rather than three sizes. */
.filter-pill.bar-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
}
.filter-pill.bar-action-icon svg { width: 1.4em; height: 1.4em; display: block; }

.filter-pill.f-fav { --c: var(--accent);         --ink: var(--accent-text); --off: var(--accent); }
.filter-pill.f-mix { --c: var(--type-mix);       --ink: #ffffff;            --off: #ffffff; }
/* --off is WHITE on both compound chips as of v0.2.19, matching MIX's label.
   With the word gone the icon is the whole chip, and drawn in its own type
   colour it read as a coloured smudge at 9px rather than as a control. The ON
   state keeps the type colour where it does the work — --c is still the fill,
   so a selected blind-test chip is still red and a selected sequence still
   blue. Only the idle glyph changes. */
/* The SELECTED fill is MIX's grey on all three type chips as of v0.2.23 — the
   red and blue are gone. They were the last place --type-blindtest and
   --type-sequence still coloured a control, and with the idle glyphs already
   white (v0.2.19) a chip that turned red or blue on selection read as a state
   change of a different kind rather than as "on". One fill for on, one ink for
   off, and the icon alone says which kind. The type tokens keep their other
   uses; only these two references change. */
.filter-pill.f-bt  { --c: var(--type-mix);       --ink: #ffffff;            --off: #ffffff; }
.filter-pill.f-seq { --c: var(--type-mix);       --ink: #ffffff;            --off: #ffffff; }

/* The right-hand cluster (v0.2.19): CONFIG + ADMIN, pushed to the far end of the
   filter line by an auto start-margin so the type filters keep their left
   alignment and nothing needs a spacer element. They are ordinary .filter-pill
   .f-mix chips — same box, same padding, same white label — and js/library.js
   keeps them out of the filter machinery entirely, so no is-on rule can reach
   them. DOM order is CONFIG then ADMIN, which puts ADMIN at the right edge.
   The bar wraps, so on a narrow window the cluster drops to its own line rather
   than squeezing the filters. */
.filter-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* Bare media-app rows: [heart] [avatar] [main] [duration] [share] [overflow].
   No boxes; separation by spacing.

   The height is PINNED to what it was when the row still reserved space for the
   "Show info" sub-line (v0.1.19 removed it). Keeping the spacing was deliberate
   — it is the rhythm the library already reads at — so the reserved space is
   now explicit rather than a side effect of markup that no longer exists.

   align-items: center, not flex-start: with nothing below the title there is no
   sub-line to align to any more, and centring is what puts the owner-colour
   tint (which fills the whole row) squarely around the title instead of leaving
   it top-heavy. */
.library-row {
  display: flex;
  align-items: center;
  min-height: var(--lib-row-h);
  gap: 10px;
  padding: var(--lib-row-pad) 0;
}

/* Pin the lead and the trailing icons to the title's 22px line box. */
.library-row .row-lead { height: 22px; }
.library-row .icon-btn { height: 22px; padding-top: 0; padding-bottom: 0; }

/* 30px is the icon button's real width (18px glyph + 6px padding each side).
   Every row type now carries a favourite heart here, so the widths already
   agree — but the fixed basis stays, because it is what guarantees the titles
   line up rather than relying on three buttons happening to measure the same. */
.row-lead {
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* ★ THE HEART'S DIAL — see --track-heart-inset in css/tokens.css.
     TRANSFORM, never margin: this is a flex item and the avatar, name and meta
     are its siblings, so a margin would push the whole row along. A transform
     runs after layout — the 30px slot stays exactly where it was and only the
     heart moves. Lives here, on the base row, because it is a TRACK-level inset:
     ordinary rows, group heads and versions all carry it. */
  transform: translateX(var(--track-heart-inset));
}

/* Name + optional info sub-line share the row's flexible middle. */
.row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.library-name {
  min-width: 0;
  /* U57 Roman Condensed as of v0.2.141 (U55 Roman before it) — heavier than the
     U47 Light Condensed everywhere else, at an
     unchanged --text-body. See --font-row-name in css/tokens.css. */
  font-family: var(--font-row-name);
  text-transform: none;    /* stored name, verbatim */
  letter-spacing: var(--tracking);
  font-size: var(--text-body);
  line-height: 22px;       /* so the play/trailing icons can align to the title */
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* --- Owner colour: LIBRARIAN VIEW ONLY -------------------------------------
   A normal user only ever sees their own rows, so neither of these carries any
   information for them; js/library.js renders them only when isLibrarian().

   The tint is an overlay rather than a background so one unitless --owner-tint
   works for every owner colour. isolation:isolate keeps the z-index:-1 inside
   the row — without it the overlay would paint behind the panel and vanish. */
.library-row { position: relative; isolation: isolate; }
.library-row.has-owner-tint::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--owner-colour);
  opacity: var(--owner-tint);
  pointer-events: none;      /* the row underneath stays fully clickable */
  z-index: var(--z-under);
}

/* Square, sized so the letter matches the title and has room to breathe. Sits
   after the heart and before the title, so nothing on the busy right edge of
   the row moves. The negative margin centres it on the 22px title line rather
   than hanging below it. */
/* ★ RESET WHEN IT IS A BUTTON (stage 2). The badge became pressable — a ?user=
   search for its uploader — and the base button rule would otherwise give it
   padding, a border, the title face and UPPERCASE tracking, none of which the
   28px square can absorb.

   ⚠️ THE GEOMETRY MUST NOT MOVE — but NOT for the reason this comment used to
   give. It claimed the autogroup spine aligns to this box's centre; measured,
   the spine spans 27..33px and the avatar 65..93, so they are independent and
   always were. What a border or padding here WOULD do is widen the 28px square
   and push the name and everything right of it along on every row.
   scripts/spine-check.mjs measures both.

   ⚠️⚠️ NO `font: inherit` HERE — it was the v0.2.106 regression, and it is the
   SAME trap as v0.2.97 seen from the other side.

   That build reset the button with `font: inherit` and then restored
   text-transform by hand, having learnt that the shorthand does not carry it.
   But `font:` is not a weak shorthand — it RESETS font-family, font-size,
   font-style, font-variant, font-weight, font-stretch AND line-height. At
   (0,1,1) it beat `.owner-avatar` at (0,1,0) and wiped three of the four
   typographic declarations the class exists to make:

       font-family  var(--font-title)  ->  the body face   (U45, not U57)
       line-height  1                  ->  1.5 inherited   (22.5px in a 28px box)
       font-size    var(--text-body)   ->  inherited

   Measured: the span read `U57, U45` / `15px`, the button `U45, …` / `22.5px`.
   The fix is a DELETION, not an override — with the shorthand gone, the class's
   own declarations apply again, because (0,1,0) already beats the base
   `button {}` rule at (0,0,1).

   What genuinely still needs resetting is only what `.owner-avatar` does NOT
   set: letter-spacing (the base rule's --tracking would space a single initial
   off its own centre) and the box/appearance. text-transform is deliberately absent
   — the class sets it and already wins. */
button.owner-avatar {
  padding: 0;
  border: 0;
  letter-spacing: normal;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button.owner-avatar:hover { opacity: 0.82; }
button.owner-avatar:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

.owner-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--type-mix);          /* the NULL-colour fallback */
  font-family: var(--font-title);
  font-size: var(--text-body);
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

/* Duration, leading the row's right-hand cluster. .u-figure supplies the dim
   colour and tabular numerals; tabular means every digit is the same advance,
   so the column is already self-aligning digit-for-digit.
   The min-width is measured, not guessed: the widest realistic value, 9:59:59,
   was 43.4px at --text-meta in U45, so 52px holds it with headroom AND keeps the
   (⚠️ MEASURED IN U45, BEFORE THE v0.2.141 CONDENSED REMAP. Condensed is
   NARROWER, so the headroom only grew — the number is stale, not wrong.)
   share/⋯ controls at a fixed x whether a row shows 3:21, 1:02:03 or nothing.
   line-height matches the title's 22px so it sits on the title's line, and
   flex:0 0 auto stops it being squeezed by a long name. */
.row-dur {
  flex: 0 0 auto;
  min-width: 52px;
  text-align: right;
  font-size: var(--text-meta);
  line-height: 22px;
}

/* Title and type badge on one line. The title takes 0 1 auto so it SHRINKS and
   ellipsizes; the badge takes 0 0 auto so it never does — which is what keeps a
   long mix name from pushing its own type off the row. The gap reads as the
   normal space after the title, so the badge runs on rather than sitting out at
   the right-hand edge. */
.row-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.row-title .library-name { flex: 0 1 auto; }

/* The plays count, trailing the title (v0.2.29).
   flex: 0 0 auto against the name's 0 1 auto is what makes a long title
   ellipsize INTO the number rather than pushing it off the row — the name
   shrinks, this never does, so the count is always readable.
   .row-title is align-items:baseline, so it lands on the title's baseline
   without a single alignment declaration here. Font and size are the artist
   subtitle's, so the two pieces of metadata on a row match each other rather
   than the title they hang off. */
.row-plays {
  flex: 0 0 auto;
  /* ⚠️ THE SUBTITLE'S FACE, NOT THE BODY'S (v0.2.145). The comment above already
     said "font and size are the artist subtitle's" — but it read --font-body,
     which was the same thing only by coincidence. Once the subtitle got its own
     variable the two would have drifted apart the first time anyone flipped the
     condensed switch, with the plays count left in the other face on the same
     line. Now it follows what it claims to follow. */
  font-family: var(--font-row-artist);
  font-size: var(--text-row-artist);
  color: var(--row-plays-colour);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The artist line under the name (v0.2.20) — the row's second line.
   U47 Light at --text-ui against the name's U57 Roman at --text-body: one step
   down in size and a whole face lighter, which is what stops the two lines
   competing. FULL WHITE, deliberately, not --text-dim: this is a name, and on a
   librarian's owner-tinted row a dim grey sinks into the tint. Ellipsised on the
   same terms as the name, so a long artist can never widen the row. */
/* The "Type•Artist" separator. Sized down (--row-sep-size) and optically
   centred: `middle` aligns it to the x-height's midpoint, which is where a
   separator belongs, rather than sitting on the baseline like a full stop.
   The gap is a margin rather than a literal space character (v0.2.30): a space
   would take the SUBTITLE's font-size, not the separator's, so the two sides
   would be wider than the glyph between them and impossible to tune. In em, so
   it scales with --row-sep-size rather than needing a second nudge. */
/* ★ THE ROW DATE. Dimmer than the name it follows — it is context, not the
   subject of the line, and at the same weight it competed with the artist for
   the eye. No size change: a second size on one line reads as a mistake. */
.row-artist .row-date { color: var(--text-dim); }

.row-artist .row-sep {
  font-size: var(--row-sep-size);
  line-height: 1;
  vertical-align: middle;
  margin: 0 var(--row-sep-gap);
}

.row-artist {
  min-width: 0;
  font-family: var(--font-row-artist);
  font-size: var(--text-row-artist);
  line-height: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Row type markers (v0.2.4) -----------------------------------------------
   The coloured word-badges that used to sit AFTER the name are gone. In their
   place, BEFORE the name, the very icon the ⋯ menu uses for that kind — so a
   blind test and a sequence read as indented behind their marker and line up
   with each other, while a plain mix carries no marker at all and stays flush
   left. The ordinary case is the one that needs no explaining.

   NEUTRAL here, always: --icon, the ⋯ menu's own colour. The type colours live
   on the filter chips, which is a different job — see .filter-pill. */
.row-type-icon {
  flex: 0 0 auto;
  display: inline-flex;
  /* .row-title aligns on the baseline, which an icon does not have — so this
     one opts out and centres on the line instead. */
  align-self: center;
  color: var(--icon);
}
.row-type-icon svg { width: 16px; height: 16px; display: block; }

/* --- An icon inside a button, left of its label (v0.2.4) --------------------
   Used by the two CREATE buttons. The glyph is neutral at rest and follows the
   label on hover, so the pair never reads as two different states. */
button.has-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
button.has-icon svg { width: 16px; height: 16px; display: block; color: var(--icon); }
button.has-icon:hover svg { color: inherit; }

/* Track names act as play buttons, so they need the affordance an <a href> gave. */
.library-name.is-activator { cursor: pointer; }
.library-name.is-activator:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* Playing: reversed out of solid yellow — the same fill-and-white-text grammar
   as the type badges, so "playing" reads as the yellow member of that family
   rather than as a new kind of highlight. The negative inline margin keeps the
   fill hugging the text without shifting the title off the other rows' left
   edge, and the padding is asymmetric because uppercase-free body text sits
   slightly high in its line box. */
/* NOW PLAYING (v0.2.21): the name turns accent yellow and takes a leading "… ".
   The solid yellow strip it used to wear is gone — a whole reversed-out block
   for one row shouted louder than the thing it was marking, and it fought the
   librarian's owner tint for the same rectangle.

   The ellipsis is a ::before, NOT text. Three reasons it has to be: it must
   never reach the stored name; paintPlayerRows() sets nameEl.title from
   nameEl.textContent, which would otherwise start reading "… Midnight Reprise";
   and as CSS it appears and disappears with the class, so there is nothing to
   remember to strip when playback stops. The whole indicator is this one rule
   plus the hover guard below — no JS changed. */
.library-name.is-playing {
  color: var(--accent);
}
/* ★ NOT YOURS — an imported share, or anything played while acting as someone
   (v0.2.96). ONE colour for both, because they are one idea: this file is not
   the signed-in user's.

   The class is set from the PLAYER's captured state, not from the row (see
   paintPlayerRows in js/library.js), so it follows the FILE: stop acting as
   someone mid-track and the title stays cyan, because the mix is still theirs.

   --unowned-accent rather than --accent deliberately: acting-as remaps --accent
   to this same cyan, so a rule reading --accent would look right during the mode
   and silently revert the instant it ended. */
.library-name.is-playing.is-unowned {
  color: var(--unowned-accent);
}
.library-name.is-playing::before { content: "\2026\00a0"; }
/* DELIBERATE GUARD — do not delete. It used to keep a hovered PLAYING title DARK
   against its yellow strip; with the strip gone (v0.2.21) its job is the mirror
   image, keeping that title YELLOW so hovering the thing you are listening to
   does not repaint it as if it were any other row. Strictly redundant while the
   activator-hover below carries :not(.is-playing), but it is what holds if a
   future hover rule lands after it. Cheap insurance against a repeat of v0.1.0. */
.library-name.is-playing:hover { color: var(--accent); }

/* The title is the transport now that the play triangle is gone, so it needs to
   look like something you can press.
   :not(.is-playing) is load-bearing. Without it this rule ties with the guard
   above on specificity (0,3,0) and wins on source order, repainting a hovered
   PLAYING title accent-on-accent — yellow text on a yellow fill, invisible. */
.library-name.is-activator:hover:not(.is-playing) { color: var(--accent); }

/* Favourite heart, in the slot the play triangle used to hold. Outline by
   default, solid when set — a shape change, not just a colour one, so it does
   not depend on colour vision. */
.fav-btn { color: var(--text-dim); }
.fav-btn:hover { color: var(--fav); }
.fav-btn.is-fav { color: var(--fav); }
.fav-btn svg { width: 17px; height: 17px; }

.icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 0;
  padding: 6px;
  margin: 0;
  color: var(--icon);
  cursor: pointer;
  transition: color var(--t-fast) ease;
}

.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn:hover { color: var(--text); opacity: 1; }
.icon-btn:disabled { opacity: var(--disabled-opacity); cursor: default; }
/* Share button's transient "copied" tick. (.playing went with the lead play
   button in v0.0.62.) */
.icon-btn.copied { color: var(--accent); }

.library-empty { font-size: var(--text-meta); color: var(--text-dim); padding: 8px 0; }

/* --- Copy toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 8px);
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
  padding: 9px 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-meta);
  white-space: nowrap;
  box-shadow: 0 8px 28px var(--scrim-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- Search --- */

/* The search box (v0.2.23): a magnifier on the left, a clear ✕ on the right when
   there is something to clear. The wrapper carries the margin the input used to,
   so the header's rhythm is unchanged. */
.library-search-wrap {
  position: relative;
  display: block;
  margin-bottom: var(--sp-content);
}
.library-search {
  display: block;
  width: 100%;
  /* ONE furniture slot now, at the right (v0.2.30). The glass used to sit on the
     left, where it crowded the placeholder and the first characters typed —
     36px of dead space in front of every query. The left padding goes back to
     the field's own, and the right stays reserved whether the glass or the ✕ is
     showing, so nothing reflows as they swap. */
  padding-right: 36px;
}
/* Both slots are centred on the input's own height rather than pinned to a
   pixel, so they stay put if the field's padding is ever retuned. */
.library-search-icon,
.library-search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  pointer-events: none;
}
/* Both furniture pieces sit in the SAME right-hand slot and are never both
   visible: the glass at rest, the ✕ the moment there is something to clear.
   Same right offset for each, so the swap is a change of glyph and not a
   change of position. */
.library-search-icon { right: 10px; width: 16px; height: 16px; }
.library-search-icon[hidden] { display: none; }
.library-search-icon svg { width: 100%; height: 100%; }

/* The clear button IS interactive, so it takes its pointer events back. Hidden
   by the [hidden] attribute js/library.js toggles — display:none would need
   overriding here, and the attribute is the accessible answer anyway. */
.library-search-clear {
  right: 7px;
  width: 22px; height: 22px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  pointer-events: auto;
}
.library-search-clear:hover { color: var(--text); opacity: 1; }
.library-search-clear[hidden] { display: none; }

/* --- Row overflow menu --- */

.row-menu {
  position: absolute;
  z-index: var(--z-popover);
  min-width: 210px;
  max-width: calc(100vw - 16px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 4px 0;
  box-shadow: 0 8px 28px var(--scrim-shadow);
}

.row-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-ui);
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
}

.row-menu button svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--icon); }
.row-menu button:hover:not(:disabled) { background: var(--input-bg); opacity: 1; }
.row-menu button:hover:not(:disabled) svg { color: currentColor; }
.row-menu button:disabled { color: var(--text-dim); opacity: 0.55; cursor: default; }
/* .danger-item DELIBERATELY CARRIES NO COLOUR (v0.2.46). Delete used to print in
   --danger here and in the sequence's ⋯ sheet. It is now the same white as every
   other item: the menu reads as a list of actions rather than one of them
   shouting, and Delete is already set apart by its own divider-separated section
   and its confirmation. js/library.js still applies the class, so restoring the
   red is two lines here and nothing else. */
.menu-sep { height: 1px; background: var(--panel-border); margin: 4px 0; }
/* Trailing hint at the right end of a list row — the ⋯ menu and the picker use
   the identical affordance. */
.menu-hint,
.picker-hint { margin-left: auto; font-size: var(--text-micro); color: var(--text-dim); }

/* --- Add-to-blindtest picker --- */

.picker-list { display: flex; flex-direction: column; gap: 6px; }

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  /* NOT routed to `secondary`, deliberately: this button is disabled when a
     blind test is full, and its hover below carries :not(:disabled) whereas
     button.secondary:hover does not. Sharing would light a disabled row up on
     hover — a behaviour change, so the duplication stays for now. */
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 0;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: var(--text-ui);
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
}

.picker-item:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); opacity: 1; }
.picker-item:disabled { color: var(--text-dim); opacity: 0.5; cursor: default; }

/* Blindtest rows read the same, just marked by their member count. */
.library-row.not-selectable .library-name { opacity: 0.55; }

.row-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  align-self: center;
}

.row-check-spacer { flex: 0 0 16px; }

/* --- Create-blindtest selection bar --- */

.select-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
}

.select-bar[hidden] { display: none; }

.select-count { font-size: var(--text-meta); }   /* colour + tabular-nums: .u-figure */

.select-bar input { flex: 1 1 180px; min-width: 0; }
.select-bar button { flex: 0 0 96px; }

/* ⚠️ `.select-blind` LIVED HERE (v0.2.149) and is gone with the checkbox in
   v0.2.155: blind is decided by which create button opened the bar, so there is
   no control in it to style. The lesson it recorded is worth keeping, because
   the rule that caught it is still above: `.select-bar input` is (0,1,1) and
   matches ANY input in the bar — anything added here that is not meant to be a
   180px-wide flex item needs its own higher-specificity escape, and `.row-check`
   alone (0,1,0) will not do it. */

.member-list { display: flex; flex-direction: column; gap: 10px; }
.member-name { font-size: var(--text-meta); color: var(--text); overflow-wrap: anywhere; }
.member-loud { font-size: var(--text-fine); }    /* colour + tabular-nums: .u-figure */

/* The editable slot name (v0.2.152). ★ NARROW ON PURPOSE — the value is capped
   at 24 characters and most are four ("R04a", "REF"), so a full-width field
   would advertise room the slot button does not have. It is still wide enough to
   show a 24-character label in full, which is the point of editing it here
   rather than on the button. */
.member-slot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.member-slot-input { flex: 0 1 var(--slot-field-w); min-width: 0; }
.member-slot-note { font-size: var(--text-fine); color: var(--text-dim); }

/* --- Details modal --- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: var(--z-modal);
}

.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 20px;
}

/* --- The WELCOME overlay (v0.2.117) ------------------------------------------
   A SEPARATE element from the .modal singleton — js/library.js's box destroys
   the running player on open and on close, and this one must never disturb
   transport (see js/welcome.js). It borrows .modal-backdrop / .modal /
   .modal-head / .modal-close so it looks like every other panel, and adds only
   what its own content needs.

   The class is also load-bearing behaviourally: searchKeyModalOpen() in
   js/searchkey.js keys on .modal-backdrop, which is what makes Escape close
   this instead of clearing the search. Renaming it would quietly break that. */
.welcome-modal { max-width: var(--welcome-max-w); }

.welcome-sub {
  margin: var(--sp-welcome-sub) 0 0;
  font-family: var(--font-body);
  font-size: var(--text-ui);
  color: var(--text-dim);
}

.welcome-heading {
  margin: var(--sp-welcome-heading) 0 0;
  font-family: var(--font-title);
  font-size: var(--text-body);
  color: var(--text);
  letter-spacing: var(--tracking);
}

/* list-style: none + an explicit marker, so the bullet takes the accent and the
   text hangs in a straight column rather than on the browser's own indent. */
.welcome-list {
  margin: var(--sp-welcome-heading) 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-body);
  font-size: var(--text-ui);
  color: var(--text);
  line-height: 1.5;
}

.welcome-list > li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--welcome-bullet-gap);
  margin-top: var(--sp-welcome-item);
}

.welcome-list > li:first-child { margin-top: 0; }

.welcome-list > li::before {
  content: "\2022";              /* • — a real marker, in the accent */
  color: var(--accent);
  /* Grid keeps the wrap hanging, so a two-line bullet stays aligned under
     itself rather than tucking back under the marker. */
}

/* --- The PLAY CARD's modal (v0.2.8) ------------------------------------------
   .modal is a SINGLETON — js/library.js builds one box and every modal in the
   app reuses it — so this cannot restyle .modal itself without restyling the
   Edit modal, Details, the blindtest player and the rest. It is opted into per
   open, exactly the way .wide already is (ensureModal(): toggled in open(),
   cleared in hide()), which is also why it cannot be left behind on the next
   modal to use the box.

   Surface, border, side padding and width ONLY — the frame. max-height and
   overflow-y are deliberately NOT restated: a tall card still has to scroll
   inside the viewport, and that is the inherited .modal rule's job. */
/* v0.2.11 FULL BLEED. v0.2.8 recoloured the card's surface but left it INSET —
   the backdrop's 20px padding and the box's 560px cap meant --card-surface was
   still a panel sitting on a darker surround (the 70%-black scrim), and the
   v0.2.9 vignette was boxed inside it with a dark frame all round. The surface
   now fills the viewport and the vignette runs off three of its edges.

   Three layers change, and they have to change together:
     BACKDROP  stops dimming and becomes the surface itself, with no padding, so
               there is no darker surround left anywhere to see.
     BOX       drops its width cap and padding and becomes a full-viewport
               scroller. It keeps overflow-y:auto — that is still the thing that
               lets a tall card scroll.
     CARD      takes over the width cap and the side gutter, so the CONTENT is
               still a readable 560px column even though the surface behind it
               is edge to edge.

   ⚠️ BACKDROP-DISMISS IS GONE for this modal, necessarily: the box now covers
   the backdrop completely, so `e.target === backdrop` can never fire. ✕ and
   Escape both still close (js/library.js hide()), and the head below is sticky
   so ✕ stays reachable however far the card scrolls. */
.modal-backdrop:has(> .modal.is-card) {
  background: var(--card-surface);
  padding: 0;
  /* Block, not flex. The flex centring is what held the box in the middle with
     surround showing round it; with the box filling there is nothing left to
     centre, and block layout avoids the "tall flex item gets squashed by
     align-items:stretch" case entirely.
     THE SCROLLER MOVES HERE, off the box — see the vignette note below; it is
     what lets the wash bleed sideways without being clipped. */
  display: block;
  overflow-y: auto;
  /* 50vw below counts the scrollbar, so the bleed can overshoot by a few px on
     a desktop with classic scrollbars. Nothing should ever scroll sideways. */
  overflow-x: hidden;
}

.modal.is-card {
  max-width: none;
  /* The height cap and the scroller both moved to the backdrop, so the box is
     just a full-width block now. min-height fills the viewport when the card is
     short, so the surface still reaches the bottom edge.
     dvh, not vh: on iOS Safari 100vh is the address-bar-hidden height, which
     would leave a strip of page showing under the toolbar. */
  max-height: none;
  min-height: 100dvh;
  overflow: visible;
  background: var(--card-surface);
  border: none;
  padding: 0;
}

/* The readable column used to be declared here. As of v0.2.17 it lives on
   .card-frame itself in css/tokens.css, because it is the same column on every
   host and for every renderer — that move is what lets the blind test and the
   sequence inherit it without a line of their own. Same values, so the standard
   card is unchanged. */

/* The vignette, off the top/left/right VIEWPORT edges rather than the card's.
 *
 * calc(50% - 50vw) is the full-bleed idiom: the card is a centred column, so
 * half the viewport out from its own centre lands exactly on each viewport edge,
 * whatever the column's width. It stays position:absolute and therefore SCROLLS
 * WITH THE CONTENT — position:fixed would also have reached the edges, but it
 * would then hang at the top of the screen while you read the tech table below,
 * washing content it has nothing to do with.
 *
 * This only works because the scroller moved to the backdrop above. Left on the
 * box, overflow-y:auto would compute overflow-x to auto as well and clip the
 * sideways bleed (and raise a horizontal scrollbar).
 *
 * The negative top clears the sticky head so the wash starts at the true top of
 * the viewport: 12px of head padding + the 34px ✕. Bottom is untouched — still
 * the normal downward fade. */
.modal.is-card .card-frame::before {
  /* Was a -46px literal. Same number, now the token the sticky wave also reads
     (v0.2.43) — the comment above has warned since v0.2.11 that this figure and
     the head's height have to move together, and a third copy was one edit away
     from proving it. */
  top: calc(-1 * var(--card-head-h));
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
}

/* THE STICKY WAVE CLEARS THE ✕ ROW (v0.2.43).
   ⚠️ The one place the pin is NOT --card-side from the top, and deliberately.
   The head below is sticky at top:0 and 46px tall, so a wave pinned at 16px
   would slide straight under it: ✕ would sit on the waveform's top-right corner
   — over the loudness readout — and the box would cover the only pointer way
   out of a modal that has no backdrop-dismiss. Reachability wins over an exact
   16px, so the wave pins 16px below the chrome instead of 16px below the
   viewport edge. Set on .card-frame rather than the box because that is the
   element the wave inherits from. One line to change if the gap reads wrong. */
.modal.is-card .card-frame { --wave-pin-top: calc(var(--card-side) + var(--card-head-h)); }

/* Sticky and above the wash. Two jobs: backdrop-dismiss is gone (the box covers
   the backdrop), so ✕ is the only pointer way out and must stay reachable however
   far a tall card scrolls; and the vignette's negative top reaches up behind this
   row, so it needs a z-index or the wash would paint over the button. Same
   pattern .modal.wide already uses. Background stays transparent, so the tint
   shows through behind ✕ rather than boxing it in.

   ⚠️ Its height is load-bearing: 12px padding + the 34px ✕ = the 46px the
   vignette above reaches up by. Change one, change the other. */
.modal.is-card .modal-head {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  margin-bottom: 0;
  padding: 12px var(--card-side) 0;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-field);
  overflow-wrap: anywhere;
}

/* The A/B/C/D player (waveform + four slots + switches) needs more room than the
   default box. Still capped to the viewport so it fits a phone. */
.modal.wide { max-width: 640px; max-width: min(640px, calc(100vw - 32px)); position: relative; }

/* Title-less (the player prints its own): the head must reserve no height at all,
   or the ✕ row plus its margin pushes the player's title down and leaves a dead
   band at the top. Floating ✕ into the corner takes it out of flow, collapsing
   the head to nothing. It sits top-right, the player title top-left — no clash. */
/* sticky, not static: the head has zero height (✕ is out of flow), and because a
   sticky box is a positioned ancestor the absolutely-placed ✕ sticks with it —
   so it stays reachable when the modal scrolls at max-height:85vh. */
.modal.wide .modal-head { margin-bottom: 0; position: sticky; top: 0; z-index: var(--z-sticky); }
.modal.wide .modal-close { position: absolute; top: 12px; right: 12px; margin: 0; z-index: var(--z-sticky); }

/* The floated ✕ is out of flow, so a long blindtest name would wrap straight
   underneath it. Keep the title clear of the button's 34px + 12px inset. The
   playlist header's right-aligned total runs into it for the same reason —
   padded on the row, since it is the total that sits under the button. Scoped to
   the modal: playlist.html shows the same player with no ✕ to avoid. */
.modal.wide .bt-title { padding-right: 52px; }
.modal.wide .pl-head { padding-right: 52px; }

/* --- .wide AND .is-card together (v0.2.17) ----------------------------------
   The blind test and sequence modals now open with BOTH: .wide for the roomier
   player it always needed, .is-card for the reframe every card gets. The two
   disagree on exactly one thing and it has to be settled explicitly, because
   .modal.wide is declared AFTER .modal.is-card at equal specificity and would
   otherwise win: .wide caps the box at 640px, .is-card wants it full-bleed. The
   cap is what .wide was for before the box became the full-width scroller, so
   full-bleed is the one that survives — the 560px reading column now lives on
   .card-frame, which is where the width actually needs to be honoured.

   The head padding is restored for the same source-order reason: .wide's head
   rule lands after .is-card's and drops its side padding, which would put ✕ hard
   against the viewport edge on a full-bleed card. */
.modal.is-card.wide { max-width: none; }
.modal.is-card.wide .modal-head { padding: 12px var(--card-side) 0; }

/* margin-left:auto keeps ✕ at the right when the title is hidden (the blindtest
   player prints its own). With a title present it is a no-op — the title's
   flex:1 1 auto has already taken the slack. :only-child can't be used: the
   hidden title is display:none but still a DOM child. */
.modal-close { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; font-size: var(--text-meta); margin-left: auto; }

.modal-body { display: flex; flex-direction: column; gap: 12px; }

/* ★★★ THE APPENDED CARD FILLS ITS COLUMN (v0.2.147). One declaration, no new
   values — .card-frame's own --card-max (560) and --card-side (16) were always
   right here; the frame simply stopped receiving them.

   ⚠️⚠️ AN AUTO CROSS-AXIS MARGIN CANCELS align-items:stretch. .modal-body is a
   flex COLUMN, so width is the cross axis, and .card-frame carries margin:0 auto
   (css/tokens.css) to centre itself. On a flex item those auto margins absorb the
   free space INSTEAD of stretching, so the frame fell back to shrink-to-fit and
   sized itself to its widest child: 256px at a 1280px viewport against the play
   card's 560, and 238px at 390. Measured margin was `0px 512px` — the whole
   surplus eaten by the margins.
   ★ That is also the phone "settles wider" bug, and it is the same line: a
   max-content box re-measures on EVERY post-mount content change. The blind test
   mounts busy with an empty notes line, writes it when the decode finishes, and
   rewrites it on every switch — so the card jumped wider each time. A longer
   blind test NAME moved it 304px on its own.

   ★★ WHY width:100% AND NOT the alternatives. It restates the cross size the
   item should have had, which takes it out of shrink-to-fit; max-width then caps
   it at --card-max and the auto margins go back to doing what they were written
   for — centring the surplus. Zeroing the margins also fills, but the item then
   aligns flex-start and the card sits LEFT of centre once the cap bites;
   align-self:stretch does nothing at all, because auto margins outrank it by
   spec. One property, and the centring stays where it is declared.

   ★★★ IT MUST NOT MATCH THE PLAY CARD, and the child combinator is what keeps it
   out. mountPlayCard puts card-frame ON the container, so there the frame IS
   .modal-body — a block-level box in .modal, never a flex item, which is why that
   card was always correct. mountBlindtestPlayer / mountPlaylistPlayer APPEND a
   card-frame child instead, and only that shape is selected here. Putting the
   class on the container for all three is the right end-state; it belongs to the
   player rebuild, not to a width fix. Measured by scripts/cardwidth-check.mjs. */
.modal.is-card .modal-body > .card-frame { width: 100%; }

/* ★ A WRAPPING ROW OF GROUPS (v0.3.0). The Details facts line is timing and
   file sizes; each group is nowrap, so a break can only land BETWEEN them and
   never inside "104.6 MB". The column-gap is the separator — it does the work a
   "·" would, and unlike a "·" it vanishes when the row wraps instead of being
   left stranded at the end of a line. */
/* ★ THE LIVE ECHO under the Mix date field. Quiet, because it is a
   confirmation and not a message — and its ABSENCE is the error state, so it
   must not leave a hole when it goes: min-height reserves the line so the
   fields below do not jump as you type. */
.meta-echo {
  min-height: 1.2em;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: var(--text-row-artist);
  color: var(--text-dim);
}

.modal-facts { display: flex; flex-wrap: wrap; column-gap: var(--facts-gap); row-gap: 2px; }
.modal-facts .facts-group { white-space: nowrap; }

.modal-facts,
.modal-empty { font-size: var(--text-meta); }    /* colour + tabular-nums: .u-figure */

/* --- Small screens --- */

@media (max-width: 600px) {
  /* Only the two values the scale does NOT hold: this row's horizontal inset
     and its bottom. The top and the gap come from --sp-page-top and --sp-stack,
     overridden with the rest of the scale in css/tokens.css. */
  main { padding: var(--sp-page-top) 14px 64px; }
  .masthead h1 { font-size: var(--text-head); letter-spacing: var(--tracking); }
  .login-form { gap: 10px; }
  /* .panel's mobile padding moved to the scale (--sp-panel-y / --panel-x). */
  /* 16px, not 32px — keeps the idle box from growing taller than the busy one. */
  .dropzone { padding: 16px 14px; }
  /* padding stays on --lib-row-pad at every width — only the column gap tightens */
  .library-row { gap: 8px; }
  .library-name { font-size: var(--text-ui); }
  .select-bar button { flex: 1 1 auto; }
  .modal-backdrop { padding: 12px; }
  /* ...but never for the card, which is full bleed at every width. Both of
     these would otherwise put the inset frame straight back on a phone, which
     is the one size where edge-to-edge matters most. */
  .modal-backdrop:has(> .modal.is-card) { padding: 0; }
  .modal { padding: 16px 14px; }
  /* The BOX stays unpadded at every width (v0.2.11) — the gutter lives on the
     card now, and it is the token at every width because it is the frame, which
     is meant to be identical in both hosts. */
  .modal.is-card { padding: 0; }
}

/* --- Share stats modal (v0.2.24, prototype) ---------------------------------
   Reuses .loudness-table's grid so the four figures line up like every other
   table in the app; only the actions row is new. Deliberately plain — this is a
   prototype surface and the numbers are the point. */
.stats-table th { text-align: left; font-weight: normal; padding-right: 18px; }
.stats-table td { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.stats-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* --- Tagged-share suggestion chips (v0.2.37) --------------------------------
   The names this owner has tagged before, offered as a tap rather than a retype.
   Wraps rather than scrolls: a long history should get taller, not hide itself
   behind a horizontal gesture nobody knows is there. */
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 4px;
}
.tag-chip {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: var(--text-meta);
  text-transform: none;
  letter-spacing: normal;
  padding: 4px 10px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--panel-border);
}
.tag-chip:hover { color: var(--text); border-color: var(--accent); opacity: 1; }

/* --- A read-only field with its copy control inside it (v0.2.40) ------------
   The link the tagged-share modal hands you. The action belongs ON the field
   rather than beside it: the field is what you are looking at, and a separate
   button made "which one do I press" a question. Same shape as every code
   host's clone-URL box. */
.copy-field { position: relative; display: block; }
.copy-field input {
  width: 100%;
  /* Room for the button, reserved always, so the text never reflows when the
     glyph swaps to a tick. */
  padding-right: 40px;
}
.copy-field-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--icon);
  cursor: pointer;
}
.copy-field-btn svg { width: 16px; height: 16px; display: block; }
.copy-field-btn:hover { color: var(--accent); opacity: 1; }

/* --- Queue position badge (v0.2.41) -----------------------------------------
   NEXT / Q2 / Q3… on a library row that is waiting in the play queue. White
   reversed out of the neutral grey the type badges used to wear — a filled
   panel rather than the outline the "Reference" badge carries, because this is
   a position rather than a caveat and should read at a glance down a list.

   U57 Roman Condensed at the plays-count size: the same size as the other trailing
   metadata, one weight heavier so a two-character token still reads. Both
   inherited from existing tokens rather than new numbers. */
.row-qbadge {
  flex: 0 0 auto;
  font-family: var(--font-row-name);
  font-size: var(--text-row-artist);
  line-height: 1;
  letter-spacing: var(--tracking);
  color: #ffffff;
  background: var(--type-mix);
  border-radius: var(--qbadge-radius);
  padding: 3px 5px 2px;
  white-space: nowrap;
  /* Nudged to sit on the title's optical centre rather than its baseline — a
     filled panel aligns to the text block, not to the letterforms' feet. */
  position: relative;
  top: -1px;
}


/* --- ACTING AS ANOTHER USER (v0.2.50) ----------------------------------------

   ★ ONE TOKEN, EVERYTHING FOLLOWS. --accent is what the whole app is drawn from
   — the play cursor, the now-playing title, the filter chips, the switches, the
   focus rings — so remapping it here turns every one of them cyan without a
   single component knowing this mode exists. Anything added later inherits the
   behaviour for free, which is the property that matters: a new yellow control
   cannot forget to change colour.

   Set on <html> rather than <body> so it also covers the fixed bar below and
   anything portalled to the end of the document.

   --accent-text is deliberately NOT remapped: it is the near-black that sits ON
   the accent, and it reads correctly on cyan as well as on yellow. */
html.impersonating {
  --accent: var(--impersonation-accent);
}

/* The bar. Fixed, full width, above everything — it has to survive scrolling,
   because "am I still acting as someone?" is a question you ask at the bottom of
   a long library. --z-toast so a modal cannot cover it: a modal is exactly where
   an impersonated write gets made. */
.imp-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--impersonation-accent);
  color: #06232a;
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: var(--tracking);
  font-size: var(--text-fine);
}
.imp-bar-label { overflow-wrap: anywhere; }
.imp-bar-exit {
  flex: 0 0 auto;
  background: #06232a;
  color: var(--impersonation-accent);
  border: 1px solid #06232a;
  border-radius: var(--btn-radius);
  padding: 3px 12px;
  font-family: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  font-size: inherit;
  cursor: pointer;
}
.imp-bar-exit:hover { opacity: 0.85; }

/* The bar is fixed, so the page has to give up its height or the masthead sits
   underneath it. Applied to <main> rather than <body> so the login view — which
   can never be impersonating — is untouched either way. */
html.impersonating main { padding-top: 56px; }

/* --- the lookup modal --- */

.imp-search { display: flex; gap: 8px; }
.imp-search input { flex: 1 1 auto; min-width: 0; }
.imp-search button { flex: 0 0 auto; }

.imp-card { display: flex; flex-direction: column; gap: 14px; }
.imp-card-head { display: flex; align-items: center; gap: 12px; }
.imp-avatar {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--panel-border);
  color: var(--text);
  font-family: var(--font-title);
  font-size: var(--text-field);
}
.imp-who { min-width: 0; }
.imp-nick { font-size: var(--text-field); overflow-wrap: anywhere; }
.imp-email { font-size: var(--text-meta); color: var(--text-dim); overflow-wrap: anywhere; }

.imp-fields { display: flex; flex-direction: column; }
.imp-field {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: var(--text-meta);
}
.imp-field-key { color: var(--text-dim); flex: 0 0 auto; }
.imp-field-val { text-align: right; overflow-wrap: anywhere; min-width: 0; }

/* Cyan BEFORE you are impersonating, on purpose: it is the colour the app is
   about to become, so the button is a preview of the state it commits you to. */
.imp-go {
  width: 100%;
  background: var(--impersonation-accent);
  color: #06232a;
  border: 1px solid var(--impersonation-accent);
  border-radius: var(--btn-radius);
  padding: 12px;
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: var(--tracking);
  cursor: pointer;
}
.imp-go:hover { opacity: 0.9; }

.imp-note { font-size: var(--text-fine); color: var(--text-dim); }


/* --- FOREIGN SHARES (v0.2.52, slice 1) ---------------------------------------

   A row that is in your library but is not yours. PALE rather than tinted or
   badged in colour: it has to read as present-but-secondary at a glance down a
   list, and every other signal on this row is already spoken for — the type word
   says "Share", the avatar says whose it is, and the accent is the now-playing
   state, which a foreign row must be able to enter like any other.

   Opacity on the ROW, not colour on the text, so the artwork, the avatar and the
   duration all recede together. The now-playing yellow still overrides it
   because that rule sets its own colour on the title. */
/* ★ THE SUBTITLE NAME, AS A SEARCH LINK.
   A <button> reset back to the type it sits inside, so the subtitle still reads
   as one line.

   ⚠️ NO RESTING AFFORDANCE — and the reason CHANGED. v0.2.97 kept it hover-only
   so a real credit and an owner-nickname fallback stayed indistinguishable at
   rest; the nickname build made every displayed name a link, so that distinction
   is gone. It stays hover-only because EVERY row now carries one: an underline
   at rest on every subtitle in a long library is noise, and the name is still
   primarily information with the link secondary. Which is how a streaming app
   treats an artist line — conventional now, rather than a workaround. */
/* ⚠️ THE `font: inherit` TRAP — v0.2.97 fell into it, and it was already
   documented at .signout twenty rules up.

   The base button rule (css/tokens.css) sets FOUR typographic properties:

       font-family: var(--font-title);      text-transform: uppercase;
       letter-spacing: var(--tracking);     font-size: var(--text-ui);

   `font: inherit` is a shorthand for font-family / size / style / weight /
   stretch / variant / line-height — and NOTHING ELSE. text-transform,
   letter-spacing and word-spacing are not font properties at all, so they sail
   straight through it. v0.2.97 caught letter-spacing and missed text-transform,
   which is why every real credit rendered as "MOI, C'EST MORT" while every
   fallback nickname beside it stayed in sentence case.

   ★ EVERY ONE OF THESE IS `inherit`, NOT a hand-picked `none`/`normal`. The
   requirement is not "no uppercase", it is "typographically identical to the
   text it sits inside" — so it takes whatever .row-artist has, and follows it if
   that ever changes. A literal here would be a second copy of the subtitle's
   typography, waiting to disagree with the first. */
.row-artist-link {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  text-decoration: inherit;
  cursor: pointer;
  /* The subtitle is ellipsised as a whole; the button must not open its own
     scroll context or force the line to wrap. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.row-artist-link:hover { color: var(--text); text-decoration: underline; }
.row-artist-link:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.library-row.row-foreign { opacity: 0.78; }
.library-row.row-foreign:hover { opacity: 1; }

/* The disabled share button keeps its slot so the row's controls stay aligned
   with the mixes above it — a bookmark one control narrower would read as a
   rendering fault rather than as a restriction. */
.library-row.row-foreign .icon-btn:disabled { opacity: 0.3; cursor: default; }

/* The slice-1 debug entry's styling went with the button in v0.2.59. */
.foreign-out { min-height: 1em; }
.foreign-card { display: flex; flex-direction: column; gap: 10px; }


/* The dead-bookmark row is GONE from v0.2.58 — dimmed "unavailable" was a
   tombstone that could never recover, because revoking a link is permanent. The
   row is removed on the load sync instead, with a one-time notice. The rules
   that dimmed it are removed with it rather than left to style a class nothing
   applies. */


/* --- Regenerate share link (v0.2.57) ----------------------------------------
   The warning leads and is the only thing in the box drawn in --danger: it is
   the irreversible half, and the reassurance under it deliberately is not, so
   the two do not shout at each other. */
.regen-warn {
  color: var(--danger);
  font-size: var(--text-ui);
  overflow-wrap: anywhere;
}
/* Cancel sits first in the DOM (keyboard order) and the destructive button
   sits right, where the eye lands last. */
.regen-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.regen-actions button { flex: 0 0 auto; }


/* --- Paste a share link into the search bar (v0.2.59) ------------------------
   The offer sits UNDER the field rather than inside it: on a phone an inline
   chip would squeeze an input that is already the narrowest control on the page,
   and the message beside it can be a whole sentence when a guard refuses. */
.library-search-wrap.has-import { padding-bottom: 8px; }
.import-offer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.import-offer[hidden] { display: none; }
.import-go {
  flex: 0 0 auto;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: var(--btn-radius);
  padding: 7px 12px;
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: var(--tracking);
  font-size: var(--text-fine);
  cursor: pointer;
}
.import-go:disabled { opacity: var(--disabled-opacity); cursor: default; }
.import-msg { font-size: var(--text-meta); color: var(--text-dim); overflow-wrap: anywhere; min-width: 0; }

/* --- Library settings modal (v0.2.64) ---------------------------------------
   Autogroup's filter-bar wrapper retired with the control; the switch reuses the
   app's existing .bt-switch and only needs its rows spacing here. */
.config-list { display: flex; flex-direction: column; gap: 4px; }
.config-row { display: flex; }
.config-switch { align-items: flex-start; }
.config-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.config-label { font-size: var(--text-ui); }
.config-desc { font-size: var(--text-meta); color: var(--text-dim); overflow-wrap: anywhere; }


/* --- Autogroup (v0.2.66) -----------------------------------------------------

   Only reachable under .autogroup-on, so none of this can touch the flat list.

   The head is an ordinary .library-row with two differences: its lead slot holds
   a chevron instead of a heart, and its title is the SONG rather than a version.
   Everything else — height, hover, the type marker, the subtitle — comes from
   the row it already is. */
#libraryList.autogroup-on .ag-head { cursor: pointer; }
#libraryList.autogroup-on .ag-head .library-name { cursor: pointer; }

/* ★★★ THE SPINE (v0.2.87) — the group marker, replacing the disclosure triangle.

   ── ONE DESIGN, TWO DIALS ──────────────────────────────────────────────────
   Option A and Option B are the same thing at two points on one axis, and the
   axis lives entirely in css/tokens.css:

     --group-spine-inset    the spine's distance in from the list's left edge
     --group-child-offset   how far the version rows indent

   Shipping at Option B (both 0): the spine sits hard left in the gutter, LEFT
   of the heart, and the versions stay flush with ordinary rows. Raise both and
   it becomes Option A — spine inward toward the heart column, versions indented
   to meet it — with no code change. Tune them in DevTools on :root.

   ── WHY A PSEUDO-ELEMENT ON THE WRAPPER ────────────────────────────────────
   .ag-group wraps the head AND the body, so ONE box spans exactly what the
   spine must mark. Collapsed, the body has zero height and the spine is the
   head's height; expanded, the body grows and the spine grows with it — on the
   SAME grid-template-rows transition, because it is the same box getting taller.
   Nothing here animates on its own, which is why the line and the reveal can
   never fall out of step.

   ⚠️ CLAMPED AT THE EDGE. max(0px, …) means the inset can only ever move the
   spine RIGHT (inward, into the panel); a negative token cannot push it out
   through the panel's left edge. --group-spine-cap holds its ends clear of the
   rounded corners.

   GROUPS ONLY — this selector cannot match an ordinary row, which is the point:
   the spine IS "this is a group", so a row without one is not one. */
.ag-group { position: relative; }
.ag-group::before {
  content: "";
  position: absolute;
  left: max(0px, var(--group-spine-inset));
  top: var(--group-spine-cap);
  bottom: var(--group-spine-cap);
  width: var(--group-spine-w);
  /* SQUARE ENDS (v0.2.88, Phil). A rounded cap read as a pill rather than a
     structural line. --group-spine-cap is untouched and unrelated: that is the
     TOP/BOTTOM inset holding the line clear of the panel's rounded corners, not
     the line's own corner rounding. */
  /* Its OWN colour token (v0.2.89) — see css/tokens.css. This was var(--accent),
     which made the spine unstylable without repainting every accented thing in
     the app. */
  background: var(--group-spine-color);
  /* The row content sits above it: at inset 0 the spine is in the gutter, but a
     larger inset walks it under the heart, and a line over the controls would
     read as damage rather than structure. */
  z-index: 0;
  pointer-events: none;
}

/* The head's empty lead, where the chevron used to be. Same box, no glyph — the
   versions' hearts and the head's title stay in one column. */
.ag-lead {
  display: flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

/* The count, in the duration slot. Dim, because it is a fact about the row
   rather than a property of the music the way a duration is.

   margin-right holds it off the row's right content edge (v0.2.91). It is the
   head's LAST child since v0.2.90 — the stand-in slots that used to inset it are
   gone — so a margin here is the whole mechanism, and it cannot reach the track
   rows' durations, which sit in front of their own share and ⋯ buttons. */
.ag-head .row-dur {
  color: var(--text-dim);
  margin-right: var(--group-count-inset);
}

/* (The head's two empty .ag-slot stand-ins were retired in v0.2.90 along with
   this rule. They existed to inset the head's count into the duration column;
   the count now sits flush at the row's right margin, so there is nothing to
   stand in for and a rule with no element is worse than none.) */

/* ★ THE COLLAPSIBLE BODY (v0.2.69).
   
   grid-template-rows 0fr -> 1fr animates a height nobody measured. max-height
   needs a guessed ceiling that clips a big group or slows a small one; the Web
   Animations API needs a measure-and-set on every toggle. This needs neither —
   the row is told to take its natural size, and the fraction between 0 and that
   is what animates.
   
   Two elements are required, not decoration: the grid is the outer, and the
   inner is what overflow:hidden clips while the track is short. min-height:0 is
   the part everyone forgets — a grid item's automatic minimum size is its
   content, which would refuse to shrink below it and animate nothing. */
.ag-group-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-group) ease;
}
.ag-group-body > .ag-group-inner { overflow: hidden; min-height: 0; }
.ag-group-body.is-open { grid-template-rows: 1fr; }

/* The whole head is the control now, so it says so to a pointer and to a
   keyboard alike. The name inside it is no longer separately focusable — there
   is one target, which is the point. */
#libraryList.autogroup-on .ag-head:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

/* ★ SETTLE TO INSTANT. Only one transition to cover now: the spine has none of
   its own — it is the wrapper's height, so it stops when the reveal does. */
@media (prefers-reduced-motion: reduce) {
  .ag-group-body { transition: none; }
}

/* The versions' indent — THE SECOND DIAL (v0.2.87).

   Was a hardcoded 22px; it is --group-child-offset now and ships at 0, so the
   versions sit flush with ordinary rows (Option B). Raising it indents them
   toward the spine (Option A). The MECHANISM is what matters here: a zero is a
   chosen point on the axis, not the absence of one, so moving along it is a
   number rather than a build.

   Padding rather than margin, as before, so the row's own hit area still spans
   the full width — a version you can only click on its right-hand nine tenths
   would be a worse row than a flat one. */
#libraryList.autogroup-on .ag-version { padding-left: var(--group-child-offset); }
/* The head's own indent — 0 today, so this changes nothing until the token does.
   padding-left, exactly as the version rows use, so the row's HIT AREA still
   spans the full width and only its contents move (see --group-child-offset's
   note). ⚠️ The spine does NOT follow this: see --group-head-inset. */
#libraryList.autogroup-on .ag-head { padding-left: var(--group-head-inset); }


/* --- Excerpt (v0.2.70) -------------------------------------------------------
   A share link carrying ?start=&end= plays only that region. The badge is
   computed from the link on every render — nothing about it is stored. */
.excerpt-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: var(--qbadge-radius);
  background: var(--type-mix);
  color: #ffffff;
  font-family: var(--font-row-name);
  font-size: var(--text-row-artist);
  letter-spacing: var(--tracking);
  text-transform: none;
}

/* ★ THE OUT-OF-REGION WAVE IS CLIPPED, NOT COVERED (v0.2.74).

   There is deliberately no rule here. v0.2.72 blanked the non-region with two
   opaque .excerpt-mask divs at z-index var(--z-raised) — which is 2, and so is
   the z-index wavesurfer puts on the .wrapper inside its shadow root. An exact
   tie, resolved only by document order, which made "does the mask cover the
   wave" a coincidence of append order rather than something the stylesheet
   said. The masks are gone; js/playcard.js sets clip-path on .wave instead, so
   the pixels outside [start,end] are never painted and no stacking is involved.

   What shows through the clip is .wave-wrap, which carries the same --input-bg
   the wave does — so the clipped part reads as empty track, not as a hole. That
   equality is load-bearing: if either background moves, move both. */

/* ── THE EXCERPT PICKER (v0.2.76, js/excerptpick.js) ────────────────────────

   The OWNER's side, and the visual inverse of the clip above: the full wave is
   drawn and the selection is expressed on top of it, because you cannot choose
   a passage you cannot see.

   ★ --z-overlay (3), NOT --z-raised (2). wavesurfer's shadow .wrapper carries
   z-index 2 and so does --z-raised — the exact tie that made the retired
   excerpt masks depend on document order to cover anything. The handles have to
   take pointer events over the canvas, so they sit a layer clear of it and the
   question never arises. */
.pick-layer {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay);
  /* The layer is inert; only the handles below opt back in. A click anywhere
     else must reach the wave, which is how "click inside the region to hear the
     tail from there" keeps working. */
  pointer-events: none;
}

/* ★★ THE ACCENT PROGRESS, BOUNDED TO THE SELECTION (v0.2.78).

   wavesurfer draws the played part of the wave in progressColor inside a
   .progress element that is a WINDOW — width = the playhead fraction, overflow
   hidden — over a child canvas drawn at FULL TRACK WIDTH. Through it you see
   track [0, playhead], which knows nothing about the region handles: a rewind
   painted the whole non-region yellow and left the selection plain.

   v0.2.77 answered that by removing the accent altogether while picking, which
   over-corrected — the played part INSIDE the region should read exactly as it
   does on an ordinary card. So the accent is back, bounded by this clip.

   The recipient's card gets it free, because it clips the WHOLE wave to the
   region. The picker deliberately shows the full unclipped wave — you cannot
   choose what you cannot see — so the accent layer is bounded on its own.

   ⚠️ THE INSETS ARE IN THE PROGRESS BOX'S OWN SPACE, NOT THE TRACK'S. clip-path
   percentages resolve against the clipped element's own box, and that box is
   only playhead-wide. v0.2.77's first attempt fed it track-space values, which
   landed nowhere near the region and did nothing on glass — while passing a
   probe that read the clip back as track-space, so fix and test were wrong
   together. With P the playhead and S the region start as track fractions, the
   region start sits at S/P across the box; js/playcard.js computes that and
   publishes it here, repainting on every playhead move.

   The 100% default matters: before anything is played there must be no accent
   at all, and an unset variable must fail CLOSED rather than reveal the lot.

   Scoped to .picking, so the ordinary player and the recipient view are
   untouched — and custom properties inherit through the shadow boundary, which
   is what lets a page stylesheet drive ::part(progress) at all. */
.wave-wrap.picking .wave > *::part(progress) {
  clip-path: inset(0 var(--pick-prog-right, 0%) 0 var(--pick-prog-left, 100%));
}

/* ★★★ ...AND THE BASE WAVE MUST BE PUT BACK UNDER IT (v0.2.80).
 *
 * THE BUG THIS FIXES, and it was mine: dragging the left handle blanked
 * [0 -> region-start] outright instead of leaving it dimmed. Reported on desktop
 * and mobile, and it was neither — it was every platform, because it is
 * geometry, not input.
 *
 * ⚠️ THE MECHANISM. wavesurfer's played colour is NOT an overlay on the wave.
 * The two are COMPLEMENTARY HALVES — renderProgress does, verbatim:
 *
 *     canvasWrapper.style.clipPath = `polygon(${i}% 0%, 100% 0%, 100% 100%, ${i}% 100%)`
 *     progressWrapper.style.width  = `${i}%`
 *
 * i.e. it CLIPS THE BASE WAVE AWAY across [0, playhead] and paints the accent
 * copy there instead. Seamless, until something clips the accent copy too.
 *
 * v0.2.78 did exactly that — bounding the accent to the region — and so [0,
 * region-start] ended up with NEITHER half: the base clipped away by wavesurfer,
 * the accent clipped away by us. A hole, not a dim. It only showed once the
 * playhead was past 0, which is why entry looked right and the first drag did
 * not.
 *
 * So picker mode cancels wavesurfer's base clip. The base wave is then drawn
 * across the WHOLE track — which is what the picker wants anyway, you cannot
 * choose what you cannot see — and the accent silhouette sits on top of it,
 * still bounded to [region-start -> playhead].
 *
 * !important is required, not decorative: wavesurfer rewrites that clipPath as
 * an INLINE style on every single progress tick, and an inline style beats an
 * ordinary ::part rule. Scoped to .picking, so the recipient view and the
 * ordinary player keep the complementary behaviour exactly as they are. */
.wave-wrap.picking .wave > *::part(canvases) {
  clip-path: none !important;
}

/* The shoulders. TRANSLUCENT, deliberately — the point of drawing the whole
   wave is that you can still read what you are leaving out. */
.pick-dim {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--input-bg);
  opacity: 0.62;
}
.pick-dim-a { left: 0; }
.pick-dim-b { right: 0; }

/* The selection itself: EDGES ONLY, no fill.
   A translucent accent wash over the band was tried and removed — it tinted the
   waveform olive and made the selected audio the hardest part of the picture to
   read, which is backwards. The shoulders are dimmed instead, so the brightest,
   truest region on screen is the one being chosen. */
.pick-band {
  position: absolute;
  top: 0;
  bottom: 0;
  /* ★ THE WAVE'S accent, not the app's (v0.2.96). js/playcard.js publishes
     --wave-accent on .wave-wrap so these layers match the canvas underneath
     them — a canvas cannot read a custom property, and CSS cannot read the
     string wavesurfer was built with, so that one assignment is the bridge.
     Falls back to --accent for any card that never set it. */
  border-left: 1px solid var(--wave-accent, var(--accent));
  border-right: 1px solid var(--wave-accent, var(--accent));
}

/* Grab targets. Wide enough for a finger and centred on the edge they move, so
   the line under the cursor is the line that follows it. */
.pick-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  margin-left: -11px;
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;          /* the drag is ours; do not scroll the page */
  background: transparent;
}
/* The visible grip is an inset bar, so the target can be finger-sized without
   a 22px slab of colour sitting on the waveform. */
.pick-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--wave-accent, var(--accent));
}
.pick-handle:focus-visible::after,
.pick-handle.is-dragging::after { width: 5px; margin-left: -2.5px; }

/* The owner's action row. Hidden entirely until there is a picker to offer. */
.pick-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
/* ⚠️ THE PICK BAR HAS NO BUTTONS LEFT, and its rules went with them. `.pick-open`
   ("Set an excerpt…") went in v0.2.160 to the scissors; `.pick-action` /
   `.pick-share` (PREVIEW, DONE, SHARE CLIP) went in v0.2.170 and v0.2.172 to the
   play button, the scissors, and the row's own share icon. Each selector is
   dropped rather than left as a dead ride-along, on the same reasoning every
   time: a rule matching nothing is how the next person concludes the button
   still exists. The bar is now the in/out readout and nothing else. */
/* ★★ THE CLIP'S IN AND OUT (v0.2.170). The VALUES are `.dataline-data` — U57,
   white — which is the app's existing treatment for a figure meant to be read,
   borrowed rather than restated so a change to that face moves both. Only the
   punctuation between them is dim, and only the size is set here: the class
   deliberately sets face and colour and nothing else.
   ⚠️ NO `margin-left: auto` ANY MORE. It pushed the range to the far end of a
   row that had three buttons in it; with Preview and Done gone the times are the
   row's subject, so they lead it. */
.pick-range { font-size: var(--clip-range-size); letter-spacing: var(--tracking); }
.pick-range-sep { color: var(--text-dim); padding: 0 2px; }

/* --- THE LUFS METERS ---------------------------------------------------------

   Four readings over the waveform: a translucent black rectangle carrying a big
   white number, a dimmed unit beside it and a dimmed subtitle beneath. Every
   dimension and position comes from an absolute variable in css/tokens.css; not
   one of them is computed from another, and there is no font metric anywhere.

   ⚠️⚠️ THE WHOLE OVERLAY IS INERT. What it covers is the SEEK SURFACE — a tap or
   a drag on the waveform is how you scrub — so anything here that swallowed a
   pointer would create a dead patch exactly where the numbers are, and it would
   read as a broken waveform rather than a broken overlay.

   ⚠️ NO @media RULES, NO PADDING, NO FLEX. Every text run is absolutely
   positioned from the box's own centre, so nothing's size or position can affect
   anything else's, and the layout is identical at every width. Boxes are allowed
   to overlap on a narrow screen. */
.meter-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
}

/* The box. Centred on its anchor BOTH ways, so changing --meter-box-width grows
   it symmetrically about the decimal line and changing the height grows it about
   the horizon — which is what makes every offset below independent of the box's
   size. */
.meter {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--meter-box-width);
  height: var(--meter-box-height);
}

.meter-1 { left: var(--meter-anchor-1); }
.meter-2 { left: var(--meter-anchor-2); }
.meter-3 { left: var(--meter-anchor-3); }
.meter-4 { left: var(--meter-anchor-4); }

/* The fill, as its own layer.
   ⚠️ THE OPACITY IS ON THIS PSEUDO-ELEMENT, NEVER ON .meter — `opacity` fades a
   whole subtree, so putting it on the box would dim the white number with it and
   undo the legibility the box exists for. Here it dims the rectangle alone, and
   the two variables stay exactly what their names say. */
.meter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--meter-box-colour);
  opacity: var(--meter-box-opacity);
}

/* ★★ EVERY TEXT RUN IS PLACED BY ITS BASELINE, WITHOUT A SINGLE FONT CONSTANT.
   
   `line-height: 0` collapses the line box to nothing, so the span's own top edge
   IS its baseline — measured, at 18px and at 9px alike: both report height 0 and
   a top exactly on the requested y. That is what lets the number and the unit
   share a baseline by setting their two offsets to the same number, at any pair
   of sizes, with no ascent/descent ratio written down anywhere.
   
   white-space: nowrap because a wrapped reading is a broken reading. */
.meter-int,
.meter-frac,
.meter-unit,
.meter-subtitle {
  position: absolute;
  line-height: 0;
  white-space: nowrap;
  font-family: var(--font-title);
  /* Fixed-width figures, so a changing value cannot make the digits jitter. */
  font-variant-numeric: tabular-nums;
}

/* ★★ THE DECIMAL POINT SITS ON THE BOX'S CENTRE LINE, and it cannot drift.
   The integer is right-aligned TO the centre and the fraction starts FROM it, so
   a wider integer grows leftward and the point itself never moves — no measured
   glyph widths, no arithmetic, just two edges meeting on 50%. */
.meter-int,
.meter-frac {
  top: calc(50% + var(--meter-large-baseline-offset));
  font-size: var(--meter-large-fontsize);
  color: var(--meter-large-colour);
}

.meter-int  { right: 50%; }
.meter-frac { left: 50%; }

/* Beside the number, at a fixed distance right of the centre line — so it stays
   put whatever the digits do. */
.meter-unit {
  left: calc(50% + var(--meter-unit-offset));
  top: calc(50% + var(--meter-unit-baseline-offset));
  font-size: var(--meter-unit-fontsize);
  color: var(--meter-large-colour);
  opacity: var(--meter-unit-dimmed-amount);
}

/* Centred under the number. ⚠️ The sign convention is inverted here on purpose
   (negative = down), so the default -20px puts the baseline 20px BELOW centre. */
.meter-subtitle {
  left: 50%;
  top: calc(50% - var(--meter-subtitle-verticaloffset));
  transform: translateX(-50%);
  font-size: var(--meter-subtitle-fontsize);
  color: var(--meter-large-colour);
  opacity: var(--meter-subtitle-dimmed-amount);
  /* ★ CAPS ARE A PRESENTATION CHOICE, so they live here and the stored string
     stays natural case — "Short Term", not "SHORT TERM". A translator writes
     their language's own sentence case and this decides how it is shown; and if
     the caps are ever dropped, no string has to be rewritten.
     ⚠️ NOT applied to .meter-unit: "LUFS" is already an initialism and forcing a
     transform on it would silently capitalise a future unit like dBTP. */
  text-transform: uppercase;
}

/* WHERE IT SHOWS.
   The library's box doubles as the upload dropzone, so the meters appear only
   once it is a player — a STATE, not a width. On a public share the card gates
   them on Expert, using the same idiom every other expert-only control uses. */
.dropzone .meter-overlay { display: none; }
.dropzone.player .meter-overlay { display: block; }
.play-card:not(.is-expert) .meter-overlay { display: none; }

/* ⚠️⚠️ HIDDEN MUST ACTUALLY HIDE, AND WITHOUT THIS IT DID NOT.
   
   `hidden` is only a UA-stylesheet `display: none`, and the rule two lines up —
   `.dropzone.player .meter-overlay`, specificity (0,3,0) — outranks both it and
   a plain `.meter-overlay[hidden]` (0,2,0). So js/loudmeter.js setting
   overlay.hidden = true when a track has no sidecar changed nothing: the box
   stayed on screen still showing the build-time dummy readings, which is exactly
   what was reported from the live player.
   
   MEASURED, not reasoned: with hidden set, the computed display was `block`, the
   element had height, and .meter-1 still read "-18".
   
   !important rather than a more specific selector because the statement is
   "hidden wins, always" — a third show-rule added later must not quietly
   reintroduce this. The welcome overlay hit the same trap in v0.2.117. */
.meter-overlay[hidden] { display: none !important; }

/* ★ "Show large metric boxes", default OFF (v0.2.140).
   ⚠️ !important FOR THE SAME REASON THE [hidden] GUARD ABOVE HAS IT: the show
   rules are .dropzone.player .meter-overlay (0,3,0) and this is (0,2,0), so a
   plainer rule would lose and the switch would appear not to work. The statement
   being made is "hidden wins, always", which is exactly what !important says.
   ⚠️ VISIBILITY ONLY — js/loudmeter.js keeps calculating, because the data line
   reads the same values. */
html.meter-boxes-off .meter-overlay { display: none !important; }
