/* Shared stylesheet. Tokens verbatim from the approved mockup "Audary Landing v5 Dark"
   (web/CLAUDE.md); --stem-vocals changed by the owner (decisions.md 2026-09-29). Bootstrap 5 in its
   dark colour mode is pointed at the tokens; the rules after that exist only where Bootstrap has no
   equivalent. Reference mockup: web/design/landing-v5-dark.html (never served). */

@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans/InstrumentSans-Variable.woff2') format('woff2');
  font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('../fonts/geist-mono/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900; font-display: swap; }

:root {
  --bg:#1D1E21; --band:#232528; --surface:#2A2C30; --surface-2:#313438;
  --border:#3A3D42; --border-strong:#4C5057;
  --text:#ECECEC; --text-dim:#C6C8CC; --muted:#9A9DA3; --faint:#8E9197;
  --accent:#E8A33D; --accent-ink:#1A1206; --accent-soft:rgba(232,163,61,.14);
  --danger:#E8654A;
  --stem-vocals:#C9D86F; --stem-drums:#6FB3E8; --stem-bass:#9C8CF0;
  --stem-guitar:#6FD8A8; --stem-piano:#E87FA8; --stem-other:#A4A9B0;
  --shadow:0 20px 50px rgba(0,0,0,.42), 0 2px 8px rgba(0,0,0,.30);
  --r-sm:6px; --r-md:10px; --r-lg:14px;
  --sans:'Instrument Sans',system-ui,sans-serif;
  --mono:'Geist Mono',ui-monospace,monospace;
}

/* ---------------------------------------------------------------- Bootstrap → tokens */

[data-bs-theme=dark] {
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-body-font-family: var(--sans);
  --bs-font-monospace: var(--mono); --bs-emphasis-color: var(--text); --bs-heading-color: var(--text);
  --bs-secondary-color: var(--muted); --bs-tertiary-bg: var(--surface); --bs-secondary-bg: var(--surface-2);
  --bs-border-color: var(--border); --bs-border-radius: var(--r-sm); --bs-border-radius-lg: var(--r-md); --bs-border-radius-xl: var(--r-lg);
  --bs-link-color: var(--accent); --bs-link-color-rgb: 232,163,61; --bs-link-hover-color: var(--text); --bs-link-hover-color-rgb: 236,236,236;
  --bs-danger: var(--danger); --bs-danger-rgb: 232,101,74;
  --bs-form-invalid-color: var(--danger); --bs-form-invalid-border-color: var(--danger);
}
body { -webkit-font-smoothing: antialiased; }
h1, h2 { font-weight: 600; letter-spacing: -0.035em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--border); --bs-card-border-radius: var(--r-lg); }
.form-control, .form-select { background-color: var(--bg); border-color: var(--border-strong); border-radius: var(--r-md); }
.form-control:focus, .form-select:focus { background-color: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }
.btn { --bs-btn-border-radius: var(--r-md); --bs-btn-font-weight: 600; --bs-btn-focus-shadow-rgb: 232,163,61; }
.btn-accent { --bs-btn-bg: var(--accent); --bs-btn-color: var(--accent-ink); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #F0B458; --bs-btn-hover-color: var(--accent-ink); --bs-btn-hover-border-color: #F0B458;
  --bs-btn-active-bg: var(--accent); --bs-btn-active-color: var(--accent-ink); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-color: var(--accent-ink); }
.btn-ghost { --bs-btn-color: var(--text-dim); --bs-btn-border-color: var(--border-strong); --bs-btn-font-weight: 500;
  --bs-btn-hover-color: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-active-color: var(--accent); --bs-btn-active-border-color: var(--accent); }

/* token helpers */
.bg-band { background: var(--band); }
.text-accent { color: var(--accent) !important; }
.text-dim { color: var(--text-dim) !important; }
.text-muted-token { color: var(--muted) !important; }
.text-faint { color: var(--faint) !important; }
.font-mono { font-family: var(--mono); }
.min-w-0 { min-width: 0; }
.eyebrow, .mono-label { font-family: var(--mono); text-transform: uppercase; }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: .14em; color: var(--accent); }
.mono-label { font-size: 11px; letter-spacing: .06em; color: var(--faint); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.c-vocals { --c: var(--stem-vocals); } .c-drums { --c: var(--stem-drums); } .c-bass { --c: var(--stem-bass); }
.c-guitar { --c: var(--stem-guitar); } .c-piano { --c: var(--stem-piano); } .c-other { --c: var(--stem-other); }

/* ---------------------------------------------------------------- header and footer */

.site-header { position: sticky; top: 0; z-index: 30; min-height: 68px; display: flex; align-items: center;
  background: rgba(29,30,33,.9); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.site-header a, .site-footer a { color: var(--text-dim); text-decoration: none; }
.site-header a:hover, .site-footer a:hover { color: var(--accent); }
.brand { display: inline-flex; align-items: flex-end; gap: 9px; color: var(--text) !important; font-size: 19px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.brand-bars { display: flex; align-items: flex-end; gap: 2px; padding-bottom: 3px; }
.brand-bars i { width: 3px; height: 12px; background: var(--text-dim); }
.brand-bars i:first-child { height: 7px; background: var(--muted); }
.brand-bars i:nth-child(3) { height: 16px; background: var(--accent); }
.brand-bars i:last-child { height: 10px; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; font: 11px/1.5 var(--mono); letter-spacing: .08em; }
.lang-switch > * { padding: 5px 9px; }
.lang-switch [aria-current] { background: var(--surface-2); }
/* <details> disclosures: the account menu, the burger, the download menus — no Bootstrap JS */
.menu { position: relative; }
.menu > summary, .burger > summary { list-style: none; cursor: pointer; }
.menu > summary { border: 1px solid var(--border-strong); border-radius: var(--r-md); }
.menu > summary::-webkit-details-marker, .burger > summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.menu > summary { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 12px; color: var(--text-dim); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 12rem; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); }
.menu-panel a, .menu-panel button { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-dim); text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); color: var(--text); }
.menu > summary:hover, .menu[open] > summary { border-color: var(--accent); color: var(--accent); }
/* the burger (below 768 px): a full-width sheet under the header */
.burger > summary { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 44px; height: 44px; margin-right: -10px; padding: 0 13px; }
.burger > summary i { height: 1.5px; background: var(--text); }
.burger-panel { position: absolute; top: 100%; left: 0; right: 0; height: calc(100dvh - 100%); z-index: 50;   /* the header's backdrop-filter makes it the containing block */
  display: flex; flex-direction: column; overflow-y: auto; background: var(--bg); }
.burger-panel > a, .burger-panel > button, .burger-panel form button, .burger-who { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px;
  padding: 0 20px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text) !important; font-size: 16px; text-align: left; }
.burger-who { color: var(--muted) !important; font: 13px var(--mono); }
.burger-panel .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.burger-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; font: 11px var(--mono); color: var(--faint); }
.burger-foot .lang-switch { font-size: 12px; } .burger-foot .lang-switch > * { padding: 10px 14px; }
/* the feedback form: a modal */
/* .card's position: relative would take the dialog out of the viewport's centre — full height, and the
   page scrolling to it (owner, 2026-10-30); fixed and as tall as its content */
.feedback-dialog { position: fixed; height: fit-content; max-height: calc(100dvh - 32px); width: min(520px, calc(100vw - 32px)); color: var(--text); box-shadow: var(--shadow); }
.feedback-dialog:not([open]) { display: none; }   /* .card's display: flex would show it */
.feedback-dialog::backdrop { background: rgba(10,10,12,.62); backdrop-filter: blur(4px); }
.copyright { font: 12px var(--mono); color: var(--faint); }
/* the footer: logo and feedback on one line, the legal links centred under them; from 992 px one line
   with the links centred on the page whatever the widths beside them */
.footer-top { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand fb" "nav nav"; align-items: center; gap: 20px 16px; }
.footer-top > .brand { grid-area: brand; justify-self: start; }
.footer-top > nav { grid-area: nav; }
.footer-top > .feedback-btn { grid-area: fb; }
@media (min-width: 992px) {
  .footer-top { grid-template-columns: 1fr auto 1fr; grid-template-areas: "brand nav fb"; }
  .footer-top > .feedback-btn { justify-self: end; }
}

/* ---------------------------------------------------------------- landing */

.hero h1 { font-size: clamp(2.75rem, 1.4rem + 5vw, 5rem); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.badge-free { display: inline-block; padding: 5px 11px 4px; border: 1px solid var(--border-strong); border-radius: 4px; font: 500 11px var(--mono); letter-spacing: .22em; }
.hero-points { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); column-gap: 40px; }
.hero-points li { padding: 14px 0; border-top: 1px solid var(--border); color: var(--text-dim); }
.hero-points li::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 12px 2px 0; border-radius: 50%; background: var(--accent); }
.wave-row { display: flex; align-items: center; gap: 18px; padding: 9px 0; }
.wave-row .mono-label { width: 54px; flex: none; }
.wave { flex: 1; min-width: 0; height: 26px; color: var(--c); opacity: .8;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.wave .drift { animation: drift var(--speed, 80s) linear infinite; }   /* one path width (500 user units) per loop */
.wave:hover .drift { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(-500px); } }
.h-section { font-size: clamp(1.75rem, 1.1rem + 2vw, 2.5rem); line-height: 1.05; }
.tile { height: 100%; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.stem-rule { display: flex; justify-content: center; gap: 4px; }
.stem-rule i { width: 28px; height: 3px; background: var(--c); }
.seo { position: relative; background: var(--bg) url('../img/overview-studio.jpg') center / cover; }
.seo::before { content: ''; position: absolute; inset: 0; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }   /* the photo a little soft (owner, 2026-10-30) */
.seo > * { position: relative; }
@media (min-width: 992px) { .seo { background-attachment: fixed; } }   /* the image stays put, the block scrolls over it */
.seo .card { --bs-card-bg: rgba(29,30,33,.82); max-width: 820px; }
.faq summary { display: flex; justify-content: space-between; gap: 24px; list-style: none; cursor: pointer; font-size: 18px; font-weight: 600; }
.faq summary::after { content: '+'; font: 22px/1 var(--mono); color: var(--accent); }
.faq details[open] summary::after { content: '−'; }

/* drop zone: one component, four states swapped in place — both states share one grid cell, so
   the box keeps one height and only the error line can move what is below */
.dropzone { display: grid; position: relative; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.dz-idle, .dz-uploading { grid-area: 1 / 1; min-width: 0; }
.dropzone[data-state=uploading] .dz-idle, .dropzone:not([data-state=uploading]) .dz-uploading { visibility: hidden; }
.dz-target::after { content: ''; position: absolute; inset: 0; cursor: pointer; }   /* the whole box is the label */
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-error { border-color: var(--danger); }
.dz-icon { display: flex; align-items: flex-end; gap: 3px; }
.dz-icon i { width: 3px; height: 18px; }
.dz-icon i:nth-child(1) { height: 10px; background: var(--stem-vocals); } .dz-icon i:nth-child(2) { background: var(--stem-drums); }
.dz-icon i:nth-child(3) { height: 24px; background: var(--stem-bass); } .dz-icon i:nth-child(4) { height: 14px; background: var(--stem-guitar); }
.dz-icon i:nth-child(5) { height: 20px; background: var(--stem-piano); }
.dz-error:empty { display: none; }
.dz-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.dz-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }

/* ---------------------------------------------------------------- workspace

   An app screen (owner, 2026-10-29/30): the body is the viewport's height and does not scroll; the
   header, the track bar, the transport, the ruler and the chords stay put and only the master and the
   stems scroll (owner, 2026-11-02). A viewport too short to show three stems that way (a phone on its
   side) scrolls as a page instead. Every timeline row is a mixer head of --head-w and a lane on one time axis. Below
   768 px a row stacks (icon and waveform, then fader and buttons), the transport docks at the bottom
   and the footer's links live in the burger. Mockups: web/design/stem-player-v2.html, stem-player-mobile.html. */

body.app { height: 100vh; height: 100dvh; min-height: 0 !important; overflow: hidden; }
.ws-shell { display: flex; flex-direction: column; min-height: 0; }
.ws { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ws-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ws-main[hidden] { display: none; }
.ws-expired { flex: 1; overflow-y: auto; max-width: 960px; padding: 24px 20px; }

.ws-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 20px; background: var(--band); border-bottom: 1px solid var(--border); }
.ws-name { min-width: 0; max-width: 100%; }
.ws-name h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; letter-spacing: -0.025em; }
.ws-facts { display: flex; align-items: center; gap: 4px 22px; min-width: 0; font: 13px var(--mono); white-space: nowrap; }
.ws-format { padding: 3px 7px; border: 1px solid var(--border-strong); border-radius: 4px; font: 500 10px var(--mono); letter-spacing: .12em; color: var(--muted); }
#tile-duration { font-size: 12px; color: var(--faint); }
.fact-k { margin-right: 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.ws-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ws-actions .btn { white-space: nowrap; }
.dl-all { display: inline-flex; align-items: center; gap: 8px; --bs-btn-bg: var(--accent); --bs-btn-color: var(--accent-ink); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #F0B458; --bs-btn-hover-color: var(--accent-ink); --bs-btn-hover-border-color: #F0B458; }
.ws-status > :not([hidden]) { margin: 10px 20px; }
.ws-message { padding: 16px 20px; border: 1px solid var(--danger); border-radius: var(--r-md); background: var(--surface); }

/* the download menu: cards under section names (Mix, All stems, Chords on phones) — the section is what
   the eye finds first, the card says the format */
.dl-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 300px; padding: 12px; }
.dl-sec, .dl-wide { grid-column: 1 / -1; }
.dl-sec { margin: 6px 0 0; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.dl-sec:first-child { margin-top: 0; }
.dl-panel > a, .dl-panel > button, .dl-panel .premium-lock { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 52px;
  padding: 9px 12px !important; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg);
  font-size: 14px; font-weight: 500; color: var(--text-dim); text-decoration: none; }
.dl-panel > a:hover, .dl-panel > button:hover, .dl-panel .premium-lock:hover { border-color: var(--accent); background: var(--bg); color: var(--text); }
.dl-panel small { font: 400 11px var(--mono); color: var(--faint); }
.menu-panel button:disabled { opacity: .5; pointer-events: none; }

/* transport */
.ws-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.tp-buttons { display: flex; align-items: center; gap: 6px; }
.tp-icon { --bs-btn-padding-x: 0; --bs-btn-padding-y: 0; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; font: 12px var(--mono); }
.pl-play { display: inline-flex; align-items: center; justify-content: center; width: 76px; height: 38px; }   /* the most important button */
.pl-play .i-pause, .pl-play.is-playing .i-play { display: none; }
.pl-play.is-playing .i-pause { display: inline; }
.pl-hint { position: absolute; top: calc(100% + 12px); left: 0; z-index: 25; padding: 10px 16px; border: 1px solid var(--accent); border-radius: var(--r-md);
  background: #3A2E1E; color: var(--accent); font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; }
.tp-clock { display: flex; align-items: baseline; gap: 14px; }
.pl-time { font: 22px var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.tp-label { font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.tp-label b { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--text); }
.tp-chord { gap: 16px; padding-left: 20px; border-left: 1px solid var(--border); }
.tp-chord div { display: flex; flex-direction: column; gap: 2px; min-width: 3.5em; }
#pl-now { font: 26px/1 var(--mono); color: var(--accent); min-height: 1em; }
#pl-next { font: 18px/1 var(--mono); color: var(--text-dim); }
.tp-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tp-note { display: contents; }
.tp-note > span { flex-basis: 100%; }
#pl-note:empty { display: none; }
/* the speed: one control, two options (a radio group) */
.speed { display: flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.speed[hidden] { display: none; }
.speed button { height: 34px; padding: 0 11px; border: 0; background: none; color: var(--text-dim); font: 12px var(--mono); }
.speed button + button { border-left: 1px solid var(--border-strong); }
.speed button[aria-checked=true] { background: var(--accent); color: var(--accent-ink); }
.speed-sm button { height: 24px; padding: 0 8px; font-size: 10px; letter-spacing: 0; }
.speed.is-busy { opacity: .5; }
/* a pressed toggle (Loop, M, S) is filled; an unpressed one never looks pressed — on touch screens the
   hover colours stick after a tap, so they are neutralised there */
.btn[aria-pressed=true] { --bs-btn-color: var(--accent-ink); --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: var(--accent-ink); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-color: var(--accent-ink); --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent); }
@media (hover: none) { .btn-ghost:not([aria-pressed=true]) { --bs-btn-hover-color: var(--text-dim); --bs-btn-hover-border-color: var(--border-strong); --bs-btn-hover-bg: transparent;
  --bs-btn-active-color: var(--text-dim); --bs-btn-active-border-color: var(--border-strong); --bs-btn-active-bg: transparent; } }

/* the timeline rows */
.tl { --head-w: 272px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tl-box { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tl-stems { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.trk { display: grid; grid-template-columns: var(--head-w) minmax(0, 1fr); grid-template-rows: auto auto;
  grid-template-areas: "name lane" "vol lane"; border-bottom: 1px solid var(--border); }
.trk-name { grid-area: name; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 104px 0 16px; }
.trk-ctl { grid-area: name; justify-self: end; display: flex; align-items: center; gap: 4px; padding: 10px 12px 0 0; }
.trk-vol { grid-area: vol; display: flex; align-items: center; gap: 10px; padding: 0 16px 6px 30px; }
.trk-lane { grid-area: lane; position: relative; min-width: 0; height: 76px; border-left: 1px solid var(--border); }
.trk-ruler, .trk-chords { grid-template-areas: "name lane"; grid-template-rows: auto; }
.trk-ruler .trk-name, .trk-chords .trk-name { padding: 0 16px; letter-spacing: .12em; }
.trk-ruler .trk-lane { height: 30px; background: var(--band); cursor: text; touch-action: none; }
.trk-chords { border-bottom: 6px solid #151618; }
.trk-master { border-bottom: 6px solid #151618; }
.trk-master .trk-lane { height: 92px; background: var(--surface); }
.trk-icon { display: none; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lane-wave canvas { display: block; width: 100%; height: 100%; }
.lane-wave { cursor: pointer; touch-action: none; }   /* a click plays from there, a drag loops (player.js) */
@media (pointer: coarse) { .stem-lane .lane-wave { touch-action: pan-y; } }   /* a tablet: a vertical swipe scrolls the rows */
.swatch { flex: none; width: 4px; height: 18px; border-radius: 2px; background: var(--c); }
.lane-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lane-hint { position: absolute; right: 8px; top: 2px; z-index: 2; font-size: 11px; }
.lane-db { flex: none; width: 62px; white-space: nowrap; text-align: right; font: 11px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-ms { --bs-btn-padding-x: 0; --bs-btn-padding-y: 0; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; font-family: var(--mono); }
.pl-dl { --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; --bs-btn-active-border-color: transparent; margin-left: 8px; }
/* the faders: 0 dB at 75 of 100 (+5 dB at the top), marked on the track */
.pl-fader { flex: 1; min-width: 60px; accent-color: var(--accent); }
.pl-fader::-webkit-slider-runnable-track { background: linear-gradient(90deg, transparent calc(75% - 1px), var(--muted) calc(75% - 1px), var(--muted) calc(75% + 1px), transparent calc(75% + 1px)), var(--surface-2); }
.pl-fader::-moz-range-track { background: linear-gradient(90deg, transparent calc(75% - 1px), var(--muted) calc(75% - 1px), var(--muted) calc(75% + 1px), transparent calc(75% + 1px)), var(--surface-2); }
.pl-fader::-webkit-slider-thumb { background: var(--accent); }
.pl-fader::-moz-range-thumb { background: var(--accent); }
/* dragging: a little darker, never Bootstrap's pale blue (owner, 2026-10-30) */
.pl-fader:focus::-webkit-slider-thumb { box-shadow: none; }
.pl-fader:focus::-moz-range-thumb { box-shadow: none; }
.pl-fader::-webkit-slider-thumb:active { background: #B87F2C; }
.pl-fader::-moz-range-thumb:active { background: #B87F2C; }
.pl-fader:disabled::-webkit-slider-thumb { background: var(--border-strong); }
.stem-lane.is-silent .lane-wave canvas { opacity: .35; }
.stem-lane.is-silent .pl-fader { accent-color: var(--muted); }
.stem-lane.is-silent .pl-fader::-webkit-slider-thumb { background: var(--muted); }
.stem-lane.is-silent .pl-fader::-moz-range-thumb { background: var(--muted); }
.stem-lane.is-silent .pl-fader::-webkit-slider-thumb:active { background: var(--faint); }
.stem-lane.is-silent .pl-fader::-moz-range-thumb:active { background: var(--faint); }
/* before the stems: dimmed rows under the card; then a spinner where the controls will appear */
#stem-list:not(.is-ready) .trk { opacity: .45; }
#stem-list:not(.is-ready) .dl-menu { visibility: hidden; }
.stem-lane.is-pending :is(.pl-ms[data-act], .trk-vol > *), .stem-lane.is-off :is(.pl-ms[data-act], .trk-vol > *) { visibility: hidden; }
#stem-list.is-ready .stem-lane.is-pending .trk-ctl { position: relative; }
#stem-list.is-ready .stem-lane.is-pending .trk-ctl::before { content: ''; position: absolute; left: 4px; top: calc(50% + 5px); width: 1rem; height: 1rem; margin-top: -.5rem;
  border: .15em solid var(--muted); border-right-color: transparent; border-radius: 50%; animation: spinner-border .75s linear infinite; }
.stems-wait { position: absolute; top: 100px; left: var(--head-w); right: 0; display: flex; justify-content: center; padding-top: 28px; pointer-events: none; }
.stems-wait[hidden] { display: none; }
.stems-wait-card { width: min(380px, 92%); padding: 20px 26px; border: 1px solid var(--border); border-radius: var(--r-lg); background: rgba(29,30,33,.92); box-shadow: var(--shadow); text-align: center; }
.indeterminate, .eta-bar { height: 3px; overflow: hidden; background: var(--surface-2); }
.eta-bar > div { height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.indeterminate::before { content: ''; display: block; width: 30%; height: 100%; background: var(--accent); animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
/* skeletons: static blocks with a subtle pulse; never a page spinner */
.skeleton { display: block; border-radius: var(--r-sm); background: var(--surface-2); animation: pulse 1.8s ease-in-out infinite; }
.skeleton-center { display: flex; align-items: center; justify-content: center; }   /* not a utility: [hidden] must still win */
@keyframes pulse { 50% { opacity: .55; } }
.dl-menu { position: relative; }
.dl-menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; }
.dl-menu > summary::-webkit-details-marker { display: none; }
.dl-menu .menu-panel { min-width: 10rem; z-index: 25; }

/* the desktop status bar */
.ws-foot { flex: none; align-items: center; gap: 24px; height: 32px; padding: 0 20px; border-top: 1px solid var(--border); font: 11px var(--mono); color: var(--faint); white-space: nowrap; }
.ws-keys { flex: 1; min-width: 0; height: 32px; display: flex; flex-wrap: wrap; gap: 0 22px; margin: 0; overflow: hidden; line-height: 32px; }
.ws-keys kbd { padding: 0; background: none; color: var(--text-dim); font: inherit; }
.ws-foot-sep { width: 1px; height: 14px; background: var(--border); }
.ws-foot nav { display: flex; gap: 16px; font: 12px var(--sans); }
.ws-foot a { color: var(--faint); text-decoration: none; } .ws-foot a:hover { color: var(--text); }
.ws-foot-fb { display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; color: var(--text-dim); font: 12px var(--sans); }
.ws-foot-fb:hover { color: var(--accent); }
.ws-foot-fb .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* the ruler: seconds (bars dropped, owner 2026-10-30) */
#ruler i { position: absolute; top: 0; bottom: 0; padding: 7px 0 0 5px; border-left: 1px solid var(--border-strong); font: normal 10px var(--mono); color: var(--muted); pointer-events: none; }

/* the chord lane: a strip at least --pps px a second, wider than the lane, scrolled by player.js. Desktop:
   the playhead walks the lane at --p like the stems' and the strip runs past it faster (owner, 2026-10-30);
   a short track's strip fills the lane. Phone: the playhead stays at the centre, the strip offset by half
   the lane. Cells at --s, --d seconds, as shares of --total. */
.trk-chords { --pps: 44px; }
.trk-chords .trk-lane { height: 56px; overflow-x: auto; scrollbar-width: none; }
.trk-chords .trk-lane::-webkit-scrollbar { display: none; }
/* sticky offsets ignore the margin: the -1px that centres the 2px line goes into `left` as well */
.chord-head { position: sticky; left: calc(var(--p, 0) * 100% - 1px); top: 0; display: block; width: 2px; height: 100%; margin-top: -56px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 3; }
@media (min-width: 768px) { .chord-head.is-tx { left: -1px; will-change: transform; } }   /* memory-constrained devices: moved by transform (player.js); a phone keeps it centred */
.chord-inner { --total: 1; position: relative; height: 100%; width: max(100%, calc(var(--total) * var(--pps))); }
.chord-inner > .pl-head { display: none; }
.chord-inner > .pl-band { left: calc(var(--b0, 0) / var(--total) * 100%); width: calc((var(--b1, 0) - var(--b0, 0)) / var(--total) * 100%); }
.chord-strip { position: relative; height: 100%; margin: 0; padding: 0; list-style: none; }
.chord-cell { position: absolute; top: 8px; bottom: 8px; left: calc(var(--s) / var(--total) * 100%); width: calc(var(--d) / var(--total) * 100%);
  display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; cursor: pointer;
  font: 13px var(--mono); background: var(--surface-2); border: 1px solid var(--bg); border-radius: 4px; }
.chord-cell.is-x { color: var(--muted); }
.chord-cell.is-n { background: none; border-color: transparent; }
.chord-cell.is-current { background: #4A3820; border-color: #6B5028; color: var(--accent); }   /* darker, not brighter (owner, 2026-10-30) */
.chord-cell.is-n.is-current { background: none; border-color: transparent; }
/* Fit (desktop): the whole track in the lane, no scrolling. A cell too narrow for its name hides it
   (.is-tight, marked by player.js); the current one and the one under the mouse widen over their
   neighbours to show it, leftwards near the right edge (.is-end) — never pushing them off their time. */
@media (min-width: 768px) {
  .trk-chords.is-fit .chord-inner { width: 100%; }
  .trk-chords.is-fit .chord-cell.is-tight { color: transparent; }
  .trk-chords.is-fit .chord-cell:not(.is-n):is(.is-current, :hover) { min-width: max-content; padding: 0 8px; z-index: 2; color: var(--accent); }
  .trk-chords.is-fit .chord-cell:not(.is-current):not(.is-n):hover { color: var(--text); }
  .trk-chords.is-fit .chord-cell.is-end { left: auto; right: calc((var(--total) - var(--s) - var(--d)) / var(--total) * 100%); }
  .chord-strip.is-measuring .chord-cell { min-width: 0 !important; padding: 0 !important; }
}
.chord-strip:empty { margin: 8px 0; height: calc(100% - 16px); border-radius: var(--r-sm); background: var(--surface-2); animation: pulse 1.8s ease-in-out infinite; }
.chord-strip.is-empty { background: none; animation: none; }
.chord-loading { position: absolute; top: 50%; left: 14px; margin-top: -.5rem; }
.chord-empty { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); white-space: nowrap; }

/* playhead, loop band and its edge handles, over the lanes */
.pl-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 2; }
/* memory-constrained devices: the playhead moves by transform on its own layer — no repaint of the lane (player.js) */
.pl-head.is-tx { left: 0; will-change: transform; }
.pl-band { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); box-shadow: inset 1px 0 var(--accent), inset -1px 0 var(--accent); pointer-events: none; z-index: 1; }
.pl-handle { position: absolute; top: 0; bottom: 0; width: 14px; margin-left: -7px; cursor: ew-resize; touch-action: none; z-index: 3; }
.pl-handle::after { content: ''; position: absolute; left: 6px; top: 20%; bottom: 20%; width: 2px; border-radius: 1px; background: var(--accent); }

@media (max-width: 767.98px) {
  .site-header { min-height: 56px; }
  .ws-bar { position: relative; display: block; padding: 12px 64px 10px 20px; }
  .ws-name h1 { font-size: 19px; }
  .ws-actions { position: absolute; top: 8px; right: 10px; }
  .dl-all { --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: var(--text-dim); --bs-btn-hover-bg: transparent; width: 44px; height: 44px; justify-content: center; }
  .dl-all svg { width: 20px; height: 20px; }
  /* one mono line that scrolls sideways, no scrollbar: MP3 · 0:28 · 152 BPM · C major · 8B · −18.3 LUFS */
  .ws-facts { gap: 0; margin-top: 2px; overflow-x: auto; scrollbar-width: none; font-size: 11px; color: var(--text-dim); }
  .ws-facts::-webkit-scrollbar { display: none; }
  .ws-facts > * + *::before { content: '·'; padding: 0 7px; color: var(--faint); }
  .ws-format { padding: 0; border: 0; font: inherit; letter-spacing: 0; color: var(--faint); }
  #tile-duration { font-size: inherit; }
  .fact .fact-k { display: none; }
  .fact-bpm { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
  .fact-bpm .fact-k { display: inline; margin: 0; font-size: inherit; letter-spacing: 0; text-transform: none; }
  .fact-bpm::before { order: 2; }
  .ws-status > :not([hidden]) { margin: 8px 16px; }
  /* the transport docks at the bottom: progress, time, then the buttons on five columns with Play in
     the middle (the buttons' group dissolves into the grid) */
  .ws-transport { order: 9; display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; gap: 6px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--band); border-top: 1px solid var(--border); border-bottom: 0; }
  .tp-progress { grid-column: 1 / -1; position: relative; height: 20px; }
  .tp-progress::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 2px; border-radius: 1px; background: var(--surface-2); }
  .tp-progress::after { content: ''; position: absolute; left: 0; top: 9px; width: var(--p, 0); height: 2px; border-radius: 1px; background: var(--accent); }
  .tp-progress i { position: absolute; top: 3px; left: var(--p, 0); width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); }
  .tp-progress .pl-head { display: none; }
  .tp-progress .pl-band { top: 6px; bottom: auto; height: 8px; border-radius: 2px; background: rgba(232,163,61,.35); box-shadow: none; }
  .tp-clock { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; }
  .pl-time { font-size: 11px; color: var(--muted); }
  .tp-buttons { display: contents; }
  .tp-buttons > * { grid-row: 3; justify-self: center; }
  #pl-start { grid-column: 1; justify-self: start; }
  #pl-back { grid-column: 2; }
  .tp-buttons > .position-relative { grid-column: 3; }
  #pl-fwd { grid-column: 4; }
  .tp-buttons .tp-icon { border: 0; width: 48px; height: 48px; color: var(--text-dim); }
  .pl-play { width: 72px; height: 56px; border-radius: var(--r-lg); }
  .tp-end { grid-row: 3; grid-column: 5; justify-self: end; margin: 0; }
  .speed { flex-direction: column; width: 44px; height: 44px; border-radius: var(--r-md); }
  .speed button { flex: 1; height: auto; padding: 0; font-size: 11px; }
  .speed button + button { border-left: 0; border-top: 1px solid var(--border-strong); }
  .tp-note > span { grid-column: 1 / -1; }
  .pl-hint { top: auto; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%); }
  /* rows: the icon beside the waveform, the fader and the buttons under it */
  .tl { --head-w: 0px; }
  .tl-box { margin: 8px 12px 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
  .trk { grid-template-columns: 48px minmax(0, 1fr) 102px; grid-template-areas: "name lane lane" ". vol ctl"; padding: 2px 4px 4px 0; }   /* 102: M, S and download — the master's fader as long as the stems' */
  .trk-name { grid-area: name; padding: 0 0 0 12px; color: var(--c, var(--text-dim)); }
  .trk-name .swatch, .trk-name .lane-name { display: none; }
  .trk-icon { display: block; }
  .trk-ctl { grid-area: ctl; justify-self: auto; justify-content: flex-end; padding: 0; gap: 0; }
  .trk-ctl .pl-ms { width: 30px; height: 28px; margin: 8px 2px; }   /* a small box, a pressed one too (the mockup) */
  .trk-ctl .pl-dl, .trk-ctl .pl-loop { width: 34px; height: 44px; margin: 0; border: 0; }
  .trk-vol { padding: 0 2px 0 0; gap: 6px; }
  .trk-lane { height: 30px; border-left: 0; }
  .stem-lane .lane-wave { cursor: auto; touch-action: auto; }   /* the list scrolls under a finger */
  .trk-master { padding-top: 4px; background: var(--surface); }
  .trk-master .trk-lane { height: 36px; background: none; }
  .trk-chords { --pps: 30px; padding: 0; }
  .trk-chords .chord-cell { top: 6px; bottom: 6px; font-size: 12px; }
  .trk-chords .trk-lane { height: 38px; }
  /* the chords already played dim towards the left edge, a short fade on the right (owner, 2026-10-30).
     A shadow over the row, not a mask: on the scrolling lane WebKit sized a mask to the whole strip and
     the left went dark (2026-11-02); a 16px mask on the row cut the chords off (owner, 2026-11-03).
     48px: the row's name column, where the lane starts */
  .trk-chords { position: relative; }
  .trk-chords::before, .trk-chords::after { content: ""; position: absolute; top: 0; bottom: 0; z-index: 3; pointer-events: none; }
  .trk-chords::before { left: 48px; width: 40%; background: linear-gradient(90deg, rgba(29,30,33,.85), rgba(29,30,33,.45) 45%, rgba(29,30,33,0)); }
  .trk-chords::after { right: 0; width: 36px; background: linear-gradient(90deg, rgba(29,30,33,0), var(--bg)); }
  .chord-head { left: calc(50% - 1px); margin-top: -38px; }
  .chord-inner { width: calc(var(--total) * var(--pps)); margin: 0 50%; }
  .stems-wait { top: 60px; left: 0; padding: 0 16px; }
}

/* too short for three stems under the fixed parts: the page scrolls, every row in it; the phone's
   transport sticks to the bottom */
@media (max-height: 559.98px) {
  body.app { height: auto; overflow: visible; }
  .ws-shell, .ws, .ws-main, .tl, .tl-box, .tl-stems { flex: none; }
  .tl-stems { overflow: visible; }
  .ws-transport { position: sticky; bottom: 0; z-index: 20; }
}
@media (max-height: 559.98px) and (min-width: 768px) { .ws-transport { position: static; } }

@media (prefers-reduced-motion: reduce) {
  .skeleton, .chord-strip:empty, .indeterminate::before, .wave .drift { animation: none; }
  .dz-bar > div { transition: none; }
}

/* ---------------------------------------------------------------- library and rename */

.lib-title { font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem); line-height: 1.05; }
.lib-usage { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.lib-slots { display: flex; gap: 3px; }
.lib-slots i { width: 6px; height: 14px; border-radius: 1px; background: var(--surface-2); }
.lib-slots i.is-used { background: var(--accent); }
.lib-search { align-items: center; gap: 10px; width: 280px; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-md); color: var(--faint); }
.lib-search:focus-within { border-color: var(--accent); }
.lib-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 14px; }
.lib { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--band); overflow: hidden; }
.lib-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 64px 56px 120px 170px 34px; gap: 20px; align-items: center; min-height: 64px; padding: 0 20px; }
.lib-row + .lib-row { border-top: 1px solid var(--border); }
.lib-head { min-height: 0; padding-block: 12px; letter-spacing: .1em; }
.lib-state { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px dashed var(--border-strong); color: var(--text); }
.lib-state.is-done { border-style: solid; }
.lib-state.is-running { border: 2px solid var(--surface-2); border-top-color: var(--accent); animation: spinner-border 1s linear infinite; }
.lib-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.lib-meta { margin-top: 2px; font: 12px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-cell { font: 13px var(--mono); color: var(--text-dim); white-space: nowrap; }
.lib-badge { flex: none; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; font: 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lib-badge.is-running { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.lib-badge.is-failed { border-color: var(--danger); color: var(--danger); }
.lib-badge.is-frozen { border-color: var(--stem-drums); color: var(--stem-drums); }
.lib-delete { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-sm); background: none; color: var(--faint); }
.lib-none { padding: 16px 20px; }
/* hover only with a mouse: on a phone or tablet a tap would leave the row lit (owner, 2026-11-03) */
@media (hover: hover) {
  .lib-row[data-title]:hover { background: var(--surface); }
  .lib-row:hover .lib-state.is-done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .lib-delete:hover { background: rgba(232,101,74,.12); color: var(--danger); }
}
@media (max-width: 767.98px) {
  .lib-summary { width: 100%; }
  .lib-slots { flex: 1; gap: 2px; }
  .lib-slots i { flex: 1; width: auto; height: 4px; }
  .lib { border-width: 1px 0; border-radius: 0; background: none; margin-inline: calc(-1 * var(--bs-gutter-x, 1.5rem) * .5); }
  .lib-row { grid-template-columns: 40px minmax(0, 1fr) 44px; gap: 12px; min-height: 68px; padding: 0 calc(var(--bs-gutter-x, 1.5rem) * .5); }
  .lib-state { width: 40px; height: 40px; }
  .lib-delete { width: 44px; height: 44px; }
}
.rename { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.rename-btn { flex: none; display: inline-flex; padding: 6px; border: 0; background: none; color: var(--faint); }
.rename-btn:hover { color: var(--accent); }
.rename.is-editing .rename-btn { display: none; }
.rename-input { position: relative; z-index: 2; min-width: min(20rem, 100%); padding: 2px 8px; font: inherit; }
