/* ============================================================================
   AVH Studios — "My Songs" / "My Beats" library shelves
   Shared by my-songs.html and my-beats.html. Reads the same :root tokens as
   brand.css / social.css so the surfaces feel like one product.
   ========================================================================== */

.lib-wrap { max-width: var(--maxw); margin: 0 auto; padding: 30px 22px 70px; }

/* ---- hero ---------------------------------------------------------------- */
.lib-hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 26px 24px; margin-bottom: 24px;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(53, 194, 255, .12), transparent 55%),
    radial-gradient(120% 160% at 0% 100%, rgba(255, 107, 53, .12), transparent 55%),
    var(--panel);
}
.lib-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5;
}
.lib-eyebrow {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 12px;
}
.lib-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 0 rgba(255, 107, 53, .5); animation: libPulse 2.2s ease-in-out infinite;
}
@keyframes libPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, .45); } 50% { box-shadow: 0 0 0 7px rgba(255, 107, 53, 0); } }
.lib-hero h1 {
  position: relative; z-index: 1; margin: 0 0 10px;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1;
}
.lib-hero h1 .grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lib-lead {
  position: relative; z-index: 1; margin: 0; max-width: 720px;
  color: var(--text-dim); font-size: 1rem; line-height: 1.6;
}
.lib-lead b { color: var(--text); }
.lib-hero-stats {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 26px; margin-top: 20px;
}
.lib-stat { display: flex; flex-direction: column; }
.lib-stat b { font-size: 1.5rem; font-weight: 800; }
.lib-stat span { color: var(--text-dim); font-size: .78rem; letter-spacing: .02em; }

/* ---- toolbar ------------------------------------------------------------- */
.lib-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.lib-count { color: var(--text-dim); font-size: .86rem; font-weight: 700; }
.lib-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-toolbar-link {
  color: var(--text-dim); font-weight: 700; font-size: .86rem;
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; background: var(--panel);
  transition: .15s ease;
}
.lib-toolbar-link:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

/* ---- list ---------------------------------------------------------------- */
.lib-list { display: flex; flex-direction: column; gap: 12px; }

.lib-row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; background: var(--panel);
  transition: border-color .15s ease, transform .12s ease, background .15s ease;
}
.lib-row:hover { border-color: rgba(255, 107, 53, .4); background: var(--panel-2); }
.lib-row.playing { border-color: var(--accent-2); box-shadow: 0 0 0 1px rgba(53, 194, 255, .3) inset; }

.lib-play { flex: 0 0 auto; }
.lib-play .music-play-ico { display: inline-block; }
.lib-play.playing .music-play-ico { transform: translateX(0); }

.lib-main { min-width: 0; flex: 1; }
.lib-title { font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-meta { color: var(--text-dim); font-size: .82rem; margin-top: 3px; }
.lib-meta .lib-ok { color: var(--accent-3); font-weight: 800; }
.lib-substats { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-plays {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; color: var(--accent);
  background: rgba(255,107,53,.12); border: 1px solid rgba(255,107,53,.28);
  border-radius: 99px; padding: 3px 10px;
}
.lib-lf {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; color: #f5c542;
  background: rgba(245,197,66,.12); border: 1px solid rgba(245,197,66,.28);
  border-radius: 99px; padding: 3px 10px;
}

.lib-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; flex: 0 0 auto; }

.lib-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px;
  background: var(--panel-2); color: var(--text); cursor: pointer;
  font: inherit; font-weight: 700; font-size: .84rem; white-space: nowrap;
  transition: .15s ease;
}
.lib-btn:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.lib-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.lib-btn-accent {
  border-color: transparent; color: #0b0d11;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.lib-btn-accent:hover { color: #0b0d11; box-shadow: 0 10px 24px rgba(255, 107, 53, .35); }

/* ---- empty state --------------------------------------------------------- */
.lib-empty {
  text-align: center; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  padding: 48px 24px; background: var(--panel); line-height: 1.6;
}
.lib-empty-cta { margin-top: 18px; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 640px) {
  .lib-wrap { padding: 22px 16px 60px; }
  .lib-hero { padding: 22px 18px; }
  .lib-row { flex-wrap: wrap; padding: 13px; }
  .lib-main { flex: 1 1 60%; }
  .lib-actions { width: 100%; }
  .lib-actions .lib-btn { flex: 1 1 auto; justify-content: center; }
  .lib-hero-stats { gap: 18px; }
}

/* ---- provenance seal + certificate button -------------------------------- */
.lib-cert {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-weight: 800; font-size: .72rem; letter-spacing: .02em;
  color: var(--accent-3); background: rgba(53, 255, 158, .1);
  border: 1px solid rgba(53, 255, 158, .34); border-radius: 999px;
  padding: 2px 9px; cursor: pointer; transition: .15s ease; vertical-align: middle;
}
.lib-cert:hover { background: rgba(53, 255, 158, .18); transform: translateY(-1px); }
.lib-cert-anchored { color: var(--accent-2); background: rgba(53, 194, 255, .1); border-color: rgba(53, 194, 255, .34); }
.lib-cert-anchored:hover { background: rgba(53, 194, 255, .18); }

.lib-btn-cert { border-color: rgba(53, 255, 158, .34); color: var(--accent-3); background: rgba(53, 255, 158, .08); }
.lib-btn-cert:hover { border-color: var(--accent-3); color: var(--accent-3); }

.lib-btn-pub { border-color: rgba(53, 194, 255, .34); color: var(--accent-2); background: rgba(53, 194, 255, .08); }
.lib-btn-pub:hover { border-color: var(--accent-2); color: var(--accent-2); }
.lib-btn-pub.on { border-color: rgba(53, 255, 158, .5); color: var(--accent-3); background: rgba(53, 255, 158, .1); }
.lib-btn-pub.on:hover { border-color: var(--accent-3); color: var(--accent-3); }

.lib-btn-danger { border-color: rgba(255, 77, 94, .34); color: var(--danger); background: rgba(255, 77, 94, .08); }
.lib-btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---- certificate panel (modal) ------------------------------------------- */
.cert-overlay {
  position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(6, 8, 12, .74); backdrop-filter: blur(4px);
  animation: certFade .16s ease;
}
.cert-overlay[hidden] { display: none; }
@keyframes certFade { from { opacity: 0; } to { opacity: 1; } }
body.cert-open { overflow: hidden; }

.cert-modal {
  position: relative; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(53, 194, 255, .1), transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(255, 107, 53, .1), transparent 55%),
    var(--panel);
  padding: 24px 24px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: certPop .18s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes certPop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.cert-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 50%; background: var(--panel-2);
  color: var(--text-dim); font-size: 1rem; cursor: pointer; line-height: 1; transition: .15s ease;
}
.cert-close:hover { color: var(--text); border-color: var(--accent); }

.cert-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.cert-seal {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.5rem; background: linear-gradient(135deg, rgba(255, 107, 53, .18), rgba(53, 194, 255, .18));
  border: 1px solid var(--border);
}
.cert-eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.cert-head h3 { margin: 2px 0 0; font-size: 1.25rem; }

.cert-body { min-height: 120px; }
.cert-loading { color: var(--text-dim); font-size: .9rem; padding: 24px 0; text-align: center; }

.cert-title { font-size: 1.15rem; font-weight: 800; }
.cert-sub { color: var(--text-dim); font-size: .84rem; margin-top: 3px; }
.cert-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.cert-pill {
  font-size: .74rem; font-weight: 800; border-radius: 999px; padding: 4px 11px; border: 1px solid var(--border);
}
.cert-pill.ok { color: var(--accent-3); background: rgba(53, 255, 158, .1); border-color: rgba(53, 255, 158, .34); }
.cert-pill.bad { color: var(--danger); background: rgba(255, 77, 94, .1); border-color: rgba(255, 77, 94, .34); }
.cert-pill.warn { color: var(--accent); background: rgba(255, 107, 53, .1); border-color: rgba(255, 107, 53, .34); }
.cert-pill.dim { color: var(--text-dim); }

.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.cert-field { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--panel-2); }
.cert-label { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 4px; }
.cert-value { font-size: .86rem; word-break: break-word; }
.cert-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.cert-hash { margin-bottom: 12px; }
.cert-role { color: var(--text-dim); font-size: .78rem; }
.cert-field a { color: var(--accent-2); }
.cert-foot { color: var(--text-dim); font-size: .78rem; line-height: 1.55; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }

.cert-anchorblock { border-color: rgba(53, 194, 255, .34); background: rgba(53, 194, 255, .06); margin-bottom: 12px; }
.cert-anchorline { font-size: .86rem; margin-bottom: 3px; }
.cert-anchordigest { color: var(--text-dim); word-break: break-all; }
.cert-anchorblock a { color: var(--accent-2); }
.cert-lineage { display: flex; flex-direction: column; gap: 5px; }
.cert-lrow { display: flex; gap: 10px; align-items: baseline; }
.cert-lkey { flex: 0 0 130px; color: var(--text-dim); font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.cert-lval { flex: 1 1 auto; font-size: .82rem; word-break: break-word; }

/* Chain of title + co-signatures (rights layer) */
.cert-chainfield { border-color: rgba(255, 107, 53, .3); background: rgba(255, 107, 53, .05); }
.cert-cosignfield { border-color: rgba(53, 194, 255, .28); background: rgba(53, 194, 255, .05); }
.cert-chain { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.cert-chain-row { display: flex; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.cert-chain-row:first-child { border-top: 0; }
.cert-chain-seq {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #1a0d05;
  font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.cert-chain-main { flex: 1 1 auto; min-width: 0; }
.cert-chain-head { font-size: .84rem; font-weight: 700; }
.cert-chain-date { color: var(--text-dim); font-size: .72rem; font-weight: 500; margin-left: 4px; }
.cert-chain-move { font-size: .78rem; color: var(--accent-2); margin-top: 2px; }
.cert-chain-detail { font-size: .78rem; color: var(--text-dim); margin-top: 2px; word-break: break-word; }
.cert-cosign { font-size: .82rem; padding: 2px 0; }
.cert-cosign.ok { color: var(--accent-3); }
.cert-cosign.bad { color: var(--danger); }

.cert-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.cert-actions .lib-btn { flex: 1 1 auto; justify-content: center; }

@media (max-width: 560px) {
  .cert-grid { grid-template-columns: 1fr; }
  .cert-modal { padding: 20px 16px 16px; }
}

/* ---- AVH Radio submit button + modal ---- */
.lib-btn-radio { border-color: rgba(255, 107, 53, .34); color: var(--accent); background: rgba(255, 107, 53, .08); }
.lib-btn-radio:hover { border-color: var(--accent); color: var(--accent); }
.lib-btn-radio.pending { border-color: rgba(53, 194, 255, .34); color: var(--accent-2); background: rgba(53, 194, 255, .08); }
.lib-btn-radio.on { border-color: rgba(53, 255, 158, .5); color: var(--accent-3); background: rgba(53, 255, 158, .1); }

.radio-submit-overlay {
  position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(6, 8, 12, .74); backdrop-filter: blur(4px); animation: certFade .16s ease;
}
.radio-submit-overlay[hidden] { display: none; }
body.radio-submit-open { overflow: hidden; }
.radio-submit-modal {
  position: relative; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 107, 53, .12), transparent 55%),
    var(--panel);
  padding: 24px 24px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: certPop .18s cubic-bezier(.2, .9, .3, 1.2);
}
.radio-submit-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim);
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.radio-submit-close:hover { color: var(--text); border-color: var(--accent); }
.radio-submit-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.radio-submit-seal {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; background: linear-gradient(135deg, rgba(255,107,53,.2), rgba(53,194,255,.2)); border: 1px solid var(--border);
}
.radio-submit-eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.radio-submit-head h3 { margin: 2px 0 0; font-size: 1.2rem; }
.radio-submit-body { display: flex; flex-direction: column; gap: 12px; }
.radio-submit-note { color: var(--text-dim); font-size: .9rem; margin: 0; line-height: 1.5; }
.radio-submit-loading { color: var(--text-dim); font-size: .9rem; padding: 10px 0; }
.radio-submit-field { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--text-dim); font-weight: 700; }
.radio-submit-field select, .radio-submit-field input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 500;
}
.radio-submit-field select:focus, .radio-submit-field input:focus { outline: none; border-color: var(--accent); }
.radio-submit-state { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); font-size: .95rem; }
.radio-submit-state.ok { border-color: rgba(53,255,158,.4); background: rgba(53,255,158,.08); }
.radio-submit-state.pending { border-color: rgba(53,194,255,.4); background: rgba(53,194,255,.08); }
.radio-submit-state.err { border-color: rgba(255,77,94,.4); background: rgba(255,77,94,.08); }
.radio-submit-picker { display: flex; flex-direction: column; gap: 8px; }
.radio-submit-pick {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text); font: inherit; transition: .15s ease;
}
.radio-submit-pick:hover { border-color: var(--accent); transform: translateY(-1px); }
.radio-submit-pick[disabled] { opacity: .6; cursor: default; transform: none; }
.radio-submit-pick .nm { font-weight: 700; }
.radio-submit-pick .mt { color: var(--text-dim); font-size: .8rem; }
.radio-submit-pick .go { margin-left: auto; font-size: .8rem; font-weight: 800; color: var(--accent); }
.radio-submit-pick.st-approved .go { color: var(--accent-3); }
.radio-submit-pick.st-pending .go { color: var(--accent-2); }

/* ============================================================================
   MUSIC VIDEOS  —  the Scene Reel shelf
   A film row is not a song row: it leads with a treatment poster instead of a
   play button, and the runtime / shot count replace the plays + likes stats.
   ========================================================================== */
.lib-row-video { align-items: center; }

.lib-vid-poster {
  flex: 0 0 auto;
  width: 104px;
  height: 62px;
  border-radius: 10px;
  object-fit: cover;
  background: #0b0d11;
  border: 1px solid var(--border, #2a2f3a);
  box-shadow: 0 6px 18px -10px rgba(0,0,0,.9);
  display: block;
}
.lib-vid-poster-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, #171a21, #1e222b);
}
.lib-row-video .lib-main { min-width: 0; }

.lib-vid-role {
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim, #9aa0ac);
  opacity: .75;
  margin-right: 2px;
}
.lib-row-video .lib-actions { flex: 0 0 auto; }
.lib-row-video .lib-btn-accent { white-space: nowrap; }

@media (max-width: 720px) {
  .lib-vid-poster { width: 72px; height: 46px; }
  .lib-row-video { flex-wrap: wrap; }
  .lib-row-video .lib-actions { width: 100%; }
}
