/*
 * wkx-library.css — Library pages (All Samples, Favorites, Recently Played,
 * Playlists). Every rule is scoped to .wkl-root, or to
 * body:has(.wkl-root) for the few page-chrome adjustments these views need
 * while they are mounted, so no other page is affected.
 */

/* ── Page chrome while a Library view is mounted ───────────────────────── */
body:has(.wkl-root) { padding-right: 0 !important; }
/* Keyboard focus (and scrollIntoView) brings a row up clear of the fixed
   player bar, never behind it. */
html:has(.wkl-root) { scroll-padding-bottom: calc(var(--player-height, 84px) + 16px); }
/* .main is overflow-y:auto but never height-bound, so the document is what
   scrolls; as a scroll container it would stop the rail from sticking. */
body:has(.wkl-root) .main { overflow: visible !important; }
body:has(.wkl-root) .session-panel,
body:has(.wkl-root) .profile-panel,
body:has(.wkl-root) .content-panel > .panel-header,
body:has(.wkl-root) #status,
body:has(.wkl-root) #mode,
body:has(.wkl-root) #note { display: none !important; }
body:has(.wkl-root) .workspace {
  display: block !important;
  padding: 0 !important;
  gap: 0 !important;
}
body:has(.wkl-root) .content-panel {
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
}
body:has(.wkl-root) #results {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  gap: 0 !important;
}

/* ── Tokens ────────────────────────────────────────────────────────────── */
.wkl-root {
  --wkl-surface: rgba(15, 17, 30, 0.78);
  --wkl-surface-2: rgba(21, 24, 42, 0.92);
  --wkl-surface-3: #171a2e;
  --wkl-border: rgba(160, 170, 255, 0.09);
  --wkl-border-2: rgba(160, 170, 255, 0.16);
  --wkl-text: #f4f5fb;
  --wkl-muted: #8e93aa;
  --wkl-dim: #5c6079;
  --wkl-violet: #7c3aed;
  --wkl-violet-2: #8b5cf6;
  --wkl-violet-3: #b4a0ff;
  --wkl-blue: #3b82f6;
  --wkl-blue-2: #7cb4ff;
  --wkl-radius-lg: 18px;
  --wkl-radius: 14px;
  --wkl-radius-sm: 10px;
  --wkl-player-h: var(--player-height, 84px);

  position: relative;
  box-sizing: border-box;
  min-height: 100%;
  /* --wkl-bottom-pad (set by the module): what it takes, on top of .main's
     own bottom padding, to end 24px clear of the player bar. */
  padding: 20px 24px var(--wkl-bottom-pad, calc(var(--wkl-player-h) + 36px));
  color: var(--wkl-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}
.wkl-root *, .wkl-root *::before, .wkl-root *::after { box-sizing: border-box; }
/* Specificity 0,1,0 (:where adds none): beats the browser's control fonts,
   while every single-class control rule below wins by source order. */
.wkl-root :where(button, input, select, textarea) { font: inherit; color: inherit; }
.wkl-root button { cursor: pointer; }
.wkl-root :focus-visible {
  outline: 2px solid var(--wkl-violet-3);
  outline-offset: 2px;
  border-radius: 8px;
}
.wkl-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wkl-root [hidden] { display: none !important; }
.wkl-dim { color: var(--wkl-dim); }
.wkl-muted { color: var(--wkl-muted); margin: 0; font-size: 13px; }
.wkl-root svg { display: block; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.wkl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 284px;
  gap: 18px;
  align-items: start;
}
.wkl-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  container-type: inline-size;
  container-name: wklmain;
}
.wkl-rail {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.wkl-root .wkl-rail-close-row, .wkl-root .wkl-rail-backdrop, .wkl-root .wkl-filters-toggle { display: none; }

/* The shared top bar (wkx-topbar.js) spans the page above the view and its
   rail; its field is the page's search, so the view's own form stays out of
   sight (in the page, for its handlers). */
.wkl-topbar-slot { min-width: 0; }
.wkl-topbar-slot:empty { display: none; }
.wkl-root.wkl-has-topbar [data-wkl-search-form] { display: none !important; }

/* ── Search ───────────────────────────────────────────────────────────── */
.wkl-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 8px 0 16px;
  border-radius: 14px;
  background: var(--wkl-surface);
  border: 1px solid var(--wkl-border-2);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.wkl-search:focus-within {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}
.wkl-search-icon { width: 18px; height: 18px; color: var(--wkl-muted); flex: none; }
.wkl-search-icon svg { width: 18px; height: 18px; }
.wkl-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 14.5px;
}
.wkl-root .wkl-search-input:focus-visible { outline: none; }
.wkl-search-input::placeholder { color: var(--wkl-dim); }
.wkl-search-input::-webkit-search-cancel-button { display: none; }
.wkl-search-clear {
  width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: transparent; color: var(--wkl-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.wkl-search-clear svg { width: 15px; height: 15px; }
.wkl-search-clear:hover { color: var(--wkl-text); background: rgba(255, 255, 255, 0.06); }
.wkl-search-go {
  height: 34px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--wkl-border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--wkl-text); font-size: 13px; font-weight: 600;
}
.wkl-search-go:hover { background: rgba(139, 92, 246, 0.16); border-color: rgba(139, 92, 246, 0.4); }

/* ── Header ───────────────────────────────────────────────────────────── */
.wkl-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 2px 2px 0;
}
.wkl-h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.wkl-h1-count { color: var(--wkl-violet-3); font-weight: 700; }
.wkl-subtitle { margin: 6px 0 0; color: var(--wkl-muted); font-size: 14.5px; }
.wkl-head-tools { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.wkl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}
.wkl-btn svg { width: 16px; height: 16px; flex: none; }
.wkl-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.wkl-btn-primary:hover { filter: brightness(1.08); }
.wkl-btn-ghost {
  color: var(--wkl-text);
  background: var(--wkl-surface);
  border-color: var(--wkl-border-2);
}
.wkl-btn-ghost:hover { border-color: rgba(139, 92, 246, 0.45); background: rgba(139, 92, 246, 0.1); }
.wkl-btn-block { width: 100%; }
.wkl-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--wkl-violet-2); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.wkl-link {
  background: none; border: 0; padding: 2px 0;
  color: var(--wkl-violet-3); font-size: 13px; font-weight: 600;
}
.wkl-link:hover { color: #fff; text-decoration: underline; }
.wkl-icon-btn {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--wkl-muted);
  font-size: 16px; line-height: 1;
}
.wkl-icon-btn svg { width: 17px; height: 17px; }
.wkl-icon-btn:hover { color: var(--wkl-text); background: rgba(255, 255, 255, 0.06); border-color: var(--wkl-border); }
.wkl-like.is-on { color: #c4b5fd; }
.wkl-like.is-on:hover { color: #ddd6fe; }
.wkl-similar { font-weight: 700; font-size: 17px; }
/* ♫ comes from the app's createSongBtnHtml — size it like the other icons. */
.wkl-root .wkx-create-song-btn.wkl-create {
  width: 30px; height: 30px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--wkl-border);
  background: rgba(255, 255, 255, 0.03); color: var(--wkl-text);
}
.wkl-root .wkx-create-song-btn.wkl-create svg { width: 15px; height: 15px; }
.wkl-root .wkx-create-song-btn.wkl-create:hover { border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.14); }
.wkl-root .wkx-create-song-btn.wkl-create.is-unavailable { opacity: 0.4; }

/* Play buttons: violet disc, filled when the sample is playing. */
.wkl-play {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(180, 160, 255, 0.35);
  background: rgba(124, 58, 237, 0.18);
  color: #fff;
  padding: 0;
  flex: none;
}
.wkl-play svg { width: 55%; height: 55%; }
.wkl-play:hover { background: rgba(124, 58, 237, 0.4); }
.wkl-play.is-on {
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
  border-color: rgba(221, 214, 254, 0.6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16), 0 6px 18px rgba(109, 40, 217, 0.45);
}
.wkl-play-sm { width: 28px; height: 28px; }

/* ── Section cards ────────────────────────────────────────────────────── */
.wkl-best, .wkl-list, .wkl-panel, .wkl-sim {
  background: linear-gradient(180deg, rgba(17, 19, 34, 0.82), rgba(10, 11, 21, 0.82));
  border: 1px solid var(--wkl-border);
  border-radius: var(--wkl-radius-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.wkl-best { padding: 16px 18px 18px; }
.wkl-list { padding: 16px 18px 6px; }
.wkl-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.wkl-h2 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.wkl-count { color: var(--wkl-muted); font-weight: 500; }
.wkl-section-sub { margin: 3px 0 0; color: var(--wkl-muted); font-size: 12.5px; }
.wkl-ai {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 6px;
  color: #fff; background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}

/* ── Best Matches ─────────────────────────────────────────────────────── */
.wkl-best-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(146px, 1fr);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
}
.wkl-best-empty { padding: 8px 2px 4px; }
.wkl-card {
  scroll-snap-align: start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 9px 9px 11px;
  border-radius: 16px;
  background: var(--wkl-surface-2);
  border: 1px solid var(--wkl-border);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}
.wkl-card:hover { border-color: var(--wkl-border-2); }
.wkl-card.is-selected { border-color: rgba(139, 92, 246, 0.55); }
.wkl-card.is-playing { border-color: rgba(139, 92, 246, 0.75); box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3), 0 12px 30px rgba(109, 40, 217, 0.22); }
.wkl-card-art {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #11131f;
}
.wkl-card-img, .wkl-card-art .wkl-art-empty {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.wkl-card-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(4, 5, 12, 0.82) 100%);
}
.wkl-card-like {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(6, 7, 14, 0.55); border-color: rgba(255, 255, 255, 0.12); color: #fff;
  backdrop-filter: blur(6px);
}
.wkl-card-play {
  position: absolute; left: 50%; top: 46%; z-index: 2;
  width: 46px; height: 46px; transform: translate(-50%, -50%);
  background: rgba(8, 9, 18, 0.55); border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}
.wkl-card-foot {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2;
  display: flex; align-items: center; gap: 8px;
}
.wkl-card-foot .wkl-wave { flex: 1; min-width: 0; height: 20px; }
.wkl-card-dur { font-size: 11.5px; color: #e6e7f2; font-variant-numeric: tabular-nums; }
.wkl-root .wkl-card-foot .wkx-create-song-btn.wkl-create {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(124, 58, 237, 0.55); border-color: rgba(221, 214, 254, 0.35);
}
.wkl-card-body { display: flex; flex-direction: column; gap: 3px; padding: 0 3px; min-width: 0; }
/* Titles get two lines, so the picks can be told apart (one line cut
   them off after a dozen characters on 150-185px cards). */
.wkl-card-title-row { display: flex; align-items: flex-start; gap: 2px; min-width: 0; }
.wkl-card-title {
  flex: 1; min-width: 0;
  margin: 0; font-size: 14px; font-weight: 700; line-height: 1.25;
  overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.wkl-card-title-row .wkl-more { width: 24px; height: 24px; margin-right: -4px; }
.wkl-card-producer { font-size: 12.5px; color: var(--wkl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wkl-card-meta { display: flex; align-items: center; gap: 5px; margin-top: 5px; min-width: 0; }
.wkl-card-meta .wkl-pill, .wkl-card-meta .wkl-key { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wkl-card-foot .wkl-similar {
  width: 26px; height: 26px; border-radius: 50%; font-size: 15px;
  color: #fff; background: rgba(6, 7, 14, 0.55); border-color: rgba(255, 255, 255, 0.16);
}
.wkl-pill {
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--wkl-border);
  white-space: nowrap;
}
.wkl-best-skel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.wkl-best-skel span { aspect-ratio: 0.8; border-radius: 16px; background: rgba(255, 255, 255, 0.035); animation: wkl-pulse 1.4s ease-in-out infinite; }

/* ── Producer links inside Library views ──────────────────────────────── */
.wkl-root .pt-producer-link {
  color: var(--wkl-muted); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: inline-block; vertical-align: bottom;
}
.wkl-root .pt-producer-link:hover { color: var(--wkl-blue-2); text-decoration: underline; }

/* ── List / table ─────────────────────────────────────────────────────── */
.wkl-list-head { align-items: center; }
.wkl-list-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.wkl-select, .wkl-root .wkl-field select, .wkl-root .wkl-field input[type="text"] {
  height: 34px;
  padding: 0 30px 0 11px;
  border-radius: 10px;
  border: 1px solid var(--wkl-border-2);
  background: var(--wkl-surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%238e93aa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--wkl-text);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
}
.wkl-root .wkl-field input[type="text"] { background-image: none; padding-right: 11px; width: 100%; }
.wkl-select:hover, .wkl-root .wkl-field select:hover { border-color: rgba(139, 92, 246, 0.45); }
.wkl-root option { background: #12142a; color: var(--wkl-text); }
.wkl-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--wkl-muted); cursor: pointer; user-select: none; }
.wkl-check input { width: 15px; height: 15px; accent-color: var(--wkl-violet-2); margin: 0; }

.wkl-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 12px; }
.wkl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px 0 11px; border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.12);
  font-size: 12.5px; font-weight: 600; color: #e9e3ff;
}
.wkl-chip svg { width: 12px; height: 12px; opacity: 0.8; }
.wkl-chip:hover { background: rgba(139, 92, 246, 0.22); }

.wkl-table-wrap { position: relative; min-width: 0; }
.wkl-table-wrap.is-loading { opacity: 0.55; pointer-events: none; transition: opacity 120ms ease; }
.wkl-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.wkl-table th {
  text-align: left;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--wkl-muted);
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--wkl-border);
  white-space: nowrap;
}
.wkl-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  vertical-align: middle;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkl-table tbody tr:last-child td { border-bottom: 0; }
.wkl-row { cursor: pointer; transition: background 120ms ease; }
.wkl-row:hover td { background: rgba(255, 255, 255, 0.025); }
.wkl-row.is-selected td { background: rgba(124, 58, 237, 0.09); }
.wkl-row.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--wkl-violet-2); }
.wkl-row.is-current .wkl-name { color: var(--wkl-violet-3); }
.wkl-row td:first-child { border-radius: 10px 0 0 10px; }
.wkl-row td:last-child { border-radius: 0 10px 10px 0; }

/* Fixed columns are kept lean so the sample name (the column that tells rows
   apart) keeps ~175px+ of text at 1440 with the rail inline. */
/* # is sized per page by the table itself (inline width: the longest number). */
.wkl-c-index { width: 28px; color: var(--wkl-muted); font-variant-numeric: tabular-nums; }
.wkl-table th.wkl-c-index, .wkl-table td.wkl-c-index { padding-left: 6px; padding-right: 4px; text-overflow: clip; }
.wkl-table td.wkl-c-index { font-size: 12px; }
.wkl-c-title { width: auto; }
.wkl-c-wave { width: 104px; }
.wkl-c-bpm { width: 48px; font-variant-numeric: tabular-nums; }
/* Wide enough for the widest pill ("G# min", "C# maj"). */
.wkl-c-key { width: 68px; }
.wkl-table th.wkl-c-key, .wkl-table td.wkl-c-key { padding-left: 6px; padding-right: 6px; }
.wkl-c-producer { width: 104px; }
.wkl-c-added { width: 92px; color: var(--wkl-muted); }
.wkl-table td.wkl-c-added { font-size: 12.5px; }
.wkl-c-duration { width: 58px; font-variant-numeric: tabular-nums; }
/* Four 28px icon buttons (♥ ≈ ♫ ⋯) edge to edge. */
.wkl-c-actions { width: 120px; }
.wkl-table th.wkl-c-actions, .wkl-table td.wkl-c-actions { padding-left: 4px; padding-right: 4px; }
.wkl-table td.wkl-c-actions { overflow: visible; }
.wkl-table td.wkl-c-producer { font-size: 12.5px; }

.wkl-title-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wkl-thumb-wrap { position: relative; width: 32px; height: 32px; flex: none; }
.wkl-thumb, .wkl-title-cell .wkl-art-empty {
  display: block;
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none;
  background: #151729; border: 1px solid rgba(255, 255, 255, 0.06);
}
/* The row's play button, on the artwork. Always visible on touch screens;
   with a mouse it shows on hover / focus and for the selected or current row. */
.wkl-thumb-wrap .wkl-play-sm {
  position: absolute; left: 3px; top: 3px; width: 26px; height: 26px;
  background: rgba(8, 9, 18, 0.62); border-color: rgba(255, 255, 255, 0.3);
}
.wkl-thumb-wrap .wkl-play-sm:hover { background: rgba(124, 58, 237, 0.7); }
.wkl-thumb-wrap .wkl-play-sm.is-on { background: linear-gradient(180deg, #8b5cf6, #6d28d9); border-color: rgba(221, 214, 254, 0.6); }
@media (hover: hover) {
  .wkl-thumb-wrap .wkl-play-sm { opacity: 0; transition: opacity 120ms ease; }
  .wkl-row:hover .wkl-play-sm, .wkl-row:focus-within .wkl-play-sm,
  .wkl-row.is-selected .wkl-play-sm, .wkl-row.is-current .wkl-play-sm { opacity: 1; }
}
.wkl-title-text { display: flex; flex-direction: column; min-width: 0; }
/* Name + pack in two tight lines: the row stays ~41px. */
.wkl-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkl-sub { font-size: 11.5px; line-height: 1.25; color: var(--wkl-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkl-actions { display: flex; align-items: center; gap: 0; justify-content: flex-end; }
.wkl-actions .wkl-icon-btn, .wkl-root .wkl-actions .wkx-create-song-btn.wkl-create { width: 28px; height: 28px; }

.wkl-key {
  display: inline-block;
  white-space: nowrap;
  font-size: 11.5px; font-weight: 650;
  padding: 2px 7px;
  border-radius: 7px;
  color: #d9ccff;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.32);
}
.wkl-key.is-minor {
  color: #b8d6ff;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.32);
}

/* Waveform slot: a neutral centre line until the player has real peaks. */
.wkl-wave {
  display: block;
  width: 100%;
  height: 24px;
  color: var(--wkl-violet-3);
  background: linear-gradient(90deg, rgba(160, 170, 255, 0.16), rgba(160, 170, 255, 0.16)) center / 100% 2px no-repeat;
  border-radius: 2px;
}
.wkl-wave.is-real { background: none; }
.wkl-wave-svg { width: 100%; height: 100%; fill: currentColor; opacity: 0.8; }
.wkl-row.is-current .wkl-wave, .wkl-card.is-current .wkl-wave { color: #c9b8ff; }
.wkl-card-foot .wkl-wave { background-color: transparent; color: #d7cbff; }

/* Skeleton + states */
.wkl-skel { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 14px; }
.wkl-skel-row { display: grid; grid-template-columns: 34px 1fr 120px 90px; gap: 14px; align-items: center; }
.wkl-skel-row span { height: 14px; border-radius: 7px; background: rgba(255, 255, 255, 0.045); animation: wkl-pulse 1.4s ease-in-out infinite; }
.wkl-skel-row span:first-child { height: 34px; border-radius: 8px; }
@keyframes wkl-pulse { 50% { opacity: 0.45; } }
.wkl-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 16px; text-align: center; color: var(--wkl-muted);
}
.wkl-state p { margin: 0; }
.wkl-state-error p { color: #fca5a5; }
.wkl-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(139, 92, 246, 0.25); border-top-color: var(--wkl-violet-3);
  animation: wkl-spin 0.8s linear infinite;
}
@keyframes wkl-spin { to { transform: rotate(360deg); } }

/* Pager */
.wkl-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 2px 12px;
  border-top: 1px solid var(--wkl-border);
  margin-top: 4px;
}
.wkl-pager-info { font-size: 12.5px; color: var(--wkl-muted); }
.wkl-pager-info b { color: var(--wkl-text); font-weight: 650; }
.wkl-pager-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wkl-pager-num, .wkl-pager-step {
  min-width: 32px; height: 30px; padding: 0 9px; border-radius: 9px;
  border: 1px solid var(--wkl-border); background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px; font-weight: 600; color: var(--wkl-text);
}
.wkl-pager-num:hover, .wkl-pager-step:hover:not(:disabled) { border-color: rgba(139, 92, 246, 0.45); }
.wkl-pager-num.is-on { background: rgba(139, 92, 246, 0.22); border-color: rgba(139, 92, 246, 0.55); color: #fff; }
.wkl-pager-step:disabled { opacity: 0.4; cursor: default; }
.wkl-pager-gap { color: var(--wkl-dim); padding: 0 2px; }

/* ── Rail: filters + preview ─────────────────────────────────────────── */
.wkl-panel { padding: 16px; }
.wkl-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 12px; }
.wkl-panel-title { margin: 0 0 12px; font-size: 16px; font-weight: 750; }
.wkl-panel-head .wkl-panel-title { margin: 0; }
.wkl-filter-form { display: flex; flex-direction: column; gap: 0; }
.wkl-field {
  display: flex; flex-direction: column; gap: 7px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 13px;
}
.wkl-field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.wkl-field-inline select, .wkl-root .wkl-field-inline input[type="text"] { width: 58%; }
.wkl-field-label { color: #d5d7e6; font-weight: 600; }
.wkl-field-row { display: flex; align-items: center; justify-content: space-between; }
.wkl-field-value {
  font-size: 12px; font-weight: 600; color: var(--wkl-text);
  padding: 2px 8px; border-radius: 7px; border: 1px solid var(--wkl-border-2); background: var(--wkl-surface-3);
}
.wkl-field-error { margin: 10px 0 0; color: #fca5a5; font-size: 12.5px; }
.wkl-filter-form .wkl-btn-block { margin-top: 12px; }
.wkl-root .wkl-rail .wkl-field select, .wkl-root .wkl-rail .wkl-field input[type="text"] { height: 32px; }
.wkl-filters-note { margin-top: 10px; }

/* Dual-thumb BPM range: two native range inputs over one track. */
.wkl-range { position: relative; height: 22px; }
.wkl-range::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
  border-radius: 2px; background: rgba(255, 255, 255, 0.1);
}
.wkl-range-fill {
  position: absolute; top: 50%; height: 4px; margin-top: -2px; left: 0; right: 0;
  border-radius: 2px; background: linear-gradient(90deg, var(--wkl-violet-2), var(--wkl-blue));
}
.wkl-range input[type="range"] {
  position: absolute; left: 0; top: 0; width: 100%; height: 22px; margin: 0;
  background: transparent; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.wkl-range input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 22px; }
.wkl-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto;
  width: 16px; height: 16px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: 3px solid var(--wkl-violet-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); cursor: pointer;
}
.wkl-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--wkl-violet-2); cursor: pointer;
}
.wkl-range input[type="range"]:focus-visible { outline: none; }
.wkl-range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(180, 160, 255, 0.45); }

.wkl-preview-main { display: flex; gap: 12px; align-items: center; min-width: 0; }
.wkl-preview-art, .wkl-preview-main .wkl-art-empty {
  width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none;
  background: #151729; border: 1px solid rgba(255, 255, 255, 0.07);
}
.wkl-preview-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wkl-preview-name {
  font-weight: 750; font-size: 14.5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.wkl-preview-producer { font-size: 12.5px; min-width: 0; }
.wkl-preview-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: #cfd2e3; margin-top: 3px; }
.wkl-preview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.wkl-preview-play { flex: 1 1 100%; border-radius: 11px; height: 40px; }
.wkl-root .wkl-preview-actions > :not(.wkl-preview-play) { flex: 1 1 0; }
.wkl-preview-play.wkl-play { border: 0; background: linear-gradient(180deg, #8b5cf6, #6d28d9); box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.wkl-preview-play.wkl-play:hover { filter: brightness(1.08); }
.wkl-preview-play.wkl-play svg { width: 16px; height: 16px; }
.wkl-preview-actions .wkl-icon-btn, .wkl-root .wkl-preview-actions .wkx-create-song-btn.wkl-create {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--wkl-border-2); background: var(--wkl-surface-3);
}

/* ── Menu ─────────────────────────────────────────────────────────────── */
.wkl-menu {
  position: absolute; z-index: 50;
  min-width: 210px;
  padding: 6px;
  border-radius: 12px;
  background: #13152a;
  border: 1px solid rgba(160, 170, 255, 0.16);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column;
}
.wkl-root .wkl-menu-item {
  display: block; width: 100%;
  text-align: left; padding: 8px 10px; border-radius: 8px;
  border: 0; background: transparent;
  color: var(--wkl-text); font-size: 13px; font-weight: 500; text-decoration: none;
  max-width: none; white-space: nowrap;
}
.wkl-root .wkl-menu-item.wkx-create-song-btn {
  height: auto; border-radius: 8px; color: var(--wkl-text);
  display: flex; align-items: center; gap: 8px;
  line-height: 1.4;   /* the app's ♫ button zeroes it (icon-only elsewhere) */
}
.wkl-root .wkl-menu-item.wkx-create-song-btn svg { width: 13px; height: 13px; }
.wkl-root .wkl-menu-item:hover, .wkl-root .wkl-menu-item:focus-visible {
  background: rgba(139, 92, 246, 0.16); color: #fff; outline: none; text-decoration: none;
}

/* ── Shared bits for Favorites / Recently Played ──────────────────────── */
.wkl-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.wkl-btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #e11d48, #9f1239);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.wkl-btn-danger:hover { filter: brightness(1.08); }
.wkl-select-wrap { display: inline-flex; align-items: center; gap: 8px; }
.wkl-sort-label { font-size: 13px; color: var(--wkl-muted); white-space: nowrap; }
.wkl-select-sm { height: 30px; font-size: 12.5px; padding: 0 26px 0 10px; background-position: right 8px center; }
.wkl-filter-buttons { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 14px; }
.wkl-insights { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wkl-insights-main:empty { display: none; }
.wkl-insights-main .wkl-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.wkl-panel-sub { margin: -6px 0 10px; font-size: 12px; color: var(--wkl-muted); }

.wkl-c-played { width: 96px; }
.wkl-table td.wkl-c-played { font-size: 12.5px; color: var(--wkl-violet-3); }
/* Favorites / Recently Played carry more columns: slimmer fixed columns so
   the sample name keeps its room. */
.wkl-view-fav .wkl-c-wave, .wkl-view-recent .wkl-c-wave { width: 78px; }
/* "WAVEFORM" is about as wide as this column at the default tracking. */
.wkl-view-fav .wkl-table th.wkl-c-wave, .wkl-view-recent .wkl-table th.wkl-c-wave { letter-spacing: 0.04em; padding-right: 2px; }
.wkl-view-fav .wkl-c-producer, .wkl-view-recent .wkl-c-producer { width: 104px; }
.wkl-view-fav .wkl-c-bpm, .wkl-view-recent .wkl-c-bpm { width: 44px; }
.wkl-view-fav .wkl-key, .wkl-view-recent .wkl-key { padding: 2px 6px; }
/* Both fit the widest relative time ("17 hours ago", "Sep 24, 2025"). */
.wkl-view-fav .wkl-c-added { width: 94px; }
.wkl-view-recent .wkl-c-played { width: 94px; }
.wkl-view-recent .wkl-c-duration { width: 52px; }
.wkl-view-fav .wkl-table td.wkl-c-added, .wkl-view-recent .wkl-table td.wkl-c-played { font-size: 12px; }
.wkl-row.is-unliked td:not(.wkl-c-actions) { opacity: 0.42; }
.wkl-row.is-unliked .wkl-name { text-decoration: line-through; text-decoration-color: rgba(180, 160, 255, 0.5); }

/* Empty states */
.wkl-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 52px 16px 46px;
}
.wkl-empty-icon {
  width: 56px; height: 56px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; color: #c4b5fd;
  background: rgba(139, 92, 246, 0.13); border: 1px solid rgba(139, 92, 246, 0.3);
}
.wkl-empty-icon svg { width: 26px; height: 26px; }
.wkl-empty-title { margin: 0; font-size: 18px; font-weight: 800; }
.wkl-empty-text { margin: 0; max-width: 420px; color: var(--wkl-muted); font-size: 13.5px; }
.wkl-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }

/* Confirmation dialog */
.wkl-dialog-backdrop {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(3, 4, 10, 0.62);
}
.wkl-dialog {
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: #12142a;
  border: 1px solid rgba(160, 170, 255, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  color: var(--wkl-text);
}
.wkl-dialog-title { margin: 0 0 10px; font-size: 18px; font-weight: 800; }
.wkl-dialog-body { color: #c9cbe0; font-size: 13.5px; line-height: 1.5; }
.wkl-dialog-body p { margin: 0 0 8px; }
.wkl-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Favorites ────────────────────────────────────────────────────────── */
.wkl-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 44%);
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border-radius: var(--wkl-radius-lg);
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(124, 58, 237, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(19, 20, 38, 0.92), rgba(11, 12, 24, 0.92));
  border: 1px solid rgba(139, 92, 246, 0.22);
}
.wkl-hero-copy { min-width: 0; position: relative; z-index: 1; }
.wkl-hero-titlerow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.wkl-hero-icon { width: 26px; height: 26px; color: #c4b5fd; flex: none; }
.wkl-hero-icon svg { width: 26px; height: 26px; }
.wkl-hero-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.wkl-hero-tag { font-size: 10.5px; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; color: var(--wkl-muted); }
.wkl-hero-sub { margin: 4px 0 14px; color: var(--wkl-muted); font-size: 13.5px; }
.wkl-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.wkl-hero-btn {
  height: 42px; padding: 0 20px; border-radius: 12px;
  background: linear-gradient(90deg, #7c3aed, #5b43e8 60%, #3b82f6);
}
/* One fixed-height line whatever the sample name: selecting a row (which
   happens on mousedown, via focus) rewrites it, and a height change here
   would move the table under the pointer between mousedown and mouseup. */
.wkl-hero-seed {
  flex: 1 1 180px; margin: 0; min-width: 0;
  height: 18px; line-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12.5px; color: var(--wkl-muted);
}
.wkl-hero-seed b { color: var(--wkl-text); font-weight: 650; }
.wkl-hero-art { height: 112px; min-width: 0; opacity: 0.9; }
.wkl-hero-art svg { width: 100%; height: 100%; }

.wkl-sim { padding: 16px 18px 18px; }
.wkl-sim .wkl-list-tools { gap: 6px; }

.wkl-assist-form {
  display: flex; align-items: stretch;
  margin-top: 12px;
  border-radius: 12px; overflow: hidden;
  background: var(--wkl-surface-3);
  border: 1px solid var(--wkl-border-2);
}
.wkl-assist-form:focus-within { border-color: rgba(139, 92, 246, 0.55); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14); }
.wkl-assist-form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  background: transparent; border: 0; outline: none; font-size: 13px;
}
.wkl-root .wkl-assist-form input:focus-visible { outline: none; }
.wkl-assist-form input::placeholder { color: var(--wkl-dim); }
.wkl-assist-go {
  width: 46px; flex: none; border: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}
.wkl-assist-go svg { width: 18px; height: 18px; }
.wkl-assist-note { margin: 8px 0 0; font-size: 11.5px; color: var(--wkl-dim); }

/* Keep "title · View all" on one line in the rail. */
.wkl-topprod-panel .wkl-panel-head { flex-wrap: nowrap; }
.wkl-topprod-panel .wkl-panel-title { font-size: 13.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wkl-topprod-panel .wkl-panel-head .wkl-link { flex: none; }
.wkl-topprod-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 4px;
}
.wkl-topprod {
  width: 100%; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px 8px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; text-align: center;
}
.wkl-topprod:hover { background: rgba(255, 255, 255, 0.035); }
.wkl-topprod.is-on { border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.12); }
.wkl-topprod-art { position: relative; width: 52px; height: 52px; margin-bottom: 8px; }
.wkl-topprod-img {
  width: 52px; height: 52px; display: block; object-fit: cover;
  border-radius: 50%; background: #151729; border: 2px solid rgba(139, 92, 246, 0.5);
}
.wkl-topprod-rank {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; color: #fff;
  background: #1b1d33; border: 1px solid rgba(139, 92, 246, 0.6);
}
/* Up to two lines, broken anywhere: handles are one long word ("@prodbycarter"). */
.wkl-topprod-name {
  max-width: 100%; font-size: 11.5px; font-weight: 650; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.wkl-topprod-count { font-size: 11px; color: var(--wkl-muted); white-space: nowrap; }

/* ── Recently Played ──────────────────────────────────────────────────── */
.wkl-head-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.wkl-head-icon {
  width: 56px; height: 56px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; color: #fff;
  background: linear-gradient(145deg, #8b5cf6, #5b21b6);
  box-shadow: 0 8px 22px rgba(109, 40, 217, 0.28);
}
.wkl-head-icon svg { width: 28px; height: 28px; }
.wkl-accent {
  background: linear-gradient(90deg, #b39dff, #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wkl-viewbar { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.wkl-view-pill {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px;
  border-radius: 11px; font-size: 13.5px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.wkl-clear-history { height: 34px; padding: 0 12px; font-size: 13px; }

/* "Continue where you left off": one compact strip above the list. */
.wkl-continue {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--wkl-radius);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.16), rgba(17, 19, 34, 0.82) 55%);
  border: 1px solid rgba(139, 92, 246, 0.28);
}
.wkl-continue-art { position: relative; width: 56px; height: 56px; }
.wkl-continue-img, .wkl-continue-art .wkl-art-empty {
  display: block; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--wkl-surface-3);
}
.wkl-continue-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wkl-continue-eyebrow {
  margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wkl-violet-3);
}
.wkl-continue-name { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wkl-continue-sub { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 12.5px; color: var(--wkl-muted); }
.wkl-continue-producer { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wkl-continue-time { flex: none; font-variant-numeric: tabular-nums; }
.wkl-continue-bar { height: 4px; margin-top: 4px; max-width: 360px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.wkl-continue-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #b4a0ff); }
.wkl-continue-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wkl-continue-play { height: 36px; padding: 0 14px; }
.wkl-continue-back { height: 36px; padding: 0 12px; max-width: 240px; }
.wkl-continue-back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@container wklmain (max-width: 720px) {
  .wkl-continue { grid-template-columns: 48px minmax(0, 1fr); }
  .wkl-continue-art, .wkl-continue-img, .wkl-continue-art .wkl-art-empty { width: 48px; height: 48px; }
  .wkl-continue-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .wkl-continue-back { max-width: 100%; }
}

.wkl-activity .wkl-panel-head { flex-wrap: nowrap; }
.wkl-activity .wkl-panel-title { white-space: nowrap; font-size: 15px; }
.wkl-stat { display: flex; flex-direction: column; gap: 2px; }
.wkl-stat-num { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.wkl-stat-label { font-size: 13px; font-weight: 600; color: #d5d7e6; }
.wkl-stat-sub { font-size: 12px; color: var(--wkl-muted); }
.wkl-stat-skel { display: flex; flex-direction: column; gap: 8px; }
.wkl-stat-skel span { display: block; height: 30px; width: 110px; border-radius: 8px; background: rgba(255, 255, 255, 0.045); animation: wkl-pulse 1.4s ease-in-out infinite; }
.wkl-stat-skel span + span { height: 96px; width: 100%; }
/* In the main column (rail is a drawer) the overview is a compact strip:
   the number beside the chart, three top samples. */
.wkl-insights-main .wkl-panel { padding: 14px 16px; }
.wkl-insights-main .wkl-panel-head { margin-bottom: 8px; }
.wkl-insights-main .wkl-activity-body { display: grid; grid-template-columns: minmax(104px, auto) minmax(0, 1fr); gap: 18px; align-items: end; }
.wkl-insights-main .wkl-stat-num { font-size: 28px; }
.wkl-insights-main .wkl-bars { height: 92px; margin-top: 0; }
.wkl-insights-main .wkl-top-row:nth-child(n+4) { display: none; }
.wkl-insights-main .wkl-top-row { padding: 4px; }

.wkl-bars { display: flex; align-items: stretch; gap: 8px; height: 120px; margin-top: 14px; }
.wkl-bars.is-dense { gap: 3px; }
.wkl-bar-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wkl-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wkl-bar {
  width: 100%; max-width: 22px; min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.95), rgba(109, 40, 217, 0.5));
}
.wkl-bars.is-dense .wkl-bar { border-radius: 3px 3px 2px 2px; }
.wkl-bar-col.is-zero .wkl-bar { height: 3px !important; background: rgba(255, 255, 255, 0.08); }
.wkl-bar-col.is-now .wkl-bar { background: linear-gradient(180deg, #b39dff, #7c3aed); box-shadow: 0 0 14px rgba(139, 92, 246, 0.4); }
/* Today with no plays looks like any empty day (the bold label still marks it). */
.wkl-bar-col.is-now.is-zero .wkl-bar { background: rgba(255, 255, 255, 0.08); box-shadow: none; }
.wkl-bar-label { height: 13px; font-size: 11px; line-height: 13px; color: var(--wkl-muted); white-space: nowrap; }
.wkl-bar-col.is-now .wkl-bar-label { color: var(--wkl-text); font-weight: 650; }

.wkl-top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
/* Name on line 1 across the plays column; producer and play count on
   line 2, so a 252px panel still shows most of each name. */
.wkl-top-row {
  display: grid; grid-template-columns: 12px 40px minmax(0, 1fr) auto 26px;
  grid-template-rows: auto auto;
  align-items: center; column-gap: 8px; row-gap: 0;
  padding: 6px 4px; border-radius: 10px; cursor: pointer;
}
.wkl-top-row:hover { background: rgba(255, 255, 255, 0.03); }
.wkl-top-row.is-selected { background: rgba(124, 58, 237, 0.09); }
.wkl-top-row.is-current .wkl-top-name { color: var(--wkl-violet-3); }
.wkl-top-rank { grid-column: 1; grid-row: 1 / 3; font-size: 12px; color: var(--wkl-muted); text-align: center; font-variant-numeric: tabular-nums; }
.wkl-top-art { grid-column: 2; grid-row: 1 / 3; position: relative; width: 40px; height: 40px; }
.wkl-top-img, .wkl-top-art .wkl-art-empty {
  display: block; width: 40px; height: 40px; border-radius: 9px; object-fit: cover;
  background: #151729; border: 1px solid rgba(255, 255, 255, 0.06);
}
.wkl-top-play {
  position: absolute; left: 7px; top: 7px; width: 26px; height: 26px;
  background: rgba(8, 9, 18, 0.62); border-color: rgba(255, 255, 255, 0.3);
}
@media (hover: hover) {
  .wkl-top-play { opacity: 0; transition: opacity 120ms ease; }
  .wkl-top-row:hover .wkl-top-play, .wkl-top-play:focus-visible, .wkl-top-row.is-current .wkl-top-play { opacity: 1; }
}
.wkl-top-text { display: contents; }
.wkl-top-name { grid-column: 3 / 5; grid-row: 1; min-width: 0; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wkl-top-producer { grid-column: 3; grid-row: 2; font-size: 12px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wkl-top-plays { grid-column: 4; grid-row: 2; font-size: 12px; color: var(--wkl-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wkl-top-row .wkl-more { grid-column: 5; grid-row: 1 / 3; width: 26px; height: 26px; }

/* ── Playlists ────────────────────────────────────────────────────────── */
/* The old top bar (and its embedding-status panel) is hidden on every
   redesigned page — Home, Explore, Search, Create, Voice Studio, Dashboard
   and the other three Library pages, each through its own page styles in
   index.html; Playlists has no body class, so it matches them here (the
   page carries its own search). Shown, it would put that bar's artist-name
   intent chips and Exact / AI / Similar search modes over this page. The
   global player bar is left exactly as the app ships it on this page. */
body:has(.wkl-view-playlists) .topbar,
body:has(.wkl-view-playlist) .topbar,
body:has(.wkl-view-playlists) .embedding-status-panel,
body:has(.wkl-view-playlist) .embedding-status-panel { display: none !important; }

.wkl-root .wkl-menu-sep { height: 1px; margin: 5px 4px; background: rgba(160, 170, 255, 0.12); }
.wkl-root .wkl-menu-item.is-danger { color: #fda4af; }
.wkl-root .wkl-menu-item.is-danger:hover, .wkl-root .wkl-menu-item.is-danger:focus-visible { background: rgba(225, 29, 72, 0.16); color: #ffe4e6; }

.wkl-new-pl { height: 42px; padding: 0 18px; border-radius: 12px; }

/* Grid / list switch */
.wkl-seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px;
  border: 1px solid var(--wkl-border-2); background: var(--wkl-surface-3);
}
.wkl-seg-btn {
  width: 32px; height: 28px; border: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--wkl-muted);
}
.wkl-seg-btn svg { width: 16px; height: 16px; }
.wkl-seg-btn:hover { color: var(--wkl-text); }
.wkl-seg-btn[aria-pressed="true"] { background: rgba(139, 92, 246, 0.22); color: #fff; }

.wkl-pl-section { padding-bottom: 16px; }
.wkl-pl-body.is-loading { opacity: 0.6; transition: opacity 120ms ease; }
.wkl-pl-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 16px;
}
.wkl-pl-grid > li { min-width: 0; }
.wkl-pl-card {
  height: 100%;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 10px 12px;
  border-radius: 16px;
  background: var(--wkl-surface-2);
  border: 1px solid var(--wkl-border);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.wkl-pl-card:hover { border-color: rgba(139, 92, 246, 0.38); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); }
.wkl-pl-card:focus-within { border-color: rgba(139, 92, 246, 0.5); }
.wkl-pl-art { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.wkl-collage {
  display: grid; width: 100%; height: 100%;
  background: #11131f;
  overflow: hidden;
}
.wkl-collage.is-quad { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.wkl-collage-img, .wkl-collage .wkl-art-empty { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; background: #151729; }
.wkl-collage.is-empty {
  place-items: center; color: #c4b5fd;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(124, 58, 237, 0.4), transparent 60%),
    radial-gradient(120% 120% at 100% 100%, rgba(59, 130, 246, 0.28), transparent 60%),
    #15172b;
}
.wkl-collage.is-empty svg { width: 34%; height: 34%; opacity: 0.9; }
.wkl-pl-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 5, 12, 0.7));
}
.wkl-pl-play {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 42px; height: 42px;
  background: linear-gradient(180deg, #8b5cf6, #6d28d9); border-color: rgba(221, 214, 254, 0.45);
  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.45);
}
.wkl-pl-play:disabled { opacity: 0; pointer-events: none; }
@media (hover: hover) {
  .wkl-pl-play { opacity: 0; transform: translateY(4px); transition: opacity 140ms ease, transform 140ms ease; }
  .wkl-pl-card:hover .wkl-pl-play:not(:disabled), .wkl-pl-card:focus-within .wkl-pl-play:not(:disabled) { opacity: 1; transform: none; }
}
.wkl-pl-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 3px; }
.wkl-pl-title-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wkl-pl-name { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; font-weight: 750; }
.wkl-pl-name a {
  display: block; color: var(--wkl-text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wkl-pl-name a:hover { color: #fff; text-decoration: underline; text-decoration-color: rgba(180, 160, 255, 0.6); }
.wkl-pl-title-row .wkl-more { width: 26px; height: 26px; margin-right: -4px; }
.wkl-pl-meta, .wkl-pl-desc-line, .wkl-pl-time {
  margin: 0; font-size: 12.5px; color: var(--wkl-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wkl-pl-meta { color: #cfd2e3; }
.wkl-pl-time { font-size: 12px; color: var(--wkl-dim); }

/* List layout: one row per playlist. */
.wkl-pl-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.wkl-pl-grid.is-list .wkl-pl-card {
  flex-direction: row; align-items: center; gap: 14px;
  padding: 8px 12px 8px 8px; border-radius: 14px;
}
.wkl-pl-grid.is-list .wkl-pl-art { width: 60px; flex: none; border-radius: 10px; }
.wkl-pl-grid.is-list .wkl-pl-art::after { display: none; }
.wkl-pl-grid.is-list .wkl-pl-play { right: 11px; bottom: 11px; width: 38px; height: 38px; }
.wkl-pl-grid.is-list .wkl-pl-body {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 4px 16px;
}
.wkl-pl-grid.is-list .wkl-pl-title-row { display: contents; }
.wkl-pl-grid.is-list .wkl-pl-name { grid-column: 1; grid-row: 1; }
.wkl-pl-grid.is-list .wkl-pl-title-row .wkl-more { grid-column: 4; grid-row: 1; }
.wkl-pl-grid.is-list .wkl-pl-meta { grid-column: 2; grid-row: 1; }
.wkl-pl-grid.is-list .wkl-pl-time { grid-column: 3; grid-row: 1; }
.wkl-pl-grid.is-list .wkl-pl-desc-line { grid-column: 1 / 4; grid-row: 2; }

.wkl-pl-skel { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 16px; }
.wkl-pl-skel span { aspect-ratio: 0.78; border-radius: 16px; background: rgba(255, 255, 255, 0.035); animation: wkl-pulse 1.4s ease-in-out infinite; }

/* Empty state: no playlists at all */
.wkl-pl-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 64px 16px 56px;
}
.wkl-pl-empty-icon {
  position: relative;
  width: 104px; height: 104px; margin-bottom: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 24px; color: #c4b5fd;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.32), rgba(38, 30, 84, 0.6));
  border: 1px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 18px 50px rgba(109, 40, 217, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.wkl-pl-empty-icon > svg { width: 48px; height: 48px; }
.wkl-spark { position: absolute; color: #a78bfa; }
.wkl-spark svg { width: 100%; height: 100%; }
.wkl-spark-a { width: 16px; height: 16px; left: -30px; top: -10px; }
.wkl-spark-b { width: 13px; height: 13px; right: -34px; top: 66px; color: #8b9cff; }
.wkl-pl-empty-title { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.wkl-pl-empty .wkl-empty-text { font-size: 15px; max-width: 560px; }
.wkl-pl-benefits {
  list-style: none; margin: 34px 0 32px; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); gap: 28px;
}
.wkl-pl-benefits li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wkl-pl-benefit-icon {
  width: 46px; height: 46px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #c4b5fd;
  background: rgba(124, 58, 237, 0.2); border: 1px solid rgba(139, 92, 246, 0.35);
}
.wkl-pl-benefit-icon svg { width: 21px; height: 21px; }
.wkl-pl-benefit-title { font-size: 15px; font-weight: 750; color: #fff; }
.wkl-pl-benefit-text { font-size: 13px; color: var(--wkl-muted); line-height: 1.45; }
.wkl-pl-empty-cta { height: 46px; padding: 0 26px; border-radius: 12px; font-size: 14.5px; }

/* One playlist */
.wkl-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; }
.wkl-back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px 6px 4px; border-radius: 10px;
  color: var(--wkl-muted); text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.wkl-back svg { width: 18px; height: 18px; }
.wkl-back:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.wkl-pl-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 24px; align-items: end;
  padding: 22px;
  border-radius: var(--wkl-radius-lg);
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
    radial-gradient(100% 140% at 0% 100%, rgba(124, 58, 237, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(19, 20, 38, 0.92), rgba(11, 12, 24, 0.92));
  border: 1px solid rgba(139, 92, 246, 0.22);
}
.wkl-pl-hero-art { width: 176px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); }
.wkl-pl-hero-collage.is-loading { animation: wkl-pulse 1.4s ease-in-out infinite; }
.wkl-pl-hero-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wkl-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wkl-violet-3); }
.wkl-pl-title { font-size: 36px; overflow-wrap: anywhere; }
.wkl-pl-desc { margin: 0; color: #cfd2e3; font-size: 14px; max-width: 70ch; overflow-wrap: anywhere; }
.wkl-pl-facts { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13px; color: var(--wkl-muted); }
.wkl-pl-facts span + span::before { content: "·"; margin: 0 8px; color: var(--wkl-dim); }
.wkl-pl-facts span:first-child { color: var(--wkl-text); font-weight: 650; }
.wkl-pl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.wkl-pl-actions .wkl-btn { height: 40px; }
.wkl-pl-actions .wkl-btn-primary { padding: 0 20px; }
.wkl-pl-actions .wkl-more { width: 40px; height: 40px; border-radius: 11px; border-color: var(--wkl-border-2); background: var(--wkl-surface); }

.wkl-pl-notice {
  display: flex; align-items: center; gap: 12px;
  margin: -4px 0 12px; padding: 8px 8px 8px 14px;
  border-radius: 12px; font-size: 13px;
  background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.3);
}
.wkl-pl-notice > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkl-pl-notice b { font-weight: 650; }

/* Playlist rows: a grip for dragging, a remove button, drop markers. */
.wkl-view-playlist .wkl-c-index { width: 46px; }
.wkl-view-playlist .wkl-c-wave { width: 84px; }
.wkl-view-playlist .wkl-c-producer { width: 104px; }
.wkl-view-playlist .wkl-c-actions { width: 148px; }   /* five 28px buttons (+ remove) */
.wkl-grip { display: inline-block; width: 14px; height: 18px; margin: 0 2px 0 -4px; vertical-align: middle; color: var(--wkl-dim); cursor: grab; }
.wkl-grip svg { width: 14px; height: 18px; }
.wkl-idx { vertical-align: middle; }
@media (hover: hover) {
  .wkl-grip { opacity: 0; transition: opacity 120ms ease; }
  .wkl-row:hover .wkl-grip, .wkl-row:focus-within .wkl-grip { opacity: 1; }
}
.wkl-row.is-dragging td { opacity: 0.45; }
.wkl-row.is-drop-before td { box-shadow: inset 0 2px 0 var(--wkl-violet-2); }
.wkl-row.is-drop-after td { box-shadow: inset 0 -2px 0 var(--wkl-violet-2); }
.wkl-remove:hover { color: #fecdd3; background: rgba(225, 29, 72, 0.14); border-color: rgba(225, 29, 72, 0.3); }

/* Dialogs: playlist name form, Add to playlist picker */
.wkl-form { display: flex; flex-direction: column; gap: 14px; }
.wkl-form-field { display: flex; flex-direction: column; gap: 6px; }
.wkl-form-label { font-size: 13px; font-weight: 650; color: #d5d7e6; }
.wkl-root .wkl-form input, .wkl-root .wkl-form textarea, .wkl-root .wkl-pick-new input, .wkl-root .wkl-pick-search input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--wkl-border-2); background: var(--wkl-surface-3); color: var(--wkl-text);
  font-size: 14px; outline: none; resize: vertical;
}
.wkl-root .wkl-form input:focus, .wkl-root .wkl-form textarea:focus,
.wkl-root .wkl-pick-new input:focus, .wkl-root .wkl-pick-search input:focus {
  border-color: rgba(139, 92, 246, 0.6); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}
.wkl-form .wkl-field-error { margin: -4px 0 0; }
.wkl-form .wkl-dialog-actions { margin-top: 4px; }
.wkl-dialog.wkl-dialog-form, .wkl-dialog.wkl-dialog-pick { width: min(460px, 100%); }
.wkl-pick-sample {
  display: flex; align-items: center; gap: 8px; margin: -2px 0 14px;
  color: var(--wkl-muted); font-size: 13px; min-width: 0;
}
.wkl-pick-sample-icon { width: 16px; height: 16px; flex: none; color: var(--wkl-violet-3); }
.wkl-pick-sample-icon svg { width: 16px; height: 16px; }
.wkl-pick-sample-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wkl-text); font-weight: 600; }
.wkl-pick-search { margin-bottom: 10px; }
.wkl-pick-list { display: flex; flex-direction: column; gap: 4px; max-height: min(320px, 44vh); overflow-y: auto; margin: 0 -4px; padding: 2px 4px; }
.wkl-pick-item {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; padding: 7px 10px 7px 7px; border-radius: 12px; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--wkl-text);
}
.wkl-pick-item:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--wkl-border); }
.wkl-pick-item.is-on { background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.35); }
.wkl-pick-item:disabled { opacity: 0.6; cursor: progress; }
.wkl-pick-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #c4b5fd; background: rgba(124, 58, 237, 0.18);
}
.wkl-pick-icon svg { width: 18px; height: 18px; }
.wkl-pick-text { display: flex; flex-direction: column; min-width: 0; }
.wkl-pick-name { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkl-pick-count { font-size: 12px; color: var(--wkl-muted); }
.wkl-pick-state { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--wkl-muted); }
.wkl-pick-state svg { width: 14px; height: 14px; }
.wkl-pick-item.is-on .wkl-pick-state { color: var(--wkl-violet-3); }
.wkl-pick-none { padding: 10px 4px; }
.wkl-pick-new { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--wkl-border); }
.wkl-pick-new .wkl-btn { height: 40px; flex: none; }
.wkl-dialog-pick .wkl-field-error { margin: 8px 0 0; }

/* ── Responsive ───────────────────────────────────────────────────────── */
/* Wide: one rail for every view — same width, and it stays in view while
   the list scrolls; a rail taller than the viewport scrolls on its own. */
@media (min-width: 1360px) {
  .wkl-rail {
    max-height: calc(100vh - var(--wkl-player-h) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 170, 255, 0.18) transparent;
  }
  /* Compact panels, so a 900px-tall window shows every panel whole. */
  .wkl-rail, .wkl-rail .wkl-insights { gap: 12px; }
  .wkl-rail .wkl-panel { padding: 14px 16px; }
  .wkl-rail .wkl-panel-head { margin-bottom: 10px; }
  .wkl-rail .wkl-field { padding: 5px 0; }
  .wkl-rail .wkl-field-bpm { gap: 4px; }
  .wkl-root .wkl-rail .wkl-field select, .wkl-root .wkl-rail .wkl-field input[type="text"] { height: 30px; }
  .wkl-rail .wkl-filter-form .wkl-btn-block, .wkl-rail .wkl-filter-buttons { margin-top: 10px; }
  .wkl-rail .wkl-filter-form .wkl-btn { height: 36px; }
  .wkl-view-fav .wkl-rail .wkl-assist-note { display: none; }
  .wkl-view-recent .wkl-rail .wkl-bars { height: 72px; margin-top: 8px; }
  .wkl-view-recent .wkl-rail .wkl-top-row { padding: 4px; grid-template-columns: 12px 36px minmax(0, 1fr) auto 26px; }
  .wkl-view-recent .wkl-rail .wkl-top-art { width: 36px; height: 36px; }
}
/* Shorter wide windows: three Top Played rows in the rail, as in the
   drawer layout ("View all" lists the rest). */
@media (min-width: 1360px) and (max-height: 940px) {
  .wkl-view-recent .wkl-rail .wkl-top-row:nth-child(n+4) { display: none; }
}
/* Short windows (1280x800): flatter Best Matches art so the list shows
   above the player bar. */
@media (max-height: 860px) {
  .wkl-card-art { aspect-ratio: 16 / 10; }
  .wkl-best { padding: 14px 16px; }
}
/* Rail inline: cards are ~150px wide; flatter art keeps the card height
   now that titles take two lines. */
@media (min-width: 1360px) {
  .wkl-card-art { aspect-ratio: 16 / 10; }
}
/* On the flatter art the play is smaller and centred in the space above
   the ≈ / waveform / duration row (6px + 26px), so the two never meet
   (clear for art 70px tall and up). */
@media (max-height: 860px), (min-width: 1360px) {
  .wkl-card-play { top: calc((100% - 32px) / 2); width: 38px; height: 38px; }
  .wkl-card-foot { bottom: 6px; }
}
/* Narrower main column (e.g. 1366 wide with the rail inline): shed the
   least important columns first. The waveform goes before the name is
   squeezed: on most rows it is only a placeholder line (no decoded peaks). */
@container wklmain (max-width: 860px) {
  .wkl-table .wkl-c-wave { display: none; }
}
/* All Samples at 600-860px: four whole Best Matches instead of a fifth cut
   off at the edge (Favorites' Play Similar row keeps its sideways scroll). */
@container wklmain (min-width: 600px) and (max-width: 860px) {
  .wkl-view-all [data-wkl-best] { grid-auto-columns: minmax(0, 1fr); }
  .wkl-view-all [data-wkl-best] > .wkl-card:nth-child(n+5) { display: none; }
}
@container wklmain (max-width: 760px) {
  .wkl-table .wkl-c-added, .wkl-table .wkl-c-duration { display: none; }
  .wkl-hero { grid-template-columns: minmax(0, 1fr); }
  .wkl-hero-art { display: none; }
}
@container wklmain (max-width: 640px) {
  .wkl-insights-main .wkl-insights { grid-template-columns: minmax(0, 1fr); }
}
@container wklmain (max-width: 640px) {
  .wkl-list-head { flex-direction: column; align-items: stretch; }
  .wkl-list-tools { justify-content: flex-start; }
}
@container wklmain (max-width: 520px) {
  .wkl-table .wkl-c-producer, .wkl-table .wkl-c-index { display: none; }
  .wkl-actions .wkl-similar, .wkl-actions .wkl-create { display: none !important; }
  .wkl-c-actions { width: 70px; }
  .wkl-c-key { width: 70px; }
}
/* Playlists at narrower main-column widths. */
@container wklmain (max-width: 700px) {
  .wkl-pl-hero { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 16px; align-items: center; }
  .wkl-pl-hero-art { width: 120px; }
  .wkl-pl-title { font-size: 26px; }
  .wkl-pl-benefits { grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 26px 0; }
  .wkl-pl-grid.is-list .wkl-pl-body { grid-template-columns: minmax(0, 1fr) auto; }
  .wkl-pl-grid.is-list .wkl-pl-meta { grid-column: 1; grid-row: 2; }
  .wkl-pl-grid.is-list .wkl-pl-time, .wkl-pl-grid.is-list .wkl-pl-desc-line { display: none; }
  .wkl-pl-grid.is-list .wkl-pl-title-row .wkl-more { grid-column: 2; grid-row: 1 / 3; }
}
@container wklmain (max-width: 520px) {
  .wkl-view-playlist .wkl-c-actions { width: 100px; }
  .wkl-pl-hero { grid-template-columns: minmax(0, 1fr); }
  .wkl-pl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* Medium: the rail becomes a drawer opened from the Filters button. */
@media (max-width: 1359px) {
  .wkl-layout { grid-template-columns: minmax(0, 1fr); }
  .wkl-root .wkl-filters-toggle { display: inline-flex; }
  .wkl-rail {
    position: fixed;
    top: 0; right: 0;
    bottom: var(--wkl-player-h);
    width: min(360px, 92vw);
    z-index: 70;
    padding: 14px;
    overflow-y: auto;
    background: #0a0c17;
    border-left: 1px solid var(--wkl-border-2);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 200ms ease, visibility 0s linear 200ms;
  }
  .wkl-root.is-rail-open .wkl-rail { transform: none; visibility: visible; transition: transform 200ms ease; }
  .wkl-root .wkl-rail-close-row { display: flex; justify-content: flex-end; margin-bottom: -6px; }
  .wkl-root.is-rail-open .wkl-rail-backdrop {
    display: block !important;
    position: fixed; left: 0; right: 0; top: 0; bottom: var(--wkl-player-h);
    z-index: 69;
    background: rgba(3, 4, 10, 0.55);
  }
}
/* Small: single column, 16px gutters. */
@media (max-width: 720px) {
  .wkl-root { padding: 14px 16px var(--wkl-bottom-pad, calc(var(--wkl-player-h) + 28px)); }
  .wkl-h1 { font-size: 27px; }
  .wkl-head { align-items: flex-start; }
  .wkl-best, .wkl-list { padding-left: 12px; padding-right: 12px; }
  .wkl-search-go { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wkl-root *, .wkl-root *::before, .wkl-root *::after { animation: none !important; transition: none !important; }
}
