/*
 * Home (assets/wkx-home2.js). Every rule is scoped to .wkh-root, or to
 * body:has(.wkh-root) for the page-chrome adjustments Home needs while it is
 * mounted (the old Home's body.home-active rules are overridden only then),
 * so no other page is affected. The shared top bar keeps its own styles.
 */

/* ── Page chrome while Home is mounted ──────────────────────────────────── */
body:has(.wkh-root) { padding-right: 0 !important; }
body:has(.wkh-root) .session-panel,
body:has(.wkh-root) .profile-panel,
body:has(.wkh-root) .main > .topbar,
body:has(.wkh-root) .content-panel > .panel-header,
body:has(.wkh-root) #status,
body:has(.wkh-root) #mode,
body:has(.wkh-root) #note,
body:has(.wkh-root) .embedding-status-panel { display: none !important; }
/* The page frame is Create's (20px 28px, max 1440px), so the shared top bar
   sits in the same place on both; one clearance for the player, here. */
body.home-active:has(.wkh-root) .main { padding-top: 0 !important; padding-bottom: 0 !important; overflow: visible !important; }
body.home-active:has(.wkh-root) .workspace {
  display: block !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  min-height: 100vh;
  padding: 20px 28px calc(var(--player-height, 80px) + 24px) !important;
  background:
    radial-gradient(1100px 380px at 62% -120px, rgba(124, 92, 255, .16), transparent 70%),
    radial-gradient(700px 420px at 0% 0%, rgba(59, 130, 246, .07), transparent 70%),
    #06060b !important;
}
body.home-active:has(.wkh-root) .content-panel {
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}
body.home-active:has(.wkh-root) #results {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}
/* Short windows: Create's tighter top, as every page with the shared bar. */
@media (max-height: 940px) {
  body.home-active:has(.wkh-root) .workspace { padding-top: 16px !important; }
}
html:has(.wkh-root) { scroll-padding-bottom: calc(var(--player-height, 80px) + 16px); }

/* ── Tokens ─────────────────────────────────────────────────────────────── */
.wkh-root {
  --wkh-bg: #06060b;
  --wkh-panel: linear-gradient(180deg, rgba(20, 20, 40, .72), rgba(12, 12, 26, .78));
  --wkh-panel-solid: #0e0e1c;
  --wkh-border: rgba(150, 160, 255, .11);
  --wkh-border-strong: rgba(170, 160, 255, .22);
  --wkh-text: #f5f4ff;
  --wkh-text-2: rgba(226, 226, 245, .74);
  --wkh-muted: rgba(200, 202, 230, .56);
  --wkh-violet: #8b5cf6;
  --wkh-violet-2: #a78bfa;
  --wkh-violet-3: #c4b5fd;
  --wkh-blue: #3b82f6;
  --wkh-blue-2: #60a5fa;
  --wkh-pink: #ec4899;
  --wkh-amber: #f5b544;
  --wkh-radius: 16px;
  --wkh-radius-sm: 11px;
  --wkh-ease: cubic-bezier(.2, .7, .2, 1);
  container: wkh / inline-size;
  max-width: 1440px;
  margin: 0 auto;
  min-width: 0;
  color: var(--wkh-text);
  font-family: inherit;
}
.wkh-root *, .wkh-root *::before, .wkh-root *::after { box-sizing: border-box; }
.wkh-root [hidden] { display: none !important; }
.wkh-root h1, .wkh-root h2, .wkh-root h3, .wkh-root p { margin: 0; }
/* No specificity of its own (:where), so every .wkh-* button class below sets its own font.
   The community's rail widgets (wkx-rails.js) in the rail slots keep their own. */
.wkh-root :where(button:not(.wkh-rail-slot button)) { font: inherit; color: inherit; }
.wkh-root button:focus-visible, .wkh-root a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #0b0916, 0 0 0 4px rgba(167, 139, 250, .9);
}
/* ── Layout: My Progress beside the hero, the rest across both columns
      (with community rail widgets, the rail runs the full height); one
      column when narrow ─────────────────────────────────────────────────── */
.wkh-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas: "hero rail" "actions actions" "packs packs" "lower lower";
  gap: 14px;
  align-items: start;
}
.wkh-root.wkh-has-rails .wkh-grid { grid-template-areas: "hero rail" "actions rail" "packs rail" "lower rail"; }
.wkh-main { display: contents; }
.wkh-rail { grid-area: rail; align-self: stretch; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.wkh-progress { flex: 1 1 auto; }
.wkh-root.wkh-has-rails .wkh-rail { align-self: start; position: sticky; top: 16px; }
.wkh-root.wkh-has-rails .wkh-progress { flex: 0 0 auto; }
/* The community's My Progress (wkx-rails.js) stands in for Home's own card. */
.wkh-root .wkh-progress[hidden], .wkh-root .wkh-rail-slot[hidden] { display: none !important; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.wkh-card {
  position: relative;
  min-width: 0;
  padding: 14px 16px 12px;
  border: 1px solid var(--wkh-border);
  border-radius: var(--wkh-radius);
  background: var(--wkh-panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.wkh-sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wkh-sec-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.wkh-sec-head p { margin-top: 2px; color: var(--wkh-muted); font-size: 13px; line-height: 1.35; }
.wkh-link {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 4px 2px; border: 0; background: none; cursor: pointer;
  color: var(--wkh-violet-2) !important; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: color 160ms ease;
}
.wkh-link svg { width: 15px; height: 15px; transition: transform 180ms var(--wkh-ease); }
.wkh-link:hover { color: var(--wkh-violet-3) !important; }
.wkh-link:hover svg { transform: translateX(2px); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.wkh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 22px; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 700; letter-spacing: .005em; white-space: nowrap;
  transition: transform 160ms var(--wkh-ease), box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.wkh-btn svg { width: 18px; height: 18px; }
.wkh-btn-primary {
  border: 1px solid rgba(196, 181, 253, .55);
  background: linear-gradient(100deg, #9a6bff 0%, #7446ff 30%, #5f35ee 70%, #4f2bd8 100%);
  color: #fff !important;
  box-shadow: 0 10px 30px rgba(124, 92, 255, .42), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.wkh-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(124, 92, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .26); }
.wkh-btn-ghost {
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(10, 10, 22, .55);
  color: var(--wkh-text) !important;
  backdrop-filter: blur(6px);
}
.wkh-btn-ghost:hover { border-color: rgba(196, 181, 253, .5); background: rgba(30, 24, 60, .6); transform: translateY(-1px); }
.wkh-btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.wkh-hero {
  grid-area: hero;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  min-height: 214px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 34px;
  border: 1px solid var(--wkh-border-strong);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(6, 6, 14, .92) 0%, rgba(6, 6, 14, .62) 38%, rgba(6, 6, 14, .08) 72%, rgba(6, 6, 14, .35) 100%),
    linear-gradient(0deg, rgba(6, 6, 14, .65) 0%, transparent 45%),
    url("/assets/home-hero.webp") center 38% / cover no-repeat,
    #0a0916;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(124, 92, 255, .05);
}
/* The scene: an abstract skyline and studio desk (assets/home-hero-scene.svg,
   drawn shapes only), lit violet / blue, faded in from the copy's side. */
.wkh-hero::before {
  content: "";
  position: absolute; right: 0; bottom: 0; width: 64%; height: 86%;
  background: url("/assets/home-hero-scene.svg") right bottom / contain no-repeat;
  opacity: .62;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
  pointer-events: none;
}
.wkh-hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .55), rgba(96, 165, 250, .4), transparent);
  pointer-events: none;
}
.wkh-hero-copy { position: relative; z-index: 1; min-width: 0; max-width: 560px; }
.wkh-hero-kicker {
  color: rgba(236, 234, 255, .9);
  font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.wkh-hero-name {
  margin-top: 4px !important;
  font-size: clamp(34px, 3.4vw, 54px); font-weight: 700; line-height: 1.02; letter-spacing: -.035em;
  color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 6px 30px rgba(124, 92, 255, .35);
}
.wkh-hero-name:empty { display: none; }
.wkh-hero-sub { margin-top: 10px !important; color: var(--wkh-text-2); font-size: clamp(14px, 1.1vw, 16.5px); line-height: 1.5; }
.wkh-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.wkh-hero-quote {
  position: relative; z-index: 1; flex: 0 1 280px; align-self: flex-start; margin-top: 10px !important;
  color: rgba(240, 238, 255, .9); font-size: 19px; font-weight: 500; line-height: 1.4; text-align: right;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .7);
}

/* ── Shortcuts ─────────────────────────────────────────────────────────── */
.wkh-actions { grid-area: actions; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wkh-action {
  --wkh-tone: 139, 92, 246;
  position: relative; min-width: 0; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 8px 12px 12px; text-align: left; cursor: pointer;
  border: 1px solid rgba(var(--wkh-tone), .34); border-radius: 14px;
  background:
    radial-gradient(160px 90px at 0% 50%, rgba(var(--wkh-tone), .2), transparent 70%),
    linear-gradient(180deg, rgba(20, 18, 40, .82), rgba(11, 10, 24, .86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform 180ms var(--wkh-ease), border-color 180ms ease, box-shadow 180ms ease;
}
.wkh-action:hover { transform: translateY(-2px); border-color: rgba(var(--wkh-tone), .7); box-shadow: 0 12px 30px rgba(var(--wkh-tone), .18), inset 0 1px 0 rgba(255, 255, 255, .06); }
.wkh-action-library { --wkh-tone: 59, 130, 246; }
.wkh-action-voice { --wkh-tone: 236, 72, 153; }
.wkh-action-producers { --wkh-tone: 245, 181, 68; }
.wkh-action-icon {
  flex: 0 0 auto; align-self: center; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid rgba(var(--wkh-tone), .5);
  background: linear-gradient(145deg, rgba(var(--wkh-tone), .34), rgba(var(--wkh-tone), .1));
  color: #fff;
  box-shadow: 0 0 22px rgba(var(--wkh-tone), .3);
}
.wkh-action-icon svg { width: 23px; height: 23px; }
.wkh-action-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; }
.wkh-action-copy b { font-size: 13.5px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkh-action-copy span { color: var(--wkh-text-2); font-size: 11.5px; line-height: 1.3; }
.wkh-action-chev { flex: 0 0 auto; align-self: center; color: var(--wkh-muted); }
.wkh-action-chev svg { width: 13px; height: 13px; display: block; }

/* ── Recent Packs ──────────────────────────────────────────────────────── */
.wkh-packs { grid-area: packs; }
.wkh-pack-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.wkh-pack {
  min-width: 0; display: flex; flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .07); border-radius: 13px; overflow: hidden;
  background: rgba(8, 8, 18, .72);
  transition: transform 180ms var(--wkh-ease), border-color 180ms ease, box-shadow 180ms ease;
}
.wkh-pack:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, .38); box-shadow: 0 14px 30px rgba(0, 0, 0, .4); }
.wkh-pack.is-current { border-color: rgba(167, 139, 250, .6); }
.wkh-pack-art { position: relative; aspect-ratio: 2.4 / 1; overflow: hidden; background: linear-gradient(145deg, #1a1433, #0b0b1a); }
/* The app's own art, toned toward the page's violet / navy and faded into
   the card; full colour on hover and on the playing pack. */
.wkh-pack-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(70, 45, 170, .14) 0%, rgba(8, 8, 18, 0) 45%, rgba(8, 8, 18, .55) 100%);
}
.wkh-pack-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(.78) brightness(.9);
  transition: transform 400ms var(--wkh-ease), filter 220ms ease;
}
.wkh-pack:hover .wkh-pack-img { transform: scale(1.04); }
.wkh-pack:hover .wkh-pack-img, .wkh-pack.is-current .wkh-pack-img { filter: none; }
.wkh-pack-meta { display: flex; align-items: center; gap: 8px; padding: 7px 8px 0 10px; min-width: 0; }
.wkh-pack-text { min-width: 0; flex: 1 1 auto; }
.wkh-pack-name {
  font-size: 14px; font-weight: 700; line-height: 1.25; min-height: 2.5em; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.wkh-pack-by { margin-top: 2px !important; color: var(--wkh-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkh-pack-info { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 3px 10px 8px; color: var(--wkh-muted); font-size: 11.5px; }
.wkh-pack-of { margin-left: -3px; color: var(--wkh-text-2); white-space: nowrap; }
.wkh-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px;
  background: rgba(139, 92, 246, .16); border: 1px solid rgba(167, 139, 250, .22);
  color: var(--wkh-violet-3); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.wkh-pack-when { white-space: nowrap; }
.wkh-producer { color: var(--wkh-text-2) !important; text-decoration: none; }
.wkh-producer[href]:hover { color: #fff !important; text-decoration: underline; }

/* ── Play buttons ──────────────────────────────────────────────────────── */
.wkh-play {
  flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; cursor: pointer;
  background: rgba(10, 10, 22, .5); color: #fff;
  transition: transform 160ms var(--wkh-ease), background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.wkh-play svg { width: 16px; height: 16px; }
.wkh-play:hover { transform: scale(1.06); border-color: #fff; background: rgba(124, 92, 255, .5); }
.wkh-play.is-playing { background: var(--wkh-violet); border-color: var(--wkh-violet-3); box-shadow: 0 0 18px rgba(139, 92, 246, .6); }
.wkh-play-sm { width: 30px; height: 30px; }
.wkh-play-sm svg { width: 13px; height: 13px; }

/* ── Lists: Recently Played, Most Played This Week ─────────────────────── */
.wkh-lower { grid-area: lower; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.wkh-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wkh-row {
  position: relative; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 5px 6px; border-radius: 10px;
  transition: background-color 160ms ease;
}
.wkh-row:hover, .wkh-row:focus-within { background: rgba(255, 255, 255, .04); }
.wkh-row.is-current { background: rgba(139, 92, 246, .1); }
.wkh-row-art { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: linear-gradient(145deg, #1a1433, #0b0b1a); }
.wkh-row-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wkh-art-empty { display: block; width: 100%; height: 100%; }
.wkh-row-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.wkh-row-title { font-size: 13.5px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkh-row-sub { color: var(--wkh-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkh-row-sub .wkh-producer { color: var(--wkh-muted) !important; }
.wkh-row-sub .wkh-producer[href]:hover { color: #fff !important; }
/* ▶ sits right after the art and the time / plays and ⋯ at the right edge,
   so they line up row to row. A waveform (real peaks only, never a
   stand-in) takes its column between title and time only on a row the
   player has decoded; elsewhere the title has the room. */
.wkh-row-recent .wkh-row-main, .wkh-row-most .wkh-row-main { flex: 1 1 0; }
.wkh-wave { flex: 0 0 clamp(64px, 22%, 140px); height: 24px; color: var(--wkh-violet-2); border-radius: 2px; }
.wkh-row-recent .wkh-wave:not(.is-real) { display: none; }
.wkh-wave-svg { display: block; width: 100%; height: 100%; fill: currentColor; opacity: .85; }
.wkh-row.is-current .wkh-wave { color: var(--wkh-violet-3); }
.wkh-row-dur { flex: 0 0 38px; text-align: right; color: var(--wkh-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.wkh-rank {
  flex: 0 0 18px; text-align: center; color: var(--wkh-text-2); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.wkh-rank-1 { color: var(--wkh-amber); }
.wkh-plays { flex: 0 0 auto; min-width: 76px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; color: var(--wkh-text-2); font-size: 12px; white-space: nowrap; }
.wkh-plays svg { width: 14px; height: 14px; color: var(--wkh-violet-2); }
.wkh-plays b { color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wkh-plays span { color: var(--wkh-muted); }

/* ⋯ menu: the row's real actions */
.wkh-more-wrap { position: relative; flex: 0 0 auto; }
.wkh-more {
  width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--wkh-muted);
  transition: background-color 160ms ease, color 160ms ease;
}
.wkh-more svg { width: 18px; height: 18px; }
.wkh-more:hover, .wkh-more[aria-expanded="true"] { background: rgba(255, 255, 255, .08); color: #fff; }
.wkh-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 196px; padding: 6px; display: flex; flex-direction: column;
  border: 1px solid var(--wkh-border-strong); border-radius: 12px;
  background: #15132a; box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.wkh-menu button {
  display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  text-align: left; color: var(--wkh-text); font-size: 13px; white-space: nowrap;
}
.wkh-menu button:hover, .wkh-menu button:focus-visible { background: rgba(139, 92, 246, .2); box-shadow: none; }

/* ── Empty / error / loading ───────────────────────────────────────────── */
.wkh-empty {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 16px; border: 1px dashed rgba(255, 255, 255, .12); border-radius: 12px;
  color: var(--wkh-text-2); font-size: 13.5px;
}
.wkh-skel .wkh-row-art, .wkh-skel.wkh-pack .wkh-pack-art, .wkh-skel-line {
  background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .08), rgba(255, 255, 255, .04)) 0 0 / 200% 100%;
  animation: wkh-shimmer 1.4s linear infinite;
}
.wkh-skel-line { display: block; flex: 1 1 auto; height: 12px; margin: 10px 12px; border-radius: 6px; }
.wkh-skel.wkh-pack { min-height: 168px; }
.wkh-skel.wkh-pack .wkh-pack-art { aspect-ratio: 2.4 / 1; }
@keyframes wkh-shimmer { to { background-position: -200% 0; } }

/* ── My Progress ───────────────────────────────────────────────────────── */
.wkh-me { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.wkh-avatar {
  position: relative; flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center;
  border: 1px solid rgba(167, 139, 250, .5);
  background: linear-gradient(145deg, #7c5cff, #3b2bb8 60%, #1e3a8a);
  box-shadow: 0 0 22px rgba(124, 92, 255, .35);
  color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .02em;
}
.wkh-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wkh-me-main { min-width: 0; flex: 1 1 auto; }
/* One line each, whatever the name or rank: they shorten, never wrap. */
.wkh-me-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wkh-me-who { min-width: 0; font-size: 17px; font-weight: 700; line-height: 1.2; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkh-me-rank {
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(167, 139, 250, .28); background: rgba(139, 92, 246, .12);
  color: var(--wkh-text-2); font-size: 11px; font-weight: 600;
}
.wkh-me-level {
  margin-top: 3px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 8px; min-width: 0;
  color: var(--wkh-violet-3); font-size: 15px; font-weight: 700; white-space: nowrap;
}
.wkh-me-xp { flex: 0 0 auto; color: var(--wkh-text-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wkh-me-scope { margin-top: 5px !important; color: var(--wkh-muted); font-size: 11px; line-height: 1.2; }
.wkh-xpbar { position: relative; height: 7px; margin-top: 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.wkh-xpbar b {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #7c5cff, #a78bfa 60%, #60a5fa);
  box-shadow: 0 0 14px rgba(139, 92, 246, .7);
  transition: width 600ms var(--wkh-ease);
}
.wkh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.wkh-stat {
  min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px; border-radius: 12px; text-align: center;
  border: 1px solid rgba(255, 255, 255, .07); background: rgba(8, 8, 20, .6);
}
.wkh-stat-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.wkh-stat-icon svg { width: 21px; height: 21px; }
.wkh-stat-plays .wkh-stat-icon { color: var(--wkh-violet-2); }
.wkh-stat-unique .wkh-stat-icon { color: var(--wkh-blue-2); }
.wkh-stat-fav .wkh-stat-icon { color: var(--wkh-pink); }
.wkh-stat-streak .wkh-stat-icon { color: #fb923c; }
.wkh-stat b { font-size: 16px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.wkh-stat > span:last-child {
  max-width: 100%; color: var(--wkh-muted); font-size: 10px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Medium (common laptop widths): the same layout, a narrower rail ───── */
@container wkh (max-width: 1180px) {
  .wkh-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
/* Beside the community rail (Home at 1440) the four shortcuts stay one row, as
   in the mockup, a little tighter: a smaller icon and no chevron. Up to
   1240 px: from 1181 px the rail is wider (320 px) and the full card cut
   "Explore Producers" to about 1225. The range syntax leaves no gap above
   the two-across rule (a fractional width under display scaling). */
@container wkh (1100px < width <= 1240px) {
  .wkh-root.wkh-has-rails .wkh-action { gap: 8px; padding: 11px 10px; }
  .wkh-root.wkh-has-rails .wkh-action-icon { width: 34px; height: 34px; border-radius: 10px; }
  .wkh-root.wkh-has-rails .wkh-action-icon svg { width: 19px; height: 19px; }
  .wkh-root.wkh-has-rails .wkh-action-chev { display: none; }
}
/* The quote needs the hero ~740 px wide (copy + quote): Home at 1440 still has it. */
@container wkh (max-width: 1100px) {
  .wkh-hero-quote { display: none; }
  .wkh-root.wkh-has-rails .wkh-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container wkh (max-width: 880px) {
  .wkh-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ── Narrow: one column, My Progress under the hero ───────────────────── */
@container wkh (max-width: 760px) {
  .wkh-grid, .wkh-root.wkh-has-rails .wkh-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .wkh-hero, .wkh-actions, .wkh-packs, .wkh-lower { grid-area: auto; }
  .wkh-rail, .wkh-root.wkh-has-rails .wkh-rail { display: contents; }
  .wkh-hero { order: 1; }
  .wkh-progress { order: 2; }
  .wkh-actions { order: 3; }
  .wkh-packs { order: 4; }
  .wkh-lower { order: 5; }
  .wkh-rail-slot { order: 6; }
  .wkh-rail-slot[data-wkh-rail="progress"] { order: 2; }
  .wkh-pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wkh-lower { grid-template-columns: minmax(0, 1fr); }
}
/* ── Small: one column ─────────────────────────────────────────────────── */
@container wkh (max-width: 640px) {
  .wkh-hero { padding: 26px 20px; min-height: 0; }
  .wkh-hero-kicker { font-size: 13px; }
  .wkh-actions, .wkh-root.wkh-has-rails .wkh-actions { grid-template-columns: minmax(0, 1fr); }
  .wkh-pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wkh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wkh-wave { display: none; }
  .wkh-card { padding: 16px 14px 14px; }
  .wkh-btn { white-space: normal; height: auto; min-height: 44px; padding: 10px 16px; text-align: center; }
  .wkh-hero-quote { display: none; }
  .wkh-hero::before { display: none; }
}
@container wkh (max-width: 420px) {
  .wkh-hero { padding: 18px 14px; }
  .wkh-hero-name { font-size: 32px; }
  .wkh-hero-ctas .wkh-btn { flex: 1 1 100%; }
  .wkh-pack-grid { grid-template-columns: minmax(0, 1fr); }
  .wkh-row-dur, .wkh-plays span, .wkh-plays svg, .wkh-row-art { display: none; }
  .wkh-plays { min-width: 0; }
  .wkh-row { gap: 6px; padding: 5px 2px; }
  /* (The shared bar wraps and compacts itself at this width: wkx-topbar.css.) */
  .wkh-sec-head { flex-wrap: wrap; }
  .wkh-link { white-space: normal; }
  .wkh-me { flex-wrap: wrap; }
}
@media (max-width: 820px) {
  body.home-active:has(.wkh-root) .workspace { padding: 16px 16px calc(var(--player-height, 80px) + 24px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .wkh-root *, .wkh-root *::before, .wkh-root *::after { transition: none !important; animation: none !important; }
}
