/*
 * Voice Studio (assets/wkx-voice.js shell + assets/wkx-voicestudio.js catalog).
 * Everything is scoped to .vx-page or body.voice-active. The --pt-* tokens
 * are the app's own (index.html defines them once, on :root); --vx-* adds
 * the few this page needs on top.
 * Motion: 150-250 ms transitions only; nothing animates continuously except
 * the active preview's waveform (canvas, redrawn only while it plays).
 */
.vx-page {
  --vx-blue: #60a5fa;
  --vx-blue-deep: #3b82f6;
  --vx-headline-gradient: linear-gradient(92deg, #c4b5fd 0%, #a78bfa 38%, #818cf8 66%, #60a5fa 100%);
  --vx-inspector-w: 340px;
  --vx-radius-card: 18px;        /* the voice cards (the spec's 18 px); panels use Create's --pt-radius-card */
}

/* Page: near-black / deep navy with one faint violet-blue horizon. Static.
   The top padding is Create's (20 px, 16 px on a short window), so the shared
   top bar doesn't shift between the two pages. */
body.voice-active .workspace {
  /* the bottom is short: .main already keeps 120 px clear of the player bar */
  padding: 20px 28px 24px !important;
  background:
    radial-gradient(1000px 300px at 62% -90px, rgba(124, 92, 255, .20), transparent 70%),
    radial-gradient(700px 320px at 100% 0%, rgba(59, 130, 246, .08), transparent 70%),
    radial-gradient(600px 340px at 0% 0%, rgba(91, 58, 255, .07), transparent 70%),
    #06060b !important;
}
@media (max-height: 940px) {
  body.voice-active .workspace { padding-top: 16px !important; }
}
@media (max-width: 820px) {
  body.voice-active .workspace { padding: 16px 16px 24px !important; }
}
/* The page scrolls with the window (.main is no scroll container, so the
   sticky inspector sticks) and the ⚙ Backend pill docks as on every page:
   both are the shared shell's (/assets/wkx-shell.css). */

/* An open details drawer keeps the pill off its content: it waits just left of the drawer
   (a phone's full-width sheet leaves room at its foot instead). */
@media (min-width: 641px) and (max-width: 1360px) {
  body.voice-active:has(.vx-inspector.is-open) #wk-backend-fab { right: calc(min(400px, 100vw) + 14px) !important; }
}

/* Create's shell width (body.create-active .create-shell), so the shared top bar sits at the same place on both pages. */
.vx-page { max-width: 1440px; margin: 0 auto; color: var(--pt-text-primary); color-scheme: dark; min-width: 0; }
/* Views fade in with opacity only: a transform (the shared panel-in animation)
   would become the containing block of the fixed inspector drawer. The fill is
   "backwards", never "both"/"forwards": a finished animation that keeps its
   value holds the pane in its own stacking context, which would trap the
   fixed drawer (z-index 320) under the global player bar. */
.vx-page .vs-pane { animation: vx-fade 200ms var(--pt-ease) backwards; }
@keyframes vx-fade { from { opacity: 0; } to { opacity: 1; } }
.vx-page [hidden] { display: none !important; }
.vx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vx-dim { color: var(--pt-text-muted); font-size: 12px; line-height: 1.5; }
.vx-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--pt-accent-bright); }

/* ── Header ─────────────────────────────────────────────────────────── */
/* The header heads the catalog column (the inspector starts level with it):
   the eyebrow and headline span the column; the subheading shares a row with
   the two actions (the text block's children join the header's grid). */
.vx-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: end; margin: 0 0 18px; }
.vx-head-text { display: contents; }
.vx-head .vx-eyebrow { grid-column: 1; grid-row: 1; align-self: center; }
.vx-head .vx-h1 { grid-column: 1 / -1; grid-row: 2; }
.vx-head .vx-sub { grid-column: 1; grid-row: 3; align-self: center; }
.vx-head .vx-head-actions { grid-column: 2; grid-row: 3; }
.vx-h1 { margin: 6px 0 8px; font-size: clamp(28px, 2.8vw, 42px); line-height: 1.06; font-weight: 850; letter-spacing: -.025em; color: var(--pt-text-primary); }
/* The voice engine's passive state, on the eyebrow's row (the shared top bar's pill is Create's song engine). */
.vx-engine { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--pt-border-subtle); background: rgba(12, 10, 22, .6); color: var(--pt-text-secondary);
  font-size: 11px; font-weight: 750; letter-spacing: .02em; white-space: nowrap; cursor: default; }
.vx-engine-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pt-text-muted); flex: 0 0 auto; }
.vx-engine-dot.is-on { background: var(--pt-success); box-shadow: 0 0 8px rgba(74, 222, 128, .7); }
.vx-engine-dot.is-wait, .vx-engine-dot.is-idle { background: var(--pt-warning); }
.vx-engine-dot.is-off { background: var(--pt-danger); }
@container vxcat (max-width: 700px) {
  .vx-head .vx-sub, .vx-head .vx-head-actions { grid-column: 1 / -1; grid-row: auto; }
  .vx-head .vx-head-actions { margin-top: 12px; }
}
@container vxcat (max-width: 420px) {
  .vx-head .vx-eyebrow, .vx-engine { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .vx-head .vx-h1 { grid-row: auto; }
  .vx-engine { margin-top: 8px; white-space: normal; height: auto; min-height: 24px; padding: 3px 10px; }
}
.vx-h1 .vx-grad { background: var(--vx-headline-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vx-sub { margin: 0; font-size: 15px; color: var(--pt-text-secondary); max-width: 680px; line-height: 1.5; min-width: 0; }
.vx-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vx-crumbs { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 13px; color: var(--pt-text-muted); }
.vx-crumbs b { color: var(--pt-text-primary); font-weight: 750; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.vx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--pt-radius-control); border: 1px solid var(--pt-border-strong); background: rgba(255, 255, 255, .04);
  color: var(--pt-text-primary); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; white-space: nowrap;
  transition: background-color var(--pt-dur) var(--pt-ease), border-color var(--pt-dur) var(--pt-ease), box-shadow var(--pt-dur) var(--pt-ease), transform var(--pt-dur) var(--pt-ease), filter var(--pt-dur) var(--pt-ease);
}
.vx-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vx-btn:hover:not(:disabled) { border-color: var(--pt-border-hover); background: rgba(124, 92, 255, .12); }
.vx-btn:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }
.vx-btn:disabled { opacity: .45; cursor: not-allowed; }
.vx-btn-primary { border-color: transparent; background: var(--pt-cta-gradient); color: #fff; box-shadow: var(--pt-glow-accent); }
.vx-btn-primary:hover:not(:disabled) { background: var(--pt-cta-gradient); filter: brightness(1.1); box-shadow: 0 10px 34px rgba(124, 92, 255, .5); }
.vx-btn-primary:disabled { box-shadow: none; filter: grayscale(.4); }
.vx-btn-ghost { background: rgba(255, 255, 255, .03); }
.vx-btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.vx-btn-block { width: 100%; height: 46px; font-size: 14px; }
.vx-btn-icon { width: 40px; padding: 0; }
.vx-btn-icon svg { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.vx-link { border: 0; background: none; color: var(--pt-accent-bright); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; padding: 4px 0; }
.vx-link:hover { text-decoration: underline; }
.vx-link:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); border-radius: 6px; }

/* ── Categories + filters ───────────────────────────────────────────── */
.vx-cats { display: flex; gap: 6px; flex-wrap: wrap; width: fit-content; max-width: 100%; box-sizing: border-box; padding: 6px; margin: 0 0 12px; border: 1px solid var(--pt-border-subtle); border-radius: 16px; background: rgba(12, 10, 22, .6); }
.vx-cat {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--pt-text-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background-color var(--pt-dur) var(--pt-ease), color var(--pt-dur) var(--pt-ease), box-shadow var(--pt-dur) var(--pt-ease);
}
.vx-cat:hover { color: var(--pt-text-primary); background: rgba(255, 255, 255, .04); }
.vx-cat.is-on { color: #fff; background: linear-gradient(135deg, rgba(124, 92, 255, .55), rgba(91, 58, 255, .42)); border-color: rgba(167, 139, 250, .5); box-shadow: 0 6px 22px rgba(124, 92, 255, .32); }
.vx-cat:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }
.vx-cat-n { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: inherit; font-variant-numeric: tabular-nums; }
.vx-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.vx-select { position: relative; display: inline-flex; align-items: center; }
.vx-select select {
  appearance: none; -webkit-appearance: none; height: 40px; padding: 0 32px 0 12px; min-width: 132px; border-radius: var(--pt-radius-control);
  border: 1px solid var(--pt-border-strong); background: rgba(14, 12, 26, .74); color: var(--pt-text-primary); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
  transition: border-color var(--pt-dur) var(--pt-ease);
}
.vx-select select:hover { border-color: rgba(255, 255, 255, .22); }
.vx-select select:focus-visible { outline: none; border-color: var(--pt-border-active); box-shadow: 0 0 0 3px rgba(124, 92, 255, .22); }
.vx-select select option { background: var(--pt-bg-menu); color: var(--pt-text-primary); }
.vx-select svg { position: absolute; right: 10px; width: 16px; height: 16px; fill: none; stroke: var(--pt-text-muted); stroke-width: 2; pointer-events: none; }
/* one row at a 1366 laptop's column (the search keeps ~140 px); wraps below that */
.vx-filters-end { display: flex; gap: 8px; align-items: center; flex: 1 1 190px; min-width: 0; }
.vx-search { flex: 1 1 auto; min-width: 0; max-width: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--pt-radius-control); border: 1px solid var(--pt-border-strong); background: rgba(14, 12, 26, .74); }
.vx-search:focus-within { border-color: var(--pt-border-active); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2); }
.vx-search svg { width: 16px; height: 16px; fill: none; stroke: var(--pt-text-muted); stroke-width: 2; flex: 0 0 auto; }
.vx-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--pt-text-primary); font: inherit; font-size: 13px; }
.vx-layout { display: inline-flex; gap: 4px; margin-left: auto; padding: 3px; border-radius: 12px; border: 1px solid var(--pt-border-subtle); background: rgba(12, 10, 22, .6); }
.vx-layout button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--pt-text-muted); cursor: pointer; display: grid; place-items: center; transition: background-color var(--pt-dur) var(--pt-ease), color var(--pt-dur) var(--pt-ease); }
.vx-layout button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.vx-layout button[aria-pressed="true"] { background: var(--pt-accent); color: #fff; box-shadow: 0 4px 14px rgba(124, 92, 255, .4); }
.vx-layout button:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }

/* ── Catalog + inspector ────────────────────────────────────────────── */
.vx-main { display: grid; grid-template-columns: minmax(0, 1fr) var(--vx-inspector-w); gap: 20px; align-items: start; }
.vx-list-col { min-width: 0; container: vxcat / inline-size; }
/* Sticky beside the grid; its height leaves the 16 px above it and the 144 px
   the page keeps below its content (.main's 120 px player reserve + 24 px), so
   it is whole on screen from the top of the page to the bottom. */
.vx-inspector { position: sticky; top: 16px; min-width: 0; max-height: calc(100vh - 160px); overflow-y: auto; scrollbar-width: thin;
  border: 1px solid var(--pt-border-card); border-radius: 20px; background: var(--pt-bg-card); box-shadow: var(--pt-shadow-card); }
/* The packaged app's own 32 px title bar (body.has-titlebar) sits above everything: stick below it. */
body.has-titlebar .vx-inspector { top: calc(var(--titlebar-h, 32px) + 16px); max-height: calc(100vh - var(--titlebar-h, 32px) - 160px); }
.vx-drawer-close { display: none; }
.vx-scrim { display: none; }

.vx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@container vxcat (max-width: 900px) { .vx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container vxcat (max-width: 640px) { .vx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container vxcat (max-width: 400px) { .vx-grid { grid-template-columns: minmax(0, 1fr); } }
.vx-cell { min-width: 0; display: flex; }
.vx-count { margin: 14px 2px 0; }
.vx-more-row { display: flex; justify-content: center; margin: 16px 0 0; }

/* Card: near-black, subtle violet border; hover lifts; selected glows. */
.vx-card {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: var(--vx-radius-card);
  border: 1px solid var(--pt-border-card); background: linear-gradient(180deg, rgba(20, 17, 34, .92), rgba(10, 9, 18, .96));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); cursor: pointer; outline: none;
  transition: transform var(--pt-dur) var(--pt-ease), border-color var(--pt-dur) var(--pt-ease), box-shadow var(--pt-dur) var(--pt-ease);
}
.vx-card:hover { transform: translateY(-2px); border-color: var(--pt-border-hover); box-shadow: 0 16px 40px rgba(0, 0, 0, .45), 0 0 0 1px rgba(167, 139, 250, .12), 0 0 24px rgba(124, 92, 255, .14); }
.vx-card:focus-visible { box-shadow: var(--pt-focus-ring); }
.vx-card.is-selected { border-color: rgba(167, 139, 250, .95); box-shadow: 0 0 0 1px rgba(167, 139, 250, .55), 0 0 28px rgba(124, 92, 255, .38), 0 16px 40px rgba(0, 0, 0, .45); }
.vx-card.is-muted .vx-card-art svg { filter: saturate(.35) brightness(.7); }
.vx-card-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: calc(var(--vx-radius-card) - 1px) calc(var(--vx-radius-card) - 1px) 0 0; background: #0b0a14; }
.vx-card-art .vx-art-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform 220ms var(--pt-ease); }
.vx-card:hover .vx-card-art .vx-art-svg { transform: scale(1.02); }
.vx-card-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(8, 7, 14, .85)); pointer-events: none; }
.vx-card-art .vx-status { position: absolute; top: 10px; left: 10px; z-index: 1; }
.vx-card-art .vx-heart { position: absolute; top: 6px; right: 6px; z-index: 1; }
.vx-card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); z-index: 1; }
.vx-card-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--pt-accent), var(--vx-blue)); }
.vx-card-body { display: flex; flex-direction: column; gap: 5px; padding: 8px 12px 12px; min-width: 0; flex: 1; }
/* The status chip sits on the art in the grid; the list layout shows the body's copy instead. */
.vx-card-body > .vx-status { display: none; }
.vx-card-name { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -30px; position: relative; z-index: 1; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
/* up to two lines: a same-name voice's "Created …" chip moves to the second line whole rather than being cut */
.vx-card-meta { font-size: 11.5px; line-height: 1.5; color: var(--pt-text-muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.vx-dup { display: inline-block; white-space: nowrap; margin-left: 3px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--pt-text-muted); font-size: 10.5px; font-weight: 700; line-height: 1.6; }
.vx-card-actions { position: relative; display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 4px; }

.vx-tags { display: flex; gap: 5px; flex-wrap: wrap; min-width: 0; }
.vx-tags span { font-size: 10.5px; font-weight: 750; padding: 2px 8px; border-radius: 7px; background: rgba(124, 92, 255, .16); color: #d6ccff; border: 1px solid rgba(167, 139, 250, .18); white-space: nowrap; }

/* One status per voice. */
.vx-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  background: rgba(8, 7, 14, .72); border: 1px solid rgba(255, 255, 255, .12); color: var(--pt-text-secondary); backdrop-filter: blur(6px); white-space: nowrap; }
.vx-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vx-tone-ok { color: #86efac; border-color: rgba(74, 222, 128, .38); }
.vx-tone-ok i { box-shadow: 0 0 8px rgba(74, 222, 128, .8); }
.vx-tone-live { color: #c4b5fd; border-color: rgba(167, 139, 250, .45); }
.vx-tone-info { color: #93c5fd; border-color: rgba(96, 165, 250, .42); }
.vx-tone-warn { color: #fcd34d; border-color: rgba(251, 191, 36, .4); }
.vx-tone-bad { color: #fca5a5; border-color: rgba(248, 113, 113, .42); }
.vx-tone-muted { color: var(--pt-text-muted); }

.vx-heart { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(8, 7, 14, .55); color: rgba(255, 255, 255, .82); cursor: pointer; display: grid; place-items: center;
  transition: color var(--pt-dur) var(--pt-ease), background-color var(--pt-dur) var(--pt-ease), transform var(--pt-dur) var(--pt-ease); }
.vx-heart svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.vx-heart:hover { background: rgba(124, 92, 255, .35); color: #fff; }
.vx-heart.is-on { color: #c4b5fd; }
.vx-heart.is-on svg { fill: currentColor; }
.vx-heart:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }

.vx-play { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--pt-dur) var(--pt-ease), border-color var(--pt-dur) var(--pt-ease), transform var(--pt-dur) var(--pt-ease); }
.vx-play svg { width: 15px; height: 15px; fill: currentColor; }
.vx-play:hover:not(:disabled) { background: var(--pt-accent); border-color: transparent; transform: scale(1.05); }
.vx-play.is-playing { background: var(--pt-accent); border-color: transparent; }
.vx-play:disabled { opacity: .35; cursor: not-allowed; }
.vx-play:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }
.vx-play-lg { width: 48px; height: 48px; border: 0; background: #fff; color: #120f22; }
.vx-play-lg svg { width: 18px; height: 18px; }
.vx-play-lg:hover:not(:disabled) { background: #fff; color: #120f22; }
.vx-play-lg.is-playing { background: var(--pt-accent); color: #fff; }

.vx-use { flex: 1; min-width: 0; height: 36px; border-radius: 11px; border: 1px solid var(--pt-border-strong); background: rgba(255, 255, 255, .04); color: var(--pt-text-primary);
  font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color var(--pt-dur) var(--pt-ease), border-color var(--pt-dur) var(--pt-ease), filter var(--pt-dur) var(--pt-ease); }
.vx-use.is-primary { border-color: rgba(167, 139, 250, .4); background: linear-gradient(135deg, rgba(124, 92, 255, .5), rgba(91, 58, 255, .38)); color: #fff; }
.vx-use:hover:not(:disabled) { border-color: var(--pt-border-hover); filter: brightness(1.15); }
.vx-use:disabled { opacity: .4; cursor: not-allowed; }
.vx-use:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }
.vx-more { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; border: 1px solid var(--pt-border-strong); background: rgba(255, 255, 255, .03); color: var(--pt-text-secondary); cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--pt-dur) var(--pt-ease), color var(--pt-dur) var(--pt-ease); }
.vx-more svg { width: 17px; height: 17px; fill: currentColor; }
.vx-more:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.vx-more:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }

.vx-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 188px; padding: 6px; border-radius: 14px; border: 1px solid rgba(167, 139, 250, .28);
  background: var(--pt-bg-menu); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); display: grid; gap: 2px; animation: vx-pop 160ms var(--pt-ease) both; }
.vx-menu-item { text-align: left; border: 0; border-radius: 9px; background: transparent; color: var(--pt-text-primary); font: inherit; font-size: 13px; font-weight: 650; padding: 9px 12px; cursor: pointer; }
.vx-menu-item:hover, .vx-menu-item:focus-visible { background: rgba(124, 92, 255, .2); outline: none; }
.vx-menu-item.is-danger { color: #fca5a5; }
@keyframes vx-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* List layout: the same cards, one per row. */
.vx-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.vx-grid.is-list .vx-card { flex-direction: row; align-items: center; }
.vx-grid.is-list .vx-card-art { width: 64px; flex: 0 0 64px; aspect-ratio: 1; border-radius: calc(var(--vx-radius-card) - 1px) 0 0 calc(var(--vx-radius-card) - 1px); }
.vx-grid.is-list .vx-card-art .vx-heart,
.vx-grid.is-list .vx-card-art .vx-status { display: none; }
.vx-grid.is-list .vx-card-art::after { display: none; }
.vx-grid.is-list .vx-card-body { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; }
.vx-grid.is-list .vx-card-body > .vx-status { display: inline-flex; flex: 0 0 auto; }
/* a fixed share (no growing): every row's status chip starts at the same x */
.vx-grid.is-list .vx-card-name { margin: 0; flex: 0 0 34%; min-width: 0; text-shadow: none; }
.vx-grid.is-list .vx-tags { flex: 0 1 auto; flex-wrap: nowrap; overflow: hidden; }
.vx-grid.is-list .vx-card-meta { flex: 1 1 140px; min-width: 0; }
/* a same-name voice's date on its own line under the meta, without the "Created" word (its tooltip keeps it) */
.vx-grid.is-list .vx-dup { display: table; margin: 1px 0 0; }
.vx-grid.is-list .vx-dup-k { display: none; }
.vx-grid.is-list .vx-card-actions { margin: 0; padding: 0; flex: 0 0 auto; width: 180px; }
@container vxcat (max-width: 900px) {
  .vx-grid.is-list .vx-tags { display: none; }
}
@container vxcat (max-width: 640px) {
  .vx-grid.is-list .vx-card-meta { display: none; }
  .vx-grid.is-list .vx-card-actions { width: auto; }
}
@container vxcat (max-width: 440px) {
  .vx-grid.is-list .vx-card-body > .vx-status { display: none; }
}

/* Skeleton while the first list loads. */
.vx-card.is-skeleton { cursor: default; pointer-events: none; }
.vx-card.is-skeleton .vx-card-art { background: linear-gradient(135deg, rgba(124, 92, 255, .08), rgba(255, 255, 255, .02)); }
.vx-card.is-skeleton .vx-card-body i { display: block; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .06); }
.vx-card.is-skeleton .vx-card-body i + i { width: 60%; }

/* Empty */
.vx-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; border: 1px dashed var(--pt-border-card); border-radius: 20px; background: rgba(12, 10, 22, .45); }
.vx-empty-title { font-size: 17px; font-weight: 800; }
.vx-empty-orb, .vx-insp-empty-orb { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 45%), linear-gradient(135deg, #7c5cff, #3b82f6); box-shadow: 0 10px 30px rgba(124, 92, 255, .35); }

/* "Your last used voice": one slim row heading My Voices (the grid stays in view). */
.vx-featured { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 0 0 14px; padding: 10px 14px; border-radius: 18px;
  border: 1px solid rgba(167, 139, 250, .32); background: linear-gradient(120deg, rgba(124, 92, 255, .16), rgba(59, 130, 246, .06) 60%, rgba(10, 9, 18, .9)); box-shadow: var(--pt-shadow-card); }
.vx-featured-art { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; }
.vx-featured-art .vx-art-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vx-featured-body { min-width: 0; }
.vx-featured-name { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; font-size: 17px; font-weight: 850; letter-spacing: -.015em; margin: 2px 0 6px; }
.vx-featured-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-featured-name .vx-status { flex: 0 0 auto; }
/* one line of stats: a stat that doesn't fit wraps out of sight whole (never half-cut) */
.vx-featured-stats { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 0; max-height: 34px; overflow: hidden; }
.vx-featured-stats div { display: grid; gap: 1px; }
.vx-featured-stats dt { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pt-text-muted); white-space: nowrap; }
.vx-featured-stats dd { margin: 0; font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vx-featured-actions { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; }
@container vxcat (max-width: 640px) {
  .vx-featured { grid-template-columns: 96px minmax(0, 1fr); }
  .vx-featured-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}

/* Training / building progress card */
.vx-progress-card { margin: 0 0 16px; padding: 16px 18px; border-radius: 20px; border: 1px solid rgba(167, 139, 250, .35);
  background: linear-gradient(120deg, rgba(124, 92, 255, .14), rgba(10, 9, 18, .92)); display: grid; gap: 10px; }
.vx-progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.vx-progress-name { font-size: 18px; font-weight: 850; margin-top: 3px; }
.vx-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--pt-text-muted); }
.vx-steps li { display: flex; align-items: center; gap: 9px; }
.vx-steps li.done { color: var(--pt-text-secondary); }
.vx-steps li.on { color: var(--pt-text-primary); font-weight: 750; }
.vx-progress-pct { color: var(--pt-text-primary); font-variant-numeric: tabular-nums; }
/* a wide column lays the stages out in one row, so the card stays short */
@container vxcat (min-width: 700px) {
  .vx-steps { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
  .vx-steps li { min-width: 0; }
}
.vx-step-dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); color: #062a1d; }
.vx-steps li.done .vx-step-dot { background: var(--pt-success); border-color: transparent; }
.vx-steps li.on .vx-step-dot { background: var(--pt-accent); border-color: transparent; box-shadow: 0 0 10px rgba(124, 92, 255, .7); }
.vx-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.vx-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pt-accent), var(--vx-blue)); transition: width 250ms var(--pt-ease); }

/* ── Inspector ──────────────────────────────────────────────────────── */
.vx-insp { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 18px; }
.vx-insp-hero { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; }
.vx-insp-hero .vx-art-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vx-insp-hero .vx-status { position: absolute; left: 10px; bottom: 10px; }
.vx-insp-hero .vx-heart { position: absolute; top: 8px; right: 8px; }
.vx-insp-head { display: flex; flex-direction: column; gap: 7px; }
.vx-insp-name { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 850; letter-spacing: -.015em; overflow-wrap: anywhere; }
.vx-insp-sub { font-size: 12px; color: var(--pt-text-muted); margin-top: -4px; }
/* ▶ beside a full-width waveform, its time under the wave's right end (the mockup's player) */
.vx-player { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--pt-bg-inset); border: 1px solid var(--pt-border-subtle); }
.vx-player > .vx-play { grid-row: 1 / span 2; }
.vx-player .vx-time { grid-column: 2; justify-self: end; }
.vx-player.is-empty { display: flex; justify-content: center; min-height: 48px; }
.vx-wave { width: 100%; min-width: 0; height: 44px; display: block; cursor: pointer; }
.vx-time { font-size: 11px; color: var(--pt-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vx-player-note { font-size: 11px; color: var(--pt-text-muted); margin-top: -6px; line-height: 1.45; }
.vx-why { font-size: 12px; line-height: 1.5; color: var(--pt-text-secondary); padding: 9px 11px; border-radius: 11px; background: rgba(255, 255, 255, .035); border: 1px solid var(--pt-border-subtle); margin-top: -4px; }
.vx-insp-row { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.vx-insp-row .vx-btn:not(.vx-btn-icon) { flex: 1; }
/* The main action with ••• beside it, one row. */
.vx-insp-cta { position: relative; display: flex; gap: 8px; align-items: stretch; }
.vx-insp-cta .vx-btn-block { flex: 1; width: auto; min-width: 0; }
.vx-insp-cta .vx-btn-cta-icon { width: 46px; height: 46px; flex: 0 0 auto; }
.vx-insp-cta .vx-menu { bottom: auto; top: calc(100% + 6px); }
.vx-section { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--pt-border-subtle); }
.vx-section-title { margin: 0; font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; color: var(--pt-text-secondary); }
.vx-about { margin: 0; font-size: 13px; line-height: 1.55; color: var(--pt-text-secondary); overflow-wrap: anywhere; }
.vx-details { display: grid; gap: 7px; margin: 0; }
.vx-details div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.vx-details dt { color: var(--pt-text-muted); }
.vx-details dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vx-quality { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--pt-bg-inset); border: 1px solid var(--pt-border-subtle); }
.vx-quality-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--pt-text-muted); }
.vx-quality-top b { font-size: 18px; color: var(--pt-text-primary); font-variant-numeric: tabular-nums; }
.vx-meter { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.vx-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pt-accent), var(--vx-blue)); }
.vx-related { display: grid; gap: 6px; }
.vx-related-note { margin-top: -4px; }
.vx-related-item { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 12px; border: 1px solid var(--pt-border-subtle); background: rgba(255, 255, 255, .025); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--pt-dur) var(--pt-ease), background-color var(--pt-dur) var(--pt-ease); }
.vx-related-item:hover { border-color: var(--pt-border-hover); background: rgba(124, 92, 255, .08); }
.vx-related-item:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }
.vx-related-art { position: relative; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.vx-related-art .vx-art-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vx-related-text { display: grid; min-width: 0; }
.vx-related-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-related-sub { font-size: 11px; color: var(--pt-text-muted); }
.vx-insp-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 20px; }
.vx-insp-empty-title { font-size: 16px; font-weight: 800; }

/* Medium: the inspector becomes a drawer. Small: a full-width sheet. */
@media (max-width: 1360px) {
  .vx-main { grid-template-columns: minmax(0, 1fr); }
  /* an opaque surface (the translucent card colour let the catalog show through) */
  .vx-inspector { position: fixed; top: 0; right: 0; bottom: 0; z-index: 320; width: min(400px, 100vw); max-height: none; border-radius: 20px 0 0 20px;
    background: linear-gradient(180deg, #141122, #0a0912); box-shadow: -24px 0 60px rgba(0, 0, 0, .55);
    transform: translateX(105%); transition: transform 220ms var(--pt-ease); visibility: hidden; }
  .vx-inspector.is-open { transform: none; visibility: visible; }
  /* the last rows scroll clear of the floating ⚙ Backend pill */
  .vx-inspector .vx-insp { padding-bottom: 72px; }
  /* below the packaged app's title bar: its window buttons stay its own, the drawer's × stays reachable */
  body.has-titlebar .vx-inspector,
  body.has-titlebar .vx-scrim { top: var(--titlebar-h, 32px); max-height: none; }
  /* 8 px inside the art's top-right corner (the art is inset 14 / 16 px), mirroring the heart at its top-left */
  .vx-drawer-close { display: grid; place-items: center; position: sticky; top: 8px; margin: 22px 24px -58px auto; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--pt-border-strong); background: rgba(8, 7, 14, .8); color: #fff; font-size: 20px; cursor: pointer; }
  .vx-drawer-close:focus-visible { outline: none; box-shadow: var(--pt-focus-ring); }
  .vx-inspector .vx-insp-hero .vx-heart { right: auto; left: 8px; }      /* the close button sits top-right */
  .vx-scrim { display: block; position: fixed; inset: 0; z-index: 310; background: rgba(5, 4, 10, .55); backdrop-filter: blur(2px); }
}
@media (max-width: 640px) {
  .vx-inspector { width: 100vw; border-radius: 0; }
  .vx-cats { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .vx-cat { flex: 0 0 auto; }
  .vx-select select { min-width: 0; }
  .vx-filters .vx-select { flex: 1 1 140px; }
  .vx-filters .vx-select select { width: 100%; }
  .vx-filters-end { flex-basis: 100%; }
  .vx-search { max-width: none; min-width: 0; }
  .vx-head .vx-head-actions { width: 100%; }
  .vx-head-actions .vx-btn { flex: 1; }
}

/* ── Create Voice flow (shell) ──────────────────────────────────────── */
.vx-flow { display: flex; gap: 6px; list-style: none; margin: 0 0 18px; padding: 12px; border-radius: 18px; border: 1px solid var(--pt-border-card); background: rgba(12, 10, 22, .6); flex-wrap: wrap; }
.vx-flow li { flex: 1 1 120px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; font-size: 12.5px; font-weight: 750; color: var(--pt-text-muted); }
.vx-flow li .vx-flow-n { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.vx-flow li.is-done { color: var(--pt-text-secondary); }
.vx-flow li.is-done .vx-flow-n { background: var(--pt-success); color: #062a1d; border-color: transparent; }
.vx-flow li.is-on { color: #fff; background: rgba(124, 92, 255, .18); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .4); }
.vx-flow li.is-on .vx-flow-n { background: var(--pt-accent); border-color: transparent; color: #fff; }
.vx-flow-note { margin: -8px 0 16px; }
.vx-alt { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; font-size: 12.5px; color: var(--pt-text-muted); }
/* The dataset builder's form buttons (Continue / Cancel, Save as Reference Voice) in this page's button metrics. */
.vx-page #vsPane-create .vd-row-end .ct-generate,
.vx-page #vsPane-style .vd-row-end .ct-generate {
  width: auto; height: 40px; padding: 0 18px; border-radius: var(--pt-radius-control); font-size: 13px; font-weight: 750;
  letter-spacing: 0; text-transform: none; background: var(--pt-cta-gradient); box-shadow: var(--pt-glow-accent);
}
.vx-page #vsPane-create .vd-row-end .ct-act,
.vx-page #vsPane-style .vd-row-end .ct-act {
  height: 40px; padding: 0 16px; border-radius: var(--pt-radius-control); font-size: 13px; font-weight: 750;
  color: var(--pt-text-primary); border-color: var(--pt-border-strong); background: rgba(255, 255, 255, .04);
}
.vx-page #vsPane-create .vd-row-end .ct-act.primary,
.vx-page #vsPane-style .vd-row-end .ct-act.primary { border-color: transparent; background: var(--pt-cta-gradient); color: #fff; }
/* Entered from + Create Voice, the crumb above is the way back; the new-dataset form's own link would be a second one. */
.vx-page #vsPane-create[data-vd-view="new"] .vd-back { display: none; }

/* The saved-voice tools (voicelib) show only their dialogs until Manage voice is open. */
.vx-lib:not(.is-open) { padding: 0 !important; margin: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; min-height: 0 !important; }
.vx-lib:not(.is-open) > :not(.vl-modal-backdrop) { display: none !important; }
.vx-lib.is-opening > :not(.vl-modal-backdrop) { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .vx-card, .vx-card-art .vx-art-svg, .vx-btn, .vx-play, .vx-inspector, .vx-bar i { transition: none !important; }
  .vx-card:hover { transform: none; }
  .vx-card:hover .vx-card-art .vx-art-svg { transform: none; }
  .vx-menu { animation: none; }
}
