/* ============================================================================
   Verse Studio — projects (spec 2). Design plan 3: a 240 px sidebar beside a
   centred stage, a drawer under 1024 px, radii 10 / 6 / 999, the accent only on
   the primary action and the active place, no entrance motion.
   ============================================================================ */
.pj-workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; max-width: 1440px; margin: 0 auto; padding: 24px; align-items: start; }
.pj-drawer-btn { display: none; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--gray-mid); border-radius: 6px; background: var(--gray-dark); color: var(--text); font-size: 13px; cursor: pointer; }
.pj-drawer-overlay { display: none; }

.pj-sidebar { position: sticky; top: calc(var(--st-bar-h) + 16px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pj-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--gray-mid); border-radius: 10px; background: var(--gray-dark); color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; }
.pj-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-views { display: flex; flex-direction: column; gap: 2px; }
.pj-view { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text-soft); font-size: 14px; text-align: left; cursor: pointer; }
.pj-view:hover:not(:disabled) { background: var(--gray-mid); color: var(--text); }
.pj-view.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.pj-view:disabled { opacity: .45; cursor: default; }
.pj-view:focus-visible, .pj-sort:focus-visible, .pj-list-btn:focus-visible, .pj-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.pj-list-head { display: flex; flex-direction: column; gap: 8px; }
.pj-list-title { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pj-search { padding: 7px 10px; border-radius: 6px; font-size: 13px; }
.pj-sorts { display: flex; gap: 6px; }
.pj-sort { padding: 4px 10px; border: 1px solid var(--gray-mid); border-radius: 999px; background: none; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.pj-sort.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.pj-list { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.pj-list-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--text-soft); font-size: 13.5px; text-align: left; cursor: pointer; }
.pj-list-item.active .pj-list-btn { background: var(--gray-mid); color: var(--text); }
.pj-list-thumb { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 6px; overflow: hidden; background: var(--gray-mid); color: var(--text-muted); }
.pj-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pj-list-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-list-empty { padding: 6px 8px; font-size: 13px; }
.pj-error { font-size: 13px; color: var(--red-soft); }
.pj-side-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.pj-stage { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.pj-stage .st-headline { text-align: center; }
.pj-empty-line, .pj-loading { text-align: center; font-size: 14px; }
.pj-gate { max-width: 560px; margin: 0 auto; padding: 48px 24px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.pj-gate-title { font-size: 17px; font-weight: 600; }


/* The Home view (spec 2 §5): the showcase strip, the hosted composer, then every project. */
.pj-home { display: flex; flex-direction: column; gap: 20px; }
.pj-showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.pj-showcase-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pj-showcase-cover { aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--gray-dark); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.pj-showcase-cover img, .pj-showcase-out img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-showcase-out { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--gray-dark); }
.pj-showcase-refs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pj-showcase-ref { display: block; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--gray-mid); }
.pj-showcase-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pj-composer { display: flex; flex-direction: column; gap: 10px; max-width: 880px; width: 100%; margin: 0 auto; }
/* The Create pages float this composer over their gallery; on the project stage it stands in the column. */
.pj-composer .cr-composer { position: static; width: 100%; margin: 0; box-shadow: none; }
.pj-composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pj-kinds { display: inline-flex; padding: 2px; border: 1px solid var(--gray-mid); border-radius: 999px; }
.pj-kind { padding: 5px 14px; border: 0; border-radius: 999px; background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; }
.pj-kind.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.pj-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.pj-preset { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--gray-mid); border-radius: 6px; background: var(--gray-dark); color: var(--text-soft); font-size: 12.5px; cursor: pointer; }
.pj-preset.active { border-color: var(--accent); color: var(--text); }
.pj-preset-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--gray-mid); border-radius: 10px; background: var(--gray-dark); }
.pj-preset-option { padding: 5px 10px; border: 1px solid var(--gray-mid); border-radius: 999px; background: none; color: var(--text-soft); font-size: 12.5px; cursor: pointer; }
.pj-preset-option:hover, .pj-preset-option:focus-visible { border-color: var(--accent); color: var(--text); }
.pj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--gray-mid); border-radius: 999px; font-size: 12.5px; color: var(--text-soft); }
.pj-chip-x { display: inline-flex; border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 0; }
.pj-refcount { color: var(--text-muted); }
.pj-nomodel { text-align: center; font-size: 14px; }
.pj-preset:focus-visible, .pj-preset-option:focus-visible, .pj-kind:focus-visible, .pj-chip-x:focus-visible, .pj-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* The outputs row: four quiet buttons under the composer, wrapping into rows on a narrow stage. */
.pj-outputs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Home's Verse Vault block (2026-10-04): one quiet card in the composer's column. The progress bar is the Vault
   sheet's own (.sv-progress in studio-vault.css); no new colour, the accent stays with the composer. */
.pj-vault { display: flex; flex-direction: column; gap: 8px; max-width: 880px; width: 100%; margin: 0 auto; padding: 12px 14px; border: 1px solid var(--gray-mid); border-radius: 10px; background: var(--gray-dark); }
.pj-vault-head { display: flex; align-items: center; gap: 8px; }
.pj-vault-ic { display: inline-flex; color: var(--text-soft); }
.pj-vault-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.pj-vault-line { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-soft); }
.pj-vault-line svg { vertical-align: -2px; margin-right: 4px; }
.pj-vault-path { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.pj-vault-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-vault-actions .btn[aria-disabled="true"] { opacity: .55; cursor: progress; }
.pj-vault-actions .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 400px) { .pj-vault { padding: 10px; } .pj-vault-actions .btn { flex: 1 1 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .pj-vault .sv-progress-bar { transition: none; } }

.pj-mine { display: flex; flex-direction: column; gap: 12px; }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pj-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--gray-mid); border-radius: 10px; background: var(--gray-dark); color: var(--text); text-align: left; cursor: pointer; }
.pj-card-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--gray-mid); color: var(--text-muted); }
.pj-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-card-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-card-new { align-items: center; justify-content: center; gap: 10px; min-height: 180px; border-style: dashed; color: var(--text-soft); }
.pj-private { align-self: flex-start; padding: 2px 8px; border: 1px solid var(--gray-light); border-radius: 999px; font-size: 11px; color: var(--text-muted); }
.pj-more { display: flex; justify-content: center; }
@media (max-width: 1024px) {
  .pj-workspace { grid-template-columns: minmax(0, 1fr); }
  .pj-drawer-btn { display: inline-flex; justify-self: start; }
  /* visibility, not just the transform: a drawer parked off screen must leave the tab order and the
     accessibility tree, or every control in it is still reachable by Tab from the page behind it. */
  .pj-sidebar { position: fixed; top: var(--st-bar-h); bottom: 0; left: 0; z-index: 65; width: 280px; max-width: 86vw; padding: 16px; overflow-y: auto; background: var(--gray-dark); border-right: 1px solid var(--gray-mid); transform: translateX(-100%); visibility: hidden; }
  .pj-workspace.drawer-open .pj-sidebar { transform: none; visibility: visible; }
  .pj-workspace.drawer-open .pj-drawer-overlay { display: block; position: fixed; inset: var(--st-bar-h) 0 0 0; z-index: 64; background: rgba(0, 0, 0, .5); }
  .pj-list { max-height: none; }
  .pj-showcase { grid-template-columns: minmax(0, 1fr); }
  .pj-presets { margin-left: 0; }
}
@media (max-width: 400px) { .pj-workspace { padding: 16px; gap: 16px; } }
@media (prefers-reduced-motion: reduce) { .pj-sidebar { transition: none; } }

/* ---- My generations / My favorites: the Image page's masonry (4 px gaps, actions on hover or focus) ---- */
.pj-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-gallery { column-count: 4; column-gap: 4px; }
.pj-gen { break-inside: avoid; margin: 0 0 4px; border-radius: 10px; overflow: hidden; background: var(--gray-dark); }
.pj-gen-media img, .pj-gen-media video { width: 100%; display: block; }
.pj-gen-glyph { display: flex; align-items: center; justify-content: center; height: 120px; color: var(--text-muted); }
.pj-gen-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; }
.pj-gen-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-gen-status { font-size: 12px; color: var(--text-muted); }
.pj-gen-waiting { border: 1px solid var(--gray-mid); }
.pj-gen-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; opacity: 0; transition: opacity .12s ease; }
.pj-gen:hover .pj-gen-actions, .pj-gen:focus-within .pj-gen-actions { opacity: 1; }
.pj-gen-actions .btn-icon[aria-pressed="true"] { color: var(--accent); }
@media (max-width: 1100px) { .pj-gallery { column-count: 3; } }
@media (max-width: 760px) { .pj-gallery { column-count: 2; } }
/* A touch screen has no hover to reveal them with, so they are simply there. */
@media (hover: none) { .pj-gen-actions { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pj-gen-actions { transition: none; } }

/* ---- My elements: the cards, and the @ menu that offers them to the prompt ---- */
.pj-elements-wrap { display: flex; flex-direction: column; gap: 12px; }
.pj-elements-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-upload { position: relative; }
.pj-elements { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pj-element { position: relative; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 8px; border: 1px solid var(--gray-mid); border-radius: 10px; background: var(--gray-dark); }
.pj-element-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--gray-mid); color: var(--text-muted); }
.pj-element-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-element-cap { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.pj-element-name { font-size: 14px; font-weight: 600; }
.pj-element-type { align-self: flex-start; padding: 1px 8px; border: 1px solid var(--gray-light); border-radius: 999px; font-size: 11px; color: var(--text-muted); }
.pj-element-notes { font-size: 12.5px; color: var(--text-muted); max-height: 0; overflow: hidden; transition: max-height .12s ease; }
.pj-element:hover .pj-element-notes, .pj-element:focus-within .pj-element-notes { max-height: 4em; }
.pj-element-x { position: absolute; top: 6px; right: 6px; display: inline-flex; padding: 3px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
.pj-mention { position: relative; }
.pj-mention-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--gray-mid); border-radius: 10px; background: var(--gray-dark); }
.pj-mention-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--gray-mid); border-radius: 999px; background: none; color: var(--text-soft); font-size: 12.5px; cursor: pointer; }
.pj-mention-item img { width: 18px; height: 18px; border-radius: 999px; object-fit: cover; }
.pj-mention-item:hover { border-color: var(--gray-light); }
.pj-mention-item:focus-visible, .pj-element-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A touch screen has no hover to open the notes with, so they are simply there. */
@media (hover: none) { .pj-element-notes { max-height: 4em; } }
@media (max-width: 400px) { .pj-elements { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .pj-element-notes { transition: none; } }
