/* AudioCap — components
   Pills, top bar, footer, eyebrow, drop, chips, sheets, formats,
   pack cards, tiers, modal, library card, project detail, audio player,
   tweak panel. Ported from the audicap2 design package. */

/* ============================================================
   PILL — universal button shape
============================================================ */
.pill {
  appearance: none; border: 0; cursor: pointer;
  background: var(--pill); color: var(--ink);
  border-radius: var(--r-pill);
  padding: 11px 18px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--d-fast) ease, transform 100ms ease, color var(--d-fast) ease;
}
.pill:hover  { background: var(--pill-hover); }
.pill:active { transform: translateY(1px); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pill-dark   { background: var(--ink); color: #fff; padding: 12px 22px; font-weight: 500; }
.pill-dark:hover { background: var(--ink-2); }

.pill-text   { background: transparent; padding: 8px 14px; }
.pill-text:hover { background: var(--pill); }

.pill-lg     { padding: 14px 24px; font-size: 15px; }

.pill-rose   { background: var(--accent); color: var(--accent-fg); }
.pill-rose:hover { background: var(--accent-2); }

.pill-danger { color: var(--warn); background: transparent; }
.pill-danger:hover { background: var(--warn-bg); }

/* Square pill — 40×40 / 42×42 icon button */
.pill-icon, .pill-icn {
  width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
}
.pill-icn { width: 42px; height: 42px; }
.pill-icon svg, .pill-icn svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.pill-icn svg { width: 16px; height: 16px; }

/* Smaller icon button (sheet bar) */
.icn-btn {
  appearance: none; border: 0; cursor: pointer;
  width: 42px; height: 42px; border-radius: var(--r-pill);
  background: var(--pill); color: var(--ink);
  display: grid; place-items: center;
  transition: background var(--d-fast) ease;
}
.icn-btn:hover { background: var(--pill-hover); }
.icn-btn svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ============================================================
   TOP BAR / NAV
============================================================ */
.top, .topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad-x);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.topbar {
  background: #fff;
  padding: 18px 26px;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em; font-size: 18px;
  text-decoration: none; color: var(--ink);
}
/* Image wordmark — used in the top bar and footer. The logo is a
   ~1.7:1 stacked Audio/Cap mark on transparent ground; sized by height
   so the bar layout doesn't shift if the artwork is swapped. */
.brand-logo {
  display: block; height: 36px; width: auto;
  user-select: none;
}
.foot .brand-logo,
.brand-logo.is-sm { height: 28px; }
/* Legacy "AC" square — kept so older pages still render until they
   migrate to .brand-logo. New work should use the image. */
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r-mark);
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
}
.brand-mark::after { content: "AC"; }

.top-right, .top-actions { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   EYEBROW (mono pill with pulse dot)
============================================================ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.02em; color: var(--muted);
  background: var(--pill); border-radius: var(--r-pill);
  padding: 6px 12px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ink);
  animation: ac-pulse 2.4s ease-in-out infinite;
}
@keyframes ac-pulse { 0%,100%{opacity:.35} 50%{opacity:1} }

/* ============================================================
   CHIP
============================================================ */
.chip {
  background: var(--pill); padding: 8px 14px; border-radius: var(--r-pill);
  font-size: 13px; color: var(--ink); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.is-on, .chip.on { background: var(--ink); color: #fff; }

.ana-chip {
  background: var(--pill); border-radius: var(--r-pill); padding: 7px 12px;
  font-family: var(--mono); font-size: 11px; color: var(--ink); letter-spacing: 0.04em;
}
.ana-chip b { font-weight: 500; }

/* Mono small KBD pill (inline keystroke / link hint) */
.kbd {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px;
  background: var(--pill); font-size: 11px; color: var(--ink); font-family: var(--mono);
}

/* ============================================================
   GENERIC CARD (re-exported for arbitrary content)
   Keeps backwards compat with earlier .card usage.
============================================================ */
.card-surface {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-mark);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  overflow: hidden;
}
.card-body { padding: 20px 16px; }
@media (min-width: 640px) { .card-body { padding: 24px; } }

/* ============================================================
   DROP ZONE (home hero)
============================================================ */
.drop-wrap {
  margin: 56px auto 0;
  max-width: var(--maxw);
  padding: 0 var(--pad-x);
}
.drop {
  position: relative;
  background: var(--pill);
  border: 0;
  border-radius: var(--r-sheet);
  padding: 48px 36px;
  transition: background .25s ease, transform .25s ease, color .25s ease;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
}
.drop:hover { background: var(--pill-2); }
.drop.is-over {
  background: var(--ink);
  color: #fff;
  transform: scale(1.005);
}
.drop.is-over .drop-meta,
.drop.is-over .or,
.drop.is-over .hint { color: rgba(255,255,255,.6); }
.drop.is-over .pill { background: rgba(255,255,255,.12); color: #fff; }
.drop.is-over .browse-btn { background: #fff; color: var(--ink); }
.drop-inner { display: flex; align-items: center; gap: 36px; min-height: 220px; }
.drop-art {
  flex: 0 0 auto;
  width: 220px; height: 220px;
  position: relative;
  border-radius: 26px;
  background: linear-gradient(180deg, #f4f4f2, #ebebe9);
  display: grid; place-items: center;
  overflow: hidden;
}
.drop-art .disc { position: absolute; inset: 0; display: grid; place-items: center; }
.drop-art .disc svg { width: 88%; height: 88%; }
.disc-rotate { animation: ac-rot 18s linear infinite; }
@keyframes ac-rot { to { transform: rotate(360deg); } }

.drop-body { flex: 1 1 auto; min-width: 0; }
.drop-title {
  font-size: 22px; font-weight: 600; letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.drop-meta { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.drop-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.browse-btn {
  background: var(--ink); color: #fff;
  padding: 13px 22px; font-weight: 500;
}
.browse-btn:hover { background: var(--ink-2); }

.or { color: var(--muted-2); font-size: 13px; }
.hint {
  margin-top: 18px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.hint b { color: var(--ink); font-weight: 500; }

/* Equalizer bars (drop preview) */
.eq {
  display: flex; align-items: end; gap: 3px;
  height: 56px; margin: 4px 0 22px;
  width: 100%;
  --c: var(--ink);
}
.eq i {
  display: block; flex: 1 1 0; min-width: 0;
  border-radius: 3px;
  background: var(--c);
  opacity: .85;
  animation: ac-eqbar 1.4s ease-in-out infinite;
  transform-origin: bottom;
}
@keyframes ac-eqbar {
  0%,100% { height: 14%; }
  50%     { height: 92%; }
}

/* Static / live wave bars (used in analysis row, sheet, track sheet) */
.wave {
  height: 56px; display: flex; align-items: center; gap: 2px; position: relative;
}
.wave i {
  display: block; flex: 1 1 auto; width: 2.5px;
  background: var(--ink); border-radius: 2px; opacity: .7;
}
.wave i.live { opacity: 1; }
.wave i.dim  { opacity: .18; }
.wave .needle {
  position: absolute; top: -8px; bottom: -8px; left: 0;
  width: 2px; background: var(--ink);
  animation: ac-needle 4s linear infinite;
}
@keyframes ac-needle { 0% { left: 0%; } 100% { left: 100%; } }

/* ============================================================
   FORMATS (sheet "pick a format" cards / row)
============================================================ */
.formats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 760px) { .formats-grid { grid-template-columns: repeat(2, 1fr); } }
.fmt {
  background: var(--pill); border-radius: 16px;
  padding: 16px 16px 18px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
  border: 1.5px solid transparent;
  text-align: left;
}
.fmt:hover  { background: var(--pill-2); }
.fmt.is-on  { background: #fff; border-color: var(--ink); }
.fmt .icon  {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); display: grid; place-items: center;
  margin-bottom: 14px;
}
.fmt .icon svg {
  width: 16px; height: 16px; stroke: #fff; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.fmt .name { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.fmt .desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

/* List-row variant (Studio v3 step-2) */
.fmt-list { display: flex; flex-direction: column; gap: 8px; }
.fmt-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-2); border: 1.5px solid transparent;
  border-radius: var(--r-tile); padding: 16px 18px;
  cursor: pointer; text-align: left; width: 100%;
  font-family: var(--sans);
  transition: background .15s ease, border-color .15s ease;
}
.fmt-row:hover { background: var(--bg-3); }
.fmt-row.is-on { background: #fff; border-color: var(--ink); }
.fmt-row .ic {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--ink); display: grid; place-items: center; flex: 0 0 auto;
}
.fmt-row .ic svg {
  width: 18px; height: 18px; stroke: #fff; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.fmt-row .body { flex: 1 1 auto; min-width: 0; }
.fmt-row .body .name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; display: block; }
.fmt-row .body .desc { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; display: block; }
.fmt-row .price { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.fmt-row .check {
  width: 22px; height: 22px; border-radius: var(--r-pill); flex: 0 0 auto;
  border: 1.5px solid #d8d8d6;
  display: grid; place-items: center;
}
.fmt-row.is-on .check { background: var(--ink); border-color: var(--ink); }
.fmt-row.is-on .check::after {
  content: ""; width: 8px; height: 4px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(0, -1px);
}

/* ============================================================
   PACK CARD (gallery + sheet)
============================================================ */
.packs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
@media (max-width: 920px) { .packs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .packs { grid-template-columns: 1fr; } }

.pack {
  background: var(--pill); border-radius: var(--r-card);
  padding: 18px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
  position: relative;
  border: 1.5px solid transparent;
}
.pack:hover  { transform: translateY(-2px); background: var(--pill-2); }
.pack.is-on  { border-color: var(--ink); background: #fff; }
.pack-art {
  aspect-ratio: 4 / 3; border-radius: 14px;
  overflow: hidden; position: relative;
  background: var(--ink);
}
.pack-art .label {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  color: rgba(255,255,255,.78); text-transform: uppercase;
}
.pack-art .play {
  position: absolute; right: 12px; bottom: 12px;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.92); display: grid; place-items: center;
}
.pack-art .play svg { width: 14px; height: 14px; fill: var(--ink); }
.pack-art .badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 9px; border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
}
.pack-art .badge.suggested { background: #fff; color: var(--ink); }
.pack-name {
  margin-top: 14px; display: flex; align-items: baseline;
  justify-content: space-between; gap: 10px;
}
.pack-name .n { font-weight: 600; letter-spacing: -0.01em; font-size: 16px; }
.pack-name .g { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pack-tag    { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.pack.is-suggested            { background: var(--ink); color: #fff; }
.pack.is-suggested .pack-name .g,
.pack.is-suggested .pack-tag  { color: rgba(255,255,255,.6); }
.pack-suggested-mark {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.12); color: #fff;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  padding: 5px 9px; border-radius: var(--r-pill);
}

/* ===== Pack art treatments (gradient-only — no images required) ===== */
.a-flowers { background: radial-gradient(120% 80% at 30% 20%, #f6efe1, #e9d9b6 55%, #b59663); }
.a-flowers::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(20px 14px at 30% 60%, #6a5b3a 0%, transparent 70%),
    radial-gradient(14px 10px at 60% 40%, #8a6f43 0%, transparent 70%),
    radial-gradient(10px 8px at 78% 70%, #c8a36a 0%, transparent 70%);
  opacity: .55; mix-blend-mode: multiply;
}
.a-lofi   { background: radial-gradient(80% 80% at 70% 70%, #d9924a, #6a3a1f 60%, #1c1610); }
.a-bauhaus{ background: conic-gradient(from 220deg at 30% 60%, #e63b1a 0 25%, #f6c83a 0 55%, #1f3fbf 0 80%, #0a0a0a 0 100%); }
.a-kandyan{ background: radial-gradient(70% 70% at 50% 40%, #c93a1d, #6f1a0c 70%, #1a0805); }
.a-kandyan::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(228,178,69,.18) 0 10deg, transparent 10deg 30deg);
  mix-blend-mode: screen;
}
.a-brutal { background: var(--ink); }
.a-brutal::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 0 70%, #fff 70% 71%, transparent 71% 100%),
    linear-gradient(0deg, transparent 0 60%, #fff 60% 60.6%, transparent 60.6% 100%);
  opacity: .85;
}
.a-sun    { background: linear-gradient(180deg, #f4ede1 0 40%, #2657aa 40% 100%); }
.a-sun::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(40px 40px at 78% 30%, #f3a99f 0%, transparent 70%);
}

/* ============================================================
   SHEET (full-page step takeover, used by home → studio flow)
============================================================ */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 70;
  pointer-events: none; opacity: 0;
  background: var(--scrim);
  transition: opacity .35s ease;
  overflow-y: auto;
}
.sheet-wrap.is-on { opacity: 1; pointer-events: auto; }

.sheet {
  max-width: 1100px; margin: 32px auto; padding: 0 var(--pad-x);
  transform: translateY(20px); opacity: 0;
  transition: transform .4s var(--ease), opacity .35s ease;
}
.sheet-wrap.is-on .sheet { transform: none; opacity: 1; }

.sheet-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 24px;
}
.sheet-progress {
  display: flex; gap: 6px; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em;
}
.sheet-progress .seg {
  width: 28px; height: 3px; border-radius: 2px; background: var(--pill-2);
}
.sheet-progress .seg.on { background: var(--ink); }

.sheet-card {
  background: #fff; border-radius: var(--r-sheet);
  padding: 36px 36px 32px;
  box-shadow: var(--shadow-sheet);
}
@media (max-width: 600px) { .sheet-card { padding: 24px 20px; } }

.sheet-actions {
  margin-top: 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

.sec-title {
  display: flex; align-items: end; justify-content: space-between; gap: 20px;
  margin: 32px 0 14px;
}
.sec-title h4 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.sec-title .m { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Now playing strip inside sheet */
.now-playing {
  display: flex; align-items: center; gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.np-art {
  width: 64px; height: 64px; border-radius: 14px;
  background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
  display: grid; place-items: center; flex: 0 0 auto;
  position: relative; overflow: hidden;
}
.np-art svg { width: 24px; height: 24px; fill: #fff; opacity: .9; position: relative; z-index: 2; }
.np-art .ring  { position: absolute; inset: 14px; border: 1px solid rgba(255,255,255,.10); border-radius: var(--r-pill); }
.np-art .ring2 { position: absolute; inset: 24px; border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-pill); }
.np-meta { flex: 1 1 auto; min-width: 0; }
.np-meta .t { font-weight: 600; letter-spacing: -0.01em; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta .s { color: var(--muted); font-size: 13px; margin-top: 2px; font-family: var(--mono); }
.np-actions { display: flex; gap: 10px; align-items: center; }

.scan-row {
  display: flex; gap: 36px; align-items: center; padding: 12px 0 4px;
}
.scan-wave {
  flex: 1 1 auto; height: 44px;
  display: flex; align-items: center; gap: 2px;
}
.scan-wave i { display: block; flex: 1 1 auto; width: 2.5px; background: var(--ink); border-radius: 2px; opacity: .55; }
.scan-wave i.live { opacity: 1; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   MODAL (login / generic)
============================================================ */
.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 80;
  pointer-events: none;
  transition: background .3s ease;
}
.scrim.is-on { background: rgba(20,20,20,.45); pointer-events: auto; }

.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98);
  z-index: 90; pointer-events: none; opacity: 0;
  width: min(440px, calc(100% - 32px));
  background: #fff; border-radius: var(--r-sheet);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-sheet);
  transition: opacity .25s ease, transform .25s ease;
}
.modal.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  background: var(--pill);
  display: grid; place-items: center; cursor: pointer; border: 0;
}
.modal-close svg { width: 14px; height: 14px; stroke: var(--ink); stroke-width: 1.8; fill: none; }

.modal-art {
  width: 96px; height: 96px; margin: 0 auto 20px;
  border-radius: var(--r-card);
  background: linear-gradient(180deg, #f4f4f2, #ebebe9);
  display: grid; place-items: center; overflow: hidden;
}
.modal-art svg { width: 78%; height: 78%; }
.modal h3 {
  text-align: center; font-size: 22px; font-weight: 600;
  letter-spacing: -0.015em; margin: 0 0 6px;
}
.modal p.sub-modal {
  text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px;
}
.modal-btn {
  width: 100%; padding: 14px; border-radius: var(--r-pill); border: 0;
  background: var(--pill); font-family: var(--sans); font-size: 14px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 10px; color: var(--ink);
  transition: background .15s ease;
}
.modal-btn:hover    { background: var(--pill-hover); }
.modal-btn.dark     { background: var(--ink); color: #fff; }
.modal-btn.dark:hover { background: var(--ink-2); }
.modal-btn svg      { width: 16px; height: 16px; }
.modal-or {
  text-align: center; color: var(--muted-2); font-size: 12px;
  margin: 14px 0 10px; font-family: var(--mono);
}
.modal-text-link {
  display: block; text-align: center; font-size: 14px; font-weight: 500; color: var(--ink);
  background: none; border: 0; padding: 10px; width: 100%; cursor: pointer;
}
.modal-fine {
  text-align: center; color: var(--muted); font-size: 11px; line-height: 1.5;
  margin-top: 12px; font-family: var(--mono);
}
.modal-fine a { color: var(--ink); text-decoration: underline; }

/* ============================================================
   FOOTER
============================================================ */
.foot {
  max-width: var(--maxw); margin: 120px auto 0;
  padding: 32px var(--pad-x) 56px;
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  flex-wrap: wrap;
  color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--line);
}
.foot .left  { display: flex; align-items: center; gap: 14px; }
.foot .right { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a       { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ============================================================
   LIBRARY CARD (catalogue grid)
============================================================ */
.lib-grid {
  max-width: var(--maxw); margin: 0 auto;
  padding: 36px 24px 140px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px;
}
@media (max-width: 920px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .lib-grid { grid-template-columns: 1fr; gap: 28px; } }

.lib-card { position: relative; cursor: pointer; }
.lib-card .art {
  aspect-ratio: 1 / 1; border-radius: var(--r-card); overflow: hidden; position: relative;
}
.lib-card .art .play {
  position: absolute; right: 14px; bottom: 14px;
  width: 44px; height: 44px; border-radius: var(--r-pill); background: var(--ink);
  display: grid; place-items: center;
  opacity: .95; transition: transform .15s ease, opacity .15s ease;
  border: 0; cursor: pointer;
}
.lib-card:hover .art .play { transform: scale(1.06); opacity: 1; }
.lib-card .art .play svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
.lib-card .meta {
  margin-top: 14px; display: flex; align-items: flex-start; gap: 8px;
}
.lib-card .meta .body { flex: 1; min-width: 0; }
.lib-card .meta .nm {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-card .meta .who {
  font-size: 13px; color: var(--muted); margin-top: 3px;
  display: flex; align-items: center; gap: 5px;
}
.lib-card .meta .who svg { width: 11px; height: 11px; stroke: var(--muted); fill: none; stroke-width: 1.7; }
.lib-card .meta .more {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--muted); margin-top: 4px;
}
.lib-card .meta .more:hover { background: var(--pill); color: var(--ink); }
.lib-card .meta .more svg  { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.lock { display: inline-flex; align-items: center; gap: 5px; }
.lock svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ============================================================
   FAB
============================================================ */
.add-fab {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  z-index: 6;
}
.add-fab .pill-dark {
  padding: 14px 24px; font-size: 14px;
  box-shadow: var(--shadow-fab);
}
body.hidden-fab .add-fab { display: none; }

/* ============================================================
   PROJECT-DETAIL OVERLAY (library detail)
============================================================ */
.detail {
  position: fixed; inset: 0; background: var(--bg); z-index: 10;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  overflow: auto;
}
.detail.is-on { opacity: 1; pointer-events: auto; }
.detail-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px;
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}

/* ============================================================
   TWEAK-PILL TABS
============================================================ */
.tabs-pill {
  display: flex; background: var(--pill);
  border-radius: var(--r-pill); padding: 5px;
  border: 1.5px solid var(--ink);
}
.tabs-pill button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  padding: 12px 18px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.tabs-pill button.on { background: #fff; color: var(--ink); }

.toggle-pill {
  background: var(--pill); border-radius: var(--r-pill); padding: 4px;
  display: inline-flex; gap: 0;
}
.toggle-pill button {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 8px 14px; border-radius: var(--r-pill); color: var(--muted);
}
.toggle-pill button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ============================================================
   MENU SHEET (project / track ··· menu)
============================================================ */
.sheet-popover {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.98); opacity: 0;
  z-index: 60; pointer-events: none;
  background: #fff; border-radius: var(--r-sheet);
  box-shadow: var(--shadow-sheet);
  transition: opacity .25s ease, transform .25s ease;
  overflow: hidden;
  max-width: calc(100% - 32px);
}
.sheet-popover.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }

.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list .group { display: flex; flex-direction: column; gap: 8px; }
.menu-list .group + .group { margin-top: 14px; }
.menu-row {
  background: var(--pill); border-radius: 14px; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; border: 0; width: 100%; text-align: left;
  font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background .15s ease;
}
.menu-row:hover { background: var(--pill-hover); }
.menu-row svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto;
}
.menu-row .label { flex: 1; }
.menu-row .val   { font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.menu-row .val svg { width: 14px; height: 14px; stroke: var(--muted); }
.menu-row.danger     { color: var(--warn); }
.menu-row.danger svg { stroke: var(--warn); }

/* ============================================================
   PERSISTENT AUDIO PLAYER (studio editor)
============================================================ */
.player {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 11;
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 14px;
  background: var(--ink); color: #fff;
  border-radius: var(--r-card);
  padding: 10px 12px;
  box-shadow: var(--shadow-pop);
  width: min(720px, calc(100% - 48px));
  transition: opacity .3s ease, transform .3s ease;
}
.player.is-hidden { opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
.player .art {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #3a3a3a, #1a1a1a);
  display: grid; place-items: center;
  overflow: hidden; position: relative;
}
.player .art .ring { position: absolute; inset: 8px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); }
.player .art .dot  { width: 6px; height: 6px; border-radius: var(--r-pill); background: #fff; }
.player .art.spinning .ring { animation: ac-spin 8s linear infinite; }
@keyframes ac-spin { to { transform: rotate(360deg); } }

.player .center { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.player .center .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.player .center .top .t {
  font-size: 13px; font-weight: 500; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.player .center .top .live {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  color: rgba(255,255,255,.5); text-transform: uppercase; flex: 0 0 auto;
}
.player .scrub {
  height: 3px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.14); position: relative; cursor: pointer;
}
.player .scrub .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #fff; border-radius: var(--r-pill); width: 32%;
}
.player .scrub .knob {
  position: absolute; top: 50%; left: 32%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: var(--r-pill); background: #fff;
}
.player .center .bot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  color: rgba(255,255,255,.55);
}
.player .center .bot .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.player .center .bot .time b { color: #fff; font-weight: 500; }
.player .ctrls { display: flex; align-items: center; gap: 2px; }
.player .pbtn  {
  appearance: none; border: 0; cursor: pointer; color: #fff;
  width: 34px; height: 34px; border-radius: var(--r-pill);
  background: transparent;
  display: grid; place-items: center;
  transition: background .15s ease;
}
.player .pbtn:hover { background: rgba(255,255,255,.08); }
.player .pbtn svg   { width: 13px; height: 13px; stroke: #fff; fill: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.player .pbtn.play  { background: #fff; color: var(--ink); width: 42px; height: 42px; }
.player .pbtn.play:hover { background: #f0f0f0; }
.player .pbtn.play svg   { stroke: var(--ink); fill: var(--ink); width: 14px; height: 14px; }

@media (max-width: 680px) {
  .player { width: calc(100% - 24px); padding: 8px; gap: 10px; }
  .player .ctrls .pbtn:not(.play) { display: none; }
  .player .center .top .live { display: none; }
}
