/*
 * Samples (assets/wkx-samples.js): one sample at a time, vertical snap feed.
 * Scoped to .wksf-root; reads the app's --pt-* tokens with the same fallbacks
 * as Explore. Phone first (390 px), then a two-column desktop stage.
 */
.wksf-root {
  --wksf-bg: var(--pt-bg, #07060c);
  --wksf-card: rgba(17, 15, 32, .9);
  --wksf-line: var(--pt-border-subtle, rgba(255, 255, 255, .08));
  --wksf-text: var(--pt-text-primary, #f7f5ff);
  --wksf-muted: var(--pt-text-secondary, rgba(228, 224, 246, .7));
  --wksf-faint: rgba(228, 224, 246, .5);
  --wksf-violet: var(--pt-accent, #7c5cff);
  --wksf-violet-2: var(--pt-accent-bright, #a78bfa);
  --wksf-ease: var(--pt-ease, cubic-bezier(.2, .7, .2, 1));
  grid-column: 1 / -1;
  min-width: 0;
  position: relative;
  color: var(--wksf-text);
  font: 14px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* The page is the player: the app's chrome steps aside as it does for Explore (index.html) -- no session panel,
   profile panel, debug status lines or second player bar; the shared top bar / phone menu stay. */
html body.wksf-active { padding-right: 0 !important; overflow: hidden; }
html body.wksf-active .topbar,
html body.wksf-active .panel-header,
html body.wksf-active #status,
html body.wksf-active #mode,
html body.wksf-active #note,
html body.wksf-active .session-panel,
html body.wksf-active #sessionPanel,
html body.wksf-active .profile-panel,
html body.wksf-active .embedding-status-panel,
html body.wksf-active #wkPlayer#wkPlayer,   /* wkx-chrome.css styles it at #wkPlayer#wkPlayer */
html body.wksf-active .player { display: none !important; }
html body.wksf-active .workspace { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; padding: 0 !important; }
html body.wksf-active .content-panel { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
  width: 100% !important; min-width: 0 !important; }
html body.wksf-active #results { width: 100% !important; max-width: none !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important; }

.wksf-root *, .wksf-root *::before, .wksf-root *::after { box-sizing: border-box; }
.wksf-root button { font: inherit; color: inherit; }
.wksf-root :focus-visible { outline: 2px solid var(--wksf-violet-2); outline-offset: 2px; }
.wksf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── top bar ─────────────────────────────────────────────── */
.wksf-top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: linear-gradient(180deg, rgba(7, 6, 12, .92), rgba(7, 6, 12, 0));
  pointer-events: none;
}
.wksf-top > * { pointer-events: auto; }
.wksf-modes { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--wksf-line); }
.wksf-mode { border: 0; background: none; padding: 7px 13px; border-radius: 999px; cursor: pointer; color: var(--wksf-muted); font-weight: 600; font-size: 13px; min-height: 36px; }
.wksf-mode[aria-pressed="true"] { background: var(--wksf-text); color: #0b0a12; }
.wksf-top-spacer { flex: 1; }
.wksf-iconbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--wksf-line); background: rgba(255, 255, 255, .06);
  display: inline-grid; place-items: center; cursor: pointer; position: relative;
}
.wksf-iconbtn svg { width: 18px; height: 18px; }
.wksf-iconbtn[data-on="true"]::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--wksf-violet-2); }
.wksf-newpill {
  position: absolute; z-index: 6; top: 58px; left: 50%; transform: translateX(-50%);
  border: 0; border-radius: 999px; padding: 9px 16px; min-height: 40px; cursor: pointer;
  background: var(--wksf-violet); color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(124, 92, 255, .45);
}

/* ── the feed ────────────────────────────────────────────── */
.wksf-feed {
  height: 100vh; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; overscroll-behavior: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; outline: none;
}
.wksf-feed::-webkit-scrollbar { display: none; }
.wksf-card {
  height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative;
  display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 60px 16px 18px; gap: 14px; overflow: hidden;
}
.wksf-bgart { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(48px) saturate(1.25) brightness(.42); opacity: .9; z-index: 0; transform: scale(1.1); }
.wksf-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 0%, rgba(7, 6, 12, 0) 0%, rgba(7, 6, 12, .75) 70%, #07060c 100%); z-index: 0; }
.wksf-stage, .wksf-info { position: relative; z-index: 1; min-width: 0; }

.wksf-stage { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0; width: 100%; height: 100%; container-type: size;
  align-self: stretch; justify-self: stretch; }
.wksf-art {
  position: relative; width: min(100cqw, 100cqh, 560px); aspect-ratio: 1 / 1;          /* always fits its stage */ border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, #2a1f55, #120f22); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .08);
}
.wksf-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wksf-art-initials[hidden] { display: none; }
.wksf-art-initials { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 800; color: rgba(255, 255, 255, .35); letter-spacing: -.02em; }
.wksf-card[data-playing="true"] .wksf-art { animation: wksf-breathe 6s var(--wksf-ease) infinite; }
@keyframes wksf-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.018); } }
.wksf-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(10, 8, 20, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); transition: transform .15s var(--wksf-ease), opacity .2s;
}
.wksf-play svg { width: 34px; height: 34px; }
.wksf-play:active { transform: translate(-50%, -50%) scale(.94); }
.wksf-card[data-playing="true"] .wksf-play { opacity: 0; }
.wksf-card[data-playing="true"] .wksf-art:hover .wksf-play, .wksf-card[data-playing="true"] .wksf-play:focus-visible { opacity: 1; }

.wksf-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: end; }
.wksf-meta { min-width: 0; }
.wksf-title { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wksf-producer { margin-top: 4px; font-weight: 600; color: var(--wksf-violet-2); display: block; }
.wksf-producer a { color: inherit; text-decoration: none; }
.wksf-producer a:hover { text-decoration: underline; }
.wksf-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.wksf-chip { padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--wksf-line); font-size: 12px; font-weight: 600; color: var(--wksf-muted); }

.wksf-rail { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.wksf-act {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--wksf-line); background: rgba(255, 255, 255, .08);
  display: grid; place-items: center; cursor: pointer; transition: transform .12s var(--wksf-ease), background .2s;
}
.wksf-act svg { width: 21px; height: 21px; }
.wksf-act:active { transform: scale(.92); }
.wksf-act[aria-pressed="true"] { background: rgba(244, 63, 94, .18); border-color: rgba(244, 63, 94, .5); color: #fb7185; }
.wksf-act[aria-pressed="true"] svg { fill: currentColor; }
.wksf-act-label { font-size: 10px; color: var(--wksf-faint); margin-top: -6px; }

/* scrubber + waveform */
.wksf-scrub { grid-column: 1 / -1; display: grid; gap: 4px; }
.wksf-wave { position: relative; height: 44px; }
.wksf-wave canvas { width: 100%; height: 100%; display: block; }
.wksf-eq { position: absolute; inset: 0; display: flex; align-items: center; gap: 3px; opacity: .55; }
.wksf-eq i { flex: 1; height: 30%; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.wksf-card[data-playing="true"] .wksf-eq i { animation: wksf-eq 1.1s ease-in-out infinite; background: rgba(167, 139, 250, .55); }
.wksf-eq i:nth-child(3n) { animation-delay: -.3s; } .wksf-eq i:nth-child(4n) { animation-delay: -.6s; } .wksf-eq i:nth-child(5n) { animation-delay: -.9s; }
@keyframes wksf-eq { 0%, 100% { height: 18%; } 50% { height: 80%; } }
.wksf-wave[data-real="true"] .wksf-eq { display: none; }
.wksf-range { width: 100%; margin: 0; accent-color: var(--wksf-violet-2); height: 28px; cursor: pointer; }
.wksf-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--wksf-faint); font-variant-numeric: tabular-nums; }
.wksf-vol { display: none; align-items: center; gap: 8px; color: var(--wksf-muted); font-size: 12px; }
.wksf-vol input { width: 110px; accent-color: var(--wksf-violet-2); }

/* step buttons (accessible next / previous, never the only way) */
.wksf-steps { position: absolute; z-index: 4; right: 14px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 10px; }

/* states */
.wksf-state { height: 100%; display: grid; place-items: center; text-align: center; padding: 80px 24px; color: var(--wksf-muted); }
.wksf-skel .wksf-art { animation: wksf-pulse 1.4s ease-in-out infinite; }
@keyframes wksf-pulse { 50% { opacity: .55; } }
.wksf-paywall {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: 24px;
  background: rgba(7, 6, 12, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.wksf-paywall-card { width: min(420px, 100%); text-align: center; padding: 28px 22px; border-radius: 22px; background: linear-gradient(180deg, rgba(28, 22, 52, .96), rgba(12, 10, 22, .96)); border: 1px solid rgba(167, 139, 250, .35); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.wksf-paywall h2 { margin: 0 0 8px; font-size: 21px; line-height: 1.25; }
.wksf-paywall p { margin: 0 0 18px; color: var(--wksf-muted); }
.wksf-paywall dl { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 6px 16px; margin: 0 0 20px; font-size: 13px; }
.wksf-paywall dt { color: var(--wksf-faint); text-align: right; } .wksf-paywall dd { margin: 0; text-align: left; font-weight: 700; }
.wksf-upgrade { width: 100%; min-height: 48px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 800; background: linear-gradient(135deg, var(--wksf-violet), var(--wksf-violet-2)); color: #fff; }
.wksf-later { margin-top: 8px; width: 100%; min-height: 44px; border: 0; background: none; color: var(--wksf-faint); cursor: pointer; }

/* filter sheet */
.wksf-sheet { position: absolute; z-index: 8; inset: auto 0 0 0; max-height: 78%; overflow: auto; padding: 18px 16px 24px; border-radius: 22px 22px 0 0; background: #110e1f; border-top: 1px solid var(--wksf-line); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); }
.wksf-sheet h3 { margin: 0 0 12px; font-size: 16px; }
.wksf-field { margin-bottom: 14px; }
.wksf-field > span { display: block; font-size: 12px; color: var(--wksf-faint); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.wksf-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.wksf-pill { border: 1px solid var(--wksf-line); background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 8px 12px; min-height: 40px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--wksf-muted); }
.wksf-pill[aria-pressed="true"] { background: var(--wksf-violet); border-color: var(--wksf-violet); color: #fff; }
.wksf-input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--wksf-line); background: rgba(255, 255, 255, .05); color: var(--wksf-text); padding: 0 12px; font: inherit; }
.wksf-sheet-actions { display: flex; gap: 8px; margin-top: 6px; }
.wksf-sheet-actions button { flex: 1; min-height: 46px; border-radius: 12px; border: 1px solid var(--wksf-line); background: rgba(255, 255, 255, .06); cursor: pointer; font-weight: 700; }
.wksf-sheet-actions .wksf-primary { background: var(--wksf-text); color: #0b0a12; border-color: transparent; }
.wksf-menu { position: absolute; z-index: 9; right: 16px; bottom: 90px; min-width: 220px; padding: 6px; border-radius: 14px; background: #15112a; border: 1px solid var(--wksf-line); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); }
.wksf-menu button { display: block; width: 100%; text-align: left; min-height: 44px; padding: 0 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; }
.wksf-menu button:hover, .wksf-menu button:focus-visible { background: rgba(255, 255, 255, .07); }

/* ── desktop: a centred two-column stage, not a stretched phone ─────────── */
@media (min-width: 1024px) {
  .wksf-top { padding: 14px 28px; }
  .wksf-card { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); align-items: center; gap: 40px;
    padding: 76px max(96px, calc((100% - 1180px) / 2)) 40px max(40px, calc((100% - 1180px) / 2)); }   /* right: room for the up / down buttons */
  .wksf-art { width: min(100cqw, 100cqh, 640px); border-radius: 28px; }
  .wksf-info { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 18px; }
  .wksf-title { font-size: 28px; -webkit-line-clamp: 3; }
  .wksf-producer { font-size: 15px; }
  .wksf-rail { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; order: 3; }
  .wksf-act-label { display: none; }
  .wksf-scrub { order: 2; }
  .wksf-vol { display: flex; order: 4; }
  .wksf-steps { display: flex; }
  .wksf-next { order: 5; padding-top: 14px; border-top: 1px solid var(--wksf-line); }
  .wksf-next h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--wksf-faint); }
  .wksf-next ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
  .wksf-next li { font-size: 13px; color: var(--wksf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wksf-sheet { inset: 70px 28px auto auto; width: 380px; border-radius: 18px; max-height: calc(100% - 100px); border: 1px solid var(--wksf-line); }
}
@media (max-width: 1023px) {
  .wksf-next { display: none; }
  /* phones / tablets: the action rail floats over the stage's right edge (the artwork gets the height back) */
  .wksf-info { grid-template-columns: minmax(0, 1fr); position: relative; }
  .wksf-rail { position: absolute; right: -4px; bottom: calc(100% + 14px); gap: 8px; z-index: 3; }
  .wksf-act { width: 44px; height: 44px; background: rgba(10, 8, 20, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .wksf-card { padding: 70px 32px 24px; }
  .wksf-art { width: min(100cqw, 100cqh, 560px); }
  .wksf-title { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .wksf-card[data-playing="true"] .wksf-art, .wksf-card[data-playing="true"] .wksf-eq i, .wksf-skel .wksf-art { animation: none !important; }
  .wksf-feed { scroll-behavior: auto; }
}

/* recommendations (owner 2026-10-07): more shelves scroll sideways; each card says why it is there */
.wksf-modes { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.wksf-modes::-webkit-scrollbar { display: none; }
.wksf-mode { white-space: nowrap; flex: 0 0 auto; }
.wksf-reason { font-size: 12px; font-weight: 600; letter-spacing: .01em; color: #c4b5fd; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wksf-beat, .wksf-drum { margin-left: 8px; max-width: 240px; min-height: 36px; border-radius: 999px; padding: 0 12px; font-size: 13px;
  background: rgba(255, 255, 255, .06); color: inherit; border: 1px solid var(--wksf-line); }

/* Tap to start listening (a browser that has not allowed sound yet): one tap unlocks the player */
.wksf-tapstart { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(12, 10, 28, .55), rgba(5, 5, 14, .82)); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); animation: wksf-fade .25s ease-out; }
.wksf-tapstart-btn { display: grid; justify-items: center; gap: 10px; padding: 28px 34px; border-radius: 24px; color: #fff;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(167, 139, 250, .35); box-shadow: 0 0 40px rgba(139, 92, 246, .25);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wksf-tapstart-btn strong { font-size: 17px; letter-spacing: .01em; }
.wksf-tapstart-btn small { font-size: 13px; color: rgba(255, 255, 255, .6); }
.wksf-tapstart-ring { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 0 0 0 rgba(139, 92, 246, .6); animation: wksf-pulse 1.8s infinite; }
.wksf-tapstart-ring svg { width: 26px; height: 26px; margin-left: 3px; }
@keyframes wksf-pulse { 0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .55); } 70% { box-shadow: 0 0 0 18px rgba(139, 92, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); } }
@keyframes wksf-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wksf-tapstart, .wksf-tapstart-ring { animation: none; } }
