/* chordresult-skin.css — single-song-only additions on top of the shared cosmic
   base (css/chord-styles.css): access wall, premium locks, the real wavesurfer
   mixer extras, and See-Also thumbnails. The listing page (chordanalyzer-library)
   does NOT load this file, so these rules are scoped to library.php only. */

/* ── No-JS fallback message ─────────────────────────────────────────────────── */
.landing-noscript { max-width: 640px; margin: 80px auto; text-align: center;
  color: var(--sub, #ccc); font-family: var(--font-body, system-ui, sans-serif); padding: 0 20px; }

/* ── See-Also real thumbnails ───────────────────────────────────────────────── */
.sa-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sa-thumb .play { position: relative; z-index: 1; }

/* ── Mixer toggle header (button styled like a card-h) ──────────────────────── */
.cr-mixer-toggle { appearance: none; border: 0; background: transparent; cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px; padding: 0; }
.cr-chev { display: inline-grid; place-items: center; color: var(--sub); transition: transform .2s ease; }
.cr-chev.up { transform: rotate(180deg); }

/* ── Mixer: loading + waveform + per-stem buttons ───────────────────────────── */
.cr-mixer-loading { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--sub); font-size: 13.5px; }
.cr-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong);
  border-top-color: var(--accent); animation: cr-spin .8s linear infinite; }
@keyframes cr-spin { to { transform: rotate(360deg); } }

.stem-wave { width: 100%; height: 46px; margin: 4px 0 12px; border-radius: 8px; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 6%, transparent); }
.cr-stem-btns { display: inline-flex; align-items: center; gap: 6px; }
.cr-stem-btn { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--sub); cursor: pointer; display: grid; place-items: center;
  font: inherit; font-size: 12px; font-weight: 700; transition: .14s; }
.cr-stem-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.cr-stem-btn.on { color: #fff; background: var(--cta); border-color: transparent; }
.cr-stem-btn svg { width: 14px; height: 14px; }

/* ── Premium lock affordance on controls ────────────────────────────────────── */
.ctl.cr-locked { position: relative; }
.ctl.cr-locked .ctl-lbl svg:last-child { color: var(--accent); opacity: .9; }
.ctl.cr-locked .ctl-val,
.ctl.cr-locked .ctl-stepper,
.ctl.cr-locked .ctl-toggle { opacity: .6; }
.view-tab svg + svg { margin-left: 2px; color: var(--accent); }

/* ── Access wall overlay ────────────────────────────────────────────────────── */
.cr-wall { position: fixed; inset: 0; z-index: 7500; display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cr-wall-card { width: min(440px, 100%); text-align: center; padding: 38px 30px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop);
  animation: toast-in .3s ease; }
.cr-wall-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center;
  color: #fff; background: var(--cta); box-shadow: var(--cta-glow); }
.cr-wall-card h2 { margin: 0 0 10px; font-family: var(--font-display); font-style: var(--display-style);
  font-size: 26px; font-weight: 600; color: var(--ink); }
.cr-wall-card p { margin: 0 0 24px; color: var(--sub); font-size: 14.5px; line-height: 1.6; }
.cr-wall-btn { display: block; width: 100%; padding: 13px 20px; border-radius: 12px; font: inherit;
  font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; margin-bottom: 10px; border: 1px solid transparent; }
.cr-wall-btn.primary { color: #fff; background: var(--cta); box-shadow: var(--cta-glow); }
.cr-wall-btn.primary:hover { filter: brightness(1.08); }
.cr-wall-btn.ghost { color: var(--ink); background: transparent; border-color: var(--line-strong); }
.cr-wall-btn.ghost:hover { border-color: var(--accent-line); }

/* ── Upgrade modal centring ─────────────────────────────────────────────────── */
.modal.cr-upgrade { width: min(440px, 100%); }
.modal.cr-upgrade .cr-wall-icon { width: 56px; height: 56px; }

/* ── "Analyze your own song" CTA (chord-library song pages only) ────────────
   Server-rendered in library.php (song mode, never CA results) and moved
   directly above the Chord Progression card by a tiny poll-and-mount script —
   the same pattern as the ad boxes, because the page body is React-rendered.
   Cosmic tokens only; the gradient border/glow uses --accent/--accent2 and the
   button uses the whole --cta gradient (never nested inside another gradient). */
.cr-own-cta { position: relative; overflow: hidden; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 20px 26px; margin: 6px 0 24px;
  padding: 22px 26px; border-radius: 20px; border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, color-mix(in srgb, var(--accent2) 62%, var(--line)),
      color-mix(in srgb, var(--accent) 62%, var(--line))) border-box;
  box-shadow: var(--shadow-card);
  animation: cr-own-in .55s cubic-bezier(.22, .8, .35, 1) backwards; }
@keyframes cr-own-in { from { opacity: 0; transform: translateY(12px); } }
.cr-own-cta::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 130% at 0% 0%, color-mix(in srgb, var(--accent2) 12%, transparent), transparent 55%),
    radial-gradient(80% 130% at 100% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%); }
.cr-own-txt { position: relative; min-width: 0; flex: 1 1 340px; }
.cr-own-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.cr-own-kicker svg { width: 13px; height: 13px; }
.cr-own-title { font-family: var(--font-body); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(19px, 2.6vw, 26px); line-height: 1.2; color: var(--ink); }
.cr-own-title em { font-family: var(--font-display); font-style: italic; font-weight: 600;
  background: var(--cta); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cr-own-desc { margin: 8px 0 0; color: var(--sub); font-size: 14.5px; line-height: 1.55; }
.cr-own-hints { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.cr-own-hint { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--sub);
  background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line); }
.cr-own-hint svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
/* Two stacked actions, equal width and equal height, so the pair reads as one
   balanced block against the text column. `align-self: center` keeps that block
   vertically centred on the copy exactly as the single button used to be. */
.cr-own-actions { position: relative; display: flex; flex-direction: column; gap: 10px;
  align-self: center; flex: 0 0 auto; min-width: min(260px, 100%); }
/* The transparent border is load-bearing: the ghost variant below sets a real
   1px border, and without a matching box here the two buttons differ by 2px. */
.cr-own-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 13px 24px; border-radius: 13px; border: 1px solid transparent;
  text-decoration: none; font: inherit;
  font-weight: 700; font-size: 15px; color: #fff; background: var(--cta); box-shadow: var(--cta-glow);
  transition: filter .15s ease, transform .1s ease; }
.cr-own-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cr-own-btn:active { transform: scale(.97); }
.cr-own-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
/* Both actions carry a second line ("Premium Engine" / "Your file or link") and
   a leading icon, so the pair is structurally identical — same height, same
   optical weight — instead of a tall primary next to a short secondary. */
.cr-own-btn-txt { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.cr-own-btn-txt small { font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; opacity: .82; margin-top: 2px; }
/* Secondary action: same footprint, quieter surface — one clear primary. */
.cr-own-btn-ghost { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink);
  border-color: var(--line); box-shadow: none; }
.cr-own-btn-ghost:hover { filter: none; background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
/* Mono palette: --cta is grayscale (near-white in dark) → white label vanishes;
   --bg is the opposite luminance (same fix as chord-styles.css mono block).
   The ghost button paints from --ink/--line, so it is already safe. */
[data-palette="mono"] .cr-own-btn { color: var(--bg) !important; }
[data-palette="mono"] .cr-own-btn-ghost { color: var(--ink) !important; }
@media (prefers-reduced-motion: reduce) { .cr-own-cta { animation: none; } }

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  /* "Analyze your own song" CTA stacks: text above a full-width tap target.
     flex-basis auto: in a column the 340px desktop basis would become HEIGHT. */
  .cr-own-cta { flex-direction: column; align-items: stretch; padding: 20px 18px; }
  .cr-own-txt { flex: 0 0 auto; }
  .cr-own-actions { align-self: stretch; min-width: 0; }
  .cr-own-btn { width: 100%; }

  .cr-wall-card { padding: 30px 22px; }
  .mixer-stems { grid-template-columns: 1fr; }

  /* The 4 progression-view tabs must never push the page wider than the viewport.
     Stack the header and let the tab bar scroll inside its own card instead. */
  .app { overflow-x: hidden; }
  .prog-top { flex-direction: column; align-items: stretch; gap: 14px; }
  .view-switch { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .view-switch::-webkit-scrollbar { display: none; }
  .view-tab { flex: 0 0 auto; white-space: nowrap; }

  /* Diagram tabs row can also overflow on very narrow screens. */
  .diag-top { flex-wrap: wrap; gap: 10px; }
  .inst-switch { overflow-x: auto; scrollbar-width: none; }
  .inst-switch::-webkit-scrollbar { display: none; }
}
